From bce64cd9980b8783104992b6cd417cdbe54a69fb Mon Sep 17 00:00:00 2001 From: Geeves Date: Sat, 25 Jul 2020 22:25:25 +0200 Subject: [PATCH] Simple Animal Improvements (#9135) Tweaked various simple animal messages to make it look better in the chat log. Aggressive grabs no longer refer to 'by the hands'. Getting a neck grab or higher on an aggressive animal restrains them from attacking. Strangling an animal now properly does damage to them. --- .../mob/living/simple_animal/hostile/bat.dm | 1 + .../mob/living/simple_animal/hostile/bear.dm | 1 + .../simple_animal/hostile/changeling.dm | 1 + .../hostile/commanded/bear_companion.dm | 1 + .../hostile/commanded/guard_dog.dm | 1 + .../simple_animal/hostile/giant_spider.dm | 1 + .../living/simple_animal/hostile/hostile.dm | 24 ++++++----- .../living/simple_animal/hostile/krampus.dm | 1 + .../simple_animal/hostile/moghesfauna.dm | 1 + .../simple_animal/hostile/spider_queen.dm | 1 + .../mob/living/simple_animal/simple_animal.dm | 40 ++++++++++--------- code/modules/mob/mob_grab.dm | 3 ++ code/modules/multiz/movement.dm | 8 ++-- .../geeves-simple_mob_improvements.yml | 9 +++++ 14 files changed, 62 insertions(+), 31 deletions(-) create mode 100644 html/changelogs/geeves-simple_mob_improvements.yml diff --git a/code/modules/mob/living/simple_animal/hostile/bat.dm b/code/modules/mob/living/simple_animal/hostile/bat.dm index feb9151bf99..08d4c254c74 100644 --- a/code/modules/mob/living/simple_animal/hostile/bat.dm +++ b/code/modules/mob/living/simple_animal/hostile/bat.dm @@ -20,6 +20,7 @@ harm_intent_damage = 8 melee_damage_lower = 10 melee_damage_upper = 10 + resist_mod = 10 // can't grab a cloud of bats easily attacktext = "bites" attack_sound = 'sound/weapons/bite.ogg' diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index 77220e213ef..f1c602ee9f4 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -25,6 +25,7 @@ maxHealth = 80 melee_damage_lower = 10 melee_damage_upper = 18 + resist_mod = 4 break_stuff_probability = 80 mob_size = 17 butchering_products = list(/obj/item/clothing/head/bearpelt = 1) diff --git a/code/modules/mob/living/simple_animal/hostile/changeling.dm b/code/modules/mob/living/simple_animal/hostile/changeling.dm index 64d1677e8c0..04b766e473a 100644 --- a/code/modules/mob/living/simple_animal/hostile/changeling.dm +++ b/code/modules/mob/living/simple_animal/hostile/changeling.dm @@ -23,6 +23,7 @@ harm_intent_damage = 0 melee_damage_lower = 30 melee_damage_upper = 30 + resist_mod = 3 mob_size = 25 environment_smash = 2 attacktext = "mangled" diff --git a/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm b/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm index 21f272ae1fd..dbfd8aa998c 100644 --- a/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm +++ b/code/modules/mob/living/simple_animal/hostile/commanded/bear_companion.dm @@ -15,6 +15,7 @@ attacktext = "swatted" melee_damage_lower = 25 melee_damage_upper = 25 + resist_mod = 5 min_oxy = 5 max_co2 = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm b/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm index 72c06255fb8..14b387ca12b 100644 --- a/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm +++ b/code/modules/mob/living/simple_animal/hostile/commanded/guard_dog.dm @@ -29,6 +29,7 @@ harm_intent_damage = 5 melee_damage_lower = 15 melee_damage_upper = 15 + resist_mod = 2 mob_size = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 7ff81328da6..0ef08c12853 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -25,6 +25,7 @@ health = 200 melee_damage_lower = 15 melee_damage_upper = 20 + resist_mod = 1.5 heat_damage_per_tick = 20 cold_damage_per_tick = 20 var/poison_per_bite = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 36fb0b2b6c1..fd98cd96a74 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -67,8 +67,8 @@ if(!isnull(T)) stance = HOSTILE_STANCE_ATTACK if(isliving(T)) - custom_emote(1, "[attack_emote] [T]") - if(istype(T, /mob/living/simple_animal/hostile/)) + visible_message(SPAN_WARNING("\The [src] [attack_emote] [T].")) + if(istype(T, /mob/living/simple_animal/hostile)) var/mob/living/simple_animal/hostile/H = T H.being_targeted(src) return T @@ -80,7 +80,7 @@ target_mob = H FoundTarget() stance = HOSTILE_STANCE_ATTACKING - custom_emote(1, "gets taunted by [H] and begins to retaliate!") + visible_message(SPAN_WARNING("\The [src] gets taunted by \the [H] and begins to retaliate!")) /mob/living/simple_animal/hostile/bullet_act(var/obj/item/projectile/P, var/def_zone) ..() @@ -165,6 +165,12 @@ mob/living/simple_animal/hostile/hitby(atom/movable/AM as mob|obj,var/speed = TH return if(!see_target()) LoseTarget() + for(var/grab in grabbed_by) + var/obj/item/grab/G = grab + if(G.state >= GRAB_NECK) + visible_message(SPAN_WARNING("\The [G.assailant] restrains \the [src] from attacking!")) + resist_grab() + return if(isliving(target_mob)) var/mob/living/L = target_mob L.attack_generic(src, rand(melee_damage_lower, melee_damage_upper), attacktext) @@ -177,7 +183,7 @@ mob/living/simple_animal/hostile/hitby(atom/movable/AM as mob|obj,var/speed = TH var/obj/machinery/porta_turret/T = target_mob src.do_attack_animation(T) T.take_damage(max(melee_damage_lower, melee_damage_upper) / 2) - visible_message("\The [src] [attacktext] \the [T]!") + visible_message(SPAN_DANGER("\The [src] [attacktext] \the [T]!")) return T /mob/living/simple_animal/hostile/proc/LoseTarget() @@ -227,7 +233,7 @@ mob/living/simple_animal/hostile/hitby(atom/movable/AM as mob|obj,var/speed = TH // This code checks if we are not going to hit our target if(smart && !check_fire(target_mob)) return - visible_message(" [src] fires at [target]!") + visible_message(SPAN_DANGER("[capitalize_first_letters(src.name)] fires at \the [target]!")) if(rapid) var/datum/callback/shoot_cb = CALLBACK(src, .proc/shoot_wrapper, target, loc, src) @@ -283,13 +289,13 @@ mob/living/simple_animal/hostile/hitby(atom/movable/AM as mob|obj,var/speed = TH if(prob(break_stuff_probability) || bypass_prob) //bypass_prob is used to make mob destroy things in the way to our target for(var/dir in cardinal) // North, South, East, West var/obj/effect/energy_field/e = locate(/obj/effect/energy_field, get_step(src, dir)) - if(e) - e.Stress(rand(1,2)) - visible_message("\The [src] [attacktext] \the [e]!") + if(e && !e.invisibility && e.density) + e.Stress(rand(0.5, 1.5)) + visible_message(SPAN_DANGER("[capitalize_first_letters(src.name)] [attacktext] \the [e]!")) src.do_attack_animation(e) target_mob = e stance = HOSTILE_STANCE_ATTACKING - return 1 + return TRUE for(var/obj/structure/window/obstacle in get_step(src, dir)) if(obstacle.dir == reverse_dir[dir]) // So that windows get smashed in the right order obstacle.attack_generic(src,rand(melee_damage_lower,melee_damage_upper),attacktext) diff --git a/code/modules/mob/living/simple_animal/hostile/krampus.dm b/code/modules/mob/living/simple_animal/hostile/krampus.dm index b8f21440653..a6189ee5e34 100644 --- a/code/modules/mob/living/simple_animal/hostile/krampus.dm +++ b/code/modules/mob/living/simple_animal/hostile/krampus.dm @@ -23,6 +23,7 @@ harm_intent_damage = 0 melee_damage_lower = 30 melee_damage_upper = 30 + resist_mod = 15 mob_size = 25 environment_smash = 2 attacktext = "punished" diff --git a/code/modules/mob/living/simple_animal/hostile/moghesfauna.dm b/code/modules/mob/living/simple_animal/hostile/moghesfauna.dm index c00e6924ae3..08bf7d7cc72 100644 --- a/code/modules/mob/living/simple_animal/hostile/moghesfauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/moghesfauna.dm @@ -20,6 +20,7 @@ harm_intent_damage = 0 melee_damage_lower = 30 melee_damage_upper = 30 + resist_mod = 10 mob_size = 30 environment_smash = 2 attacktext = "chomped" diff --git a/code/modules/mob/living/simple_animal/hostile/spider_queen.dm b/code/modules/mob/living/simple_animal/hostile/spider_queen.dm index d3e6de9a148..57ceff5ea16 100644 --- a/code/modules/mob/living/simple_animal/hostile/spider_queen.dm +++ b/code/modules/mob/living/simple_animal/hostile/spider_queen.dm @@ -20,6 +20,7 @@ health = 700 melee_damage_lower = 25 melee_damage_upper = 30 + resist_mod = 15 // LOL good luck pal heat_damage_per_tick = 20 cold_damage_per_tick = 20 faction = "spiders" diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index a3453327220..d5d272368a0 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -66,6 +66,7 @@ var/friendly = "nuzzles" var/environment_smash = 0 var/resistance = 0 // Damage reduction + var/resist_mod = 1 // a multiplier for the chance the animal has to break out var/wizard_master @@ -378,11 +379,11 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) if(I_HELP) if (health > 0) - M.visible_message("[M] [response_help] \the [src].") + M.visible_message("\The [M] [response_help] \the [src].") poke() if(I_DISARM) - M.visible_message("[M] [response_disarm] \the [src].") + M.visible_message("\The [M] [response_disarm] \the [src]") M.do_attack_animation(src) poke(1) //TODO: Push the mob away or something @@ -404,7 +405,7 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) G.affecting = src LAssailant = WEAKREF(M) - M.visible_message("[M] has grabbed [src] passively!") + M.visible_message(SPAN_WARNING("\The [M] has grabbed \the [src] passively!")) M.do_attack_animation(src) poke(1) @@ -415,7 +416,7 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) /mob/living/simple_animal/proc/unarmed_harm_attack(var/mob/living/carbon/human/user) apply_damage(harm_intent_damage, BRUTE, used_weapon = "Attack by [user.name]") - user.visible_message(SPAN_WARNING("[user] [response_harm] \the [src]!")) + user.visible_message(SPAN_WARNING("\The [user] [response_harm] \the [src]!"), SPAN_WARNING("You [response_harm] \the [src]!")) user.do_attack_animation(src) poke(TRUE) @@ -427,13 +428,13 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) var/obj/item/reagent_containers/glass/G = O if(stat == CONSCIOUS && istype(G) && G.is_open_container()) if(udder.total_volume <= 0) - to_chat(user, "The udder is dry.") + to_chat(user, SPAN_WARNING("The udder is dry.")) return if(G.reagents.total_volume >= G.volume) - to_chat(user, "The [O] is full.") + to_chat(user, SPAN_WARNING("The [O] is full.")) return - user.visible_message("[user] milks [src] using \the [O].") - udder.trans_type_to(G, milk_type , rand(5,10)) + user.visible_message("\The [user] milks \the [src] using \the [O].") + udder.trans_type_to(G, milk_type, rand(5, 10)) return if(istype(O, /obj/item/reagent_containers) || istype(O, /obj/item/stack/medical) || istype(O,/obj/item/gripper/)) @@ -453,14 +454,14 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) return user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(istype(O, brush) && canbrush) //Brushing animals - visible_message(SPAN_NOTICE("[user] gently brushes [src] with \the [O].")) + visible_message("\The [user] gently brushes \the [src] with \the [O].") if(prob(15) && !istype(src, /mob/living/simple_animal/hostile)) //Aggressive animals don't purr before biting your face off. - visible_message(SPAN_NOTICE("[src] [speak_emote.len ? pick(speak_emote) : "rumbles"].")) //purring + visible_message("[capitalize_first_letters(src.name)] [speak_emote.len ? pick(speak_emote) : "rumbles"].") //purring return if(!O.force) - visible_message("[user] gently taps [src] with \the [O].") + visible_message("\The [user] gently taps \the [src] with \the [O].") poke() - return 0 + return FALSE if(O.force > resistance) var/damage = O.force @@ -473,10 +474,10 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) apply_damage(damage, O.damtype, used_weapon = "[O.name]") poke(1) else - to_chat(usr, "This weapon is ineffective, it does no damage.") + to_chat(user, SPAN_WARNING("This weapon is ineffective, it does no damage.")) poke() - visible_message("\The [src] has been attacked with the [O] by [user].") + visible_message(SPAN_DANGER("\The [src] has been attacked with \the [O] by \the [user].")) user.do_attack_animation(src) @@ -622,11 +623,11 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) new path(get_turf(src)) if(issmall(src)) - user.visible_message("[user] chops up \the [src]!") + user.visible_message("\The [user] chops up \the [src]!") new/obj/effect/decal/cleanable/blood/splatter(get_turf(src)) qdel(src) else - user.visible_message("[user] butchers \the [src] messily!") + user.visible_message("\The [user] butchers \the [src] messily!") gib() //For picking up small animals @@ -695,7 +696,7 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) apply_damage(shock_damage, BURN) playsound(loc, "sparks", 50, 1, -1) spark(loc, 5, alldirs) - visible_message("[src] was shocked by [source]!", "You are shocked by [source]!", "You hear an electrical crack.") + visible_message(SPAN_WARNING("\The [src] was shocked by \the [source]!"), SPAN_WARNING("You are shocked by \the [source]!"), SPAN_WARNING("You hear an electrical crack!")) /mob/living/simple_animal/can_fall() @@ -754,4 +755,7 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj) SSghostroles.remove_spawn_atom("wizard_familiar", src) if(wizard_master) add_spell(new /spell/contract/return_master(wizard_master), "const_spell_ready") - to_chat(src, "You are [src], a familiar to [wizard_master]. He is your master and your friend. Aid him in his wizarding duties to the best of your ability.") \ No newline at end of file + to_chat(src, "You are [src], a familiar to [wizard_master]. He is your master and your friend. Aid him in his wizarding duties to the best of your ability.") + +/mob/living/simple_animal/get_resist_power() + return resist_mod \ No newline at end of file diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index ab40104cf43..caddf441a4d 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -169,6 +169,9 @@ if(do_mob(assailant, affecting, 150)) A.visible_message(SPAN_WARNING("[A] falls unconscious..."), FONT_LARGE(SPAN_DANGER("The world goes dark as you fall unconscious..."))) A.Paralyse(20) + else if(istype(affecting, /mob/living/simple_animal)) + if(affecting.stat != DEAD) + affecting.health -= 1 adjust_position() diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index a4cce0595e5..e2fa12d0574 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -376,10 +376,10 @@ !lying && thrust.allow_thrust(0.01, src)) return FALSE - for(var/mob/living/carbon/human/H in range(1, src)) // can't fall if someone's holding you - for(var/obj/item/grab/G in list(H.l_hand, H.r_hand)) - if(G.state >= GRAB_AGGRESSIVE && G.affecting == src) - return FALSE + for(var/grab in grabbed_by) + var/obj/item/grab/G = grab + if(G.state >= GRAB_AGGRESSIVE) + return FALSE return ..() /mob/living/carbon/human/bst/can_fall() diff --git a/html/changelogs/geeves-simple_mob_improvements.yml b/html/changelogs/geeves-simple_mob_improvements.yml new file mode 100644 index 00000000000..339ee39b83e --- /dev/null +++ b/html/changelogs/geeves-simple_mob_improvements.yml @@ -0,0 +1,9 @@ +author: Geeves + +delete-after: True + +changes: + - tweak: "Tweaked various simple animal messages to make it look better in the chat log." + - tweak: "Aggressive grabs no longer refer to 'by the hands'." + - rscadd: "Getting a neck grab or higher on an aggressive animal restrains them from attacking." + - rscadd: "Strangling an animal now properly does damage to them." \ No newline at end of file