Skip to content

Commit cb755f5

Browse files
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%.
1 parent a10a3c9 commit cb755f5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

node/server_functions.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,19 +2698,23 @@ function add_condition(target, condition, args) {
26982698
disappearing_text(target.socket, target, "FREEZE!", { xy: 1, size: "huge", color: "freeze", nv: 1 });
26992699
}
27002700
if (condition == "burned") {
2701+
let scale = 1.0 - (target.firesistance || 0) / 100.0;
27012702
duration = 5000;
27022703
if (!args.attack) {
27032704
args.attack = 1000;
27042705
}
27052706
if (args.divider == 3 && target.s.burned && target.s.burned.ms) {
2706-
duration = min(
2707-
12000,
2708-
max(duration + 400, min(8000, parseInt(duration / 4 + (50 * args.attack) / (target.s.burned.intensity + 200)))),
2707+
duration = parseInt(
2708+
scale *
2709+
min(
2710+
12000,
2711+
max(duration + 400, min(8000, duration / 4 + (50 * args.attack) / (target.s.burned.intensity + 200))),
2712+
),
27092713
);
27102714
}
27112715
C.intensity = max(
27122716
(target.s.burned && target.s.burned.intensity) || 1,
2713-
parseInt(((target.s.burned && target.s.burned.intensity) || 0) / (args.divider || 3) + args.attack),
2717+
parseInt((scale * ((target.s.burned && target.s.burned.intensity) || 0)) / (args.divider || 3) + args.attack),
27142718
);
27152719
C.fid = args.fid;
27162720
disappearing_text({}, target, "BURN!", { xy: 1, size: "huge", color: "burn", nv: 1 }); //target.is_player&&"huge"||undefined

0 commit comments

Comments
 (0)