From c51574aaec8dc1745cb76e0699840a2f1c8b57a0 Mon Sep 17 00:00:00 2001 From: kyunkyunkyun <120701975+kyunkyunkyun@users.noreply.github.com> Date: Sun, 23 Mar 2025 15:16:41 +0500 Subject: [PATCH] Fixes unused `melee_block_chance` for syndie mobs (#28508) * fix double attack * this check is actually working one * tested a bit more * fix block ignore --- .../simple_animal/hostile/syndicate_mobs.dm | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm b/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm index d247ce22560..d620ef8b375 100644 --- a/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/syndicate_mobs.dm @@ -7,6 +7,7 @@ icon_dead = "syndicate_dead" // Does not actually exist. del_on_death. icon_gib = "syndicate_gib" // Does not actually exist. del_on_death. mob_biotypes = MOB_ORGANIC | MOB_HUMANOID + damage_coeff = list("brute" = 1, "fire" = 1, "tox" = 0, "clone" = 0, "stamina" = 0, "oxy" = 0) speak_chance = 0 turns_per_move = 5 response_help = "pokes the" @@ -62,39 +63,22 @@ var/ranged_block_chance = 35 /mob/living/simple_animal/hostile/syndicate/melee/attack_by(obj/item/O, mob/living/user, params) - if(..()) + if(prob(melee_block_chance)) + visible_message("[src] blocks [O] with its shield!") + user.changeNext_move(CLICK_CD_MELEE) + user.do_attack_animation(src) return FINISH_ATTACK - user.changeNext_move(CLICK_CD_MELEE) - user.do_attack_animation(src) - if(O.force) - if(prob(melee_block_chance)) - visible_message("[src] blocks [O] with its shield!") - else - var/damage = O.force - if(O.damtype == STAMINA) - damage = 0 - if(force_threshold && damage < force_threshold) - visible_message("[src] is unharmed by [O]!") - return - adjustHealth(damage) - visible_message("[src] has been attacked with [O] by [user].") - playsound(loc, O.hitsound, 25, TRUE, -1) - else - to_chat(usr, "This weapon is ineffective, it does no damage.") - visible_message("[user] gently taps [src] with [O].") - - return FINISH_ATTACK + return ..() /mob/living/simple_animal/hostile/syndicate/melee/bullet_act(obj/item/projectile/Proj) if(!Proj) return if(prob(ranged_block_chance)) visible_message("[src] blocks [Proj] with its shield!") - else - if(Proj.damage_type == BRUTE || Proj.damage_type == BURN) - adjustHealth(Proj.damage) - return 0 + return + + return ..() /mob/living/simple_animal/hostile/syndicate/melee/autogib loot = list(/obj/effect/mob_spawn/human/corpse/syndicatesoldier, @@ -134,7 +118,6 @@ depotarea = get_area(src) spawn_turf = get_turf(src) - /mob/living/simple_animal/hostile/syndicate/melee/autogib/depot/ListTargetsLazy() // The normal ListTargetsLazy ignores walls, which is very bad in the case of depot mobs. So we override it. return ListTargets() @@ -248,7 +231,6 @@ return 1 return ..() - /mob/living/simple_animal/hostile/syndicate/melee/autogib/depot/officer name = "Syndicate Officer" icon_state = "syndicate_sword" @@ -325,7 +307,6 @@ depotarea.unlock_lockers() return ..() - /mob/living/simple_animal/hostile/syndicate/melee/autogib/depot/space name = "Syndicate Backup" 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) @@ -373,6 +354,7 @@ icon_living = "syndicate_smg" projectilesound = 'sound/weapons/gunshots/gunshot.ogg' casingtype = /obj/item/ammo_casing/c45 + /mob/living/simple_animal/hostile/syndicate/ranged/space icon_state = "syndicate_space_smg" icon_living = "syndicate_space_smg" @@ -387,7 +369,6 @@ /obj/effect/gibspawner/generic, /obj/effect/gibspawner/generic) - /mob/living/simple_animal/hostile/syndicate/ranged/space/Process_Spacemove(movement_dir = 0, continuous_move = FALSE) return TRUE @@ -423,7 +404,6 @@ gold_core_spawnable = HOSTILE_SPAWN del_on_death = TRUE deathmessage = "is smashed into pieces!" - initial_traits = list(TRAIT_FLYING) /mob/living/simple_animal/hostile/viscerator/Initialize(mapload)