mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-20 03:29:32 +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.hero = path.targetHero;
|
||||||
newThreat.turn = path.turn();
|
newThreat.turn = path.turn();
|
||||||
|
newThreat.threat = path.getHeroStrength() * (1 - path.movementCost() / 2.0);
|
||||||
newThreat.danger = path.getHeroStrength();
|
newThreat.danger = path.getHeroStrength();
|
||||||
|
|
||||||
if(newThreat.value() > node.maximumDanger.value())
|
if(newThreat.value() > node.maximumDanger.value())
|
||||||
|
@ -22,6 +22,7 @@ struct HitMapInfo
|
|||||||
|
|
||||||
uint64_t danger;
|
uint64_t danger;
|
||||||
uint8_t turn;
|
uint8_t turn;
|
||||||
|
float threat;
|
||||||
HeroPtr hero;
|
HeroPtr hero;
|
||||||
|
|
||||||
HitMapInfo()
|
HitMapInfo()
|
||||||
@ -33,6 +34,7 @@ struct HitMapInfo
|
|||||||
{
|
{
|
||||||
danger = 0;
|
danger = 0;
|
||||||
turn = 255;
|
turn = 255;
|
||||||
|
threat = 0;
|
||||||
hero = HeroPtr();
|
hero = HeroPtr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user