Technomancer Golem Tweaks & Simple Animal Health "Refactor"

Simple animals now use the base health system that most other mobs use.
Fixes a bunch of Destroy()s so that they should qdel properly.
Mend Synthetic can heal synthetic simple animals.
Adds attack and spellcast animations to the golem.
Adds system to manually flick because byond is stupid sometimes.
Removes shield and reflect spells from the golem since SAs can't use shields at the moment.
Adds more helpful spells to the golem.
Golem and the Lost Drone now use the 'synthetic_evil' speech bubble.
This commit is contained in:
Neerti
2017-09-30 22:24:42 -04:00
parent 34f5b7b6bf
commit b8a7749351
16 changed files with 146 additions and 81 deletions
+1 -1
View File
@@ -293,7 +293,7 @@ default behaviour is:
return fireloss
/mob/living/proc/getActualFireLoss() // Mostly for humans with robolimbs.
return getBruteLoss()
return getFireLoss()
/mob/living/proc/adjustFireLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
@@ -22,6 +22,9 @@
playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0)
/mob/living/silicon/robot/lost/speech_bubble_appearance()
return "synthetic_evil"
/mob/living/silicon/robot/lost/randomlaws
/mob/living/silicon/robot/lost/randomlaws/init()
@@ -227,19 +227,14 @@
//Should we be dead?
/mob/living/simple_animal/updatehealth()
health = getMaxHealth() - getToxLoss() - getFireLoss() - getBruteLoss()
//Alive, becoming dead
if((stat < DEAD) && (health <= 0))
death()
//Dead, becoming alive
else if((stat >= DEAD) && (health > 0))
dead_mob_list -= src
living_mob_list += src
stat = CONSCIOUS
density = 1
//Overhealth
else if(health > getMaxHealth())
if(health > getMaxHealth())
health = getMaxHealth()
/mob/living/simple_animal/update_icon()
@@ -621,6 +616,16 @@
var/tally = 0 //Incase I need to add stuff other than "speed" later
tally = speed
if(force_max_speed)
return -3
for(var/datum/modifier/M in modifiers)
if(!isnull(M.haste) && M.haste == TRUE)
return -3
if(!isnull(M.slowdown))
tally += M.slowdown
if(purge)//Purged creatures will move more slowly. The more time before their purge stops, the slower they'll move.
if(tally <= 0)
tally = 1
@@ -674,52 +679,6 @@
if(3.0)
adjustBruteLoss(30)
// Don't understand why simple animals don't use the regular /mob/living health system.
/mob/living/simple_animal/adjustBruteLoss(damage)
if(damage > 0)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.incoming_damage_percent))
damage *= M.incoming_damage_percent
if(!isnull(M.incoming_brute_damage_percent))
damage *= M.incoming_brute_damage_percent
else if(damage < 0)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.incoming_healing_percent))
damage *= M.incoming_healing_percent
health = Clamp(health - damage, 0, getMaxHealth())
updatehealth()
/mob/living/simple_animal/adjustFireLoss(damage)
if(damage > 0)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.incoming_damage_percent))
damage *= M.incoming_damage_percent
if(!isnull(M.incoming_fire_damage_percent))
damage *= M.incoming_brute_damage_percent
else if(damage < 0)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.incoming_healing_percent))
damage *= M.incoming_healing_percent
health = Clamp(health - damage, 0, getMaxHealth())
updatehealth()
/mob/living/simple_animal/adjustToxLoss(damage)
if(damage > 0)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.incoming_damage_percent))
damage *= M.incoming_damage_percent
if(!isnull(M.incoming_tox_damage_percent))
damage *= M.incoming_brute_damage_percent
else if(damage < 0)
for(var/datum/modifier/M in modifiers)
if(!isnull(M.incoming_healing_percent))
damage *= M.incoming_healing_percent
health = Clamp(health - damage, 0, getMaxHealth())
updatehealth()
// Check target_mob if worthy of attack (i.e. check if they are dead or empty mecha)
/mob/living/simple_animal/proc/SA_attackable(target_mob)
ai_log("SA_attackable([target_mob])",3)
@@ -1238,6 +1197,9 @@
if(!isnull(M.outgoing_melee_damage_percent))
damage_to_do *= M.outgoing_melee_damage_percent
if(attack_sound)
playsound(src, attack_sound, 75, 1)
// SA attacks can be blocked with shields.
if(ishuman(A))
var/mob/living/carbon/human/H = A
+1 -1
View File
@@ -123,7 +123,7 @@
// Removes all modifiers of a type
/mob/living/proc/remove_modifiers_of_type(var/modifier_type, var/silent = FALSE)
for(var/datum/modifier/M in modifiers)
if(istype(M, modifier_type))
if(ispath(M.type, modifier_type))
M.expire(silent)
// Removes all modifiers, useful if the mob's being deleted