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

refactor: Energy Rework #5259

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1390328
Energy Rework Part 1
KheirFerrum Aug 27, 2024
5938e79
Energy Rework Part 2
KheirFerrum Aug 28, 2024
56336a4
Energy rework part 2.2
KheirFerrum Aug 28, 2024
0050481
Energy Rework Part 3
KheirFerrum Aug 29, 2024
b70c8f2
style(autofix.ci): automated formatting
autofix-ci[bot] Aug 29, 2024
4721751
style(autofix.ci): automated formatting (attempt 2/3)
autofix-ci[bot] Aug 29, 2024
eea45c0
quick fix
KheirFerrum Aug 29, 2024
30a6840
Update item.cpp
KheirFerrum Aug 29, 2024
6ee3e55
Merge branch 'upload' into The-BIG-FUCKING-energy-rework
KheirFerrum Aug 31, 2024
7ecabae
Energy Rework Part 4
KheirFerrum Aug 31, 2024
99334fb
Merge branch 'upload' into The-BIG-FUCKING-energy-rework
KheirFerrum Oct 2, 2024
416a8d0
style(autofix.ci): automated formatting
autofix-ci[bot] Oct 2, 2024
d151eb4
Energy Rework part 5.1
KheirFerrum Oct 2, 2024
2fc8ba7
Merge branch 'The-BIG-FUCKING-energy-rework' of https://github.com/Kh…
KheirFerrum Oct 2, 2024
4398981
Merge branch 'upload' into The-BIG-FUCKING-energy-rework
KheirFerrum Oct 4, 2024
1b16cdf
Energy Rework Part 5.2
KheirFerrum Oct 6, 2024
bafda51
Energy Rework Part 5.3
KheirFerrum Oct 30, 2024
4421a00
Simple escapes
KheirFerrum Nov 21, 2024
669b15e
Energy Rework 5.4
KheirFerrum Dec 1, 2024
23c6368
Fixes
KheirFerrum Dec 4, 2024
b43ff7d
Merge branch 'upload' into The-BIG-FUCKING-energy-rework
KheirFerrum Dec 4, 2024
044c705
JSON fixes
KheirFerrum Dec 4, 2024
a9a0e85
JSON Updates 1.1
KheirFerrum Dec 4, 2024
f96631f
style(autofix.ci): automated formatting
autofix-ci[bot] Dec 4, 2024
cbbb635
JSON updates
KheirFerrum Dec 6, 2024
eb6641b
Quick workover
KheirFerrum Dec 6, 2024
2f095bc
Modify unload function to account for batteries
KheirFerrum Jan 8, 2025
a420615
Merge branch 'upload' into The-BIG-FUCKING-energy-rework
KheirFerrum Jan 8, 2025
8cd471a
Energy Rework 6.1
KheirFerrum Jan 8, 2025
2f58ddf
Energy Rework 6.2
KheirFerrum Jan 10, 2025
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
106 changes: 48 additions & 58 deletions data/json/items/battery.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"max_capacity": "30 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE" ]
},
{
"id": "light_minus_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "ultra-light battery", "str_pl": "ultra-light batteries" },
"description": "This is a light battery cell designed for small size over everything else. It retains its universal compatibility, though.",
Expand All @@ -30,14 +29,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"capacity": 50,
"max_power": "50 kJ",
"initial_power": "50 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE" ]
},
{
"id": "light_minus_atomic_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "ultra-light plutonium battery", "str_pl": "ultra-light plutonium batteries" },
"description": "This battery uses a thin plutonium-244 rod to stabilize an exotic nanocompound, manufactured from repurposed plutonium fission cells. It is universally compatible with small devices. Although it stores a huge amount of power, it cannot be recharged.",
Expand All @@ -49,15 +48,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "green",
"ammo_type": "battery",
"count": 500,
"capacity": 500,
"max_power": "500 kJ",
"initial_power": "500 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "LEAK_DAM", "RADIOACTIVE" ]
},
{
"id": "light_minus_disposable_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "ultra-light disposable battery", "str_pl": "ultra-light disposable batteries" },
"description": "This is a light battery cell designed for small size over everything else. It retains its universal compatibility, though. The battery's chemistry means that it has a very high capacity, but cannot be recharged.",
Expand All @@ -68,15 +66,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"count": 150,
"capacity": 150,
"max_power": "150 kJ",
"initial_power": "150 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD" ]
},
{
"id": "light_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "light battery", "str_pl": "light batteries" },
"description": "This is a light battery cell, universally compatible with all kinds of small devices.",
Expand All @@ -88,14 +85,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"capacity": 100,
"max_power": "100 kJ",
"initial_power": "100 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE", "MAG_COMPACT" ]
},
{
"id": "light_plus_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "light battery (high-capacity)", "str_pl": "light batteries (high-capacity)" },
"description": "This is a high-capacity light battery cell, universally compatible with all kinds of small devices.",
Expand All @@ -106,14 +103,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"capacity": 150,
"max_power": "150 kJ",
"initial_power": "150 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE", "MAG_COMPACT" ]
},
{
"id": "light_atomic_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "light plutonium battery", "str_pl": "light plutonium batteries" },
"description": "This battery uses a thin plutonium-244 rod to stabilize an exotic nanocompound, manufactured from repurposed plutonium fission cells. It is universally compatible with all kinds of personal electronic devices. Although it stores a huge amount of power, it cannot be recharged.",
Expand All @@ -125,15 +122,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "green",
"ammo_type": "battery",
"count": 1000,
"capacity": 1000,
"max_power": "1000 kJ",
"initial_power": "1000 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "LEAK_DAM", "RADIOACTIVE", "MAG_COMPACT" ]
},
{
"id": "light_disposable_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "light disposable battery", "str_pl": "light disposable batteries" },
"description": "This is a light battery cell, universally compatible with all kinds of small devices. The battery's chemistry means that it has a very high capacity, but cannot be recharged.",
Expand All @@ -144,15 +140,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"count": 300,
"capacity": 300,
"max_power": "300 kJ",
"initial_power": "300 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "MAG_COMPACT" ]
},
{
"id": "medium_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "medium battery", "str_pl": "medium batteries" },
"description": "This is a medium battery cell, universally compatible with all kinds of appliances and power tools.",
Expand All @@ -164,14 +159,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"capacity": 500,
"max_power": "500 kJ",
"initial_power": "500 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE", "MAG_COMPACT" ]
},
{
"id": "medium_plus_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "medium battery (high-capacity)", "str_pl": "medium batteries (high-capacity)" },
"description": "This is a high-capacity medium battery cell, universally compatible with all kinds of appliances and power tools.",
Expand All @@ -182,14 +177,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"capacity": 750,
"max_power": "750 kJ",
"initial_power": "750 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE", "MAG_COMPACT" ]
},
{
"id": "medium_atomic_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "medium plutonium battery", "str_pl": "medium plutonium batteries" },
"description": "This battery uses a thin plutonium-244 rod to stabilize an exotic nanocompound, manufactured from repurposed plutonium fission cells. It is universally compatible with all kinds of appliances and power tools. Although it stores a huge amount of power, it cannot be recharged.",
Expand All @@ -201,15 +196,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "green",
"ammo_type": "battery",
"count": 5000,
"capacity": 5000,
"max_power": "5000 kJ",
"initial_power": "5000 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "LEAK_DAM", "RADIOACTIVE", "MAG_COMPACT" ]
},
{
"id": "medium_disposable_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "medium disposable battery", "str_pl": "medium disposable batteries" },
"description": "This is a medium battery cell, universally compatible with all kinds of appliances and power tools. The battery's chemistry means that it has a very high capacity, but cannot be recharged.",
Expand All @@ -220,15 +214,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"count": 1500,
"capacity": 1500,
"max_power": "1500 kJ",
"initial_power": "1500 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "MAG_COMPACT" ]
},
{
"id": "heavy_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "heavy battery", "str_pl": "heavy batteries" },
"description": "This is a heavy battery cell, universally compatible with all kinds of industrial-grade equipment and large tools.",
Expand All @@ -240,14 +233,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"capacity": 1000,
"max_power": "1000 kJ",
"initial_power": "1000 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE", "MAG_BULKY" ]
},
{
"id": "heavy_plus_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "heavy battery (high-capacity)", "str_pl": "heavy batteries (high-capacity)" },
"description": "This is a high-capacity heavy battery cell, universally compatible with all kinds of industrial-grade equipment and large tools.",
Expand All @@ -258,14 +251,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"capacity": 1500,
"max_power": "1500 kJ",
"initial_power": "1500 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "RECHARGE", "MAG_BULKY" ]
},
{
"id": "heavy_atomic_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "heavy plutonium battery", "str_pl": "heavy plutonium batteries" },
"description": "This battery uses a thin plutonium-244 rod to stabilize an exotic nanocompound, manufactured from repurposed plutonium fission cells. It is universally compatible with all kinds of industrial-grade equipment and large tools. Although it stores a huge amount of power, it cannot be recharged.",
Expand All @@ -277,15 +270,14 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "green",
"ammo_type": "battery",
"count": 10000,
"capacity": 10000,
"max_power": "10000 kJ",
"initial_power": "10000 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "LEAK_DAM", "RADIOACTIVE", "MAG_BULKY" ]
},
{
"id": "huge_atomic_battery_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "military plutonium fuel cell" },
"description": "This battery uses a huge plutonium-244 rod to stabilize an exotic nanocompound, manufactured from repurposed plutonium fission cells. It was used in military mech-suits, was highly experimental, and had no civilian applications. Although it stores a stupendous amount of power, it cannot be recharged.",
Expand All @@ -296,15 +288,14 @@
"material": [ "superalloy", "plastic" ],
"symbol": "=",
"color": "red",
"ammo_type": "battery",
"count": 100000,
"capacity": 100000,
"max_power": "100000 kJ",
"initial_power": "100000 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "MECH_BAT", "LEAK_DAM", "RADIOACTIVE" ]
},
{
"id": "heavy_disposable_cell",
"type": "MAGAZINE",
"type": "BATTERY",
"category": "battery",
"name": { "str": "heavy disposable battery", "str_pl": "heavy disposable batteries" },
"description": "This is a heavy battery cell, universally compatible with all kinds of industrial-grade equipment and large tools. The battery's chemistry means that it has a very high capacity, but cannot be recharged.",
Expand All @@ -315,9 +306,8 @@
"material": [ "iron", "plastic" ],
"symbol": "=",
"color": "yellow",
"ammo_type": "battery",
"count": 3000,
"capacity": 3000,
"max_power": "3000 kJ",
"initial_power": "3000 kJ",
"looks_like": "battery",
"flags": [ "NO_SALVAGE", "NO_UNLOAD", "MAG_BULKY" ]
}
Expand Down
40 changes: 0 additions & 40 deletions data/json/items/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -2545,46 +2545,6 @@
"volume": "5 ml",
"to_hit": -3,
"max_charges": 200000000,
"rand_charges": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
50,
100,
200,
300,
500,
800,
1000,
1200,
1400,
1600,
1800,
2000,
3000,
4000,
5000,
6000,
7000,
8000,
9000,
10000,
12000,
14000,
16000,
18000,
20000,
50000,
100000
],
"ammo": "money"
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/tool/cooking.json
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@
"symbol": ";",
"color": "red",
"ammo": "battery",
"power_draw": 1500000,
"power_draw": "1J",
"qualities": [ [ "CONTAIN", 1 ] ],
"use_action": "MULTICOOKER",
"magazines": [
Expand Down
3 changes: 1 addition & 2 deletions data/json/items/tool/electronics.json
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,6 @@
"target": "bionic_scanner_on",
"msg": "You start scanning for bionics.",
"active": true,
"need_charges": 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this will if I recall let you turn it on even when it has zero power? Unless 1 is a default in the code already.

Copy link
Collaborator Author

@KheirFerrum KheirFerrum Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary while I'm testing, since batteries don't have charges in the rework. There's not a whole lot of point in reviewing my work at this stage, it's very preliminary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, aight. Hope it goes well then. :D

"need_charges_msg": "The scanner doesn't have enough power.",
"type": "transform"
},
Expand Down Expand Up @@ -610,7 +609,7 @@
"color": "magenta",
"use_action": "NOTE_BIONICS",
"revert_to": "bionic_scanner",
"power_draw": 10000,
"power_draw": "100 J",
"revert_msg": "The %s shuts down."
}
]
1 change: 0 additions & 1 deletion data/json/items/tool/fire.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"material": [ "plastic", "aluminum" ],
"symbol": ",",
"color": "blue",
"rand_charges": [ 1, 10, 12, 15, 16, 22, 44, 50, 67, 75, 82, 100 ],
"max_charges": 100,
"charges_per_use": 1,
"use_action": { "type": "firestarter", "moves": 50 },
Expand Down
1 change: 0 additions & 1 deletion data/json/obsoletion/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"name": { "str": "active makeshift grenade" },
"description": "This is an active grenade, and will explode any second now. Better throw it!",
"price": "0 cent",
"rand_charges": [ 2, 7 ],
"max_charges": 7,
"turns_per_charge": 1,
"use_action": {
Expand Down
Loading
Loading