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

feat: fix and add STR_RELOAD to crossbows #3575

Merged
merged 1 commit into from
Nov 6, 2023
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
4 changes: 2 additions & 2 deletions data/json/items/classes/range.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"skill": "rifle",
"symbol": "(",
"color": "green",
"flags": [ "PRIMITIVE_RANGED_WEAPON", "CROSSBOW", "RELOAD_ONE" ],
"flags": [ "PRIMITIVE_RANGED_WEAPON", "CROSSBOW", "RELOAD_ONE", "STR_RELOAD" ],
"clip_size": 1,
"ammo": "bolt",
"valid_mod_locations": [
Expand All @@ -56,7 +56,7 @@
"range": 12,
"dispersion": 400,
"durability": 6,
"reload": 1200,
"reload": 600,
"valid_mod_locations": [
[ "accessories", 2 ],
[ "grip", 1 ],
Expand Down
4 changes: 2 additions & 2 deletions data/json/items/ranged/crossbows.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@
"price": 20000,
"price_postapoc": 2000,
"material": [ "wood", "iron" ],
"extend": { "flags": [ "STR_RELOAD" ] },
"ammo": "pebble",
"weight": "1906 g",
"volume": "1250 ml",
Expand Down Expand Up @@ -421,6 +420,7 @@
"price": 324000,
"material": [ "steel", "wood" ],
"extend": { "flags": [ "FIRE_TWOHAND", "TRADER_AVOID" ] },
"delete": { "flags": [ "STR_RELOAD" ] },
"weight": "3628 g",
"volume": "2500 ml",
"price_postapoc": 6000,
Expand All @@ -432,7 +432,7 @@
"recoil": 30,
"durability": 6,
"clip_size": 10,
"reload": 800,
"reload": 200,
"valid_mod_locations": [ [ "dampening", 1 ], [ "grip", 1 ], [ "mechanism", 1 ] ]
}
]
5 changes: 3 additions & 2 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11710,8 +11710,9 @@ int Character::item_reload_cost( const item &it, item &ammo, int qty ) const
mv += cost / ( 1.0f + std::min( get_skill_level( sk ) * 0.1f, 1.0f ) );

if( it.has_flag( flag_STR_RELOAD ) ) {
/** @EFFECT_STR reduces reload time of some weapons */
mv -= get_str() * 20;
/** @EFFECT_STR over 10 reduces reload time of some weapons */
/** maximum reduction down to 25% of reload rate */
mv *= std::max<float>( 10.0f / std::max<float>( 10.0f, get_str() ), 0.25f );
}

return std::max( mv, 25 );
Expand Down
Loading