Skip to content

Commit 1055f5b

Browse files
Expand implementation of liquid ammo (#72271)
* Test: basic implementation of boomer bile gun * Use breathability to measure protection against liquid ammo * wip on_hit_effect * Apllying effects on Bp is handled in the effect definition, no need for extra c++ * Let clothing_wetness_mult be 0 when checking for permeability * Only pass the Bp hit to apply_effects_nodamage * make bile field glowing * replace boomer attacks with gun, tweak gun and rounds * remove BOOMER and BOOMER_GLOW hardcoded special attacks * on_hit_effects Doc update Co-authored-by: GuardianDll <[email protected]> * remove reference to inexistant bounce effect * add missing include * update gun ammo and boomer to current json style * fix boomer puking sounds * give ammo to huge boomer and glutton * fixes from review * blinding bile * only advanced boomer makes glowing bile * Add test for ammo effect application * clean up loading code * add sections to test * add boomer_head to gun dps data * tidy up * fix crash * fix ammo effect that should be a flag --------- Co-authored-by: Fris0uman <[email protected]> Co-authored-by: Anton Simakov <[email protected]> Co-authored-by: GuardianDll <[email protected]>
1 parent b29180b commit 1055f5b

File tree

22 files changed

+326
-116
lines changed

22 files changed

+326
-116
lines changed

data/json/ammo_effects.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,5 +461,10 @@
461461
"type": "ammo_effect",
462462
"//": "runs EoC that cause you to mutate",
463463
"eoc": [ "EOC_random_mutate" ]
464+
},
465+
{
466+
"id": "LIQUID",
467+
"type": "ammo_effect",
468+
"//": "This is basically a flag for liquid ammo, it is set automatically when the material of the ammo is liquid"
464469
}
465470
]

data/json/effects.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,14 +2274,13 @@
22742274
"desc": [ "Your vision is obscured by a disgusting splatter of bile." ],
22752275
"apply_message": "You're covered in bile!",
22762276
"rating": "bad",
2277-
"base_mods": { "per_mod": [ -3 ] },
22782277
"max_duration": "30 s",
22792278
"limb_score_mods": [
22802279
{ "limb_score": "vision", "modifier": 0.1 },
22812280
{ "limb_score": "night_vis", "modifier": 0.0 },
22822281
{ "limb_score": "reaction", "modifier": 0.2 }
22832282
],
2284-
"flags": [ "EFFECT_LIMB_SCORE_MOD" ],
2283+
"flags": [ "EFFECT_LIMB_SCORE_MOD_LOCAL" ],
22852284
"show_in_info": true
22862285
},
22872286
{

data/json/field_type.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@
2828
"display_field": true,
2929
"looks_like": "fd_acid"
3030
},
31+
{
32+
"id": "fd_bile_adv",
33+
"type": "field_type",
34+
"intensity_levels": [
35+
{ "name": "thick bile splatter", "color": "pink" },
36+
{ "name": "thick bile stain", "light_emitted": 1 },
37+
{ "name": "puddle of thick bile", "light_emitted": 3 }
38+
],
39+
"description_affix": "covered_in",
40+
"underwater_age_speedup": "25 minutes",
41+
"decay_amount_factor": 2,
42+
"is_splattering": true,
43+
"half_life": "1 days",
44+
"phase": "liquid",
45+
"accelerated_decay": true,
46+
"display_field": true,
47+
"looks_like": "fd_bile"
48+
},
3149
{
3250
"id": "fd_darkness",
3351
"type": "field_type",

data/json/items/ammo.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@
563563
"category": "spare_parts",
564564
"material": [ "stone" ],
565565
"ammo_type": "rock",
566-
"flags": [ "TRADER_AVOID", "NPC_THROWN" ],
566+
"flags": [ "TRADER_AVOID", "NPC_THROWN", "ALLOWS_BODY_BLOCK" ],
567567
"weight": "657 g",
568568
"volume": "250 ml",
569569
"damage": { "damage_type": "bash", "amount": 7 },
@@ -572,7 +572,7 @@
572572
"loudness": 0,
573573
"to_hit": { "grip": "solid", "length": "hand", "surface": "any", "balance": "neutral" },
574574
"recovery_chance": 99,
575-
"effects": [ "NEVER_MISFIRES", "NON_FOULING", "ALLOWS_BODY_BLOCK" ],
575+
"effects": [ "NEVER_MISFIRES", "NON_FOULING" ],
576576
"qualities": [ [ "HAMMER", 1 ] ],
577577
"melee_damage": { "bash": 7 },
578578
"thrown_damage": { "damage_type": "bash", "amount": 7 }
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
[
2+
{
3+
"type": "ammunition_type",
4+
"id": "bile",
5+
"name": "boomer bile",
6+
"default": "boomer_bile"
7+
},
8+
{
9+
"id": "boomer_bile",
10+
"type": "ITEM",
11+
"subtypes": [ "AMMO" ],
12+
"name": { "str": "boomer bile", "//~": "NO_I18N" },
13+
"description": { "str": "Boomer bile, if you see this it's a bug.", "//~": "NO_I18N" },
14+
"weight": "3 g",
15+
"volume": "250 ml",
16+
"material": [ "water" ],
17+
"symbol": "=",
18+
"color": "pink",
19+
"phase": "liquid",
20+
"ammo_type": "bile",
21+
"range": 4,
22+
"count": 1,
23+
"effects": [ "NEVER_MISFIRES", "BILE_JET", "BILE_STINK", "BILE_BLIND" ]
24+
},
25+
{
26+
"id": "boomer_bile_adv",
27+
"type": "ITEM",
28+
"subtypes": [ "AMMO" ],
29+
"name": { "str": "advanced boomer bile", "//~": "NO_I18N" },
30+
"description": { "str": "Boomer bile, if you see this it's a bug.", "//~": "NO_I18N" },
31+
"weight": "3 g",
32+
"volume": "250 ml",
33+
"material": [ "water" ],
34+
"symbol": "=",
35+
"color": "pink",
36+
"phase": "liquid",
37+
"ammo_type": "bile",
38+
"range": 4,
39+
"count": 1,
40+
"effects": [ "NEVER_MISFIRES", "BILE_JET_ADV", "BILE_GLOW", "BILE_BOMB_ADV", "BILE_STINK", "BILE_IRRITATE", "BILE_BLIND" ]
41+
},
42+
{
43+
"id": "BILE_BOMB",
44+
"type": "ammo_effect",
45+
"//": "Leaves a pool of bile on detonation",
46+
"aoe": { "field_type": "fd_bile", "intensity_min": 3, "intensity_max": 3 }
47+
},
48+
{
49+
"id": "BILE_JET",
50+
"type": "ammo_effect",
51+
"//": "Creates a trail of bile",
52+
"trail": { "field_type": "fd_bile", "intensity_min": 1, "intensity_max": 2, "chance": 75 }
53+
},
54+
{
55+
"id": "BILE_JET_ADV",
56+
"type": "ammo_effect",
57+
"//": "Creates a trail of advanced bile",
58+
"trail": { "field_type": "fd_bile_adv", "intensity_min": 1, "intensity_max": 2, "chance": 75 }
59+
},
60+
{
61+
"id": "BILE_BOMB_ADV",
62+
"type": "ammo_effect",
63+
"//": "Leaves a pool of advanced bile on detonation",
64+
"aoe": { "field_type": "fd_bile_adv", "intensity_min": 3, "intensity_max": 3 }
65+
},
66+
{
67+
"id": "BILE_GLOW",
68+
"type": "ammo_effect",
69+
"on_hit_effects": [ { "effect": "glowing", "duration": "5 m", "intensity": 1 } ]
70+
},
71+
{
72+
"id": "BILE_STINK",
73+
"type": "ammo_effect",
74+
"on_hit_effects": [ { "effect": "bile_stink", "duration": "5 m", "intensity": 1, "need_touch_skin": true } ]
75+
},
76+
{
77+
"id": "BILE_IRRITATE",
78+
"type": "ammo_effect",
79+
"on_hit_effects": [ { "effect": "bile_irritant", "duration": "5 m", "intensity": 1, "need_touch_skin": true } ]
80+
},
81+
{
82+
"id": "BILE_BLIND",
83+
"type": "ammo_effect",
84+
"on_hit_effects": [ { "effect": "boomered", "duration": "30 s", "intensity": 1, "need_touch_skin": true } ]
85+
}
86+
]

data/json/monster_special_attacks/monster_gun.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,5 +351,24 @@
351351
"range": 100,
352352
"dispersion": 1000,
353353
"ranged_damage": { "damage_type": "stab", "amount": 30 }
354+
},
355+
{
356+
"id": "boomer_head",
357+
"copy-from": "fake_item",
358+
"type": "ITEM",
359+
"subtypes": [ "GUN" ],
360+
"reload_noise": "slosh.",
361+
"name": { "str": "boomer head", "//~": "NO_I18N" },
362+
"description": { "str": "The head of a boomer, if you see this item it's a bug.", "//~": "NO_I18N" },
363+
"material": [ "flesh" ],
364+
"flags": [ "NEVER_JAMS", "NON_FOULING" ],
365+
"ammo_effects": [ "NEVER_MISFIRES", "NO_PENETRATE_OBSTACLES", "LIQUID" ],
366+
"ammo": [ "bile" ],
367+
"skill": "rifle",
368+
"dispersion": 300,
369+
"durability": 10,
370+
"range": 10,
371+
"pocket_data": [ { "pocket_type": "MAGAZINE", "ammo_restriction": { "bile": 1000 }, "watertight": true } ],
372+
"melee_damage": { "bash": 9 }
354373
}
355374
]

data/json/monsters/zed_explosive.json

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,27 @@
2020
"upgrades": { "half_life": 168, "into_group": "GROUP_ZOMBIE_BOOMER_UPGRADE" },
2121
"fungalize_into": "mon_boomer_dusted",
2222
"armor": { "electric": 2 },
23-
"extend": { "flags": [ "BILE_BLOOD" ], "weakpoint_sets": [ "wps_humanoid_head_small" ], "special_attacks": [ [ "BOOMER", 20 ] ] }
23+
"starting_ammo": { "boomer_bile": 999 },
24+
"extend": {
25+
"flags": [ "BILE_BLOOD" ],
26+
"weakpoint_sets": [ "wps_humanoid_head_small" ],
27+
"special_attacks": [
28+
{
29+
"type": "gun",
30+
"move_cost": 150,
31+
"cooldown": 5,
32+
"id": "boomer_bile",
33+
"gun_type": "boomer_head",
34+
"ammo_type": "boomer_bile",
35+
"fake_skills": [ [ "gun", 3 ], [ "rifle", 3 ] ],
36+
"fake_dex": 10,
37+
"targeting_sound": "gurgling.",
38+
"description": "The %s spews bile!",
39+
"no_ammo_sound": "dry heaving.",
40+
"ranges": [ [ 0, 2, "DEFAULT" ] ]
41+
}
42+
]
43+
}
2444
},
2545
{
2646
"id": "mon_boomer_huge",
@@ -42,8 +62,26 @@
4262
"corpse_type": "NO_CORPSE"
4363
},
4464
"armor": { "bash": 5, "cut": 5, "bullet": 4, "electric": 3 },
45-
"extend": { "special_attacks": [ [ "BOOMER_GLOW", 20 ] ] },
46-
"delete": { "special_attacks": [ "BOOMER" ] }
65+
"delete": { "special_attacks": [ "boomer_bile" ] },
66+
"starting_ammo": { "boomer_bile_adv": 999 },
67+
"extend": {
68+
"special_attacks": [
69+
{
70+
"type": "gun",
71+
"move_cost": 150,
72+
"cooldown": 20,
73+
"id": "boomer_bile_adv",
74+
"gun_type": "boomer_head",
75+
"ammo_type": "boomer_bile_adv",
76+
"fake_skills": [ [ "gun", 3 ], [ "rifle", 3 ] ],
77+
"fake_dex": 10,
78+
"targeting_sound": "gurgling.",
79+
"description": "The %s spews bile!",
80+
"no_ammo_sound": "dry heaving.",
81+
"ranges": [ [ 0, 2, "DEFAULT" ] ]
82+
}
83+
]
84+
}
4785
},
4886
{
4987
"id": "mon_zombie_gasbag",
@@ -59,7 +97,7 @@
5997
"death_function": { "message": "The %s explodes!", "effect": { "id": "death_gas", "hit_self": true }, "corpse_type": "NO_CORPSE" },
6098
"fungalize_into": "mon_gasbag_dusted",
6199
"armor": { "electric": 1 },
62-
"delete": { "flags": [ "BILE_BLOOD", "BASHES", "GROUP_BASH", "GRABS", "PUSH_MON" ], "special_attacks": [ "BOOMER" ] }
100+
"delete": { "flags": [ "BILE_BLOOD", "BASHES", "GROUP_BASH", "GRABS", "PUSH_MON" ], "special_attacks": [ "boomer_bile" ] }
63101
},
64102
{
65103
"id": "mon_zombie_relax_gasbag",
@@ -107,10 +145,24 @@
107145
"vision_night": 5,
108146
"emit_fields": [ { "emit_id": "emit_sludge_puddle", "delay": "1 s" } ],
109147
"grab_strength": 30,
148+
"starting_ammo": { "boomer_bile_adv": 999 },
110149
"special_attacks": [
111150
{ "id": "grab" },
112151
{ "id": "scratch_humanoid" },
113-
[ "BOOMER", 21 ],
152+
{
153+
"type": "gun",
154+
"move_cost": 150,
155+
"cooldown": 7,
156+
"id": "boomer_bile_adv",
157+
"gun_type": "boomer_head",
158+
"ammo_type": "boomer_bile_adv",
159+
"fake_skills": [ [ "gun", 3 ], [ "rifle", 3 ] ],
160+
"fake_dex": 10,
161+
"targeting_sound": "gurgling.",
162+
"description": "The %s spews bile!",
163+
"no_ammo_sound": "dry heaving.",
164+
"ranges": [ [ 0, 2, "DEFAULT" ] ]
165+
},
114166
{
115167
"id": "bite_humanoid",
116168
"cooldown": 3,

data/mods/TEST_DATA/expected_dps_data/guns_dps.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"glock_34": 5.09,
4848
"glock_48": 5.09,
4949
"glock_44": 5.09,
50-
"bone_dart": 6.29
50+
"bone_dart": 6.29,
51+
"boomer_head": 7.69
5152
}
5253
}
5354
]

data/mods/TropiCataclysm/monsters/zed_plant.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,21 @@
120120
"melee_damage": [ { "damage_type": "cut", "amount": 0 } ],
121121
"vision_night": 3,
122122
"harvest": "exempt",
123-
"special_attacks": [ [ "BOOMER", 20 ], [ "scratch", 20 ] ],
123+
"special_attacks": [
124+
{
125+
"type": "gun",
126+
"move_cost": 150,
127+
"cooldown": 5,
128+
"id": "boomer_bile",
129+
"gun_type": "boomer_head",
130+
"ammo_type": "boomer_bile",
131+
"fake_skills": [ [ "gun", 3 ], [ "rifle", 3 ] ],
132+
"fake_dex": 10,
133+
"no_ammo_sound": "Boomer tries to vomit more, but only droplets are thrown.",
134+
"ranges": [ [ 0, 2, "DEFAULT" ] ]
135+
},
136+
[ "scratch", 20 ]
137+
],
124138
"death_drops": "mon_zombie_thorny_death_drops",
125139
"death_function": { "effect": { "id": "death_boomer", "hit_self": true }, "message": "The %s explodes!", "corpse_type": "NO_CORPSE" },
126140
"upgrades": { "half_life": 56, "into_group": "GROUP_MOSSY_BOOMER_UPGRADE" },

doc/JSON/ITEM.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,14 @@ ammo_effects define what effect the projectile, that you shoot, would have. List
272272
"drop": "null" // Which item to drop at landing point
273273
}
274274
},
275+
"on_hit_effects": [ // This effects will be applied if body part is hit
276+
{
277+
"effect": "bile_stink",// id of an effect, mandatory
278+
"duration": "5 m", // duration, mandatory
279+
"intensity": 1, // intensity, mandatory
280+
"need_touch_skin": true// if true, and projectile is liquid, the target need to be soaked through for effect to be applied
281+
}
282+
],
275283
"do_flashbang": false, // Creates a one tile radius EMP explosion at the hit location; default false
276284
"do_emp_blast": false, // Creates a hardcoded flashbang explosion; default false
277285
"foamcrete_build": false, // Creates foamcrete fields and walls on the hit location, used in aftershock; default false

0 commit comments

Comments
 (0)