mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-22 08:01:06 +00:00
Openturf throw fix & minor refactors (#2203)
changes: Thrown objects will now fire Entered() on the turf they land on. As a result, they will now fall if they land on an openturf. Openturfs now queue an icon update if something falls down. /obj/item/weapon/ore_radar converted to use SSfast_process instead of a spawn loop. Converted hand-held tanks' New() to Initialize(). Note: This PR allows grenades to be thrown down openturfs.
This commit is contained in:
@@ -192,6 +192,10 @@
|
|||||||
src.thrower = null
|
src.thrower = null
|
||||||
src.throw_source = null
|
src.throw_source = null
|
||||||
|
|
||||||
|
if (isturf(loc))
|
||||||
|
var/turf/Tloc = loc
|
||||||
|
Tloc.Entered(src)
|
||||||
|
|
||||||
|
|
||||||
//Overlays
|
//Overlays
|
||||||
/atom/movable/overlay
|
/atom/movable/overlay
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
var/volume_rate = 500 //Needed for borg jetpack transfer
|
var/volume_rate = 500 //Needed for borg jetpack transfer
|
||||||
action_button_name = "Toggle Jetpack"
|
action_button_name = "Toggle Jetpack"
|
||||||
|
|
||||||
/obj/item/weapon/tank/jetpack/New()
|
/obj/item/weapon/tank/jetpack/Initialize()
|
||||||
..()
|
. = ..()
|
||||||
src.ion_trail = new /datum/effect/effect/system/ion_trail_follow()
|
src.ion_trail = new /datum/effect/effect/system/ion_trail_follow()
|
||||||
src.ion_trail.set_up(src)
|
src.ion_trail.set_up(src)
|
||||||
|
|
||||||
@@ -90,10 +90,9 @@
|
|||||||
icon_state = "jetpack-void"
|
icon_state = "jetpack-void"
|
||||||
item_state = "jetpack-void"
|
item_state = "jetpack-void"
|
||||||
|
|
||||||
/obj/item/weapon/tank/jetpack/void/New()
|
/obj/item/weapon/tank/jetpack/void/Initialize()
|
||||||
..()
|
. = ..()
|
||||||
air_contents.adjust_gas("oxygen", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
air_contents.adjust_gas("oxygen", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/tank/jetpack/oxygen
|
/obj/item/weapon/tank/jetpack/oxygen
|
||||||
name = "jetpack (oxygen)"
|
name = "jetpack (oxygen)"
|
||||||
@@ -101,10 +100,9 @@
|
|||||||
icon_state = "jetpack"
|
icon_state = "jetpack"
|
||||||
item_state = "jetpack"
|
item_state = "jetpack"
|
||||||
|
|
||||||
/obj/item/weapon/tank/jetpack/oxygen/New()
|
/obj/item/weapon/tank/jetpack/oxygen/Initialize()
|
||||||
..()
|
. = ..()
|
||||||
air_contents.adjust_gas("oxygen", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
air_contents.adjust_gas("oxygen", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/tank/jetpack/carbondioxide
|
/obj/item/weapon/tank/jetpack/carbondioxide
|
||||||
name = "jetpack (carbon dioxide)"
|
name = "jetpack (carbon dioxide)"
|
||||||
@@ -113,10 +111,9 @@
|
|||||||
icon_state = "jetpack-black"
|
icon_state = "jetpack-black"
|
||||||
item_state = "jetpack-black"
|
item_state = "jetpack-black"
|
||||||
|
|
||||||
/obj/item/weapon/tank/jetpack/carbondioxide/New()
|
/obj/item/weapon/tank/jetpack/carbondioxide/Initialize()
|
||||||
..()
|
. = ..()
|
||||||
air_contents.adjust_gas("carbon_dioxide", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
air_contents.adjust_gas("carbon_dioxide", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/tank/jetpack/carbondioxide/synthetic
|
/obj/item/weapon/tank/jetpack/carbondioxide/synthetic
|
||||||
name = "Synthetic Jetpack"
|
name = "Synthetic Jetpack"
|
||||||
|
|||||||
@@ -17,13 +17,12 @@
|
|||||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||||
|
|
||||||
|
|
||||||
New()
|
/obj/item/weapon/tank/oxygen/Initialize()
|
||||||
..()
|
. = ..()
|
||||||
air_contents.adjust_gas("oxygen", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
air_contents.adjust_gas("oxygen", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
examine(mob/user)
|
/obj/item/weapon/tank/oxygen/examine(mob/user)
|
||||||
if(..(user, 0) && air_contents.gas["oxygen"] < 10)
|
if(..(user, 0) && air_contents.gas["oxygen"] < 10)
|
||||||
user << text("<span class='warning'>The meter on \the [src] indicates you are almost out of oxygen!</span>")
|
user << text("<span class='warning'>The meter on \the [src] indicates you are almost out of oxygen!</span>")
|
||||||
//playsound(usr, 'sound/effects/alert.ogg', 50, 1)
|
//playsound(usr, 'sound/effects/alert.ogg', 50, 1)
|
||||||
@@ -47,15 +46,13 @@
|
|||||||
icon_state = "anesthetic"
|
icon_state = "anesthetic"
|
||||||
item_state = "an_tank"
|
item_state = "an_tank"
|
||||||
|
|
||||||
/obj/item/weapon/tank/anesthetic/New()
|
/obj/item/weapon/tank/anesthetic/Initialize()
|
||||||
..()
|
. = ..()
|
||||||
|
|
||||||
air_contents.gas["oxygen"] = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
air_contents.gas["oxygen"] = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||||
air_contents.gas["sleeping_agent"] = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
air_contents.gas["sleeping_agent"] = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||||
air_contents.update_values()
|
air_contents.update_values()
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Air
|
* Air
|
||||||
*/
|
*/
|
||||||
@@ -64,18 +61,14 @@
|
|||||||
desc = "Mixed anyone?"
|
desc = "Mixed anyone?"
|
||||||
icon_state = "oxygen"
|
icon_state = "oxygen"
|
||||||
|
|
||||||
|
|
||||||
examine(mob/user)
|
examine(mob/user)
|
||||||
if(..(user, 0) && air_contents.gas["oxygen"] < 1 && loc==user)
|
if(..(user, 0) && air_contents.gas["oxygen"] < 1 && loc==user)
|
||||||
user << "<span class='danger'>The meter on the [src.name] indicates you are almost out of air!</span>"
|
user << "<span class='danger'>The meter on the [src.name] indicates you are almost out of air!</span>"
|
||||||
user << sound('sound/effects/alert.ogg')
|
user << sound('sound/effects/alert.ogg')
|
||||||
|
|
||||||
/obj/item/weapon/tank/air/New()
|
/obj/item/weapon/tank/air/Initialize()
|
||||||
..()
|
. = ..()
|
||||||
|
air_contents.adjust_multi("oxygen", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD, "nitrogen", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
|
||||||
src.air_contents.adjust_multi("oxygen", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD, "nitrogen", (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -89,12 +82,9 @@
|
|||||||
flags = CONDUCT
|
flags = CONDUCT
|
||||||
slot_flags = null //they have no straps!
|
slot_flags = null //they have no straps!
|
||||||
|
|
||||||
|
/obj/item/weapon/tank/phoron/Initialize()
|
||||||
/obj/item/weapon/tank/phoron/New()
|
. = ..()
|
||||||
..()
|
air_contents.adjust_gas("phoron", (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C))
|
||||||
|
|
||||||
src.air_contents.adjust_gas("phoron", (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C))
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/tank/phoron/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
/obj/item/weapon/tank/phoron/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||||
..()
|
..()
|
||||||
@@ -125,14 +115,12 @@
|
|||||||
volume = 2 //Tiny. Real life equivalents only have 21 breaths of oxygen in them. They're EMERGENCY tanks anyway -errorage (dangercon 2011)
|
volume = 2 //Tiny. Real life equivalents only have 21 breaths of oxygen in them. They're EMERGENCY tanks anyway -errorage (dangercon 2011)
|
||||||
|
|
||||||
|
|
||||||
New()
|
/obj/item/weapon/tank/emergency_oxygen/Initialize()
|
||||||
..()
|
. = ..()
|
||||||
src.air_contents.adjust_gas("oxygen", (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
air_contents.adjust_gas("oxygen", (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
examine(mob/user)
|
/obj/item/weapon/tank/emergency_oxygen/examine(mob/user)
|
||||||
if(..(user, 0) && air_contents.gas["oxygen"] < 0.2 && loc==user)
|
if(..(user, 0) && air_contents.gas["oxygen"] < 0.2 && loc==user)
|
||||||
user << text("<span class='danger'>The meter on the [src.name] indicates you are almost out of air!</span>")
|
user << text("<span class='danger'>The meter on the [src.name] indicates you are almost out of air!</span>")
|
||||||
user << sound('sound/effects/alert.ogg')
|
user << sound('sound/effects/alert.ogg')
|
||||||
@@ -161,14 +149,12 @@
|
|||||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||||
volume = 2
|
volume = 2
|
||||||
|
|
||||||
New()
|
|
||||||
..()
|
|
||||||
src.air_contents.adjust_gas("nitrogen", (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
|
||||||
|
|
||||||
return
|
/obj/item/weapon/tank/emergency_nitrogen/Initialize()
|
||||||
|
. = ..()
|
||||||
|
air_contents.adjust_gas("nitrogen", (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||||
|
|
||||||
|
/obj/item/weapon/tank/emergency_nitrogen/examine(mob/user)
|
||||||
examine(mob/user)
|
|
||||||
if(..(user, 0) && air_contents.gas["nitrogen"] < 0.2 && loc==user)
|
if(..(user, 0) && air_contents.gas["nitrogen"] < 0.2 && loc==user)
|
||||||
user << text("<span class='danger'>The meter on \the [src] indicates you are almost out of air!</span>")
|
user << text("<span class='danger'>The meter on \the [src] indicates you are almost out of air!</span>")
|
||||||
user << sound('sound/effects/alert.ogg')
|
user << sound('sound/effects/alert.ogg')
|
||||||
@@ -182,12 +168,10 @@
|
|||||||
icon_state = "oxygen_fr"
|
icon_state = "oxygen_fr"
|
||||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||||
|
|
||||||
|
/obj/item/weapon/tank/nitrogen/Initialize()
|
||||||
|
. = ..()
|
||||||
|
|
||||||
/obj/item/weapon/tank/nitrogen/New()
|
air_contents.adjust_gas("nitrogen", (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C))
|
||||||
..()
|
|
||||||
|
|
||||||
src.air_contents.adjust_gas("nitrogen", (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C))
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/tank/nitrogen/examine(mob/user)
|
/obj/item/weapon/tank/nitrogen/examine(mob/user)
|
||||||
if(..(user, 0) && air_contents.gas["nitrogen"] < 10)
|
if(..(user, 0) && air_contents.gas["nitrogen"] < 10)
|
||||||
|
|||||||
@@ -29,19 +29,18 @@
|
|||||||
var/volume = 70
|
var/volume = 70
|
||||||
var/manipulated_by = null //Used by _onclick/hud/screen_objects.dm internals to determine if someone has messed with our tank or not.
|
var/manipulated_by = null //Used by _onclick/hud/screen_objects.dm internals to determine if someone has messed with our tank or not.
|
||||||
//If they have and we haven't scanned it with the PDA or gas analyzer then we might just breath whatever they put in it.
|
//If they have and we haven't scanned it with the PDA or gas analyzer then we might just breath whatever they put in it.
|
||||||
/obj/item/weapon/tank/New()
|
/obj/item/weapon/tank/Initialize()
|
||||||
..()
|
. = ..()
|
||||||
|
|
||||||
|
air_contents = new /datum/gas_mixture()
|
||||||
|
air_contents.volume = volume //liters
|
||||||
|
air_contents.temperature = T20C
|
||||||
|
|
||||||
src.air_contents = new /datum/gas_mixture()
|
|
||||||
src.air_contents.volume = volume //liters
|
|
||||||
src.air_contents.temperature = T20C
|
|
||||||
START_PROCESSING(SSprocessing, src)
|
START_PROCESSING(SSprocessing, src)
|
||||||
update_gauge()
|
update_gauge()
|
||||||
return
|
|
||||||
|
|
||||||
/obj/item/weapon/tank/Destroy()
|
/obj/item/weapon/tank/Destroy()
|
||||||
if(air_contents)
|
QDEL_NULL(air_contents)
|
||||||
qdel(air_contents)
|
|
||||||
|
|
||||||
STOP_PROCESSING(SSprocessing, src)
|
STOP_PROCESSING(SSprocessing, src)
|
||||||
|
|
||||||
|
|||||||
@@ -650,13 +650,20 @@
|
|||||||
if(!active)
|
if(!active)
|
||||||
active = 1
|
active = 1
|
||||||
usr << "<span class='notice'>You activate the pinpointer</span>"
|
usr << "<span class='notice'>You activate the pinpointer</span>"
|
||||||
workdisk(user)
|
START_PROCESSING(SSfast_process, src)
|
||||||
else
|
else
|
||||||
active = 0
|
active = 0
|
||||||
icon_state = "pinoff"
|
icon_state = "pinoff"
|
||||||
usr << "<span>You deactivate the pinpointer</span>"
|
usr << "<span>You deactivate the pinpointer</span>"
|
||||||
|
STOP_PROCESSING(SSfast_process, src)
|
||||||
|
|
||||||
/obj/item/weapon/ore_radar/proc/workdisk(var/user)
|
/obj/item/weapon/ore_radar/process()
|
||||||
|
if (active)
|
||||||
|
workdisk()
|
||||||
|
else
|
||||||
|
STOP_PROCESSING(SSfast_process, src)
|
||||||
|
|
||||||
|
/obj/item/weapon/ore_radar/proc/workdisk()
|
||||||
if(!src.loc)
|
if(!src.loc)
|
||||||
active = 0
|
active = 0
|
||||||
|
|
||||||
@@ -665,8 +672,8 @@
|
|||||||
|
|
||||||
var/closest = 15
|
var/closest = 15
|
||||||
|
|
||||||
for(var/turf/simulated/mineral/random/R in orange(14,user))
|
for(var/turf/simulated/mineral/random/R in orange(14,loc))
|
||||||
var/dist = get_dist(user, R)
|
var/dist = get_dist(loc, R)
|
||||||
if(dist < closest)
|
if(dist < closest)
|
||||||
closest = dist
|
closest = dist
|
||||||
sonar = R
|
sonar = R
|
||||||
@@ -674,8 +681,8 @@
|
|||||||
if(!sonar)
|
if(!sonar)
|
||||||
icon_state = "pinonnull"
|
icon_state = "pinonnull"
|
||||||
return
|
return
|
||||||
set_dir(get_dir(user,sonar))
|
set_dir(get_dir(loc,sonar))
|
||||||
switch(get_dist(user,sonar))
|
switch(get_dist(loc,sonar))
|
||||||
if(0)
|
if(0)
|
||||||
icon_state = "pinondirect"
|
icon_state = "pinondirect"
|
||||||
if(1 to 8)
|
if(1 to 8)
|
||||||
@@ -684,7 +691,6 @@
|
|||||||
icon_state = "pinonmedium"
|
icon_state = "pinonmedium"
|
||||||
if(16 to INFINITY)
|
if(16 to INFINITY)
|
||||||
icon_state = "pinonfar"
|
icon_state = "pinonfar"
|
||||||
spawn(5) .()
|
|
||||||
|
|
||||||
/**********************Jaunter**********************/
|
/**********************Jaunter**********************/
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,7 @@
|
|||||||
/turf/simulated/open/Entered(atom/movable/mover)
|
/turf/simulated/open/Entered(atom/movable/mover)
|
||||||
..()
|
..()
|
||||||
mover.fall()
|
mover.fall()
|
||||||
|
update_icon()
|
||||||
|
|
||||||
// override to make sure nothing is hidden
|
// override to make sure nothing is hidden
|
||||||
/turf/simulated/open/levelupdate()
|
/turf/simulated/open/levelupdate()
|
||||||
|
|||||||
Reference in New Issue
Block a user