Merge github.com:Baystation12/Baystation12

Conflicts:
	code/modules/mob/mob.dm
	code/modules/projectiles/projectile/change.dm
This commit is contained in:
cib
2012-05-29 13:43:20 +02:00
119 changed files with 12083 additions and 10356 deletions

View File

@@ -361,12 +361,6 @@
#include "code\defines\sd_procs\constants.dm"
#include "code\defines\sd_procs\direction.dm"
#include "code\defines\sd_procs\math.dm"
#include "code\FEA\FEA_airgroup.dm"
#include "code\FEA\FEA_fire.dm"
#include "code\FEA\FEA_gas_mixture.dm"
#include "code\FEA\FEA_group_helpers.dm"
#include "code\FEA\FEA_system.dm"
#include "code\FEA\FEA_turf_tile.dm"
#include "code\game\algorithm.dm"
#include "code\game\atom_procs.dm"
#include "code\game\cellautomata.dm"
@@ -649,6 +643,7 @@
#include "code\game\objects\tank.dm"
#include "code\game\objects\toys.dm"
#include "code\game\objects\transfer_valve.dm"
#include "code\game\objects\uplinks.dm"
#include "code\game\objects\washing_machine.dm"
#include "code\game\objects\watercloset.dm"
#include "code\game\objects\weapons.dm"
@@ -774,6 +769,7 @@
#include "code\game\objects\storage\lockbox.dm"
#include "code\game\objects\storage\storage.dm"
#include "code\game\objects\storage\toolbox.dm"
#include "code\game\objects\storage\uplink_kits.dm"
#include "code\game\objects\tanks\emergency.dm"
#include "code\game\objects\tanks\jetpack.dm"
#include "code\game\objects\tanks\oxygen.dm"
@@ -790,6 +786,7 @@
#include "code\js\byjax.dm"
#include "code\js\menus.dm"
#include "code\modules\admin\admin.dm"
#include "code\modules\admin\admin_memo.dm"
#include "code\modules\admin\admin_verbs.dm"
#include "code\modules\admin\banjob.dm"
#include "code\modules\admin\create_mob.dm"
@@ -1180,8 +1177,6 @@
#include "code\WorkInProgress\organs\organs.dm"
#include "code\WorkInProgress\Ported\policetape.dm"
#include "code\WorkInProgress\Ported\sql.dm"
#include "code\WorkInProgress\Ported\Abi79\uplink_kits.dm"
#include "code\WorkInProgress\Ported\Abi79\uplinks.dm"
#include "code\WorkInProgress\Ported\Bureaucracy\copier.dm"
#include "code\WorkInProgress\Ported\Bureaucracy\filing.dm"
#include "code\WorkInProgress\SkyMarshal\coatrack.dm"
@@ -1207,6 +1202,17 @@
#include "code\WorkInProgress\virus2\monkeydispensor.dm"
#include "code\WorkInProgress\virus2\Prob.dm"
#include "code\WorkInProgress\Wrongnumber\weldbackpack.dm"
#include "code\ZAS\Connection.dm"
#include "code\ZAS\Creation.dm"
#include "code\ZAS\Definition.dm"
#include "code\ZAS\FEA_gas_mixture.dm"
#include "code\ZAS\FEA_system.dm"
#include "code\ZAS\FEA_turf_tile.dm"
#include "code\ZAS\Fire.dm"
#include "code\ZAS\Functions.dm"
#include "code\ZAS\Plasma.dm"
#include "code\ZAS\Processing.dm"
#include "code\ZAS\Variable Settings.dm"
#include "interface\interface.dm"
#include "interface\skin.dmf"
#include "maps\tgstation.2.0.8.dmm"

View File

@@ -128,28 +128,19 @@ datum/pipeline
var/datum/gas_mixture/air_sample = air.remove_ratio(mingle_volume/air.volume)
air_sample.volume = mingle_volume
if(istype(target) && target.parent && target.parent.group_processing)
if(istype(target) && target.zone)
//Have to consider preservation of group statuses
var/datum/gas_mixture/turf_copy = new
turf_copy.copy_from(target.parent.air)
turf_copy.volume = target.parent.air.volume //Copy a good representation of the turf from parent group
turf_copy.copy_from(target.zone.air)
turf_copy.volume = target.zone.air.volume //Copy a good representation of the turf from parent group
equalize_gases(list(air_sample, turf_copy))
air.merge(air_sample)
if(target.parent.air.compare(turf_copy))
//The new turf would be an acceptable group member so permit the integration
turf_copy.subtract(target.zone.air)
turf_copy.subtract(target.parent.air)
target.parent.air.merge(turf_copy)
else
//Comparison failure so dissemble group and copy turf
target.parent.suspend_group_processing()
target.air.copy_from(turf_copy)
target.zone.air.merge(turf_copy)
else
var/datum/gas_mixture/turf_air = target.return_air()
@@ -187,9 +178,9 @@ datum/pipeline
var/delta_temperature = 0
var/sharer_heat_capacity = 0
if(modeled_location.parent && modeled_location.parent.group_processing)
delta_temperature = (air.temperature - modeled_location.parent.air.temperature)
sharer_heat_capacity = modeled_location.parent.air.heat_capacity()
if(modeled_location.zone)
delta_temperature = (air.temperature - modeled_location.zone.air.temperature)
sharer_heat_capacity = modeled_location.zone.air.heat_capacity()
else
delta_temperature = (air.temperature - modeled_location.air.temperature)
sharer_heat_capacity = modeled_location.air.heat_capacity()
@@ -208,14 +199,8 @@ datum/pipeline
air.temperature += self_temperature_delta
if(modeled_location.parent && modeled_location.parent.group_processing)
if((abs(sharer_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) && (abs(sharer_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*modeled_location.parent.air.temperature))
modeled_location.parent.suspend_group_processing()
modeled_location.air.temperature += sharer_temperature_delta
else
modeled_location.parent.air.temperature += sharer_temperature_delta/modeled_location.parent.air.group_multiplier
if(modeled_location.zone)
modeled_location.zone.air.temperature += sharer_temperature_delta/modeled_location.zone.air.group_multiplier
else
modeled_location.air.temperature += sharer_temperature_delta

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -12,31 +12,16 @@ atom/movable/airflow_speed
The speed (1-15) at which a flying object is traveling to airflow_dest. Decays over time.
CALLABLE PROCS:
AirflowRepel(turf/T, n, per)
Causes objects to fly away from a point within a single zone.
Called manually by air releasers. T is the location of the expanding gas.
n is the pressure released. per indicates that n is a percent value if nonzero.
RETURNS: Null
AirflowAttract(turf/T, n, per)
Causes objects to fly to a point within a single zone.
Called manually by air consumers. T is the location of the attractor.
n is the pressure consumed. per indicates that n is a percent value if nonzero.
RETURNS: Null
OVERLOADABLE PROCS:
mob/airflow_stun()
Contains checks for and results of being stunned by airflow.
Called when airflow quantities exceed AF_HUMAN_STUN_THRESHOLD.
Called when airflow quantities exceed airflow_medium_pressure.
RETURNS: Null
atom/movable/check_airflow_movable(n)
Contains checks for moving any object due to airflow.
n is the percent of 1 Atmosphere that is flowing.
n is the pressure that is flowing.
RETURNS: 1 if the object moves under the air conditions, 0 if it stays put.
atom/movable/airflow_hit(atom/A)
@@ -47,10 +32,9 @@ atom/movable/airflow_hit(atom/A)
AUTOMATIC PROCS:
Airflow(zone/A, zone/B, n)
Airflow(zone/A, zone/B)
Causes objects to fly along a pressure gradient.
Called by zone updates. A and B are two connected zones.
n is the pressure difference between them.
AirflowSpace(zone/A)
Causes objects to fly into space.
@@ -64,115 +48,19 @@ atom/movable/RepelAirflowDest(n)
*/
var/tick_multiplier = 2
vs_control/var
zone_update_delay = 10
zone_update_delay_NAME = "Zone Update Delay"
zone_update_delay_DESC = "The delay in ticks between updates of zones. Increase if lag is bad seemingly because of air."
zone_share_percent = 5
zone_share_percent = 2
zone_share_percent_NAME = "Zone Connection Transfer %"
zone_share_percent_DESC = "Percent of gas per connected tile that is shared between zones."
airflow_lightest_pressure = 35
airflow_light_pressure = 50
airflow_medium_pressure = 80
airflow_heavy_pressure = 100
airflow_heaviest_pressure = 150
//Used in /mob/carbon/human/life
OXYGEN_LOSS = 2
OXYGEN_LOSS_NAME = "Damage - Oxygen Loss"
OXYGEN_LOSS_DESC = "A multiplier for damage due to lack of air, CO2 poisoning, and vacuum. Does not affect oxyloss\
from being incapacitated or dying."
TEMP_DMG = 2
TEMP_DMG_NAME = "Damage - Temperature"
TEMP_DMG_DESC = "A multiplier for damage due to body temperature irregularities."
BURN_DMG = 6
BURN_DMG_NAME = "Damage - Fire"
BURN_DMG_DESC = "A multiplier for damage due to direct fire exposure."
AF_TINY_MOVEMENT_THRESHOLD = 50 //% difference to move tiny items.
AF_TINY_MOVEMENT_THRESHOLD_NAME = "Airflow - Tiny Movement Threshold %"
AF_TINY_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which items with the tiny weight class will move."
AF_SMALL_MOVEMENT_THRESHOLD = 70 //% difference to move small items.
AF_SMALL_MOVEMENT_THRESHOLD_NAME = "Airflow - Small Movement Threshold %"
AF_SMALL_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which items with the small weight class will move."
AF_NORMAL_MOVEMENT_THRESHOLD = 90 //% difference to move normal items.
AF_NORMAL_MOVEMENT_THRESHOLD_NAME = "Airflow - Normal Movement Threshold %"
AF_NORMAL_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which items with the normal weight class will move."
AF_LARGE_MOVEMENT_THRESHOLD = 100 //% difference to move large and huge items.
AF_LARGE_MOVEMENT_THRESHOLD_NAME = "Airflow - Large Movement Threshold %"
AF_LARGE_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which items with the large or huge weight class will move."
AF_DENSE_MOVEMENT_THRESHOLD = 120 //% difference to move dense crap and mobs.
AF_DENSE_MOVEMENT_THRESHOLD_NAME = "Airflow - Dense Movement Threshold %"
AF_DENSE_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which dense objects (canisters, etc.) will be shifted by airflow."
AF_MOB_MOVEMENT_THRESHOLD = 175
AF_MOB_MOVEMENT_THRESHOLD_NAME = "Airflow - Human Movement Threshold %"
AF_MOB_MOVEMENT_THRESHOLD_DESC = "Percent of 1 Atm. at which mobs will be shifted by airflow."
AF_HUMAN_STUN_THRESHOLD = 130
AF_HUMAN_STUN_THRESHOLD_NAME = "Airflow - Human Stun Threshold %"
AF_HUMAN_STUN_THRESHOLD_DESC = "Percent of 1 Atm. at which living things are stunned or knocked over."
AF_PERCENT_OF = ONE_ATMOSPHERE
AF_PERCENT_OF_NAME = "Airflow - 100% Pressure"
AF_PERCENT_OF_DESC = "Normally set to 1 Atm. in kPa, this indicates what pressure is considered 100% by the system."
AF_SPEED_MULTIPLIER = 4 //airspeed per movement threshold value crossed.
AF_SPEED_MULTIPLIER_NAME = "Airflow - Speed Increase per 10%"
AF_SPEED_MULTIPLIER_DESC = "Velocity increase of shifted items per 10% of airflow."
AF_DAMAGE_MULTIPLIER = 5 //Amount of damage applied per airflow_speed.
AF_DAMAGE_MULTIPLIER_NAME = "Airflow - Damage Per Velocity"
AF_DAMAGE_MULTIPLIER_DESC = "Amount of damage applied per unit of speed (1-15 units) at which mobs are thrown."
AF_STUN_MULTIPLIER = 1.5 //Seconds of stun applied per airflow_speed.
AF_STUN_MULTIPLIER_NAME = "Airflow - Stun Per Velocity"
AF_STUN_MULTIPLIER_DESC = "Amount of stun effect applied per unit of speed (1-15 units) at which mobs are thrown."
AF_SPEED_DECAY = 0.5 //Amount that flow speed will decay with time.
AF_SPEED_DECAY_NAME = "Airflow - Velocity Lost per Tick"
AF_SPEED_DECAY_DESC = "Amount of airflow speed lost per tick on a moving object."
AF_SPACE_MULTIPLIER = 2 //Increasing this will make space connections more DRAMATIC!
AF_SPACE_MULTIPLIER_NAME = "Airflow - Space Airflow Multiplier"
AF_SPACE_MULTIPLIER_DESC = "Increasing this multiplier will cause more powerful airflow to space."
AF_CANISTER_MULTIPLIER = 0.25
AF_CANISTER_MULTIPLIER_NAME = "Airflow - Canister Airflow Multiplier"
AF_CANISTER_MULTIPLIER_DESC = "Increasing this multiplier will cause more powerful airflow from single-tile sources like canisters."
mob/proc
Change_Airflow_Constants()
set category = "Debug"
var/choice = input("Which constant will you modify?","Change Airflow Constants")\
as null|anything in list("Movement Threshold","Speed Multiplier","Damage Multiplier","Stun Multiplier","Speed Decay")
var/n
switch(choice)
if("Movement Threshold")
n = input("What will you change it to","Change Airflow Constants",vsc.AF_DENSE_MOVEMENT_THRESHOLD) as num
n = max(1,n)
vsc.AF_DENSE_MOVEMENT_THRESHOLD = n
world.log << "vsc.AF_DENSE_MOVEMENT_THRESHOLD set to [n]."
if("Speed Multiplier")
n = input("What will you change it to","Change Airflow Constants",vsc.AF_SPEED_MULTIPLIER) as num
n = max(1,n)
vsc.AF_SPEED_MULTIPLIER = n
world.log << "vsc.AF_SPEED_MULTIPLIER set to [n]."
if("Damage Multiplier")
n = input("What will you change it to","Change Airflow Constants",vsc.AF_DAMAGE_MULTIPLIER) as num
vsc.AF_DAMAGE_MULTIPLIER = n
world.log << "AF_DAMAGE_MULTIPLIER set to [n]."
if("Stun Multiplier")
n = input("What will you change it to","Change Airflow Constants",vsc.AF_STUN_MULTIPLIER) as num
vsc.AF_STUN_MULTIPLIER = n
world.log << "AF_STUN_MULTIPLIER set to [n]."
if("Speed Decay")
n = input("What will you change it to","Change Airflow Constants",vsc.AF_SPEED_DECAY) as num
vsc.AF_SPEED_DECAY = n
world.log << "AF_SPEED_DECAY set to [n]."
if("Space Flow Multiplier")
n = input("What will you change it to","Change Airflow Constants",vsc.AF_SPEED_DECAY) as num
vsc.AF_SPEED_DECAY = n
world.log << "AF_SPEED_DECAY set to [n]."
//The main airflow code. Called by zone updates.
//Zones A and B are air zones. n represents the amount of air moved.
airflow_damage = 0.3
airflow_stun = 0.15
airflow_speed_decay = 1
mob/proc/airflow_stun()
if(weakened <= 0) src << "\red The sudden rush of air knocks you over!"
@@ -197,8 +85,7 @@ atom/movable/proc/check_airflow_movable(n)
if(anchored && !ismob(src)) return 0
if(!istype(src,/obj/item) && n < vsc.AF_DENSE_MOVEMENT_THRESHOLD) return 0
if(ismob(src) && n < vsc.AF_MOB_MOVEMENT_THRESHOLD) return 0
if(!istype(src,/obj/item) && n < vsc.airflow_heavy_pressure) return 0
return 1
@@ -213,177 +100,125 @@ obj/item/check_airflow_movable(n)
. = ..()
switch(w_class)
if(2)
if(n < vsc.AF_SMALL_MOVEMENT_THRESHOLD) return 0
if(n < vsc.airflow_lightest_pressure) return 0
if(3)
if(n < vsc.AF_NORMAL_MOVEMENT_THRESHOLD) return 0
if(n < vsc.airflow_light_pressure) return 0
if(4,5)
if(n < vsc.AF_LARGE_MOVEMENT_THRESHOLD) return 0
if(n < vsc.airflow_medium_pressure) return 0
proc/Airflow(zone/A,zone/B,n)
//The main airflow code. Called by zone updates.
//Zones A and B are air zones. n represents the amount of air moved.
//Now n is a percent of one atm.
n = round((n/vsc.AF_PERCENT_OF)*100,0.1)
proc/Airflow(zone/A,zone/B)
var/n = B.air.pressure - A.air.pressure
//Don't go any further if n is lower than the lowest value needed for airflow.
if(abs(n) < vsc.AF_TINY_MOVEMENT_THRESHOLD) return
if(abs(n) < vsc.airflow_lightest_pressure) return
//These turfs are the midway point between A and B, and will be the destination point for thrown objects.
var/list/connected_turfs = A.connections[B]
//Get lists of things that can be thrown across the room for each zone.
var/list/pplz = A.movables()
var/list/otherpplz = B.movables()
var/list/pplz = A.movable_objects
var/list/otherpplz = B.movable_objects
for(var/atom/movable/M in pplz)
if(M.last_airflow > world.time - 150) continue
//Check for knocking people over
if(ismob(M) && n > vsc.AF_HUMAN_STUN_THRESHOLD)
if(ismob(M) && n > vsc.airflow_medium_pressure)
if(M:nodamage) continue
M:airflow_stun()
if(M.check_airflow_movable(n))
//Check for things that are in range of the midpoint turfs.
var/fail = 1
var/list/close_turfs = list()
for(var/turf/U in connected_turfs)
if(M in range(U)) fail = 0
if(fail) continue
if(M in range(U)) close_turfs += U
if(!close_turfs.len) continue
//If they're already being tossed, don't do it again.
if(!M.airflow_speed)
M.airflow_dest = pick(connected_turfs) //Pick a random midpoint to fly towards.
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
spawn M.GotoAirflowDest(abs(n) * (vsc.AF_SPEED_MULTIPLIER/10))
//Send the object flying at a speed determined by n and AF_SPEED_MULTIPLIER.
spawn M.GotoAirflowDest(abs(n)/20)
//Do it again for the stuff in the other zone, making it fly away.
for(var/atom/movable/M in otherpplz)
if(ismob(M) && abs(n) > vsc.AF_HUMAN_STUN_THRESHOLD)
if(M.last_airflow > world.time - 150) continue
if(ismob(M) && abs(n) > vsc.airflow_medium_pressure)
if(M:nodamage) continue
M:airflow_stun()
if(M.check_airflow_movable(abs(n)))
var/fail = 1
var/list/close_turfs = list()
for(var/turf/U in connected_turfs)
if(M in range(U)) fail = 0
if(fail) continue
if(M in range(U)) close_turfs += U
if(!close_turfs.len) continue
if(M && !M.airflow_speed)
//If they're already being tossed, don't do it again.
if(!M.airflow_speed)
M.airflow_dest = pick(connected_turfs)
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
spawn M.RepelAirflowDest(abs(n) * (vsc.AF_SPEED_MULTIPLIER/10))
spawn M.RepelAirflowDest(abs(n)/20)
proc/AirflowSpace(zone/A)
//The space version of the Airflow(A,B,n) proc.
var/n = (A.air.oxygen + A.air.nitrogen + A.air.carbon_dioxide)*vsc.AF_SPACE_MULTIPLIER
//Here, n is determined by the space multiplier constant and the zone's air.
var/n = A.air.pressure
//Here, n is determined by only the pressure in the room.
n = round((n/vsc.AF_PERCENT_OF)*100,0.1)
if(n < vsc.AF_TINY_MOVEMENT_THRESHOLD) return
if(n < vsc.airflow_lightest_pressure) return
var/list/connected_turfs = A.space_tiles //The midpoints are now all the space connections.
var/list/pplz = A.movables() //We only need to worry about things in the zone, not things in space.
var/list/pplz = A.movable_objects //We only need to worry about things in the zone, not things in space.
for(var/atom/movable/M in pplz)
if(ismob(M) && n > vsc.AF_HUMAN_STUN_THRESHOLD)
if(M.last_airflow > world.time - 150) continue
if(ismob(M) && n > vsc.airflow_medium_pressure)
if(M:nodamage) continue
M:airflow_stun()
if(M.check_airflow_movable(n))
var/fail = 1
var/list/close_turfs = list()
for(var/turf/U in connected_turfs)
if(M in range(U)) fail = 0
if(fail) continue
if(M in range(U)) close_turfs += U
if(!close_turfs.len) continue
//If they're already being tossed, don't do it again.
if(!M.airflow_speed)
M.airflow_dest = pick(connected_turfs)
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
spawn
if(M) M.GotoAirflowDest(n * (vsc.AF_SPEED_MULTIPLIER/10))
if(M) M.GotoAirflowDest(n/20)
//Sometimes shit breaks, and M isn't there after the spawn.
proc/AirflowRepel(turf/T,n,per = 0)
//This one is used for air escaping from canisters.
var/zone/A = T.zone
if(!A) return
n *= vsc.AF_CANISTER_MULTIPLIER
if(!per)
n = round((n/vsc.AF_PERCENT_OF) * 100,0.1)
if(n < 0) return
if(abs(n) > vsc.AF_TINY_MOVEMENT_THRESHOLD)
var/list/pplz = A.movables()
for(var/atom/movable/M in pplz)
var/relative_n = n / max(1,get_dist(T,M)/2)
if(ismob(M) && relative_n > vsc.AF_HUMAN_STUN_THRESHOLD)
if(M:nodamage) continue
M:airflow_stun()
if(M.check_airflow_movable(relative_n))
if(!(M in range(T))) continue //Recall that T is the center of the repelling force.
if(!M.airflow_speed)
M.airflow_dest = T
spawn M.RepelAirflowDest(relative_n * (vsc.AF_SPEED_MULTIPLIER/10))
proc/AirflowAttract(turf/T,n,per=0)
//Same as above, but attracts objects to the target.
var/zone/A = T.zone
if(!A) return
n *= vsc.AF_CANISTER_MULTIPLIER
if(!per)
n = round((n/vsc.AF_PERCENT_OF) * 100,0.1)
if(n < 0) return
if(abs(n) > vsc.AF_TINY_MOVEMENT_THRESHOLD)
//world << "Airflow!"
var/list/pplz = A.movables()
for(var/atom/movable/M in pplz)
//world << "[M] / \..."
var/relative_n = n / max(1,get_dist(T,M)/2)
if(ismob(M) && relative_n > vsc.AF_HUMAN_STUN_THRESHOLD)
if(M:nodamage) continue
M:airflow_stun()
if(M.check_airflow_movable(relative_n))
if(!(M in range(T))) continue
if(!M.airflow_speed)
M.airflow_dest = T
spawn M.GotoAirflowDest(relative_n * (vsc.AF_SPEED_MULTIPLIER/10))
atom/movable
var/turf/airflow_dest
var/airflow_speed = 0
var/airflow_time = 0
var/last_airflow = 0
proc/GotoAirflowDest(n)
if(!airflow_dest) return
if(airflow_speed < 0) return
if(last_airflow > world.time - 150) return
if(airflow_speed)
airflow_speed = n
return
last_airflow = world.time
if(airflow_dest == loc)
step_away(src,loc)
if(ismob(src))
@@ -408,7 +243,7 @@ atom/movable
while(airflow_speed > 0)
if(airflow_speed <= 0) return
airflow_speed = min(airflow_speed,15)
airflow_speed -= vsc.AF_SPEED_DECAY
airflow_speed -= vsc.airflow_speed_decay
if(airflow_speed > 7)
if(airflow_time++ >= airflow_speed - 7)
sleep(1 * tick_multiplier)
@@ -421,17 +256,18 @@ atom/movable
step_towards(src, src.airflow_dest)
if(ismob(src) && src:client) src:client:move_delay = world.time + 10
airflow_dest = null
airflow_speed = -1
spawn(150 * tick_multiplier) airflow_speed = 0
airflow_speed = 0
if(od)
density = 0
proc/RepelAirflowDest(n)
if(!airflow_dest) return
if(airflow_speed < 0) return
if(last_airflow > world.time - 150) return
if(airflow_speed)
airflow_speed = n
return
last_airflow = world.time
if(airflow_dest == loc)
step_away(src,loc)
if(ismob(src))
@@ -456,7 +292,7 @@ atom/movable
while(airflow_speed > 0)
if(airflow_speed <= 0) return
airflow_speed = min(airflow_speed,15)
airflow_speed -= vsc.AF_SPEED_DECAY
airflow_speed -= vsc.airflow_speed_decay
if(airflow_speed > 7)
if(airflow_time++ >= airflow_speed - 7)
sleep(1 * tick_multiplier)
@@ -469,8 +305,7 @@ atom/movable
step_towards(src, src.airflow_dest)
if(ismob(src) && src:client) src:client:move_delay = world.time + 10
airflow_dest = null
airflow_speed = -1
spawn(150 * tick_multiplier) airflow_speed = 0
airflow_speed = 0
if(od)
density = 0
@@ -482,8 +317,7 @@ atom/movable
. = ..()
atom/movable/proc/airflow_hit(atom/A)
airflow_speed = -1
spawn(50 * tick_multiplier) airflow_speed = 0
airflow_speed = 0
airflow_dest = null
mob/airflow_hit(atom/A)
@@ -499,8 +333,7 @@ obj/airflow_hit(atom/A)
. = ..()
obj/item/airflow_hit(atom/A)
airflow_speed = -1
spawn(50 * tick_multiplier) airflow_speed = 0
airflow_speed = 0
airflow_dest = null
mob/living/carbon/human/airflow_hit(atom/A)
@@ -512,76 +345,43 @@ mob/living/carbon/human/airflow_hit(atom/A)
src.wear_suit.add_blood(src)
if (src.w_uniform)
src.w_uniform.add_blood(src)
var/b_loss = airflow_speed * vsc.AF_DAMAGE_MULTIPLIER
for(var/organ in src:organs)
var/datum/organ/external/temp = src:organs["[organ]"]
if (istype(temp, /datum/organ/external))
switch(temp.name)
if("head")
temp.take_damage(b_loss * 0.2, 0)
if("chest")
temp.take_damage(b_loss * 0.4, 0)
if("diaper")
temp.take_damage(b_loss * 0.1, 0)
spawn UpdateDamageIcon()
var/b_loss = airflow_speed * vsc.airflow_damage
var/blocked = run_armor_check("head","melee")
apply_damage(b_loss/3, BRUTE, "head", blocked, 0, "Airflow")
blocked = run_armor_check("chest","melee")
apply_damage(b_loss/3, BRUTE, "chest", blocked, 0, "Airflow")
blocked = run_armor_check("groin","melee")
apply_damage(b_loss/3, BRUTE, "groin", blocked, 0, "Airflow")
if(airflow_speed > 10)
paralysis += round(airflow_speed * vsc.AF_STUN_MULTIPLIER)
paralysis += round(airflow_speed * vsc.airflow_stun)
stunned = max(stunned,paralysis + 3)
else
stunned += round(airflow_speed * vsc.AF_STUN_MULTIPLIER/2)
stunned += round(airflow_speed * vsc.airflow_stun/2)
. = ..()
zone/proc/movables()
. = list()
for(var/turf/T in contents)
for(var/atom/A in T)
. += A
turf/simulated/Entered(atom/A)
. = ..()
if(istype(A,/atom/movable) && zone)
zone.movable_objects += A
proc/Get_Dir(atom/S,atom/T) //Shamelessly stolen from AJX.AdvancedGetDir
var/GDist=get_dist(S,T)
var/GDir=get_dir(S,T)
if(GDist<=3)
if(GDist==0) return 0
if(GDist==1)
return GDir
turf/simulated/Exited(atom/A)
. = ..()
if(istype(A,/atom/movable) && zone)
zone.movable_objects -= A
atom/movable/New(turf/simulated/T)
. = ..()
if(istype(T))
if(T.zone)
T.zone.movable_objects += src
var/X1=S.x*10
var/X2=T.x*10
var/Y1=S.y*10
var/Y2=T.y*10
var/Ref
if(GDir==NORTHEAST)
Ref=(X2/X1)*Y1
if(Ref-1>Y2) .=EAST
else if(Ref+1<Y2) .=NORTH
else .=NORTHEAST
else if(GDir==NORTHWEST)
Ref=(1+((1-(X2/X1))))*Y1
if(Ref-1>Y2) .=WEST
else if(Ref+1<Y2) .=NORTH
else .=NORTHWEST
else if(GDir==SOUTHEAST)
Ref=(1-((X2/X1)-1))*Y1
if(Ref-1>Y2) .=SOUTH
else if(Ref+1<Y2) .=EAST
else .=SOUTHEAST
else if(GDir==SOUTHWEST)
Ref=(X2/X1)*Y1
if(Ref-1>Y2) .=SOUTH
else if(Ref+1<Y2) .=WEST
else .=SOUTHWEST
else
return GDir
proc/SaveTweaks()
var/savefile/F = new("data/game_settings.sav")
F << vsc
del F
world.log << "TWEAKS: Airflow, Plasma and Damage settings saved."
proc/LoadTweaks()
if(fexists("data/game_settings.sav"))
var/savefile/F = new("data/game_settings.sav")
F >> vsc
del F
world.log << "TWEAKS: Airflow, Plasma and Damage settings loaded."
atom/movable/Del()
var/turf/simulated/T = loc
if(istype(T))
if(T.zone)
T.zone.movable_objects -= src
. = ..()

View File

@@ -1,3 +1,8 @@
/*
This object is contained within zone/var/connections. It's generated whenever two turfs from different zones are linked.
Indirect connections will not merge the two zones after they reach equilibrium.
*/
connection
var
turf //The turfs involved in the connection.
@@ -5,6 +10,7 @@ connection
B
indirect = 0 //If the connection is purely indirect, the zones should not join.
last_updated //The tick at which this was last updated.
no_zone_count = 0
New(turf/T,turf/O)
A = T
B = O
@@ -31,6 +37,8 @@ connection
B.zone.connected_zones[A.zone] = 1
else
B.zone.connected_zones[A.zone]++
else
world.log << "Attempted to create connection object for non-zone tiles: [T] -> [O]"
Del()
if(A.zone && A.zone.connections)
A.zone.connections -= src
@@ -57,5 +65,14 @@ connection
. = ..()
proc/Cleanup()
if(A.zone == B.zone) del src
if(!A.zone || !B.zone) del src
if(!A || !B)
world.log << "Connection removed: [A] or [B] missing entirely."
del src
if(A.zone == B.zone)
world.log << "Connection removed: Zones now merged."
del src
if(!A.zone || !B.zone)
no_zone_count++
if(no_zone_count >= 5)
world.log << "Connection removed: [A] or [B] missing a zone."
del src

View File

@@ -1,13 +1,19 @@
zone
New(turf/start)
//Get the turfs that are part of the zone using a floodfill method
if(istype(start,/list))
contents = start
else
contents = FloodFill(start)
//Change all the zone vars of the turfs, check for space to be added to space_tiles.
for(var/turf/T in contents)
T.zone = src
if(istype(T,/turf/space))
AddSpace(T)
//Generate the gas_mixture for use in this zone by using the average of the gases
//defined at startup.
air = new
var/members = contents.len
for(var/turf/simulated/T in contents)
@@ -17,8 +23,13 @@ zone
air.toxins += T.toxins / members
air.temperature += T.temperature / members
air.group_multiplier = contents.len
air.update_values()
//Add this zone to the global list.
zones += src
Del()
//Ensuring the zone list doesn't get clogged with null values.
zones -= src
. = ..()
@@ -30,17 +41,23 @@ proc/FloodFill(turf/start)
while(open.len)
for(var/turf/T in open)
//Stop if there's a door, even if it's open. These are handled by indirect connection.
if(!T.HasDoor())
for(var/d in cardinal)
var/turf/O = get_step(T,d)
//Simple pass check.
if(O.ZCanPass(T) && !(O in open) && !(O in closed))
open += O
open -= T
closed += T
return closed
turf/proc/ZCanPass(turf/T)
//Fairly standard pass checks for turfs, objects and directional windows. Also stops at the edge of space.
if(istype(T,/turf/space)) return 0
else
if(T.blocks_air||blocks_air)
@@ -51,6 +68,7 @@ turf/proc/ZCanPass(turf/T)
continue
if(!obstacle.CanPass(0, T, 0, 1))
return 0
for(var/obj/obstacle in T)
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
continue

View File

@@ -1,5 +1,5 @@
client/proc/Zone_Info(turf/T as null|turf)
client/verb/Zone_Info(turf/T as null|turf)
set category = "Debug"
if(T)
if(T.zone)
@@ -28,9 +28,10 @@ zone/proc
M << "Plasma: [air.toxins]"
M << "Carbon Dioxide: [air.carbon_dioxide]"
M << "Temperature: [air.temperature]"
M << "Heat Energy: [air.thermal_energy()]"
M << "Heat Energy: [air.temperature * air.heat_capacity()]"
M << "Pressure: [air.return_pressure()]"
M << ""
M << "Space Tiles: [length(space_tiles)]"
M << "<u>Connections: [length(connections)]</u>"
for(var/connection/C in connections)
@@ -40,6 +41,9 @@ zone/proc
spawn(50)
C.A.overlays -= 'debug_connect.dmi'
C.B.overlays -= 'debug_connect.dmi'
for(var/C in connections)
if(!istype(C,/connection))
M << "[C] (Not Connection!)"
else
dbg_output = 0

View File

@@ -1,30 +1,11 @@
turf/var/zone/zone
var/list/zones = list()
var/zone_controller/zone_master = new
zone_controller
var
current_tick = 0
proc
start()
set background = 1
while(1)
current_tick++
for(var/zone/Z in zones)
if(Z.last_update < current_tick)
Z.process()
if(Z) Z.last_update = current_tick
for(var/obj/fire/F)
F.process()
//for(var/obj/z_hotspot/H in z_hotspots)
// H.process()
sleep(max(5,vsc.zone_update_delay*tick_multiplier))
zone
var
dbg_output = 0 //Enables debug output.
rebuild = 0 //If 1, zone will be rebuilt on next process.
rebuild = 0 //If 1, zone will be rebuilt on next process. Not sure if used.
datum/gas_mixture/air //The air contents of the zone.
list/contents //All the tiles that are contained in this zone.
list/connections // /connection objects which refer to connections with other zones, e.g. through a door.
@@ -32,3 +13,5 @@ zone
//of points they're connected at.
list/space_tiles // Any space tiles in this list will cause air to flow out.
last_update = 0
list/movable_objects = list() //All the things that can be tossed by airflow.

1008
code/ZAS/FEA_gas_mixture.dm Normal file

File diff suppressed because it is too large Load Diff

178
code/ZAS/FEA_system.dm Normal file
View File

@@ -0,0 +1,178 @@
/*
Overview:
The air_master global variable is the workhorse for the system.
Why are you archiving data before modifying it?
The general concept with archiving data and having each tile keep track of when they were last updated is to keep everything symmetric
and totally independent of the order they are read in an update cycle.
This prevents abnormalities like air/fire spreading rapidly in one direction and super slowly in the other.
Why not just archive everything and then calculate?
Efficiency. While a for-loop that goes through all tils and groups to archive their information before doing any calculations seems simple, it is
slightly less efficient than the archive-before-modify/read method.
Why is there a cycle check for calculating data as well?
This ensures that every connection between group-tile, tile-tile, and group-group is only evaluated once per loop.
Important variables:
air_master.groups_to_rebuild (list)
A list of air groups that have had their geometry occluded and thus may need to be split in half.
A set of adjacent groups put in here will join together if validly connected.
This is done before air system calculations for a cycle.
air_master.tiles_to_update (list)
Turfs that are in this list have their border data updated before the next air calculations for a cycle.
Place turfs in this list rather than call the proc directly to prevent race conditions
turf/simulated.archive() and datum/air_group.archive()
This stores all data for.
If you modify, make sure to update the archived_cycle to prevent race conditions and maintain symmetry
atom/CanPass(atom/movable/mover, turf/target, height, air_group)
returns 1 for allow pass and 0 for deny pass
Turfs automatically call this for all objects/mobs in its turf.
This is called both as source.CanPass(target, height, air_group)
and target.CanPass(source, height, air_group)
Cases for the parameters
1. This is called with args (mover, location, height>0, air_group=0) for normal objects.
2. This is called with args (null, location, height=0, air_group=0) for flowing air.
3. This is called with args (null, location, height=?, air_group=1) for determining group boundaries.
Cases 2 and 3 would be different for doors or other objects open and close fairly often.
(Case 3 would return 0 always while Case 2 would return 0 only when the door is open)
This prevents the necessity of re-evaluating group geometry every time a door opens/closes.
Important Procedures
air_master.process()
This first processes the air_master update/rebuild lists then processes all groups and tiles for air calculations
*/
var/kill_air = 0
var/tick_multiplier = 2
atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
//Purpose: Determines if the object (or airflow) can pass this atom.
//Called by: Movement, airflow.
//Inputs: The moving atom (optional), target turf, "height" and air group
//Outputs: Boolean if can pass.
return (!density || !height || air_group)
turf
CanPass(atom/movable/mover, turf/target, height=1.5,air_group=0)
if(!target) return 0
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
return !density
else // Now, doing more detailed checks for air movement and air group formation
if(target.blocks_air||blocks_air)
return 0
for(var/obj/obstacle in src)
if(!obstacle.CanPass(mover, target, height, air_group))
return 0
for(var/obj/obstacle in target)
if(!obstacle.CanPass(mover, src, height, air_group))
return 0
return 1
var/global/datum/controller/air_system/air_master
datum
controller
air_system
//Geoemetry lists
var/list/turf/simulated/active_singletons = list()
//Special functions lists
var/list/turf/simulated/active_super_conductivity = list()
var/list/turf/simulated/high_pressure_delta = list()
//Geometry updates lists
var/list/turf/simulated/tiles_to_update = list()
var/list/turf/simulated/groups_to_rebuild = list()
var/current_cycle = 0
var/update_delay = 5 //How long between check should it try to process atmos again.
var/failed_ticks = 0 //How many ticks have runtimed?
/* process()
//Call this to process air movements for a cycle
process_rebuild_select_groups()
//Used by process()
//Warning: Do not call this
rebuild_group(datum/air_group)
//Used by process_rebuild_select_groups()
//Warning: Do not call this, add the group to air_master.groups_to_rebuild instead
*/
proc/setup()
//Purpose: Call this at the start to setup air groups geometry
// (Warning: Very processor intensive but only must be done once per round)
//Called by: Gameticker/Master controller
//Inputs: None.
//Outputs: None.
set background = 1
world << "\red \b Processing Geometry..."
sleep(-1)
var/start_time = world.timeofday
for(var/turf/simulated/S in world)
if(S.z < 5)
if(!S.blocks_air && !S.zone && S.z < 5) // Added last check to force skipping asteroid z-levels -- TLE
new/zone(S)
S.update_air_properties()
world << "\red \b Geometry processed in [time2text(world.timeofday-start_time, "mm:ss")] minutes!"
spawn start()
proc/start()
//Purpose: This is kicked off by the master controller, and controls the processing of all atmosphere.
//Called by: Master controller
//Inputs: None.
//Outputs: None.
set background = 1
while(1)
if(!kill_air)
current_cycle++
var/success = tick() //Changed so that a runtime does not crash the ticker.
if(!success) //Runtimed.
failed_ticks++
if(failed_ticks > 20)
world << "<font size='4' color='red'>ERROR IN ATMOS TICKER. Killing air simulation!</font>"
kill_air = 1
sleep(max(5,update_delay*tick_multiplier))
proc/tick()
if(tiles_to_update.len > 0) //If there are tiles to update, do so.
for(var/turf/simulated/T in tiles_to_update)
spawn T.update_air_properties()
tiles_to_update = list()
for(var/zone/Z in zones)
if(Z.last_update < current_cycle)
Z.process()
if(Z) Z.last_update = current_cycle
for(var/obj/fire/F)
F.process()
return 1

205
code/ZAS/FEA_turf_tile.dm Normal file
View File

@@ -0,0 +1,205 @@
atom/var/pressure_resistance = ONE_ATMOSPHERE
turf
assume_air(datum/gas_mixture/giver) //use this for machines to adjust air
del(giver)
return 0
return_air()
//Create gas mixture to hold data for passing
var/datum/gas_mixture/GM = new
GM.oxygen = oxygen
GM.carbon_dioxide = carbon_dioxide
GM.nitrogen = nitrogen
GM.toxins = toxins
GM.temperature = temperature
GM.update_values()
return GM
remove_air(amount as num)
var/datum/gas_mixture/GM = new
var/sum = oxygen + carbon_dioxide + nitrogen + toxins
if(sum>0)
GM.oxygen = (oxygen/sum)*amount
GM.carbon_dioxide = (carbon_dioxide/sum)*amount
GM.nitrogen = (nitrogen/sum)*amount
GM.toxins = (toxins/sum)*amount
GM.temperature = temperature
GM.update_values()
return GM
turf
simulated
var/current_graphic = null
var/tmp
datum/gas_mixture/air
processing = 1
group_border = 0
length_space_border = 0
air_check_directions = 0 //Do not modify this, just add turf to air_master.tiles_to_update
archived_cycle = 0
current_cycle = 0
obj/fire/active_hotspot
temperature_archived //USED ONLY FOR SOLIDS
being_superconductive = 0
proc
process_cell()
update_air_properties()
archive()
mimic_air_with_tile(turf/model)
share_air_with_tile(turf/simulated/sharer)
mimic_temperature_with_tile(turf/model)
share_temperature_with_tile(turf/simulated/sharer)
super_conduct()
update_visuals()
overlays = null
var/siding_icon_state = return_siding_icon_state()
if(siding_icon_state)
overlays += image('floors.dmi',siding_icon_state)
var/datum/gas_mixture/model = return_air()
switch(model.graphic)
if("plasma")
overlays.Add(plmaster)
if("sleeping_agent")
overlays.Add(slmaster)
New()
..()
if(!blocks_air)
air = new
air.oxygen = oxygen
air.carbon_dioxide = carbon_dioxide
air.nitrogen = nitrogen
air.toxins = toxins
air.temperature = temperature
air.update_values()
if(air_master)
air_master.tiles_to_update.Add(src)
find_zone()
// air.parent = src //TODO DEBUG REMOVE
else
if(air_master)
for(var/direction in cardinal)
var/turf/simulated/floor/target = get_step(src,direction)
if(istype(target))
air_master.tiles_to_update.Add(target)
Del()
if(active_hotspot)
del(active_hotspot)
if(blocks_air)
for(var/direction in list(NORTH, SOUTH, EAST, WEST))
var/turf/simulated/tile = get_step(src,direction)
if(istype(tile) && !tile.blocks_air)
air_master.tiles_to_update.Add(tile)
..()
assume_air(datum/gas_mixture/giver)
if(!giver) return 0
if(zone)
zone.air.merge(giver)
return 1
else
return ..()
archive()
if(air) //For open space like floors
air.archive()
temperature_archived = temperature
archived_cycle = air_master.current_cycle
share_air_with_tile(turf/simulated/T)
return air.share(T.air)
mimic_air_with_tile(turf/T)
return air.mimic(T)
return_air()
if(zone)
return zone.air
else if(air)
return air
else
return ..()
remove_air(amount as num)
if(zone)
var/datum/gas_mixture/removed = null
removed = zone.air.remove(amount)
return removed
else if(air)
var/datum/gas_mixture/removed = null
removed = air.remove(amount)
if(air.check_tile_graphic())
update_visuals(air)
return removed
else
return ..()
update_air_properties()//OPTIMIZE
air_check_directions = 0
for(var/direction in cardinal)
if(CanPass(null, get_step(src,direction), 0, 0))
air_check_directions |= direction
if(zone)
for(var/direction in cardinal)
if(air_check_directions&direction)
var/turf/simulated/T = get_step(src,direction)
if(T)
ZConnect(src,T)
else
var/turf/simulated/T = get_step(src,direction)
if(T)
ZDisconnect(src,T)
else
for(var/direction in cardinal)
if(air_check_directions&direction)
var/turf/simulated/T = get_step(src,direction)
if(T.zone)
T.zone.AddTurf(src)
break
if(!zone)
new/zone(src)
if(air_check_directions)
processing = 1
else
processing = 0

View File

@@ -1,13 +1,16 @@
vs_control/var/IgnitionLevel = 10 //Moles of oxygen+plasma - co2 needed to burn.
#define OXYGEN
//Some legacy definitions so fires can be started.
atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return null
turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
if(fire_protection) return
if(fire_protection > world.time-300) return
var/datum/gas_mixture/air_contents = return_air(1)
if(!air_contents)
return 0
@@ -25,19 +28,11 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
return 1
var/datum/gas/volatile_fuel/fuel = locate() in air_contents.trace_gases
var/obj/liquid_fuel/liquid = locate() in src
var/fuel_level = 0
var/liquid_level = 0
if(fuel) fuel_level = fuel.moles
if(liquid) liquid_level = liquid.amount
var/total_fuel = air_contents.toxins + fuel_level + liquid_level
if((air_contents.oxygen + air_contents.toxins + fuel_level*1.5 + liquid_level*1.5) - (air_contents.carbon_dioxide*0.25) > vsc.IgnitionLevel && total_fuel > 0.5)
if(air_contents.calculate_firelevel(liquid) > vsc.IgnitionLevel && (fuel || liquid || air_contents.toxins > 0.5))
igniting = 1
if(air_contents.oxygen < 0.5)
return 0
if(parent&&parent.group_processing)
parent.suspend_group_processing()
if(! (locate(/obj/fire) in src))
var/obj/fire/F = new(src,1000)
F.temperature = exposed_temperature
@@ -48,112 +43,9 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
return igniting
obj/effect/hotspot
//Icon for fire on turfs, also helps for nurturing small fires until they are full tile
anchored = 1
mouse_opacity = 0
//luminosity = 3
icon = 'fire.dmi'
icon_state = "1"
layer = TURF_LAYER
var
volume = 125
temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
just_spawned = 1
bypassing = 0
obj/effect/hotspot/proc/perform_exposure()
var/turf/simulated/floor/location = loc
if(!istype(location))
return 0
if(volume > CELL_VOLUME*0.95)
bypassing = 1
else bypassing = 0
if(bypassing)
if(!just_spawned)
volume = location.air.fuel_burnt*FIRE_GROWTH_RATE
temperature = location.air.temperature
else
var/datum/gas_mixture/affected = location.air.remove_ratio(volume/location.air.volume)
affected.temperature = temperature
affected.react()
temperature = affected.temperature
volume = affected.fuel_burnt*FIRE_GROWTH_RATE
location.assume_air(affected)
for(var/atom/item in loc)
item.temperature_expose(null, temperature, volume)
obj/effect/hotspot/process(turf/simulated/list/possible_spread)
if(just_spawned)
just_spawned = 0
return 0
var/turf/simulated/floor/location = loc
if(!istype(location))
del(src)
if((temperature < FIRE_MINIMUM_TEMPERATURE_TO_EXIST) || (volume <= 1))
del(src)
if(location.air.toxins < 0.5 || location.air.oxygen < 0.5)
del(src)
perform_exposure()
if(location.wet) location.wet = 0
if(bypassing)
icon_state = "3"
location.burn_tile()
//Possible spread due to radiated heat
if(location.air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_SPREAD)
var/radiated_temperature = location.air.temperature*FIRE_SPREAD_RADIOSITY_SCALE
for(var/turf/simulated/possible_target in possible_spread)
if(!locate(/obj/effect/hotspot) in possible_target)
possible_target.hotspot_expose(radiated_temperature, CELL_VOLUME/4)
else
if(volume > CELL_VOLUME*0.4)
icon_state = "2"
else
icon_state = "1"
return 1
obj/effect/hotspot/New()
..()
dir = pick(cardinal)
sd_SetLuminosity(3)
obj/effect/hotspot/Del()
src.sd_SetLuminosity(0)
loc = null
..()
var
fire_ratio_1 = 0.05
obj
fire
//Icon for fire on turfs, also helps for nurturing small fires until they are full tile
//Icon for fire on turfs.
anchored = 1
mouse_opacity = 0
@@ -168,84 +60,82 @@ obj
var
volume = CELL_VOLUME
temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
firelevel = 10000
firelevel = 10000 //Calculated by gas_mixture.calculate_firelevel()
archived_firelevel = 0
process()
if(firelevel > vsc.IgnitionLevel)
var/turf/simulated/floor/S = loc
if(!S.zone) del src
//src.temperature += (src.firelevel/FireTempDivider+FireOffset - src.temperature) / FireRate
if(!S.zone) del src //Cannot exist where zones are broken.
if(istype(S,/turf/simulated/floor))
var
datum/gas_mixture/air_contents = S.return_air()
//Get whatever trace fuels are in the area
datum/gas/volatile_fuel/fuel = locate(/datum/gas/volatile_fuel/) in air_contents.trace_gases
fuel_level = 0
//Also get liquid fuels on the ground.
obj/liquid_fuel/liquid = locate() in S
liquid_level = 0
if(fuel) fuel_level = fuel.moles
if(liquid)
liquid_level = liquid.amount
if(liquid.amount <= 0)
del liquid
liquid_level = 0
firelevel = air_contents.calculate_firelevel(liquid)
firelevel = (air_contents.oxygen + air_contents.toxins + fuel_level*1.5 + liquid_level*1.5) - (air_contents.carbon_dioxide*0.25)
//Ensure that there is an appropriate amount of fuel and O2 here.
if(firelevel > 25 && (air_contents.toxins || fuel || liquid))
firelevel = min(firelevel,vsc.IgnitionLevel*5)
if(firelevel > vsc.IgnitionLevel * 1.5 && (air_contents.toxins || fuel_level || liquid_level))
for(var/direction in cardinal)
if(S.air_check_directions&direction) //Grab all valid bordering tiles
var/turf/simulated/enemy_tile = get_step(S, direction)
if(istype(enemy_tile))
if(enemy_tile.fire_protection)
firelevel -= vsc.IgnitionLevel
continue
if(!(locate(/obj/fire) in enemy_tile))
if( prob( firelevel/(vsc.IgnitionLevel*0.1) ) )
new/obj/fire(enemy_tile,firelevel)
// else
// world << "Spread Probability: [firelevel/(vsc.IgnitionLevel*0.1)]%."
// else
// world << "There's a fire there bitch."
// else
// world << "[enemy_tile] cannot be spread to."
//else
// world << "Not enough firelevel to spread: [firelevel]/[vsc.IgnitionLevel*1.5]"
var/datum/gas_mixture/flow = air_contents.remove_ratio(0.5)
//n = PV/RT, taking the volume of a single tile from the gas.
var/turf/simulated/enemy_tile = get_step(S, direction)
if(istype(enemy_tile))
//If extinguisher mist passed over the turf it's trying to spread to, don't spread and
//reduce firelevel.
if(enemy_tile.fire_protection > world.time-30)
firelevel -= 150
continue
//Spread the fire.
if(!(locate(/obj/fire) in enemy_tile))
if( prob( firelevel/2.5 ) )
new/obj/fire(enemy_tile,firelevel)
var/datum/gas_mixture/flow = air_contents.remove_ratio(0.5) //Take half the air from the room I guess.
if(flow)
if(flow.oxygen > 0.3 && (flow.toxins || fuel_level || liquid))
//Ensure adequate oxygen and fuel.
if(flow.oxygen > 0.3 && (flow.toxins || fuel || liquid))
//Change icon depending on the fuel, and thus temperature.
icon_state = "1"
if(firelevel > vsc.IgnitionLevel * 2)
if(firelevel > 25)
icon_state = "2"
if(firelevel > vsc.IgnitionLevel * 3.5)
if(firelevel > 100)
icon_state = "3"
//Ensure flow temperature is higher than minimum fire temperatures.
flow.temperature = max(PLASMA_MINIMUM_BURN_TEMPERATURE+0.1,flow.temperature)
//Burn the gas mixture.
flow.zburn(liquid)
else
del src
S.assume_air(flow)
S.assume_air(flow) //Then put it back where you found it.
else
//world << "No air at all."
del src
else
del src
else
//world << "Insufficient fire level for ignition: [firelevel]/[IgnitionLevel]"
del src
for(var/mob/living/carbon/human/M in loc)
M.FireBurn(firelevel/(vsc.IgnitionLevel*10))
M.FireBurn(min(max(0.1,firelevel / 20),10)) //Burn the humans!
New(newLoc,fl)
@@ -254,7 +144,7 @@ obj
sd_SetLuminosity(3)
firelevel = fl
for(var/mob/living/carbon/human/M in loc)
M.FireBurn(firelevel/(vsc.IgnitionLevel*10))
M.FireBurn(min(max(0.1,firelevel / 20),10)) //Burn the humans!
Del()
if (istype(loc, /turf/simulated))
@@ -265,74 +155,161 @@ obj
..()
obj/liquid_fuel
icon = 'effects.dmi'
icon_state = "slube"
//Liquid fuel is used for things that used to rely on volatile fuels or plasma being contained to a couple tiles.
icon = 'icons/effects/effects.dmi'
icon_state = "fuel"
layer = TURF_LAYER+0.2
anchored = 1
var/amount = 1
var/amount = 1 //Basically moles.
New(newLoc)
New(newLoc,amt=1)
src.amount = amt
//Be absorbed by any other liquid fuel in the tile.
for(var/obj/liquid_fuel/other in newLoc)
if(other != src)
other.amount += src.amount
spawn other.Spread()
del src
return
Spread()
. = ..()
vs_control/var/switch_fire = 1
proc/Spread()
//Allows liquid fuels to sometimes flow into other tiles.
if(amount < 0.5) return
var/turf/simulated/S = loc
if(!istype(S)) return
for(var/d in cardinal)
if(S.air_check_directions & d)
if(rand(25))
var/turf/simulated/O = get_step(src,d)
new/obj/liquid_fuel(O,amount*0.25)
amount *= 0.75
turf/simulated/var/fire_protection = 0
flamethrower_fuel
icon_state = "mustard"
anchored = 0
New(newLoc, amt = 1, d = 0)
dir = d //Setting this direction means you won't get torched by your own flamethrower.
. = ..()
Spread()
//The spread for flamethrower fuel is much more precise, to create a wide fire pattern.
if(amount < 0.1) return
var/turf/simulated/S = loc
if(!istype(S)) return
for(var/d in list(turn(dir,90),turn(dir,-90)))
if(S.air_check_directions & d)
var/turf/simulated/O = get_step(S,d)
new/obj/liquid_fuel/flamethrower_fuel(O,amount*0.25,d)
O.hotspot_expose((T20C*2) + 380,500) //Light flamethrower fuel on fire immediately.
amount *= 0.5
turf/simulated/var/fire_protection = 0 //Protects newly extinguished tiles from being overrun again.
turf/simulated/proc/apply_fire_protection()
fire_protection = world.time
datum/gas_mixture/proc/zburn(obj/liquid_fuel/liquid)
if(vsc.switch_fire)
. = fire()
if(liquid && liquid.amount > 0)
oxygen -= fire_ratio_1
liquid.amount = max(liquid.amount-fire_ratio_1,0)
carbon_dioxide += fire_ratio_1
if(liquid.amount <= 0)
del liquid
return
//This proc is similar to fire(), but uses a simple logarithm to calculate temp, and is thus more stable with ZAS.
if(temperature > PLASMA_MINIMUM_BURN_TEMPERATURE)
var
fuel_level = 0
total_fuel = toxins
fuel_sources = 0 //We'll divide by this later so that fuel is consumed evenly.
datum/gas/volatile_fuel/fuel = locate() in trace_gases
liquid_level = 0
if(fuel) fuel_level = fuel.moles
if(liquid) liquid_level = liquid.amount
if(liquid && liquid_level <= 0)
del liquid
liquid_level = 0
if(oxygen > 0.3 && (toxins || fuel_level || liquid_level))
if(toxins && temperature < PLASMA_UPPER_TEMPERATURE)
temperature += (FIRE_PLASMA_ENERGY_RELEASED*fire_ratio_1) / heat_capacity()
if((fuel_level || liquid_level) && temperature < PLASMA_UPPER_TEMPERATURE)
temperature += (FIRE_CARBON_ENERGY_RELEASED*fire_ratio_1) / heat_capacity()
if(fuel)
//Volatile Fuel
total_fuel += fuel.moles
fuel_sources++
if(toxins > fire_ratio_1)
oxygen -= vsc.plc.OXY_TO_PLASMA*fire_ratio_1
toxins -= fire_ratio_1
carbon_dioxide += fire_ratio_1
else if(toxins)
oxygen -= toxins * vsc.plc.OXY_TO_PLASMA
carbon_dioxide += toxins
toxins = 0
if(fuel_level > fire_ratio_1/1.5)
oxygen -= vsc.plc.OXY_TO_PLASMA*fire_ratio_1
fuel.moles -= fire_ratio_1
carbon_dioxide += fire_ratio_1
else if(fuel_level)
oxygen -= fuel.moles * vsc.plc.OXY_TO_PLASMA
carbon_dioxide += fuel.moles
fuel.moles = 0
if(liquid_level > 0)
oxygen -= fire_ratio_1
liquid.amount = max(liquid.amount-fire_ratio_1,0)
carbon_dioxide += fire_ratio_1
if(liquid)
//Liquid Fuel
if(liquid.amount <= 0)
del liquid
return 1
else
total_fuel += liquid.amount
fuel_sources++
//Toxins
if(toxins > 0.3) fuel_sources++
if(!fuel_sources) return 0 //If there's no fuel, there's no burn. Can't divide by zero anyway.
if(oxygen > 0.3)
//Calculate the firelevel.
var/firelevel = calculate_firelevel(liquid)
//Reaches a maximum practical temperature of around 2750.
temperature = 1000*log(0.016*firelevel + 1.45)
//Consume some gas.
var/consumed_gas = min(oxygen,0.002*firelevel,total_fuel) / fuel_sources
oxygen -= consumed_gas
toxins = max(0,toxins-consumed_gas)
if(fuel)
fuel.moles -= consumed_gas
if(fuel.moles <= 0) del fuel
if(liquid)
liquid.amount -= consumed_gas
if(liquid.amount <= 0) del liquid
update_values()
return consumed_gas*fuel_sources
return 0
datum/gas_mixture/proc/calculate_firelevel(obj/liquid_fuel/liquid)
//Calculates the firelevel based on one equation instead of having to do this multiple times in different areas.
var
datum/gas/volatile_fuel/fuel = locate() in trace_gases
fuel_level = 0
liquid_level = 0
if(fuel) fuel_level = fuel.moles
if(liquid) liquid_level = liquid.amount
return oxygen + toxins + liquid_level*15 + fuel_level*5
/mob/living/carbon/human/proc/FireBurn(mx as num)
//Burns mobs due to fire. Respects heat transfer coefficients on various body parts.
var
head_exposure = 1
chest_exposure = 1
groin_exposure = 1
legs_exposure = 1
arms_exposure = 1
//Get heat transfer coefficients for clothing.
for(var/obj/item/clothing/C in src)
if(l_hand == C || r_hand == C) continue
if(C.body_parts_covered & HEAD)
head_exposure *= C.heat_transfer_coefficient
if(C.body_parts_covered & UPPER_TORSO)
chest_exposure *= C.heat_transfer_coefficient
if(C.body_parts_covered & LOWER_TORSO)
groin_exposure *= C.heat_transfer_coefficient
if(C.body_parts_covered & LEGS)
legs_exposure *= C.heat_transfer_coefficient
if(C.body_parts_covered & ARMS)
arms_exposure *= C.heat_transfer_coefficient
//Always check these damage procs first if fire damage isn't working. They're probably what's wrong.
apply_damage(2.5*mx*head_exposure, BURN, "head", 0, 0, "Fire")
apply_damage(2.5*mx*chest_exposure, BURN, "chest", 0, 0, "Fire")
apply_damage(2.0*mx*groin_exposure, BURN, "groin", 0, 0, "Fire")
apply_damage(0.6*mx*legs_exposure, BURN, "l_leg", 0, 0, "Fire")
apply_damage(0.6*mx*legs_exposure, BURN, "r_leg", 0, 0, "Fire")
apply_damage(0.4*mx*arms_exposure, BURN, "l_arm", 0, 0, "Fire")
apply_damage(0.4*mx*arms_exposure, BURN, "r_arm", 0, 0, "Fire")
flash_pain()

View File

@@ -1,43 +1,34 @@
zone
proc
AddTurf(turf/T)
//Adds the turf to contents, increases the size of the zone, and sets the zone var.
if(T in contents) return
contents += T
air.group_multiplier++
T.zone = src
RemoveTurf(turf/T)
//Same, but in reverse.
if(!(T in contents)) return
contents -= T
air.group_multiplier--
T.zone = null
DivideAir(ratio)
ratio = min(1,max(0,ratio))
air.oxygen *= ratio
air.oxygen = QUANTIZE(air.oxygen)
air.nitrogen *= ratio
air.nitrogen = QUANTIZE(air.nitrogen)
air.toxins *= ratio
air.toxins = QUANTIZE(air.toxins)
air.carbon_dioxide *= ratio
air.carbon_dioxide = QUANTIZE(air.carbon_dioxide)
if(air.trace_gases.len)
for(var/datum/gas/trace_gas in air.trace_gases)
trace_gas.moles *= ratio
trace_gas.moles = QUANTIZE(trace_gas.moles)
air.temperature = air.temperature*ratio + TCMB*(1-ratio)
air.temperature = QUANTIZE(air.temperature)
AddSpace(turf/space/S)
//Adds a space tile to the list, and creates the list if null.
if(istype(S,/turf/space))
if(!space_tiles) space_tiles = list()
space_tiles += S
RemoveSpace(turf/space/S)
//Removes a space tile from the list, and deletes the list if length is 0.
if(space_tiles)
space_tiles -= S
if(!space_tiles.len) space_tiles = null
turf/proc/HasDoor(turf/O)
//Checks for the presence of doors, used for zone spreading and connection.
//A positive numerical argument checks only for closed doors.
//Another turf as an argument checks for windoors between here and there.
for(var/obj/machinery/door/D in src)
if(isnum(O) && O)
if(!D.density) continue
@@ -48,110 +39,155 @@ turf/proc/HasDoor(turf/O)
return 1
turf/proc/find_zone()
//Allows newly generated turfs to join up with a nearby zone.
if(world.time < 10) return
for(var/d in cardinal)
var/turf/T = get_step(src,d)
if(!T || !T.zone) continue
if(!T || !T.zone || !T.ZCanPass(src)) continue
if(!zone)
zone = T.zone
zone.AddTurf(src)
else if(T.zone != zone)
ZConnect(src,T)
turf/proc/check_connections()
//Checks for new connections that can be made.
for(var/d in cardinal)
var/turf/T = get_step(src,d)
if(!T || !T.zone || !T.CanPass(0,src,0,0)) continue
if(T.zone != zone)
ZConnect(src,T)
turf/proc/check_for_space()
//Checks for space around the turf.
for(var/d in cardinal)
var/turf/T = get_step(src,d)
if(istype(T,/turf/space) && T.CanPass(0,src,0,0))
zone.AddSpace(T)
proc
ZMerge(zone/A,zone/B)
//world << "Merge occured."
//Merges two zones so that they are one.
var
a_size = A.air.group_multiplier
b_size = B.air.group_multiplier
c_size = a_size + b_size
new_contents = A.contents + B.contents
//Set air multipliers to one so air represents gas per tile.
A.air.group_multiplier = 1
B.air.group_multiplier = 1
//Remove some air proportional to the size of this zone.
A.air.remove_ratio(a_size/c_size)
B.air.remove_ratio(b_size/c_size)
//Merge the gases and set the multiplier to the sum of the old ones.
A.air.merge(B.air)
A.air.group_multiplier = c_size
//Check for connections to merge into the new zone.
for(var/connection/C in B.connections)
if((C.A in new_contents) && (C.B in new_contents))
del C
continue
if(!A.connections) A.connections = list()
A.connections += C
//Add space tiles.
A.space_tiles += B.space_tiles
//Add contents.
A.contents = new_contents
//Set all the zone vars.
for(var/turf/T in B.contents)
T.zone = A
del B
ZConnect(turf/A,turf/B)
//Connects two zones by forming a connection object representing turfs A and B.
//Make sure that if it's space, it gets added to space_tiles instead.
if(istype(B,/turf/space))
if(A.zone)
A.zone.AddSpace(B)
//world << "Space added."
return
if(istype(A,/turf/space))
if(B.zone)
B.zone.AddSpace(B)
//world << "Space added."
B.zone.AddSpace(A)
return
//Make some preliminary checks to see if the connection is valid.
if(!A.zone || !B.zone) return
if(A.zone == B.zone) return
if(!A.CanPass(0,B,0,0)) return
//Ensure the connection isn't already made.
for(var/connection/C in A.zone.connections)
if((C.A == A && C.B == B) || (C.A == B && C.B == A))
return
var/connection/C = new(A,B)
if(A.HasDoor(B) || B.HasDoor(A)) C.indirect = 1
//world << "Connection Formed: [A] --> [B] [(C.indirect?"Indirect":"Direct")]"
//A.overlays += 'zone_connection_A.dmi'
//B.overlays += 'zone_connection_B.dmi'
//spawn(10)
// A.overlays -= 'zone_connection_A.dmi'
// B.overlays -= 'zone_connection_B.dmi'
var/connection/C = new(A,B)
//Ensure zones separated by doors do not merge.
if(A.HasDoor(B) || B.HasDoor(A)) C.indirect = 1
ZDisconnect(turf/A,turf/B)
//Removes a zone connection. Can split zones in the case of a permanent barrier.
//If one of them doesn't have a zone, it might be space, so check for that.
if(A.zone && B.zone)
//If the two zones are different, just remove a connection.
if(A.zone != B.zone)
for(var/connection/C in A.zone.connections)
if((C.A == A && C.B == B) || (C.A == B && C.B == A))
//world << "Connection Dissolved: [A] -/-> [B] [(C.indirect?"Indirect":"Direct")]"
/*A.overlays += 'zone_connection_A.dmi'
B.overlays += 'zone_connection_B.dmi'
spawn(10)
A.overlays -= 'zone_connection_A.dmi'
B.overlays -= 'zone_connection_B.dmi'*/
del C
/*else
//If they're the same, split the zone at this line.
else
//Preliminary checks to prevent stupidity.
if(A == B) return
if(A.CanPass(0,B,0,0)) return
if(A.HasDoor(B) || B.HasDoor(A)) return
//Do a test fill. If turf B is still in the floodfill, then the zone isn't really split.
var/zone/oldzone = A.zone
var/list/test = FloodFill(A)
if(B in test) return
else
var/zone/Z = new(test,oldzone.air)
var/zone/Z = new(test,oldzone.air) //Create a new zone based on the old air and the test fill.
//Add connections from the old zone.
for(var/connection/C in oldzone.connections)
if((A in Z.contents) || (B in Z.contents))
if(!Z.connections) Z.connections = list()
Z.connections += C
//Check for space.
for(var/turf/T in test)
T.check_for_space()
//Make a new, identical air mixture for the other zone.
var/datum/gas_mixture/Y_Air = new
Y_Air.copy_from(oldzone.air)
var/zone/Y = new(B,Y_Air)
var/zone/Y = new(B,Y_Air) //Make a new zone starting at B and using Y_Air.
//Add relevant connections from old zone.
for(var/connection/C in oldzone.connections)
if((A in Y.contents) || (B in Y.contents))
if(!Y.connections) Y.connections = list()
Y.connections += C
//Add the remaining space tiles to this zone.
for(var/turf/space/T in oldzone.space_tiles)
if(!(T in Z.space_tiles))
Y.AddSpace(T)
oldzone.air = null
del oldzone
world << "Zone Split: [A] / [B]"
A.overlays += 'zone_connection_A.dmi'
B.overlays += 'zone_connection_B.dmi'
spawn(10)
A.overlays -= 'zone_connection_A.dmi'
B.overlays -= 'zone_connection_B.dmi'*/
else
if(istype(A,/turf/space) && B.zone)
B.zone.RemoveSpace(A)

View File

@@ -1,252 +1,139 @@
pl_control/var
PLASMA_DMG = 3
PLASMA_DMG_NAME = "Plasma Damage Multiplier"
PLASMA_DMG_DESC = "Multiplier on how much damage inhaling plasma can do."
OXY_TO_PLASMA = 1
OXY_TO_PLASMA_NAME = "O2/Plasma Ratio"
OXY_TO_PLASMA_DESC = "Multiplier for the ratio of oxygen to plasma required in fires."
CLOTH_CONTAMINATION = 0 //If this is on, plasma does damage by getting into cloth.
CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth.
CLOTH_CONTAMINATION_NAME = "Plasma - Cloth Contamination"
CLOTH_CONTAMINATION_RANDOM = 60
CLOTH_CONTAMINATION_METHOD = "Toggle"
CLOTH_CONTAMINATION_DESC = "If set to nonzero, plasma will contaminate cloth items (uniforms, backpacks, etc.)\
and cause a small amount of damage over time to anyone carrying or wearing them. Contamination can be detected\
with a Health Analyzer, and washed off in the washer."
ALL_ITEM_CONTAMINATION = 0 //If this is on, any item can be contaminated, so suits and tools must be discarded or
//decontaminated.
ALL_ITEM_CONTAMINATION_NAME = "Plasma - Full Contamination"
ALL_ITEM_CONTAMINATION_RANDOM = 10
ALL_ITEM_CONTAMINATION_METHOD = "Toggle"
ALL_ITEM_CONTAMINATION_DESC = "Like Cloth Contamination, but all item types are susceptible."
PLASMAGUARD_ONLY = 0
PLASMAGUARD_ONLY_NAME = "Plasma - Biosuits/Spacesuits Only"
PLASMAGUARD_ONLY_RANDOM = 20
PLASMAGUARD_ONLY_METHOD = "Toggle"
PLASMAGUARD_ONLY_DESC = "If on, any suits that are not biosuits or space suits will not protect against contamination."
//CANISTER_CORROSION = 0 //If this is on, plasma must be stored in orange tanks and canisters,
//CANISTER_CORROSION_RANDOM = 20 //or it will corrode the tank.
//CANISTER_CORROSION_METHOD = "Toggle"
PLASMAGUARD_ONLY = 0 //If this is on, only biosuits and spacesuits protect against contamination and ill effects.
GENETIC_CORRUPTION = 0 //Chance of genetic corruption as well as toxic damage, X in 10,000.
GENETIC_CORRUPTION_NAME = "Plasma - Genetic Corruption"
GENETIC_CORRUPTION_RANDOM = "PROB10/3d6"
GENETIC_CORRUPTION_METHOD = "Numeric"
GENETIC_CORRUPTION_DESC = "When set to a probability in 1000, any humans in plasma will have this chance to develop a random mutation."
SKIN_BURNS = 1 //Plasma has an effect similar to mustard gas on the un-suited.
SKIN_BURNS_NAME = "Plasma - Skin Burns"
SKIN_BURNS_RANDOM = 10
SKIN_BURNS_METHOD = "Toggle"
SKIN_BURNS_DESC = "When toggled, humans with exposed skin will suffer burns (similar to mustard gas) in plasma."
//PLASMA_INJECTS_TOXINS = 0 //Plasma damage injects the toxins chemical to do damage over time.
//PLASMA_INJECTS_TOXINS_RANDOM = 30
//PLASMA_INJECTS_TOXINS_METHOD = "Toggle"
EYE_BURNS = 1 //Plasma burns the eyes of anyone not wearing eye protection.
EYE_BURNS = 0 //Plasma burns the eyes of anyone not wearing eye protection.
EYE_BURNS_NAME = "Plasma - Eye Burns"
EYE_BURNS_RANDOM = 30
EYE_BURNS_METHOD = "Toggle"
EYE_BURNS_DESC = "When toggled, humans without masks that cover the eyes will suffer temporary blurriness and sight loss,\
and may need glasses to see again if exposed for long durations."
CONTAMINATION_LOSS = 0.01
//N2O_REACTION = 0 //Plasma can react with N2O, making sparks and starting a fire if levels are high.
//N2O_REACTION_RANDOM = 5
PLASMA_HALLUCINATION = 0
//PLASMA_COLOR = "onturf" //Plasma can change colors yaaaay!
//PLASMA_COLOR_RANDOM = "PICKonturf,onturf"
//PLASMA_DMG_OFFSET = 1
//PLASMA_DMG_OFFSET_RANDOM = "1d5"
//PLASMA_DMG_QUOTIENT = 10
//PLASMA_DMG_QUOTIENT_RANDOM = "1d10+4"
CONTAMINATION_LOSS = 0.1
_NAME = "Plasma - Contamination Damage"
CONTAMINATION_LOSS_DESC = "A number representing the damage done per life cycle by contaminated items."
PLASMA_HALLUCINATION = 1
PLASMA_HALLUCINATION_NAME = "Plasma - Hallucination"
PLASMA_HALLUCINATION_METHOD = "Toggle"
PLASMA_HALLUCINATION_DESC = "If toggled, uses the remnants of the hallucination code to induce visions in those\
who breathe plasma."
N2O_HALLUCINATION = 1
N2O_HALLUCINATION_NAME = "Nitrous Oxide - Hallucination"
N2O_HALLUCINATION_METHOD = "Toggle"
N2O_HALLUCINATION_DESC = "If toggled, uses the remnants of the hallucination code to induce visions in those\
who breathe N2O."
//CONTAMINATION_LOSS_RANDOM = "5d5"
//Plasma has a chance to be a different color.
obj/var/contaminated = 0
obj/item/proc
can_contaminate()
//Clothing and backpacks can be contaminated.
if(flags & PLASMAGUARD) return 0
if((flags & SUITSPACE) && !vsc.plc.PLASMAGUARD_ONLY) return 1
if(vsc.plc.ALL_ITEM_CONTAMINATION) return 1
if(flags & SUITSPACE) return 0
else if(istype(src,/obj/item/clothing)) return 1
else if(istype(src,/obj/item/weapon/storage/backpack)) return 1
/mob/living/carbon/human/proc/contaminate()
contaminate()
//Do a contamination overlay? Temporary measure to keep contamination less deadly than it was.
if(!contaminated)
contaminated = 1
overlays += 'icons/effects/contamination.dmi'
decontaminate()
contaminated = 0
overlays -= 'icons/effects/contamination.dmi'
/mob/proc/contaminate()
/mob/living/carbon/human/contaminate()
//See if anything can be contaminated.
if(!pl_suit_protected())
suit_contamination()
else if(vsc.plc.PLASMAGUARD_ONLY)
if(!wear_suit.flags & PLASMAGUARD) wear_suit.contaminated = 1
if(!pl_head_protected())
if(wear_mask) wear_mask.contaminated = 1
if(prob(1)) suit_contamination() //Plasma can sometimes get through such an open suit.
else if(vsc.plc.PLASMAGUARD_ONLY)
if(!head.flags & PLASMAGUARD) head.contaminated = 1
if(istype(back,/obj/item/weapon/storage/backpack) || vsc.plc.ALL_ITEM_CONTAMINATION)
back.contaminated = 1
if(istype(back,/obj/item/weapon/storage/backpack))
back.contaminate()
if(l_hand)
if(l_hand.can_contaminate()) l_hand.contaminated = 1
if(r_hand)
if(r_hand.can_contaminate()) r_hand.contaminated = 1
if(belt)
if(belt.can_contaminate()) belt.contaminated = 1
if(wear_id && !pl_suit_protected())
if(wear_id.can_contaminate()) wear_id.contaminated = 1
if(l_ear && !pl_head_protected())
if(l_ear.can_contaminate()) l_ear.contaminated = 1
if(r_ear && !pl_head_protected())
if(r_ear.can_contaminate()) r_ear.contaminated = 1
/mob/proc/pl_effects()
/mob/living/carbon/human/proc/pl_effects()
/mob/living/carbon/human/pl_effects()
//Handles all the bad things plasma can do.
//Contamination
if(vsc.plc.CLOTH_CONTAMINATION) contaminate()
//Anything else requires them to not be dead.
if(stat >= 2)
return
//Burn skin if exposed.
if(vsc.plc.SKIN_BURNS)
if(!pl_head_protected() || !pl_suit_protected())
burn_skin(0.75)
if (coughedtime != 1)
coughedtime = 1
emote("gasp")
spawn (20)
coughedtime = 0
if(prob(20)) src << "\red Your skin burns!"
updatehealth()
if(vsc.plc.EYE_BURNS && !pl_head_protected())
//Burn eyes if exposed.
if(vsc.plc.EYE_BURNS)
if(!head)
if(!wear_mask)
if(prob(20)) usr << "\red Your eyes burn!"
eye_stat += 2.5
eye_blurry += 1.5
if (eye_stat >= 20 && !(disabilities & 1))
src << "\red Your eyes start to burn badly!"
disabilities |= 1
if (prob(max(0,eye_stat - 20) + 1))
src << "\red You are blinded!"
eye_blind += 20
eye_stat = max(eye_stat-25,0)
burn_eyes()
else
if(!(wear_mask.flags & MASKCOVERSEYES))
if(prob(20)) usr << "\red Your eyes burn!"
eye_stat += 2.5
eye_blurry = min(eye_blurry+1.5,50)
if (eye_stat >= 20 && !(disabilities & 1))
src << "\red Your eyes start to burn badly!"
disabilities |= 1
if (prob(max(0,eye_stat - 20) + 1) &&!eye_blind)
src << "\red You are blinded!"
eye_blind += 20
eye_stat = 0
burn_eyes()
else
if(!(head.flags & HEADCOVERSEYES))
if(!wear_mask)
burn_eyes()
else
if(!(wear_mask.flags & MASKCOVERSEYES))
burn_eyes()
//Genetic Corruption
if(vsc.plc.GENETIC_CORRUPTION)
if(rand(1,1000) < vsc.plc.GENETIC_CORRUPTION)
if(rand(1,10000) < vsc.plc.GENETIC_CORRUPTION)
randmutb(src)
src << "\red High levels of toxins cause you to spontaneously mutate."
domutcheck(src,null)
/mob/living/carbon/human/proc/FireBurn(mx as num)
//NO! NOT INTO THE PIT! IT BURRRRRNS!
mx *= vsc.BURN_DMG
var
head_exposure = 1
chest_exposure = 1
groin_exposure = 1
legs_exposure = 1
feet_exposure = 1
arms_exposure = 1
hands_exposure = 1
for(var/obj/item/clothing/C in src)
if(l_hand == C || r_hand == C) continue
if(C.body_parts_covered & HEAD)
head_exposure *= C.heat_transfer_coefficient
if(C.body_parts_covered & UPPER_TORSO)
chest_exposure *= C.heat_transfer_coefficient
if(C.body_parts_covered & LOWER_TORSO)
groin_exposure *= C.heat_transfer_coefficient
if(C.body_parts_covered & LEGS)
legs_exposure *= C.heat_transfer_coefficient
if(C.body_parts_covered & FEET)
feet_exposure *= C.heat_transfer_coefficient
if(C.body_parts_covered & ARMS)
arms_exposure *= C.heat_transfer_coefficient
if(C.body_parts_covered & HANDS)
arms_exposure *= C.heat_transfer_coefficient
mx *= 10
apply_damage("head", 0, 2.5*mx*head_exposure)
apply_damage("chest", 0, 2.5*mx*chest_exposure)
apply_damage("groin", 0, 2.0*mx*groin_exposure)
apply_damage("l_leg", 0, 0.6*mx*legs_exposure)
apply_damage("r_leg", 0, 0.6*mx*legs_exposure)
apply_damage("l_arm", 0, 0.4*mx*arms_exposure)
apply_damage("r_arm", 0, 0.4*mx*arms_exposure)
apply_damage("l_foot", 0, 0.25*mx*feet_exposure)
apply_damage("r_foot", 0, 0.25*mx*feet_exposure)
apply_damage("l_hand", 0, 0.25*mx*hands_exposure)
apply_damage("r_hand", 0, 0.25*mx*hands_exposure)
/mob/living/carbon/human/proc/suit_interior()
. = list()
if(!pl_suit_protected())
for(var/obj/item/I in src)
. += I
return .
. += wear_mask
. += w_uniform
. += shoes
. += gloves
if(!pl_head_protected())
. += head
/mob/living/carbon/human/proc/burn_eyes()
//The proc that handles eye burning.
if(prob(20)) src << "\red Your eyes burn!"
eye_stat += 2.5
eye_blurry = min(eye_blurry+1.5,50)
if (prob(max(0,eye_stat - 20) + 1) &&!eye_blind)
src << "\red You are blinded!"
eye_blind += 20
eye_stat = 0
/mob/living/carbon/human/proc/pl_head_protected()
//Checks if the head is adequately sealed.
if(head)
if(vsc.plc.PLASMAGUARD_ONLY)
if(head.flags & PLASMAGUARD || head.flags & HEADSPACE) return 1
else
if(head.flags & HEADCOVERSEYES) return 1
return 0
/mob/living/carbon/human/proc/pl_suit_protected()
//Checks if the suit is adequately sealed.
if(wear_suit)
if(vsc.plc.PLASMAGUARD_ONLY)
if(wear_suit.flags & PLASMAGUARD || wear_suit.flags & SUITSPACE) return 1
else
if(wear_suit.flags_inv & HIDEJUMPSUIT) return 1
return 0
/mob/living/carbon/human/proc/suit_contamination()
if(vsc.plc.ALL_ITEM_CONTAMINATION)
for(var/obj/item/I in src)
I.contaminated = 1
else
if(wear_suit) wear_suit.contaminated = 1
if(w_uniform) w_uniform.contaminated = 1
if(shoes) shoes.contaminated = 1
if(gloves) gloves.contaminated = 1
if(wear_mask) wear_mask.contaminated = 1
//Runs over the things that can be contaminated and does so.
if(w_uniform) w_uniform.contaminate()
if(shoes) shoes.contaminate()
if(gloves) gloves.contaminate()
turf/Entered(obj/item/I)
. = ..()
if(istype(I))
//Items that are in plasma, but not on a mob, can still be contaminated.
if(istype(I) && vsc.plc.CLOTH_CONTAMINATION)
var/datum/gas_mixture/env = return_air(1)
if(env.toxins > 0.35)
if(env.toxins > MOLES_PLASMA_VISIBLE + 1)
if(I.can_contaminate())
I.contaminated = 1
I.contaminate()

View File

@@ -2,19 +2,26 @@
var/explosion_halt = 0
zone
proc/process()
//Does rebuilding stuff. Not sure if used.
if(rebuild)
//Deletes zone if empty.
if(!contents.len)
del src
return 0
//Choose a random turf and regenerate the zone from it.
var
turf/sample = pick(contents)
list/new_contents = FloodFill(sample)
problem = 0
//If something isn't carried over, there was a complication.
for(var/turf/T in contents)
if(!(T in new_contents))
problem = 1
if(problem)
//Build some new zones for stuff that wasn't included.
var/list/rebuild_turfs = list()
for(var/turf/T in contents - new_contents)
contents -= T
@@ -26,74 +33,181 @@ zone
Z.air.copy_from(air)
rebuild = 0
var/total_space = 0
var/turf/space/space
//Sometimes explosions will cause the air to be deleted for some reason.
if(!air)
air = new()
air.adjustGases(MOLES_O2STANDARD, 0, MOLES_N2STANDARD, 0, list())
world.log << "Air object lost in zone. Regenerating."
if(length(connected_zones))
for(var/zone/Z in connected_zones)
total_space += length(Z.space_tiles)
if(length(Z.space_tiles))
space = Z.space_tiles[1]
//Counting up space.
var/total_space = 0
if(space_tiles)
for(var/T in space_tiles)
if(!istype(T,/turf/space)) space_tiles -= T
total_space += length(space_tiles)
if(length(space_tiles))
space = space_tiles[1]
total_space = length(space_tiles)
if(total_space && space)
var/old_pressure = air.return_pressure()
air.temperature_mimic(space,OPEN_HEAT_TRANSFER_COEFFICIENT,total_space)
air.remove(MOLES_CELLSTANDARD * (air.group_multiplier/40) * total_space)
if(dbg_output) world << "Space removed [MOLES_CELLSTANDARD*(air.group_multiplier/40)*total_space] moles of air."
var/p_diff = old_pressure - air.return_pressure()
if(p_diff > vsc.AF_TINY_MOVEMENT_THRESHOLD) AirflowSpace(src,p_diff)
//Add checks to ensure that we're not sucking air out of an empty room.
if(total_space && air.total_moles > 0.1 && air.temperature > TCMB+0.5)
//If there is space, air should flow out of the zone.
//if(abs(air.pressure) > vsc.airflow_lightest_pressure)
// AirflowSpace(src)
ShareSpace(air,total_space*(vsc.zone_share_percent/100))
//React the air here.
air.react(null,0)
var/check = air.check_tile_graphic()
for(var/turf/T in contents)
if(T.zone && T.zone != src)
RemoveTurf(T)
if(dbg_output) world << "Removed invalid turf."
if(air.group_multiplier <= 0) // No more turfs belong to this zone, so we can get rid of it
del(src)
else // Turf was valid, so we can handle it
if(!T.zone)
T.zone = src
if(istype(T,/turf/simulated))
var/turf/simulated/S = T
if(S.fire_protection) S.fire_protection--
//Check the graphic.
var/check = air.check_tile_graphic()
//Only run through the individual turfs if there's reason to.
if(check || air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
for(var/turf/simulated/S in contents)
//Update overlays.
if(check)
if(S.HasDoor(1))
S.update_visuals()
else
S.update_visuals(air)
//Expose stuff to extreme heat.
if(air.temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
for(var/atom/movable/item in S)
item.temperature_expose(air, air.temperature, CELL_VOLUME)
S.temperature_expose(air, air.temperature, CELL_VOLUME)
//Archive graphic so we can know if it's different.
air.graphic_archived = air.graphic
//Ensure temperature does not reach absolute zero.
air.temperature = max(TCMB,air.temperature)
//Handle connections to other zones.
if(length(connections))
for(var/connection/C in connections)
//Check if the connection is valid first.
C.Cleanup()
if(C && !C.indirect)
if(C.A.zone.air.compare(C.B.zone.air))
//Do merging if conditions are met. Specifically, if there's a non-door connection
//to somewhere with space, the zones are merged regardless of equilibrium, to speed
//up spacing in areas with double-plated windows.
if(C && !C.indirect && C.A.zone && C.B.zone)
if(C.A.zone.air.compare(C.B.zone.air) || total_space)
ZMerge(C.A.zone,C.B.zone)
//Share some
for(var/zone/Z in connected_zones)
var/p_diff = (air.return_pressure()-Z.air.return_pressure())*connected_zones[Z]*(vsc.zone_share_percent/100)
if(p_diff > vsc.AF_TINY_MOVEMENT_THRESHOLD) Airflow(src,Z,p_diff)
air.share_ratio(Z.air,connected_zones[Z]*(vsc.zone_share_percent/100))
//Ensure we're not doing pointless calculations on equilibrium zones.
if(abs(air.total_moles - Z.air.total_moles) > 0.1 || abs(air.temperature - Z.air.temperature) > 0.1)
//if(abs(Z.air.pressure - air.pressure) > vsc.airflow_lightest_pressure)
// Airflow(src,Z)
ShareRatio(air,Z.air,connected_zones[Z]*(vsc.zone_share_percent/100))
proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, ratio)
//Shares a specific ratio of gas between mixtures using simple weighted averages.
var
size = max(1,A.group_multiplier)
share_size = max(1,B.group_multiplier)
full_oxy = A.oxygen * size
full_nitro = A.nitrogen * size
full_co2 = A.carbon_dioxide * size
full_plasma = A.toxins * size
full_thermal = A.temperature * A.heat_capacity() * size
s_full_oxy = B.oxygen * share_size
s_full_nitro = B.nitrogen * share_size
s_full_co2 = B.carbon_dioxide * share_size
s_full_plasma = B.toxins * share_size
s_full_thermal = B.temperature * B.heat_capacity() * share_size
oxy_avg = (full_oxy + s_full_oxy) / (size + share_size)
nit_avg = (full_nitro + s_full_nitro) / (size + share_size)
co2_avg = (full_co2 + s_full_co2) / (size + share_size)
plasma_avg = (full_plasma + s_full_plasma) / (size + share_size)
thermal_avg = (full_thermal + s_full_thermal) / (size+share_size)
A.oxygen = (A.oxygen - oxy_avg) * (1-ratio) + oxy_avg
A.nitrogen = (A.nitrogen - nit_avg) * (1-ratio) + nit_avg
A.carbon_dioxide = (A.carbon_dioxide - co2_avg) * (1-ratio) + co2_avg
A.toxins = (A.toxins - plasma_avg) * (1-ratio) + plasma_avg
B.oxygen = (B.oxygen - oxy_avg) * (1-ratio) + oxy_avg
B.nitrogen = (B.nitrogen - nit_avg) * (1-ratio) + nit_avg
B.carbon_dioxide = (B.carbon_dioxide - co2_avg) * (1-ratio) + co2_avg
B.toxins = (B.toxins - plasma_avg) * (1-ratio) + plasma_avg
var
thermal = (full_thermal/size - thermal_avg) * (1-ratio) + thermal_avg
sharer_thermal = (s_full_thermal/share_size - thermal_avg) * (1-ratio) + thermal_avg
A.temperature = thermal / (A.heat_capacity() == 0 ? MINIMUM_HEAT_CAPACITY : A.heat_capacity())
B.temperature = sharer_thermal / (B.heat_capacity() == 0 ? MINIMUM_HEAT_CAPACITY : B.heat_capacity())
for(var/datum/gas/G in A.trace_gases)
var/datum/gas/H = locate(G.type) in B.trace_gases
if(H)
var/G_avg = (G.moles*size + H.moles*share_size) / (size+share_size)
G.moles = (G.moles - G_avg) * (1-ratio) + G_avg
H.moles = (H.moles - G_avg) * (1-ratio) + G_avg
else
H = new G.type
B.trace_gases += H
var/G_avg = (G.moles*size) / (size+share_size)
G.moles = (G.moles - G_avg) * (1-ratio) + G_avg
H.moles = (H.moles - G_avg) * (1-ratio) + G_avg
A.update_values()
B.update_values()
if(A.compare(B)) return 1
else return 0
proc/ShareSpace(datum/gas_mixture/A, ratio)
//A modified version of ShareRatio for spacing gas at the same rate as if it were going into a huge airless room.
var
size = max(1,A.group_multiplier)
share_size = 2000 //A huge value because space is huge.
full_oxy = A.oxygen * size
full_nitro = A.nitrogen * size
full_co2 = A.carbon_dioxide * size
full_plasma = A.toxins * size
full_thermal = A.temperature * A.heat_capacity() * size
oxy_avg = (full_oxy + 0) / (size + share_size)
nit_avg = (full_nitro + 0.2) / (size + share_size)
co2_avg = (full_co2 + 0) / (size + share_size)
plasma_avg = (full_plasma + 0) / (size + share_size)
thermal_avg = (full_thermal + MINIMUM_HEAT_CAPACITY) / (size+share_size)
A.oxygen = (A.oxygen - oxy_avg) * (1-ratio) + oxy_avg
A.nitrogen = (A.nitrogen - nit_avg) * (1-ratio) + nit_avg
A.carbon_dioxide = (A.carbon_dioxide - co2_avg) * (1-ratio) + co2_avg
A.toxins = (A.toxins - plasma_avg) * (1-ratio) + plasma_avg
var/thermal = (full_thermal/size - thermal_avg) * (1-ratio) + thermal_avg
A.temperature = thermal / (A.heat_capacity() == 0 ? MINIMUM_HEAT_CAPACITY : A.heat_capacity())
for(var/datum/gas/G in A.trace_gases)
var/G_avg = (G.moles*size + 0) / (size+share_size)
G.moles = (G.moles - G_avg) * (1-ratio) + G_avg
A.update_values()
return 1
zone/proc
connected_zones()
//A legacy proc for getting connected zones.
. = list()
for(var/connection/C in connections)
var/zone/Z

View File

@@ -119,8 +119,6 @@ vs_control
if("Original")
plc.CLOTH_CONTAMINATION = 0 //If this is on, plasma does damage by getting into cloth.
plc.ALL_ITEM_CONTAMINATION = 0 //If this is on, any item can be contaminated, so suits and tools must be discarded or
plc.PLASMAGUARD_ONLY = 0
//plc.CANISTER_CORROSION = 0 //If this is on, plasma must be stored in orange tanks and canisters,
@@ -133,6 +131,8 @@ vs_control
plc.EYE_BURNS = 0 //Plasma burns the eyes of anyone not wearing eye protection.
plc.PLASMA_HALLUCINATION = 0
//plc.N2O_REACTION = 0 //Plasma can react with N2O, making sparks and starting a fire if levels are high.
//plc.PLASMA_COLOR = "onturf" //Plasma can change colors yaaaay!
@@ -142,9 +142,7 @@ vs_control
plc.CONTAMINATION_LOSS = 0
if("Hazard - Low")
plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth.
plc.ALL_ITEM_CONTAMINATION = 0 //If this is on, any item can be contaminated, so suits and tools must be discarded or
plc.CLOTH_CONTAMINATION = 0 //If this is on, plasma does damage by getting into cloth.
plc.PLASMAGUARD_ONLY = 0
@@ -152,7 +150,7 @@ vs_control
plc.GENETIC_CORRUPTION = 0 //Chance of genetic corruption as well as toxic damage, X in 1000.
plc.SKIN_BURNS = 0 //Plasma has an effect similar to mustard gas on the un-suited.
plc.SKIN_BURNS = 1 //Plasma has an effect similar to mustard gas on the un-suited.
// plc.PLASMA_INJECTS_TOXINS = 0 //Plasma damage injects the toxins chemical to do damage over time.
@@ -168,27 +166,22 @@ vs_control
//plc.PLASMA_DMG_OFFSET = 1.5
//plc.PLASMA_DMG_QUOTIENT = 8
plc.CONTAMINATION_LOSS = 0.01
var/s = pick(plc.settings)
plc.Randomize(s)
plc.CONTAMINATION_LOSS = 0
if("Hazard - High")
plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth.
plc.ALL_ITEM_CONTAMINATION = 0 //If this is on, any item can be contaminated, so suits and tools must be discarded or
plc.PLASMAGUARD_ONLY = 0
// plc.CANISTER_CORROSION = 1 //If this is on, plasma must be stored in orange tanks and canisters,
plc.GENETIC_CORRUPTION = 0 //Chance of genetic corruption as well as toxic damage, X in 1000.
plc.SKIN_BURNS = 0 //Plasma has an effect similar to mustard gas on the un-suited.
plc.SKIN_BURNS = 1 //Plasma has an effect similar to mustard gas on the un-suited.
// plc.PLASMA_INJECTS_TOXINS = 0 //Plasma damage injects the toxins chemical to do damage over time.
plc.EYE_BURNS = 0 //Plasma burns the eyes of anyone not wearing eye protection.
plc.EYE_BURNS = 1 //Plasma burns the eyes of anyone not wearing eye protection.
// plc.N2O_REACTION = 0 //Plasma can react with N2O, making sparks and starting a fire if levels are high.
@@ -197,17 +190,9 @@ vs_control
//plc.PLASMA_DMG_OFFSET = 3
//plc.PLASMA_DMG_QUOTIENT = 5
plc.CONTAMINATION_LOSS = 0.05
for(var/i = rand(3,5),i>0,i--)
var/s = pick(plc.settings)
plc.Randomize(s)
if("Everything")
if("Oh Shit!")
plc.CLOTH_CONTAMINATION = 1 //If this is on, plasma does damage by getting into cloth.
plc.ALL_ITEM_CONTAMINATION = 1 //If this is on, any item can be contaminated, so suits and tools must be discarded or ELSE
plc.PLASMAGUARD_ONLY = 1
// plc.CANISTER_CORROSION = 1 //If this is on, plasma must be stored in orange tanks and canisters,
@@ -227,7 +212,6 @@ vs_control
//plc.PLASMA_DMG_OFFSET = 3
//plc.PLASMA_DMG_QUOTIENT = 5
plc.CONTAMINATION_LOSS = 0.02
/////world << "Plasma color updated."
pl_control

View File

@@ -431,7 +431,7 @@ client/Topic(href, href_list, hsrc)
//~CARN: for renaming mobs (updates their real_name and their ID/PDA if applicable).
else if (href_list["rename"])
var/new_name = input(usr,"What would you like to name this mob?","Input a name") as text|null
var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name") as text|null),1,MAX_NAME_LEN)
if(!new_name) return
var/mob/M = locate(href_list["rename"])
if(!istype(M)) return

View File

@@ -305,7 +305,7 @@ datum/mind
role_alt_title = null
else if (href_list["memory_edit"])
var/new_memo = input("Write new memory", "Memory", memory) as null|message
var/new_memo = copytext(sanitize(input("Write new memory", "Memory", memory) as null|message),1,MAX_MESSAGE_LEN)
if (isnull(new_memo)) return
memory = new_memo
@@ -408,7 +408,7 @@ datum/mind
new_objective:target_amount = target_number
if ("custom")
var/expl = input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null
var/expl = copytext(sanitize(input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null),1,MAX_MESSAGE_LEN)
if (!expl) return
new_objective = new /datum/objective
new_objective.owner = src

View File

@@ -723,7 +723,7 @@ proc/process_ghost_teleport_locs()
//Crew
/area/crew_quarters
name = "Dormitory"
name = "Dormitories"
icon_state = "Sleep"
/area/crew_quarters/toilet
@@ -842,25 +842,25 @@ proc/process_ghost_teleport_locs()
//Engineering
/area/engine
engineering
engine_smes
name = "Engineering SMES"
icon_state = "engine_smes"
requires_power = 0//This area only covers the batteries and they deal with their own power
engineering
engineering_break_room
name = "Engineering Break Room"
icon_state = "engine_breakroom"
chiefs_office
name = "Chief Engineer's office"
icon_state = "engine_ce"
particle_accelerator
name = "Particle Accelerator"
icon_state = "engine_pa"
chiefs_office
name = "Chief Engineers office"
icon_state = "engine_ce"
engineering_break_room
name = "Engineering Breakroom"
icon_state = "engine_breakroom"
control
name = "Engineering Control"
icon_state = "engine_control"
@@ -1008,7 +1008,7 @@ proc/process_ghost_teleport_locs()
icon_state = "showroom"
/area/assembly/assembly_line
name = "Assembly Line"
name = "Robotics Assembly Line"
icon_state = "ass_line"
//Teleporter
@@ -1079,6 +1079,10 @@ proc/process_ghost_teleport_locs()
name = "Genetics"
icon_state = "genetics"
/area/medical/sleeper
name = "Medical Sleepers Room"
icon_state = "medbay"
//Security
/area/security/main
@@ -1106,7 +1110,7 @@ proc/process_ghost_teleport_locs()
icon_state = "security"
/area/security/hos
name = "Head of Security"
name = "Head of Security's Office"
icon_state = "security"
/area/security/detectives_office
@@ -1187,7 +1191,7 @@ proc/process_ghost_teleport_locs()
icon_state = "yellow"
/area/janitor/
name = "Janitors Closet"
name = "Custodial Closet"
icon_state = "janitor"
/area/hydroponics
@@ -1221,15 +1225,15 @@ proc/process_ghost_teleport_locs()
icon_state = "toxlab"
/area/toxins/storage
name = "Toxin Storage"
name = "Toxins Storage"
icon_state = "toxstorage"
/area/toxins/test_area
name = "Toxins Lab Test Area"
name = "Toxins Test Area"
icon_state = "toxtest"
/area/toxins/mixing
name = "Toxins Lab Mixing Room"
name = "Toxins Mixing Room"
icon_state = "toxmix"
/area/toxins/observatory
@@ -1247,7 +1251,7 @@ proc/process_ghost_teleport_locs()
//Storage
/area/storage/tools
name = "Tool Storage"
name = "Auxiliary Tool Storage"
icon_state = "storage"
/area/storage/primary
@@ -1275,11 +1279,11 @@ proc/process_ghost_teleport_locs()
icon_state = "storage"
/area/storage/emergency
name = "Emergency Storage A"
name = "Starboard Emergency Storage"
icon_state = "emergencystorage"
/area/storage/emergency2
name = "Emergency Storage B"
name = "Port Emergency Storage"
icon_state = "emergencystorage"
/area/storage/tech
@@ -1316,7 +1320,7 @@ proc/process_ghost_teleport_locs()
icon_state = "hallS"
/area/derelict/arrival
name = "Arrival Centre"
name = "Derelict Arrival Centre"
icon_state = "yellow"
/area/derelict/storage/equipment
@@ -1330,23 +1334,23 @@ proc/process_ghost_teleport_locs()
icon_state = "green"
/area/derelict/bridge
name = "Control Room"
name = "Derelict Control Room"
icon_state = "bridge"
/area/derelict/secret
name = "Secret Room"
name = "Derelict Secret Room"
icon_state = "library"
/area/derelict/bridge/access
name = "Control Room Access"
name = "Derelict Control Room Access"
icon_state = "auxstorage"
/area/derelict/bridge/ai_upload
name = "Ruined Computer Core"
name = "Derelict Computer Core"
icon_state = "ai"
/area/derelict/solar_control
name = "Solar Control"
name = "Derelict Solar Control"
icon_state = "engine"
/area/derelict/crew_quarters
@@ -1374,7 +1378,7 @@ proc/process_ghost_teleport_locs()
icon_state = "eva"
/area/derelict/ship
name = "Abandoned ship"
name = "Abandoned Ship"
icon_state = "yellow"
/area/solar/derelict_starboard

View File

@@ -17,7 +17,7 @@
// replaced by OPENCONTAINER flags and atom/proc/is_open_container()
///Chemistry.
proc/assume_air(datum/air_group/giver)
proc/assume_air(datum/gas_mixture/giver)
del(giver)
return null
@@ -48,7 +48,7 @@
*/
obj
assume_air(datum/air_group/giver)
assume_air(datum/gas_mixture/giver)
if(loc)
return loc.assume_air(giver)
else

View File

@@ -190,6 +190,8 @@ var
const/MAX_PAPER_MESSAGE_LEN = 3072
const/MAX_BOOK_MESSAGE_LEN = 9216
const/MAX_NAME_LEN = 40
list/paper_blacklist = list("script","frame","iframe","input","button","a","embed","object")
const/shuttle_time_in_station = 1800 // 3 minutes in the station

View File

@@ -130,15 +130,6 @@
var/list/connected_doors
var/department //each department has a hardcoded list of possible door networks
/obj/machinery/computer/crew
name = "Crew monitoring computer"
desc = "Used to monitor active health sensors built into most of the crew's uniforms."
icon_state = "crew"
use_power = 1
idle_power_usage = 250
active_power_usage = 500
circuit = "/obj/item/weapon/circuitboard/crew"
var/list/tracked = list( )
/*/obj/machinery/computer/scan_consolenew //Coming Soon, I highly doubt this but Ill leave it here anyways
name = "DNA Modifier Access Console"

View File

@@ -126,9 +126,9 @@
name = "Robust Softdrinks"
desc = "A softdrink vendor provided by Robust Industries, LLC."
icon_state = "Cola_Machine"
product_paths = "/obj/item/weapon/reagent_containers/food/drinks/cola;/obj/item/weapon/reagent_containers/food/drinks/space_mountain_wind;/obj/item/weapon/reagent_containers/food/drinks/dr_gibb;/obj/item/weapon/reagent_containers/food/drinks/starkist;/obj/item/weapon/reagent_containers/food/drinks/space_up"
product_amounts = "10;10;10;10;10"
product_prices = "1;1;1;1;1"
product_paths = "/obj/item/weapon/reagent_containers/food/drinks/cola;/obj/item/weapon/reagent_containers/food/drinks/space_mountain_wind;/obj/item/weapon/reagent_containers/food/drinks/dr_gibb;/obj/item/weapon/reagent_containers/food/drinks/starkist;/obj/item/weapon/reagent_containers/food/drinks/space_up;/obj/item/weapon/reagent_containers/food/drinks/waterbottle"
// product_amounts = "10;10;10;10;10"
product_prices = "1;1;1;1;1;1"
product_slogans = "Robust Softdrinks: More robust then a toolbox to the head!"
product_hidden = "/obj/item/weapon/reagent_containers/food/drinks/thirteenloko"
product_hideamt = "5"

View File

@@ -692,15 +692,15 @@ Turf and target are seperate in case you want to teleport some distance from a t
/proc/ainame(var/mob/M as mob)
var/randomname = M.name
var/time_passed = world.time//Pretty basic but it'll do. It's still possible to bypass this by return ainame().
var/newname = input(M,"You are the AI. Would you like to change your name to something else?", "Name change",randomname)
var/newname = copytext(sanitize(input(M,"You are the AI. Would you like to change your name to something else?", "Name change",randomname)),1,MAX_NAME_LEN)
if((world.time-time_passed)>200)//If more than 20 game seconds passed.
M << "You took too long to decide. Default name selected."
return
if (length(newname) == 0)
if (!newname)
newname = randomname
if (newname)
else
if (newname == "Inactive AI")//Keeping this here to prevent dumb.
M << "That name is reserved."
return ainame(M)
@@ -708,22 +708,19 @@ Turf and target are seperate in case you want to teleport some distance from a t
if (A.real_name == newname&&newname!=randomname)
M << "There's already an AI with that name."
return ainame(M)
if (length(newname) >= 26)
newname = copytext(newname, 1, 26)
newname = dd_replacetext(newname, ">", "'")
M.real_name = newname
M.name = newname
M.original_name = newname
/*/proc/clname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea
var/randomname = pick(clown_names)
var/newname = input(M,"You are the clown. Would you like to change your name to something else?", "Name change",randomname)
var/newname = copytext(sanitize(input(M,"You are the clown. Would you like to change your name to something else?", "Name change",randomname)),1,MAX_NAME_LEN)
var/oldname = M.real_name
if (length(newname) == 0)
if (!newname)
newname = randomname
if (newname)
else
var/badname = 0
switch(newname)
if("Unknown") badname = 1
@@ -740,9 +737,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
if(A.real_name == newname)
M << "That name is reserved."
return clname(M)
if(length(newname) >= 26)
newname = copytext(newname, 1, 26)
newname = dd_replacetext(newname, ">", "'")
M.real_name = newname
M.name = newname
M.original_name = newname
@@ -1561,18 +1555,12 @@ proc/listclearnulls(list/list)
for(var/turf/simulated/T1 in toupdate)
for(var/obj/machinery/door/D2 in T1)
doors += D2
if(T1.parent)
air_master.groups_to_rebuild += T1.parent
else
air_master.tiles_to_update += T1
if(fromupdate.len)
for(var/turf/simulated/T2 in fromupdate)
for(var/obj/machinery/door/D2 in T2)
doors += D2
if(T2.parent)
air_master.groups_to_rebuild += T2.parent
else
air_master.tiles_to_update += T2
for(var/obj/O in doors)
@@ -1728,9 +1716,6 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
for(var/turf/simulated/T1 in toupdate)
for(var/obj/machinery/door/D2 in T1)
doors += D2
if(T1.parent)
air_master.groups_to_rebuild += T1.parent
else
air_master.tiles_to_update += T1
for(var/obj/O in doors)

View File

@@ -341,8 +341,6 @@
proc/TemperatureAct(temperature)
for(var/turf/simulated/floor/target_tile in range(2,loc))
if(target_tile.parent && target_tile.parent.group_processing)
target_tile.parent.suspend_group_processing()
var/datum/gas_mixture/napalm = new

View File

@@ -409,7 +409,7 @@ As such, it's hard-coded for now. No reason for it not to be, really.
var/mission
while(!mission)
mission = input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "")
mission = copytext(sanitize(input(src, "Please specify which mission the space ninja shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!mission)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return

View File

@@ -339,18 +339,15 @@
/proc/nukelastname(var/mob/M as mob) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea. Also praise Urist for copypasta ho.
var/randomname = pick(last_names)
var/newname = input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname)
var/newname = copytext(sanitize(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname)),1,MAX_NAME_LEN)
if (length(newname) == 0)
if (!newname)
newname = randomname
if (newname)
if (newname == "Unknown")
else
if (newname == "Unknown" || newname == "floor" || newname == "wall" || newname == "rwall" || newname == "_")
M << "That name is reserved."
return nukelastname(M)
if (length(newname) >= 26)
newname = copytext(newname, 1, 26)
newname = dd_replacetext(newname, ">", "'")
return newname

View File

@@ -334,7 +334,7 @@ datum/objective/steal
var/tmp_obj = new custom_target
var/custom_name = tmp_obj:name
del(tmp_obj)
custom_name = input("Enter target name:", "Objective target", custom_name) as text|null
custom_name = copytext(sanitize(input("Enter target name:", "Objective target", custom_name) as text|null),1,MAX_MESSAGE_LEN)
if (!custom_name) return
target_name = custom_name
steal_target = custom_target
@@ -343,7 +343,6 @@ datum/objective/steal
set_target(new_target)
return steal_target
check_completion()
if(!steal_target || !owner.current) return 0
if(!isliving(owner.current)) return 0

View File

@@ -72,15 +72,11 @@
var/wizard_name_second = pick(wizard_second)
var/randomname = "[wizard_name_first] [wizard_name_second]"
spawn(0)
var/newname = input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text
var/newname = copytext(sanitize(input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
if (length(newname) == 0)
if (!newname)
newname = randomname
if (newname)
if (length(newname) >= 26)
newname = copytext(newname, 1, 26)
newname = dd_replacetext(newname, ">", "'")
wizard_mob.real_name = newname
wizard_mob.name = newname
return

View File

@@ -35,19 +35,19 @@
#define ui_monkey_back "6:14,1:5" //monkey
//Lower right, persistant menu
#define ui_dropbutton "13:26,1:5"
#define ui_throw "13:26,1:5"
#define ui_pull "13:26,2:7"
#define ui_acti "12:24,1:5"
#define ui_dropbutton "11:22,1:5"
#define ui_throw "11:22,1:5"
#define ui_pull "12:24,1:5"
#define ui_movi "12:24,1:5"
#define ui_movi "13:26,2:7"
#define ui_acti "13:26,1:5"
#define ui_zonesel "14:28,1:5"
//Gun buttons
#define ui_gun1 "11:22,2:7"
#define ui_gun2 "10:20,2:7"
#define ui_gun3 "9:18,2:7"
#define ui_gun_select "11:22,1:5"
#define ui_gun1 "13:26,2:5"
#define ui_gun2 "12:24,2:5"
#define ui_gun3 "11:22,2:5"
#define ui_gun_select "14:28,2:5"
//Middle right (damage indicators)
#define ui_pressure "14:28,6:13"
@@ -67,12 +67,15 @@
#define ui_health "14:28,7:15"
#define ui_internal "14:28,8:17"
//For non-human compatibility
//borgs
#define ui_borg_health "14:28,6:13" //borgs have the health display where humans have the pressure damage indicator.
#define ui_alien_health "14:28,6:13" //aliens have the health display where humans have the pressure damage indicator.
#define ui_throw_old "13:26,2:7"
#define ui_movi_old "12:24,2:7"
#define ui_pull_old "14:28,2:7"
#define ui_dropbutton_old "12:24,1:5"
#define ui_pull_borg "12:24,1:5"
//Pop-up inventory
#define ui_shoes "2:8,1:5"
@@ -92,10 +95,10 @@
//Intent small buttons
#define ui_help_small "12:16,1:-3"
#define ui_disarm_small "12:16,1:12"
#define ui_grab_small "12:32,1:12"
#define ui_harm_small "12:32,1:-3"
#define ui_help_small "13:18,1:-3"
#define ui_disarm_small "13:18,1:12"
#define ui_grab_small "13:34,1:12"
#define ui_harm_small "13:34,1:-3"

View File

@@ -21,15 +21,11 @@
H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes)
spawn(0)
var/religion_name = "Christianity"
var/new_religion = input(H, "You are the Chaplain / Counselor. For game mechanics purposes, you need to choose a religion either way. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name)
var/new_religion = copytext(sanitize(input(H, "You are the Chaplain / Counselor. For game mechanics purposes, you need to choose a religion either way. Would you like to change your religion? Default is Christianity, in SPACE.", "Name change", religion_name)),1,MAX_NAME_LEN)
if ((length(new_religion) == 0) || (new_religion == "Christianity"))
new_religion = religion_name
if (new_religion)
if (length(new_religion) >= 26)
new_religion = copytext(new_religion, 1, 26)
new_religion = dd_replacetext(new_religion, ">", "'")
switch(lowertext(new_religion))
if("christianity")
B.name = pick("The Holy Bible","The Dead Sea Scrolls")
@@ -53,15 +49,10 @@
spawn(1)
var/deity_name = "Space Jesus"
var/new_deity = input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name)
var/new_deity = copytext(sanitize(input(H, "Would you like to change your deity? Default is Space Jesus.", "Name change", deity_name)),1,MAX_NAME_LEN)
if ((length(new_deity) == 0) || (new_deity == "Space Jesus") )
new_deity = deity_name
if(new_deity)
if (length(new_deity) >= 26)
new_deity = copytext(new_deity, 1, 26)
new_deity = dd_replacetext(new_deity, ">", "'")
B.deity_name = new_deity
var/accepted = 0

View File

@@ -52,6 +52,12 @@
if(H.mind.role_alt_title && H.mind.role_alt_title == "Virologist")
H.equip_if_possible(new /obj/item/clothing/under/rank/virologist(H), H.slot_w_uniform)
H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat/virologist(H), H.slot_wear_suit)
else if(H.mind.role_alt_title && H.mind.role_alt_title == "Emergency Physician")
H.equip_if_possible(new /obj/item/clothing/under/rank/medical(H), H.slot_w_uniform)
H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat/fr_jacket(H), H.slot_wear_suit)
else if(H.mind.role_alt_title && H.mind.role_alt_title == "Surgeon")
H.equip_if_possible(new /obj/item/clothing/under/rank/medical/blue(H), H.slot_w_uniform)
H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat(H), H.slot_wear_suit)
else
H.equip_if_possible(new /obj/item/clothing/under/rank/medical(H), H.slot_w_uniform)
H.equip_if_possible(new /obj/item/clothing/suit/storage/labcoat(H), H.slot_wear_suit)

View File

@@ -377,7 +377,7 @@
if("setid")
refresh=0
var/new_id = input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null
var/new_id = copytext(sanitize(input("Enter new bot ID", "Mulebot [suffix ? "([suffix])" : ""]", suffix) as text|null),1,MAX_NAME_LEN)
refresh=1
if(new_id)
suffix = new_id

View File

@@ -52,6 +52,7 @@
dat += "<A href='?src=\ref[src];AIoverride=1'>(<font color=red>Disable Safety Protocols?</font>)</A><BR>"
dat += "<BR>"
dat += "Safety Protocols are <font color=green> ENABLED </font><BR>"
user << browse(dat, "window=computer;size=400x500")
onclose(user, "computer")
@@ -119,6 +120,8 @@
/obj/machinery/computer/HolodeckControl/attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
//Warning, uncommenting this can have concequences. For example, deconstructing the computer may cause holographic eswords to never derez
/* if(istype(D, /obj/item/weapon/screwdriver))
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
if(do_after(user, 20))
@@ -166,6 +169,30 @@
// if(target)
// loadProgram(target)
//This could all be done better, but it works for now.
/obj/machinery/computer/HolodeckControl/Del()
emergencyShutdown()
..()
/obj/machinery/computer/HolodeckControl/meteorhit(var/obj/O as obj)
emergencyShutdown()
..()
/obj/machinery/computer/HolodeckControl/emp_act(severity)
emergencyShutdown()
..()
/obj/machinery/computer/HolodeckControl/ex_act(severity)
emergencyShutdown()
..()
/obj/machinery/computer/HolodeckControl/blob_act()
emergencyShutdown()
..()
/obj/machinery/computer/HolodeckControl/process()
@@ -282,7 +309,18 @@
T.hotspot_expose(50000,50000,1)
/obj/machinery/computer/HolodeckControl/proc/emergencyShutdown()
//Get rid of any items
for(var/item in holographic_items)
derez(item)
//Turn it back to the regular non-holographic room
target = locate(/area/holodeck/source_plating)
if(target)
loadProgram(target)
var/area/targetsource = locate(/area/holodeck/source_plating)
targetsource.copy_contents_to(linkedholodeck , 1)
active = 0

View File

@@ -98,7 +98,7 @@
if("announce")
if(src.authenticated==2)
if(message_cooldown) return
var/input = input(usr, "Please choose a message to announce to the station crew.", "What?", "")
var/input = copytext(sanitize(input(usr, "Please choose a message to announce to the station crew.", "What?", "")),1,MAX_MESSAGE_LEN)
if(!input || !(usr in view(1,src)))
return
captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain
@@ -187,7 +187,7 @@
if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by."
return
var/input = input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")
var/input = copytext(sanitize(input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")),1,MAX_MESSAGE_LEN)
if(!input || !(usr in view(1,src)))
return
Centcomm_announce(input, usr)
@@ -204,7 +204,7 @@
if(centcomm_message_cooldown)
usr << "Arrays recycling. Please stand by."
return
var/input = input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")
var/input = copytext(sanitize(input(usr, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")),1,MAX_MESSAGE_LEN)
if(!input || !(usr in view(1,src)))
return
Syndicate_announce(input, usr)

View File

@@ -1,4 +1,14 @@
/obj/machinery/computer/crew
name = "Crew monitoring computer"
desc = "Used to monitor active health sensors built into most of the crew's uniforms."
icon_state = "crew"
use_power = 1
idle_power_usage = 250
active_power_usage = 500
circuit = "/obj/item/weapon/circuitboard/crew"
var/list/tracked = list( )
New()
tracked = list()
..()
@@ -58,33 +68,31 @@
t += "<BR><A href='?src=\ref[src];close=1'>Close</A>"
t += "<table><tr><td>Name</td><td>Vitals</td><td>Position</td></tr>"
for(var/obj/item/clothing/under/C in src.tracked)
if((C) && (C.has_sensor) && (C.loc) && (C.loc.z == 1))
if((C) && (C.has_sensor) && (C.loc) && (C.loc.z == 1) && C.sensor_mode)
if(istype(C.loc, /mob/living/carbon/human))
var/mob/living/carbon/human/H = C.loc
var/dam1 = round(H.getOxyLoss(),1)
var/dam2 = round(H.getToxLoss(),1)
var/dam3 = round(H.getFireLoss(),1)
var/dam4 = round(H.getBruteLoss(),1)
if(H.wear_id)
t += "<tr><td>[H.wear_id.name]</td>"
else
t += "<tr><td>Unknown:</td>"
switch(C.sensor_mode)
if(1)
if(H.wear_id)
t += "<tr><td>[H.wear_id.name]</td><td>"
else
t += "<tr><td>Unknown:</td><td>"
t+= "[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"]</td><td>Not Available</td></tr>"
t+= "<td>[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"]</td><td>Not Available</td></tr>"
if(2)
if(H.wear_id)
t += "<tr><td>[H.wear_id.name]</td><td>"
else
t += "<tr><td>Unknown:</td><td>"
t += "[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"], [dam1] - [dam2] - [dam3] - [dam4]</td><td>Not Available</td></tr>"
t += "<td>[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"], [dam1] - [dam2] - [dam3] - [dam4]</td><td>Not Available</td></tr>"
if(3)
t += "<tr><td>[H.name]</td><td>[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"], [dam2] - [dam2] - [dam3] - [dam4]</td><td>[get_area(H)] ([H.x], [H.y])</td></tr>"
t += "<td>[H.stat > 1 ? "<font color=red>Deceased</font>" : "Living"], [dam2] - [dam2] - [dam3] - [dam4]</td><td>[get_area(H)] ([H.x], [H.y])</td></tr>"
t += "</table>"
t += "</FONT></PRE></TT>"
user << browse(t, "window=crewcomp;size=500x800")
user << browse(t, "window=crewcomp;size=900x600")
onclose(user, "crewcomp")
scan()
for(var/obj/item/clothing/under/C in world)
if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human)))

View File

@@ -293,7 +293,7 @@
switch(href_list["field"])
if("fingerprint")
if (istype(src.active1, /datum/data/record))
var/t1 = input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text
var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Med. records", src.active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["fingerprint"] = t1
@@ -305,61 +305,61 @@
src.active1.fields["sex"] = "Male"
if("age")
if (istype(src.active1, /datum/data/record))
var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as text
var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as num
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["age"] = t1
if("mi_dis")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text
var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["mi_dis"] = t1
if("mi_dis_d")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message
var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["mi_dis_d"] = t1
if("ma_dis")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text
var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["ma_dis"] = t1
if("ma_dis_d")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message
var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["ma_dis_d"] = t1
if("alg")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text
var/t1 = copytext(sanitize(input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["alg"] = t1
if("alg_d")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message
var/t1 = copytext(sanitize(input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["alg_d"] = t1
if("cdi")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text
var/t1 = copytext(sanitize(input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["cdi"] = t1
if("cdi_d")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message
var/t1 = copytext(sanitize(input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["cdi_d"] = t1
if("notes")
if (istype(src.active2, /datum/data/record))
var/t1 = input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null) as message
var/t1 = copytext(sanitize(input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
src.active2.fields["notes"] = t1
@@ -374,7 +374,7 @@
src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;b_type=an'>A-</A> <A href='?src=\ref[];temp=1;b_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=bn'>B-</A> <A href='?src=\ref[];temp=1;b_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;b_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=on'>O-</A> <A href='?src=\ref[];temp=1;b_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src)
if("b_dna")
if (istype(src.active1, /datum/data/record))
var/t1 = input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text
var/t1 = copytext(sanitize(input("Please input DNA hash:", "Med. records", src.active1.fields["dna"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active1 != a1))
return
src.active1.fields["dna"] = t1
@@ -475,7 +475,7 @@
if (!( istype(src.active2, /datum/data/record) ))
return
var/a2 = src.active2
var/t1 = input("Add Comment:", "Med. records", null, null) as message
var/t1 = copytext(sanitize(input("Add Comment:", "Med. records", null, null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || src.active2 != a2))
return
var/counter = 1

View File

@@ -94,7 +94,8 @@
usr << "Unauthorized Access."
else if(href_list["warn"])
var/warning = input(usr,"Message:","Enter your message here!","")
var/warning = copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN)
if(!warning) return
var/obj/item/weapon/implant/I = locate(href_list["warn"])
if((I)&&(I.imp_in))
var/mob/living/carbon/R = I.imp_in

View File

@@ -348,7 +348,7 @@ What a mess.*/
if (!( istype(active2, /datum/data/record) ))
return
var/a2 = active2
var/t1 = input("Add Comment:", "Secure. records", null, null) as message
var/t1 = copytext(sanitize(input("Add Comment:", "Secure. records", null, null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
var/counter = 1
@@ -415,13 +415,13 @@ What a mess.*/
active1.fields["name"] = t1
if("id")
if (istype(active2, /datum/data/record))
var/t1 = input("Please input id:", "Secure. records", active1.fields["id"], null) as text
var/t1 = copytext(sanitize(input("Please input id:", "Secure. records", active1.fields["id"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["id"] = t1
if("fingerprint")
if (istype(active1, /datum/data/record))
var/t1 = input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text
var/t1 = copytext(sanitize(input("Please input fingerprint hash:", "Secure. records", active1.fields["fingerprint"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["fingerprint"] = t1
@@ -433,37 +433,37 @@ What a mess.*/
active1.fields["sex"] = "Male"
if("age")
if (istype(active1, /datum/data/record))
var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as text
var/t1 = input("Please input age:", "Secure. records", active1.fields["age"], null) as num
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["age"] = t1
if("mi_crim")
if (istype(active2, /datum/data/record))
var/t1 = input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text
var/t1 = copytext(sanitize(input("Please input minor disabilities list:", "Secure. records", active2.fields["mi_crim"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["mi_crim"] = t1
if("mi_crim_d")
if (istype(active2, /datum/data/record))
var/t1 = input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message
var/t1 = copytext(sanitize(input("Please summarize minor dis.:", "Secure. records", active2.fields["mi_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["mi_crim_d"] = t1
if("ma_crim")
if (istype(active2, /datum/data/record))
var/t1 = input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text
var/t1 = copytext(sanitize(input("Please input major diabilities list:", "Secure. records", active2.fields["ma_crim"], null) as text),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["ma_crim"] = t1
if("ma_crim_d")
if (istype(active2, /datum/data/record))
var/t1 = input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message
var/t1 = copytext(sanitize(input("Please summarize major dis.:", "Secure. records", active2.fields["ma_crim_d"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["ma_crim_d"] = t1
if("notes")
if (istype(active2, /datum/data/record))
var/t1 = input("Please summarize notes:", "Secure. records", active2.fields["notes"], null) as message
var/t1 = copytext(sanitize(input("Please summarize notes:", "Secure. records", active2.fields["notes"], null) as message),1,MAX_MESSAGE_LEN)
if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active2 != a2))
return
active2.fields["notes"] = t1

View File

@@ -343,33 +343,6 @@
var/turf/simulated/east = get_step(source,EAST)
var/turf/simulated/west = get_step(source,WEST)
if(need_rebuild)
if(istype(source)) //Rebuild/update nearby group geometry
if(source.parent)
air_master.groups_to_rebuild += source.parent
else
air_master.tiles_to_update += source
if(istype(north))
if(north.parent)
air_master.groups_to_rebuild += north.parent
else
air_master.tiles_to_update += north
if(istype(south))
if(south.parent)
air_master.groups_to_rebuild += south.parent
else
air_master.tiles_to_update += south
if(istype(east))
if(east.parent)
air_master.groups_to_rebuild += east.parent
else
air_master.tiles_to_update += east
if(istype(west))
if(west.parent)
air_master.groups_to_rebuild += west.parent
else
air_master.tiles_to_update += west
else
if(istype(source)) air_master.tiles_to_update += source
if(istype(north)) air_master.tiles_to_update += north
if(istype(south)) air_master.tiles_to_update += south

View File

@@ -110,18 +110,6 @@
var/turf/simulated/source = loc
var/turf/simulated/destination = get_step(source,dir)
if(need_rebuild)
if(istype(source)) //Rebuild/update nearby group geometry
if(source.parent)
air_master.groups_to_rebuild += source.parent
else
air_master.tiles_to_update += source
if(istype(destination))
if(destination.parent)
air_master.groups_to_rebuild += destination.parent
else
air_master.tiles_to_update += destination
else
if(istype(source)) air_master.tiles_to_update += source
if(istype(destination)) air_master.tiles_to_update += destination
return 1

View File

@@ -15,18 +15,6 @@
var/turf/simulated/source = loc
var/turf/simulated/target = get_step(source,dir)
if(need_rebuild)
if(istype(source)) //Rebuild/update nearby group geometry
if(source.parent)
air_master.groups_to_rebuild += source.parent
else
air_master.tiles_to_update += source
if(istype(target))
if(target.parent)
air_master.groups_to_rebuild += target.parent
else
air_master.tiles_to_update += target
else
if(istype(source)) air_master.tiles_to_update += source
if(istype(target)) air_master.tiles_to_update += target

View File

@@ -323,7 +323,7 @@
if(speed <= 0)
speed = 1
if("setpath")
var/newpath = input(usr, "Please define a new path!",,path) as text|null
var/newpath = copytext(sanitize(input(usr, "Please define a new path!",,path) as text|null),1,MAX_MESSAGE_LEN)
if(newpath && newpath != "")
moving = 0 // stop moving
path = newpath

View File

@@ -123,7 +123,7 @@
return
/obj/structure/m_tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if ((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src)))
if ((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src) || user.contents.Find(O)))
return
if (!ismob(O) && !istype(O, /obj/structure/closet/body_bag))
return
@@ -316,7 +316,9 @@
return
/obj/structure/c_tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if ((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src) || istype(user, /mob/dead)))
if ((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src) || user.contents.Find(O)))
return
if (!ismob(O) && !istype(O, /obj/structure/closet/body_bag))
return
O.loc = src.loc
if (user != O)

View File

@@ -193,7 +193,7 @@ Transponder Codes:<UL>"}
updateDialog()
else if(href_list["locedit"])
var/newloc = input("Enter New Location", "Navigation Beacon", location) as text|null
var/newloc = copytext(sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null),1,MAX_MESSAGE_LEN)
if(newloc)
location = newloc
updateDialog()

View File

@@ -203,7 +203,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if(reject_bad_text(href_list["write"]))
dpt = ckey(href_list["write"]) //write contains the string of the receiving department's name
var/new_message = reject_bad_text(input(usr, "Write your message:", "Awaiting Input", ""))
var/new_message = copytext(reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")),1,MAX_MESSAGE_LEN)
if(new_message)
message = new_message
screen = 9
@@ -218,7 +218,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
priority = -1
if(href_list["writeAnnouncement"])
var/new_message = reject_bad_text(input(usr, "Write your message:", "Awaiting Input", ""))
var/new_message = copytext(reject_bad_text(input(usr, "Write your message:", "Awaiting Input", "")),1,MAX_MESSAGE_LEN)
if(new_message)
message = new_message
switch(href_list["priority"])

View File

@@ -408,33 +408,6 @@
var/turf/simulated/east = get_step(source,EAST)
var/turf/simulated/west = get_step(source,WEST)
if(need_rebuild)
if(istype(source)) //Rebuild/update nearby group geometry
if(source.parent)
air_master.groups_to_rebuild += source.parent
else
air_master.tiles_to_update += source
if(istype(north))
if(north.parent)
air_master.groups_to_rebuild += north.parent
else
air_master.tiles_to_update += north
if(istype(south))
if(south.parent)
air_master.groups_to_rebuild += south.parent
else
air_master.tiles_to_update += south
if(istype(east))
if(east.parent)
air_master.groups_to_rebuild += east.parent
else
air_master.tiles_to_update += east
if(istype(west))
if(west.parent)
air_master.groups_to_rebuild += west.parent
else
air_master.tiles_to_update += west
else
if(istype(source)) air_master.tiles_to_update += source
if(istype(north)) air_master.tiles_to_update += north
if(istype(south)) air_master.tiles_to_update += south

View File

@@ -176,7 +176,7 @@
switch(href_list["input"])
if("id")
var/newid = input(usr, "Specify the new ID for this machine", src, id) as null|text
var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN)
if(newid && usr in range(1, src))
id = newid
temp = "<font color = #666633>-% New ID assigned: \"[id]\" %-</font color>"

View File

@@ -534,7 +534,7 @@ var/list/sacrificed = list()
/////////////////////////////////////////FOURTEETH RUNE
communicate()
var/input = input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "") as text|null
var/input = copytext(sanitize(input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "") as text|null),1,MAX_MESSAGE_LEN)
if(!input)
if (istype(src))
return fizzle()

View File

@@ -123,7 +123,7 @@
user.drop_item()
O.loc = src
else if(istype(O, /obj/item/weapon/pen))
var/newname = input("What would you like to title this bookshelf?") as text|null
var/newname = copytext(sanitize(input("What would you like to title this bookshelf?") as text|null),1,MAX_MESSAGE_LEN)
if(!newname)
return
else
@@ -306,12 +306,9 @@
var/choice = input("What would you like to change?") in list("Title", "Contents", "Author", "Cancel")
switch(choice)
if("Title")
var/ntitle = input("Write a new title:") as text|null
var/ntitle = copytext(sanitize(input("Write a new title:") as text|null),1,MAX_MESSAGE_LEN)
if(!ntitle)
return
else
title = sanitize(ntitle)
name = "Book: [title]"
if("Contents")
var/t = "[src.dat]"
do
@@ -337,7 +334,7 @@
src.dat = t
gen_pages()
if("Author")
var/nauthor = input("Write the author's name:") as text|null
var/nauthor = copytext(sanitize(input("Write the author's name:") as text|null),1,MAX_NAME_LEN)
if(!nauthor)
return
else
@@ -780,9 +777,9 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
if(checkoutperiod < 1)
checkoutperiod = 1
if(href_list["editbook"])
buffer_book = input("Enter the book's title:") as text|null
buffer_book = copytext(sanitize(input("Enter the book's title:") as text|null),1,MAX_MESSAGE_LEN)
if(href_list["editmob"])
buffer_mob = input("Enter the recipient's name:") as text|null
buffer_mob = copytext(sanitize(input("Enter the recipient's name:") as text|null),1,MAX_NAME_LEN)
if(href_list["checkout"])
var/datum/borrowbook/b = new /datum/borrowbook
b.bookname = sanitize(buffer_book)
@@ -802,9 +799,9 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
scanner.cache.title = sanitize(newtitle)
scanner.cache.name = "Book: [scanner.cache.title]"
if(href_list["setauthor"])
var/newauthor = input("Enter the author's name: ", "Book Upload", scanner.cache.author) as text|null
var/newauthor = copytext(sanitize(input("Enter the author's name: ", "Book Upload", scanner.cache.author) as text|null),1,MAX_MESSAGE_LEN)
if(newauthor)
scanner.cache.author = sanitize(newauthor)
scanner.cache.author = newauthor
if(href_list["setcategory"])
var/newcategory = input("Choose a category: ") in list("Fiction", "Non-Fiction", "Adult", "Reference", "Religion")
if(newcategory)

View File

@@ -8,7 +8,7 @@
new /obj/item/device/flashlight(src)
new /obj/item/weapon/tank/oxygen/red(src)
new /obj/item/weapon/extinguisher(src)
new /obj/item/clothing/head/helmet/hardhat/red(src)
new /obj/item/clothing/head/helmet/space/fire_helmet(src)
/obj/structure/closet/firecloset/New()
..()
@@ -17,7 +17,7 @@
new /obj/item/clothing/mask/gas(src)
new /obj/item/weapon/tank/oxygen/red(src)
new /obj/item/weapon/extinguisher(src)
new /obj/item/clothing/head/helmet/hardhat/red(src)
new /obj/item/clothing/head/helmet/space/fire_helmet(src)
/*switch (pickweight(list("nothing" = 5, "bare-bones" = 35, "basic" = 40, "pickpocketed" = 10, "untouched" = 10)))
if ("nothing")

View File

@@ -90,7 +90,7 @@
else
radio.wires |= t1
if(href_list["setlaws"])
var/newlaws = input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message
var/newlaws = copytext(sanitize(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message),1,MAX_MESSAGE_LEN)
if(newlaws)
pai.pai_laws = newlaws
pai << "Your supplemental directives have been updated. Your new directives are:"

View File

@@ -1050,33 +1050,6 @@ steam.start() -- spawns the effect
var/turf/simulated/east = get_step(source,EAST)
var/turf/simulated/west = get_step(source,WEST)
if(need_rebuild)
if(istype(source)) //Rebuild/update nearby group geometry
if(source.parent)
air_master.groups_to_rebuild += source.parent
else
air_master.tiles_to_update += source
if(istype(north))
if(north.parent)
air_master.groups_to_rebuild += north.parent
else
air_master.tiles_to_update += north
if(istype(south))
if(south.parent)
air_master.groups_to_rebuild += south.parent
else
air_master.tiles_to_update += south
if(istype(east))
if(east.parent)
air_master.groups_to_rebuild += east.parent
else
air_master.tiles_to_update += east
if(istype(west))
if(west.parent)
air_master.groups_to_rebuild += west.parent
else
air_master.tiles_to_update += west
else
if(istype(source)) air_master.tiles_to_update += source
if(istype(north)) air_master.tiles_to_update += north
if(istype(south)) air_master.tiles_to_update += south

View File

@@ -398,10 +398,16 @@ THERMAL GLASSES
usr << "You unbutton the labcoat."
else if(src.icon_state == "fr_jacket_open")
src.icon_state = "fr_jacket"
usr << "You button up the labcoat."
usr << "You button up the jacket."
else if(src.icon_state == "fr_jacket")
src.icon_state = "fr_jacket_open"
usr << "You unbutton the labcoat."
usr << "You unbutton the jacket."
else if(src.icon_state == "fr_sleeve_open")
src.icon_state = "fr_sleeve"
usr << "You button up the jacket."
else if(src.icon_state == "fr_sleeve")
src.icon_state = "fr_sleeve_open"
usr << "You unbutton the jacket."
else
usr << "Sorry! The suit you're wearing doesn't have buttons!"
usr.update_clothing()

View File

@@ -220,7 +220,7 @@
if (istype(W, /obj/item/weapon/pen))
var/t = input(user, "Enter new robot name", src.name, src.created_name) as text
t = copytext(sanitize(t), 1, MAX_MESSAGE_LEN)
t = copytext(sanitize(t), 1, MAX_NAME_LEN)
if (!t)
return
if (!in_range(src, usr) && src.loc != usr)

View File

@@ -91,8 +91,8 @@ AI MODULES
/obj/item/weapon/aiModule/safeguard/attack_self(var/mob/user as mob)
..()
var/targName = input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)
targetName = sanitize(targName)
var/targName = copytext(sanitize(input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)),1,MAX_MESSAGE_LEN)
targetName = targName
desc = text("A 'safeguard' AI module: 'Safeguard []. Individuals that threaten [] are not crew and are a threat to crew.'", targetName, targetName)
/obj/item/weapon/aiModule/safeguard/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -114,8 +114,8 @@ AI MODULES
/obj/item/weapon/aiModule/oneHuman/attack_self(var/mob/user as mob)
..()
var/targName = input(usr, "Please enter the name of the person who is the only crewmember.", "Who?", user.real_name)
targetName = sanitize(targName)
var/targName = copytext(sanitize(input(usr, "Please enter the name of the person who is the only human.", "Who?", user.real_name)),1,MAX_MESSAGE_LEN)
targetName = targName
desc = text("A 'one crewmember' AI module: 'Only [] is crewmember.'", targetName)
/obj/item/weapon/aiModule/oneHuman/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -247,8 +247,8 @@ AI MODULES
lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num
lawpos = min(lawpos, 50)
var/newlaw = ""
var/targName = input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)
newFreeFormLaw = sanitize(targName)
var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
newFreeFormLaw = targName
desc = "A 'freeform' AI module: ([lawpos]) '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/freeform/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -390,8 +390,8 @@ AI MODULES
/obj/item/weapon/aiModule/freeformcore/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
var/targName = input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)
newFreeFormLaw = sanitize(targName)
var/targName = copytext(sanitize(input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
newFreeFormLaw = targName
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/freeformcore/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -411,8 +411,8 @@ AI MODULES
/obj/item/weapon/aiModule/syndicate/attack_self(var/mob/user as mob)
..()
var/newlaw = ""
var/targName = input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)
newFreeFormLaw = sanitize(targName)
var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
newFreeFormLaw = targName
desc = "A hacked AI law module: '[newFreeFormLaw]'"
/obj/item/weapon/aiModule/syndicate/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)

View File

@@ -1,5 +1,7 @@
/obj/item/weapon/plastique/attack_self(mob/user as mob)
var/newtime = input(usr, "Please set the timer.", "Timer", 10)
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
if(newtime < 1)
newtime = 10
timer = newtime
user << "Timer set for [timer] seconds."

View File

@@ -236,8 +236,10 @@
/obj/item/weapon/flamethrower/proc/ignite_turf(turf/target)
//TODO: DEFERRED Consider checking to make sure tank pressure is high enough before doing this...
//Transfer 5% of current tank air contents to turf
var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(0.05*throw_amount/100)
air_transfer.toxins = air_transfer.toxins * 5 // This is me not comprehending the air system. I realize this is retarded and I could probably make it work without fucking it up like this, but there you have it. -- TLE
var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(0.02*(throw_amount/100))
//air_transfer.toxins = air_transfer.toxins * 5 // This is me not comprehending the air system. I realize this is retarded and I could probably make it work without fucking it up like this, but there you have it. -- TLE
new/obj/liquid_fuel/flamethrower_fuel(target,air_transfer.toxins,get_dir(loc,target))
air_transfer.toxins = 0
target.assume_air(air_transfer)
//Burn it based on transfered gas
//target.hotspot_expose(part4.air_contents.temperature*2,300)

View File

@@ -222,8 +222,7 @@ PHOTOGRAPHS
/obj/item/weapon/paper/photograph/attack_self(mob/user as mob)
var/n_name = input(user, "What would you like to label the photo?", "Paper Labelling", null) as text
n_name = copytext(n_name, 1, 32)
var/n_name = copytext(sanitize(input(user, "What would you like to label the photo?", "Paper Labelling", null) as text),1,32)
if ((src.loc == user && user.stat == 0))
src.name = text("photo[]", (n_name ? text("- '[]'", n_name) : null))
src.add_fingerprint(user)

View File

@@ -145,33 +145,6 @@
var/turf/simulated/east = get_step(source,EAST)
var/turf/simulated/west = get_step(source,WEST)
if(need_rebuild)
if(istype(source)) //Rebuild/update nearby group geometry
if(source.parent)
air_master.groups_to_rebuild += source.parent
else
air_master.tiles_to_update += source
if(istype(north))
if(north.parent)
air_master.groups_to_rebuild += north.parent
else
air_master.tiles_to_update += north
if(istype(south))
if(south.parent)
air_master.groups_to_rebuild += south.parent
else
air_master.tiles_to_update += south
if(istype(east))
if(east.parent)
air_master.groups_to_rebuild += east.parent
else
air_master.tiles_to_update += east
if(istype(west))
if(west.parent)
air_master.groups_to_rebuild += west.parent
else
air_master.tiles_to_update += west
else
if(istype(source)) air_master.tiles_to_update += source
if(istype(north)) air_master.tiles_to_update += north
if(istype(south)) air_master.tiles_to_update += south
@@ -225,8 +198,6 @@
proc/TemperatureAct(temperature)
for(var/turf/simulated/floor/target_tile in range(2,loc))
if(target_tile.parent && target_tile.parent.group_processing)
target_tile.parent.suspend_group_processing()
var/datum/gas_mixture/napalm = new

View File

@@ -85,9 +85,12 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
if(!on)
return
var/dat = {"
<html><head><title>[src]</title></head><body><TT>
Microphone: [broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>
var/dat = "<html><head><title>[src]</title></head><body><TT>"
if(!istype(src, /obj/item/device/radio/headset)) //Headsets dont get a mic button
dat += "Microphone: [broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>"
dat += {"
Speaker: [listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>
Frequency:
<A href='byond://?src=\ref[src];freq=-10'>-</A>

View File

@@ -0,0 +1,53 @@
/obj/item/weapon/storage/syndie_kit
name = "Box"
desc = "A sleek, sturdy box"
icon_state = "box_of_doom"
item_state = "syringe_kit"
/obj/item/weapon/storage/syndie_kit/imp_freedom
name = "Freedom Implant (with injector)"
/obj/item/weapon/storage/syndie_kit/imp_freedom/New()
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
O.imp = new /obj/item/weapon/implant/freedom(O)
O.update()
..()
return
/obj/item/weapon/storage/syndie_kit/imp_compress
name = "Compressed Matter Implant (with injector)"
/obj/item/weapon/storage/syndie_kit/imp_compress/New()
new /obj/item/weapon/implanter/compressed(src)
..()
return
/obj/item/weapon/storage/syndie_kit/imp_explosive
name = "Explosive Implant (with injector)"
/obj/item/weapon/storage/syndie_kit/imp_explosive/New()
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
O.imp = new /obj/item/weapon/implant/explosive(O)
O.name = "(BIO-HAZARD) BIO-detpack"
O.update()
..()
return
/obj/item/weapon/storage/syndie_kit/imp_uplink
name = "Uplink Implant (with injector)"
/obj/item/weapon/storage/syndie_kit/imp_uplink/New()
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(src)
O.imp = new /obj/item/weapon/implant/uplink(O)
O.update()
..()
return
/obj/item/weapon/storage/syndie_kit/space
name = "Space Suit and Helmet"
/obj/item/weapon/storage/syndie_kit/space/New()
new /obj/item/clothing/suit/space/syndicate(src)
new /obj/item/clothing/head/helmet/space/syndicate(src)
..()
return

View File

@@ -0,0 +1,461 @@
/*
SYNDICATE UPLINKS
TO-DO:
Once wizard is fixed, make sure the uplinks work correctly for it. wizard.dm is right now uncompiled and with broken code in it.
Clean the code up and comment it. Part of it is right now copy-pasted, with the general Topic() and modifications by Abi79.
I should take a more in-depth look at both the copy-pasted code for the individual uplinks below, and at each gamemode's code
to see how uplinks are assigned and if there are any bugs with those.
A list of items and costs is stored under the datum of every game mode, alongside the number of crystals, and the welcoming message.
*/
/obj/item/device/uplink
var/welcome // Welcoming menu message
var/menu_message = "" // The actual menu text
var/items // List of items
var/list/ItemList // Parsed list of items
var/uses // Numbers of crystals
// List of items not to shove in their hands.
var/list/NotInHand = list(/obj/machinery/singularity_beacon/syndicate)
New()
welcome = ticker.mode.uplink_welcome
items = dd_replacetext(ticker.mode.uplink_items, "\n", "") // Getting the text string of items
ItemList = dd_text2list(src.items, ";") // Parsing the items text string
uses = ticker.mode.uplink_uses
//Let's build a menu!
proc/generate_menu()
src.menu_message = "<B>[src.welcome]</B><BR>"
src.menu_message += "Tele-Crystals left: [src.uses]<BR>"
src.menu_message += "<HR>"
src.menu_message += "<B>Request item:</B><BR>"
src.menu_message += "<I>Each item costs a number of tele-crystals as indicated by the number following their name.</I><br><BR>"
var/cost
var/item
var/name
var/path_obj
var/path_text
var/category_items = 1 //To prevent stupid :P
for(var/D in ItemList)
var/list/O = stringsplit(D, ":")
if(O.len != 3) //If it is not an actual item, make a break in the menu.
if(O.len == 1) //If there is one item, it's probably a title
src.menu_message += "<b>[O[1]]</b><br>"
category_items = 0
else //Else, it's a white space.
if(category_items < 1) //If there were no itens in the last category...
src.menu_message += "<i>We apologize, as you could not afford anything from this category.</i><br>"
src.menu_message += "<br>"
continue
path_text = O[1]
cost = text2num(O[2])
if(cost>uses)
continue
path_obj = text2path(path_text)
item = new path_obj()
name = O[3]
del item
src.menu_message += "<A href='byond://?src=\ref[src];buy_item=[path_text];cost=[cost]'>[name]</A> ([cost])<BR>"
category_items++
// src.menu_message += "<A href='byond://?src=\ref[src];buy_item=random'>Random Item (??)</A><br>"
src.menu_message += "<HR>"
return
Topic(href, href_list)
if (href_list["buy_item"])
/* if(href_list["buy_item"] == "random")
var/list/randomItems = list()
//Sorry for all the ifs, but it makes it 1000 times easier for other people/servers to add or remove items from this list
//Add only items the player can afford:
if(uses > 19)
randomItems.Add("/obj/item/weapon/circuitboard/teleporter") //Teleporter Circuit Board (costs 20, for nuke ops)
if(uses > 9)
randomItems.Add("/obj/item/toy/syndicateballoon")//Syndicate Balloon
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_uplink") //Uplink Implanter
randomItems.Add("/obj/item/weapon/storage/box/syndicate") //Syndicate bundle
//if(uses > 8) //Nothing... yet.
//if(uses > 7) //Nothing... yet.
if(uses > 6)
randomItems.Add("/obj/item/weapon/aiModule/syndicate") //Hacked AI Upload Module
randomItems.Add("/obj/item/device/radio/beacon/syndicate") //Singularity Beacon
if(uses > 5)
randomItems.Add("/obj/item/weapon/gun/projectile") //Revolver
if(uses > 4)
randomItems.Add("/obj/item/weapon/gun/energy/crossbow") //Energy Crossbow
randomItems.Add("/obj/item/device/powersink") //Powersink
if(uses > 3)
randomItems.Add("/obj/item/weapon/melee/energy/sword") //Energy Sword
randomItems.Add("/obj/item/clothing/mask/gas/voice") //Voice Changer
randomItems.Add("/obj/item/device/chameleon") //Chameleon Projector
if(uses > 2)
randomItems.Add("/obj/item/weapon/storage/emp_kit") //EMP Grenades
randomItems.Add("/obj/item/weapon/pen/paralysis") //Paralysis Pen
randomItems.Add("/obj/item/weapon/cartridge/syndicate") //Detomatix Cartridge
randomItems.Add("/obj/item/clothing/under/chameleon") //Chameleon Jumpsuit
randomItems.Add("/obj/item/weapon/card/id/syndicate") //Agent ID Card
randomItems.Add("/obj/item/weapon/card/emag") //Cryptographic Sequencer
randomItems.Add("/obj/item/weapon/storage/syndie_kit/space") //Syndicate Space Suit
randomItems.Add("/obj/item/device/encryptionkey/binary") //Binary Translator Key
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_freedom") //Freedom Implant
randomItems.Add("/obj/item/clothing/glasses/thermal") //Thermal Imaging Goggles
if(uses > 1)
/*
var/list/usrItems = usr.get_contents() //Checks to see if the user has a revolver before giving ammo
var/hasRevolver = 0
for(var/obj/I in usrItems) //Only add revolver ammo if the user has a gun that can shoot it
if(istype(I,/obj/item/weapon/gun/projectile))
hasRevolver = 1
if(hasRevolver) randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
*/
randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
randomItems.Add("/obj/item/clothing/shoes/syndigaloshes") //No-Slip Syndicate Shoes
randomItems.Add("/obj/item/weapon/plastique") //C4
if(uses > 0)
randomItems.Add("/obj/item/weapon/soap/syndie") //Syndicate Soap
randomItems.Add("/obj/item/weapon/storage/toolbox/syndicate") //Syndicate Toolbox
if(!randomItems)
del(randomItems)
return 0
else
href_list["buy_item"] = pick(randomItems)
switch(href_list["buy_item"]) //Ok, this gets a little messy, sorry.
if("/obj/item/weapon/circuitboard/teleporter")
uses -= 20
if("/obj/item/toy/syndicateballoon" , "/obj/item/weapon/storage/syndie_kit/imp_uplink" , "/obj/item/weapon/storage/box/syndicate")
uses -= 10
if("/obj/item/weapon/aiModule/syndicate" , "/obj/item/device/radio/beacon/syndicate")
uses -= 7
if("/obj/item/weapon/gun/projectile")
uses -= 6
if("/obj/item/weapon/gun/energy/crossbow" , "/obj/item/device/powersink")
uses -= 5
if("/obj/item/weapon/melee/energy/sword" , "/obj/item/clothing/mask/gas/voice" , "/obj/item/device/chameleon")
uses -= 4
if("/obj/item/weapon/storage/emp_kit" , "/obj/item/weapon/pen/paralysis" , "/obj/item/weapon/cartridge/syndicate" , "/obj/item/clothing/under/chameleon" , \
"/obj/item/weapon/card/id/syndicate" , "/obj/item/weapon/card/emag" , "/obj/item/weapon/storage/syndie_kit/space" , "/obj/item/device/encryptionkey/binary" , \
"/obj/item/weapon/storage/syndie_kit/imp_freedom" , "/obj/item/clothing/glasses/thermal")
uses -= 3
if("/obj/item/ammo_magazine/a357" , "/obj/item/clothing/shoes/syndigaloshes" , "/obj/item/weapon/plastique")
uses -= 2
if("/obj/item/weapon/soap/syndie" , "/obj/item/weapon/storage/toolbox/syndicate")
uses -= 1
del(randomItems)
return 1
*/
if(text2num(href_list["cost"]) > uses) // Not enough crystals for the item
return 0
//if(usr:mind && ticker.mode.traitors[usr:mind])
//var/datum/traitorinfo/info = ticker.mode.traitors[usr:mind]
//info.spawnlist += href_list["buy_item"]
uses -= text2num(href_list["cost"])
return 1
/*
*PDA uplink
*/
//Syndicate uplink hidden inside a traitor PDA
//Communicate with traitor through the PDA's note function.
/obj/item/device/uplink/pda
name = "uplink module"
desc = "An electronic uplink system of unknown origin."
icon = 'module.dmi'
icon_state = "power_mod"
var/obj/item/device/pda/hostpda = null
var/orignote = null //Restore original notes when locked.
var/active = 0 //Are we currently active?
var/lock_code = "" //The unlocking password.
proc
unlock()
if ((isnull(src.hostpda)) || (src.active))
return
src.orignote = src.hostpda.note
src.active = 1
src.hostpda.mode = 1 //Switch right to the notes program
src.generate_menu()
print_to_host(menu_message)
for (var/mob/M in viewers(1, src.hostpda.loc))
if (M.client && M.machine == src.hostpda)
src.hostpda.attack_self(M)
return
print_to_host(var/text)
if (isnull(hostpda))
return
hostpda.note = text
for (var/mob/M in viewers(1, hostpda.loc))
if (M.client && M.machine == hostpda)
hostpda.attack_self(M)
return
shutdown_uplink()
if (isnull(src.hostpda))
return
active = 0
hostpda.note = orignote
if (hostpda.mode==1)
hostpda.mode = 0
hostpda.updateDialog()
return
attack_self(mob/user as mob)
src.generate_menu()
src.hostpda.note = src.menu_message
Topic(href, href_list)
if ((isnull(src.hostpda)) || (!src.active))
return
if (usr.stat || usr.restrained() || !in_range(src.hostpda, usr))
return
if(..() == 1) // We can afford the item
var/path_obj = text2path(href_list["buy_item"])
var/mob/A = src.hostpda.loc
var/item = new path_obj(get_turf(src.hostpda))
if(ismob(A) && !(locate(item) in NotInHand)) //&& !istype(item, /obj/spawner))
if(!A.r_hand)
item:loc = A
A.r_hand = item
item:layer = 20
else if(!A.l_hand)
item:loc = A
A.l_hand = item
item:layer = 20
else
item:loc = get_turf(A)
usr.update_clothing()
// usr.client.onBought("[item:name]") When we have the stats again, uncomment.
/* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
del item*/
//HEADFINDBACK
src.attack_self(usr)
src.hostpda.attack_self(usr)
return
/*
*Portable radio uplink
*/
//A Syndicate uplink disguised as a portable radio
/obj/item/device/uplink/radio/implanted
New()
..()
uses = 5
return
explode()
var/turf/location = get_turf(src.loc)
if(location)
location.hotspot_expose(700,125)
explosion(location, 0, 0, 2, 4, 1)
var/obj/item/weapon/implant/uplink/U = src.loc
var/mob/living/A = U.imp_in
var/datum/organ/external/head = A:organs["head"]
head.destroyed = 1
spawn(2)
head.droplimb()
del(src.master)
del(src)
return
/obj/item/device/uplink/radio
name = "ship bounced radio"
icon = 'radio.dmi'
icon_state = "radio"
var/temp = null //Temporary storage area for a message offering the option to destroy the radio
var/selfdestruct = 0 //Set to 1 while the radio is self destructing itself.
var/obj/item/device/radio/origradio = null
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
w_class = 2.0
item_state = "radio"
throwforce = 5
throw_speed = 4
throw_range = 20
m_amt = 100
attack_self(mob/user as mob)
var/dat
if (src.selfdestruct)
dat = "Self Destructing..."
else
if (src.temp)
dat = "[src.temp]<BR><BR><A href='byond://?src=\ref[src];clear_selfdestruct=1'>Clear</A>"
else
src.generate_menu()
dat = src.menu_message
if (src.origradio) // Checking because sometimes the radio uplink may be spawned by itself, not as a normal unlockable radio
dat += "<A href='byond://?src=\ref[src];lock=1'>Lock</A><BR>"
dat += "<HR>"
dat += "<A href='byond://?src=\ref[src];selfdestruct=1'>Self-Destruct</A>"
user << browse(dat, "window=radio")
onclose(user, "radio")
return
Topic(href, href_list)
if (usr.stat || usr.restrained())
return
if (!( istype(usr, /mob/living/carbon/human)))
return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || istype(src.loc,/obj/item/weapon/implant/uplink)))
usr.machine = src
if(href_list["buy_item"])
if(..() == 1) // We can afford the item
var/path_obj = text2path(href_list["buy_item"])
var/item = new path_obj(get_turf(src.loc))
var/mob/A = src.loc
if(istype(src.loc,/obj/item/weapon/implant/uplink))
var/obj/item/weapon/implant/uplink/U = src.loc
A = U.imp_in
if(ismob(A) && !(locate(item) in NotInHand)) //&& !istype(item, /obj/spawner))
if(!A.r_hand)
item:loc = A
A.r_hand = item
item:layer = 20
else if(!A.l_hand)
item:loc = A
A.l_hand = item
item:layer = 20
else
item:loc = get_turf(A)
/* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
del item*/
// usr.client.onBought("[item:name]") When we have the stats again, uncomment.
src.attack_self(usr)
return
else if (href_list["lock"] && src.origradio)
// presto chango, a regular radio again! (reset the freq too...)
usr.machine = null
usr << browse(null, "window=radio")
var/obj/item/device/radio/T = src.origradio
var/obj/item/device/uplink/radio/R = src
R.loc = T
T.loc = usr
// R.layer = initial(R.layer)
R.layer = 0
if (usr.client)
usr.client.screen -= R
if (usr.r_hand == R)
usr.u_equip(R)
usr.r_hand = T
else
usr.u_equip(R)
usr.l_hand = T
R.loc = T
T.layer = 20
T.set_frequency(initial(T.frequency))
T.attack_self(usr)
return
else if (href_list["selfdestruct"])
src.temp = "<A href='byond://?src=\ref[src];selfdestruct2=1'>Self-Destruct</A>"
else if (href_list["selfdestruct2"])
src.selfdestruct = 1
spawn (100)
explode()
return
else if (href_list["clear_selfdestruct"])
src.temp = null
attack_self(usr)
// if (istype(src.loc, /mob))
// attack_self(src.loc)
// else
// for(var/mob/M in viewers(1, src))
// if (M.client)
// src.attack_self(M)
return
proc/explode()
var/turf/location = get_turf(src.loc)
if(location)
location.hotspot_expose(700,125)
explosion(location, 0, 0, 2, 4, 1)
del(src.master)
del(src)
return
proc/shutdown_uplink()
if (!src.origradio)
return
var/list/nearby = viewers(1, src)
for(var/mob/M in nearby)
if (M.client && M.machine == src)
M << browse(null, "window=radio")
M.machine = null
var/obj/item/device/radio/T = src.origradio
var/obj/item/device/uplink/radio/R = src
var/mob/L = src.loc
R.loc = T
T.loc = L
// R.layer = initial(R.layer)
R.layer = 0
if (istype(L))
if (L.client)
L.client.screen -= R
if (L.r_hand == R)
L.u_equip(R)
L.r_hand = T
else
L.u_equip(R)
L.l_hand = T
T.layer = 20
T.set_frequency(initial(T.frequency))
return

View File

@@ -30,8 +30,6 @@
for (var/turf/simulated/floor/target in range(1,src))
if(!target.blocks_air)
if(target.parent)
target.parent.suspend_group_processing()
var/datum/gas_mixture/payload = new
var/datum/gas/sleeping_agent/trace_gas = new
@@ -48,8 +46,6 @@
/obj/effect/mine/proc/triggerplasma(obj)
for (var/turf/simulated/floor/target in range(1,src))
if(!target.blocks_air)
if(target.parent)
target.parent.suspend_group_processing()
var/datum/gas_mixture/payload = new

View File

@@ -346,18 +346,6 @@
var/turf/simulated/source = loc
var/turf/simulated/target = get_step(source,dir)
if(need_rebuild)
if(istype(source)) //Rebuild/update nearby group geometry
if(source.parent)
air_master.groups_to_rebuild += source.parent
else
air_master.tiles_to_update += source
if(istype(target))
if(target.parent)
air_master.groups_to_rebuild += target.parent
else
air_master.tiles_to_update += target
else
if(istype(source)) air_master.tiles_to_update += source
if(istype(target)) air_master.tiles_to_update += target

View File

@@ -27,7 +27,7 @@ client/verb/JoinResponseTeam()
new_commando.mind.key = usr.key
new_commando.key = usr.key
new_commando << "\blue You are [!leader_selected?"a member":"the <B>LEADER</B>"] of an armed response team in CentComm's service. Something went down on [station_name()] and they're now on code red. Go in there and fix the problem."
new_commando << "\blue You are [!leader_selected?"a member":"the <B>LEADER</B>"] of an Emergency Response Team under CentComm's service. There is a code red alert on [station_name()], you are tasked to go and fix the problem."
new_commando << "<b>You should first gear up and discuss a plan with your team. More members may be joining, don't move out before you're ready."
del(L)
@@ -81,7 +81,7 @@ proc/trigger_armed_response_team(var/force = 0)
if(!nuke)
nuke = locate() in world
var/obj/item/weapon/paper/P = new
P.info = "Your orders, Commander, are to use all necessary tools given to return the station to a survivable condition. <br> To this end, you have been provided with the best tools we can give in the three areas of Medical Engineering and Security. The nuclear authorization code is: <b>[ nuke ? nuke.r_code : "AHH, THE NUKE IS GONE!"]</b>. Be warned, if you detonate this without good reason, we will hold you to account for damages. Memorise this code, and then burn this message."
P.info = "Your orders, Commander, are to use all means necessary to return the station to a survivable condition.<br>To this end, you have been provided with the best tools we can give in the three areas of Medicine, Engineering, and Security. The nuclear authorization code is: <b>[ nuke ? nuke.r_code : "AHH, THE NUKE IS GONE!"]</b>. Be warned, if you detonate this without good reason, we will hold you to account for damages. Memorise this code, and then burn this message."
P.name = "Emergency Nuclear Code, and ERT Orders"
for (var/obj/effect/landmark/A in world)
if (A.name == "nukecode")

View File

@@ -373,7 +373,9 @@ This method wont take into account storage items developed in the future and doe
var/obj/item/weapon/paper/reqform = new /obj/item/weapon/paper(src.loc)
var/idname = "Unknown"
var/idrank = "Unknown"
var/reason = input(usr,"Reason:","Why do you require this item?","")
var/reason = copytext(sanitize(input(usr,"Reason:","Why do you require this item?","")),1,MAX_MESSAGE_LEN)
if(!reason)
reason = "Unknown"
reqform.name = "Requisition Form - [P.name]"
reqform.overlays += "paper_words"
@@ -587,7 +589,7 @@ This method wont take into account storage items developed in the future and doe
supply_shuttle_points -= P.cost
O.object = P
O.orderedby = usr.name
O.comment = input(usr,"Comment:","Enter comment","")
O.comment = copytext(sanitize(input(usr,"Comment:","Enter comment","")),1,MAX_MESSAGE_LEN)
supply_shuttle_shoppinglist += O
src.temp = "Thanks for your order.<BR>"
src.temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
@@ -603,7 +605,7 @@ This method wont take into account storage items developed in the future and doe
supply_shuttle_points -= P.cost
O.object = P
O.orderedby = usr.name
O.comment = input(usr,"Comment:","Enter comment","")
O.comment = copytext(sanitize(input(usr,"Comment:","Enter comment","")),1,MAX_MESSAGE_LEN)
supply_shuttle_shoppinglist += O
src.temp = "Thanks for your order.<BR>"
src.temp += "<BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
@@ -676,7 +678,7 @@ This method wont take into account storage items developed in the future and doe
if (supply_shuttle_moving) return
if (!supply_can_move())
usr << "\red The supply shuttle can not transport station employees or homing beacons."
usr << "\red The supply shuttle can not transport station employees, exosuits, classified nuclear codes, or homing beacons."
return
var/shuttleat = supply_shuttle_at_station ? SUPPLY_STATION_AREATYPE : SUPPLY_DOCK_AREATYPE

View File

@@ -968,11 +968,10 @@ var/global/BSACooldown = 0
if ((src.rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
var/mob/M = locate(href_list["forcespeech"])
if (ismob(M))
var/speech = input("What will [key_name(M)] say?.", "Force speech", "")
var/speech = copytext(sanitize(input("What will [key_name(M)] say?.", "Force speech", "")),1,MAX_MESSAGE_LEN)
if(!speech)
return
M.say(speech)
speech = copytext(sanitize(speech), 1, MAX_MESSAGE_LEN)
log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]")
message_admins("\blue [key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]")
else
@@ -1883,7 +1882,7 @@ var/global/BSACooldown = 0
if(!ticker)
alert("The game hasn't started yet!")
return
var/objective = input("Enter an objective")
var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN)
if(!objective)
return
//feedback_inc("admin_secrets_fun_used",1)

View File

@@ -0,0 +1,54 @@
#define MEMOFILE "data/memo.sav" //where the memos are saved
#define ENABLE_MEMOS 1 //using a define because screw making a config variable for it. This is more efficient and purty.
//switch verb so we don't spam up the verb lists with like, 3 verbs for this feature.
/client/proc/admin_memo(task in list("write","show","delete"))
set name = "Memo"
set category = "Server"
if(!holder) return
switch(task)
if("write")
admin_memo_write()
if("show")
admin_memo_show()
if("delete")
admin_memo_delete()
//write a message
/client/proc/admin_memo_write()
var/savefile/F = new(MEMOFILE)
if(F)
var/memo = input(src,"Type your memo\n(Leaving it blank will delete your current memo):","Write Memo",null) as null|message
switch(memo)
if(null)
return
if("")
F.dir.Remove(ckey)
src << "<b>Memo removed</b>"
return
if( findtext(memo,"<script",1,0) )
return
F[ckey] << "[key] on [time2text(world.realtime,"(DDD) DD MMM hh:mm")]<br>[memo]"
message_admins("[key] set an admin memo:<br>[memo]")
//show all memos
/client/proc/admin_memo_show()
if(ENABLE_MEMOS)
var/savefile/F = new(MEMOFILE)
if(F)
for(var/ckey in F.dir)
src << "<center><span class='motd'><b>Admin Memo</b><i> by [F[ckey]]</i></span></center>"
//delete your own or somebody else's memo
/client/proc/admin_memo_delete()
var/savefile/F = new(MEMOFILE)
if(F)
var/ckey
if( holder.rank == "Game Master" )
ckey = input(src,"Whose memo shall we remove?","Remove Memo",null) as null|anything in F.dir
else
ckey = src.ckey
if(ckey)
F.dir.Remove(ckey)
src << "<b>Removed Memo created by [ckey].</b>"

View File

@@ -144,7 +144,7 @@
verbs += /client/proc/voting
verbs += /client/proc/hide_verbs
verbs += /client/proc/general_report
verbs += /client/proc/air_report
//verbs += /client/proc/air_report
verbs += /client/proc/deadmin_self
//verbs += /client/proc/cmd_admin_prison --Merged with player panel
//verbs += /obj/admins/proc/unprison --Merged with player panel
@@ -248,7 +248,7 @@
// verbs += /client/proc/mapload
verbs += /client/proc/check_words
verbs += /client/proc/drop_bomb
verbs += /client/proc/kill_airgroup
//verbs += /client/proc/kill_airgroup
//verbs += /client/proc/cmd_admin_drop_everything --Merged with view variables
verbs += /client/proc/make_sound
verbs += /client/proc/play_local_sound
@@ -260,6 +260,7 @@
verbs += /client/proc/toggle_gravity_off
verbs += /client/proc/toggle_random_events
verbs += /client/proc/deadmin_self
if(ENABLE_MEMOS) verbs += /client/proc/admin_memo
//verbs += /client/proc/cmd_mass_modify_object_variables --Merged with view variables
//verbs += /client/proc/cmd_admin_explosion --Merged with view variables
//verbs += /client/proc/cmd_admin_emp --Merged with view variables
@@ -278,7 +279,7 @@
verbs += /client/proc/Force_Event_admin
verbs += /client/proc/radioalert
verbs += /client/proc/CarbonCopy
verbs += /client/proc/jump_to_dead_group
//verbs += /client/proc/jump_to_dead_group
else return
//Game Master
@@ -403,7 +404,7 @@
verbs -= /client/proc/voting
verbs -= /client/proc/hide_verbs
verbs -= /client/proc/general_report
verbs -= /client/proc/air_report
//verbs -= /client/proc/air_report
verbs -= /client/proc/cmd_admin_say
verbs -= /client/proc/cmd_admin_gib_self
verbs -= /client/proc/restartcontroller
@@ -425,6 +426,7 @@
verbs -= /client/proc/giveruntimelog //used by coders to retrieve runtime logs
verbs -= /client/proc/getserverlog
verbs -= /client/proc/cinematic //show a cinematic sequence
verbs -= /client/proc/admin_memo
verbs -= /client/proc/cmd_admin_change_custom_event
verbs -= /client/proc/admin_invis
verbs -= /client/proc/callprocgen
@@ -452,13 +454,13 @@
//verbs -= /obj/admins/proc/unprison --Merged with player panel
//verbs -= /client/proc/cmd_switch_radio --removed because tcommsat is staying
verbs -= /client/proc/togglebuildmodeself
verbs -= /client/proc/kill_airgroup
//verbs -= /client/proc/kill_airgroup
verbs -= /client/proc/debug_master_controller
verbs -= /client/proc/make_tajaran
verbs -= /client/proc/admin_deny_shuttle
verbs -= /client/proc/cmd_admin_christmas
verbs -= /client/proc/editappear
verbs -= /client/proc/jump_to_dead_group
//verbs -= /client/proc/jump_to_dead_group
verbs -= /client/proc/playernotes
verbs -= /obj/admins/proc/show_skills
verbs -= /client/proc/enable_debug_verbs

View File

@@ -22,7 +22,7 @@
usr << browse(output,"window=generalreport")
//feedback_add_details("admin_verb","SGR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
air_report()
/* air_report()
set category = "Debug"
set name = "Show Air Report"
@@ -83,7 +83,7 @@
for(var/datum/gas/trace_gas in GM.trace_gases)
usr << "[trace_gas.type]: [trace_gas.moles]"
//feedback_add_details("admin_verb","DAST") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
*/
fix_next_move()
set category = "Debug"
set name = "Unfreeze Everyone"
@@ -183,7 +183,7 @@
//feedback_add_details("admin_verb","RLDA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
jump_to_dead_group()
/*jump_to_dead_group()
set name = "Jump to dead group"
set category = "Debug"
if(!holder)
@@ -221,7 +221,7 @@
else
usr << "Local airgroup is unsimulated!"
//feedback_add_details("admin_verb","KLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
*/
tension_report()
set category = "Debug"

View File

@@ -130,14 +130,14 @@ var/intercom_range_display_status = 0
src.verbs += /client/proc/camera_view //-errorage
src.verbs += /client/proc/sec_camera_report //-errorage
src.verbs += /client/proc/intercom_view //-errorage
src.verbs += /client/proc/air_status //Air things
//src.verbs += /client/proc/air_status //Air things
src.verbs += /client/proc/Cell //More air things
src.verbs += /client/proc/atmosscan //check plumbing
src.verbs += /client/proc/powerdebug //check power
src.verbs += /client/proc/count_objects_on_z_level
src.verbs += /client/proc/count_objects_all
src.verbs += /client/proc/cmd_assume_direct_control //-errorage
src.verbs += /client/proc/jump_to_dead_group
//src.verbs += /client/proc/jump_to_dead_group
src.verbs += /client/proc/startSinglo
src.verbs += /client/proc/ticklag //allows you to set the ticklag.
src.verbs += /client/proc/cmd_admin_grantfullaccess

View File

@@ -621,6 +621,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
/client/proc/cmd_admin_gib_self()
set name = "Gibself"
set category = "Fun"
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm == "Yes")
if (istype(mob, /mob/dead/observer)) // so they don't spam gibs everywhere
return
else

View File

@@ -24,7 +24,7 @@ var/global/sent_strike_team = 0
var/input = null
while(!input)
input = input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "") as text|null
input = copytext(sanitize(input(src, "Please specify which mission the death commando squad shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return

View File

@@ -24,7 +24,7 @@ var/global/sent_syndicate_strike_team = 0
var/input = null
while(!input)
input = input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", "")
input = copytext(sanitize(input(src, "Please specify which mission the syndicate strike team shall undertake.", "Specify Mission", "")),1,MAX_MESSAGE_LEN)
if(!input)
if(alert("Error, no mission set. Do you want to exit the setup process?",,"Yes","No")=="Yes")
return

View File

@@ -261,23 +261,25 @@ datum
for(var/mob/living/carbon/metroid/M in T)
M.adjustToxLoss(rand(15,20))
var/hotspot = (locate(/obj/effect/hotspot) in T)
var/hotspot = (locate(/obj/fire) in T)
if(hotspot && !istype(T, /turf/space))
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles )
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
lowertemp.react()
T.assume_air(lowertemp)
T.apply_fire_protection()
del(hotspot)
return
reaction_obj(var/obj/O, var/volume)
src = null
var/turf/T = get_turf(O)
var/hotspot = (locate(/obj/effect/hotspot) in T)
var/hotspot = (locate(/obj/fire) in T)
if(hotspot && !istype(T, /turf/space))
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles )
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
lowertemp.react()
T.assume_air(lowertemp)
T.apply_fire_protection()
del(hotspot)
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/monkeycube))
var/obj/item/weapon/reagent_containers/food/snacks/monkeycube/cube = O
@@ -2142,12 +2144,13 @@ datum
if(T.wet_overlay)
T.overlays -= T.wet_overlay
T.wet_overlay = null
var/hotspot = (locate(/obj/effect/hotspot) in T)
var/hotspot = (locate(/obj/fire) in T)
if(hotspot)
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles )
lowertemp.temperature = max( min(lowertemp.temperature-2000,lowertemp.temperature / 2) ,0)
lowertemp.react()
T.assume_air(lowertemp)
T.apply_fire_protection()
del(hotspot)
enzyme

View File

@@ -350,8 +350,6 @@ datum
on_reaction(var/datum/reagents/holder, var/created_volume)
var/turf/location = get_turf(holder.my_atom.loc)
for(var/turf/simulated/floor/target_tile in range(0,location))
if(target_tile.parent && target_tile.parent.group_processing)
target_tile.parent.suspend_group_processing()
var/datum/gas_mixture/napalm = new

View File

@@ -2912,6 +2912,15 @@
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/waterbottle
name = "water bottle"
desc = "Straight from the ice lakes of Mars!"
icon_state = "waterbottle"
New()
..()
reagents.add_reagent("water", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/sillycup
name = "Paper Cup"

View File

@@ -28,6 +28,18 @@
protective_temperature = 10000
slowdown = 1.5
/obj/item/clothing/head/helmet/space/fire_helmet
name = "Fire Helmet"
desc = "A helmet designed to protect against fires in sealed areas, which often create extreme pressures."
flags = FPRINT | TABLEPASS | HEADSPACE | HEADCOVERSEYES | BLOCKHAIR
see_face = 0.0
permeability_coefficient = 0.01
heat_transfer_coefficient = 0.01
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 50)
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES
icon_state = "hazmat_firered"
item_state = "hazhat_firered"
/obj/item/clothing/head/radiation

View File

@@ -48,5 +48,11 @@
/obj/item/clothing/suit/storage/labcoat/fr_jacket
name = "first responder jacket"
desc = "\"The first moments are the most crucial.\""
desc = "A high-visibility jacket worn by medical first responders."
icon_state = "fr_jacket_open"
item_state = "fr_jacket"
/obj/item/clothing/suit/storage/labcoat/fr_jacket/sleeve
name = "first responder jacket"
desc = "A high-visibility jacket worn by medical first responders. Has rolled up sleeves."
icon_state = "fr_sleeve_open"

View File

@@ -315,6 +315,7 @@
dug = 1
icon_plating = "asteroid_dug"
icon_state = "asteroid_dug"
return
else
..(W,user)
if ((istype(W,/obj/item/weapon/pickaxe/drill)))

View File

@@ -146,7 +146,7 @@
using.name = "drop"
using.icon = 'screen1_alien.dmi'
using.icon_state = "act_drop"
using.screen_loc = ui_dropbutton
using.screen_loc = ui_dropbutton_old
using.layer = 19
src.adding += using

View File

@@ -183,7 +183,7 @@
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
var/datum/gas_mixture/environment = loc.return_air()
var/datum/air_group/breath
var/datum/gas_mixture/breath
// HACK NEED CHANGING LATER
if(src.health < 0)
src.losebreath++

View File

@@ -56,7 +56,7 @@
using.dir = SOUTHWEST
using.icon = 'screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi_old
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
move_intent = using

View File

@@ -158,7 +158,7 @@
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
var/datum/gas_mixture/environment = loc.return_air()
var/datum/air_group/breath
var/datum/gas_mixture/breath
// HACK NEED CHANGING LATER
if(health < 0)
losebreath++

View File

@@ -76,7 +76,7 @@
param = trim(param)
var/input
if(!param)
input = input("Choose an emote to display.") as text|null
input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
else
input = param
if(input)

View File

@@ -359,7 +359,7 @@
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
var/datum/gas_mixture/environment = loc.return_air()
var/datum/air_group/breath
var/datum/gas_mixture/breath
// HACK NEED CHANGING LATER
if(isbreathing && health < config.health_threshold_crit)
@@ -420,6 +420,16 @@
smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs?
break // If they breathe in the nasty stuff once, no need to continue checking
if(istype(wear_mask, /obj/item/clothing/mask/gas))
var/datum/gas_mixture/filtered = new()
filtered.toxins = breath.toxins
filtered.trace_gases = breath.trace_gases.Copy()
filtered.update_values()
breath.toxins = 0
breath.trace_gases = list()
breath.update_values()
loc.assume_air(filtered)
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
@@ -469,7 +479,7 @@
var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa
//var/safe_oxygen_max = 140 // Maximum safe partial pressure of O2, in kPa (Not used for now)
var/safe_co2_max = 10 // Yes it's an arbitrary value who cares?
var/safe_toxins_max = 0.005
var/safe_toxins_max = 0.0025
var/SA_para_min = 1
var/SA_sleep_min = 5
var/oxygen_used = 0
@@ -649,7 +659,7 @@
//Account for massive pressure differences. Done by Polymorph
var/pressure = environment.return_pressure()
if(!istype(wear_suit, /obj/item/clothing/suit/space))
if(!istype(wear_suit, /obj/item/clothing/suit/space) && !istype(wear_suit, /obj/item/clothing/suit/fire))
/*if(pressure < 20)
if(prob(25))
src << "You feel the splittle on your lips and the fluid on your eyes boiling away, the capillteries in your skin breaking."
@@ -658,6 +668,9 @@
if(pressure > HAZARD_HIGH_PRESSURE)
adjustBruteLoss(min((10+(round(pressure/(HIGH_STEP_PRESSURE)-2)*5)),MAX_PRESSURE_DAMAGE))
if(environment.toxins > MOLES_PLASMA_VISIBLE)
pl_effects()
return //TODO: DEFERRED
adjust_body_temperature(current, loc_temp, boost)

View File

@@ -187,7 +187,7 @@
if(!loc) return //probably ought to make a proper fix for this, but :effort: --NeoFite
var/datum/gas_mixture/environment = loc.return_air()
var/datum/air_group/breath
var/datum/gas_mixture/breath
if(losebreath>0) //Suffocating so do not take a breath
src.losebreath--

View File

@@ -40,14 +40,8 @@
return 0
var/mob/living/carbon/human/H = src //make this damage method divide the damage to be done among all the body parts, then burn each body part for that much damage. will have better effect then just randomly picking a body part
var/divided_damage = (burn_amount)/(H.organs.len)
var/extradam = 0 //added to when organ is at max dam
for(var/name in H.organs)
var/datum/organ/external/affecting = H.organs[name]
if(!affecting) continue
if(affecting.take_damage(0, divided_damage+extradam, 0, used_weapon))
extradam = 0
else
extradam += divided_damage
apply_damage(divided_damage, BURN, name, 0, 0, "Skin Burns")
H.UpdateDamageIcon()
H.updatehealth()
return 1

View File

@@ -54,10 +54,9 @@
m_type = 2
if ("custom")
var/input = input("Choose an emote to display.") as text|null
var/input = copytext(sanitize(input("Choose an emote to display.") as text|null),1,MAX_MESSAGE_LEN)
if (!input)
return
input = sanitize(input)
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
if (input2 == "Visible")
m_type = 1

View File

@@ -202,7 +202,7 @@
mymob.pullin.icon = 'screen1_robot.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_old
mymob.pullin.screen_loc = ui_pull_borg
mymob.blind = new /obj/screen( null )
mymob.blind.icon = 'screen1_robot.dmi'

View File

@@ -238,7 +238,19 @@
/mob/proc/show_inv(mob/user as mob)
user.machine = src
var/dat = text("<TT>\n<B><FONT size=3>[]</FONT></B><BR>\n\t<B>Head(Mask):</B> <A href='?src=\ref[];item=mask'>[]</A><BR>\n\t<B>Left Hand:</B> <A href='?src=\ref[];item=l_hand'>[]</A><BR>\n\t<B>Right Hand:</B> <A href='?src=\ref[];item=r_hand'>[]</A><BR>\n\t<B>Back:</B> <A href='?src=\ref[];item=back'>[]</A><BR>\n\t[]<BR>\n\t[]<BR>\n\t[]<BR>\n\t<A href='?src=\ref[];item=pockets'>Empty Pockets</A><BR>\n<A href='?src=\ref[];mach_close=mob[]'>Close</A><BR>\n</TT>", name, src, (wear_mask ? text("[]", wear_mask) : "Nothing"), src, (l_hand ? text("[]", l_hand) : "Nothing"), src, (r_hand ? text("[]", r_hand) : "Nothing"), src, (back ? text("[]", back) : "Nothing"), ((istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank) && !( internal )) ? text(" <A href='?src=\ref[];item=internal'>Set Internal</A>", src) : ""), (internal ? text("<A href='?src=\ref[];item=internal'>Remove Internal</A>", src) : ""), (handcuffed ? text("<A href='?src=\ref[];item=handcuff'>Handcuffed</A>", src) : text("<A href='?src=\ref[];item=handcuff'>Not Handcuffed</A>", src)), src, user, name)
var/dat = {"
<B><HR><FONT size=3>[name]</FONT></B>
<BR><HR>
<BR><B>Head(Mask):</B> <A href='?src=\ref[src];item=mask'>[(wear_mask ? wear_mask : "Nothing")]</A>
<BR><B>Left Hand:</B> <A href='?src=\ref[src];item=l_hand'>[(l_hand ? l_hand : "Nothing")]</A>
<BR><B>Right Hand:</B> <A href='?src=\ref[src];item=r_hand'>[(r_hand ? r_hand : "Nothing")]</A>
<BR><B>Back:</B> <A href='?src=\ref[src];item=back'>[(back ? back : "Nothing")]</A> [((istype(wear_mask, /obj/item/clothing/mask) && istype(back, /obj/item/weapon/tank) && !( internal )) ? text(" <A href='?src=\ref[];item=internal'>Set Internal</A>", src) : "")]
<BR>[(handcuffed ? text("<A href='?src=\ref[src];item=handcuff'>Handcuffed</A>") : text("<A href='?src=\ref[src];item=handcuff'>Not Handcuffed</A>"))]
<BR>[(internal ? text("<A href='?src=\ref[src];item=internal'>Remove Internal</A>") : "")]
<BR><A href='?src=\ref[src];item=pockets'>Empty Pockets</A>
<BR><A href='?src=\ref[user];refresh=1'>Refresh</A>
<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>
<BR>"}
user << browse(dat, text("window=mob[];size=325x500", name))
onclose(user, "mob[name]")
return
@@ -746,8 +758,8 @@
return
/client/New()
if(findtextEx(key, "Telnet @"))
src << "Sorry, this game does not support Telnet."
if( connection != "seeker" )
src << "Sorry, this game does not support [connection] connections." //doesn't work
del(src)
if (CheckBan(src))
del(src)
@@ -770,8 +782,6 @@
..()
makejson()
if (join_motd)
src << "<div class=\"motd\">[join_motd]</div>"
if(custom_event_msg && custom_event_msg != "")
src << "<h1 class='alert'>Custom Event</h1>"
@@ -779,10 +789,11 @@
src << "<span class='alert'>[html_encode(custom_event_msg)]</span>"
src << "<br>"
if(admins.Find(ckey))
if( ckey in admins )
holder = new /obj/admins(src)
holder.rank = admins[ckey]
update_admins(admins[ckey])
admin_memo_show()
if(ticker && ticker.mode && ticker.mode.name =="sandbox")
mob.CanBuild()

View File

@@ -15,6 +15,9 @@
anchored = 1 // don't get pushed around
Login()
if (join_motd)
src << "<div class=\"motd\">[join_motd]</div>"
if(!preferences)
preferences = new

View File

@@ -633,16 +633,15 @@ datum/preferences
switch(link_tags["real_name"])
if("input")
new_name = input(user, "Please select a name:", "Character Generation") as text
new_name = copytext( (input(user, "Please select a name:", "Character Generation") as text) ,1,MAX_NAME_LEN)
var/list/bad_characters = list("_", "'", "\"", "<", ">", ";", "\[", "\]", "{", "}", "|", "\\","0","1","2","3","4","5","6","7","8","9")
for(var/c in bad_characters)
new_name = dd_replacetext(new_name, c, "")
if(!new_name || (new_name == "Unknown") || (new_name == "floor") || (new_name == "wall") || (new_name == "r-wall"))
alert("Invalid name. Don't do that!")
return
if(length(new_name) >= 26)
alert("That name is too long.")
return
//Make it so number one. (means you can have names like McMillian). Credit to: Jtgibson
new_name = simple_titlecase(new_name)
/*
@@ -660,8 +659,6 @@ datum/preferences
randomize_name()
if(new_name)
if(length(new_name) >= 26)
new_name = copytext(new_name, 1, 26)
real_name = new_name
if(link_tags["age"])
@@ -675,16 +672,8 @@ datum/preferences
if(link_tags["OOC"])
var/tempnote = ""
tempnote = input(user, "Please enter your OOC Notes!:", "OOC notes" , metadata) as text
var/list/bad_characters = list("_", "\"", "<", ">", ";", "\[", "\]", "{", "}", "|", "\\","0","1","2","3","4","5","6","7","8","9")
for(var/c in bad_characters)
tempnote = dd_replacetext(tempnote, c, "")
if(length(tempnote) >= 255)
alert("That name is too long. (255 character max, please)")
return
tempnote = copytext(sanitize(input(user, "Please enter your OOC Notes!:", "OOC notes" , metadata) as text),1,MAX_MESSAGE_LEN)
if(tempnote)
metadata = tempnote
return
@@ -757,7 +746,7 @@ datum/preferences
if("random")
randomize_skin_tone()
if("input")
var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black) or 20-70 for Tajarans", "Character Generation") as text
var/new_tone = input(user, "Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black) or 20-70 for Tajarans", "Character Generation") as num
if(new_tone)
if(species == "Tajaran")
s_tone = max(min(round(text2num(new_tone)), 70), 20)
@@ -769,6 +758,7 @@ datum/preferences
if(species != "Human")
return
switch(link_tags["h_style"])
// New and improved hair selection code, by Doohl
if("random") // random hair selection

View File

@@ -104,7 +104,7 @@
burn *= 0.66 //~2/3 damage for ROBOLIMBS
if(owner && !robot)
owner.pain(display_name, (brute+burn)*3, 1)
owner.pain(display_name, (brute+burn)*3, 1, burn > brute)
if(sharp)
var/nux = brute * rand(10,15)
if(brute_dam >= max_damage)

View File

@@ -7,7 +7,7 @@ mob/var/next_pain_time = 0
// partname is the name of a body part
// amount is a num from 1 to 100
mob/proc/pain(var/partname, var/amount, var/force)
mob/proc/pain(var/partname, var/amount, var/force, var/burning = 0)
if(stat >= 2) return
if(world.time < next_pain_time && !force)
return
@@ -17,12 +17,23 @@ mob/proc/pain(var/partname, var/amount, var/force)
if(amount > 50 && prob(amount / 5))
src:drop_item()
var/msg
if(burning)
switch(amount)
if(1 to 10)
msg = "<b>Your [partname] hurts a bit.</b>"
msg = "\red <b>Your [partname] burns.</b>"
if(11 to 90)
flash_weak_pain()
msg = "<b><font size=1>Ouch! Your [partname] hurts.</font></b>"
msg = "\red <b><font size=2>Your [partname] burns badly!</font></b>"
if(91 to 10000)
flash_pain()
msg = "\red <b><font size=3>OH GOD! Your [partname] is on fire!</font></b>"
else
switch(amount)
if(1 to 10)
msg = "<b>Your [partname] hurts.</b>"
if(11 to 90)
flash_weak_pain()
msg = "<b><font size=2>Your [partname] hurts badly.</font></b>"
if(91 to 10000)
flash_pain()
msg = "<b><font size=3>OH GOD! Your [partname] is hurting terribly!</font></b>"

View File

@@ -35,8 +35,7 @@
user << "\blue You put the [W] into the folder."
update_icon()
else if(istype(W, /obj/item/weapon/pen))
var/n_name = input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text
n_name = copytext(n_name, 1, 32)
var/n_name = copytext(sanitize(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text),1,MAX_NAME_LEN)
if ((loc == usr && usr.stat == 0))
name = "folder[(n_name ? text("- '[n_name]'") : null)]"
return

View File

@@ -40,13 +40,10 @@
if(mode)
usr << "\blue You turn on the hand labeler."
//Now let them chose the text.
var/str = reject_bad_text(input(usr,"Label text?","Set label","")) //sanitize stuff! GOD DAMN THIS IS A SECURITY HOLE
var/str = copytext(reject_bad_text(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
usr << "\red Invalid text."
return
if(length(str) > 64)
usr << "\red Text too long."
return
label = str
usr << "\blue You set the text to '[str]'."
else

View File

@@ -62,7 +62,7 @@
if ((usr.mutations & CLUMSY) && prob(50))
usr << "\red You cut yourself on the paper."
return
var/n_name = input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text
var/n_name = copytext(sanitize(input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text),1,MAX_NAME_LEN)
n_name = copytext(n_name, 1, 32)
if ((loc == usr && usr.stat == 0))
name = "paper[(n_name ? text("- '[n_name]'") : null)]"

Some files were not shown because too many files have changed in this diff Show More