Ported C++mos from yogs (help me)

This commit is contained in:
Putnam
2020-05-11 15:44:26 -07:00
parent e1d113b970
commit e8d7da56f4
97 changed files with 678 additions and 1037 deletions
+9 -13
View File
@@ -47,31 +47,29 @@
if(!loaded_tank)
return
if(!bitcoinmining)
if(!loaded_tank.air_contents.gases[/datum/gas/plasma])
if(loaded_tank.air_contents.get_moles(/datum/gas/plasma) < 0.0001)
investigate_log("<font color='red'>out of fuel</font>.", INVESTIGATE_SINGULO)
playsound(src, 'sound/machines/ding.ogg', 50, 1)
Radio.talk_into(src, "Insufficient plasma in [get_area(src)] [src], ejecting \the [loaded_tank].", FREQ_ENGINEERING)
eject()
else
var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.gases[/datum/gas/plasma])
loaded_tank.air_contents.gases[/datum/gas/plasma] -= 2.7 * gasdrained
loaded_tank.air_contents.gases[/datum/gas/tritium] += 2.7 * gasdrained
GAS_GARBAGE_COLLECT(loaded_tank.air_contents.gases)
var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.get_moles(/datum/gas/plasma))
loaded_tank.air_contents.adjust_moles(/datum/gas/plasma, -gasdrained)
loaded_tank.air_contents.adjust_moles(/datum/gas/tritium, gasdrained)
var/power_produced = RAD_COLLECTOR_OUTPUT
add_avail(power_produced)
stored_power-=power_produced
else if(is_station_level(z) && SSresearch.science_tech)
if(!loaded_tank.air_contents.gases[/datum/gas/tritium] || !loaded_tank.air_contents.gases[/datum/gas/oxygen])
if(!loaded_tank.air_contents.get_moles(/datum/gas/tritium) || !loaded_tank.air_contents.get_moles(/datum/gas/oxygen))
playsound(src, 'sound/machines/ding.ogg', 50, 1)
Radio.talk_into(src, "Insufficient oxygen and tritium in [get_area(src)] [src] to produce research points, ejecting \the [loaded_tank].", FREQ_ENGINEERING)
eject()
else
var/gasdrained = bitcoinproduction_drain*drainratio
loaded_tank.air_contents.gases[/datum/gas/tritium] -= gasdrained
loaded_tank.air_contents.gases[/datum/gas/oxygen] -= gasdrained
loaded_tank.air_contents.gases[/datum/gas/carbon_dioxide] += gasdrained*2
GAS_GARBAGE_COLLECT(loaded_tank.air_contents.gases)
loaded_tank.air_contents.adjust_moles(/datum/gas/tritium, -gasdrained)
loaded_tank.air_contents.adjust_moles(/datum/gas/oxygen, -gasdrained)
loaded_tank.air_contents.adjust_moles(/datum/gas/carbon_dioxide, gasdrained*2)
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, stored_power*RAD_COLLECTOR_MINING_CONVERSION_RATE)
last_push = stored_power
stored_power = 0
@@ -82,9 +80,7 @@
toggle_power()
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
"<span class='notice'>You turn the [src.name] [active? "on":"off"].</span>")
var/fuel
if(loaded_tank)
fuel = loaded_tank.air_contents.gases[/datum/gas/plasma]
var/fuel = loaded_tank.air_contents.get_moles(/datum/gas/plasma)
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [key_name(user)]. [loaded_tank?"Fuel: [round(fuel/0.29)]%":"<font color='red'>It is empty</font>"].", INVESTIGATE_SINGULO)
return
else