From 96b276cd8c473369088c87f49fda53ad50b28613 Mon Sep 17 00:00:00 2001 From: Nerd Lord Date: Wed, 3 Feb 2016 20:43:14 -0500 Subject: [PATCH 1/3] not so simple now, holy shit --- code/_onclick/item_attack.dm | 7 ++----- .../gamemodes/miniantags/revenant/revenant.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 18 +++++++++--------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index b9fde4bcb33..61d144dbb7f 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -25,7 +25,6 @@ I.attack(src, user) /mob/living/proc/attacked_by(obj/item/I, mob/living/user, def_zone) - apply_damage(I.force, I.damtype, def_zone) if(I.damtype == "brute") if(prob(33) && I.force) var/turf/location = src.loc @@ -46,16 +45,14 @@ if(message_verb) visible_message("[attack_message]", "[attack_message]") + apply_damage(I.force, I.damtype, def_zone) //apply damage after messages, so dying animals don't produce a message before dying /mob/living/simple_animal/attacked_by(var/obj/item/I, var/mob/living/user) if(!I.force) user.visible_message("[user] gently taps [src] with [I].",\ "This weapon is ineffective, it does no damage!") - else if(I.force >= force_threshold && I.damtype != STAMINA) - ..() else - visible_message("[I] bounces harmlessly off of [src].",\ - "[I] bounces harmlessly off of [src]!") + ..() diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index 0e05f8f4066..343387a546b 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -23,6 +23,7 @@ see_invisible = SEE_INVISIBLE_MINIMUM see_in_dark = 8 languages = ALL + force_threshold = 5 response_help = "passes through" response_disarm = "swings through" response_harm = "punches through" @@ -31,7 +32,6 @@ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 maxbodytemp = INFINITY - harm_intent_damage = 0 friendly = "touches" status_flags = 0 wander = 0 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 3adcb7749a1..7706ca31c2d 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -274,7 +274,7 @@ /mob/living/simple_animal/attack_animal(mob/living/simple_animal/M) if(..()) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - attack_threshold_check(damage,M.melee_damage_type) + apply_damage(damage,M.melee_damage_type) return 1 /mob/living/simple_animal/bullet_act(obj/item/projectile/Proj) @@ -330,7 +330,7 @@ M.do_attack_animation(src) visible_message("[M] [response_harm] [src]!") playsound(loc, "punch", 25, 1, -1) - attack_threshold_check(harm_intent_damage) + apply_damage(harm_intent_damage) add_logs(M, src, "attacked") updatehealth() return 1 @@ -339,7 +339,7 @@ if(..()) //successful monkey bite. if(stat != DEAD) var/damage = rand(1, 3) - attack_threshold_check(damage) + apply_damage(damage) return 1 if (M.a_intent == "help") if (health > 0) @@ -360,7 +360,7 @@ visible_message("[M] has slashed at [src]!", \ "[M] has slashed at [src]!") playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) - attack_threshold_check(damage) + apply_damage(damage) add_logs(M, src, "attacked") return 1 @@ -369,7 +369,7 @@ var/damage = rand(5, 10) if(stat != DEAD) L.amount_grown = min(L.amount_grown + damage, L.max_grown) - attack_threshold_check(damage) + apply_damage(damage) return 1 /mob/living/simple_animal/attack_slime(mob/living/simple_animal/slime/M) @@ -377,15 +377,15 @@ var/damage = rand(15, 25) if(M.is_adult) damage = rand(20, 35) - attack_threshold_check(damage) + apply_damage(damage) return 1 -/mob/living/simple_animal/proc/attack_threshold_check(damage, damagetype = BRUTE) +/mob/living/simple_animal/apply_damage(damage = 0, damagetype = BRUTE) if(damage <= force_threshold || !damage_coeff[damagetype]) visible_message("[src] looks unharmed.") + return 0 else - adjustBruteLoss(damage) - updatehealth() + return ..() /mob/living/simple_animal/attackby(obj/item/O, mob/living/user, params) //Marker -Agouri From d412c90ba804864f55f4a9afd872fb1689137201 Mon Sep 17 00:00:00 2001 From: Nerd Lord Date: Wed, 3 Feb 2016 21:10:33 -0500 Subject: [PATCH 2/3] If we let the threshold be on by default, we cuck blob chemicals. Let's not do that. --- code/_onclick/item_attack.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 61d144dbb7f..9dad9e5fac3 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -45,7 +45,7 @@ if(message_verb) visible_message("[attack_message]", "[attack_message]") - apply_damage(I.force, I.damtype, def_zone) //apply damage after messages, so dying animals don't produce a message before dying + apply_damage(I.force, I.damtype, def_zone, threshold_check = 1) /mob/living/simple_animal/attacked_by(var/obj/item/I, var/mob/living/user) if(!I.force) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 7706ca31c2d..ea9c876e402 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -274,7 +274,7 @@ /mob/living/simple_animal/attack_animal(mob/living/simple_animal/M) if(..()) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - apply_damage(damage,M.melee_damage_type) + apply_damage(damage, M.melee_damage_type, threshold_check = 1) return 1 /mob/living/simple_animal/bullet_act(obj/item/projectile/Proj) @@ -330,7 +330,7 @@ M.do_attack_animation(src) visible_message("[M] [response_harm] [src]!") playsound(loc, "punch", 25, 1, -1) - apply_damage(harm_intent_damage) + apply_damage(harm_intent_damage, threshold_check = 1) add_logs(M, src, "attacked") updatehealth() return 1 @@ -339,7 +339,7 @@ if(..()) //successful monkey bite. if(stat != DEAD) var/damage = rand(1, 3) - apply_damage(damage) + apply_damage(damage, threshold_check = 1) return 1 if (M.a_intent == "help") if (health > 0) @@ -360,7 +360,7 @@ visible_message("[M] has slashed at [src]!", \ "[M] has slashed at [src]!") playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) - apply_damage(damage) + apply_damage(damage, threshold_check = 1) add_logs(M, src, "attacked") return 1 @@ -369,7 +369,7 @@ var/damage = rand(5, 10) if(stat != DEAD) L.amount_grown = min(L.amount_grown + damage, L.max_grown) - apply_damage(damage) + apply_damage(damage, threshold_check = 1) return 1 /mob/living/simple_animal/attack_slime(mob/living/simple_animal/slime/M) @@ -377,12 +377,13 @@ var/damage = rand(15, 25) if(M.is_adult) damage = rand(20, 35) - apply_damage(damage) + apply_damage(damage, threshold_check = 1) return 1 -/mob/living/simple_animal/apply_damage(damage = 0, damagetype = BRUTE) - if(damage <= force_threshold || !damage_coeff[damagetype]) - visible_message("[src] looks unharmed.") +/mob/living/simple_animal/apply_damage(damage = 0, damagetype = BRUTE, threshold_check = 0) + if(!damage_coeff[damagetype] || threshold_check && damage <= force_threshold) + if(threshold_check) //if it's not checking the force threshold, it probably doesn't want a message to appear + visible_message("[src] looks unharmed.") return 0 else return ..() From 20b61a351c77f373ce202bf662ba26636e8a6970 Mon Sep 17 00:00:00 2001 From: Nerd Lord Date: Wed, 3 Feb 2016 21:16:56 -0500 Subject: [PATCH 3/3] shitcoder no shitcoding --- code/_onclick/item_attack.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 9dad9e5fac3..00b45820509 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -45,7 +45,7 @@ if(message_verb) visible_message("[attack_message]", "[attack_message]") - apply_damage(I.force, I.damtype, def_zone, threshold_check = 1) + apply_damage(I.force, I.damtype, def_zone, threshold_check = 1, threshold_message = 1) /mob/living/simple_animal/attacked_by(var/obj/item/I, var/mob/living/user) if(!I.force) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index ea9c876e402..d54a755eee7 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -274,13 +274,13 @@ /mob/living/simple_animal/attack_animal(mob/living/simple_animal/M) if(..()) var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) - apply_damage(damage, M.melee_damage_type, threshold_check = 1) + apply_damage(damage, M.melee_damage_type, threshold_check = 1, threshold_message = 1) return 1 /mob/living/simple_animal/bullet_act(obj/item/projectile/Proj) if(!Proj) return - apply_damage(Proj.damage, Proj.damage_type) + apply_damage(Proj.damage, Proj.damage_type, threshold_message = 1) Proj.on_hit(src) return 0 @@ -330,7 +330,7 @@ M.do_attack_animation(src) visible_message("[M] [response_harm] [src]!") playsound(loc, "punch", 25, 1, -1) - apply_damage(harm_intent_damage, threshold_check = 1) + apply_damage(harm_intent_damage, threshold_check = 1, threshold_message = 1) add_logs(M, src, "attacked") updatehealth() return 1 @@ -339,7 +339,7 @@ if(..()) //successful monkey bite. if(stat != DEAD) var/damage = rand(1, 3) - apply_damage(damage, threshold_check = 1) + apply_damage(damage, threshold_check = 1, threshold_message = 1) return 1 if (M.a_intent == "help") if (health > 0) @@ -360,7 +360,7 @@ visible_message("[M] has slashed at [src]!", \ "[M] has slashed at [src]!") playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) - apply_damage(damage, threshold_check = 1) + apply_damage(damage, threshold_check = 1, threshold_message = 1) add_logs(M, src, "attacked") return 1 @@ -369,7 +369,7 @@ var/damage = rand(5, 10) if(stat != DEAD) L.amount_grown = min(L.amount_grown + damage, L.max_grown) - apply_damage(damage, threshold_check = 1) + apply_damage(damage, threshold_check = 1, threshold_message = 1) return 1 /mob/living/simple_animal/attack_slime(mob/living/simple_animal/slime/M) @@ -377,12 +377,12 @@ var/damage = rand(15, 25) if(M.is_adult) damage = rand(20, 35) - apply_damage(damage, threshold_check = 1) + apply_damage(damage, threshold_check = 1, threshold_message = 1) return 1 -/mob/living/simple_animal/apply_damage(damage = 0, damagetype = BRUTE, threshold_check = 0) +/mob/living/simple_animal/apply_damage(damage = 0, damagetype = BRUTE, threshold_check = 0, threshold_message = 0) if(!damage_coeff[damagetype] || threshold_check && damage <= force_threshold) - if(threshold_check) //if it's not checking the force threshold, it probably doesn't want a message to appear + if(threshold_message) visible_message("[src] looks unharmed.") return 0 else