mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-14 10:12:59 +02:00
Threat in DangerHitMap
Added new value threat to DangerHitMapAnalayzer. The purpose is to allow decisions to be less binary around enemy heros.
This commit is contained in:
parent
53c51b4278
commit
48ecbd4cbf
@ -96,6 +96,7 @@ void DangerHitMapAnalyzer::updateHitMap()
|
||||
|
||||
newThreat.hero = path.targetHero;
|
||||
newThreat.turn = path.turn();
|
||||
newThreat.threat = path.getHeroStrength() * (1 - path.movementCost() / 2.0);
|
||||
newThreat.danger = path.getHeroStrength();
|
||||
|
||||
if(newThreat.value() > node.maximumDanger.value())
|
||||
|
@ -22,6 +22,7 @@ struct HitMapInfo
|
||||
|
||||
uint64_t danger;
|
||||
uint8_t turn;
|
||||
float threat;
|
||||
HeroPtr hero;
|
||||
|
||||
HitMapInfo()
|
||||
@ -33,6 +34,7 @@ struct HitMapInfo
|
||||
{
|
||||
danger = 0;
|
||||
turn = 255;
|
||||
threat = 0;
|
||||
hero = HeroPtr();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user