Skip to content

Commit

Permalink
Add 60mm M224 mortar
Browse files Browse the repository at this point in the history
  • Loading branch information
GuardianDll committed Jan 24, 2025
1 parent 5ad4199 commit 1c7301e
Show file tree
Hide file tree
Showing 16 changed files with 488 additions and 1 deletion.
10 changes: 10 additions & 0 deletions data/json/ammo_effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,16 @@
"type": "ammo_effect",
"explosion": { "power": 7980, "shrapnel": { "casing_mass": 8725, "fragment_mass": 0.5 } }
},
{
"id": "EXPLOSIVE_60mmHE",
"type": "ammo_effect",
"explosion": { "power": 250, "shrapnel": 500 }
},
{
"id": "EXPLOSIVE_60mmHE2",
"type": "ammo_effect",
"explosion": { "power": 358, "shrapnel": 430 }
},
{
"id": "FLASHBANG",
"type": "ammo_effect",
Expand Down
7 changes: 7 additions & 0 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -5221,5 +5221,12 @@
"id": "eff_mind_seeing_bonus_30",
"name": [ "" ],
"desc": [ "" ]
},
{
"type": "effect_type",
"id": "aimed_60mm",
"max_duration": "3 m",
"name": [ "" ],
"desc": [ "" ]
}
]
62 changes: 62 additions & 0 deletions data/json/furniture_and_terrain/furniture_military.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[
{
"type": "furniture",
"id": "f_m224_mortar",
"name": "M224 mortar",
"description": "Deployed and ready to be used 60 mm mortar. You are lucky you don't need to scavenge actual firing tables, as they are clipped tightly to the mortar itself. However you can use it only for indirect fire, with a substantial precision loss.",
"symbol": "#",
"color": "dark_gray",
"move_cost_mod": 2,
"coverage": 60,
"required_str": 10,
"flags": [ "MOUNTABLE", "SHORT", "FLAT_SURF" ],
"bash": {
"str_min": 12,
"str_max": 40,
"sound": "smash!",
"sound_fail": "whump.",
"items": [ { "item": "black_glass_shard", "count": [ 40, 80 ] } ]
},
"//range": [
"charge; muzzle velocity; min range, max range",
"0, 210, 70, 400 ",
"1, 415, 250, 1340",
"2, 560, 350, 2150",
"3, 680, 500, 2890",
"4, 810, 650, 3490",
"aim deviation: 10% of total distance, decreased by laucnher skill to 2%",
"aim duration: 16 seconds, decreased by launcher skill to 5 seconds, if you already aimed the gun properly; the first shot gonna take up to 190 secodns, decreased by launcher skill to 60 seconds"
],
"examine_action": {
"type": "mortar",
"ammo": [ "mortar_60mm" ],
"condition": { "math": [ "u_skill('launcher') >= 1" ] },
"condition_fail_msg": "You have absolutely no idea how to use this mortar.",
"range": 3490,
"aim_duration": {
"math": [
"u_effect_duration('aimed_60mm') > 1",
" ? max(5, 16 / u_skill('launcher'))",
" : max(60, 190 / u_skill('launcher'))"
]
},
"aim_deviation": { "math": [ "max(0.02, 0.1 / u_skill('launcher'))" ] },
"booster": "60mm_propellant",
"booster_distances": [
{ "amount": 4, "distance": 400 },
{ "amount": 3, "distance": 1340 },
{ "amount": 2, "distance": 2150 },
{ "amount": 1, "distance": 2890 }
],
"effect_on_conditions": [
{
"id": "EOC_SHOT",
"effect": [
{ "u_add_effect": "aimed_60mm", "duration": "3 minutes" },
{ "math": [ "u_skill_exp('launcher', 'format': 'percentage')++" ] }
]
}
]
}
}
]
48 changes: 48 additions & 0 deletions data/json/items/ammo/60mm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[
{
"id": "60mm_shell_m720a1",
"type": "AMMO",
"name": { "str": "high-explosive mortar shell" },
"description": "High-explosive mortar cartridge, designed to be used against troops, light vehicles, light bunkers or similar targets. Multioption fuse allows it to be set to function as proximity burst, impact burst, or delay burst.",
"variants": [
{
"id": "60mm_shell_m720",
"name": { "str": "M720A1 60 mm mortar shell (HE)", "str_pl": "M720A1 60 mm mortar shells (HE)" },
"description": "High-explosive mortar cartridge, designed to be used against troops, light vehicles, light bunkers or similar targets. Multioption fuse allows it to be set to function as proximity burst, impact burst, or delay burst."
}
],
"weight": "1700 g",
"//": "190 g of comp-b, so explosion power should be 250; let's pretend case mass is third of the rest of the weight, so 500 g",
"volume": "680 ml",
"longest_side": "376 mm",
"price": "400 USD",
"price_postapoc": "20 USD",
"flags": [ "IRREPLACEABLE_CONSUMABLE" ],
"material": [ { "type": "steel", "portion": 80 }, { "type": "powder", "portion": 20 } ],
"symbol": "=",
"color": "dark_gray",
"count": 1,
"stack_size": 1,
"ammo_type": "mortar_60mm",
"effects": [ "SPECIAL_COOKOFF", "NEVER_MISFIRES", "EXPLOSIVE_60mmHE" ]
},
{
"id": "60mm_shell_m768",
"copy-from": "60mm_shell_m720a1",
"type": "AMMO",
"name": { "str": "high-explosive mortar shell" },
"description": "High-explosive mortar cartridge, designed to be used against troops, light vehicles, light bunkers or similar targets. Multioption fuse allows it to be set to function as proximity burst, impact burst, or delay burst. This one is more modern version, both more safe and more powerful.",
"variants": [
{
"id": "60mm_shell_m768",
"name": { "str": "M768 60 mm mortar shell (HE)", "str_pl": "M768 60 mm mortar shells (HE)" },
"description": "High-explosive mortar cartridge, designed to be used against troops, light vehicles, light bunkers or similar targets. This one is more modern version, more safe and more powerful, but uses more simple impact fuze."
}
],
"weight": "1655 g",
"//": "358 g of pax-21, which is replacement for comp b - weaker (~1.0 tnt equivalent), but safer, so explosion power should be 358; let's pretend case mass is third of the rest of the weight, so 430 g",
"price": "600 USD",
"extend": { "effects": [ "EXPLOSIVE_60mmHE2" ] },
"delete": { "effects": [ "EXPLOSIVE_60mmHE" ] }
}
]
6 changes: 6 additions & 0 deletions data/json/items/ammo_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@
"name": "M235 66mm Incendiary TPA",
"default": "m235tpa"
},
{
"type": "ammunition_type",
"id": "mortar_60mm",
"name": "60 mm mortar cartridge",
"default": "60mm_shell_m720a1"
},
{
"type": "ammunition_type",
"id": "sling-ready_grenade",
Expand Down
25 changes: 25 additions & 0 deletions data/json/items/gun/60mm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[
{
"type": "GENERIC",
"id": "mortar_m224",
"name": { "str_sp": "light mortar" },
"description": "Lightweight Company Mortar System is a portable mortar that can be carried and used by a one person, even if much slower than with a full crew of three. Luckily, someone attached a bunch of firing tables to it. Whoever will use it should be prepared to spend plenty of time estimating distances and calculating correct elevation and rotation angles.",
"variants": [
{
"id": "mortar_m224",
"name": { "str": "60mm M224 mortar" },
"description": "Lightweight Company Mortar System is a portable mortar that can be carried and used by a one person, even if much slower than with a full crew of three. Luckily, someone attached a bunch of firing tables to it. Whoever will use it should be prepared to spend plenty of time estimating distances and calculating correct elevation and rotation angles."
}
],
"use_action": { "type": "deploy_furn", "furn_type": "f_m224_mortar" },
"category": "other",
"material": [ "steel" ],
"weight": "21100 g",
"volume": "48 L",
"longest_side": "100 cm",
"price": "11000 USD",
"price_postapoc": "20 USD",
"symbol": "q",
"color": "light_gray"
}
]
16 changes: 16 additions & 0 deletions data/json/items/tool/explosives.json
Original file line number Diff line number Diff line change
Expand Up @@ -1391,5 +1391,21 @@
"countdown_action": { "type": "explosion", "explosion": { "power": 69200, "shrapnel": { "casing_mass": 12000, "fragment_mass": 600 } } },
"flags": [ "BOMB", "TRADER_AVOID", "DANGEROUS" ],
"melee_damage": { "bash": 20 }
},
{
"id": "60mm_propellant",
"type": "GENERIC",
"name": { "str": "60 mm mortar propellant charge" },
"description": "Small explosive in a form of donut without a piece, this thing is designed to be attached on the mortar shell tail, to increase the projectile velocity and, therefore, it's range. Since the projectile it was connected to was already shot, you can only cut it for it's content.",
"weight": "50 g",
"//": "8 g of some unknown to me explosive material, let's assume comp b for simplicity",
"volume": "70 ml",
"longest_side": "45 mm",
"price": "14 USD",
"price_postapoc": "2 USD",
"flags": [ "IRREPLACEABLE_CONSUMABLE" ],
"material": [ { "type": "plastic", "portion": 80 }, { "type": "powder", "portion": 20 } ],
"symbol": "=",
"color": "dark_gray"
}
]
7 changes: 7 additions & 0 deletions data/json/player_activities.json
Original file line number Diff line number Diff line change
Expand Up @@ -1134,5 +1134,12 @@
"verb": "infusing saline",
"based_on": "time",
"do_turn_eoc": "SALINE_INFUSION_eff"
},
{
"id": "ACT_MORTAR_AIMING",
"type": "activity_type",
"activity_level": "NO_EXERCISE",
"based_on": "speed",
"verb": "aiming the artillery"
}
]
10 changes: 10 additions & 0 deletions data/json/uncraft/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,5 +306,15 @@
"difficulty": 1,
"time": "2 m",
"components": [ [ [ "pot_canning_clay", 1 ] ], [ [ "clay_pot", 1 ] ], [ [ "fire_brick", 2 ] ] ]
},
{
"result": "60mm_propellant",
"type": "uncraft",
"activity_level": "LIGHT_EXERCISE",
"skill_used": "fabrication",
"qualities": [ { "id": "CUT", "level": 1 } ],
"difficulty": 1,
"time": "20 seconds",
"components": [ [ [ "chem_compositionb", 8 ] ], [ [ "plastic_chunk", 1 ] ] ]
}
]
3 changes: 2 additions & 1 deletion doc/JSON/EFFECT_ON_CONDITION.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ For example, `{ "npc_has_effect": "Shadow_Reveal" }`, used by shadow lieutenant,
| Talk with NPC | player (Avatar) | NPC (NPC) | |
| Talk with monster | player (Avatar) | monster (monster) |
| Use computer | player (Avatar) | computer (Furniture) |
| furniture: "examine_action" | player (Avatar) | NONE |
| furniture: "examine_action" | player (Avatar) | NONE | `this`, string, furniture id; `pos`; string, coordinates of the furniture
| furniture: "mortar" | player (Avatar) | NONE | `this`, string, furniture id; `pos`; string, coordinates of the furniture; `target`, string, coordinates of picked tile
| SPELL: "effect": "effect_on_condition" | target (Character, Monster) | spell caster (Character, Monster) | `spell_location`, location variable, location of target for use primarily when the target isn't a creature
| trap: "action": "eocs" | triggerer (Creature, item not supported yet) | NONE | `trap_location`, location variable, location of the trap to use primarily with ranged traps
| monster_attack: "eoc" | attacker ( Monster) | victim (Creature) | `damage`, int, damage dealt by attack
Expand Down
86 changes: 86 additions & 0 deletions doc/JSON/EXAMINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The examine actors are specified as JSON objects with a `type` corresponding to
- ```shrub_wildveggies``` Pick a wild veggies shrub.
- ```slot_machine``` Gamble.
- ```water_source``` Drink or get liquid from a furniture/terrain. Should be used in pair with `liquid_source`
- ```mortar``` Shoot a projectile.

## Examine Actors

Expand Down Expand Up @@ -165,3 +166,88 @@ What message to print when attempting to activate the cardreader after it has al
Mandatory.
Array of strings and or effect_on_condition objects.
Run all of the eocs upon being examined with u as the examiner and npc as null. See [EFFECT_ON_CONDITION.md](EFFECT_ON_CONDITION.md)

### `mortar`

#### `ammo`
Mandatory.
Array of strings.
List of ammo types, that can be used in this mortar.

#### `range`
Mandatory
Integer
How far this mortar can shoot, in meters.

#### `booster`
Optional
Item id
Mortars can have a boosters they can give the player after use, if the target close enough; specific amount of boosters given defined in booster_distances.

#### `booster_distances`
Optional
Array of objects `amount` and `distance`
If defined, the game check each `distance`, and if target distance is less than `distance`, the game return you amount of boosters defined in `amount`.

#### `condition`
Optional, defaults to true.
Condition
Can be used to add custom conditions for a turret to be used; character must pass the condition, otherwise they won't be able to use a turret.

#### `condition_fail_msg`
Optional, defaults to `You cannot use this mortar.`
String.
If `condition` is failed, the game print this message

#### `aim_deviation`
Optional, defaults to 0.
Integer or variable object
Percent of the distance between you and aiming point, that you may miss; aim_deviation of `0.02` when you aim 1000 meters afar would mean you can miss for 20 meters, 10 meters in either coordinate.

#### `aim_duration`
Optional, defaults to 0 seconds.
Integer or variable object
How long you gonna aim before actually shooting a projectile.

#### `effect_on_conditions`
Optional
JSON Object.
Effect on condition, that would be fired in the end of shooting. Additional context variables sent:
`this`, string, furniture id;
`pos`; string, coordinates of the furniture;
`target`, string, coordinates of picked tile

#### Example
```json
{
"type": "mortar",
"ammo": [ "mortar_60mm" ],
"condition": { "math": [ "u_skill('launcher') >= 1" ] },
"condition_fail_msg": "You have absolutely no idea how to use this mortar.",
"range": 3490,
"aim_duration": {
"math": [
"u_effect_duration('aimed_60mm') > 1",
" ? max(5, 16 / u_skill('launcher'))",
" : max(60, 190 / u_skill('launcher'))"
]
},
"aim_deviation": { "math": [ "max(0.02, 0.1 / u_skill('launcher'))" ] },
"booster": "60mm_propellant",
"booster_distances": [
{ "amount": 4, "distance": 400 },
{ "amount": 3, "distance": 1340 },
{ "amount": 2, "distance": 2150 },
{ "amount": 1, "distance": 2890 }
],
"effect_on_conditions": [
{
"id": "EOC_SHOT",
"effect": [
{ "u_add_effect": "aimed_60mm", "duration": "3 minutes" },
{ "math": [ "u_skill_exp('launcher', 'format': 'percentage')++" ] }
]
}
]
}
```
Loading

0 comments on commit 1c7301e

Please sign in to comment.