Skip to content

Commit

Permalink
Implement Bit Boss Overheal mode - you can buff your max HP
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosuav committed Jan 6, 2025
1 parent f44173c commit 026873c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions httpstatic/chan_minigames.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function render(data) {
SELECT({name: "selfheal", value: boss.selfheal}, [
OPTION({value: "0"}, "Deals damage as normal"),
OPTION({value: "1"}, "Heals the boss"),
OPTION({value: "2"}, "Overheals the boss"),
]),
]),
LI([
Expand Down
2 changes: 1 addition & 1 deletion modules/http/chan_minigames.pike
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ constant sections = ([
"hpgrowth": 0, //0 for static, positive numbers for fixed growth, -1 for overkill
"autoreset": 1, //Reset at end of stream automatically. There'll be a mod command to reset regardless.
"giftrecipient": 0,
"selfheal": 1,
"selfheal": 1, //0 lets current boss damage themselves (phoenix mode), 1 self-heal up to current max HP, 2 self-heal unlimited
]),
"crown": ([
"enabled": 0,
Expand Down
5 changes: 4 additions & 1 deletion modules/http/chan_monitors.pike
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ void advance_goalbar(object channel, mapping|string info, mapping person, int ad
if (string recip = info->boss_giftrecipient && extra->msg_param_recipient_display_name) from_name = recip;
if (info->boss_selfheal && lower_case(from_name) == lower_case(channel->expand_variables("$bossname$"))) {
int dmg = (int)channel->expand_variables("$bossdmg$");
if (advance > dmg) advance = dmg; //No healing past your max HP
if (advance > dmg) {
if (info->boss_selfheal == 2) channel->set_variable("bossmaxhp", dmg - advance, "add"); //Overheal: Healing can increase max HP
else advance = dmg; //Normal heal: No healing past your max HP
}
advance = -advance; //Heal rather than hurt.
}
int total = (int)channel->set_variable(varname, advance, "add"); //Abuse the fact that it'll take an int just fine for add :)
Expand Down

0 comments on commit 026873c

Please sign in to comment.