Skip to content

Commit

Permalink
Bring EMP grenades in line with reality (#35734)
Browse files Browse the repository at this point in the history
* Bring EMP grenades in line with reality

Right now, EMP grenades are somewhat nonsense - they can be crafted out
of some electronic scrap, yet easily take down any robotic enemy. These
are problematic not just from their ease of crafting - they also help to
trivialize robotic enemies.

This commit aims to change the that, by replacing the EMP grenade recipe
with one based off of real-life EMP weapons.
This EMP device works by draining a high-current capacitor (represented
by a plutonium fuel cell) into a 'explosively propelled flux compression
generator'. When this generator is activated, with the aid of an
explosion, it creates a strong magnetic field. This magnetic field is
then passed through a microwave generator (magnetron), into a single
loop antenna, which creates the EMP.

I have created a new uncraftable emp grenade which functions like the
current, but is uncraftable and can only be obtained through military
drops rarely, or more commonly from Hub 01.
I have also obsoleted the recipe for the scrambler grenade, because it
similarly did not make much sense. Hub 01 will generally be the supplier
of these.

I have added a large copper tube, magnetron, and flux compression
generator as necessary components for crafting devices introduced in
this PR.
The tube and flux compression generator have had crafting recipes added.

I have largely replaced the former EMP grenade, that is now an EMP bomb,
with EMP grenades. Particularly in the inventory of Hub 01 NPCs, because
that could get deadly.

I have added the flux compression generator to one itemgroup.
The magnetron appears in  none (you can get it from microwaves though).
The large copper tube does not spawn and can only be forged.
Perhaps this could be improved

* Adjust EMP explosive power, remove some recipes

Remove the large copper tube completely and the flux compression
generator recipe.

The flux compression generator requires fiberglass to be craftable,
which is more of a hurdle than I initially considered.

The large copper tube was only used in crafting it, and is no longer
needed.

I also recalculated the volume/weight/etc of the flux compression
generator and found that I could get away with much lower explosive
power, so I've lowered it, and removed the explosion fudging.
  • Loading branch information
anothersimulacrum authored and kevingranade committed Dec 9, 2019
1 parent 5532c9f commit b6e17ea
Show file tree
Hide file tree
Showing 15 changed files with 142 additions and 57 deletions.
2 changes: 2 additions & 0 deletions data/json/itemgroups/item_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -4681,6 +4681,7 @@
[ "grenade_inc", 30 ],
[ "flashbang", 30 ],
[ "EMPbomb", 20 ],
[ "grenade_emp", 5 ],
[ "gasbomb", 15 ],
[ "gasbomb_makeshift", 15 ],
[ "smokebomb", 50 ],
Expand Down Expand Up @@ -5572,6 +5573,7 @@
[ "canister_goo", 8 ],
[ "EMPbomb", 2 ],
[ "pheromone", 1 ],
[ "flux_comp_gen", 3 ],
[ "recipe_mininuke_launch", 4 ],
[ "portal", 2 ],
[ "bot_manhack", 1 ],
Expand Down
2 changes: 1 addition & 1 deletion data/json/itemgroups/robofac_trade.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"type": "item_group",
"id": "robofac_basic_grenades",
"subtype": "distribution",
"items": [ [ "EMPbomb", 70 ], [ "scrambler", 30 ] ]
"items": [ [ "grenade_emp", 70 ], [ "scrambler", 30 ] ]
},
{
"type": "item_group",
Expand Down
33 changes: 33 additions & 0 deletions data/json/items/electronics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
"id": "magnetron",
"type": "GENERIC",
"category": "spare_parts",
"name": "microwave generator",
"description": "This electrical component is designed to produce microwaves, for use in your microwave.",
"weight": "954 g",
"volume": "4 L",
"price": 4000,
"looks_like": "motor_small",
"material": "steel",
"symbol": ":",
"color": "light_gray"
},
{
"id": "flux_comp_gen",
"type": "GENERIC",
"category": "spare_parts",
"name": "explosively pump flux compression generator",
"description": "This large device consists mainly of a tube of copper wire surrounding a large copper tube filled with high explosives. When detonated properly, the explosives allow the device to produce large amounts of electrical energy in a very short time.",
"weight": "3589 g",
"volume": "10455 ml",
"price": 10000,
"explode_in_fire": true,
"explosion": { "power": 600, "shrapnel": { "casing_mass": 3214, "fragment_mass": 0.5 } },
"//": "uncraftable right now, needs fiberglass before it can be crafted",
"looks_like": "cu_pipe",
"material": "copper",
"symbol": "|",
"color": "brown"
}
]
2 changes: 1 addition & 1 deletion data/json/items/generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@
"price": 1000,
"material": [ "steel", "plastic" ],
"weight": "11339 g",
"volume": "3 L"
"volume": "9 L"
},
{
"type": "GENERIC",
Expand Down
59 changes: 58 additions & 1 deletion data/json/items/grenades.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,12 @@
"type": "TOOL",
"category": "weapons",
"name": "scrambler grenade",
"description": "This is a highly modified EMP grenade, designed to scramble robots' IFF control chips rather than destroy them. This converts the robot to your side for a short time, before the backup systems kick in. Use this item to pull the pin and light the fuse, turning it into an active scrambler grenade.",
"description": "This is a specialized grenade, designed to scramble robots' IFF control chips. This converts the robot to your side for a short time, before the backup systems kick in. Use this item to pull the pin and light the fuse, turning it into an active scrambler grenade.",
"weight": "500 g",
"volume": "250 ml",
"price": 6000,
"//": "Something this useful doesn't come cheap after the apocalypse",
"price_postapoc": 20000,
"to_hit": -1,
"bashing": 5,
"material": [ "steel", "plastic" ],
Expand Down Expand Up @@ -188,6 +190,61 @@
},
"flags": [ "TRADER_AVOID" ]
},
{
"id": "grenade_emp",
"type": "TOOL",
"category": "weapons",
"name": "EMP grenade",
"description": "This is a grenade that generates a electromagnetic pulse with a low-inductance capacitor bank discharged into a single-loop antenna. Use this item to pull the pin and light the fuse, turning it into an active EMP grenade. You will then have three turns before it detonates, creating an EMP field that damages robots and drains bionic energy.",
"weight": "400 g",
"volume": "250 ml",
"price": 6000,
"//": "Something this useful doesn't come cheap after the apocalypse",
"price_postapoc": 20000,
"to_hit": -1,
"bashing": 5,
"material": [ "steel", "plastic" ],
"symbol": "*",
"looks_like": "EMPbomb",
"color": "cyan",
"use_action": {
"target": "grenade_emp_act",
"msg": "You pull the pin on the EMP grenade.",
"target_charges": 3,
"active": true,
"menu_text": "Pull pin",
"type": "transform"
},
"flags": [ "RADIO_MODABLE", "RADIO_INVOKE_PROC", "BOMB", "GRENADE" ]
},
{
"id": "grenade_emp_act",
"type": "TOOL",
"category": "weapons",
"name": "active EMP grenade",
"description": "This EMP grenade is active, and will shortly detonate, creating a large EMP field that damages robots and drains bionic energy. You may not want to be holding it much longer.",
"weight": "400 g",
"volume": "250 ml",
"price": 0,
"to_hit": -1,
"bashing": 5,
"material": [ "steel", "plastic" ],
"symbol": "*",
"color": "cyan",
"initial_charges": 3,
"max_charges": 3,
"turns_per_charge": 1,
"use_action": {
"type": "explosion",
"draw_explosion_radius": 4,
"draw_explosion_color": "light_blue",
"emp_blast_radius": 4,
"sound_volume": 0,
"sound_msg": "Tick.",
"no_deactivate_msg": "You've already pulled the %s's pin, try throwing it instead."
},
"flags": [ "TRADER_AVOID" ]
},
{
"abstract": "grenade_canister",
"type": "GENERIC",
Expand Down
47 changes: 26 additions & 21 deletions data/json/items/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@
"id": "EMPbomb",
"type": "TOOL",
"category": "weapons",
"name": "EMP grenade",
"description": "This is a grenade that generates a electromagnetic pulse with a low-inductance capacitor bank discharged into a single-loop antenna. Use this item to pull the pin and light the fuse, turning it into an active EMP grenade. You will then have three turns before it detonates, creating an EMP field that damages robots and drains bionic energy.",
"weight": "400 g",
"volume": "250 ml",
"price": 6000,
"name": "EMP bomb",
"description": "This substantial device is a bomb that generates a electromagnetic pulse. When activated, the plutonium fuel cell is drained into a flux compression generator, the detonation of which creates a strong magnetic field. When this magnetic field is fed into the antenna, it creates a strong electro-magnetic pulse.",
"weight": "4543 g",
"volume": "15500 ml",
"price": 60000,
"to_hit": -1,
"bashing": 5,
"bashing": 12,
"material": [ "steel", "plastic" ],
"symbol": "*",
"color": "cyan",
"explode_in_fire": true,
"explosion": { "power": 600, "shrapnel": { "casing_mass": 3214, "fragment_mass": 0.5 } },
"color": "light_gray",
"use_action": {
"target": "EMPbomb_act",
"msg": "You pull the pin on the EMP grenade.",
"target_charges": 3,
"msg": "You activate the EMP bomb.",
"target_charges": 50,
"active": true,
"menu_text": "Pull pin",
"menu_text": "Activate bomb",
"type": "transform"
},
"flags": [ "RADIO_MODABLE", "RADIO_INVOKE_PROC", "BOMB", "GRENADE" ]
Expand All @@ -41,27 +43,30 @@
"id": "EMPbomb_act",
"type": "TOOL",
"category": "weapons",
"name": "active EMP grenade",
"description": "This EMP grenade is active, and will shortly detonate, creating a large EMP field that damages robots and drains bionic energy. You may not want to be holding it much longer.",
"weight": "400 g",
"volume": "250 ml",
"name": "active EMP bomb",
"description": "This EMP bomb is active, and will shortly detonate, creating a large EMP field that damages robots and drains bionic energy, as well as a sizeable explosion. You may not want to be holding it much longer.",
"weight": "19515 g",
"volume": "16 L",
"price": 0,
"to_hit": -1,
"bashing": 5,
"bashing": 12,
"material": [ "steel", "plastic" ],
"symbol": "*",
"color": "cyan",
"initial_charges": 3,
"max_charges": 3,
"explode_in_fire": true,
"explosion": { "power": 600, "shrapnel": { "casing_mass": 3214, "fragment_mass": 0.5 } },
"color": "light_gray",
"initial_charges": 50,
"max_charges": 50,
"turns_per_charge": 1,
"use_action": {
"type": "explosion",
"draw_explosion_radius": 4,
"draw_explosion_radius": 10,
"draw_explosion_color": "light_blue",
"emp_blast_radius": 4,
"emp_blast_radius": 10,
"sound_volume": 0,
"sound_msg": "Tick.",
"no_deactivate_msg": "You've already pulled the %s's pin, try throwing it instead."
"explosion": { "power": 600, "shrapnel": { "casing_mass": 3214, "fragment_mass": 0.5 } },
"no_deactivate_msg": "You've already activated the %s, try throwing it instead."
},
"flags": [ "TRADER_AVOID" ]
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/monsters/drones.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"color": "cyan",
"armor_cut": 4,
"revert_to_itype": "bot_EMP_hack",
"starting_ammo": { "EMPbomb": 1 },
"starting_ammo": { "grenade_emp": 1 },
"special_attacks": [ [ "KAMIKAZE", 0 ] ]
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/json/npcs/robofac/NPC_ROBOFAC_INTERCOM.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"terrain": { "@": "t_grass", "b": "t_dirt", "M": "t_dirt" },
"fields": { "b": { "field": "fd_blood", "intensity": 1 } },
"items": { "@": { "item": "NC_ROBOFAC_FIELD_RESEARCHER_worn", "chance": 100 } },
"item": { "@": [ { "item": "EMPbomb", "amount": 2 }, { "item": "corpse" } ] },
"item": { "@": [ { "item": "grenade_emp", "amount": 2 }, { "item": "corpse" } ] },
"monster": { "M": { "monster": "mon_robofac_prototype" } }
}
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/npcs/robofac/NPC_ROBOFAC_MERC_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"items": [
{ "item": "ear_plugs", "custom-flags": [ "no_auto_equip" ] },
{ "item": "stanag30", "ammo-item": "556", "charges": 30 },
{ "item": "EMPbomb" },
{ "item": "grenade_emp" },
{ "item": "bot_grenade_hack", "count": 2 }
]
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/npcs/robofac/NPC_Ulysses_Rourke.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"id": "NC_robofac_security_head_misc",
"subtype": "collection",
"entries": [
{ "item": "EMPbomb" },
{ "item": "grenade_emp" },
{ "item": "needlegun", "charges": 100, "ammo-item": "5x50heavy" },
{ "item": "goggles_nv" },
{ "item": "flashbang", "count": 2 },
Expand Down
2 changes: 1 addition & 1 deletion data/json/npcs/robofac/NPC_robofac_generic_security.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"id": "NC_robofac_generic_security_misc",
"subtype": "collection",
"entries": [
{ "item": "EMPbomb", "prob": 33 },
{ "item": "grenade_emp", "prob": 33 },
{ "item": "grenade", "prob": 2 },
{ "item": "PR24-extended" },
{ "item": "flashlight" },
Expand Down
3 changes: 2 additions & 1 deletion data/json/recipes/recipe_deconstruction.json
Original file line number Diff line number Diff line change
Expand Up @@ -1870,7 +1870,8 @@
[ [ "amplifier", 1 ] ],
[ [ "power_supply", 4 ] ],
[ [ "plastic_chunk", 8 ] ],
[ [ "motor_micro", 1 ] ]
[ [ "motor_micro", 1 ] ],
[ [ "magnetron", 1 ] ]
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion data/json/recipes/recipe_electronics.json
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@
"using": [ [ "soldering_standard", 10 ] ],
"qualities": [ { "id": "SCREW", "level": 1 } ],
"components": [
[ [ "EMPbomb", 1 ] ],
[ [ "grenade_emp", 1 ] ],
[ [ "ai_module_basic", 1 ] ],
[ [ "RAM", 1 ] ],
[ [ "small_storage_battery", 1 ] ],
Expand Down
5 changes: 5 additions & 0 deletions data/json/recipes/recipe_obsolete.json
Original file line number Diff line number Diff line change
Expand Up @@ -2176,6 +2176,11 @@
{
"type": "recipe",
"result": "abzats",
"obsolete": "true"
},
{
"type": "recipe",
"result": "scrambler",
"obsolete": true
}
]
34 changes: 8 additions & 26 deletions data/json/recipes/weapon/explosive.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,16 @@
"time": "32 m",
"reversible": true,
"book_learn": [ [ "textbook_anarch", 5 ], [ "advanced_electronics", 5 ] ],
"using": [ [ "soldering_standard", 6 ] ],
"using": [ [ "soldering_standard", 15 ] ],
"qualities": [ { "id": "SCREW", "level": 1 } ],
"components": [
[ [ "superglue", 1 ], [ "cordage", 1, "LIST" ] ],
[
[ "scrap", 3 ],
[ "can_food_unsealed", 1 ],
[ "can_drink_unsealed", 1 ],
[ "clay_canister", 1 ],
[ "canister_empty", 1 ]
],
[ [ "amplifier", 1 ], [ "power_supply", 1 ] ],
[ [ "cable", 5 ] ]
[ [ "circuit", 1 ] ],
[ [ "e_scrap", 3 ] ],
[ [ "magnetron", 1 ] ],
[ [ "flux_comp_gen", 1 ] ],
[ [ "plut_cell", 1 ] ],
[ [ "antenna", 1 ] ],
[ [ "cable", 20 ] ]
]
},
{
Expand Down Expand Up @@ -322,21 +319,6 @@
]
]
},
{
"result": "scrambler",
"type": "recipe",
"category": "CC_WEAPON",
"subcategory": "CSC_WEAPON_EXPLOSIVE",
"skill_used": "electronics",
"skills_required": [ "computer", 4 ],
"difficulty": 8,
"time": "32 m",
"reversible": true,
"book_learn": [ [ "textbook_anarch", 8 ], [ "advanced_electronics", 8 ] ],
"using": [ [ "soldering_standard", 6 ] ],
"qualities": [ { "id": "SCREW", "level": 1 } ],
"components": [ [ [ "EMPbomb", 1 ] ], [ [ "antenna", 1 ] ], [ [ "transponder", 1 ] ], [ [ "e_scrap", 2 ] ] ]
},
{
"result": "smokebomb",
"type": "recipe",
Expand Down

0 comments on commit b6e17ea

Please sign in to comment.