From cb755f5cf8df53b4be129fc9602f651b981717c5 Mon Sep 17 00:00:00 2001 From: FreezePhoenix <24441367+FreezePhoenix@users.noreply.github.com> Date: Wed, 21 Feb 2024 09:00:42 -0500 Subject: [PATCH] Implement Fire Resistance Changes (Original PR: #105) This PR changes Fire Resistance to not only affect the chance of getting burned, but also having higher Fire Resistance reduces the duration and intensity of the burn debuff. For instance, if the player had N fire resistance, they would have a N% chance to simply not get burned, but also, the duration would be reduced by N%, and the intensity would be reduced by N%. --- node/server_functions.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/node/server_functions.js b/node/server_functions.js index 9b6e7b9e..d221f440 100644 --- a/node/server_functions.js +++ b/node/server_functions.js @@ -2698,19 +2698,23 @@ function add_condition(target, condition, args) { disappearing_text(target.socket, target, "FREEZE!", { xy: 1, size: "huge", color: "freeze", nv: 1 }); } if (condition == "burned") { + let scale = 1.0 - (target.firesistance || 0) / 100.0; duration = 5000; if (!args.attack) { args.attack = 1000; } if (args.divider == 3 && target.s.burned && target.s.burned.ms) { - duration = min( - 12000, - max(duration + 400, min(8000, parseInt(duration / 4 + (50 * args.attack) / (target.s.burned.intensity + 200)))), + duration = parseInt( + scale * + min( + 12000, + max(duration + 400, min(8000, duration / 4 + (50 * args.attack) / (target.s.burned.intensity + 200))), + ), ); } C.intensity = max( (target.s.burned && target.s.burned.intensity) || 1, - parseInt(((target.s.burned && target.s.burned.intensity) || 0) / (args.divider || 3) + args.attack), + parseInt((scale * ((target.s.burned && target.s.burned.intensity) || 0)) / (args.divider || 3) + args.attack), ); C.fid = args.fid; disappearing_text({}, target, "BURN!", { xy: 1, size: "huge", color: "burn", nv: 1 }); //target.is_player&&"huge"||undefined