Merge pull request #225 from FreezePhoenix/patch-20

Add flag for implicit targets, and the implicit targets functionality
This commit is contained in:
Kaan Soral
2026-02-02 17:12:38 +03:00
committed by GitHub
+9 -7
View File
@@ -168,6 +168,7 @@ var mode = {
prevent_external: 0, // for "test" / "hardcore" prevent_external: 0, // for "test" / "hardcore"
pvp_level_gap: 0, // have to be within 10 level to attack pvp_level_gap: 0, // have to be within 10 level to attack
fear_affects_heal: 0, // when feared heal output is lowered fear_affects_heal: 0, // when feared heal output is lowered
implicit_targets: 0, // Do skills that don't have an explicit target, such as self-buffing skills, trigger mana restoring effects with increased chances?
}; };
var events = { var events = {
// SEASONS // SEASONS
@@ -8651,13 +8652,13 @@ function init_io() {
} }
} }
} else if (data.name == "hardshell" || data.name == "power" || data.name == "xpower") { } else if (data.name == "hardshell" || data.name == "power" || data.name == "xpower") {
consume_mp(player, gSkill.mp); consume_mp(player, gSkill.mp, mode.implicit_targets && player);
player.s[gSkill.condition] = { player.s[gSkill.condition] = {
ms: gSkill.duration || G.conditions[gSkill.condition].duration, ms: gSkill.duration || G.conditions[gSkill.condition].duration,
}; };
player.to_resend = "u+cid"; player.to_resend = "u+cid";
} else if (data.name == "mshield") { } else if (data.name == "mshield") {
consume_mp(player, gSkill.mp); // consume_mp(player, gSkill.mp);
if (player.s[gSkill.condition]) { if (player.s[gSkill.condition]) {
delete player.s[gSkill.condition]; delete player.s[gSkill.condition];
} else { } else {
@@ -8672,7 +8673,7 @@ function init_io() {
data.name == "massexchange" || data.name == "massexchange" ||
data.name == "massexchangepp" data.name == "massexchangepp"
) { ) {
consume_mp(player, gSkill.mp); consume_mp(player, gSkill.mp, mode.implicit_targets && player);
player.s[gSkill.condition] = { ms: G.conditions[gSkill.condition].duration }; player.s[gSkill.condition] = { ms: G.conditions[gSkill.condition].duration };
xy_emit(player, "ui", { type: data.name, name: player.name }); xy_emit(player, "ui", { type: data.name, name: player.name });
player.to_resend = "u+cid"; player.to_resend = "u+cid";
@@ -8729,10 +8730,10 @@ function init_io() {
target.cid++; target.cid++;
} }
} else if (data.name == "phaseout") { } else if (data.name == "phaseout") {
consume_mp(player, gSkill.mp); consume_mp(player, gSkill.mp, mode.implicit_targets && player);
player.s.phasedout = { ms: G.conditions.phasedout.duration }; player.s.phasedout = { ms: G.conditions.phasedout.duration };
} else if (data.name == "pcoat") { } else if (data.name == "pcoat") {
consume_mp(player, gSkill.mp); consume_mp(player, gSkill.mp, mode.implicit_targets && player);
player.s.poisonous = { ms: G.conditions.poisonous.duration }; player.s.poisonous = { ms: G.conditions.poisonous.duration };
} else if (data.name == "curse") { } else if (data.name == "curse") {
//#TODO: last_curse variable + check for multiple curses //#TODO: last_curse variable + check for multiple curses
@@ -8780,6 +8781,7 @@ function init_io() {
return fail_response("target_alive", data.name); return fail_response("target_alive", data.name);
} }
consume_mp(player, gSkill.mp, target);
if (target.hp != target.max_hp) { if (target.hp != target.max_hp) {
reject = { response: "data", place: data.name, reason: "hp" }; reject = { response: "data", place: data.name, reason: "hp" };
player.socket.emit("game_response", { response: "revive_failed", id: data.id }); player.socket.emit("game_response", { response: "revive_failed", id: data.id });
@@ -9184,7 +9186,7 @@ function init_io() {
player.s.blink.d = data.direction; player.s.blink.d = data.direction;
} }
if (player.role != "gm") { if (player.role != "gm") {
consume_mp(player, gSkill.mp); consume_mp(player, gSkill.mp, mode.implicit_targets && player);
} }
// xy_emit(player,"ui",{type:"blinking",name:player.name}); // xy_emit(player,"ui",{type:"blinking",name:player.name});
resend(player, "u+cid"); resend(player, "u+cid");
@@ -9214,7 +9216,7 @@ function init_io() {
player.s.blink.d = data.direction; player.s.blink.d = data.direction;
} }
if (player.role != "gm") { if (player.role != "gm") {
consume_mp(player, gSkill.mp); consume_mp(player, gSkill.mp, mode.implicit_targets && player);
} }
// xy_emit(player,"ui",{type:"blinking",name:player.name}); // xy_emit(player,"ui",{type:"blinking",name:player.name});
player.to_resend = "u+cid"; player.to_resend = "u+cid";