Merge pull request #5045 from Fox-McCloud/tg-weather

Ports TG's Weather System
This commit is contained in:
TheDZD
2016-07-16 12:04:17 -04:00
committed by GitHub
15 changed files with 363 additions and 89 deletions
+4
View File
@@ -83,6 +83,9 @@
<A href='?src=\ref[src];secretsfun=securitylevel3'>Security Level - Gamma</A>&nbsp;&nbsp;
<A href='?src=\ref[src];secretsfun=securitylevel4'>Security Level - Epsilon</A>&nbsp;&nbsp;
<A href='?src=\ref[src];secretsfun=securitylevel5'>Security Level - Delta</A><BR>
<b>Create Weather</b><BR>
<A href='?src=\ref[src];secretsfun=weatherashstorm'>Weather - Ash Storm</A>&nbsp;&nbsp;
<A href='?src=\ref[src];secretsfun=weatherdarkness'>Weather - Advanced Darkness</A>&nbsp;&nbsp;
<BR>
</center>"}
@@ -104,6 +107,7 @@
<A href='?src=\ref[src];secretsfun=onlyoneteam'>Dodgeball (TDM)!</A><BR>
<b>Round-enders</b><br>
<A href='?src=\ref[src];secretsfun=floorlava'>The floor is lava! (DANGEROUS: extremely lame)</A><BR>
<A href='?src=\ref[src];secretsfun=fakelava'>The floor is fake-lava! (non-harmful)</A><BR>
<A href='?src=\ref[src];secretsfun=monkey'>Turn all humans into monkeys</A><BR>
<A href='?src=\ref[src];secretsfun=fakeguns'>Make all items look like guns</A><BR>
<A href='?src=\ref[src];secretsfun=prisonwarp'>Warp all Players to Prison</A><BR>
+29 -52
View File
@@ -2548,60 +2548,37 @@
L.fix()
message_admins("[key_name_admin(usr)] fixed all lights", 1)
if("floorlava")
if(floorIsLava)
to_chat(usr, "The floor is lava already.")
feedback_inc("admin_secrets_fun_used", 1)
feedback_add_details("admin_secrets_fun_used", "LF")
var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
if(sure == "No")
return
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","LF")
//Options
var/length = input(usr, "How long will the lava last? (in seconds)", "Length", 180) as num
length = min(abs(length), 1200)
var/damage = input(usr, "How deadly will the lava be?", "Damage", 2) as num
damage = min(abs(damage), 100)
var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "YES!", "Nah")
if(sure == "Nah")
weather_master.run_weather("the floor is lava")
message_admins("[key_name_admin(usr)] made the floor lava")
if("fakelava")
feedback_inc("admin_secrets_fun_used", 1)
feedback_add_details("admin_secrets_fun_used", "LZ")
var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
if(sure == "No")
return
floorIsLava = 1
message_admins("[key_name_admin(usr)] made the floor LAVA! It'll last [length] seconds and it will deal [damage] damage to everyone.", 1)
for(var/turf/simulated/floor/F in world)
if((F.z in config.station_levels))
F.name = "lava"
F.desc = "The floor is LAVA!"
F.overlays += "lava"
F.lava = 1
spawn(0)
for(var/i = i, i < length, i++) // 180 = 3 minutes
if(damage)
for(var/mob/living/carbon/L in living_mob_list)
if(istype(L.loc, /turf/simulated/floor)) // Are they on LAVA?!
var/turf/simulated/floor/F = L.loc
if(F.lava)
var/safe = 0
for(var/obj/structure/O in F.contents)
if(O.level > F.level && !istype(O, /obj/structure/window)) // Something to stand on and it isn't under the floor!
safe = 1
break
if(!safe)
L.adjustFireLoss(damage)
sleep(10)
for(var/turf/simulated/floor/F in world) // Reset everything.
if((F.z in config.station_levels))
F.name = initial(F.name)
F.desc = initial(F.desc)
F.overlays.Cut()
F.lava = 0
F.update_icon()
floorIsLava = 0
return
weather_master.run_weather("fake lava")
message_admins("[key_name_admin(usr)] made aesthetic lava on the floor")
if("weatherashstorm")
feedback_inc("admin_secrets_fun_used", 1)
feedback_add_details("admin_secrets_fun_used", "WA")
var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
if(sure == "No")
return
weather_master.run_weather("ash storm")
message_admins("[key_name_admin(usr)] spawned an ash storm on the mining asteroid")
if("weatherdarkness")
feedback_inc("admin_secrets_fun_used", 1)
feedback_add_details("admin_secrets_fun_used", "WD")
var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
if(sure == "No")
return
weather_master.run_weather("advanced darkness")
message_admins("[key_name_admin(usr)] made the station go through advanced darkness")
if("retardify")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","RET")
+12 -27
View File
@@ -490,6 +490,16 @@
return
if(RESIST_HEAT in mutations)
return
var/thermal_protection = get_thermal_protection()
if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT)
return
if(thermal_protection >= FIRE_SUIT_MAX_TEMP_PROTECT)
bodytemperature += 11
else
bodytemperature += BODYTEMP_HEATING_MAX
/mob/living/carbon/human/proc/get_thermal_protection()
var/thermal_protection = 0 //Simple check to estimate how protected we are against multiple temperatures
if(wear_suit)
if(wear_suit.max_heat_protection_temperature >= FIRE_SUIT_MAX_TEMP_PROTECT)
@@ -498,34 +508,9 @@
if(head.max_heat_protection_temperature >= FIRE_HELM_MAX_TEMP_PROTECT)
thermal_protection += (head.max_heat_protection_temperature*THERMAL_PROTECTION_HEAD)
thermal_protection = round(thermal_protection)
if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT)
return
if(thermal_protection >= FIRE_SUIT_MAX_TEMP_PROTECT)
bodytemperature += 11
return
else
bodytemperature += BODYTEMP_HEATING_MAX
return
//END FIRE CODE
return thermal_protection
/*
/mob/living/carbon/human/proc/adjust_body_temperature(current, loc_temp, boost)
var/temperature = current
var/difference = abs(current-loc_temp) //get difference
var/increments// = difference/10 //find how many increments apart they are
if(difference > 50)
increments = difference/5
else
increments = difference/10
var/change = increments*boost // Get the amount to change by (x per increment)
var/temp_change
if(current < loc_temp)
temperature = min(loc_temp, temperature+change)
else if(current > loc_temp)
temperature = max(loc_temp, temperature-change)
temp_change = (temperature - current)
return temp_change
*/
//END FIRE CODE
/mob/living/carbon/human/proc/stabilize_temperature_from_calories()
if(bodytemperature <= species.cold_level_1) //260.15 is 310.15 - 50, the temperature where you start to feel effects.
@@ -54,6 +54,8 @@
var/list/butcher_results = null
var/list/weather_immunities = list()
var/list/surgeries = list() //a list of surgery datums. generally empty, they're added when the player wants them.
var/gene_stability = DEFAULT_GENE_STABILITY