Merge pull request #983 from tigercat2000/water_act

Water_act system - for all your watery needs
This commit is contained in:
ZomgPonies
2015-05-10 16:14:55 -04:00
17 changed files with 117 additions and 9 deletions
@@ -152,6 +152,10 @@
bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up!
return
/mob/living/carbon/alien/proc/handle_wetness()
if(mob_master.current_cycle%20==2) //dry off a bit once every 20 ticks or so
wetlevel = max(wetlevel - 1,0)
return
/mob/living/carbon/alien/IsAdvancedToolUser()
return has_fine_manipulation
@@ -53,6 +53,9 @@
//Handle being on fire
handle_fire()
//Decrease wetness over time
handle_wetness()
//Status updates, death etc.
handle_regular_status_updates()
update_canmove()
-1
View File
@@ -92,7 +92,6 @@ mob/living
return
return
/mob/living/carbon/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0, var/def_zone = null)
if(status_flags & GODMODE) //godmode
return 0
@@ -14,4 +14,9 @@
visible_message("<span class='warning'>[src] catches [I]!</span>")
throw_mode_off()
return
..()
/mob/living/carbon/water_act(volume, temperature, source)
if(volume > 10) //anything over 10 volume will make the mob wetter.
wetlevel = min(wetlevel + 1,5)
..()
@@ -20,4 +20,5 @@
var/pulse = PULSE_NORM //current pulse level
var/heart_attack = 0
var/heart_attack = 0
var/wetlevel = 0 //how wet the mob is
@@ -231,6 +231,18 @@
if(fire_stacks < 0)
msg += "[t_He] looks a little soaked.\n"
switch(wetlevel)
if(1)
msg += "[t_He] looks a bit damp.\n"
if(2)
msg += "[t_He] looks a little bit wet.\n"
if(3)
msg += "[t_He] looks wet.\n"
if(4)
msg += "[t_He] looks very wet.\n"
if(5)
msg += "[t_He] looks absolutely soaked.\n"
if(nutrition < 100)
msg += "[t_He] [t_is] severely malnourished.\n"
else if(nutrition >= 500)
@@ -488,11 +488,16 @@ emp_act
..()
return
/mob/living/carbon/human/experience_pressure_difference(pressure_difference, direction)
if(shoes)
if(istype(shoes,/obj/item/clothing/shoes/magboots)) //TODO: Make a not-shit shoe var system to negate airflow.
var/obj/item/clothing/shoes/magboots/MB = shoes
if(MB.magpulse)
return 0
..()
..()
/mob/living/carbon/human/water_act(volume, temperature, source)
..()
if(temperature >= 330) bodytemperature = bodytemperature + (temperature - bodytemperature)
if(temperature <= 280) bodytemperature = bodytemperature - (bodytemperature - temperature)
@@ -108,6 +108,9 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
//Check if we're on fire
handle_fire()
//Decrease wetness over time
handle_wetness()
//stuff in the stomach
handle_stomach()
@@ -547,6 +550,10 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
return
//END FIRE CODE
proc/handle_wetness()
if(mob_master.current_cycle%20==2) //dry off a bit once every 20 ticks or so
wetlevel = max(wetlevel - 1,0)
return
/*
proc/adjust_body_temperature(current, loc_temp, boost)
@@ -32,6 +32,20 @@
if(10)
msg += "<span class='warning'><B>It is radiating with massive levels of electrical activity!</B></span>\n"
msg += "<span class='warning'>"
switch(wetlevel)
if(1)
msg += "It looks a bit damp.\n"
if(2)
msg += "It looks a little bit wet.\n"
if(3)
msg += "It looks wet.\n"
if(4)
msg += "It looks very wet.\n"
if(5)
msg += "It looks absolutely soaked.\n"
msg += "</span>"
msg += "*---------*</span>"
usr << msg
return
@@ -42,6 +42,8 @@
handle_regular_status_updates() // Status updates, death etc.
handle_wetness()
/mob/living/carbon/slime/proc/AIprocess() // the master AI process
if(AIproc || stat == DEAD || client) return
@@ -285,6 +287,11 @@
else
Evolve()
/mob/living/carbon/slime/proc/handle_wetness()
if(mob_master.current_cycle%20==2) //dry off a bit once every 20 ticks or so
wetlevel = max(wetlevel - 1,0)
return
/mob/living/carbon/slime/proc/handle_targets()
if(Tempstun)
if(!Victim) // not while they're eating!
@@ -40,6 +40,20 @@
msg += "It isn't responding to anything around it; it seems to be asleep.\n"
msg += "</span>"
msg += "<span class='warning'>"
switch(wetlevel)
if(1)
msg += "It looks a bit damp.\n"
if(2)
msg += "It looks a little bit wet.\n"
if(3)
msg += "It looks wet.\n"
if(4)
msg += "It looks very wet.\n"
if(5)
msg += "It looks absolutely soaked.\n"
msg += "</span>"
if (src.digitalcamo)
msg += "It is repulsively uncanny!\n"
@@ -62,6 +62,9 @@
//Check if we're on fire
handle_fire()
//Decrease wetness over time
handle_wetness()
//Status updates, death etc.
handle_regular_status_updates()
update_canmove()
@@ -660,4 +663,9 @@
return
adjustFireLoss(6)
return
//END FIRE CODE
//END FIRE CODE
proc/handle_wetness()
if(mob_master.current_cycle%20==2) //dry off a bit once every 20 ticks or so
wetlevel = max(wetlevel - 1,0)
return
@@ -238,6 +238,10 @@
//Mobs on Fire end
/mob/living/water_act(volume, temperature)
if(volume >= 20) fire_stacks -= 0.5
if(volume >= 50) fire_stacks -= 1
//This is called when the mob is thrown into a dense turf
/mob/living/proc/turf_collision(var/turf/T, var/speed)
src.take_organ_damage(speed*5)