Adds delayed mob regeneration (#9619)

* Adds sitting and resting icon functions

* Adds mob delayed resurrection

* Changes stuff as pointed out on github

* Changelog, and makes Norris regenerate
This commit is contained in:
Skullyton
2016-05-06 18:34:25 +01:00
committed by clusterfack
parent b2d32ff4d3
commit 55a1b5fade
6 changed files with 66 additions and 1 deletions

View File

@@ -576,4 +576,4 @@
if(href_list["remove_inv"] || href_list["add_inv"]) if(href_list["remove_inv"] || href_list["add_inv"])
to_chat(usr, "<span class='warning'>[src] won't wear that!</span>") to_chat(usr, "<span class='warning'>[src] won't wear that!</span>")
return return
..() ..()

View File

@@ -94,6 +94,10 @@
emote_hear = list("screams") emote_hear = list("screams")
emote_see = list("screams") emote_see = list("screams")
friendly = "bites" friendly = "bites"
canRegenerate = 1
minRegenTime = 30 //It's just a crab, might as well give it quick regen
maxRegenTime = 120
/mob/living/simple_animal/crab/snowy /mob/living/simple_animal/crab/snowy
name = "Snowy" name = "Snowy"

View File

@@ -18,6 +18,9 @@
speed = 4 speed = 4
size = SIZE_BIG size = SIZE_BIG
move_to_delay = 4 move_to_delay = 4
canRegenerate = 1
minRegenTime = 300
maxRegenTime = 1200
min_oxy = 0 min_oxy = 0
max_oxy = 0 max_oxy = 0

View File

@@ -56,6 +56,10 @@
move_to_delay = 6 move_to_delay = 6
maxHealth = 100 maxHealth = 100
health = 100 health = 100
canRegenerate = 1
minRegenTime = 300
maxRegenTime = 1800
harm_intent_damage = 15 harm_intent_damage = 15
melee_damage_lower = 10 melee_damage_lower = 10

View File

@@ -82,6 +82,12 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
var/supernatural = 0 var/supernatural = 0
var/purge = 0 var/purge = 0
//For those that we want to just pop back up a little while after they're killed
var/canRegenerate = 0 //If 1, it qualifies for regeneration
var/isRegenerating = 0 //To stop life calling the proc multiple times
var/minRegenTime = 0
var/maxRegenTime = 0
universal_speak = 1 universal_speak = 1
universal_understand = 1 universal_understand = 1
@@ -142,6 +148,8 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
stat = CONSCIOUS stat = CONSCIOUS
density = 1 density = 1
update_canmove() update_canmove()
if(canRegenerate && !isRegenerating)
src.delayedRegen()
return 0 return 0
@@ -163,6 +171,8 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
if(purge) if(purge)
purge -= 1 purge -= 1
isRegenerating = 0
//Movement //Movement
if((!client||deny_client_move) && !stop_automated_movement && wander && !anchored && (ckey == null) && !(flags & INVULNERABLE)) if((!client||deny_client_move) && !stop_automated_movement && wander && !anchored && (ckey == null) && !(flags & INVULNERABLE))
if(isturf(src.loc) && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc. if(isturf(src.loc) && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
@@ -702,4 +712,12 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
if(!supernatural) if(!supernatural)
adjustBruteLoss(volume * 0.5) adjustBruteLoss(volume * 0.5)
/mob/living/simple_animal/proc/delayedRegen()
set waitfor = 0
isRegenerating = 1
sleep(rand(minRegenTime, maxRegenTime)) //Don't want it being predictable
src.resurrect()
src.revive()
visible_message("<span class='warning'>[src] appears to wake from the dead, having healed all wounds.</span>")
/datum/locking_category/simple_animal /datum/locking_category/simple_animal

View File

@@ -0,0 +1,36 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscdel (general deleting of nice things)
# rscadd (general adding of nice things)
# imageadd
# imagedel
# spellcheck (typo fixes)
# experiment
# tgs (TG-ported fixes?)
#################################
# Your name.
author: Skullyton
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# There needs to be a space after the - and before the prefix. Don't use tabs anywhere in this file.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# If you're using characters such as # ' : - or the like in your changelog, surround the entire change with quotes as shown in the second example. These quotes don't show up on the changelog once it's merged and prevent errors.
# SCREW ANY OF THIS UP AND IT WON'T WORK.
changes:
- rscadd: Adds back-from-the-dead regeneration for simple mobs, and adds it to certain mobs. Said mobs will need to have their bodies destroyed in some way to keep them down.