From 240aed884ed6c160888cb4ee8896e5567c2167c6 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sun, 14 Jun 2015 11:03:03 +0200 Subject: [PATCH 001/207] mob/living/Life() now handles chemicals in the body. --- code/modules/mob/living/carbon/alien/life.dm | 7 ------- code/modules/mob/living/carbon/brain/life.dm | 6 +----- code/modules/mob/living/carbon/human/life.dm | 8 ++++---- code/modules/mob/living/carbon/metroid/life.dm | 3 +-- code/modules/mob/living/life.dm | 6 ++++++ 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index e13f6b4670..2977b31bf5 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -10,13 +10,9 @@ ..() if (stat != DEAD) //still breathing - // GROW! update_progression() - // Chemicals in the body - handle_chemicals_in_body() - blinded = null //Status updates, death etc. @@ -27,9 +23,6 @@ if(client) handle_regular_hud_updates() -/mob/living/carbon/alien/proc/handle_chemicals_in_body() - return // Nothing yet. Maybe check it out at a later date. - /mob/living/carbon/alien/handle_mutations_and_radiation() // Currently both Dionaea and larvae like to eat radiation, so I'm defining the diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 64f4564941..7df46c394d 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -6,10 +6,6 @@ set background = 1 ..() - if(stat != DEAD) - //Chemicals in the body - handle_chemicals_in_body() - //Apparently, the person who wrote this code designed it so that //blinded get reset each cycle and then get activated later in the //code. Very ugly. I dont care. Moving this stuff here so its easy @@ -91,7 +87,7 @@ adjustFireLoss(5.0*discomfort) -/mob/living/carbon/brain/proc/handle_chemicals_in_body() +/mob/living/carbon/brain/handle_chemicals_in_body() chem_effects.Cut() analgesic = 0 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 25299f19fa..bdada0e1eb 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -66,9 +66,6 @@ //Updates the number of stored chemicals for powers handle_changeling() - //Chemicals in the body - handle_chemicals_in_body() - //Disabilities handle_disabilities() @@ -845,7 +842,10 @@ return min(1,thermal_protection) -/mob/living/carbon/human/proc/handle_chemicals_in_body() +/mob/living/carbon/human/handle_chemicals_in_body() + if(in_stasis) + return + if(reagents) chem_effects.Cut() analgesic = 0 diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 00d28b3a37..a04db40e07 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -8,7 +8,6 @@ ..() if(stat != DEAD) - handle_chemicals_in_body() handle_nutrition() if (!client) @@ -74,7 +73,7 @@ temp_change = (temperature - current) return temp_change -/mob/living/carbon/slime/proc/handle_chemicals_in_body() +/mob/living/carbon/slime/handle_chemicals_in_body() chem_effects.Cut() analgesic = 0 diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 751b995c83..b7d1fa92b8 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -15,6 +15,9 @@ //Mutations and radiation handle_mutations_and_radiation() + //Chemicals in the body + handle_chemicals_in_body() + . = 1 //Handle temperature/pressure differences between body and environment @@ -27,5 +30,8 @@ /mob/living/proc/handle_mutations_and_radiation() return +/mob/living/proc/handle_chemicals_in_body() + return + /mob/living/proc/handle_environment(var/datum/gas_mixture/environment) return From a14406f83ab6e0d0ed7b4e334b6a2556c6f45289 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sun, 14 Jun 2015 11:14:31 +0200 Subject: [PATCH 002/207] mob/living/Life() now handles blood. --- code/modules/mob/living/carbon/human/life.dm | 4 ++-- code/modules/mob/living/life.dm | 6 ++++++ code/modules/organs/blood.dm | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index bdada0e1eb..aaf61f07c0 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -47,7 +47,6 @@ //to find it. blinded = null fire_alert = 0 //Reset this here, because both breathe() and handle_environment() have a chance to set it. - ..() //TODO: seperate this out // update the current life tick, can be used to e.g. only do something every 4 ticks @@ -56,6 +55,8 @@ in_stasis = istype(loc, /obj/structure/closet/body_bag/cryobag) && loc:opened == 0 if(in_stasis) loc:used++ + ..() + if(life_tick%30==15) hud_updateflag = 1022 @@ -71,7 +72,6 @@ //Organs and blood handle_organs() - handle_blood() stabilize_body_temperature() //Body temperature adjusts itself (self-regulation) //Random events (vomiting etc) diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index b7d1fa92b8..a0ac76b452 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -18,6 +18,9 @@ //Chemicals in the body handle_chemicals_in_body() + //Blood + handle_blood() + . = 1 //Handle temperature/pressure differences between body and environment @@ -33,5 +36,8 @@ /mob/living/proc/handle_chemicals_in_body() return +/mob/living/proc/handle_blood() + return + /mob/living/proc/handle_environment(var/datum/gas_mixture/environment) return diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 70c2281bb3..4c756ace0c 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -35,7 +35,9 @@ var/const/BLOOD_VOLUME_SURVIVE = 122 B.color = B.data["blood_colour"] // Takes care blood loss and regeneration -/mob/living/carbon/human/proc/handle_blood() +/mob/living/carbon/human/handle_blood() + if(in_stasis) + return if(species && species.flags & NO_BLOOD) return From 03be640d019b2281321675d4dcce7ae1439beae4 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sun, 14 Jun 2015 11:17:04 +0200 Subject: [PATCH 003/207] mob/living/Life() now handles random events (vomiting etc). --- code/modules/mob/living/carbon/human/life.dm | 8 ++++---- code/modules/mob/living/life.dm | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index aaf61f07c0..165d69bc7b 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -74,9 +74,6 @@ handle_organs() stabilize_body_temperature() //Body temperature adjusts itself (self-regulation) - //Random events (vomiting etc) - handle_random_events() - //stuff in the stomach handle_stomach() @@ -1416,7 +1413,10 @@ O.process_hud(src) if(!druggy && !seer) see_invisible = SEE_INVISIBLE_LIVING -/mob/living/carbon/human/proc/handle_random_events() +/mob/living/carbon/human/handle_random_events() + if(in_stasis) + return + // Puke if toxloss is too high if(!stat) if (getToxLoss() >= 45 && nutrition > 20) diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index a0ac76b452..b4772bf89f 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -21,6 +21,9 @@ //Blood handle_blood() + //Random events (vomiting etc) + handle_random_events() + . = 1 //Handle temperature/pressure differences between body and environment @@ -39,5 +42,8 @@ /mob/living/proc/handle_blood() return +/mob/living/proc/handle_random_events() + return + /mob/living/proc/handle_environment(var/datum/gas_mixture/environment) return From 1a7e8976afbb69f410ca5ee140c7a75f7ed8d1af Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sun, 14 Jun 2015 11:26:52 +0200 Subject: [PATCH 004/207] mob/living/Life() now handles fire. Aliens (largery un-used on Bay) and robots now deal with fire differently. --- code/modules/mob/living/carbon/alien/life.dm | 6 +++++ code/modules/mob/living/carbon/human/life.dm | 3 --- code/modules/mob/living/life.dm | 3 +++ code/modules/mob/living/living_defense.dm | 24 +++++++++---------- code/modules/mob/living/silicon/robot/life.dm | 9 +++++++ .../mob/living/simple_animal/simple_animal.dm | 14 +++++++++-- 6 files changed, 42 insertions(+), 17 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 2977b31bf5..27a73c596e 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -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 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 165d69bc7b..65cb0aface 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -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() diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index b4772bf89f..23724cc0d2 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -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) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index e0385e7d2b..24ebc4d844 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -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("\The [user] begins to slit [src]'s throat with \the [W]!") - + 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("\The [user] slit [src]'s throat open with \the [W]!") else user.visible_message("\The [user] cut [src]'s neck with \the [W]!") - + 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()]\] Knifed [name] ([ckey]) with [W.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(W.damtype)])" src.attack_log += "\[[time_stamp()]\] Got knifed by [user.name] ([user.ckey]) with [W.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(W.damtype)])" msg_admin_attack("[key_name(user)] knifed [key_name(src)] with [W.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(W.damtype)])" ) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 58159f3382..bd3e280f68 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -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() diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index e2ec5059a2..8a58d97112 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -295,7 +295,7 @@ if(!O.force) visible_message("[user] gently taps [src] with \the [O].") return - + if(O.force > resistance) var/damage = O.force if (O.damtype == HALLOSS) @@ -306,7 +306,7 @@ adjustBruteLoss(damage) else usr << "[src] has been attacked with the [O] by [user].") user.do_attack_animation(src) @@ -404,3 +404,13 @@ else user.visible_message("[user] butchers \the [src] messily!") 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 From c8b7a773993be6db98d65c38cedb2590babefbda Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 17 Jun 2015 15:19:41 +0200 Subject: [PATCH 005/207] mob/living/Life() now handles stomach contents. --- code/modules/mob/living/carbon/human/life.dm | 5 +---- code/modules/mob/living/life.dm | 12 +++++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 65cb0aface..0495bcc32b 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -74,9 +74,6 @@ handle_organs() stabilize_body_temperature() //Body temperature adjusts itself (self-regulation) - //stuff in the stomach - handle_stomach() - handle_shock() handle_pain() @@ -1426,7 +1423,7 @@ if(L && L.lum_r + L.lum_g + L.lum_b == 0) playsound_local(src,pick(scarySounds),50, 1, -1) -/mob/living/carbon/human/proc/handle_stomach() +/mob/living/carbon/human/handle_stomach() spawn(0) for(var/mob/living/M in stomach_contents) if(M.loc != src) diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 23724cc0d2..5db47928f5 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -26,13 +26,16 @@ . = 1 - //Check if we're on fire - handle_fire() - //Handle temperature/pressure differences between body and environment if(environment) handle_environment(environment) + //Check if we're on fire + handle_fire() + + //stuff in the stomach + handle_stomach() + /mob/living/proc/handle_breathing() return @@ -50,3 +53,6 @@ /mob/living/proc/handle_environment(var/datum/gas_mixture/environment) return + +/mob/living/proc/handle_stomach() + return From 9887f161351c4a3319ef122f6513561e268d6b40 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 17 Jun 2015 15:32:23 +0200 Subject: [PATCH 006/207] mob/living/Life() now has basic gravity handling (no overrides). --- code/game/area/areas.dm | 16 +++++++++++++++- code/modules/mob/living/life.dm | 2 ++ code/modules/mob/mob_movement.dm | 6 ++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index dccc9e9dbf..e342ba3329 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -299,4 +299,18 @@ var/list/mob/living/forced_ambiance_list = new for(var/obj/machinery/door/airlock/temp_airlock in src) temp_airlock.prison_open() for(var/obj/machinery/door/window/temp_windoor in src) - temp_windoor.open() \ No newline at end of file + temp_windoor.open() + +/area/proc/has_gravity() + return has_gravity + +/area/space/has_gravity() + return 0 + +/proc/has_gravity(atom/AT, turf/T) + if(!T) + T = get_turf(AT) + var/area/A = get_area(T) + if(A && A.has_gravity()) + return 1 + return 0 diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 5db47928f5..63f0739a3f 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -36,6 +36,8 @@ //stuff in the stomach handle_stomach() + update_gravity(mob_has_gravity()) + /mob/living/proc/handle_breathing() return diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 7eefc97d68..8ba66ffe31 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -520,3 +520,9 @@ prob_slip = round(prob_slip) return(prob_slip) + +/mob/proc/mob_has_gravity(turf/T) + return has_gravity(src, T) + +/mob/proc/update_gravity() + return From 838739c4edb21ec8645696b1220cb678f3a09702 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 17 Jun 2015 15:35:41 +0200 Subject: [PATCH 007/207] mob/living/Life() now handles updating pulling. --- code/modules/mob/living/life.dm | 7 +++++++ code/modules/mob/living/living_defense.dm | 4 ++++ code/modules/mob/mob.dm | 2 ++ 3 files changed, 13 insertions(+) diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 63f0739a3f..bafdfa4efe 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -38,6 +38,8 @@ update_gravity(mob_has_gravity()) + update_pulling() + /mob/living/proc/handle_breathing() return @@ -58,3 +60,8 @@ /mob/living/proc/handle_stomach() return + +/mob/living/proc/update_pulling() + if(pulling) + if(incapacitated()) + stop_pulling() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 24ebc4d844..a566c3a901 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -371,3 +371,7 @@ src.attack_log += "\[[time_stamp()]\] Got knifed by [user.name] ([user.ckey]) with [W.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(W.damtype)])" msg_admin_attack("[key_name(user)] knifed [key_name(src)] with [W.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(W.damtype)])" ) return + +/mob/living/incapacitated() + if(stat || paralysis || stunned || weakened || restrained()) + return 1 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 2264f60a54..6fba60f97c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -118,6 +118,8 @@ //handle_typing_indicator() //You said the typing indicator would be fine. The test determined that was a lie. return +/mob/proc/incapacitated() + return /mob/proc/restrained() return From 225ed82c1c075a9dfc4977bca85ed62b9ecd44b7 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 17 Jun 2015 15:38:53 +0200 Subject: [PATCH 008/207] mob/living/Life() now handles can move. --- code/modules/mob/living/carbon/alien/life.dm | 1 - code/modules/mob/living/carbon/brain/life.dm | 1 - code/modules/mob/living/carbon/human/life.dm | 1 - code/modules/mob/living/life.dm | 2 ++ 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 27a73c596e..6eee1ac7a7 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -17,7 +17,6 @@ //Status updates, death etc. handle_regular_status_updates() - update_canmove() update_icons() if(client) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 7df46c394d..f4758cb335 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -14,7 +14,6 @@ //Status updates, death etc. handle_regular_status_updates() - update_canmove() if(client) handle_regular_hud_updates() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 0495bcc32b..35569e10be 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -92,7 +92,6 @@ //Status updates, death etc. handle_regular_status_updates() //Optimized a bit - update_canmove() //Update our name based on whether our face is obscured/disfigured name = get_visible_name() diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index bafdfa4efe..6e27266ce6 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -40,6 +40,8 @@ update_pulling() + update_canmove() + /mob/living/proc/handle_breathing() return From b98d64b66857f4cd63580140157a49debbef5207 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 17 Jun 2015 15:41:25 +0200 Subject: [PATCH 009/207] mob/living/Life() now handles processing grabs. --- code/modules/mob/living/carbon/human/life.dm | 4 ---- code/modules/mob/living/life.dm | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 35569e10be..9b1183e75e 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -100,10 +100,6 @@ pulse = handle_pulse() - // Grabbing - for(var/obj/item/weapon/grab/G in src) - G.process() - /mob/living/carbon/human/breathe() if(!in_stasis) ..() diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 6e27266ce6..5cd668cc40 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -40,6 +40,9 @@ update_pulling() + for(var/obj/item/weapon/grab/G in src) + G.process() + update_canmove() /mob/living/proc/handle_breathing() From d4b2fb71768d8f9002d7431bb04fd321706e99ab Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 17 Jun 2015 15:47:24 +0200 Subject: [PATCH 010/207] mob/living/Life() now handles regular hud updates. --- code/modules/mob/living/carbon/alien/life.dm | 5 +--- code/modules/mob/living/carbon/brain/life.dm | 5 +--- code/modules/mob/living/carbon/human/life.dm | 4 +-- code/modules/mob/living/life.dm | 25 +++++++++++++++++++ code/modules/mob/living/silicon/robot/life.dm | 2 +- 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 6eee1ac7a7..fcd5a372d4 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -19,9 +19,6 @@ handle_regular_status_updates() update_icons() - if(client) - handle_regular_hud_updates() - /mob/living/carbon/alien/handle_mutations_and_radiation() // Currently both Dionaea and larvae like to eat radiation, so I'm defining the @@ -100,7 +97,7 @@ return 1 -/mob/living/carbon/alien/proc/handle_regular_hud_updates() +/mob/living/carbon/alien/handle_regular_hud_updates() if (stat == 2 || (XRAY in src.mutations)) sight |= SEE_TURFS diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index f4758cb335..ca0d1aa1de 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -15,9 +15,6 @@ //Status updates, death etc. handle_regular_status_updates() - if(client) - handle_regular_hud_updates() - /mob/living/carbon/brain/handle_mutations_and_radiation() if (radiation) if (radiation > 100) @@ -181,7 +178,7 @@ handle_statuses() return 1 -/mob/living/carbon/brain/proc/handle_regular_hud_updates() +/mob/living/carbon/brain/handle_regular_hud_updates() if (stat == 2 || (XRAY in src.mutations)) sight |= SEE_TURFS sight |= SEE_MOBS diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 9b1183e75e..e9d55414bd 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -96,8 +96,6 @@ //Update our name based on whether our face is obscured/disfigured name = get_visible_name() - handle_regular_hud_updates() - pulse = handle_pulse() /mob/living/carbon/human/breathe() @@ -1076,7 +1074,7 @@ return 1 -/mob/living/carbon/human/proc/handle_regular_hud_updates() +/mob/living/carbon/human/handle_regular_hud_updates() if(!overlays_cache) overlays_cache = list() overlays_cache.len = 23 diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 5cd668cc40..7214f2e18f 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -45,6 +45,9 @@ update_canmove() + if(client) + handle_regular_hud_updates() + /mob/living/proc/handle_breathing() return @@ -70,3 +73,25 @@ if(pulling) if(incapacitated()) stop_pulling() + +//this handles hud updates. Calls update_vision() and handle_hud_icons() +/mob/living/proc/handle_regular_hud_updates() + if(!client) return 0 + + handle_vision() + handle_hud_icons() + + return 1 + +/mob/living/proc/handle_vision() + return + +/mob/living/proc/update_sight() + return + +/mob/living/proc/handle_hud_icons() + handle_hud_icons_health() + return + +/mob/living/proc/handle_hud_icons_health() + return diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index bd3e280f68..6051c9c122 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -144,7 +144,7 @@ return 1 -/mob/living/silicon/robot/proc/handle_regular_hud_updates() +/mob/living/silicon/robot/handle_regular_hud_updates() if (src.stat == 2 || XRAY in mutations || src.sight_mode & BORGXRAY) src.sight |= SEE_TURFS From 9d38bcc149cac1d10cb7a50a3ce59ad22be11320 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 17 Jun 2015 16:01:26 +0200 Subject: [PATCH 011/207] mob/living/Life() now handles regular status updates. --- code/modules/mob/living/carbon/alien/life.dm | 3 +- code/modules/mob/living/carbon/brain/life.dm | 16 +------ code/modules/mob/living/carbon/human/life.dm | 17 ++++--- .../modules/mob/living/carbon/metroid/life.dm | 6 +-- code/modules/mob/living/life.dm | 47 +++++++++++++++++++ code/modules/mob/living/living.dm | 12 +++++ code/modules/mob/living/silicon/robot/life.dm | 2 +- code/modules/mob/living/silicon/silicon.dm | 6 +++ code/modules/mob/mob.dm | 6 +++ 9 files changed, 86 insertions(+), 29 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index fcd5a372d4..a28afc25dc 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -16,7 +16,6 @@ blinded = null //Status updates, death etc. - handle_regular_status_updates() update_icons() /mob/living/carbon/alien/handle_mutations_and_radiation() @@ -35,7 +34,7 @@ adjustToxLoss(-(rads)) return -/mob/living/carbon/alien/proc/handle_regular_status_updates() +/mob/living/carbon/alien/handle_regular_status_updates() if(status_flags & GODMODE) return 0 diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index ca0d1aa1de..40f709efb5 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -1,20 +1,6 @@ /mob/living/carbon/brain/handle_breathing() return -/mob/living/carbon/brain/Life() - set invisibility = 0 - set background = 1 - ..() - - //Apparently, the person who wrote this code designed it so that - //blinded get reset each cycle and then get activated later in the - //code. Very ugly. I dont care. Moving this stuff here so its easy - //to find it. - blinded = null - - //Status updates, death etc. - handle_regular_status_updates() - /mob/living/carbon/brain/handle_mutations_and_radiation() if (radiation) if (radiation > 100) @@ -108,7 +94,7 @@ return //TODO: DEFERRED -/mob/living/carbon/brain/proc/handle_regular_status_updates() //TODO: comment out the unused bits >_> +/mob/living/carbon/brain/handle_regular_status_updates() //TODO: comment out the unused bits >_> updatehealth() if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index e9d55414bd..ac76041fb6 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -87,17 +87,19 @@ handle_stasis_bag() - 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 + if(!handle_some_updates()) return //We go ahead and process them 5 times for HUD images and other stuff though. - //Status updates, death etc. - handle_regular_status_updates() //Optimized a bit - //Update our name based on whether our face is obscured/disfigured name = get_visible_name() pulse = handle_pulse() +/mob/living/carbon/human/proc/handle_some_updates() + 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 0 + return 1 + /mob/living/carbon/human/breathe() if(!in_stasis) ..() @@ -149,7 +151,7 @@ else return ONE_ATMOSPHERE + pressure_difference -/mob/living/carbon/human/proc/handle_disabilities() +/mob/living/carbon/human/handle_disabilities() if (disabilities & EPILEPSY) if ((prob(1) && paralysis < 1)) src << "\red You have a seizure!" @@ -911,7 +913,10 @@ return //TODO: DEFERRED -/mob/living/carbon/human/proc/handle_regular_status_updates() +/mob/living/carbon/human/handle_regular_status_updates() + if(!handle_some_updates()) + return 0 + if(status_flags & GODMODE) return 0 //SSD check, if a logged player is awake put them back to sleep! diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index a04db40e07..73f6913361 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -17,10 +17,6 @@ handle_AI() handle_speech_and_mood() - regular_hud_updates() - - handle_regular_status_updates() // Status updates, death etc. - /mob/living/carbon/slime/handle_environment(datum/gas_mixture/environment) if(!environment) adjustToxLoss(rand(10,20)) @@ -91,7 +87,7 @@ return //TODO: DEFERRED -/mob/living/carbon/slime/proc/handle_regular_status_updates() +/mob/living/carbon/slime/handle_regular_status_updates() src.blinded = null diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 7214f2e18f..14bdd03a7a 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -43,6 +43,10 @@ for(var/obj/item/weapon/grab/G in src) G.process() + if(handle_regular_status_updates()) // Status & health update, are we dead or alive etc. + handle_disabilities() // eye, ear, brain damages + handle_status_effects() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc + update_canmove() if(client) @@ -74,6 +78,49 @@ if(incapacitated()) stop_pulling() +//This updates the health and status of the mob (conscious, unconscious, dead) +/mob/living/proc/handle_regular_status_updates() + updatehealth() + if(stat != DEAD) + if(paralysis) + stat = UNCONSCIOUS + else if (status_flags & FAKEDEATH) + stat = UNCONSCIOUS + else + stat = CONSCIOUS + return 1 + +//this updates all special effects: stunned, sleeping, weakened, druggy, stuttering, etc.. +/mob/living/proc/handle_status_effects() + if(paralysis) + paralysis = max(paralysis-1,0) + if(stunned) + stunned = max(stunned-1,0) + if(!stunned) + update_icons() + + if(weakened) + weakened = max(weakened-1,0) + if(!weakened) + update_icons() + +/mob/living/proc/handle_disabilities() + //Eyes + if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own + eye_blind = max(eye_blind, 1) + else if(eye_blind) //blindness, heals slowly over time + eye_blind = max(eye_blind-1,0) + else if(eye_blurry) //blurry eyes heal slowly + eye_blurry = max(eye_blurry-1, 0) + + //Ears + if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own + setEarDamage(-1, max(ear_deaf, 1)) + else + // deafness heals slowly over time, unless ear_damage is over 100 + if(ear_damage < 100) + adjustEarDamage(-0.05,-1) + //this handles hud updates. Calls update_vision() and handle_hud_icons() /mob/living/proc/handle_regular_hud_updates() if(!client) return 0 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index af99441108..e24fa8a782 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -800,3 +800,15 @@ default behaviour is: return ..() + +//damage/heal the mob ears and adjust the deaf amount +/mob/living/adjustEarDamage(var/damage, var/deaf) + ear_damage = max(0, ear_damage + damage) + ear_deaf = max(0, ear_deaf + deaf) + +//pass a negative argument to skip one of the variable +/mob/living/setEarDamage(var/damage, var/deaf) + if(damage >= 0) + ear_damage = damage + if(deaf >= 0) + ear_deaf = deaf diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 6051c9c122..d86ab2ba2c 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -61,7 +61,7 @@ lights_on = 0 set_light(0) -/mob/living/silicon/robot/proc/handle_regular_status_updates() +/mob/living/silicon/robot/handle_regular_status_updates() if(src.camera && !scrambledcodes) if(src.stat == 2 || wires.IsIndexCut(BORG_WIRE_CAMERA)) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index de27956678..270f618a85 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -350,3 +350,9 @@ /mob/living/silicon/proc/is_malf_or_traitor() return is_traitor() || is_malf() + +/mob/living/silicon/adjustEarDamage() + return + +/mob/living/silicon/setEarDamage() + return diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 6fba60f97c..40d39fff32 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1027,3 +1027,9 @@ mob/proc/yank_out_object() /mob/verb/westfaceperm() set hidden = 1 set_face_dir(WEST) + +/mob/proc/adjustEarDamage() + return + +/mob/proc/setEarDamage() + return From 6ed7cee0416259f47041fd88ee056223f7c4e3b9 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Wed, 17 Jun 2015 16:08:12 +0200 Subject: [PATCH 012/207] mob/living/Life() now handles even more regular hud updates. Relocates action handling. --- code/defines/procs/hud.dm | 2 +- code/modules/mob/living/carbon/metroid/hud.dm | 2 +- code/modules/mob/living/life.dm | 5 ++++- code/modules/mob/living/living.dm | 5 ----- code/modules/mob/living/living_defense.dm | 4 ---- code/modules/mob/living/silicon/ai/life.dm | 2 +- code/modules/mob/living/silicon/pai/life.dm | 2 +- code/modules/mob/living/silicon/robot/life.dm | 2 +- 8 files changed, 9 insertions(+), 15 deletions(-) diff --git a/code/defines/procs/hud.dm b/code/defines/procs/hud.dm index e572176ef9..5f222b0374 100644 --- a/code/defines/procs/hud.dm +++ b/code/defines/procs/hud.dm @@ -61,7 +61,7 @@ proc/can_process_hud(var/mob/M) return 1 //Deletes the current HUD images so they can be refreshed with new ones. -mob/proc/regular_hud_updates() //Used in the life.dm of mobs that can use HUDs. +mob/proc/handle_regular_hud_updates() //Used in the life.dm of mobs that can use HUDs. if(client) for(var/image/hud in client.images) if(copytext(hud.icon_state,1,4) == "hud") diff --git a/code/modules/mob/living/carbon/metroid/hud.dm b/code/modules/mob/living/carbon/metroid/hud.dm index c5282b9a83..da6729c3dc 100644 --- a/code/modules/mob/living/carbon/metroid/hud.dm +++ b/code/modules/mob/living/carbon/metroid/hud.dm @@ -1,2 +1,2 @@ -/mob/living/carbon/slime/regular_hud_updates() +/mob/living/carbon/slime/handle_regular_hud_updates() return \ No newline at end of file diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 14bdd03a7a..d7f475ec5b 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -47,6 +47,8 @@ handle_disabilities() // eye, ear, brain damages handle_status_effects() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc + handle_actions() + update_canmove() if(client) @@ -122,8 +124,9 @@ adjustEarDamage(-0.05,-1) //this handles hud updates. Calls update_vision() and handle_hud_icons() -/mob/living/proc/handle_regular_hud_updates() +/mob/living/handle_regular_hud_updates() if(!client) return 0 + ..() handle_vision() handle_hud_icons() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e24fa8a782..07b5fb7900 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1,8 +1,3 @@ -/mob/living/Life() - ..() - if(stat != DEAD) - handle_actions() - //mob verbs are faster than object verbs. See mob/verb/examine. /mob/living/verb/pulled(atom/movable/AM as mob|obj in oview(1)) set name = "Pull" diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index a566c3a901..28860ba5b4 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -247,10 +247,6 @@ //Scale quadratically so that single digit numbers of fire stacks don't burn ridiculously hot. return round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_stacks/FIRE_MAX_FIRESUIT_STACKS)**2) -/mob/living/regular_hud_updates() - ..() - update_action_buttons() - /mob/living/proc/handle_actions() //Pretty bad, i'd use picked/dropped instead but the parent calls in these are nonexistent for(var/datum/action/A in actions) diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index a62ce82429..51f2ffa782 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -151,7 +151,7 @@ theAPC = null process_queued_alarms() - regular_hud_updates() + handle_regular_hud_updates() switch(src.sensor_mode) if (SEC_HUD) process_sec_hud(src,0,src.eyeobj) diff --git a/code/modules/mob/living/silicon/pai/life.dm b/code/modules/mob/living/silicon/pai/life.dm index fe426c36d0..a9ad698754 100644 --- a/code/modules/mob/living/silicon/pai/life.dm +++ b/code/modules/mob/living/silicon/pai/life.dm @@ -10,7 +10,7 @@ M.show_message("\red The data cable rapidly retracts back into its spool.", 3, "\red You hear a click and the sound of wire spooling rapidly.", 2) qdel(src.cable) - regular_hud_updates() + handle_regular_hud_updates() if(src.secHUD == 1) process_sec_hud(src, 1) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index d86ab2ba2c..e5a0227020 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -173,7 +173,7 @@ src.see_invisible = SEE_INVISIBLE_LIVING // This is normal vision (25), setting it lower for normal vision means you don't "see" things like darkness since darkness // has a "invisible" value of 15 - regular_hud_updates() + handle_regular_hud_updates() var/obj/item/borg/sight/hud/hud = (locate(/obj/item/borg/sight/hud) in src) if(hud && hud.hud) From c5d283f544010ee0cb7f40da3d5fa1ad823544ea Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 20 Jun 2015 21:03:48 -0400 Subject: [PATCH 013/207] Fixes phoron fire reaction progress The amount of gas burning is already limited by vsc.fire_consuption_rate so there is no need to limit the ratio of gas burning. --- code/ZAS/Fire.dm | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 27011dc7b3..7cf4292c16 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -226,13 +226,14 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) //Returns the firelevel /datum/gas_mixture/proc/zburn(zone/zone, force_burn, no_check = 0) - #ifdef FIREDBG - log_debug("***************** FIREDBG *****************") - if(zone) log_debug("Burning [zone.name]!") - #endif - . = 0 if((temperature > PHORON_MINIMUM_BURN_TEMPERATURE || force_burn) && (no_check ||check_recombustability(zone? zone.fuel_objs : null))) + + #ifdef FIREDBG + log_debug("***************** FIREDBG *****************") + log_debug("Burning [zone? zone.name : "zoneless gas_mixture"]!") + #endif + var/gas_fuel = 0 //in the case of mixed gas/liquid fires, the gas burns first. var/liquid_fuel = 0 var/total_fuel = 0 @@ -270,9 +271,8 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) //calculate the firelevel. var/firelevel = calculate_firelevel(total_fuel, total_oxidizers, reaction_limit) - //vapour fuels are extremely volatile! The reaction progress is a percentage of the total fuel (similar to old zburn). - var/gas_reaction_progress = min(0.2, (firelevel/vsc.fire_firelevel_multiplier))*gas_fuel*FIRE_GAS_BURNRATE_MULT + var/gas_reaction_progress = (firelevel/vsc.fire_firelevel_multiplier)*gas_fuel*FIRE_GAS_BURNRATE_MULT //liquid fuels are not as volatile, and the reaction progress depends on the size of the area that is burning. Limit the burn rate to a certain amount per area. var/liquid_reaction_progress = ((firelevel/vsc.fire_firelevel_multiplier)*0.2 + 0.05)*fuel_area*FIRE_LIQUID_BURNRATE_MULT @@ -282,10 +282,13 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) var/used_oxidizers = used_fuel*(FIRE_REACTION_OXIDIZER_AMOUNT/FIRE_REACTION_FUEL_AMOUNT) #ifdef FIREDBG + log_debug("gas_fuel = [gas_fuel], liquid_fuel = [liquid_fuel], total_oxidizers = [total_oxidizers]") + log_debug("fuel_area = [fuel_area], total_fuel = [total_fuel], reaction_limit = [reaction_limit]") log_debug("firelevel -> [firelevel] / [vsc.fire_firelevel_multiplier]") log_debug("liquid_reaction_progress = [liquid_reaction_progress]") log_debug("gas_reaction_progress = [gas_reaction_progress]") - log_debug("used_fuel = [used_fuel]; used_oxidizers = [used_oxidizers]; reaction_limit=[reaction_limit]") + log_debug("total_reaction_progress = [total_reaction_progress]") + log_debug("used_fuel = [used_fuel], used_oxidizers = [used_oxidizers]; ") #endif //if the reaction is progressing too slow then it isn't self-sustaining anymore and burns out @@ -297,8 +300,8 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) //*** Remove fuel and oxidizer, add carbon dioxide and heat //remove and add gasses as calculated - var/used_gas_fuel = between(0.25, used_fuel*(gas_reaction_progress/total_reaction_progress), gas_fuel) //remove in proportion to the relative reaction progress - var/used_liquid_fuel = between(0.25, used_fuel-used_gas_fuel, liquid_fuel) + var/used_gas_fuel = min(max(0.25, used_fuel*(gas_reaction_progress/total_reaction_progress)), gas_fuel) //remove in proportion to the relative reaction progress + var/used_liquid_fuel = min(max(0.25, used_fuel-used_gas_fuel), liquid_fuel) //remove_by_flag() and adjust_gas() handle the group_multiplier for us. remove_by_flag(XGM_GAS_OXIDIZER, used_oxidizers) @@ -309,10 +312,10 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) zone.remove_liquidfuel(used_liquid_fuel, !check_combustability()) //calculate the energy produced by the reaction and then set the new temperature of the mix - temperature = (starting_energy + vsc.fire_fuel_energy_release * used_fuel) / heat_capacity() + temperature = (starting_energy + vsc.fire_fuel_energy_release * (used_gas_fuel + used_liquid_fuel)) / heat_capacity() #ifdef FIREDBG - log_debug("used_gas_fuel = [used_gas_fuel]; used_liquid_fuel = [used_liquid_fuel]; total = [used_gas_fuel+used_liquid_fuel]") + log_debug("used_gas_fuel = [used_gas_fuel]; used_liquid_fuel = [used_liquid_fuel]; total = [used_fuel]") log_debug("new temperature = [temperature]") #endif From c48ffa8d638d0d7a066a2852dfc95564add7b8bf Mon Sep 17 00:00:00 2001 From: PJB3005 Date: Sun, 21 Jun 2015 23:27:37 +0200 Subject: [PATCH 014/207] Lighting optimizations + meson fix --- code/__HELPERS/maths.dm | 17 ++---- code/__HELPERS/unsorted.dm | 22 +++++++ code/game/area/Space Station 13 areas.dm | 2 +- code/game/turfs/turf.dm | 8 ++- code/modules/lighting/_lighting_defs.dm | 2 +- code/modules/lighting/light_source.dm | 53 +++++++++-------- code/modules/lighting/lighting_overlay.dm | 70 ++++++++++++++++++++--- code/modules/lighting/lighting_system.dm | 32 ++--------- code/modules/lighting/lighting_turf.dm | 23 ++------ code/modules/mob/living/living_defense.dm | 2 +- code/setup.dm | 4 +- 11 files changed, 142 insertions(+), 93 deletions(-) diff --git a/code/__HELPERS/maths.dm b/code/__HELPERS/maths.dm index f148b10ef8..2b6d6db018 100644 --- a/code/__HELPERS/maths.dm +++ b/code/__HELPERS/maths.dm @@ -1,15 +1,6 @@ // Macro functions. #define RAND_F(LOW, HIGH) (rand()*(HIGH-LOW) + LOW) -// List of square roots for the numbers 1-100. -var/list/sqrtTable = list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10) - -/proc/Clamp(val, min, max) - return max(min, min(val, max)) - // min is inclusive, max is exclusive /proc/Wrap(val, min, max) var/d = max - min @@ -101,18 +92,18 @@ var/list/sqrtTable = list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, // if they are imaginary. /proc/SolveQuadratic(a, b, c) ASSERT(a) - + . = list() var/discriminant = b*b - 4*a*c var/bottom = 2*a - + // Return if the roots are imaginary. if(discriminant < 0) return - + var/root = sqrt(discriminant) . += (-b + root) / bottom - + // If discriminant == 0, there would be two roots at the same position. if(discriminant != 0) . += (-b - root) / bottom diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 31c885d886..98e76920e8 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1315,3 +1315,25 @@ var/list/WALLITEMS = list( temp_col = "0[temp_col]" colour += temp_col return colour + +//Version of view() which ignores darkness, because BYOND doesn't have it. +/proc/dview(var/range = world.view, var/center, var/invis_flags = 0) + if(!center) + return + + var/global/mob/dview/DV + if(!DV) + DV = new + + DV.loc = center + + DV.see_in_dark = range + DV.see_invisible = invis_flags + + . = view(range, DV) + DV.loc = null + +/mob/dview + invisibility = 101 + density = 0 + diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 04d7ef41e9..76cf6f8c02 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -26,7 +26,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station icon = 'icons/turf/areas.dmi' icon_state = "unknown" layer = 10 - luminosity = 1 + luminosity = 0 mouse_opacity = 0 var/lightswitch = 1 diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 65d9050617..94919b8589 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -33,6 +33,7 @@ var/holy = 0 var/dynamic_lighting = 1 + luminosity = 0 /turf/New() ..() @@ -41,7 +42,10 @@ src.Entered(AM) return turfs |= src - return + + var/area/A = loc + if(!dynamic_lighting || !A.lighting_use_dynamic) + luminosity = 1 /turf/Destroy() turfs -= src @@ -229,6 +233,7 @@ var/old_opacity = opacity var/old_dynamic_lighting = dynamic_lighting var/list/old_affecting_lights = affecting_lights + var/old_lighting_overlay = lighting_overlay //world << "Replacing [src.type] with [N]" @@ -280,6 +285,7 @@ W.levelupdate() . = W + lighting_overlay = old_lighting_overlay affecting_lights = old_affecting_lights if((old_opacity != opacity) || (dynamic_lighting != old_dynamic_lighting) || force_lighting_update) reconsider_lights() diff --git a/code/modules/lighting/_lighting_defs.dm b/code/modules/lighting/_lighting_defs.dm index a913c97e21..57e6cc22d2 100644 --- a/code/modules/lighting/_lighting_defs.dm +++ b/code/modules/lighting/_lighting_defs.dm @@ -4,7 +4,7 @@ #define LIGHTING_LAMBERTIAN 1 // use lambertian shading for light sources #define LIGHTING_HEIGHT 1 // height off the ground of light sources on the pseudo-z-axis, you should probably leave this alone #define LIGHTING_TRANSITIONS 1 // smooth, animated transitions, similar to /tg/station +#define LIGHTING_ROUND_VALUE (1 / 128) //Value used to round lumcounts, values smaller than 1/255 don't matter (if they do, thanks sinking points), greater values will make lighting less precise, but in turn increase performance, VERY SLIGHTLY. -#define LIGHTING_RESOLUTION 1 // resolution of the lighting overlays, powers of 2 only, max of 32 #define LIGHTING_LAYER 10 // drawing layer for lighting overlays #define LIGHTING_ICON 'icons/effects/lighting_overlay.dmi' // icon used for lighting shading effects diff --git a/code/modules/lighting/light_source.dm b/code/modules/lighting/light_source.dm index 1897272118..a71550268c 100644 --- a/code/modules/lighting/light_source.dm +++ b/code/modules/lighting/light_source.dm @@ -60,13 +60,16 @@ if(top_atom != source_atom) if(!top_atom.light_sources) top_atom.light_sources = list() top_atom.light_sources += src - lighting_update_lights += src - needs_update = 1 + + if(!needs_update) + lighting_update_lights += src + needs_update = 1 /datum/light_source/proc/force_update() - needs_update = 1 force_update = 1 - lighting_update_lights += src + if(!needs_update) + lighting_update_lights += src + needs_update = 1 /datum/light_source/proc/check() if(!source_atom || !light_range || !light_power) @@ -113,11 +116,7 @@ /datum/light_source/proc/falloff(atom/movable/lighting_overlay/O) #if LIGHTING_FALLOFF == 1 // circular - #if LIGHTING_RESOLUTION == 1 . = (O.x - source_turf.x)**2 + (O.y - source_turf.y)**2 + LIGHTING_HEIGHT - #else - . = (O.x - source_turf.x + O.xoffset)**2 + (O.y - source_turf.y + O.yoffset)**2 + LIGHTING_HEIGHT - #endif #if LIGHTING_LAMBERTIAN == 1 . = CLAMP01((1 - CLAMP01(sqrt(.) / light_range)) * (1 / (sqrt(. + 1)))) @@ -126,11 +125,7 @@ #endif #elif LIGHTING_FALLOFF == 2 // square - #if LIGHTING_RESOLUTION == 1 . = abs(O.x - source_turf.x) + abs(O.y - source_turf.y) + LIGHTING_HEIGHT - #else - . = abs(O.x - source_turf.x + O.xoffset) + abs(O.y - source_turf.y + O.yoffset) + LIGHTING_HEIGHT - #endif #if LIGHTING_LAMBERTIAN == 1 . = CLAMP01((1 - CLAMP01(. / light_range)) * (1 / (sqrt(.)**2 + ))) @@ -142,26 +137,36 @@ /datum/light_source/proc/apply_lum() applied = 1 if(istype(source_turf)) - for(var/atom/movable/lighting_overlay/O in view(light_range, source_turf)) - var/strength = light_power * falloff(O) + for(var/turf/T in dview(light_range, source_turf, INVISIBILITY_LIGHTING)) + if(T.lighting_overlay) + var/strength = light_power * falloff(T.lighting_overlay) + if(!strength) //Don't add turfs that aren't affected to the affected turfs. + continue - effect_r[O] = lum_r * strength - effect_g[O] = lum_g * strength - effect_b[O] = lum_b * strength + effect_r[T.lighting_overlay] = round(lum_r * strength, LIGHTING_ROUND_VALUE) + effect_g[T.lighting_overlay] = round(lum_g * strength, LIGHTING_ROUND_VALUE) + effect_b[T.lighting_overlay] = round(lum_b * strength, LIGHTING_ROUND_VALUE) + + T.lighting_overlay.update_lumcount( + round(lum_r * strength, LIGHTING_ROUND_VALUE), + round(lum_g * strength, LIGHTING_ROUND_VALUE), + round(lum_b * strength, LIGHTING_ROUND_VALUE) + ) + + if(!T.affecting_lights) + T.affecting_lights = list() - O.update_lumcount(lum_r * strength, lum_g * strength, lum_b * strength) - for(var/turf/T in view(light_range, source_turf)) - if(!T.affecting_lights) T.affecting_lights = list() T.affecting_lights += src effect_turf += T /datum/light_source/proc/remove_lum() applied = 0 - for(var/atom/movable/lighting_overlay/O in effect_r) - O.update_lumcount(-effect_r[O], -effect_g[O], -effect_b[O]) - for(var/turf/T in effect_turf) - if(T.affecting_lights) T.affecting_lights -= src + if(T.affecting_lights) + T.affecting_lights -= src + + if(T.lighting_overlay) + T.lighting_overlay.update_lumcount(-effect_r[T.lighting_overlay], -effect_g[T.lighting_overlay], -effect_b[T.lighting_overlay]) effect_r.Cut() effect_g.Cut() diff --git a/code/modules/lighting/lighting_overlay.dm b/code/modules/lighting/lighting_overlay.dm index b75d8aec7f..47365d6d36 100644 --- a/code/modules/lighting/lighting_overlay.dm +++ b/code/modules/lighting/lighting_overlay.dm @@ -5,6 +5,7 @@ anchored = 1 icon = LIGHTING_ICON + icon_state = "light1" layer = LIGHTING_LAYER invisibility = INVISIBILITY_LIGHTING blend_mode = BLEND_MULTIPLY @@ -14,11 +15,6 @@ var/lum_g var/lum_b - #if LIGHTING_RESOLUTION != 1 - var/xoffset - var/yoffset - #endif - var/needs_update /atom/movable/lighting_overlay/New() @@ -26,12 +22,32 @@ verbs.Cut() /atom/movable/lighting_overlay/proc/update_lumcount(delta_r, delta_g, delta_b) + if(!delta_r && !delta_g && !delta_b) //Nothing is being changed all together. + return + + var/should_update = 0 + + if(!needs_update) //If this isn't true, we're already updating anyways. + if(max(lum_r, lum_g, lum_b) < 1) //Any change that could happen WILL change appearance. + should_update = 1 + + else if(max(lum_r + delta_r, lum_g + delta_g, lum_b + delta_b) < 1) //The change would bring us under 1 max lum, again, guaranteed to change appearance. + should_update = 1 + + else //We need to make sure that the colour ratios won't change in this code block. + var/mx1 = max(lum_r, lum_g, lum_b) + var/mx2 = max(lum_r + delta_r, lum_g + delta_g, lum_b + delta_b) + + if(lum_r / mx1 != (lum_r + delta_r) / mx2 || lum_g / mx1 != (lum_g + delta_g) / mx2 || lum_b / mx1 != (lum_b + delta_b) / mx2) //Stuff would change. + should_update = 1 + lum_r += delta_r lum_g += delta_g lum_b += delta_b - needs_update = 1 - lighting_update_overlays += src + if(!needs_update && should_update) + needs_update = 1 + lighting_update_overlays += src /atom/movable/lighting_overlay/proc/update_overlay() var/mx = max(lum_r, lum_g, lum_b) @@ -46,3 +62,43 @@ #else color = rgb(lum_r * 255 * ., lum_g * 255 * ., lum_b * 255 * .) #endif + + var/turf/T = loc + + if(istype(T)) //Incase we're not on a turf, pool ourselves, something happened. + if(color != "#000000") + T.luminosity = 1 + else //No light, set the turf's luminosity to 0 to remove it from view() + #if LIGHTING_TRANSITIONS == 1 + spawn(LIGHTING_INTERVAL - 1) + T.luminosity = 0 + #else + T.luminosity = 0 + #endif + + else + warning("A lighting overlay realised its loc was NOT a turf (actual loc: [loc][loc ? ", " + loc.type : ""]) in update_overlay() and got pooled!") + qdel(src) + +/atom/movable/lighting_overlay/ResetVars() + loc = null + + lum_r = 0 + lum_g = 0 + lum_b = 0 + + color = "#000000" + + needs_update = 0 + +/atom/movable/lighting_overlay/Destroy() + lighting_update_overlays -= src + + var/turf/T = loc + if(istype(T)) + T.lighting_overlay = null + + for(var/datum/light_source/D in T.affecting_lights) //Remove references to us on the light sources affecting us. + D.effect_r -= src + D.effect_g -= src + D.effect_b -= src diff --git a/code/modules/lighting/lighting_system.dm b/code/modules/lighting/lighting_system.dm index 6177c81f8f..0c84294f35 100644 --- a/code/modules/lighting/lighting_system.dm +++ b/code/modules/lighting/lighting_system.dm @@ -5,26 +5,15 @@ // duplicates lots of code, but this proc needs to be as fast as possible. /proc/create_lighting_overlays(zlevel = 0) - var/state = "light[LIGHTING_RESOLUTION]" var/area/A if(zlevel == 0) // populate all zlevels for(var/turf/T in world) if(T.dynamic_lighting) A = T.loc if(A.lighting_use_dynamic) - #if LIGHTING_RESOLUTION == 1 - var/atom/movable/lighting_overlay/O = new(T) - O.icon_state = state - #else - for(var/i = 0; i < LIGHTING_RESOLUTION; i++) - for(var/j = 0; j < LIGHTING_RESOLUTION; j++) - var/atom/movable/lighting_overlay/O = new(T) - O.pixel_x = i * (32 / LIGHTING_RESOLUTION) - O.pixel_y = j * (32 / LIGHTING_RESOLUTION) - O.xoffset = (((2*i + 1) / (LIGHTING_RESOLUTION * 2)) - 0.5) - O.yoffset = (((2*j + 1) / (LIGHTING_RESOLUTION * 2)) - 0.5) - O.icon_state = state - #endif + var/atom/movable/lighting_overlay/O = PoolOrNew(/atom/movable/lighting_overlay, T) + T.lighting_overlay = O + else for(var/x = 1; x <= world.maxx; x++) for(var/y = 1; y <= world.maxy; y++) @@ -32,16 +21,5 @@ if(T.dynamic_lighting) A = T.loc if(A.lighting_use_dynamic) - #if LIGHTING_RESOLUTION == 1 - var/atom/movable/lighting_overlay/O = new(T) - O.icon_state = state - #else - for(var/i = 0; i < LIGHTING_RESOLUTION; i++) - for(var/j = 0; j < LIGHTING_RESOLUTION; j++) - var/atom/movable/lighting_overlay/O = new(T) - O.pixel_x = i * (32 / LIGHTING_RESOLUTION) - O.pixel_y = j * (32 / LIGHTING_RESOLUTION) - O.xoffset = (((2*i + 1) / (LIGHTING_RESOLUTION * 2)) - 0.5) - O.yoffset = (((2*j + 1) / (LIGHTING_RESOLUTION * 2)) - 0.5) - O.icon_state = state - #endif + var/atom/movable/lighting_overlay/O = PoolOrNew(/atom/movable/lighting_overlay, T) + T.lighting_overlay = O diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index 266e4b1d79..0a438b047c 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -1,29 +1,18 @@ /turf var/list/affecting_lights + var/atom/movable/lighting_overlay/lighting_overlay /turf/proc/reconsider_lights() for(var/datum/light_source/L in affecting_lights) L.force_update() /turf/proc/lighting_clear_overlays() - for(var/atom/movable/lighting_overlay/L in src) - L.loc = null + if(lighting_overlay) + qdel(lighting_overlay) /turf/proc/lighting_build_overlays() - if(!locate(/atom/movable/lighting_overlay) in src) - var/state = "light[LIGHTING_RESOLUTION]" + if(!lighting_overlay) var/area/A = loc if(A.lighting_use_dynamic) - #if LIGHTING_RESOLUTION == 1 - var/atom/movable/lighting_overlay/O = new(src) - O.icon_state = state - #else - for(var/i = 0; i < LIGHTING_RESOLUTION; i++) - for(var/j = 0; j < LIGHTING_RESOLUTION; j++) - var/atom/movable/lighting_overlay/O = new(src) - O.pixel_x = i * (32 / LIGHTING_RESOLUTION) - O.pixel_y = j * (32 / LIGHTING_RESOLUTION) - O.xoffset = (((2*i + 1) / (LIGHTING_RESOLUTION * 2)) - 0.5) - O.yoffset = (((2*j + 1) / (LIGHTING_RESOLUTION * 2)) - 0.5) - O.icon_state = state - #endif + var/atom/movable/lighting_overlay/O = PoolOrNew(/atom/movable/lighting_overlay, src) + lighting_overlay = O diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 32b0235009..97b16ea797 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -215,7 +215,7 @@ return /mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person - fire_stacks = Clamp(fire_stacks + add_fire_stacks, min = FIRE_MIN_STACKS, max = FIRE_MAX_STACKS) + fire_stacks = Clamp(fire_stacks + add_fire_stacks, FIRE_MIN_STACKS, FIRE_MAX_STACKS) /mob/living/proc/handle_fire() if(fire_stacks < 0) diff --git a/code/setup.dm b/code/setup.dm index ba6762e3c7..6b2262da98 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -955,7 +955,9 @@ var/list/be_special_flags = list( #define WALL_CAN_OPEN 1 #define WALL_OPENING 2 -#define CLAMP01(x) max(0, min(1, x)) +#define Clamp(x, y, z) (x <= y ? y : (x >= z ? z : x)) + +#define CLAMP01(x) (Clamp(x, 0, 1)) #define DEFAULT_WALL_MATERIAL "steel" #define DEFAULT_TABLE_MATERIAL "plastic" From bca222b119555cccb12c87689a335766709655b5 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 25 Jun 2015 08:39:33 +0200 Subject: [PATCH 015/207] Some more disability cleanup. --- code/modules/mob/living/carbon/alien/life.dm | 7 ------- code/modules/mob/living/carbon/human/life.dm | 3 --- 2 files changed, 10 deletions(-) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index a28afc25dc..642cbfdbde 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -85,13 +85,6 @@ else if(eye_blurry) eye_blurry = max(eye_blurry-1, 0) - //Ears - if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own - ear_deaf = max(ear_deaf, 1) - else if(ear_deaf) //deafness, heals slowly over time - ear_deaf = max(ear_deaf-1, 0) - ear_damage = max(ear_damage-0.05, 0) - update_icons() return 1 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index ac76041fb6..a302875181 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -67,9 +67,6 @@ //Updates the number of stored chemicals for powers handle_changeling() - //Disabilities - handle_disabilities() - //Organs and blood handle_organs() stabilize_body_temperature() //Body temperature adjusts itself (self-regulation) From 203f1b321ab00f80cf7be3a9d2062cb2cb587dca Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 25 Jun 2015 10:11:25 +0200 Subject: [PATCH 016/207] Fixes missing camera c_tag. Prevents the camera from showing up as an invalid null entry in the camera console list. --- maps/exodus-4.dmm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maps/exodus-4.dmm b/maps/exodus-4.dmm index 9a4353df6b..b226378751 100644 --- a/maps/exodus-4.dmm +++ b/maps/exodus-4.dmm @@ -29,7 +29,7 @@ "aC" = (/obj/machinery/portable_atmospherics/canister/air,/obj/structure/window/basic{tag = "icon-window (EAST)"; icon_state = "window"; dir = 4},/obj/structure/window/basic{tag = "icon-window (NORTH)"; icon_state = "window"; dir = 1},/turf/simulated/floor{icon_state = "bot"; dir = 1},/area/constructionsite/teleporter) "aD" = (/obj/structure/table/reinforced,/obj/item/stack/material/plasteel{amount = 50},/obj/random/tech_supply,/turf/simulated/floor,/area/constructionsite/teleporter) "aE" = (/obj/structure/table/reinforced,/obj/machinery/light{tag = "icon-tube1 (NORTH)"; icon_state = "tube1"; dir = 1},/obj/item/stack/material/steel{amount = 50; pixel_x = 0; pixel_y = 0},/obj/item/stack/material/steel{amount = 50; pixel_x = 0; pixel_y = 0},/obj/item/stack/material/steel{amount = 50; pixel_x = 0; pixel_y = 0},/obj/item/stack/material/steel{amount = 50; pixel_x = 0; pixel_y = 0},/obj/item/stack/material/steel{amount = 50; pixel_x = 0; pixel_y = 0},/obj/random/tech_supply,/turf/simulated/floor,/area/constructionsite/teleporter) -"aF" = (/obj/structure/table/reinforced,/obj/item/stack/material/glass{amount = 50},/obj/item/stack/material/glass{amount = 50},/obj/item/stack/material/glass{amount = 50},/obj/item/stack/material/glass{amount = 50},/obj/item/stack/material/glass{amount = 50},/obj/random/tech_supply,/obj/machinery/camera/motion/engineering_outpost,/turf/simulated/floor,/area/constructionsite/teleporter) +"aF" = (/obj/structure/table/reinforced,/obj/item/stack/material/glass{amount = 50},/obj/item/stack/material/glass{amount = 50},/obj/item/stack/material/glass{amount = 50},/obj/item/stack/material/glass{amount = 50},/obj/item/stack/material/glass{amount = 50},/obj/random/tech_supply,/obj/machinery/camera/motion/engineering_outpost{c_tag = "Construction Site Teleporter"},/turf/simulated/floor,/area/constructionsite/teleporter) "aG" = (/obj/structure/table/reinforced,/obj/random/powercell,/obj/random/tech_supply,/obj/random/tech_supply,/turf/simulated/floor,/area/constructionsite/teleporter) "aH" = (/obj/machinery/shieldgen,/obj/structure/window/basic{tag = "icon-window (WEST)"; icon_state = "window"; dir = 8},/turf/simulated/floor{icon_state = "bot"; dir = 1},/area/constructionsite/teleporter) "aI" = (/obj/machinery/shieldgen,/obj/structure/window/basic{tag = "icon-window (EAST)"; icon_state = "window"; dir = 4},/turf/simulated/floor{icon_state = "bot"; dir = 1},/area/constructionsite/teleporter) From fdab654bebc309f07f45928cedab08af8d0003ee Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 25 Jun 2015 14:10:10 +0200 Subject: [PATCH 017/207] Grid check now respects critical APC status. Fixes #9919. On power failure critical APCs are left alone, however on power restoration critical APCs are still included. --- code/game/gamemodes/events/power_failure.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm index a6acbd0e31..0f7d6149d3 100644 --- a/code/game/gamemodes/events/power_failure.dm +++ b/code/game/gamemodes/events/power_failure.dm @@ -20,7 +20,7 @@ for(var/obj/machinery/power/apc/C in world) - if(C.cell && C.z in config.station_levels) + if(!C.is_critical && C.cell && (C.z in config.station_levels)) C.cell.charge = 0 /proc/power_restore(var/announce = 1) @@ -29,7 +29,7 @@ if(announce) command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg') for(var/obj/machinery/power/apc/C in world) - if(C.cell && C.z in config.station_levels) + if(C.cell && (C.z in config.station_levels)) C.cell.charge = C.cell.maxcharge for(var/obj/machinery/power/smes/S in world) var/area/current_area = get_area(S) From e6b4cecf50de48ee41cd61f29241434d8a238e45 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Thu, 25 Jun 2015 21:09:51 +0300 Subject: [PATCH 018/207] Fixes #9519 Now client can't escape the resetting! --- code/modules/mob/living/carbon/human/life.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 9df3395850..b8cb5b1539 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -968,8 +968,10 @@ spawn handle_hallucinations() //The not boring kind! if(client && prob(5)) client.dir = pick(2,4,8) + var/client/C = client spawn(rand(20,50)) - client.dir = 1 + if(C) + C.dir = 1 if(hallucination<=2) hallucination = 0 From 5dda5021a316b965600b9c8681b34e7c7289c7a4 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Thu, 25 Jun 2015 23:04:04 +0300 Subject: [PATCH 019/207] Fixed a list being qdel'd when radio is deleted. --- code/controllers/communications.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/communications.dm b/code/controllers/communications.dm index 723d2e001a..52521415b4 100644 --- a/code/controllers/communications.dm +++ b/code/controllers/communications.dm @@ -297,7 +297,7 @@ var/global/datum/controller/radio/radio_controller devices_line -= null if (devices_line.len==0) devices -= devices_filter - qdel(devices_line) + del(devices_line) /datum/signal var/obj/source From 9d03286b6c167b6ff08f2603673b59d8d6a0c08c Mon Sep 17 00:00:00 2001 From: Chinsky Date: Thu, 25 Jun 2015 23:04:33 +0300 Subject: [PATCH 020/207] Added yet another special snowflake check for assistants so they'd get properly dressed on preview icon. --- code/modules/mob/new_player/preferences_setup.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 28f63329b1..7157f956f3 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -190,7 +190,10 @@ datum/preferences qdel(I) var/jobflag var/dept - if(job_civilian_high) + if (job_civilian_low & ASSISTANT) + jobflag = job_civilian_low + dept = CIVILIAN + else if(job_civilian_high) jobflag = job_civilian_high dept = CIVILIAN else if (job_medsci_high) @@ -199,7 +202,6 @@ datum/preferences else if (job_engsec_high) jobflag = job_engsec_high dept = ENGSEC - if(jobflag && dept && job_master) for (var/datum/job/J in job_master.occupations) if((J.department_flag & dept) && (J.flag & jobflag)) From 265b1d5b519d975405cd3ca0aa9cd22c1ecf7fbd Mon Sep 17 00:00:00 2001 From: Chinsky Date: Thu, 25 Jun 2015 23:51:58 +0300 Subject: [PATCH 021/207] Fixes #9913 Also axes hidden var in lieu of using implants like other foreign objects. Now instead of one object, amount of stuff you can put in someone's organ is restricted by stuff's combined w_class. --- code/game/machinery/adv_med.dm | 2 +- code/modules/mob/living/silicon/pai/pai.dm | 3 ++- code/modules/organs/organ_external.dm | 1 - code/modules/surgery/implant.dm | 30 +++++++++++----------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 8c6be59f71..58ebfb38ab 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -398,7 +398,7 @@ imp += "[I] implanted:" else unknown_body++ - if(unknown_body || e.hidden) + if(unknown_body) imp += "Unknown body present:" if(!AN && !open && !infected & !imp) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 82259f1bb4..09a25fbee4 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -281,8 +281,9 @@ if(ishuman(holder)) var/mob/living/carbon/human/H = holder for(var/obj/item/organ/external/affecting in H.organs) - if(affecting.hidden == card) + if(card in affecting.implants) affecting.take_damage(rand(30,50)) + affecting.implants -= card H.visible_message("\The [src] explodes out of \the [H]'s [affecting.name] in shower of gore!") break holder.drop_from_inventory(card) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 5434e98acc..f8f4a9bfff 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -39,7 +39,6 @@ var/cavity = 0 var/sabotaged = 0 // If a prosthetic limb is emagged, it will detonate when it fails. var/encased // Needs to be opened with a saw to access the organs. - var/obj/item/hidden = null var/list/implants = list() var/wound_update_accuracy = 1 // how often wounds should be updated, a higher number means less often var/joint = "joint" // Descriptive string used in dislocation. diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index 95980d5252..b20da362ca 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -45,7 +45,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected && !affected.cavity && !affected.hidden + return affected && !affected.cavity begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -112,7 +112,15 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(..()) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected && !istype(user,/mob/living/silicon/robot) && !affected.hidden && affected.cavity && tool.w_class <= get_max_wclass(affected) + if(istype(user,/mob/living/silicon/robot)) + return + if(affected && affected.cavity) + var/total_volume = tool.w_class + for(var/obj/item/I in affected.implants) + if(istype(I,/obj/item/weapon/implant)) + continue + total_volume += I.w_class + return total_volume <= get_max_wclass(affected) begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) @@ -132,8 +140,8 @@ affected.wounds += I affected.owner.custom_pain("You feel something rip in your [affected.name]!", 1) user.drop_item() - affected.hidden = tool - tool.loc = target + affected.implants += tool + tool.loc = affected affected.cavity = 0 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -174,7 +182,7 @@ if (affected.implants.len) - var/obj/item/obj = affected.implants[1] + var/obj/item/obj = pick(affected.implants) if(istype(obj,/obj/item/weapon/implant)) var/obj/item/weapon/implant/imp = obj @@ -201,6 +209,8 @@ worm.leave_host() else obj.loc = get_turf(target) + obj.add_blood(target) + obj.update_icon() if(istype(obj,/obj/item/weapon/implant)) var/obj/item/weapon/implant/imp = obj imp.imp_in = null @@ -208,16 +218,6 @@ else user.visible_message("\blue [user] removes \the [tool] from [target]'s [affected.name].", \ "\blue There's something inside [target]'s [affected.name], but you just missed it this time." ) - else if (affected.hidden) - user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.name] with \the [tool].", \ - "\blue You take something out of incision on [target]'s [affected.name]s with \the [tool]." ) - affected.hidden.loc = get_turf(target) - if(!affected.hidden.blood_DNA) - affected.hidden.blood_DNA = list() - affected.hidden.blood_DNA[target.dna.unique_enzymes] = target.dna.b_type - affected.hidden.update_icon() - affected.hidden = null - else user.visible_message("\blue [user] could not find anything inside [target]'s [affected.name], and pulls \the [tool] out.", \ "\blue You could not find anything inside [target]'s [affected.name]." ) From 78784a3d9a380bc80327e3be8077f7bcb0608f38 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Thu, 25 Jun 2015 23:59:12 +0300 Subject: [PATCH 022/207] Fixes #9933 Also potential same issue with other scalpel subtypes. --- code/modules/surgery/generic.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm index c1e51d9c4d..1b129fbcbb 100644 --- a/code/modules/surgery/generic.dm +++ b/code/modules/surgery/generic.dm @@ -30,7 +30,7 @@ /obj/item/weapon/scalpel/laser1 = 75, \ /obj/item/weapon/melee/energy/sword = 5 ) - + priority = 2 min_duration = 90 max_duration = 110 @@ -71,7 +71,7 @@ allowed_tools = list( /obj/item/weapon/scalpel/manager = 100 ) - + priority = 2 min_duration = 80 max_duration = 120 From 5906ae7556f603374f894e11b0ca1cbfb2f9e4a5 Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Thu, 25 Jun 2015 22:52:36 +0100 Subject: [PATCH 023/207] Adds 'age' command to world.Topic, for the IRC bot. Also runs all keys through ckey() before using them, to avoid easily-fixed errors --- code/modules/client/client procs.dm | 19 +++++++++++++++++++ code/world.dm | 23 +++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index d68356792c..51a5333fdc 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -177,6 +177,25 @@ return ..() +// here because it's similar to below + +// Returns null if no DB connection can be established, or -1 if the requested key was not found in the database + +/proc/get_player_age(key) + establish_db_connection() + if(!dbcon.IsConnected()) + return null + + var/sql_ckey = sql_sanitize_text(ckey(key)) + + var/DBQuery/query = dbcon.NewQuery("SELECT datediff(Now(),firstseen) as age FROM erro_player WHERE ckey = '[sql_ckey]'") + query.Execute() + + if(query.NextRow()) + return text2num(query.item[1]) + else + return -1 + /client/proc/log_client_to_db() diff --git a/code/world.dm b/code/world.dm index 2fd24cf9f5..f67d6711ac 100644 --- a/code/world.dm +++ b/code/world.dm @@ -156,9 +156,10 @@ var/world_topic_spam_protect_time = world.timeofday return "Bad Key" var/client/C + var/req_ckey = ckey(input["adminmsg"]) for(var/client/K in clients) - if(K.ckey == input["adminmsg"]) + if(K.ckey == req_ckey) C = K break if(!C) @@ -199,10 +200,28 @@ var/world_topic_spam_protect_time = world.timeofday world_topic_spam_protect_ip = addr return "Bad Key" - return show_player_info_irc(input["notes"]) + return show_player_info_irc(ckey(input["notes"])) + else if(copytext(T,1,4) == "age") + var/input[] = params2list(T) + if(input["key"] != config.comms_password) + if(world_topic_spam_protect_ip == addr && abs(world_topic_spam_protect_time - world.time) < 50) + spawn(50) + world_topic_spam_protect_time = world.time + return "Bad Key (Throttled)" + world_topic_spam_protect_time = world.time + world_topic_spam_protect_ip = addr + return "Bad Key" + var/age = get_player_age(input["age"]) + if(isnum(age)) + if(age >= 0) + return "[age]" + else + return "Ckey not found" + else + return "Database connection failed or not set up" /world/Reboot(var/reason) From 94ffb49bfbf6e151f2026526755f55794fcb0678 Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Fri, 26 Jun 2015 01:04:03 +0100 Subject: [PATCH 024/207] Fixes certain modes not sending the 'A round of [x] has ended' notification at round-end --- code/game/gamemodes/cult/cult.dm | 1 + code/game/gamemodes/nuclear/nuclear.dm | 3 ++- code/game/gamemodes/revolution/anti_revolution.dm | 3 ++- code/game/gamemodes/revolution/revolution.dm | 2 +- code/game/gamemodes/revolution/rp-revolution.dm | 2 ++ code/game/gamemodes/revolution/rp_revolution.dm | 2 +- 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index b86f46fa89..9ff016d7e5 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -280,6 +280,7 @@ /datum/game_mode/cult/declare_completion() if(config.objectives_disabled) + ..() return 1 if(!check_cult_victory()) feedback_set_details("round_end_result","win - cult win") diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index b2e54da0d9..a9ecba29a7 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -243,6 +243,7 @@ var/global/list/turf/synd_spawn = list() /datum/game_mode/nuclear/declare_completion() if(config.objectives_disabled) + ..() return var/disk_rescued = 1 for(var/obj/item/weapon/disk/nuclear/D in world) @@ -343,4 +344,4 @@ var/global/list/turf/synd_spawn = list() else synd_mind.current.name = choose_name synd_mind.current.real_name = choose_name - return \ No newline at end of file + return diff --git a/code/game/gamemodes/revolution/anti_revolution.dm b/code/game/gamemodes/revolution/anti_revolution.dm index fce1cace91..823b7d5fb3 100644 --- a/code/game/gamemodes/revolution/anti_revolution.dm +++ b/code/game/gamemodes/revolution/anti_revolution.dm @@ -191,6 +191,7 @@ feedback_add_details("head_objective","[objective.type]|FAIL") count++ break // just print once + ..() return 1 @@ -219,4 +220,4 @@ src.verbs -= /mob/proc/ResignFromHeadPosition - src << "\red You resigned from your position, now you have the consequences." \ No newline at end of file + src << "\red You resigned from your position, now you have the consequences." diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 71e9704606..428757245a 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -353,7 +353,7 @@ else if(finished == 2) feedback_set_details("round_end_result","loss - rev heads killed") world << "\red The heads of staff managed to stop the revolution!" - ..() + ..() return 1 /datum/game_mode/proc/auto_declare_completion_revolution() diff --git a/code/game/gamemodes/revolution/rp-revolution.dm b/code/game/gamemodes/revolution/rp-revolution.dm index 815b3be3cb..8af3deabc3 100644 --- a/code/game/gamemodes/revolution/rp-revolution.dm +++ b/code/game/gamemodes/revolution/rp-revolution.dm @@ -270,6 +270,8 @@ text += "[head_mind.key] (character destroyed)" world << text + + ..() return 1 diff --git a/code/game/gamemodes/revolution/rp_revolution.dm b/code/game/gamemodes/revolution/rp_revolution.dm index 5cf1bcc08d..94581909dd 100644 --- a/code/game/gamemodes/revolution/rp_revolution.dm +++ b/code/game/gamemodes/revolution/rp_revolution.dm @@ -146,7 +146,7 @@ else if(finished == 2) feedback_set_details("round_end_result","loss - revolution stopped") world << "\red The heads of staff managed to stop the revolution!" - ..() + ..() return 1 /datum/game_mode/revolution/proc/is_convertible(mob/M) From e08dbc3080f80cfbde8b4fac80452084bde54837 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sun, 21 Jun 2015 02:23:57 -0400 Subject: [PATCH 025/207] Adjusts gas fires to burn out faster with low concentrations of gas fuel --- code/ZAS/Fire.dm | 12 +++++++----- code/ZAS/_gas_mixture_xgm.dm | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 7cf4292c16..d752e14593 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -234,7 +234,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) log_debug("Burning [zone? zone.name : "zoneless gas_mixture"]!") #endif - var/gas_fuel = 0 //in the case of mixed gas/liquid fires, the gas burns first. + var/gas_fuel = 0 var/liquid_fuel = 0 var/total_fuel = 0 var/total_oxidizers = 0 @@ -270,12 +270,14 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) //calculate the firelevel. var/firelevel = calculate_firelevel(total_fuel, total_oxidizers, reaction_limit) + var/firelevel_ratio = firelevel / vsc.fire_firelevel_multiplier - //vapour fuels are extremely volatile! The reaction progress is a percentage of the total fuel (similar to old zburn). - var/gas_reaction_progress = (firelevel/vsc.fire_firelevel_multiplier)*gas_fuel*FIRE_GAS_BURNRATE_MULT + //vapour fuels are extremely volatile! The reaction progress is a percentage of the total fuel (similar to old zburn).) + var/min_burn = 0.30*volume*group_multiplier/CELL_VOLUME //in moles - so that fires with very small gas concentrations burn out fast + var/gas_reaction_progress = max(min_burn, firelevel_ratio*gas_fuel)*FIRE_GAS_BURNRATE_MULT //liquid fuels are not as volatile, and the reaction progress depends on the size of the area that is burning. Limit the burn rate to a certain amount per area. - var/liquid_reaction_progress = ((firelevel/vsc.fire_firelevel_multiplier)*0.2 + 0.05)*fuel_area*FIRE_LIQUID_BURNRATE_MULT + var/liquid_reaction_progress = (firelevel_ratio*0.2 + 0.05)*fuel_area*FIRE_LIQUID_BURNRATE_MULT var/total_reaction_progress = gas_reaction_progress + liquid_reaction_progress var/used_fuel = min(total_reaction_progress, reaction_limit) @@ -356,7 +358,7 @@ datum/gas_mixture/proc/check_recombustability(list/fuel_objs) . = 0 for(var/g in gas) - if(gas_data.flags[g] & XGM_GAS_FUEL && QUANTIZE(gas[g] * vsc.fire_consuption_rate) >= 0.1) + if(gas_data.flags[g] & XGM_GAS_FUEL && QUANTIZE(gas[g] * vsc.fire_consuption_rate) >= 0.005) . = 1 break diff --git a/code/ZAS/_gas_mixture_xgm.dm b/code/ZAS/_gas_mixture_xgm.dm index 8043be1579..6456d64bc1 100644 --- a/code/ZAS/_gas_mixture_xgm.dm +++ b/code/ZAS/_gas_mixture_xgm.dm @@ -232,6 +232,7 @@ gas[g] = gas[g] * (1 - ratio) removed.temperature = temperature + removed.volume = volume * group_multiplier / out_group_multiplier update_values() removed.update_values() From 9d7a1b9ad637beac13cd406f760707bad7e52c65 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 25 Jun 2015 22:03:01 -0400 Subject: [PATCH 026/207] Fixes misleading path and proc name --- code/TriDimension/Turfs.dm | 4 ++-- code/game/machinery/floorlayer.dm | 2 +- .../objects/items/stacks/tiles/plasteel.dm | 16 +++++++------- code/game/objects/structures/lattice.dm | 2 +- code/game/turfs/simulated/floor.dm | 22 +++++++++---------- code/game/turfs/space/space.dm | 4 ++-- code/game/turfs/turf.dm | 4 ++-- code/modules/admin/verbs/debug.dm | 14 ++++++------ code/modules/materials/material_recipes.dm | 2 +- code/modules/mob/living/bot/floorbot.dm | 16 +++++++------- .../mob/living/silicon/robot/robot_modules.dm | 4 ++-- 11 files changed, 45 insertions(+), 45 deletions(-) diff --git a/code/TriDimension/Turfs.dm b/code/TriDimension/Turfs.dm index 43e33ed3c2..12f7bc7c12 100644 --- a/code/TriDimension/Turfs.dm +++ b/code/TriDimension/Turfs.dm @@ -114,10 +114,10 @@ ReplaceWithLattice() return - if (istype(C, /obj/item/stack/tile/plasteel)) + if (istype(C, /obj/item/stack/tile/steel)) var/obj/structure/lattice/L = locate(/obj/structure/lattice, src) if(L) - var/obj/item/stack/tile/plasteel/S = C + var/obj/item/stack/tile/steel/S = C if (S.get_amount() < 1) return qdel(L) diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm index 009d1c7694..80d9ea8643 100644 --- a/code/game/machinery/floorlayer.dm +++ b/code/game/machinery/floorlayer.dm @@ -10,7 +10,7 @@ var/list/mode = list("dismantle"=0,"laying"=0,"collect"=0) /obj/machinery/floorlayer/New() - T = new/obj/item/stack/tile/plasteel(src) + T = new/obj/item/stack/tile/steel(src) ..() /obj/machinery/floorlayer/Move(new_turf,M_Dir) diff --git a/code/game/objects/items/stacks/tiles/plasteel.dm b/code/game/objects/items/stacks/tiles/plasteel.dm index 86af65a2fa..548173e52c 100644 --- a/code/game/objects/items/stacks/tiles/plasteel.dm +++ b/code/game/objects/items/stacks/tiles/plasteel.dm @@ -1,7 +1,7 @@ -/obj/item/stack/tile/plasteel +/obj/item/stack/tile/steel name = "floor tile" singular_name = "floor tile" - desc = "Those could work as a pretty decent throwing weapon" + desc = "Those could work as a pretty decent throwing weapon" //why? icon_state = "tile" force = 6.0 matter = list(DEFAULT_WALL_MATERIAL = 937.5) @@ -10,24 +10,24 @@ throw_range = 20 flags = CONDUCT -/obj/item/stack/tile/plasteel/New(var/loc, var/amount=null) +/obj/item/stack/tile/steel/New(var/loc, var/amount=null) ..() src.pixel_x = rand(1, 14) src.pixel_y = rand(1, 14) return -/obj/item/stack/tile/plasteel/cyborg +/obj/item/stack/tile/steel/cyborg name = "floor tile synthesizer" desc = "A device that makes floor tiles." gender = NEUTER matter = null uses_charge = 1 charge_costs = list(250) - stacktype = /obj/item/stack/tile/plasteel - build_type = /obj/item/stack/tile/plasteel + stacktype = /obj/item/stack/tile/steel + build_type = /obj/item/stack/tile/steel /* -/obj/item/stack/tile/plasteel/attack_self(mob/user as mob) +/obj/item/stack/tile/steel/attack_self(mob/user as mob) if (usr.stat) return var/T = user.loc @@ -43,7 +43,7 @@ return */ -/obj/item/stack/tile/plasteel/proc/build(turf/S as turf) +/obj/item/stack/tile/steel/proc/build(turf/S as turf) if (istype(S,/turf/space)) S.ChangeTurf(/turf/simulated/floor/plating/airless) else diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index 078f4bc06b..f90bc29b2c 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -53,7 +53,7 @@ /obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob) - if (istype(C, /obj/item/stack/tile/plasteel)) + if (istype(C, /obj/item/stack/tile/steel)) var/turf/T = get_turf(src) T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead return diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index b34144fc39..3fbfe7aff2 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -29,7 +29,7 @@ var/list/wood_icons = list("wood","wood-broken") /turf/simulated/floor //Note to coders, the 'intact' var can no longer be used to determine if the floor is a plating or not. - //Use the is_plating(), is_plasteel_floor() and is_light_floor() procs instead. --Errorage + //Use the is_plating(), is_steel_floor() and is_light_floor() procs instead. --Errorage name = "floor" icon = 'icons/turf/floors.dmi' icon_state = "floor" @@ -42,7 +42,7 @@ var/list/wood_icons = list("wood","wood-broken") var/broken = 0 var/burnt = 0 var/mineral = DEFAULT_WALL_MATERIAL - var/floor_type = /obj/item/stack/tile/plasteel + var/floor_type = /obj/item/stack/tile/steel var/lightfloor_state // for light floors, this is the state of the tile. 0-7, 0x4 is on-bit - use the helper procs below proc/get_lightfloor_state() @@ -122,7 +122,7 @@ var/list/wood_icons = list("wood","wood-broken") turf/simulated/floor/proc/update_icon() if(lava) return - else if(is_plasteel_floor()) + else if(is_steel_floor()) if(!broken && !burnt) icon_state = icon_regular_floor else if(is_plating()) @@ -237,8 +237,8 @@ turf/simulated/floor/proc/update_icon() make_plating() break_tile() -/turf/simulated/floor/is_plasteel_floor() - if(ispath(floor_type, /obj/item/stack/tile/plasteel)) +/turf/simulated/floor/is_steel_floor() + if(ispath(floor_type, /obj/item/stack/tile/steel)) return 1 else return 0 @@ -277,7 +277,7 @@ turf/simulated/floor/proc/update_icon() if(istype(src,/turf/simulated/floor/mech_bay_recharge_floor)) src.ChangeTurf(/turf/simulated/floor/plating) if(broken) return - if(is_plasteel_floor()) + if(is_steel_floor()) src.icon_state = "damaged[pick(1,2,3,4,5)]" broken = 1 else if(is_light_floor()) @@ -300,10 +300,10 @@ turf/simulated/floor/proc/update_icon() if(istype(src,/turf/simulated/floor/engine)) return if(istype(src,/turf/simulated/floor/plating/airless/asteroid)) return//Asteroid tiles don't burn if(broken || burnt) return - if(is_plasteel_floor()) + if(is_steel_floor()) src.icon_state = "damaged[pick(1,2,3,4,5)]" burnt = 1 - else if(is_plasteel_floor()) + else if(is_steel_floor()) src.icon_state = "floorscorched[pick(1,2)]" burnt = 1 else if(is_plating()) @@ -351,13 +351,13 @@ turf/simulated/floor/proc/update_icon() //This proc will make the turf a plasteel floor tile. The expected argument is the tile to make the turf with //If none is given it will make a new object. dropping or unequipping must be handled before or after calling //this proc. -/turf/simulated/floor/proc/make_plasteel_floor(var/obj/item/stack/tile/plasteel/T = null) +/turf/simulated/floor/proc/make_plasteel_floor(var/obj/item/stack/tile/steel/T = null) broken = 0 burnt = 0 intact = 1 set_light(0) if(T) - if(istype(T,/obj/item/stack/tile/plasteel)) + if(istype(T,/obj/item/stack/tile/steel)) floor_type = T.type if (icon_regular_floor) icon_state = icon_regular_floor @@ -368,7 +368,7 @@ turf/simulated/floor/proc/update_icon() levelupdate() return //if you gave a valid parameter, it won't get thisf ar. - floor_type = /obj/item/stack/tile/plasteel + floor_type = /obj/item/stack/tile/steel icon_state = "floor" icon_regular_floor = icon_state diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index b3c545053c..35ca29d2d5 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -39,10 +39,10 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" = ReplaceWithLattice() return - if (istype(C, /obj/item/stack/tile/plasteel)) + if (istype(C, /obj/item/stack/tile/steel)) var/obj/structure/lattice/L = locate(/obj/structure/lattice, src) if(L) - var/obj/item/stack/tile/plasteel/S = C + var/obj/item/stack/tile/steel/S = C if (S.get_amount() < 1) return qdel(L) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 65d9050617..a99a9265d5 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -2,7 +2,7 @@ icon = 'icons/turf/floors.dmi' level = 1.0 - //for floors, use is_plating(), is_plasteel_floor() and is_light_floor() + //for floors, use is_plating(), is_steel_floor() and is_light_floor() var/intact = 1 //Properties for open tiles (/floor) @@ -160,7 +160,7 @@ return 0 /turf/proc/is_asteroid_floor() return 0 -/turf/proc/is_plasteel_floor() +/turf/proc/is_steel_floor() return 0 /turf/proc/is_light_floor() return 0 diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 0552892f21..ef9c5c6376 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -641,13 +641,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that M.equip_to_slot_or_del(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), slot_r_store) M.equip_to_slot_or_del(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), slot_l_store) - M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) - M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) - M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) - M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) - M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) - M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) - M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack) + M.equip_to_slot_or_del(new /obj/item/stack/tile/steel(M), slot_in_backpack) if ("pirate") M.equip_to_slot_or_del(new /obj/item/clothing/under/pirate(M), slot_w_uniform) diff --git a/code/modules/materials/material_recipes.dm b/code/modules/materials/material_recipes.dm index c24490d6db..ab528d9644 100644 --- a/code/modules/materials/material_recipes.dm +++ b/code/modules/materials/material_recipes.dm @@ -46,7 +46,7 @@ recipes += new/datum/stack_recipe("closet", /obj/structure/closet, 2, time = 15, one_per_turf = 1, on_floor = 1) recipes += new/datum/stack_recipe("canister", /obj/machinery/portable_atmospherics/canister, 10, time = 15, one_per_turf = 1, on_floor = 1) recipes += new/datum/stack_recipe("cannon frame", /obj/item/weapon/cannonframe, 10, time = 15, one_per_turf = 0, on_floor = 0) - recipes += new/datum/stack_recipe("floor tile", /obj/item/stack/tile/plasteel, 1, 4, 20) + recipes += new/datum/stack_recipe("floor tile", /obj/item/stack/tile/steel, 1, 4, 20) recipes += new/datum/stack_recipe("metal rod", /obj/item/stack/rods, 1, 2, 60) recipes += new/datum/stack_recipe("computer frame", /obj/structure/computerframe, 5, time = 25, one_per_turf = 1, on_floor = 1) recipes += new/datum/stack_recipe("wall girders", /obj/structure/girder, 2, time = 50, one_per_turf = 1, on_floor = 1) diff --git a/code/modules/mob/living/bot/floorbot.dm b/code/modules/mob/living/bot/floorbot.dm index 8d61d0bb03..80d6d69df8 100644 --- a/code/modules/mob/living/bot/floorbot.dm +++ b/code/modules/mob/living/bot/floorbot.dm @@ -148,7 +148,7 @@ if(!target && amount < maxAmount && eattiles || maketiles) // Eat tiles if(eattiles) - for(var/obj/item/stack/tile/plasteel/T in view(src)) + for(var/obj/item/stack/tile/steel/T in view(src)) if(T in ignorelist) continue target = T @@ -215,7 +215,7 @@ if(A && (locate(/obj/structure/lattice, A) && building == 1 || !locate(/obj/structure/lattice, A) && building == 2)) // Make sure that it still needs repairs var/obj/item/I if(building == 1) - I = new /obj/item/stack/tile/plasteel(src) + I = new /obj/item/stack/tile/steel(src) else I = PoolOrNew(/obj/item/stack/rods, src) A.attackby(I, src) @@ -230,14 +230,14 @@ visible_message("[src] begins to improve the floor.") if(do_after(src, 50)) if(!F.floor_type) - var/obj/item/stack/tile/plasteel/T = new /obj/item/stack/tile/plasteel(src) + var/obj/item/stack/tile/steel/T = new /obj/item/stack/tile/steel(src) F.attackby(T, src) addTiles(-1) target = null repairing = 0 update_icons() - else if(istype(A, /obj/item/stack/tile/plasteel) && amount < maxAmount) - var/obj/item/stack/tile/plasteel/T = A + else if(istype(A, /obj/item/stack/tile/steel) && amount < maxAmount) + var/obj/item/stack/tile/steel/T = A visible_message("[src] begins to collect tiles.") repairing = 1 update_icons() @@ -269,7 +269,7 @@ new /obj/item/device/assembly/prox_sensor(Tsec) if(prob(50)) new /obj/item/robot_parts/l_arm(Tsec) - var/obj/item/stack/tile/plasteel/T = new /obj/item/stack/tile/plasteel(Tsec) + var/obj/item/stack/tile/steel/T = new /obj/item/stack/tile/steel(Tsec) T.amount = amount var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(3, 1, src) @@ -285,8 +285,8 @@ /* Assembly */ -/obj/item/weapon/storage/toolbox/mechanical/attackby(var/obj/item/stack/tile/plasteel/T, mob/user as mob) - if(!istype(T, /obj/item/stack/tile/plasteel)) +/obj/item/weapon/storage/toolbox/mechanical/attackby(var/obj/item/stack/tile/steel/T, mob/user as mob) + if(!istype(T, /obj/item/stack/tile/steel)) ..() return if(contents.len >= 1) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 527ce35df2..5e6b949a65 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -372,7 +372,7 @@ var/global/list/robot_modules = list( C.synths = list(wire) src.modules += C - var/obj/item/stack/tile/plasteel/cyborg/S = new /obj/item/stack/tile/plasteel/cyborg(src) + var/obj/item/stack/tile/steel/cyborg/S = new /obj/item/stack/tile/steel/cyborg(src) S.synths = list(metal) src.modules += S @@ -695,7 +695,7 @@ var/global/list/robot_modules = list( C.synths = list(wire) src.modules += C - var/obj/item/stack/tile/plasteel/cyborg/S = new /obj/item/stack/tile/plasteel/cyborg(src) + var/obj/item/stack/tile/steel/cyborg/S = new /obj/item/stack/tile/steel/cyborg(src) S.synths = list(metal) src.modules += S From 56065022a753cda5236ec1c3f46ce316da7e7f38 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 25 Jun 2015 22:55:26 -0400 Subject: [PATCH 027/207] Updates fire_act() implementations to work better with lower temperature fires In some cases fire_act() wasn't even checking the applied temperature. Reworks how fire damages flooring. --- code/game/objects/effects/aliens.dm | 4 +- code/game/objects/effects/spiders.dm | 2 +- .../objects/items/devices/floor_painter.dm | 2 +- .../objects/items/stacks/tiles/tile_types.dm | 6 +- code/game/turfs/simulated/floor.dm | 64 ++++++++++++------- code/modules/mob/living/carbon/carbon.dm | 3 +- code/modules/mob/living/carbon/human/life.dm | 4 +- code/modules/mob/living/living_defense.dm | 6 ++ code/modules/reagents/reagent_dispenser.dm | 2 +- 9 files changed, 60 insertions(+), 33 deletions(-) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 6882f9affa..d34c185d08 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -259,7 +259,7 @@ Alien plants should do something if theres a lot of poison /obj/effect/alien/weeds/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) - if(exposed_temperature > 300) + if(exposed_temperature > 300 + T0C) health -= 5 healthcheck() @@ -430,7 +430,7 @@ Alien plants should do something if theres a lot of poison Burst() /obj/effect/alien/egg/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) - if(exposed_temperature > 500) + if(exposed_temperature > 500 + T0C) health -= 5 healthcheck() diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 03b5c922d8..62c13c7e61 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -48,7 +48,7 @@ qdel(src) /obj/effect/spider/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) - if(exposed_temperature > 300) + if(exposed_temperature > 300 + T0C) health -= 5 healthcheck() diff --git a/code/game/objects/items/devices/floor_painter.dm b/code/game/objects/items/devices/floor_painter.dm index 43bc58261b..415a5ec200 100644 --- a/code/game/objects/items/devices/floor_painter.dm +++ b/code/game/objects/items/devices/floor_painter.dm @@ -21,7 +21,7 @@ if(istype(A, /turf/simulated/floor)) var/turf/simulated/floor/F = A - if(F.is_plasteel_floor()) // only tiled floors + if(F.is_steel_floor()) // only tiled floors if(tile_dir_mode) var/D = get_dir(usr, F) if(usr.loc == F) diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index dcac154442..47134c0e75 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -26,7 +26,7 @@ throwforce = 1.0 throw_speed = 5 throw_range = 20 - flags = CONDUCT + flags = 0 origin_tech = "biotech=1" /* @@ -41,7 +41,7 @@ throwforce = 1.0 throw_speed = 5 throw_range = 20 - flags = CONDUCT + flags = 0 /obj/item/stack/tile/wood/cyborg name = "wood floor tile synthesizer" @@ -63,4 +63,4 @@ throwforce = 1.0 throw_speed = 5 throw_range = 20 - flags = CONDUCT + flags = 0 diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 3fbfe7aff2..6cfdbf4470 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -102,13 +102,23 @@ var/list/wood_icons = list("wood","wood-broken") return /turf/simulated/floor/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) + + var/temp_destroy = get_damage_temperature() if(!burnt && prob(5)) - burn_tile() - else if(prob(1) && !is_plating()) - make_plating() - burn_tile() + burn_tile(exposed_temperature) + else if(temp_destroy && exposed_temperature >= (temp_destroy + 100) && prob(1) && !is_plating()) + make_plating() //destroy the tile, exposing plating + burn_tile(exposed_temperature) return +//should be a little bit lower than the temperature required to destroy the material +/turf/simulated/floor/proc/get_damage_temperature() + if(is_steel_floor()) return T0C+1400 + if(is_wood_floor()) return T0C+200 + if(is_carpet_floor()) return T0C+200 + if(is_grass_floor()) return T0C+80 + return null + /turf/simulated/floor/adjacent_fire_act(turf/simulated/floor/adj_turf, datum/gas_mixture/adj_air, adj_temp, adj_volume) var/dir_to = get_dir(src, adj_turf) @@ -296,28 +306,38 @@ turf/simulated/floor/proc/update_icon() src.icon_state = "sand[pick("1","2","3")]" broken = 1 -/turf/simulated/floor/proc/burn_tile() +/turf/simulated/floor/proc/burn_tile(var/exposed_temperature) if(istype(src,/turf/simulated/floor/engine)) return if(istype(src,/turf/simulated/floor/plating/airless/asteroid)) return//Asteroid tiles don't burn - if(broken || burnt) return - if(is_steel_floor()) - src.icon_state = "damaged[pick(1,2,3,4,5)]" - burnt = 1 - else if(is_steel_floor()) + + var/damage_temp = get_damage_temperature() + + if(broken) return + if(burnt) + if(is_steel_floor() && exposed_temperature >= damage_temp) //allow upgrading from scorched tiles to damaged tiles + src.icon_state = "damaged[pick(1,2,3,4,5)]" + broken = 1 + return + + if(is_steel_floor() && exposed_temperature >= T0C+300) //enough to char the floor, but not hot enough to actually burn holes in it src.icon_state = "floorscorched[pick(1,2)]" burnt = 1 - else if(is_plating()) - src.icon_state = "panelscorched" - burnt = 1 - else if(is_wood_floor()) - src.icon_state = "wood-broken" - burnt = 1 - else if(is_carpet_floor()) - src.icon_state = "carpet-broken" - burnt = 1 - else if(is_grass_floor()) - src.icon_state = "sand[pick("1","2","3")]" - burnt = 1 + else if(exposed_temperature >= damage_temp) + if(is_steel_floor()) + src.icon_state = "damaged[pick(1,2,3,4,5)]" + burnt = 1 + else if(is_plating()) + src.icon_state = "panelscorched" + burnt = 1 + else if(is_wood_floor()) + src.icon_state = "wood-broken" + burnt = 1 + else if(is_carpet_floor()) + src.icon_state = "carpet-broken" + burnt = 1 + else if(is_grass_floor()) + src.icon_state = "sand[pick("1","2","3")]" + burnt = 1 //This proc will set floor_type to null and the update_icon() proc will then change the icon_state of the turf //This proc auto corrects the grass tiles' siding. diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 8dc6823726..d8842cdd29 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -381,7 +381,8 @@ /mob/living/carbon/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) ..() - bodytemperature = max(bodytemperature, BODYTEMP_HEAT_DAMAGE_LIMIT+10) + var/temp_inc = max(BODYTEMP_HEATING_MAX*(1-get_heat_protection()), 0) + bodytemperature = min(bodytemperature + temp_inc, exposed_temperature) /mob/living/carbon/can_use_hands() if(handcuffed) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index a624b3d18c..8379a5a883 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -764,7 +764,7 @@ return thermal_protection_flags - proc/get_heat_protection(temperature) //Temperature is the temperature you're being exposed to. + get_heat_protection(temperature) //Temperature is the temperature you're being exposed to. var/thermal_protection_flags = get_heat_protection_flags(temperature) var/thermal_protection = 0.0 @@ -821,7 +821,7 @@ return thermal_protection_flags - proc/get_cold_protection(temperature) + get_cold_protection(temperature) if(COLD_RESISTANCE in mutations) return 1 //Fully protected from the cold. diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 32b0235009..986ab14cec 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -239,6 +239,12 @@ adjust_fire_stacks(2) IgniteMob() +/mob/living/proc/get_cold_protection() + return 0 + +/mob/living/proc/get_heat_protection() + return 0 + //Finds the effective temperature that the mob is burning at. /mob/living/proc/fire_burn_temperature() if (fire_stacks <= 0) diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 185f6b1342..7fc8ebf8ab 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -165,7 +165,7 @@ explosion(src.loc,1,2,4) else if (reagents.total_volume > 100) explosion(src.loc,0,1,3) - else + else if (reagents.total_volume > 50) explosion(src.loc,-1,1,2) if(src) qdel(src) From aae29d8b6ee83bc80219ec280e83bfd0930800ab Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 25 Jun 2015 23:18:48 -0400 Subject: [PATCH 028/207] Adds 'melting' and ignition points for various materials --- code/modules/materials/materials.dm | 34 ++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index 2098c7c776..2f2be81dfa 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -69,7 +69,7 @@ var/list/name_to_material // Attributes var/cut_delay = 0 // Delay in ticks when cutting through this wall. var/radioactivity // Radiation var. Used in wall and object processing to irradiate surroundings. - var/ignition_point // Point at which the material catches on fire. + var/ignition_point // K, point at which the material catches on fire. var/melting_point = 1800 // K, walls will take damage if they're next to a fire hotter than this var/integrity = 150 // General-use HP value for products. var/opacity = 1 // Is the material transparent? 0.5< makes transparent walls/doors. @@ -249,7 +249,7 @@ var/list/name_to_material /material/phoron name = "phoron" stack_type = /obj/item/stack/material/phoron - ignition_point = 100 + ignition_point = PHORON_MINIMUM_BURN_TEMPERATURE icon_base = "stone" icon_colour = "#FC2BC5" shard_type = SHARD_SHARD @@ -432,7 +432,7 @@ var/list/name_to_material name = "phoron glass" stack_type = /obj/item/stack/material/glass/phoronglass flags = MATERIAL_BRITTLE - ignition_point = 300 + ignition_point = PHORON_MINIMUM_BURN_TEMPERATURE+300 integrity = 200 // idk why but phoron windows are strong, so. icon_colour = "#FC2BC5" stack_origin_tech = "materials=3;phorontech=2" @@ -458,6 +458,7 @@ var/list/name_to_material icon_colour = "#CCCCCC" hardness = 10 weight = 12 + melting_point = T0C+371 //assuming heat resistant plastic stack_origin_tech = "materials=3" /material/plastic/holographic @@ -521,6 +522,8 @@ var/list/name_to_material shard_can_repair = 0 // you can't weld splinters back into planks hardness = 15 weight = 18 + melting_point = T0C+300 //okay, not melting in this case, but hot enough to destroy wood + ignition_point = T0C+288 stack_origin_tech = "materials=1;biotech=1" dooropen_noise = 'sound/effects/doorcreaky.ogg' door_icon_base = "wood" @@ -542,6 +545,8 @@ var/list/name_to_material icon_colour = "#AAAAAA" hardness = 1 weight = 1 + ignition_point = T0C+232 //"the temperature at which book-paper catches fire, and burns." close enough + melting_point = T0C+232 //temperature at which cardboard walls would be destroyed stack_origin_tech = "materials=1" door_icon_base = "wood" destruction_desc = "crumples" @@ -550,6 +555,8 @@ var/list/name_to_material name = "cloth" stack_origin_tech = "materials=2" door_icon_base = "wood" + ignition_point = T0C+232 + melting_point = T0C+300 flags = MATERIAL_PADDING /material/cult @@ -578,6 +585,7 @@ var/list/name_to_material icon_colour = "#E85DD8" dooropen_noise = 'sound/effects/attackblob.ogg' door_icon_base = "resin" + melting_point = T0C+300 /material/resin/can_open_material_door(var/mob/living/user) var/mob/living/carbon/M = user @@ -591,6 +599,8 @@ var/list/name_to_material icon_colour = "#5C4831" stack_origin_tech = "materials=2" flags = MATERIAL_PADDING + ignition_point = T0C+300 + melting_point = T0C+300 /material/carpet name = "carpet" @@ -598,12 +608,16 @@ var/list/name_to_material use_name = "red upholstery" icon_colour = "#DA020A" flags = MATERIAL_PADDING + ignition_point = T0C+232 + melting_point = T0C+300 /material/cotton name = "cotton" display_name ="cotton" icon_colour = "#FFFFFF" flags = MATERIAL_PADDING + ignition_point = T0C+232 + melting_point = T0C+300 /material/cloth_teal name = "teal" @@ -611,6 +625,8 @@ var/list/name_to_material use_name = "teal cloth" icon_colour = "#00EAFA" flags = MATERIAL_PADDING + ignition_point = T0C+232 + melting_point = T0C+300 /material/cloth_black name = "black" @@ -618,6 +634,8 @@ var/list/name_to_material use_name = "black cloth" icon_colour = "#505050" flags = MATERIAL_PADDING + ignition_point = T0C+232 + melting_point = T0C+300 /material/cloth_green name = "green" @@ -625,6 +643,8 @@ var/list/name_to_material use_name = "green cloth" icon_colour = "#01C608" flags = MATERIAL_PADDING + ignition_point = T0C+232 + melting_point = T0C+300 /material/cloth_puple name = "purple" @@ -632,6 +652,8 @@ var/list/name_to_material use_name = "purple cloth" icon_colour = "#9C56C4" flags = MATERIAL_PADDING + ignition_point = T0C+232 + melting_point = T0C+300 /material/cloth_blue name = "blue" @@ -639,6 +661,8 @@ var/list/name_to_material use_name = "blue cloth" icon_colour = "#6B6FE3" flags = MATERIAL_PADDING + ignition_point = T0C+232 + melting_point = T0C+300 /material/cloth_beige name = "beige" @@ -646,6 +670,8 @@ var/list/name_to_material use_name = "beige cloth" icon_colour = "#E8E7C8" flags = MATERIAL_PADDING + ignition_point = T0C+232 + melting_point = T0C+300 /material/cloth_lime name = "lime" @@ -653,3 +679,5 @@ var/list/name_to_material use_name = "lime cloth" icon_colour = "#62E36C" flags = MATERIAL_PADDING + ignition_point = T0C+232 + melting_point = T0C+300 From 1b978f9570446dc7a90c5560fc13ede54b05f63a Mon Sep 17 00:00:00 2001 From: mwerezak Date: Fri, 26 Jun 2015 01:34:15 -0400 Subject: [PATCH 029/207] Makes update_inv_head() respect item_state and item_icons Fixes #9873 --- code/modules/clothing/head/misc_special.dm | 15 ++++------ .../mob/living/carbon/human/update_icons.dm | 29 ++++++++++++------- code/modules/mob/update_icons.dm | 1 + code/modules/paperwork/paper.dm | 1 + code/setup.dm | 1 + 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 5eb7e0c65b..39d75a8392 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -138,21 +138,18 @@ desc = "A pair of kitty ears. Meow!" icon_state = "kitty" body_parts_covered = 0 - var/icon/mob - var/icon/mob2 siemens_coefficient = 1.5 + item_icons = list() update_icon(var/mob/living/carbon/human/user) if(!istype(user)) return - mob = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty") - mob2 = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty2") - mob.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) - mob2.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) + var/icon/ears = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty") + ears.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) var/icon/earbit = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kittyinner") - var/icon/earbit2 = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kittyinner2") - mob.Blend(earbit, ICON_OVERLAY) - mob2.Blend(earbit2, ICON_OVERLAY) + ears.Blend(earbit, ICON_OVERLAY) + + item_icons[icon_head] = ears /obj/item/clothing/head/richard name = "chicken mask" diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index b33980f4b9..d25802b2f7 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -686,17 +686,24 @@ proc/get_damage_icon_part(damage_state, body_part) /mob/living/carbon/human/update_inv_head(var/update_icons=1) if(head) head.screen_loc = ui_head //TODO - var/image/standing - if(istype(head,/obj/item/clothing/head/kitty)) - standing = image("icon" = head:mob) - else - if(head.icon_override) - standing = image("icon" = head.icon_override, "icon_state" = "[head.icon_state]") - else if(head.sprite_sheets && head.sprite_sheets[species.name]) - standing = image("icon" = head.sprite_sheets[species.name], "icon_state" = "[head.icon_state]") - else - standing = image("icon" = 'icons/mob/head.dmi', "icon_state" = "[head.icon_state]") - + + //Determine the icon to use + var/t_icon = INV_HEAD_DEF_ICON + if(head.icon_override) + t_icon = head.icon_override + else if(head.sprite_sheets && head.sprite_sheets[species.name]) + t_icon = head.sprite_sheets[species.name] + else if(head.item_icons && (icon_head in head.item_icons)) + t_icon = head.item_icons[icon_head] + + //Determine the state to use + var/t_state = head.icon_state + if(head.item_state) + t_state = head.item_state + + //Create the image + var/image/standing = image(icon = t_icon, icon_state = t_state) + if(head.blood_DNA) var/image/bloodsies = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "helmetblood") bloodsies.color = head.blood_color diff --git a/code/modules/mob/update_icons.dm b/code/modules/mob/update_icons.dm index 480c4be322..572fe17737 100644 --- a/code/modules/mob/update_icons.dm +++ b/code/modules/mob/update_icons.dm @@ -2,6 +2,7 @@ //Having them here also makes for a nice reference list of the various overlay-updating procs available //default item on-mob icons +#define INV_HEAD_DEF_ICON 'icons/mob/head.dmi' #define INV_L_HAND_DEF_ICON 'icons/mob/items/lefthand.dmi' #define INV_R_HAND_DEF_ICON 'icons/mob/items/righthand.dmi' diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 87d5f002ee..75fb65a2af 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -8,6 +8,7 @@ gender = PLURAL icon = 'icons/obj/bureaucracy.dmi' icon_state = "paper" + item_state = "paper" throwforce = 0 w_class = 1.0 throw_range = 1 diff --git a/code/setup.dm b/code/setup.dm index 7faa91e45a..7f0d550173 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -247,6 +247,7 @@ // cannot be used as associative list keys. #define icon_l_hand "slot_l_hand" #define icon_r_hand "slot_r_hand" +#define icon_head "slot_head" // Bitflags for clothing parts. #define HEAD 1 From 242f5c5dfdf6a61fd63ab986ceda532d1f8fafce Mon Sep 17 00:00:00 2001 From: mwerezak Date: Fri, 26 Jun 2015 01:35:35 -0400 Subject: [PATCH 030/207] Fixes #9928 --- code/game/machinery/recharger.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 8a949f7272..b533015c66 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -13,6 +13,7 @@ obj/machinery/recharger var/icon_state_charged = "recharger2" var/icon_state_charging = "recharger1" var/icon_state_idle = "recharger0" //also when unpowered + var/portable = 1 obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) if(istype(user,/mob/living/silicon)) @@ -45,7 +46,7 @@ obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob) G.loc = src charging = G update_icon() - else if(istype(G, /obj/item/weapon/wrench)) + else if(portable && istype(G, /obj/item/weapon/wrench)) if(charging) user << "\red Remove [charging] first!" return @@ -155,3 +156,4 @@ obj/machinery/recharger/wallcharger icon_state_charged = "wrecharger2" icon_state_charging = "wrecharger1" icon_state_idle = "wrecharger0" + portable = 0 From c6c200c12789f7fc263373bde94a35c1b21fc05a Mon Sep 17 00:00:00 2001 From: mwerezak Date: Fri, 26 Jun 2015 01:38:04 -0400 Subject: [PATCH 031/207] Fixes #9251 --- code/modules/shuttles/escape_pods.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/shuttles/escape_pods.dm b/code/modules/shuttles/escape_pods.dm index 289cf4d7b0..3fbc03b0ae 100644 --- a/code/modules/shuttles/escape_pods.dm +++ b/code/modules/shuttles/escape_pods.dm @@ -111,8 +111,9 @@ var/closing = 0 /datum/computer/file/embedded_program/docking/simple/escape_pod/proc/arm() - armed = 1 - open_door() + if(!armed) + armed = 1 + open_door() /datum/computer/file/embedded_program/docking/simple/escape_pod/receive_user_command(command) From 90f08d3fa7d53270e2a684294dbaf76df2bdb8bf Mon Sep 17 00:00:00 2001 From: Atlantis Date: Fri, 26 Jun 2015 18:22:59 +0200 Subject: [PATCH 032/207] Fixes #9929 - Adds missing connect_to_network() and disconnect_from_network() into TEG wrenching code. --- code/modules/power/generator.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index f6f7f135e2..c73bd19aa8 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -145,6 +145,10 @@ "You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \ "You hear a ratchet") use_power = anchored + if(anchored) // Powernet connection stuff. + connect_to_network() + else + disconnect_from_network() reconnect() else ..() From dd7d9b851b68fc8df4df5bd065e2811c1fa9c2f3 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Fri, 26 Jun 2015 19:23:47 +0200 Subject: [PATCH 033/207] Updates changelog. --- html/changelog.html | 25 +++++++++++++++++++++++++ html/changelogs/.all_changelog.yml | 1 + 2 files changed, 26 insertions(+) diff --git a/html/changelog.html b/html/changelog.html index ca9cb73ae7..731c4fd321 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -56,6 +56,31 @@ -->
+

24 June 2015

+

HarpyEagle updated:

+
    +
  • Fixed Tajaran name generation producing names without a space between first and last.
  • +
  • Adds docking to the mercenary shuttle. Works similarly to other shuttles, except docking and undocking is manually initiated and not automatic. A system to approve or deny dock requests still to be implemented.
  • +
  • Toolboxes can now hold larger items, such as stacks of metal or power cells, at the cost of having less space for other things.
  • +
  • Gloves/shoes can now be worn even if you have one hand/foot missing. The other one still has to be present, of course. The items still drop when you first lose the hand/foot.
  • +
  • Budget insulated gloves are somewhat less useless. On average, they will stop half the damage from getting shocked, and the worst case insulation is not as bad as it used to be. Budget gloves that are as good as regular insulated gloves are still as rare as they were before though.
  • +
  • PTR bullets are now hitscan, to make them somewhat better for actual sniping.
  • +
  • The telecoms server room now has an actual cycling airlock into it.
  • +
  • Non-vital body parts will no longer take further damage above a certain amount, and will inflict paincrit effects instead. On most humaniods the head, chest, and groin are vital.
  • +
  • Engineers now spawn with industrial workboots (credit: ChessPiece/Bishop).
  • +
  • Damaged robotic legs now more likely to have an effect.
  • +
  • Fixed bug preventing internal organs from taking damage in some cases.
  • +
  • New flavours of tables around the station. Engineering starts with more plastic.
  • +
  • Fixed worn items not appearing in some cases. Most notably crossbows and certain guns when worn on the back. As a side effect, laundry machines no longer transform items.
  • +
  • Crit oxyloss now runs in game time instead of real time. So if lag is slowing your movement the same slowdown applies to the dying person you're trying to reach.
  • +
  • Breathmasks can now be adjusted by clicking on them in your hand, in addition to the verb.
  • +
  • Wearing a space helmet or similar face-covering gear now prevents eating and force-feeding food, drink, and pills.
  • +
  • Phoron in air ignites above it's flashpoint temperature and a certain (very small) minimum concentration. Environments that have oxygen and are hot enough, and have phoron but not enough concentration to burn will produce flareouts, which are mostly a visual effect.
  • +
  • Adds animation when making unarmed attacks or attacking with melee weapons, to help make it clearer who is attacking.
  • +
  • Opening an unpowered door now has an appropriate sound.
  • +
  • Ingesting diseased blood may contract the disease.
  • +
+

19 June 2015

HarpyEagle updated: