Skip to content
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

Jsonize bionic power gen from sunlight and wind #35643

Merged
merged 11 commits into from
Nov 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions data/json/items/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@
"flags": [ "PSEUDO", "PERPETUAL" ],
"fuel": { "energy": 1 }
},
{
"type": "GENERIC",
"//": "pseudo item, used as fuel type for CBMs that are sun-powered",
"id": "sunlight",
"symbol": "?",
"color": "white",
"name": "sun light",
"name_plural": "none",
"description": "seeing this is a bug",
"stackable": true,
"price": 0,
"volume": 0,
"flags": [ "PSEUDO", "PERPETUAL" ],
"fuel": { "energy": 1 }
},
{
"type": "GENERIC",
"//": "pseudo item, used as fuel type for CBMs that are metabolism-powered",
Expand Down
9 changes: 9 additions & 0 deletions data/mods/Aftershock/items/afs_cbms.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
"price": 350000,
"difficulty": 4
},
{
"id": "afs_bio_wind_turbine",
"copy-from": "bionic_general",
"type": "BIONIC_ITEM",
"name": "Wind Turbine CBM",
"description": "Installed on your body is a set of small retractable wind turbines. When activated, they will deploy and slowly harvest wind power to recharge your power level.",
"price": 350000,
"difficulty": 4
},
{
"id": "afs_bio_precision_solderers",
"copy-from": "bionic_general",
Expand Down
11 changes: 10 additions & 1 deletion data/mods/Aftershock/maps/afs_item_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"items": [
[ "bio_furnace", 10 ],
[ "bn_bio_solar", 10 ],
[ "afs_bio_wind_turbine", 5 ],
[ "afs_bio_precision_solderers", 10 ],
[ "afs_bio_missiles", 10 ],
[ "afs_bio_linguistic_coprocessor", 10 ],
Expand All @@ -42,6 +43,7 @@
"items": [
[ "bio_furnace", 10 ],
[ "bn_bio_solar", 10 ],
[ "afs_bio_wind_turbine", 5 ],
[ "afs_bio_precision_solderers", 5 ],
[ "afs_bio_linguistic_coprocessor", 8 ]
]
Expand All @@ -57,14 +59,21 @@
"items": [
[ "bio_furnace", 5 ],
[ "bn_bio_solar", 5 ],
[ "afs_bio_wind_turbine", 2 ],
[ "afs_bio_precision_solderers", 7 ],
[ "afs_bio_linguistic_coprocessor", 5 ]
]
},
{
"id": "bionics_op",
"type": "item_group",
"items": [ [ "bio_furnace", 15 ], [ "bn_bio_solar", 15 ], [ "afs_bio_missiles", 10 ], [ "afs_bio_dopamine_stimulators", 10 ] ]
"items": [
[ "bio_furnace", 15 ],
[ "bn_bio_solar", 15 ],
[ "afs_bio_wind_turbine", 10 ],
[ "afs_bio_missiles", 10 ],
[ "afs_bio_dopamine_stimulators", 10 ]
]
},
{
"id": "bionics_subs",
Expand Down
17 changes: 15 additions & 2 deletions data/mods/Aftershock/player/afs_bionics.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
[
{
"id": "bn_bio_solar",
"//": "That's right, it's taken from Bright Nights. Sue me!",
"type": "bionic",
"name": "Solar Panels",
"description": "Installed on your back is a set of retractable, reinforced solar panels resembling angular butterfly wings. When in direct sunlight, they will automatically deploy and slowly recharge your power level.",
"occupied_bodyparts": [ [ "TORSO", 10 ] ],
"flags": [ "BIONIC_POWER_SOURCE" ]
"fuel_options": [ "sunlight" ],
"fuel_efficiency": 1.0,
"time": 1,
"flags": [ "BIONIC_POWER_SOURCE", "BIONIC_TOGGLED" ]
},
{
"id": "afs_bio_wind_turbine",
"type": "bionic",
"name": "Wind Turbines",
"description": "Installed on your body is a set of small retractable wind turbines. When activated, they will deploy and slowly harvest wind power to recharge your power level.",
"occupied_bodyparts": [ [ "TORSO", 10 ] ],
"fuel_options": [ "wind" ],
"fuel_efficiency": 0.25,
"time": 1,
"flags": [ "BIONIC_POWER_SOURCE", "BIONIC_TOGGLED" ]
},
{
"id": "afs_bio_precision_solderers",
Expand Down
57 changes: 29 additions & 28 deletions doc/JSON_INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,34 +353,35 @@ This section describes each json file and their contents. Each json has their ow

### Bionics

| Identifier | Description
|--- |---
| id | Unique ID. Must be one continuous word, use underscores if necessary.
| name | In-game name displayed.
| active | Whether the bionic is active or passive. (default: `passive`)
| power_source | Whether the bionic provides power. (default: `false`)
| faulty | Whether it is a faulty type. (default: `false`)
| act_cost | How many kJ it costs to activate the bionic. Strings can be used "1 kJ"/"1000 J"/"1000000 mJ" (default: `0`)
| deact_cost | How many kJ it costs to deactivate the bionic. Strings can be used "1 kJ"/"1000 J"/"1000000 mJ" (default: `0`)
| react_cost | How many kJ it costs over time to keep this bionic active, does nothing without a non-zero "time". Strings can be used "1 kJ"/"1000 J"/"1000000 mJ" (default: `0`)
| time | How long, when activated, between drawing cost. If 0, it draws power once. (default: `0`)
| description | In-game description.
| encumbrance | (_optional_) A list of body parts and how much this bionic encumber them.
| weight_capacity_bonus | (_optional_) Bonus to weight carrying capacity in grams, can be negative. Strings can be used - "5000 g" or "5 kg" (default: `0`)
| weight_capacity_modifier | (_optional_) Factor modifying base weight carrying capacity. (default: `1`)
| canceled_mutations | (_optional_) A list of mutations/traits that are removed when this bionic is installed (e.g. because it replaces the fault biological part).
| included_bionics | (_optional_) Additional bionics that are installed automatically when this bionic is installed. This can be used to install several bionics from one CBM item, which is useful as each of those can be activated independently.
| included | (_optional_) Whether this bionic is included with another. If true this bionic does not require a CBM item to be defined. (default: `false`)
| env_protec | (_optional_) How much environmental protection does this bionic provide on the specified body parts.
| occupied_bodyparts | (_optional_) A list of body parts occupied by this bionic, and the number of bionic slots it take on those parts.
| capacity | (_optional_) Amount of power storage added by this bionic. Strings can be used "1 kJ"/"1000 J"/"1000000 mJ" (default: `0`)
| fuel_options | (_optional_) A list of fuel that this bionic can use to produce bionic power.
| fuel_capacity | (_optional_) Volume of fuel this bionic can store.
| fuel_efficiency | (_optional_) Fraction of fuel energy converted into power. (default: `0`)
| passive_fuel_efficiency | (_optional_) Fraction of fuel energy passively converted into power. Only useful for muscle powered CBM (default: `0`)
| exothermic_power_gen | (_optional_) If true this bionic emits heat when producing power. (default: `false`)
| power_gen_emission | (_optional_) `emit_id` of the field emitted by this bionic when it produces energy. Emit_ids are defined in `emit.json`.
| stat_bonus | (_optional_) List of passive stat bonus. Stat are designated as follow: "DEX", "INT", "STR", "PER".
| Identifier | Description
|--- |---
| id | Unique ID. Must be one continuous word, use underscores if necessary.
| name | In-game name displayed.
| active | Whether the bionic is active or passive. (default: `passive`)
| power_source | Whether the bionic provides power. (default: `false`)
| faulty | Whether it is a faulty type. (default: `false`)
| act_cost | How many kJ it costs to activate the bionic. Strings can be used "1 kJ"/"1000 J"/"1000000 mJ" (default: `0`)
| deact_cost | How many kJ it costs to deactivate the bionic. Strings can be used "1 kJ"/"1000 J"/"1000000 mJ" (default: `0`)
| react_cost | How many kJ it costs over time to keep this bionic active, does nothing without a non-zero "time". Strings can be used "1 kJ"/"1000 J"/"1000000 mJ" (default: `0`)
| time | How long, when activated, between drawing cost. If 0, it draws power once. (default: `0`)
| description | In-game description.
| encumbrance | (_optional_) A list of body parts and how much this bionic encumber them.
| weight_capacity_bonus | (_optional_) Bonus to weight carrying capacity in grams, can be negative. Strings can be used - "5000 g" or "5 kg" (default: `0`)
| weight_capacity_modifier | (_optional_) Factor modifying base weight carrying capacity. (default: `1`)
| canceled_mutations | (_optional_) A list of mutations/traits that are removed when this bionic is installed (e.g. because it replaces the fault biological part).
| included_bionics | (_optional_) Additional bionics that are installed automatically when this bionic is installed. This can be used to install several bionics from one CBM item, which is useful as each of those can be activated independently.
| included | (_optional_) Whether this bionic is included with another. If true this bionic does not require a CBM item to be defined. (default: `false`)
| env_protec | (_optional_) How much environmental protection does this bionic provide on the specified body parts.
| occupied_bodyparts | (_optional_) A list of body parts occupied by this bionic, and the number of bionic slots it take on those parts.
| capacity | (_optional_) Amount of power storage added by this bionic. Strings can be used "1 kJ"/"1000 J"/"1000000 mJ" (default: `0`)
| fuel_options | (_optional_) A list of fuel that this bionic can use to produce bionic power.
| fuel_capacity | (_optional_) Volume of fuel this bionic can store.
| fuel_efficiency | (_optional_) Fraction of fuel energy converted into power. (default: `0`)
| passive_fuel_efficiency | (_optional_) Fraction of fuel energy passively converted into power. Useful for CBM using PERPETUAL fuel like `muscle`, `wind` or `sun_light`. (default: `0`)
| exothermic_power_gen | (_optional_) If true this bionic emits heat when producing power. (default: `false`)
| coverage_power_gen_penalty | (_optional_) Fraction of coverage diminishing fuel_efficiency. Float between 0.0 and 1.0. (default: `nullopt`)
| power_gen_emission | (_optional_) `emit_id` of the field emitted by this bionic when it produces energy. Emit_ids are defined in `emit.json`.
| stat_bonus | (_optional_) List of passive stat bonus. Stat are designated as follow: "DEX", "INT", "STR", "PER".

```C++
{
Expand Down
Loading