Merge pull request #81 from FreezePhoenix/patch-8

Introduce tags for some debuffs
This commit is contained in:
Kaan Soral
2024-02-21 16:01:09 +03:00
committed by GitHub
4 changed files with 40 additions and 34 deletions
+7
View File
@@ -307,6 +307,7 @@ conditions={
"ui":True, "ui":True,
"blocked":True, "blocked":True,
"debuff":True, "debuff":True,
"defense":"phresistance",
"duration":3200, "duration":3200,
}, },
"deepfreezed":{ "deepfreezed":{
@@ -316,6 +317,7 @@ conditions={
"ui":True, "ui":True,
"blocked":True, "blocked":True,
"debuff":True, "debuff":True,
"defense":"fzresistance",
}, },
"invincible":{ "invincible":{
"name":"Invincible", "name":"Invincible",
@@ -330,6 +332,7 @@ conditions={
"ui":True, "ui":True,
"debuff":True, "debuff":True,
"duration":5000, "duration":5000,
"defense":"fzresistance",
}, },
"burned":{ "burned":{
"name":"Burned", "name":"Burned",
@@ -337,6 +340,7 @@ conditions={
"interval":210, "interval":210,
"ui":True, "ui":True,
"debuff":True, "debuff":True,
"defense":"firesistance",
}, },
"shocked":{ "shocked":{
"name":"Shocked", "name":"Shocked",
@@ -360,6 +364,7 @@ conditions={
"duration":4000, "duration":4000,
"blocked":True, "blocked":True,
"debuff":True, "debuff":True,
# "defense":"bmresistance",
}, },
"easterluck":{ "easterluck":{
"skin":"easterluck", "skin":"easterluck",
@@ -478,6 +483,7 @@ conditions={
"potionsm":0.5, "potionsm":0.5,
"healm":0.25, "healm":0.25,
"debuff":True, "debuff":True,
"defense":"pnresistance",
}, },
"cursed":{ "cursed":{
"name":"Cursed", "name":"Cursed",
@@ -487,6 +493,7 @@ conditions={
"speed":-20, "speed":-20,
"duration":5000, "duration":5000,
"debuff":True, "debuff":True,
# "defense":"bmresistance",
}, },
"dampened":{ "dampened":{
"name":"Dampened", "name":"Dampened",
+4 -4
View File
@@ -2500,22 +2500,22 @@ function init_socket(args)
sender.a_direction=sender.direction=data.direction; sender.a_direction=sender.direction=data.direction;
} }
} }
else if(data.type=="poison_resist") else if(data.type=="poisoned_resist")
{ {
var target=get_entity(data.id); var target=get_entity(data.id);
if(target) d_text("RESIST!",target,{color:"#68B84B"}); if(target) d_text("RESIST!",target,{color:"#68B84B"});
} }
else if(data.type=="freeze_resist") else if(data.type=="frozen_resist"||data.type=="deepfreezed_resist")
{ {
var target=get_entity(data.id); var target=get_entity(data.id);
if(target) d_text("RESIST!",target,{color:"#66C1C8"}); if(target) d_text("RESIST!",target,{color:"#66C1C8"});
} }
else if(data.type=="fire_resist") else if(data.type=="burned_resist")
{ {
var target=get_entity(data.id); var target=get_entity(data.id);
if(target) d_text("RESIST!",target,{color:"#B22F1A"}); if(target) d_text("RESIST!",target,{color:"#B22F1A"});
} }
else if(data.type=="stun_resist") else if(data.type=="stunned_resist")
{ {
var target=get_entity(data.id); var target=get_entity(data.id);
if(target) d_text("RESIST!",target,{color:"crit"}); if(target) d_text("RESIST!",target,{color:"crit"});
+4 -13
View File
@@ -3413,12 +3413,7 @@ function complete_attack(attacker, target, info) {
o_attack = attack = ceil(attack); o_attack = attack = ceil(attack);
if (info.conditions.includes("frozen") && !target.immune && target.hp > attack) { if (info.conditions.includes("frozen") && !target.immune && target.hp > attack) {
if (Math.random() < target.fzresistance / 100.0) { add_condition(target, "frozen");
xy_emit(target, "ui", { type: "freeze_resist", id: target.id });
} else {
add_condition(target, "frozen");
disappearing_text(target.socket, target, "FREEZE!", { xy: 1, size: "huge", color: "freeze", nv: 1 }); //target.is_player&&"huge"||undefined
}
} }
if (info.conditions.includes("burned") && !target.immune && target.hp > attack) { if (info.conditions.includes("burned") && !target.immune && target.hp > attack) {
@@ -3434,13 +3429,9 @@ function complete_attack(attacker, target, info) {
add_condition(target, "woven"); add_condition(target, "woven");
} }
if ( if (info.conditions.includes("stunned") && target.hp > attack) {
info.conditions.includes("stunned") && add_condition(target, "stunned", { duration: 2000 });
target.hp > attack && }
add_condition(target, "stunned", { duration: 2000 })
) {
disappearing_text(target.socket, target, "STUN!", { xy: 1, size: "huge", color: "stun", nv: 1 });
} //target.is_player&&"huge"||undefined
if (info.procs && target.a.putrid) { if (info.procs && target.a.putrid) {
add_condition(attacker, "poisoned"); add_condition(attacker, "poisoned");
+25 -17
View File
@@ -2661,30 +2661,43 @@ function add_condition(target, condition, args) {
} }
var response = { response: "condition", name: condition, cevent: true }; var response = { response: "condition", name: condition, cevent: true };
var duration = args.duration || args.ms || def.duration; var duration = args.duration || args.ms || def.duration;
if (def.defense) {
if (Math.random() < (target[def.defense] || 0) / 100.0) {
return xy_emit(target, "ui", { type: condition + "_resist", id: target.id });
}
}
// if (def.tag === "stun") {
// if (Math.random() < (target.phresistance || 0) / 100.0) {
// }
// } else if (def.tag === "burn") {
// if (Math.random() < (target.firesistance || 0) / 100.0) {
// return xy_emit(target, "ui", { type: "fire_resist", id: target.id });
// }
// } else if (def.tag === "poison") {
// if (Math.random() < (target.pnresistance || 0) / 100.0) {
// return xy_emit(target, "ui", { type: "poison_resist", id: target.id });
// }
// } else if (def.tag === "freeze") {
// if (Math.random() < (target.fzresistance || 0) / 100.0) {
// return xy_emit(target, "ui", { type: "freeze_resist", id: target.id });
// }
// }
if (duration == undefined) { if (duration == undefined) {
duration = 1000; duration = 1000;
} }
var C = { ms: duration }; var C = { ms: duration };
if (condition == "poisoned" && target.pnresistance) { if (condition == "poisoned" && target.pnresistance) {
if (Math.random() < (target.pnresistance || 0) / 100.0) {
return xy_emit(target, "ui", { type: "poison_resist", id: target.id });
}
duration *= (100 - target.pnresistance) / 100.0; duration *= (100 - target.pnresistance) / 100.0;
} }
if (condition == "stunned") { if (condition == "stunned") {
if (Math.random() < (target.phresistance || 0) / 100.0) {
return xy_emit(target, "ui", { type: "stun_resist", id: target.id });
}
target.abs = true; target.abs = true;
target.moving = false; target.moving = false;
disappearing_text(target.socket, target, "STUN!", { xy: 1, size: "huge", color: "stun", nv: 1 });
}
if (condition == "frozen") {
disappearing_text(target.socket, target, "FREEZE!", { xy: 1, size: "huge", color: "freeze", nv: 1 });
} }
if (condition == "burned") { if (condition == "burned") {
if (Math.random() < (target.firesistance || 0) / 100.0) {
return xy_emit(target, "ui", { type: "fire_resist", id: target.id });
}
duration = 5000; duration = 5000;
if (!args.attack) { if (!args.attack) {
args.attack = 1000; args.attack = 1000;
@@ -2702,11 +2715,6 @@ function add_condition(target, condition, args) {
C.fid = args.fid; C.fid = args.fid;
disappearing_text({}, target, "BURN!", { xy: 1, size: "huge", color: "burn", nv: 1 }); //target.is_player&&"huge"||undefined disappearing_text({}, target, "BURN!", { xy: 1, size: "huge", color: "burn", nv: 1 }); //target.is_player&&"huge"||undefined
} }
if (condition == "deepfreezed") {
if (Math.random() < (target.fzresistance || 0) / 100.0) {
return xy_emit(target, "ui", { type: "freeze_resist", id: target.id });
}
}
if (condition == "woven") { if (condition == "woven") {
C.s = min((target.is_monster && 20) || 5, (target.s.woven && target.s.woven.s + 1) || 1); C.s = min((target.is_monster && 20) || 5, (target.s.woven && target.s.woven.s + 1) || 1);
C.speed = -3 * C.s; C.speed = -3 * C.s;