mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-25 06:07:22 +01:00
Merge pull request #9996 from PsiOmegaDelta/150702-AtmosAnalyzeCleanup
Refactors gas analyzation.
This commit is contained in:
@@ -112,20 +112,9 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/device/analyzer) && ptank)
|
||||
var/obj/item/weapon/icon = src
|
||||
user.visible_message("<span class='notice'>[user] has used the analyzer on \icon[icon]</span>")
|
||||
var/pressure = ptank.air_contents.return_pressure()
|
||||
var/total_moles = ptank.air_contents.total_moles
|
||||
|
||||
user << "<span class='notice'>Results of analysis of \icon[icon]</span>"
|
||||
if(total_moles>0)
|
||||
user << "<span class='notice'>Pressure: [round(pressure,0.1)] kPa</span>"
|
||||
for(var/g in ptank.air_contents.gas)
|
||||
user << "<span class='notice'>[gas_data.name[g]]: [round((ptank.air_contents.gas[g] / total_moles) * 100)]%</span>"
|
||||
user << "<span class='notice'>Temperature: [round(ptank.air_contents.temperature-T0C)]°C</span>"
|
||||
else
|
||||
user << "<span class='notice'>Tank is empty!</span>"
|
||||
if(istype(W, /obj/item/device/analyzer))
|
||||
var/obj/item/device/analyzer/A = W
|
||||
A.analyze_gases(src, user)
|
||||
return
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -87,28 +87,12 @@
|
||||
|
||||
/obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
var/obj/icon = src
|
||||
|
||||
if (istype(src.loc, /obj/item/assembly))
|
||||
icon = src.loc
|
||||
|
||||
if ((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
|
||||
for (var/mob/O in viewers(user, null))
|
||||
O << "<span class='notice'>\The [user] has used [W] on \icon[icon] [src]</span>"
|
||||
|
||||
var/pressure = air_contents.return_pressure()
|
||||
manipulated_by = user.real_name //This person is aware of the contents of the tank.
|
||||
var/total_moles = air_contents.total_moles
|
||||
|
||||
user << "<span class='notice'>Results of analysis of \icon[icon]</span>"
|
||||
if (total_moles>0)
|
||||
user << "<span class='notice'>Pressure: [round(pressure,0.1)] kPa</span>"
|
||||
for(var/g in air_contents.gas)
|
||||
user << "<span class='notice'>[gas_data.name[g]]: [(round(air_contents.gas[g] / total_moles) * 100)]%</span>"
|
||||
user << "<span class='notice'>Temperature: [round(air_contents.temperature-T0C)]°C</span>"
|
||||
else
|
||||
user << "<span class='notice'>Tank is empty!</span>"
|
||||
src.add_fingerprint(user)
|
||||
var/obj/item/device/analyzer/A = W
|
||||
A.analyze_gases(src, user)
|
||||
else if (istype(W,/obj/item/latexballon))
|
||||
var/obj/item/latexballon/LB = W
|
||||
LB.blow(src)
|
||||
@@ -131,7 +115,7 @@
|
||||
location = loc.loc
|
||||
else if(istype(loc, /mob/living/carbon))
|
||||
location = loc
|
||||
|
||||
|
||||
var/using_internal
|
||||
if(istype(location))
|
||||
if(location.internal==src)
|
||||
@@ -278,11 +262,11 @@
|
||||
var/range = (pressure-TANK_FRAGMENT_PRESSURE)/TANK_FRAGMENT_SCALE
|
||||
|
||||
explosion(
|
||||
get_turf(loc),
|
||||
round(min(BOMBCAP_DVSTN_RADIUS, range*0.25)),
|
||||
round(min(BOMBCAP_HEAVY_RADIUS, range*0.50)),
|
||||
round(min(BOMBCAP_LIGHT_RADIUS, range*1.00)),
|
||||
round(min(BOMBCAP_FLASH_RADIUS, range*1.50)),
|
||||
get_turf(loc),
|
||||
round(min(BOMBCAP_DVSTN_RADIUS, range*0.25)),
|
||||
round(min(BOMBCAP_HEAVY_RADIUS, range*0.50)),
|
||||
round(min(BOMBCAP_LIGHT_RADIUS, range*1.00)),
|
||||
round(min(BOMBCAP_FLASH_RADIUS, range*1.50)),
|
||||
)
|
||||
qdel(src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user