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
This commit is contained in:
kyunkyunkyun
2025-03-23 15:16:41 +05:00
committed by GitHub
parent d59a8bdb28
commit c51574aaec
@@ -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("<span class='boldwarning'>[src] blocks [O] with its shield!</span>")
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("<span class='boldwarning'>[src] blocks [O] with its shield!</span>")
else
var/damage = O.force
if(O.damtype == STAMINA)
damage = 0
if(force_threshold && damage < force_threshold)
visible_message("<span class='boldwarning'>[src] is unharmed by [O]!</span>")
return
adjustHealth(damage)
visible_message("<span class='boldwarning'>[src] has been attacked with [O] by [user].</span>")
playsound(loc, O.hitsound, 25, TRUE, -1)
else
to_chat(usr, "<span class='warning'>This weapon is ineffective, it does no damage.</span>")
visible_message("<span class='warning'>[user] gently taps [src] with [O].</span>")
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("<span class='danger'>[src] blocks [Proj] with its shield!</span>")
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)