-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[READY]Circuit balance #35931
[READY]Circuit balance #35931
Changes from 8 commits
ded7b21
9a3b665
f4ac22d
e0306df
d85acaf
ed0bf90
9b788bc
6a9b7c0
97177bf
23ff52b
8f408d0
a2eb4d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,11 +97,19 @@ | |
activators = list() | ||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH | ||
var/volume = 60 | ||
var/list/fuel = list("plasma" = 10000, "welding_fuel" = 3000, "carbon" = 2000, "ethanol" = 2000, "nutriment" = 1600, "blood" = 1000) | ||
var/list/fuel = list("plasma" = 50000, "welding_fuel" = 15000, "carbon" = 10000, "ethanol" = 10000, "nutriment" = 8000) | ||
var/multi = 1 | ||
var/lfwb | ||
|
||
/obj/item/integrated_circuit/passive/power/chemical_cell/New() | ||
..() | ||
create_reagents(volume) | ||
var/p = text2path("/datum/config_entry/flag/disable_human_mood") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are you trying to do here ? Why is this path a string and why are you not using the common config helpers? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because there is no such flag in game yet.So it is error safe version of flag check. |
||
if(p) | ||
if(!global.config.Get(p)) | ||
lfwb = TRUE | ||
extended_desc +="But no fuel can be compared with blood of living human." | ||
|
||
|
||
/obj/item/integrated_circuit/passive/power/chemical_cell/interact(mob/user) | ||
set_pin_data(IC_OUTPUT, 2, WEAKREF(src)) | ||
|
@@ -115,7 +123,18 @@ | |
/obj/item/integrated_circuit/passive/power/chemical_cell/make_energy() | ||
if(assembly) | ||
if(assembly.battery) | ||
var/bp = 5000 | ||
if(reagents.get_reagent_amount("blood")) //only blood is powerful enough to power the station(c) | ||
var/datum/reagent/blood/B = locate() in reagents.reagent_list | ||
if(lfwb) | ||
if(B && B.data["cloneable"]) | ||
var/mob/M = B.data["donor"] | ||
if(M && M.stat != DEAD && M.client) | ||
bp = 500000 | ||
if((assembly.battery.maxcharge-assembly.battery.charge) / GLOB.CELLRATE > bp) | ||
if(reagents.remove_reagent("blood", 1)) | ||
assembly.give_power(bp) | ||
for(var/I in fuel) | ||
if((assembly.battery.maxcharge-assembly.battery.charge) / GLOB.CELLRATE > fuel[I]) | ||
if(reagents.remove_reagent(I, 1)) | ||
assembly.give_power(fuel[I]) | ||
assembly.give_power(fuel[I]*multi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fairly performance-sensitive proc so I recommend making a different version like GetAllContentsOfType or something, alternatively put your if before the while and have a different loop based on whether you're looking for specific types only or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok