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
New option in options.cfg: canConvertAmmoToElerium #341
Conversation
Default: OFF Have you ever dreamed that you can convert your elerium-based ammunition back to elerium? :) Which you got a lot from UFOs of course. Think about it. The gunpowder can be extracted from a bullet, why can't we simple extract elerium from the elerium-based ammo too? Now you can do this. :) Just turn on canConvertAmmoToElerium in options.cfg, and you can manufacture Elerium-115 from Plasma Pistol Clip, Plasma Rifle Clip, etc., and from Alien Grenade. (of course the clip/grenade must be researched first to convert back) The manufacture time-cost is half of the clip's manufacture time-cost, and money cost is 0 of course. (since we just disassemblying the ammo)
This looks like the type of feature that would better belong in a ruleset instead of hardcoding it into the game. |
Ruleset itself is not enough for this. (and can't be turned on/off with a single switch) Since one Heavy Plasma Clip contains 3 pieces of Elerium, and can't set 1/3 as required quantity. (1/3 Heavy Plasma Clip -> 1 Elerium) |
Ok, i'm suspending this PR until #348 got merged. (conflicts) |
this is totally a mod. there's a better way to implement it, add a ratio to manufacture items to allow multiple items out from one item in, add some string magic so you can define something like "STR_PLASMA_RIFLE_CLIP -> STR_ELERIUM x3" modifications that will allow this behaviour to be defined in the ruleset would be a much better solution than adding an option switch. |
Ok, suppose i'll do that, and this thing goes to the ruleset. How do you want to make it optional? Ruleset is unique, so this thing would be turned on permanently. Do you want me to make an option which actually removes or keeps rules from the already read-in ruleset? |
just define an ItemsOut field or something in the RuleManufacture, and have it default to 1, so you don't even have to define it in the ruleset. and at the point of adding the newly produced item to the base, factor in this variable. as for the string magic... follow similar logic, set a vector of strings as the "_longName" variable in RuleManufacture, and modify the RuleManufacture->GetName() to include an IF statement to see if it should return the name, or the concatenated _longName strings based on whether or not a _longName is defined. |
Rulesets aren't unique, they're modular - http://openxcom.org/forum/index.php/topic,670.0.html - and the ultimate goal is for people to be able to make and pick the combination of rulesets they want, instead of a monolithic approach. Just because this is undocumented unfinished behavior doesn't mean it's not there. |
Default: OFF
Have you ever dreamed that you can convert your elerium-based ammunition back to elerium? :) Which you got a lot from UFOs of course.
Think about it. The gunpowder can be extracted from a bullet, why can't we simple extract elerium from the elerium-based ammo too?
Now you can do this. :)
Just turn on canConvertAmmoToElerium in options.cfg, and you can manufacture Elerium-115 from Plasma Pistol Clip, Plasma Rifle Clip, etc., and from Alien Grenade. (of course the clip/grenade must be researched first to convert back)
The manufacture time-cost is half of the clip's manufacture time-cost, and money cost is 0 of course. (since we just disassemblying the ammo)