mirror of
https://github.com/Yawn-Wider/YWPolarisVore.git
synced 2026-08-24 21:47:21 +01:00
Converts gas, mat and reagent strings to defines
This commit is contained in:
@@ -160,7 +160,7 @@
|
||||
|
||||
to_chat(user, "You inject the solution into the power cell.")
|
||||
|
||||
if(S.reagents.has_reagent("phoron", 5))
|
||||
if(S.reagents.has_reagent(REAGENT_ID_PHORON, 5))
|
||||
|
||||
rigged = 1
|
||||
|
||||
|
||||
@@ -303,8 +303,8 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(istype(T))
|
||||
var/datum/gas_mixture/plasma = new
|
||||
plasma.adjust_gas("oxygen", (size*100), 0)
|
||||
plasma.adjust_gas("phoron", (size*100), 0)
|
||||
plasma.adjust_gas(GAS_O2, (size*100), 0)
|
||||
plasma.adjust_gas(GAS_PHORON, (size*100), 0)
|
||||
plasma.temperature = (plasma_temperature/2)
|
||||
plasma.update_values()
|
||||
T.assume_air(plasma)
|
||||
@@ -639,8 +639,8 @@
|
||||
var/turf/TT = get_turf(pick(turfs_in_range))
|
||||
if(istype(TT))
|
||||
var/datum/gas_mixture/plasma = new
|
||||
plasma.adjust_gas("oxygen", (size*100), 0)
|
||||
plasma.adjust_gas("phoron", (size*100), 0)
|
||||
plasma.adjust_gas(GAS_O2, (size*100), 0)
|
||||
plasma.adjust_gas(GAS_PHORON, (size*100), 0)
|
||||
plasma.temperature = (plasma_temperature/2)
|
||||
plasma.update_values()
|
||||
TT.assume_air(plasma)
|
||||
@@ -655,8 +655,8 @@
|
||||
var/turf/TT = get_turf(owned_core)
|
||||
if(istype(TT))
|
||||
var/datum/gas_mixture/plasma = new
|
||||
plasma.adjust_gas("oxygen", (size*100), 0)
|
||||
plasma.adjust_gas("phoron", (size*100), 0)
|
||||
plasma.adjust_gas(GAS_O2, (size*100), 0)
|
||||
plasma.adjust_gas(GAS_PHORON, (size*100), 0)
|
||||
plasma.temperature = (plasma_temperature/2)
|
||||
plasma.update_values()
|
||||
TT.assume_air(plasma)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
var/percent_depleted = 1
|
||||
var/list/rod_quantities = list()
|
||||
var/fuel_type = "composite"
|
||||
var/fuel_type = MAT_COMPOSITE
|
||||
var/fuel_colour
|
||||
var/radioactivity = 0
|
||||
var/const/initial_amount = 3000000
|
||||
@@ -54,13 +54,13 @@
|
||||
|
||||
// Mapper shorthand.
|
||||
/obj/item/fuel_assembly/deuterium/New(var/newloc)
|
||||
..(newloc, "deuterium")
|
||||
..(newloc, MAT_DEUTERIUM)
|
||||
|
||||
/obj/item/fuel_assembly/tritium/New(var/newloc)
|
||||
..(newloc, "tritium")
|
||||
..(newloc, MAT_TRITIUM)
|
||||
|
||||
/obj/item/fuel_assembly/phoron/New(var/newloc)
|
||||
..(newloc, "phoron")
|
||||
..(newloc, MAT_PHORON)
|
||||
|
||||
/obj/item/fuel_assembly/supermatter/New(var/newloc)
|
||||
..(newloc, "supermatter")
|
||||
..(newloc, MAT_SUPERMATTER)
|
||||
|
||||
@@ -76,8 +76,8 @@ var/list/fusion_reactions
|
||||
|
||||
// Unideal/material production reactions
|
||||
/decl/fusion_reaction/oxygen_oxygen
|
||||
p_react = "oxygen"
|
||||
s_react = "oxygen"
|
||||
p_react = REAGENT_ID_OXYGEN
|
||||
s_react = REAGENT_ID_OXYGEN
|
||||
energy_consumption = 10
|
||||
energy_production = 0
|
||||
instability = 5
|
||||
@@ -85,17 +85,17 @@ var/list/fusion_reactions
|
||||
products = list("silicon"= 1)
|
||||
|
||||
/decl/fusion_reaction/iron_iron
|
||||
p_react = "iron"
|
||||
s_react = "iron"
|
||||
products = list("silver" = 1, "gold" = 1, "platinum" = 1) // Not realistic but w/e
|
||||
p_react = REAGENT_ID_IRON
|
||||
s_react = REAGENT_ID_IRON
|
||||
products = list(REAGENT_ID_SILVER = 1, REAGENT_ID_GOLD = 1, REAGENT_ID_PLATINUM = 1) // Not realistic but w/e
|
||||
energy_consumption = 10
|
||||
energy_production = 0
|
||||
instability = 2
|
||||
minimum_reaction_temperature = 10000
|
||||
|
||||
/decl/fusion_reaction/phoron_hydrogen
|
||||
p_react = "hydrogen"
|
||||
s_react = "phoron"
|
||||
p_react = REAGENT_ID_HYDROGEN
|
||||
s_react = REAGENT_ID_PHORON
|
||||
energy_consumption = 10
|
||||
energy_production = 0
|
||||
instability = 5
|
||||
@@ -105,7 +105,7 @@ var/list/fusion_reactions
|
||||
// VERY UNIDEAL REACTIONS.
|
||||
/decl/fusion_reaction/phoron_supermatter
|
||||
p_react = "supermatter"
|
||||
s_react = "phoron"
|
||||
s_react = REAGENT_ID_PHORON
|
||||
energy_consumption = 0
|
||||
energy_production = 5
|
||||
radiation = 20
|
||||
@@ -145,7 +145,7 @@ var/list/fusion_reactions
|
||||
// High end reactions.
|
||||
/decl/fusion_reaction/boron_hydrogen
|
||||
p_react = "boron"
|
||||
s_react = "hydrogen"
|
||||
s_react = REAGENT_ID_HYDROGEN
|
||||
minimum_energy_level = FUSION_HEAT_CAP * 0.5
|
||||
energy_consumption = 3
|
||||
energy_production = 15
|
||||
@@ -153,8 +153,8 @@ var/list/fusion_reactions
|
||||
instability = 3
|
||||
|
||||
/decl/fusion_reaction/hydrogen_hydrogen
|
||||
p_react = "hydrogen"
|
||||
s_react = "hydrogen"
|
||||
p_react = REAGENT_ID_HYDROGEN
|
||||
s_react = REAGENT_ID_HYDROGEN
|
||||
minimum_energy_level = FUSION_HEAT_CAP * 0.75
|
||||
energy_consumption = 0
|
||||
energy_production = 20
|
||||
|
||||
@@ -1141,7 +1141,7 @@ var/global/list/light_type_cache = list()
|
||||
|
||||
to_chat(user, "You inject the solution into the [src].")
|
||||
|
||||
if(S.reagents.has_reagent("phoron", 5))
|
||||
if(S.reagents.has_reagent(REAGENT_ID_PHORON, 5))
|
||||
|
||||
log_admin("LOG: [user.name] ([user.ckey]) injected a light with phoron, rigging it to explode.")
|
||||
message_admins("LOG: [user.name] ([user.ckey]) injected a light with phoron, rigging it to explode.")
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
var/phoron = (sheets+sheet_left)*20
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
if (environment)
|
||||
environment.adjust_gas_temp("phoron", phoron/10, temperature + T0C)
|
||||
environment.adjust_gas_temp(GAS_PHORON, phoron/10, temperature + T0C)
|
||||
|
||||
sheets = 0
|
||||
sheet_left = 0
|
||||
|
||||
@@ -37,11 +37,11 @@ var/global/list/rad_collectors = list()
|
||||
receive_pulse(rads * 5) //Maths is hard
|
||||
|
||||
if(P)
|
||||
if(P.air_contents.gas["phoron"] == 0)
|
||||
if(P.air_contents.gas[GAS_PHORON] == 0)
|
||||
investigate_log("<font color='red'>out of fuel</font>.","singulo")
|
||||
eject()
|
||||
else
|
||||
P.air_contents.adjust_gas("phoron", -0.001*drainratio)
|
||||
P.air_contents.adjust_gas(GAS_PHORON, -0.001*drainratio)
|
||||
return
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ var/global/list/rad_collectors = list()
|
||||
toggle_power()
|
||||
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
|
||||
"You turn the [src.name] [active? "on":"off"].")
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [P?"Fuel: [round(P.air_contents.gas["phoron"]/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [P?"Fuel: [round(P.air_contents.gas[GAS_PHORON]/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
|
||||
return
|
||||
else
|
||||
to_chat(user, span_red("The controls are locked!"))
|
||||
@@ -130,7 +130,7 @@ var/global/list/rad_collectors = list()
|
||||
/obj/machinery/power/rad_collector/proc/receive_pulse(var/pulse_strength)
|
||||
if(P && active)
|
||||
var/power_produced = 0
|
||||
power_produced = P.air_contents.gas["phoron"]*pulse_strength*20
|
||||
power_produced = P.air_contents.gas[GAS_PHORON]*pulse_strength*20
|
||||
add_avail(power_produced)
|
||||
last_power_new = power_produced
|
||||
return
|
||||
|
||||
@@ -362,7 +362,7 @@
|
||||
probability = 50
|
||||
|
||||
/datum/particle_smasher_recipe/phoron_valhollide
|
||||
reagents = list("phoron" = 10, "pacid" = 10)
|
||||
reagents = list(REAGENT_ID_PHORON = 10, "pacid" = 10)
|
||||
|
||||
result = /obj/item/stack/material/valhollide
|
||||
required_material = /obj/item/stack/material/phoron
|
||||
@@ -375,7 +375,7 @@
|
||||
probability = 10
|
||||
|
||||
/datum/particle_smasher_recipe/valhollide_supermatter
|
||||
reagents = list("phoron" = 300)
|
||||
reagents = list(REAGENT_ID_PHORON = 300)
|
||||
|
||||
result = /obj/item/stack/material/supermatter
|
||||
required_material = /obj/item/stack/material/valhollide
|
||||
@@ -404,7 +404,7 @@
|
||||
|
||||
/datum/particle_smasher_recipe/donkpockets_ascend
|
||||
items = list(/obj/item/reagent_containers/food/snacks/donkpocket)
|
||||
reagents = list("phoron" = 120)
|
||||
reagents = list(REAGENT_ID_PHORON = 120)
|
||||
|
||||
recipe_type = PS_RESULT_ITEM
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@
|
||||
damage = max( damage + min( ( (removed.temperature - CRITICAL_TEMPERATURE) / 150 ), damage_inc_limit ) , 0 )
|
||||
//Ok, 100% oxygen atmosphere = best reaction
|
||||
//Maxes out at 100% oxygen pressure
|
||||
oxygen = max(min((removed.gas["oxygen"] - (removed.gas["nitrogen"] * NITROGEN_RETARDATION_FACTOR)) / removed.total_moles, 1), 0)
|
||||
oxygen = max(min((removed.gas[GAS_O2] - (removed.gas[GAS_N2] * NITROGEN_RETARDATION_FACTOR)) / removed.total_moles, 1), 0)
|
||||
|
||||
//calculate power gain for oxygen reaction
|
||||
var/temp_factor
|
||||
@@ -368,8 +368,8 @@
|
||||
|
||||
//Release reaction gasses
|
||||
var/heat_capacity = removed.heat_capacity()
|
||||
removed.adjust_multi("phoron", max(device_energy / PHORON_RELEASE_MODIFIER, 0), \
|
||||
"oxygen", max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0))
|
||||
removed.adjust_multi(GAS_PHORON, max(device_energy / PHORON_RELEASE_MODIFIER, 0), \
|
||||
GAS_O2, max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0))
|
||||
|
||||
var/thermal_power = THERMAL_RELEASE_MODIFIER * device_energy
|
||||
if (debug)
|
||||
|
||||
Reference in New Issue
Block a user