Skip to content

Commit

Permalink
Use ammo_effect_str_id instead of std::string (#73931)
Browse files Browse the repository at this point in the history
* Use ammo_effect_str_id instead of std::string

* replace RECOVER_ flag with a new field

* Update json

* Update doc

* remove unused ammo_effect

* update mods

* fix ids for clang

---------

Co-authored-by: Fris0uman <[email protected]>
  • Loading branch information
Fris0uman and Fris0uman authored Jun 15, 2024
1 parent fd7656a commit 0c7dd6a
Show file tree
Hide file tree
Showing 40 changed files with 320 additions and 220 deletions.
5 changes: 0 additions & 5 deletions data/json/ammo_effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,6 @@
"type": "ammo_effect",
"//": "Applies sensor-stunning effect to robots. Hardcoded"
},
{
"id": "RECOVER_X",
"type": "ammo_effect",
"//": " Has a [(X-1)/X] probability to create a single charge of the used ammo at the point of impact. Change the X with any number, like 'RECOVER_2' means [(2-1)/2]=50% chance. Hardcoded"
},
{
"id": "RECYCLED",
"type": "ammo_effect",
Expand Down
6 changes: 4 additions & 2 deletions data/json/items/ammo.json
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,8 @@
"dispersion": 14,
"loudness": 0,
"to_hit": -2,
"effects": [ "NEVER_MISFIRES", "NON_FOULING", "RECOVER_80" ],
"recovery_chance": 80,
"effects": [ "NEVER_MISFIRES", "NON_FOULING" ],
"melee_damage": { "cut": 9 }
},
{
Expand All @@ -560,7 +561,8 @@
"dispersion": 14,
"loudness": 0,
"to_hit": -1,
"effects": [ "NEVER_MISFIRES", "NON_FOULING", "RECOVER_80", "ALLOWS_BODY_BLOCK" ],
"recovery_chance": 80,
"effects": [ "NEVER_MISFIRES", "NON_FOULING", "ALLOWS_BODY_BLOCK" ],
"qualities": [ [ "HAMMER", 1 ] ],
"melee_damage": { "bash": 7 }
},
Expand Down
6 changes: 4 additions & 2 deletions data/json/items/generic/toys_and_sports.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"dispersion": 14,
"loudness": 0,
"to_hit": -3,
"effects": [ "NEVER_MISFIRES", "NON_FOULING", "RECOVER_60" ],
"recovery_chance": 60,
"effects": [ "NEVER_MISFIRES", "NON_FOULING" ],
"melee_damage": { "bash": 8 }
},
{
Expand Down Expand Up @@ -163,7 +164,8 @@
"dispersion": 12,
"loudness": 0,
"to_hit": 3,
"effects": [ "NEVER_MISFIRES", "NON_FOULING", "RECOVER_80" ],
"recovery_chance": 80,
"effects": [ "NEVER_MISFIRES", "NON_FOULING" ],
"melee_damage": { "bash": 6 }
},
{
Expand Down
37 changes: 21 additions & 16 deletions data/json/items/ranged/archery.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"description": "A crude pointed wooden shaft with a notch at the back.",
"material": [ "wood" ],
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.75 },
"effects": [ "RECOVER_2" ]
"recovery_chance": 2
},
{
"type": "AMMO",
Expand All @@ -33,7 +33,7 @@
"dispersion": 150,
"loudness": 0,
"critical_multiplier": 10,
"effects": [ "RECOVER_30" ],
"recovery_chance": 30,
"melee_damage": { "bash": 3 }
},
{
Expand All @@ -50,7 +50,8 @@
"material": [ { "type": "wood", "portion": 81 }, { "type": "rubber", "portion": 19 } ],
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.2 },
"critical_multiplier": 1,
"effects": [ "RECOVER_35", "BEANBAG" ]
"recovery_chance": 35,
"effects": [ "BEANBAG" ]
},
{
"type": "AMMO",
Expand All @@ -63,7 +64,8 @@
"copy-from": "arrow_field_point_fletched",
"price_postapoc": "15 cent",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.5 },
"effects": [ "RECOVER_10", "NOGIB" ]
"recovery_chance": 10,
"effects": [ "NOGIB" ]
},
{
"type": "AMMO",
Expand All @@ -76,7 +78,7 @@
"relative": { "dispersion": -40 },
"price": "20 USD",
"damage": { "damage_type": "stab", "armor_penetration": 1, "constant_damage_multiplier": 1.5 },
"effects": [ "RECOVER_25" ],
"recovery_chance": 25,
"melee_damage": { "bash": 2, "cut": 1 }
},
{
Expand All @@ -90,7 +92,7 @@
"material": [ "wood" ],
"copy-from": "arrow_field_point_fletched",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.75 },
"effects": [ "RECOVER_6" ]
"recovery_chance": 6
},
{
"type": "AMMO",
Expand All @@ -103,7 +105,8 @@
"copy-from": "arrow_field_point_fletched",
"price_postapoc": "25 cent",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.5 },
"effects": [ "RECOVER_35", "NOGIB" ]
"recovery_chance": 35,
"effects": [ "NOGIB" ]
},
{
"type": "AMMO",
Expand All @@ -118,7 +121,7 @@
"price_postapoc": "15 cent",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 1.25 },
"show_stats": true,
"effects": [ "RECOVER_8" ]
"recovery_chance": 8
},
{
"type": "AMMO",
Expand All @@ -132,7 +135,7 @@
"price_postapoc": "20 cent",
"damage": { "damage_type": "stab", "armor_penetration": 1 },
"show_stats": true,
"effects": [ "RECOVER_20" ],
"recovery_chance": 20,
"melee_damage": { "bash": 2 }
},
{
Expand All @@ -148,7 +151,7 @@
"price_postapoc": "40 cent",
"damage": { "damage_type": "stab", "armor_penetration": 1, "constant_damage_multiplier": 1.5 },
"range": 2,
"effects": [ "RECOVER_35" ],
"recovery_chance": 35,
"melee_damage": { "bash": 3, "cut": 2 }
},
{
Expand All @@ -164,7 +167,7 @@
"price_postapoc": "40 cent",
"damage": { "damage_type": "stab", "armor_penetration": 3 },
"range": 2,
"effects": [ "RECOVER_40" ],
"recovery_chance": 40,
"melee_damage": { "bash": 3, "cut": 2 }
},
{
Expand All @@ -181,7 +184,8 @@
"relative": { "dispersion": -75 },
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.5 },
"range": 2,
"effects": [ "RECOVER_45", "NOGIB" ]
"recovery_chance": 45,
"effects": [ "NOGIB" ]
},
{
"type": "AMMO",
Expand All @@ -197,7 +201,7 @@
"price_postapoc": "50 cent",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 1.75 },
"range": 4,
"effects": [ "RECOVER_30" ],
"recovery_chance": 30,
"melee_damage": { "bash": 1 }
},
{
Expand All @@ -220,7 +224,7 @@
"dispersion": 120,
"loudness": 0,
"critical_multiplier": 6,
"effects": [ "RECOVER_1000000" ],
"recovery_chance": 100,
"to_hit": { "grip": "solid", "length": "long", "surface": "point", "balance": "good" },
"flags": [ "UNBREAKABLE_MELEE", "NONCONDUCTIVE" ],
"melee_damage": { "bash": 10, "stab": 26 }
Expand All @@ -245,7 +249,7 @@
"count": 1,
"stack_size": 1,
"critical_multiplier": 10,
"effects": [ "RECOVER_35" ],
"recovery_chance": 35,
"use_action": {
"target": "arrow_flamming",
"target_timer": "20 seconds",
Expand All @@ -266,7 +270,8 @@
"symbol": "=",
"color": "brown",
"revert_to": "arrow_field_point_fletched",
"effects": [ "IGNITE", "RECOVER_35" ],
"recovery_chance": 35,
"effects": [ "IGNITE" ],
"flags": [ "TRADER_AVOID" ]
},
{
Expand Down
6 changes: 3 additions & 3 deletions data/json/items/ranged/atlatl.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"dispersion": 35,
"loudness": 0,
"critical_multiplier": 15,
"effects": [ "RECOVER_30" ],
"recovery_chance": 30,
"melee_damage": { "stab": 10 }
},
{
Expand All @@ -74,7 +74,7 @@
"dispersion": 35,
"loudness": 0,
"critical_multiplier": 15,
"effects": [ "RECOVER_25" ],
"recovery_chance": 25,
"melee_damage": { "stab": 8 }
},
{
Expand All @@ -95,7 +95,7 @@
"dispersion": 50,
"loudness": 0,
"critical_multiplier": 8,
"effects": [ "RECOVER_6" ],
"recovery_chance": 6,
"melee_damage": { "stab": 5 }
}
]
2 changes: 1 addition & 1 deletion data/json/items/ranged/ballista.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"dispersion": 35,
"loudness": 5,
"critical_multiplier": 2,
"effects": [ "RECOVER_50" ],
"recovery_chance": 50,
"melee_damage": { "stab": 12 }
}
]
27 changes: 15 additions & 12 deletions data/json/items/ranged/crossbows.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"price": "0 cent",
"price_postapoc": "20 cent",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.75 },
"effects": [ "RECOVER_2" ]
"recovery_chance": 2
},
{
"type": "AMMO",
Expand All @@ -26,7 +26,7 @@
"price": "5 USD",
"price_postapoc": "25 cent",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.75 },
"effects": [ "RECOVER_6" ]
"recovery_chance": 6
},
{
"type": "AMMO",
Expand All @@ -41,7 +41,8 @@
"price": "6 USD 50 cent",
"price_postapoc": "25 cent",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.5 },
"effects": [ "RECOVER_10", "NOGIB" ]
"recovery_chance": 10,
"effects": [ "NOGIB" ]
},
{
"type": "AMMO",
Expand All @@ -57,7 +58,7 @@
"price_postapoc": "30 cent",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 1.25 },
"show_stats": true,
"effects": [ "RECOVER_8" ]
"recovery_chance": 8
},
{
"type": "AMMO",
Expand All @@ -69,7 +70,7 @@
"copy-from": "bolt_wood_bodkin",
"relative": { "dispersion": 10 },
"damage": { "damage_type": "stab", "constant_damage_multiplier": 1.5, "armor_penetration": 1 },
"effects": [ "RECOVER_25" ]
"recovery_chance": 25
},
{
"type": "AMMO",
Expand All @@ -89,7 +90,7 @@
"dispersion": 100,
"loudness": 0,
"critical_multiplier": 10,
"effects": [ "RECOVER_30" ],
"recovery_chance": 30,
"melee_damage": { "bash": 3 }
},
{
Expand All @@ -102,7 +103,8 @@
"copy-from": "bolt_wood_bodkin",
"relative": { "dispersion": 30 },
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.5 },
"effects": [ "RECOVER_35", "NOGIB" ]
"recovery_chance": 35,
"effects": [ "NOGIB" ]
},
{
"type": "AMMO",
Expand All @@ -115,7 +117,7 @@
"relative": { "dispersion": 80 },
"damage": { "damage_type": "stab", "constant_damage_multiplier": 1.25, "armor_penetration": 1 },
"show_stats": true,
"effects": [ "RECOVER_20" ]
"recovery_chance": 20
},
{
"type": "AMMO",
Expand All @@ -131,7 +133,7 @@
"price_postapoc": "50 cent",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 1.5, "armor_penetration": 2 },
"range": 2,
"effects": [ "RECOVER_35" ]
"recovery_chance": 35
},
{
"type": "AMMO",
Expand All @@ -147,7 +149,7 @@
"price_postapoc": "50 cent",
"damage": { "damage_type": "stab", "armor_penetration": 4 },
"range": 2,
"effects": [ "RECOVER_40" ]
"recovery_chance": 40
},
{
"type": "AMMO",
Expand All @@ -161,7 +163,8 @@
"relative": { "dispersion": -30 },
"damage": { "damage_type": "stab", "constant_damage_multiplier": 0.5 },
"range": 2,
"effects": [ "RECOVER_45", "NOGIB" ]
"recovery_chance": 45,
"effects": [ "NOGIB" ]
},
{
"type": "AMMO",
Expand All @@ -177,7 +180,7 @@
"price_postapoc": "60 cent",
"damage": { "damage_type": "stab", "constant_damage_multiplier": 1.75 },
"range": 4,
"effects": [ "RECOVER_30" ]
"recovery_chance": 30
},
{
"id": "bullet_crossbow",
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/ranged/launchers.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"price": "500 USD",
"material": [ "steel" ],
"flags": [ "NEVER_JAMS", "MOUNTED_GUN", "NO_RELOAD", "NON_FOULING", "WONT_TRAIN_MARKSMANSHIP" ],
"ammo_effects": [ "JET", "BEANBAG", "NEVER_MISFIRES", "RECOVER_10" ],
"ammo_effects": [ "JET", "BEANBAG", "NEVER_MISFIRES" ],
"skill": "launcher",
"ammo": [ "water" ],
"weight": "24500 g",
Expand Down
6 changes: 3 additions & 3 deletions data/json/items/ranged/spearguns.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dispersion": 150,
"loudness": 0,
"count": 4,
"effects": [ "RECOVER_5" ],
"recovery_chance": 5,
"melee_damage": { "bash": 1 }
},
{
Expand All @@ -42,7 +42,7 @@
"dispersion": 90,
"loudness": 0,
"count": 4,
"effects": [ "RECOVER_3" ],
"recovery_chance": 3,
"melee_damage": { "bash": 1 }
},
{
Expand All @@ -65,7 +65,7 @@
"dispersion": 120,
"loudness": 0,
"count": 4,
"effects": [ "RECOVER_15" ],
"recovery_chance": 15,
"melee_damage": { "bash": 1 }
},
{
Expand Down
3 changes: 2 additions & 1 deletion data/json/items/resources/stone.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"dispersion": 14,
"loudness": 0,
"to_hit": -1,
"effects": [ "NEVER_MISFIRES", "NON_FOULING", "RECOVER_60" ],
"recovery_chance": 60,
"effects": [ "NEVER_MISFIRES", "NON_FOULING" ],
"melee_damage": { "bash": 7 }
},
{
Expand Down
Loading

0 comments on commit 0c7dd6a

Please sign in to comment.