fixes silly stuff about basic mobs (#72260)

## About The Pull Request
makes basic mob attacks call their default attacks when done by a
player, rather than calling simple mob attacks
makes basic mob attacks call simple animal attacks by default, until we
remove simplemobs
moves some stuff off to procs and flags, fixes some stuff

## Why It's Good For The Game
im moving holoparasites to basic mobs and i literally cant give them
secondary click attacks

## Changelog
🆑
fix: fixes moonicorns not applying pax
/🆑
This commit is contained in:
Fikou
2022-12-27 23:29:14 +01:00
committed by GitHub
parent ad35d261a1
commit 3daf3b0643
10 changed files with 77 additions and 135 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))