Skip to content

Commit

Permalink
Drop only drops one item
Browse files Browse the repository at this point in the history
Same as `dont_recover_one_in`.
Adds documentation because why the hell isn't this documented?
  • Loading branch information
KheirFerrum committed Jul 31, 2024
1 parent 51297d4 commit 78c651e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions doc/src/content/docs/en/mod/json/reference/json_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -1487,19 +1487,21 @@ See also VEHICLE_JSON.md
### Ammo

```json
"type" : "AMMO", // Defines this as ammo
... // same entries as above for the generic item.
// additional some ammo specific entries:
"ammo_type" : "shot", // Determines what it can be loaded in
"damage" : 18, // Ranged damage when fired
"prop_damage": 2, // Multiplies the damage of weapon by amount (overrides damage field)
"pierce" : 0, // Armor piercing ability when fired
"range" : 5, // Range when fired
"dispersion" : 0, // Inaccuracy of ammo, measured in quarter-degrees
"recoil" : 18, // Recoil caused when firing
"count" : 25, // Number of rounds that spawn together
"stack_size" : 50, // (Optional) How many rounds are in the above-defined volume. If omitted, is the same as 'count'
"show_stats" : true, // (Optional) Force stat display for combat ammo. (for projectiles lacking both damage and prop_damage)
"type" : "AMMO", // Defines this as ammo
... // same entries as above for the generic item.
// additional some ammo specific entries:
"ammo_type" : "shot", // Determines what it can be loaded in
"damage" : 18, // Ranged damage when fired
"prop_damage": 2, // Multiplies the damage of weapon by amount (overrides damage field)
"pierce" : 0, // Armor piercing ability when fired
"range" : 5, // Range when fired
"dispersion" : 0, // Inaccuracy of ammo, measured in quarter-degrees
"recoil" : 18, // Recoil caused when firing
"count" : 25, // Number of rounds that spawn together
"stack_size" : 50, // (Optional) How many rounds are in the above-defined volume. If omitted, is the same as 'count'
"show_stats" : true, // (Optional) Force stat display for combat ammo. (for projectiles lacking both damage and prop_damage)
"dont_recover_one_in": 1 // (Optional) 1 in x chance of not recovering the ammo (100 means you have a 99% chance of getting it back)
"drop": "nail" // (Optional) Defines an object that drops at the projectile location at a 100% chance.
"effects" : ["COOKOFF", "SHOT"]
```

Expand Down
2 changes: 1 addition & 1 deletion src/ranged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ static projectile make_gun_projectile( const item &gun )
}

if( ammo.drop ) {
detached_ptr<item> drop = item::spawn( ammo.drop );
detached_ptr<item> drop = item::spawn( ammo.drop, calendar::turn, 1 );
if( ammo.drop_active ) {
drop->activate();
}
Expand Down

0 comments on commit 78c651e

Please sign in to comment.