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

Fix for being unable to charge UPS and use UPS-modded tools without UPS #15116

Merged
merged 5 commits into from
Feb 1, 2016
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions data/json/items/obsolete.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
[
{
"id": "rechargeable_battery",
"type": "TOOL",
"symbol": ";",
"color": "light_green",
"name": "rechargeable battery mod",
"description": "A homemade, rechargeable power cell built from salvaged electronics. With enough electronics skill, you could attach it to an electric-powered device to provide it with energy. The power cell is not compatible with standard batteries; it must be re-energized via a special recharging station.",
"price": 2000,
"material": ["plastic", "aluminum"],
"weight": 142,
"volume": 1,
"to_hit": -2,
"max_charges": 0,
"initial_charges": 0,
"charges_per_use": 0,
"turns_per_charge": 0,
"ammo": "NULL",
"revert_to": "null",
"category" : "spare_parts",
"use_action": "UPS_BATTERY"
},
{
"id": "saiga_sawn",
"type": "GUN",
Expand Down
31 changes: 6 additions & 25 deletions data/json/items/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,8 @@
"turns_per_charge": 0,
"ammo": "battery",
"revert_to": "null",
"use_action": "ROBOTCONTROL"
"use_action": "ROBOTCONTROL",
"flags": ["NO_UNLOAD", "RECHARGE"]
},
{
"id": "sarcophagus_access_code",
Expand Down Expand Up @@ -4227,7 +4228,8 @@
"charges_per_use": 0,
"turns_per_charge": 0,
"ammo": "battery",
"revert_to": "null"
"revert_to": "null",
"flags": ["NO_UNLOAD", "RECHARGE"]
},
{
"id": "adv_UPS_off",
Expand All @@ -4236,7 +4238,7 @@
"color": "light_green",
"name": "advanced UPS",
"name_plural": "advanced UPS's",
"description": "This is an advanced version of the unified power supply, or UPS. This device has been significantly redesigned to provide better efficiency as well as to consume plutonium fuel cells rather than batteries.",
"description": "This is an advanced version of the unified power supply, or UPS. This device has been significantly redesigned to provide better efficiency as well as to consume plutonium fuel cells rather than batteries. Sadly, it's plutonium reactor can't be charged in UPS charging station.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be "its", not "it's".

"price": 560000,
"material": ["aluminum", "plastic"],
"weight": 453,
Expand Down Expand Up @@ -4302,7 +4304,7 @@
"price" : 17000,
"material" : ["plastic", "steel"],
"techniques" : ["WBLOCK_2", "RAPID"],
"flags" : ["DURABLE_MELEE"],
"flags" : ["DURABLE_MELEE", "NO_UNLOAD", "RECHARGE"],
"weight" : 726,
"volume" : 9,
"bashing" : 14,
Expand Down Expand Up @@ -9209,27 +9211,6 @@
"category" : "spare_parts",
"use_action": "ATOMIC_BATTERY"
},
{
"id": "rechargeable_battery",
"type": "TOOL",
"symbol": ";",
"color": "light_green",
"name": "rechargeable battery mod",
"description": "A homemade, rechargeable power cell built from salvaged electronics. With enough electronics skill, you could attach it to an electric-powered device to provide it with energy. The power cell is not compatible with standard batteries; it must be re-energized via a special recharging station.",
"price": 2000,
"material": ["plastic", "aluminum"],
"weight": 142,
"volume": 1,
"to_hit": -2,
"max_charges": 0,
"initial_charges": 0,
"charges_per_use": 0,
"turns_per_charge": 0,
"ammo": "NULL",
"revert_to": "null",
"category" : "spare_parts",
"use_action": "UPS_BATTERY"
},
{
"id": "battery_ups",
"type": "TOOL",
Expand Down
1 change: 1 addition & 0 deletions data/json/recipes/recipe_electronics.json
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@
],
"components": [
[ [ "power_supply", 4 ] ],
[ [ "small_storage_battery", 1 ] ],
[ [ "amplifier", 3 ] ],
[ [ "scrap", 4 ] ],
[ [ "cable", 10 ] ]
Expand Down
4 changes: 2 additions & 2 deletions data/json/vehicle_parts.json
Original file line number Diff line number Diff line change
Expand Up @@ -4977,9 +4977,9 @@
"type" : "vehicle_part",
"id" : "recharge_station",
"name" : "UPS-compatible recharging station",
"symbol" : "#",
"symbol" : "o",
"color" : "light_green",
"broken_symbol" : "0",
"broken_symbol" : "#",
"broken_color" : "blue",
"damage_modifier" : 10,
"durability" : 20,
Expand Down
2 changes: 2 additions & 0 deletions data/json/vehicles/military.json
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,7 @@
"parts" : [
{"x": 0, "y": 1, "part": "hdframe_vertical_2"},
{"x": 0, "y": 1, "part": "box"},
{"x": 0, "y": 1, "part": "recharge_station"},
{"x": 0, "y": 1, "part": "hdroof"},
{"x": 0, "y": 2, "part": "hdframe_vertical_2"},
{"x": 0, "y": 2, "part": "seat"},
Expand Down Expand Up @@ -952,6 +953,7 @@
"parts" : [
{"x": 0, "y": 1, "part": "hdframe_vertical_2"},
{"x": 0, "y": 1, "part": "box"},
{"x": 0, "y": 1, "part": "recharge_station"},
{"x": 0, "y": 1, "part": "hdroof"},
{"x": 0, "y": 2, "part": "hdframe_vertical_2"},
{"x": 0, "y": 2, "part": "seat"},
Expand Down
2 changes: 1 addition & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11610,7 +11610,7 @@ void game::unload( item &it )
}

if( target->has_flag( "NO_UNLOAD" ) ) {
if( target->has_flag( "RECHARGE" ) ) {
if( target->has_flag( "RECHARGE" ) || target->has_flag( "USE_UPS" )) {
add_msg( m_info, _( "You can't unload a rechargeable %s!" ), target->tname().c_str() );
} else {
add_msg( m_info, _( "You can't unload a %s!" ), target->tname().c_str() );
Expand Down