stuff
This commit is contained in:
@@ -76,6 +76,13 @@
|
||||
#define VV_HK_ADDCOMPONENT "addcomponent"
|
||||
#define VV_HK_MODIFY_TRAITS "modtraits"
|
||||
|
||||
// /datum/gas_mixture
|
||||
#define VV_HK_SET_MOLES "set_moles"
|
||||
#define VV_HK_EMPTY "empty"
|
||||
#define VV_HK_SET_TEMPERATURE "set_temp"
|
||||
#define VV_HK_PARSE_GASSTRING "parse_gasstring"
|
||||
#define VV_HK_SET_VOLUME "set_volume"
|
||||
|
||||
// /atom
|
||||
#define VV_HK_MODIFY_TRANSFORM "atom_transform"
|
||||
#define VV_HK_ADD_REAGENT "addreagent"
|
||||
|
||||
@@ -16,6 +16,8 @@ GLOBAL_LIST_INIT(meta_gas_dangers, meta_gas_danger_list())
|
||||
GLOBAL_LIST_INIT(meta_gas_ids, meta_gas_id_list())
|
||||
GLOBAL_LIST_INIT(meta_gas_fusions, meta_gas_fusion_list())
|
||||
/datum/gas_mixture
|
||||
/// Never ever set this variable, hooked into vv_get_var for view variables viewing.
|
||||
var/gas_list_view_only
|
||||
var/initial_volume = CELL_VOLUME //liters
|
||||
var/list/reaction_results
|
||||
var/list/analyzer_results //used for analyzer feedback - not initialized until its used
|
||||
@@ -29,9 +31,70 @@ GLOBAL_LIST_INIT(meta_gas_fusions, meta_gas_fusion_list())
|
||||
reaction_results = new
|
||||
|
||||
/datum/gas_mixture/vv_edit_var(var_name, var_value)
|
||||
if(var_name == "_extools_pointer_gasmixture")
|
||||
if(var_name == NAMEOF(src, _extools_pointer_gasmixture))
|
||||
return FALSE // please no. segfaults bad.
|
||||
if(var_name == NAMEOF(src, gas_list_view_only))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/gas_mixture/vv_get_var(var_name)
|
||||
. = ..()
|
||||
if(var_name == NAMEOF(gas_list_view_only))
|
||||
var/list/dummy = get_gases
|
||||
return debug_variables("gases (READ ONLY)", dummy, 0, src)
|
||||
|
||||
/datum/gas_mixture/vv_get_dropdown()
|
||||
. = ..()
|
||||
VV_DROPDOWN_OPTION(VV_HK_PARSE_GASSTRING, "Parse Gas String")
|
||||
VV_DROPDOWN_OPTION(VV_HK_EMPTY, "Empty")
|
||||
VV_DROPDOWN_OPTION(VV_HK_SET_MOLES, "Set Moles")
|
||||
VV_DROPDOWN_OPTION(VV_HK_SET_TEMPERATURE, "Set Temperature")
|
||||
VV_DROPDOWN_OPTION(VV_HK_SET_VOLUME, "Set Volume")
|
||||
|
||||
/datum/gas_mixture/vv_do_topic(list/href_list)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
if(href_list[VV_HK_PARSE_GASSTRING])
|
||||
var/gasstring = input(usr, "Input Gas String (WARNING: Advanced. Don't use this unless you know how these work.", "Gas String Parse") as text|null
|
||||
if(!istext(gasstring))
|
||||
return
|
||||
log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Set to gas string [gasstring].")
|
||||
message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Set to gas string [gasstring].")
|
||||
parse_gas_string(gasstring)
|
||||
if(href_list[VV_HK_EMPTY])
|
||||
log_admin("[key_name(usr)] emptied gas mixture [REF(src)].")
|
||||
message_admins("[key_name(usr)] emptied gas mixture [REF(src)].")
|
||||
clear()
|
||||
if(href_list[VV_HK_SET_MOLES])
|
||||
var/list/gases = return_gases()
|
||||
var/gastype = input(usr, "What kind of gas?", "Set Gas") as anything|null in subtypesof(/datum/gas)
|
||||
if(!ispath(gastype, /datum/gas))
|
||||
return
|
||||
var/amount = input(usr, "Input amount", "Set Gas", gases[gastype] || 0) as num|null
|
||||
if(!isnum(amount))
|
||||
return
|
||||
amount = max(0, amount)
|
||||
log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Set gas type [gastype] to [amount] moles.")
|
||||
message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Set gas type [gastype] to [amount] moles.")
|
||||
set_moles(gas_type, amount)
|
||||
if(href_list[VV_HK_SET_TEMPERATURE])
|
||||
var/temp = input(usr, "Set the temperature of this mixture to?", "Set Temperature", return_temperature()) as num|null
|
||||
if(!isnum(temp))
|
||||
return
|
||||
temp = max(2.7, temp)
|
||||
log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Changed temperature to [temp].")
|
||||
message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Changed temperature to [temp].")
|
||||
set_temperature(temp)
|
||||
if(href_list[VV_HK_SET_VOLUME])
|
||||
var/volume = input(usr, "Set the volume of this mixture to?", "Set Volume", return_volume()) as num|null
|
||||
if(!isnum(volume))
|
||||
return
|
||||
volume = max(0, volume)
|
||||
log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Changed volume to [volume].")
|
||||
message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Changed volume to [volume].")
|
||||
set_volume(volume)
|
||||
|
||||
/*
|
||||
/datum/gas_mixture/Del()
|
||||
__gasmixture_unregister()
|
||||
@@ -169,7 +232,7 @@ GLOBAL_LIST_INIT(meta_gas_fusions, meta_gas_fusion_list())
|
||||
set_moles(path, text2num(gas[id]))
|
||||
archive()
|
||||
return 1
|
||||
|
||||
|
||||
/datum/gas_mixture/react(datum/holder)
|
||||
. = NO_REACTION
|
||||
if(!total_moles())
|
||||
|
||||
Reference in New Issue
Block a user