Skip to content

Commit

Permalink
feat(content): Shocking flag (#4561)
Browse files Browse the repository at this point in the history
* Shocking flag

Added in the shocking json flag, changes to electrical weapons, electrified rapier, tonfa recipe adjustment. WIP.

* style(autofix.ci): automated formatting

* Undid hardcode

Undid the hardcode for the use actions, instead just added them in the json since that's way simpler.

* style(autofix.ci): automated formatting

* Update data/json/items/melee/bludgeons.json

Co-authored-by: Chaosvolt <[email protected]>

* Removed unused parameters

* Unhardcoded the shock tonfa

Since the shock tonfa's hardcode was throwing errors, I decided to un-hardcode that too.

* style(autofix.ci): automated formatting

* Formatting and description fix

* Update data/json/items/melee/bludgeons.json

Co-authored-by: Chaosvolt <[email protected]>

* Update data/json/items/melee/bludgeons.json

Co-authored-by: Chaosvolt <[email protected]>

* Update data/json/items/melee/swords_and_blades.json

Co-authored-by: Chaosvolt <[email protected]>

* Update data/json/items/melee/swords_and_blades.json

Co-authored-by: Chaosvolt <[email protected]>

* Update data/json/items/melee/swords_and_blades.json

Co-authored-by: Chaosvolt <[email protected]>

* Update data/json/items/melee/swords_and_blades.json

Co-authored-by: Chaosvolt <[email protected]>

* style(autofix.ci): automated formatting

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Chaosvolt <[email protected]>
  • Loading branch information
3 people authored Apr 30, 2024
1 parent cb25b7c commit d875c37
Show file tree
Hide file tree
Showing 12 changed files with 188 additions and 94 deletions.
5 changes: 5 additions & 0 deletions data/json/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,11 @@
"type": "json_flag",
"context": [ ]
},
{
"id": "SHOCKING",
"type": "json_flag",
"context": [ ]
},
{
"id": "SLEEP_IGNORE",
"type": "json_flag",
Expand Down
10 changes: 0 additions & 10 deletions data/json/item_actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -849,16 +849,6 @@
"id": "SHAVEKIT",
"name": { "str": "Shave" }
},
{
"type": "item_action",
"id": "SHOCKTONFA_OFF",
"name": { "str": "Turn on" }
},
{
"type": "item_action",
"id": "SHOCKTONFA_ON",
"name": { "str": "Turn off" }
},
{
"type": "item_action",
"id": "SIPHON",
Expand Down
47 changes: 37 additions & 10 deletions data/json/items/melee/bludgeons.json
Original file line number Diff line number Diff line change
Expand Up @@ -744,16 +744,22 @@
"id": "shock_staff",
"type": "TOOL",
"copy-from": "i_staff",
"name": { "str": "powered quarterstaff", "str_pl": "powered quarterstaves" },
"description": "This is an ironshod quarterstaff that has a high-voltage stun gun built into the handle. The stun gun is wired to the metal caps at either end of the staff, allowing you to zap a dangerous opponent should beating them senseless with it prove too hazardous.",
"name": { "str": "powered quarterstaff (off)", "str_pl": "powered quarterstaves (off)" },
"description": "This is an ironshod quarterstaff that has a high-voltage stun gun built into the handle. The stun gun is wired to the metal caps at either end of the staff, allowing you to zap a dangerous opponent with each strike. It is currently off.",
"weight": "2650 g",
"volume": "3250 ml",
"price": "80 USD",
"price_postapoc": "45 USD",
"bashing": 29,
"ammo": "battery",
"charges_per_use": 100,
"use_action": "TAZER",
"use_action": {
"type": "transform",
"msg": "You press a button and the staff crackles with electricity.",
"active": true,
"need_charges": 1,
"need_charges_msg": "The %s's batteries are dead.",
"target": "shock_staff_on"
},
"magazines": [
[
"battery",
Expand All @@ -762,6 +768,19 @@
],
"magazine_well": "500 ml"
},
{
"id": "shock_staff_on",
"copy-from": "shock_staff",
"type": "TOOL",
"name": { "str": "powered quarterstaff (on)", "str_pl": "powered quarterstaves (on)" },
"description": "This is an ironshod quarterstaff that has a high-voltage stun gun built into the handle. The stun gun is wired to the metal caps at either end of the staff, allowing you to zap a dangerous opponent with each strike. It is currently on.",
"revert_to": "shock_staff",
"revert_msg": "The %s's batteries run dry.",
"use_action": { "type": "transform", "msg": "You press a button and the staff turns off.", "target": "shock_staff" },
"extend": { "flags": [ "TRADER_AVOID", "SHOCKING" ] },
"power_draw": 5000000,
"magazine_well": "500 ml"
},
{
"id": "rock_sock",
"type": "GENERIC",
Expand Down Expand Up @@ -859,15 +878,21 @@
"type": "TOOL",
"copy-from": "tonfa",
"name": { "str": "tactical tonfa (off)", "str_pl": "tactical tonfas (off)" },
"description": "This is a reinforced plastic tonfa; the core is hollowed out and is filled with capacitors and a high-yield rechargeable storage battery. When a switch on the handle is pressed, a high-voltage current is transmitted to the two electrodes mounted in the end of the tonfa, and by extension to anyone unfortunate enough to be in contact with them. It also has a nifty flashlight, which is off at the moment.",
"description": "This is a reinforced plastic tonfa; the core is hollowed out and is filled with capacitors and a battery compartment. When a switch on the handle is pressed, a high-voltage current is transmitted to the two electrodes mounted in the end of the tonfa, and by extension to anyone unfortunate enough to be in contact with them. It's currently turned off.",
"weight": "726 g",
"volume": "2250 ml",
"price": "170 USD",
"price_postapoc": "25 USD",
"material": [ "plastic", "steel" ],
"ammo": "battery",
"charges_per_use": 1,
"use_action": "SHOCKTONFA_OFF",
"use_action": {
"type": "transform",
"msg": "You press a button and the tonfa crackles with electricity.",
"need_charges": 1,
"active": true,
"need_charges_msg": "The %s's batteries are dead.",
"target": "shocktonfa_on"
},
"flags": [ "DURABLE_MELEE", "NONCONDUCTIVE", "BELT_CLIP" ],
"magazines": [
[
Expand All @@ -882,10 +907,12 @@
"copy-from": "shocktonfa_off",
"type": "TOOL",
"name": { "str": "tactical tonfa (on)", "str_pl": "tactical tonfas (on)" },
"description": "This is a reinforced plastic tonfa; the core is hollowed out and is filled with capacitors and a high-yield rechargeable storage battery. When a switch on the handle is pressed, a high-voltage current is transmitted to the two electrodes mounted in the end of the tonfa, and by extension to anyone unfortunate enough to be in contact with them. It also has a nifty flashlight, which is currently active.",
"description": "This is a reinforced plastic tonfa; the core is hollowed out and is filled with capacitors and a battery compartment. When a switch on the handle is pressed, a high-voltage current is transmitted to the two electrodes mounted in the end of the tonfa, and by extension to anyone unfortunate enough to be in contact with them. It's currently turned on.",
"revert_to": "shocktonfa_off",
"use_action": "SHOCKTONFA_ON",
"extend": { "flags": [ "LIGHT_20", "TRADER_AVOID" ] },
"revert_msg": "The %s's batteries run dry.",
"use_action": { "type": "transform", "msg": "You press a button and the tonfa turns off.", "target": "shocktonfa_off" },
"extend": { "flags": [ "TRADER_AVOID", "SHOCKING" ] },
"power_draw": 5000000,
"magazine_well": "500 ml"
},
{
Expand Down
118 changes: 107 additions & 11 deletions data/json/items/melee/swords_and_blades.json
Original file line number Diff line number Diff line change
Expand Up @@ -1107,12 +1107,18 @@
"id": "shock_foil",
"type": "TOOL",
"copy-from": "fencing_foil_sharpened",
"name": { "str": "electrified foil" },
"description": "The modifications made to this fencing foil may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired through the electronic scoring circuit to the tip. Thrusting the sharpened tip into a foe and activating the momentary switch will deliver a painful electric shock.",
"name": { "str": "electrified foil (off)" },
"description": "The modifications made to this fencing foil may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired through the electronic scoring circuit to the tip. Activate the switch to elecrocute your foes!",
"ammo": "battery",
"charges_per_use": 100,
"price_postapoc": "1250 cent",
"use_action": "TAZER",
"use_action": {
"type": "transform",
"msg": "You press a button and the foil crackles with electricity.",
"active": true,
"need_charges": 1,
"need_charges_msg": "The %s's batteries are dead.",
"target": "shock_foil_on"
},
"extend": { "flags": [ "NONCONDUCTIVE" ] },
"relative": { "volume": "250 ml", "weight": "151 g" },
"magazines": [
Expand All @@ -1123,6 +1129,19 @@
],
"magazine_well": "500 ml"
},
{
"id": "shock_foil_on",
"copy-from": "shock_foil",
"type": "TOOL",
"name": { "str": "electrified foil (on)", "str_pl": "electrified foils (on)" },
"description": "The modifications made to this fencing foil may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired through the electronic scoring circuit to the tip. It is currently turned on.",
"revert_to": "shock_foil",
"revert_msg": "The %s's batteries run dry.",
"use_action": { "type": "transform", "msg": "You press a button and the foil turns off.", "target": "shock_foil" },
"extend": { "flags": [ "TRADER_AVOID", "SHOCKING" ] },
"power_draw": 5000000,
"magazine_well": "500 ml"
},
{
"id": "fencing_epee",
"type": "GENERIC",
Expand All @@ -1148,11 +1167,17 @@
"copy-from": "fencing_epee_sharpened",
"looks_like": "fencing_epee",
"name": { "str": "electrified épée" },
"description": "The modifications made to this fencing épée may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired through the electronic scoring circuit to the tip. Thrusting the sharpened tip into a foe and activating the momentary switch will deliver a painful electric shock.",
"description": "The modifications made to this fencing épée may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired through the electronic scoring circuit to the tip. Activate the switch to electrocute your foes!",
"ammo": "battery",
"price_postapoc": "1250 cent",
"charges_per_use": 100,
"use_action": "TAZER",
"use_action": {
"type": "transform",
"msg": "You press a button and the epee crackles with electricity.",
"active": true,
"need_charges": 1,
"need_charges_msg": "The %s's batteries are dead.",
"target": "shock_epee_on"
},
"extend": { "flags": [ "NONCONDUCTIVE" ] },
"relative": { "volume": "250 ml", "weight": "151 g" },
"magazines": [
Expand All @@ -1163,6 +1188,19 @@
],
"magazine_well": "500 ml"
},
{
"id": "shock_epee_on",
"copy-from": "shock_epee",
"type": "TOOL",
"name": { "str": "electrified epee (on)", "str_pl": "electrified epees (on)" },
"description": "The modifications made to this fencing épée may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired through the electronic scoring circuit to the tip. It is currently turned on.",
"revert_to": "shock_epee",
"revert_msg": "The %s's batteries run dry.",
"use_action": { "type": "transform", "msg": "You press a button and the epee turns off.", "target": "shock_epee" },
"extend": { "flags": [ "TRADER_AVOID", "SHOCKING" ] },
"power_draw": 5000000,
"magazine_well": "500 ml"
},
{
"id": "fencing_sabre",
"type": "GENERIC",
Expand All @@ -1186,12 +1224,18 @@
"type": "TOOL",
"copy-from": "fencing_sabre_sharpened",
"looks_like": "fencing_sabre",
"name": { "str": "electrified saber" },
"description": "The modifications made to this fencing saber may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired to the tip along the saber's groove. Thrusting the sharpened tip into a foe and activating the momentary switch will deliver a painful electric shock.",
"name": { "str": "electrified saber (off)", "str_pl": "electrified sabers (off)" },
"description": "The modifications made to this fencing saber may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired to the tip along the saber's groove. Activate the switch to electrocute your foes!",
"ammo": "battery",
"price_postapoc": "1250 cent",
"charges_per_use": 100,
"use_action": "TAZER",
"use_action": {
"type": "transform",
"msg": "You press a button and the sabre crackles with electricity.",
"active": true,
"need_charges": 1,
"need_charges_msg": "The %s's batteries are dead.",
"target": "shock_sabre_on"
},
"extend": { "flags": [ "NONCONDUCTIVE" ] },
"relative": { "volume": "250 ml", "weight": "151 g" },
"magazines": [
Expand All @@ -1202,6 +1246,19 @@
],
"magazine_well": "500 ml"
},
{
"id": "shock_sabre_on",
"copy-from": "shock_sabre",
"type": "TOOL",
"name": { "str": "electrified saber (on)", "str_pl": "electrified sabers (on)" },
"description": "The modifications made to this fencing saber may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired through the electronic scoring circuit to the tip. It is currently turned on.",
"revert_to": "shock_sabre",
"revert_msg": "The %s's batteries run dry.",
"use_action": { "type": "transform", "msg": "You press a button and the foil crackles with electricity.", "target": "shock_sabre" },
"extend": { "flags": [ "TRADER_AVOID", "SHOCKING" ] },
"power_draw": 5000000,
"magazine_well": "500 ml"
},
{
"id": "sword_cane",
"type": "GENERIC",
Expand Down Expand Up @@ -1291,6 +1348,45 @@
"qualities": [ [ "CUT", 1 ], [ "BUTCHER", 9 ] ],
"flags": [ "STAB", "DURABLE_MELEE", "SHEATH_SWORD", "NONCONDUCTIVE" ]
},
{
"id": "shock_rapier_off",
"type": "TOOL",
"copy-from": "rapier",
"name": { "str": "electrified rapier (off)", "str_pl": "electrified rapiers (off)" },
"description": "The modifications made to this rapier may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired to the tip along the saber's groove. Activate the switch to electrocute your foes!",
"ammo": "battery",
"price_postapoc": "1250 cent",
"use_action": {
"type": "transform",
"msg": "You press a button and the rapier crackles with electricity.",
"active": true,
"need_charges": 1,
"need_charges_msg": "The %s's batteries are dead.",
"target": "shock_rapier_on"
},
"extend": { "flags": [ "NONCONDUCTIVE" ] },
"relative": { "volume": "250 ml", "weight": "151 g" },
"magazines": [
[
"battery",
[ "medium_battery_cell", "medium_plus_battery_cell", "medium_atomic_battery_cell", "medium_disposable_cell" ]
]
],
"magazine_well": "500 ml"
},
{
"id": "shock_rapier_on",
"copy-from": "shock_rapier_off",
"type": "TOOL",
"name": { "str": "electrified rapier (on)", "str_pl": "electrified rapiers (on)" },
"description": "The modifications made to this rapier may not be sporting, but they might give you an edge in this final competition. Extra effort has been made to insulate the grip and a high voltage stun gun has been attached to the guard, wired through the electronic scoring circuit to the tip. It is currently turned on.",
"revert_to": "shock_rapier_off",
"revert_msg": "The %s's batteries run dry.",
"use_action": { "type": "transform", "msg": "You press a button and the rapier turns off.", "target": "shock_rapier_off" },
"extend": { "flags": [ "TRADER_AVOID", "SHOCKING" ] },
"power_draw": 5000000,
"magazine_well": "500 ml"
},
{
"id": "rapier_fake",
"type": "GENERIC",
Expand Down
9 changes: 6 additions & 3 deletions data/json/recipes/weapon/bashing.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@
"subcategory": "CSC_WEAPON_BASHING",
"skill_used": "fabrication",
"skills_required": [ "melee", 1 ],
"difficulty": 6,
"difficulty": 5,
"autolearn": true,
"time": "30 m",
"book_learn": [ [ "recipe_melee", 4 ] ],
"tools": [ [ [ "mold_plastic", -1 ] ], [ [ "surface_heat", 10, "LIST" ] ] ],
Expand All @@ -219,9 +220,10 @@
"category": "CC_WEAPON",
"subcategory": "CSC_WEAPON_BASHING",
"skill_used": "fabrication",
"skills_required": [ "bashing", 3 ],
"skills_required": [ "melee", 1 ],
"difficulty": 4,
"time": "30 m",
"autolearn": true,
"book_learn": [ [ "recipe_melee", 3 ] ],
"qualities": [ { "id": "CUT", "level": 1 } ],
"components": [ [ [ "2x4", 1 ], [ "stick", 2 ] ] ]
Expand All @@ -235,12 +237,13 @@
"skills_required": [ "electronics", 3 ],
"difficulty": 6,
"time": "45 m",
"autolearn": true,
"book_learn": [ [ "recipe_melee", 5 ] ],
"using": [ [ "soldering_standard", 10 ], [ "surface_heat", 10 ] ],
"qualities": [ { "id": "SCREW", "level": 1 } ],
"tools": [ [ [ "mold_plastic", -1 ] ] ],
"components": [
[ [ "plastic_chunk", 10 ] ],
[ [ "plastic_chunk", 10 ], [ "tonfa", 1 ] ],
[ [ "amplifier", 2 ] ],
[ [ "power_supply", 1 ] ],
[ [ "scrap", 2 ] ],
Expand Down
21 changes: 21 additions & 0 deletions data/json/recipes/weapon/piercing.json
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,27 @@
[ [ "cable", 10 ] ]
]
},
{
"type": "recipe",
"result": "shock_rapier_off",
"category": "CC_WEAPON",
"subcategory": "CSC_WEAPON_PIERCING",
"skill_used": "fabrication",
"skills_required": [ "electronics", 3 ],
"difficulty": 3,
"time": "15 m",
"reversible": true,
"book_learn": [ [ "textbook_electronics", 3 ], [ "advanced_electronics", 3 ], [ "recipe_melee", 4 ] ],
"using": [ [ "soldering_standard", 10 ] ],
"qualities": [ { "id": "SCREW", "level": 1 } ],
"components": [
[ [ "rapier", 1 ] ],
[ [ "fabric_hides_any", 1, "LIST" ] ],
[ [ "duct_tape", 100 ], [ "superglue", 1 ] ],
[ [ "tazer", 1 ] ],
[ [ "cable", 10 ] ]
]
},
{
"type": "recipe",
"result": "estoc",
Expand Down
1 change: 1 addition & 0 deletions src/flag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ const flag_id flag_ROLLER_ONE( "ROLLER_ONE" );
const flag_id flag_ROLLER_QUAD( "ROLLER_QUAD" );
const flag_id flag_SAFECRACK( "SAFECRACK" );
const flag_id flag_SEMITANGIBLE( "SEMITANGIBLE" );
const flag_id flag_SHOCKING( "SHOCKING" );
const flag_id flag_SILENT( "SILENT" );
const flag_id flag_SKINNED( "SKINNED" );
const flag_id flag_SKINTIGHT( "SKINTIGHT" );
Expand Down
1 change: 1 addition & 0 deletions src/flag.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ extern const flag_id flag_ROLLER_ONE;
extern const flag_id flag_ROLLER_QUAD;
extern const flag_id flag_SAFECRACK;
extern const flag_id flag_SEMITANGIBLE;
extern const flag_id flag_SHOCKING;
extern const flag_id flag_SILENT;
extern const flag_id flag_SKINNED;
extern const flag_id flag_SKINTIGHT;
Expand Down
2 changes: 0 additions & 2 deletions src/item_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,8 +1045,6 @@ void Item_factory::init()
add_iuse( "SEED", &iuse::seed );
add_iuse( "SEWAGE", &iuse::sewage );
add_iuse( "SHAVEKIT", &iuse::shavekit );
add_iuse( "SHOCKTONFA_OFF", &iuse::shocktonfa_off );
add_iuse( "SHOCKTONFA_ON", &iuse::shocktonfa_on );
add_iuse( "SIPHON", &iuse::siphon );
add_iuse( "SLEEP", &iuse::sleep );
add_iuse( "SMOKING", &iuse::smoking );
Expand Down
Loading

0 comments on commit d875c37

Please sign in to comment.