From 7099647243a269638ab9568a16483aa22a067277 Mon Sep 17 00:00:00 2001 From: Evgeniy Kozlov Date: Sat, 24 Aug 2024 11:54:00 +0300 Subject: [PATCH] Passive BGE Devotion: parameterized (as percent) (#78) * Passive BGE Devotion: parameterized (as percent) Use "Devotion 20" to have 20% bonus, "Devotion 25" for 25% and so on * Passive BGE Devotion: AHK: add X param to the Devotion --- SimpleTUOLiveSim.ahk | 2 +- SimpleTUOptimizeStarter.ahk | 2 +- sim.cpp | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/SimpleTUOLiveSim.ahk b/SimpleTUOLiveSim.ahk index 55dc1f2d..c9eb826c 100644 --- a/SimpleTUOLiveSim.ahk +++ b/SimpleTUOLiveSim.ahk @@ -15,7 +15,7 @@ FileDelete, %file% MaxCardsSections := 100 -BGEffects := "none|SuperHeroism|Crackdown|Devotion|Unity|Iron-Will|Cold-Sleep|Blood-Vengeance|Oath-of-Loyalty|Furiosity|TemporalBacklash|CriticalReach|Devour|HaltedOrders|ZealotsPreservation|Virulence|Enfeeble all X|Enhance all S X|Evolve n S1 S2|Heal all X|Mortar X|Protect all X|Rally all X|Siege all X|Strike all X|Weaken all X|Brigade|Bloodlust X|Counterflux|Divert|EnduringRage|Fortification|Heroism|Metamorphosis|Megamorphosis|Revenge X|TurningTides" +BGEffects := "none|SuperHeroism|Crackdown|Devotion X|Unity|Iron-Will|Cold-Sleep|Blood-Vengeance|Oath-of-Loyalty|Furiosity|TemporalBacklash|CriticalReach|Devour|HaltedOrders|ZealotsPreservation|Virulence|Enfeeble all X|Enhance all S X|Evolve n S1 S2|Heal all X|Mortar X|Protect all X|Rally all X|Siege all X|Strike all X|Weaken all X|Brigade|Bloodlust X|Counterflux|Divert|EnduringRage|Fortification|Heroism|Metamorphosis|Megamorphosis|Revenge X|TurningTides" IniFileName := "data\SimpleTUOLiveSim.ini" IniSection := "onLoad" diff --git a/SimpleTUOptimizeStarter.ahk b/SimpleTUOptimizeStarter.ahk index 54e8b521..29019482 100644 --- a/SimpleTUOptimizeStarter.ahk +++ b/SimpleTUOptimizeStarter.ahk @@ -15,7 +15,7 @@ FileDelete, %file% MaxCardsSections := 100 -BGEffects := "none|SuperHeroism|Crackdown|Devotion|Unity|Iron-Will|Cold-Sleep|Blood-Vengeance|Oath-of-Loyalty|Furiosity|TemporalBacklash|CriticalReach|Devour|HaltedOrders|ZealotsPreservation|Virulence|Enfeeble all X|Enhance all S X|Evolve n S1 S2|Heal all X|Mortar X|Protect all X|Rally all X|Siege all X|Strike all X|Weaken all X|Brigade|Bloodlust X|Counterflux|Divert|EnduringRage|Fortification|Heroism|Metamorphosis|Megamorphosis|Revenge X|TurningTides" +BGEffects := "none|SuperHeroism|Crackdown|Devotion X|Unity|Iron-Will|Cold-Sleep|Blood-Vengeance|Oath-of-Loyalty|Furiosity|TemporalBacklash|CriticalReach|Devour|HaltedOrders|ZealotsPreservation|Virulence|Enfeeble all X|Enhance all S X|Evolve n S1 S2|Heal all X|Mortar X|Protect all X|Rally all X|Siege all X|Strike all X|Weaken all X|Brigade|Bloodlust X|Counterflux|Divert|EnduringRage|Fortification|Heroism|Metamorphosis|Megamorphosis|Revenge X|TurningTides" IniFileName := "data\SimpleTUOptimizeStarter.ini" IniSection := "onLoad" diff --git a/sim.cpp b/sim.cpp index c089f143..66e4255f 100644 --- a/sim.cpp +++ b/sim.cpp @@ -1009,11 +1009,15 @@ struct PlayCard } //Devotion BGE - if (__builtin_expect(fd->bg_effects[status->m_player][PassiveBGE::devotion], false) && !summoned && card->m_category == CardCategory::normal && fd->players[status->m_player]->commander.m_card->m_faction == card->m_faction) + if (__builtin_expect(fd->bg_effects[status->m_player][PassiveBGE::devotion], false) + && !summoned && card->m_category == CardCategory::normal + && fd->players[status->m_player]->commander.m_card->m_faction == card->m_faction) { + unsigned devotion_percent = fd->bg_effects[status->m_player][PassiveBGE::devotion]; + unsigned bge_buff = (card->m_health*devotion_percent+99)/100; _DEBUG_MSG(1, "Devotion %s: Gains %u HP\n", - status_description(status).c_str(), (2*card->m_health+4)/5); - status->ext_hp((2*card->m_health+4)/5); //40% bonus health (rounded up) + status_description(status).c_str(), bge_buff); + status->ext_hp(bge_buff); // % bonus health (rounded up) }