The catch isn't in that.:smile52:
In my opinion, such a function would work. It returns the index with the smallest value.
Assuming that the index of the argument passed to the function is the name of the city, and the value is the distance. That is, it will return the name of the nearest city (from those that were in the array).
DesiredCity = nil;
MinDistance = 999;
For i, city in array_of_cities do
Distance = (city_xyz - hero_xyz);
If Distance < MinDistance then
MinDistance = Distance
DesiredCity = City
End
End
This is the entire code for selecting the nearest city; all that remains is to translate it from "Olbansky" and add a couple of conditions. You can also add a filter for enemy affiliation (filtering allied players in the team) and immediately find the ID of the player who owns the object. Added 7 minutes later
For example, the reward will be calculated as if the treasure was cleared "at a level higher." Of course, in the case of treasure rooms at the maximum level, some special level will have to be introduced for the hero. Another option is a percentage increase in the reward (but there will be a problem with artifacts).
It is necessary to first compile a list of objects to which such an attitude will apply.
It's a hassle, so it's better to leave it for the second 32-bit version. I would like to release the alpha version of the first 32 new ones earlier, and then add up to 64. Therefore, the special feature will not disappear, but its implementation will be postponed to another time.
I remind you that the first date for the implementation of all 64 new heroes is December 21, 2012 - right before the end of the world :)
But, most likely, the date will be postponed slightly.
P.S. I would like to release the 32-bit version at the beginning of October; in principle, for the alpha, the presence of familiar icons is not very important (but they need to be made different so that they don't repeat, for example, temporarily borrowed from companion factions)
NHF 0.90 : NHF - группа в VK
Карты для HeroesV:
Путешествие , Условие крови , Рука судьбы.Часть 1: В поход , Рука судьбы.Часть 2: Отчаянье , Рука судьбы.Часть 3: Восхождение , Стойкость
Абсолютная власть , Иду на Вы! , Корона Ургаша , На задворках
Мир надо уничтожить... Чтобы создать свой...