Skip to content

Commit

Permalink
Passive BGE Devotion: parameterized (as percent)
Browse files Browse the repository at this point in the history
Use "Devotion 20" to have 20% bonus, "Devotion 25" for 25% and so on
  • Loading branch information
dsuchka committed Aug 23, 2024
1 parent ec83f46 commit fc1ea2e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); // <bge_value>% bonus health (rounded up)
}


Expand Down

0 comments on commit fc1ea2e

Please sign in to comment.