mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-14 16:46:28 +01:00
Merge remote-tracking branch 'upstream/master' into dev-freeze
Conflicts: code/game/objects/items/weapons/tanks/tanks.dm code/modules/holodeck/HolodeckControl.dm code/modules/mob/living/carbon/breathe.dm code/modules/mob/living/carbon/human/life.dm code/setup.dm
This commit is contained in:
@@ -99,17 +99,9 @@
|
||||
if (src.loc != usr)
|
||||
return 0
|
||||
if(tank_one && href_list["tankone"])
|
||||
split_gases()
|
||||
valve_open = 0
|
||||
tank_one.loc = get_turf(src)
|
||||
tank_one = null
|
||||
update_icon()
|
||||
remove_tank(tank_one)
|
||||
else if(tank_two && href_list["tanktwo"])
|
||||
split_gases()
|
||||
valve_open = 0
|
||||
tank_two.loc = get_turf(src)
|
||||
tank_two = null
|
||||
update_icon()
|
||||
remove_tank(tank_two)
|
||||
else if(href_list["open"])
|
||||
toggle_valve()
|
||||
else if(attached_device)
|
||||
@@ -148,20 +140,43 @@
|
||||
if(attached_device)
|
||||
overlays += "device"
|
||||
|
||||
/obj/item/device/transfer_valve/proc/remove_tank(obj/item/weapon/tank/T)
|
||||
if(tank_one == T)
|
||||
split_gases()
|
||||
tank_one = null
|
||||
else if(tank_two == T)
|
||||
split_gases()
|
||||
tank_two = null
|
||||
else
|
||||
return
|
||||
|
||||
T.loc = get_turf(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/device/transfer_valve/proc/merge_gases()
|
||||
if(valve_open)
|
||||
return
|
||||
tank_two.air_contents.volume += tank_one.air_contents.volume
|
||||
var/datum/gas_mixture/temp
|
||||
temp = tank_one.air_contents.remove_ratio(1)
|
||||
tank_two.air_contents.merge(temp)
|
||||
valve_open = 1
|
||||
|
||||
/obj/item/device/transfer_valve/proc/split_gases()
|
||||
if (!valve_open || !tank_one || !tank_two)
|
||||
if(!valve_open)
|
||||
return
|
||||
|
||||
valve_open = 0
|
||||
|
||||
if(deleted(tank_one) || deleted(tank_two))
|
||||
return
|
||||
|
||||
var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume
|
||||
var/datum/gas_mixture/temp
|
||||
temp = tank_two.air_contents.remove_ratio(ratio1)
|
||||
tank_one.air_contents.merge(temp)
|
||||
tank_two.air_contents.volume -= tank_one.air_contents.volume
|
||||
|
||||
|
||||
/*
|
||||
Exadv1: I know this isn't how it's going to work, but this was just to check
|
||||
@@ -169,8 +184,7 @@
|
||||
*/
|
||||
|
||||
/obj/item/device/transfer_valve/proc/toggle_valve()
|
||||
if(valve_open==0 && (tank_one && tank_two))
|
||||
valve_open = 1
|
||||
if(!valve_open && (tank_one && tank_two))
|
||||
var/turf/bombturf = get_turf(src)
|
||||
var/area/A = get_area(bombturf)
|
||||
|
||||
@@ -196,16 +210,11 @@
|
||||
message_admins(log_str, 0, 1)
|
||||
log_game(log_str)
|
||||
merge_gases()
|
||||
spawn(20) // In case one tank bursts
|
||||
for (var/i=0,i<5,i++)
|
||||
src.update_icon()
|
||||
sleep(10)
|
||||
src.update_icon()
|
||||
|
||||
else if(valve_open==1 && (tank_one && tank_two))
|
||||
split_gases()
|
||||
valve_open = 0
|
||||
src.update_icon()
|
||||
|
||||
src.update_icon()
|
||||
|
||||
// this doesn't do anything but the timer etc. expects it to be here
|
||||
// eventually maybe have it update icon to show state (timer, prox etc.) like old bombs
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
else
|
||||
if(get_amount() < used)
|
||||
return 0
|
||||
for(var/i = 1 to uses_charge)
|
||||
for(var/i = 1 to charge_costs.len)
|
||||
var/datum/matter_synth/S = synths[i]
|
||||
S.use_charge(charge_costs[i] * used) // Doesn't need to be deleted
|
||||
return 1
|
||||
@@ -264,8 +264,8 @@
|
||||
return 0
|
||||
var/datum/matter_synth/S = synths[1]
|
||||
. = round(S.get_charge() / charge_costs[1])
|
||||
if(uses_charge > 1)
|
||||
for(var/i = 2 to uses_charge)
|
||||
if(charge_costs.len > 1)
|
||||
for(var/i = 2 to charge_costs.len)
|
||||
S = synths[i]
|
||||
. = min(., round(S.get_charge() / charge_costs[i]))
|
||||
return
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#ifndef T_BOARD
|
||||
#error T_BOARD macro is not defined but we need it!
|
||||
#endif
|
||||
|
||||
/obj/item/weapon/circuitboard/holodeckcontrol
|
||||
name = T_BOARD("holodeck control console")
|
||||
build_path = /obj/machinery/computer/HolodeckControl
|
||||
origin_tech = "programming=2;bluespace=2"
|
||||
var/last_to_emag
|
||||
var/linkedholodeck_area
|
||||
var/list/supported_programs
|
||||
var/list/restricted_programs
|
||||
|
||||
/obj/item/weapon/circuitboard/holodeckcontrol/construct(var/obj/machinery/computer/HolodeckControl/HC)
|
||||
if (..(HC))
|
||||
HC.supported_programs = supported_programs.Copy()
|
||||
HC.restricted_programs = restricted_programs.Copy()
|
||||
if(linkedholodeck_area)
|
||||
HC.linkedholodeck = locate(linkedholodeck_area)
|
||||
if(last_to_emag)
|
||||
HC.last_to_emag = last_to_emag
|
||||
HC.emagged = 1
|
||||
HC.safety_disabled = 1
|
||||
|
||||
/obj/item/weapon/circuitboard/holodeckcontrol/deconstruct(var/obj/machinery/computer/HolodeckControl/HC)
|
||||
if (..(HC))
|
||||
linkedholodeck_area = HC.linkedholodeck_area
|
||||
supported_programs = HC.supported_programs.Copy()
|
||||
restricted_programs = HC.restricted_programs.Copy()
|
||||
last_to_emag = HC.last_to_emag
|
||||
HC.emergencyShutdown()
|
||||
@@ -36,6 +36,10 @@
|
||||
qdel(air_contents)
|
||||
|
||||
processing_objects.Remove(src)
|
||||
|
||||
if(istype(loc, /obj/item/device/transfer_valve))
|
||||
var/obj/item/device/transfer_valve/TTV = loc
|
||||
TTV.remove_tank(src)
|
||||
|
||||
..()
|
||||
|
||||
@@ -272,7 +276,10 @@
|
||||
qdel(src)
|
||||
|
||||
else if(pressure > TANK_RUPTURE_PRESSURE)
|
||||
//world << "<span class='notice'>[x],[y] tank is rupturing: [pressure] kPa, integrity [integrity]</span>"
|
||||
#ifdef FIREDBG
|
||||
log_debug("\blue[x],[y] tank is rupturing: [pressure] kPa, integrity [integrity]")
|
||||
#endif
|
||||
|
||||
if(integrity <= 0)
|
||||
var/turf/simulated/T = get_turf(src)
|
||||
if(!T)
|
||||
@@ -284,7 +291,10 @@
|
||||
integrity--
|
||||
|
||||
else if(pressure > TANK_LEAK_PRESSURE)
|
||||
//world << "<span class='notice'>[x],[y] tank is leaking: [pressure] kPa, integrity [integrity]</span>"
|
||||
#ifdef FIREDBG
|
||||
log_debug("\blue[x],[y] tank is leaking: [pressure] kPa, integrity [integrity]")
|
||||
#endif
|
||||
|
||||
if(integrity <= 0)
|
||||
var/turf/simulated/T = get_turf(src)
|
||||
if(!T)
|
||||
|
||||
Reference in New Issue
Block a user