mob/living/Life() now handles fire.

Aliens (largery un-used on Bay) and robots now deal with fire differently.
This commit is contained in:
PsiOmega
2015-06-14 11:26:52 +02:00
parent 03be640d01
commit 1a7e8976af
6 changed files with 42 additions and 17 deletions
@@ -173,3 +173,9 @@
src << "\red You feel a searing heat!"
else
if (fire) fire.icon_state = "fire0"
/mob/living/carbon/alien/handle_fire()
if(..())
return
bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up!
return
@@ -93,9 +93,6 @@
if(life_tick > 5 && timeofdeath && (timeofdeath < 5 || world.time - timeofdeath > 6000)) //We are long dead, or we're junk mobs spawned like the clowns on the clown shuttle
return //We go ahead and process them 5 times for HUD images and other stuff though.
//Check if we're on fire
handle_fire()
//Status updates, death etc.
handle_regular_status_updates() //Optimized a bit
update_canmove()
+3
View File
@@ -26,6 +26,9 @@
. = 1
//Check if we're on fire
handle_fire()
//Handle temperature/pressure differences between body and environment
if(environment)
handle_environment(environment)
+12 -12
View File
@@ -219,7 +219,7 @@
/mob/living/proc/handle_fire()
if(fire_stacks < 0)
fire_stacks = max(0, fire_stacks++) //If we've doused ourselves in water to avoid fire, dry off slowly
fire_stacks = min(0, fire_stacks++) //If we've doused ourselves in water to avoid fire, dry off slowly
if(!on_fire)
return 1
@@ -324,49 +324,49 @@
//If simple_animals are ever moved under carbon, then this can probably be moved to carbon as well
/mob/living/proc/attack_throat(obj/item/W, obj/item/weapon/grab/G, mob/user)
// Knifing
if(!W.edge || !W.force || W.damtype != BRUTE) return //unsuitable weapon
user.visible_message("<span class='danger'>\The [user] begins to slit [src]'s throat with \the [W]!</span>")
user.next_move = world.time + 20 //also should prevent user from triggering this repeatedly
if(!do_after(user, 20))
return
if(!(G && G.assailant == user && G.affecting == src)) //check that we still have a grab
return
var/damage_mod = 1
//presumably, if they are wearing a helmet that stops pressure effects, then it probably covers the throat as well
var/obj/item/clothing/head/helmet = get_equipped_item(slot_head)
if(istype(helmet) && (helmet.body_parts_covered & HEAD) && (helmet.flags & STOPPRESSUREDAMAGE))
//we don't do an armor_check here because this is not an impact effect like a weapon swung with momentum, that either penetrates or glances off.
damage_mod = 1.0 - (helmet.armor["melee"]/100)
var/total_damage = 0
for(var/i in 1 to 3)
var/damage = min(W.force*1.5, 20)*damage_mod
apply_damage(damage, W.damtype, "head", 0, sharp=W.sharp, edge=W.edge)
total_damage += damage
var/oxyloss = total_damage
if(total_damage >= 40) //threshold to make someone pass out
oxyloss = 60 // Brain lacks oxygen immediately, pass out
adjustOxyLoss(min(oxyloss, 100 - getOxyLoss())) //don't put them over 100 oxyloss
if(total_damage)
if(oxyloss >= 40)
user.visible_message("<span class='danger'>\The [user] slit [src]'s throat open with \the [W]!</span>")
else
user.visible_message("<span class='danger'>\The [user] cut [src]'s neck with \the [W]!</span>")
if(W.hitsound)
playsound(loc, W.hitsound, 50, 1, -1)
G.last_action = world.time
flick(G.hud.icon_state, G.hud)
user.attack_log += "\[[time_stamp()]\]<font color='red'> Knifed [name] ([ckey]) with [W.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(W.damtype)])</font>"
src.attack_log += "\[[time_stamp()]\]<font color='orange'> Got knifed by [user.name] ([user.ckey]) with [W.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(W.damtype)])</font>"
msg_admin_attack("[key_name(user)] knifed [key_name(src)] with [W.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(W.damtype)])" )
@@ -331,3 +331,12 @@
if(paralysis || stunned || weakened || buckled || lockcharge || !is_component_functioning("actuator")) canmove = 0
else canmove = 1
return canmove
/mob/living/silicon/robot/update_fire()
overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")
if(on_fire)
overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")
/mob/living/silicon/robot/fire_act()
if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
IgniteMob()
@@ -295,7 +295,7 @@
if(!O.force)
visible_message("<span class='notice'>[user] gently taps [src] with \the [O].</span>")
return
if(O.force > resistance)
var/damage = O.force
if (O.damtype == HALLOSS)
@@ -306,7 +306,7 @@
adjustBruteLoss(damage)
else
usr << "<span class='danger>This weapon is ineffective, it does no damage.</span>"
visible_message("<span class='danger>[src] has been attacked with the [O] by [user].</span>")
user.do_attack_animation(src)
@@ -404,3 +404,13 @@
else
user.visible_message("<span class='danger'>[user] butchers \the [src] messily!</span>")
gib()
/mob/living/simple_animal/handle_fire()
return
/mob/living/simple_animal/update_fire()
return
/mob/living/simple_animal/IgniteMob()
return
/mob/living/simple_animal/ExtinguishMob()
return