[MIRROR] fixes silly stuff about basic mobs [MDB IGNORE] (#18368)

* fixes silly stuff about basic mobs

* merge conflicts, also apply upstream 72120

Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
This commit is contained in:
SkyratBot
2023-01-09 06:00:48 -05:00
committed by GitHub
co-authored by Fikou tastyfish
parent 2797bd39cf
commit 36bc850a11
12 changed files with 84 additions and 143 deletions
+18 -17
View File
@@ -38,8 +38,10 @@
///What kind of objects this mob can smash.
var/environment_smash = ENVIRONMENT_SMASH_NONE
/// 1 for full damage , 0 for none , -1 for 1:1 heal from that source.
/// 1 for full damage, 0 for none, -1 for 1:1 heal from that source.
var/list/damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 1, CLONE = 1, STAMINA = 0, OXY = 1)
///Minimum force required to deal any damage.
var/force_threshold = 0
///Verbs used for speaking e.g. "Says" or "Chitters". This can be elementized
var/list/speak_emote = list()
@@ -75,10 +77,6 @@
var/icon_dead = ""
///We only try to show a gibbing animation if this exists.
var/icon_gib = null
///Flip the sprite upside down on death. Mostly here for things lacking custom dead sprites.
var/flip_on_death = FALSE
///Removes density upon death, restores the original state if alive.
var/become_passable_on_death = TRUE
///If the mob can be spawned with a gold slime core. HOSTILE_SPAWN are spawned with plasma, FRIENDLY_SPAWN are spawned with blood.
var/gold_core_spawnable = NO_SPAWN
@@ -139,32 +137,35 @@
. = ..()
if(basic_mob_flags & DEL_ON_DEATH)
qdel(src)
else
health = 0
icon_state = icon_dead
if(flip_on_death)
transform = transform.Turn(180)
if (become_passable_on_death)
set_density(FALSE)
return
health = 0
icon_state = icon_dead
if(basic_mob_flags & FLIP_ON_DEATH)
transform = transform.Turn(180)
if(basic_mob_flags & UNDENSIFY_ON_DEATH)
set_density(FALSE)
/mob/living/basic/revive(full_heal_flags = NONE, excess_healing = 0, force_grab_ghost = FALSE)
. = ..()
if (!.)
return
icon_state = icon_living
if (flip_on_death)
if(basic_mob_flags & FLIP_ON_DEATH)
transform = transform.Turn(180)
if (become_passable_on_death)
if(basic_mob_flags & UNDENSIFY_ON_DEATH)
set_density(initial(density))
/mob/living/basic/proc/melee_attack(atom/target)
src.face_atom(target)
/mob/living/basic/proc/melee_attack(atom/target, list/modifiers)
face_atom(target)
if(SEND_SIGNAL(src, COMSIG_HOSTILE_PRE_ATTACKINGTARGET, target) & COMPONENT_HOSTILE_NO_ATTACK)
return FALSE //but more importantly return before attack_animal called
var/result = target.attack_basic_mob(src)
var/result = target.attack_basic_mob(src, modifiers)
SEND_SIGNAL(src, COMSIG_HOSTILE_POST_ATTACKINGTARGET, target, result)
return result
/mob/living/basic/resolve_unarmed_attack(atom/attack_target, list/modifiers)
melee_attack(attack_target, modifiers)
/mob/living/basic/vv_edit_var(vname, vval)
. = ..()
if(vname == NAMEOF(src, speed))
+47 -51
View File
@@ -70,36 +70,31 @@
/mob/living/basic/attack_alien(mob/living/carbon/alien/adult/user, list/modifiers)
if(..()) //if harm or disarm intent.
if(LAZYACCESS(modifiers, RIGHT_CLICK))
playsound(loc, 'sound/weapons/pierce.ogg', 25, TRUE, -1)
visible_message(span_danger("[user] [response_disarm_continuous] [name]!"), \
span_userdanger("[user] [response_disarm_continuous] you!"), null, COMBAT_MESSAGE_RANGE, user)
to_chat(user, span_danger("You [response_disarm_simple] [name]!"))
log_combat(user, src, "disarmed")
else
var/damage = rand(15, 30)
visible_message(span_danger("[user] slashes at [src]!"), \
span_userdanger("You're slashed at by [user]!"), null, COMBAT_MESSAGE_RANGE, user)
to_chat(user, span_danger("You slash at [src]!"))
playsound(loc, 'sound/weapons/slice.ogg', 25, TRUE, -1)
attack_threshold_check(damage)
log_combat(user, src, "attacked")
return 1
. = ..()
if(!.)
return
if(LAZYACCESS(modifiers, RIGHT_CLICK))
playsound(loc, 'sound/weapons/pierce.ogg', 25, TRUE, -1)
visible_message(span_danger("[user] [response_disarm_continuous] [name]!"), \
span_userdanger("[user] [response_disarm_continuous] you!"), null, COMBAT_MESSAGE_RANGE, user)
to_chat(user, span_danger("You [response_disarm_simple] [name]!"))
log_combat(user, src, "disarmed")
return
var/damage = rand(user.melee_damage_lower, user.melee_damage_upper)
visible_message(span_danger("[user] slashes at [src]!"), \
span_userdanger("You're slashed at by [user]!"), null, COMBAT_MESSAGE_RANGE, user)
to_chat(user, span_danger("You slash at [src]!"))
playsound(loc, 'sound/weapons/slice.ogg', 25, TRUE, -1)
attack_threshold_check(damage)
log_combat(user, src, "attacked")
/mob/living/basic/attack_larva(mob/living/carbon/alien/larva/L, list/modifiers)
/mob/living/basic/attack_larva(mob/living/carbon/alien/larva/attacking_larva, list/modifiers)
. = ..()
if(. && stat != DEAD) //successful larva bite
var/damage = rand(5, 10)
var/damage = rand(attacking_larva.melee_damage_lower, attacking_larva.melee_damage_upper)
. = attack_threshold_check(damage)
if(.)
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
/mob/living/basic/attack_basic_mob(mob/living/basic/user, list/modifiers)
. = ..()
if(.)
var/damage = rand(user.melee_damage_lower, user.melee_damage_upper)
return attack_threshold_check(damage, user.melee_damage_type)
attacking_larva.amount_grown = min(attacking_larva.amount_grown + damage, attacking_larva.max_grown)
/mob/living/basic/attack_animal(mob/living/simple_animal/user, list/modifiers)
. = ..()
@@ -114,13 +109,13 @@
damage = rand(20, 35)
return attack_threshold_check(damage)
/mob/living/basic/attack_drone(mob/living/simple_animal/drone/M)
if(M.combat_mode) //No kicking dogs even as a rogue drone. Use a weapon.
/mob/living/basic/attack_drone(mob/living/simple_animal/drone/attacking_drone)
if(attacking_drone.combat_mode) //No kicking dogs even as a rogue drone. Use a weapon.
return
return ..()
/mob/living/basic/attack_drone_secondary(mob/living/simple_animal/drone/M)
if(M.combat_mode)
/mob/living/basic/attack_drone_secondary(mob/living/simple_animal/drone/attacking_drone)
if(attacking_drone.combat_mode)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
return ..()
@@ -130,23 +125,23 @@
temp_damage = 0
else
temp_damage *= damage_coeff[damagetype]
if(actuallydamage)
apply_damage(damage, damagetype, null, getarmor(null, armorcheck))
return TRUE
if(temp_damage >= 0 && temp_damage <= force_threshold)
visible_message(span_warning("[src] looks unharmed!"))
return FALSE
else
if(actuallydamage)
apply_damage(damage, damagetype, blocked = getarmor(null, armorcheck))
return TRUE
/mob/living/basic/check_projectile_armor(def_zone, obj/projectile/impacting_projectile, is_silent)
return 0
/mob/living/basic/ex_act(severity, target, origin)
if(origin && istype(origin, /datum/spacevine_mutation) && isvineimmune(src))
return FALSE
. = ..()
if(QDELETED(src))
if(!. || QDELETED(src))
return
var/bomb_armor = getarmor(null, BOMB)
switch (severity)
switch(severity)
if (EXPLODE_DEVASTATE)
if(prob(bomb_armor))
apply_damage(500, damagetype = BRUTE)
@@ -166,13 +161,12 @@
bloss = bloss / 1.5
apply_damage(bloss, damagetype = BRUTE)
/mob/living/basic/blob_act(obj/structure/blob/B)
/mob/living/basic/blob_act(obj/structure/blob/attacking_blob)
apply_damage(20, damagetype = BRUTE)
return
/mob/living/basic/do_attack_animation(atom/A, visual_effect_icon, used_item, no_effect)
/mob/living/basic/do_attack_animation(atom/attacked_atom, visual_effect_icon, used_item, no_effect)
if(!no_effect && !visual_effect_icon && melee_damage_upper)
if(attack_vis_effect && !iswallturf(A)) // override the standard visual effect.
if(attack_vis_effect && !iswallturf(attacked_atom)) // override the standard visual effect.
visual_effect_icon = attack_vis_effect
else if(melee_damage_upper < 10)
visual_effect_icon = ATTACK_EFFECT_PUNCH
@@ -180,7 +174,6 @@
visual_effect_icon = ATTACK_EFFECT_SMASH
..()
/mob/living/basic/update_stat()
if(status_flags & GODMODE)
return
@@ -194,11 +187,14 @@
/mob/living/basic/emp_act(severity)
. = ..()
if(mob_biotypes & MOB_ROBOTIC)
switch (severity)
if (EMP_LIGHT)
visible_message(span_danger("[src] shakes violently, its parts coming loose!"))
apply_damage(maxHealth * 0.6)
Shake(5, 5, 1 SECONDS)
if (EMP_HEAVY)
visible_message(span_danger("[src] suddenly bursts apart!"))
apply_damage(maxHealth)
emp_reaction(severity)
/mob/living/basic/proc/emp_reaction(severity)
switch(severity)
if(EMP_LIGHT)
visible_message(span_danger("[src] shakes violently, its parts coming loose!"))
apply_damage(maxHealth * 0.6)
Shake(5, 5, 1 SECONDS)
if(EMP_HEAVY)
visible_message(span_danger("[src] suddenly bursts apart!"))
apply_damage(maxHealth)