Skip to content

Commit

Permalink
Fix night vision goggles (#74298)
Browse files Browse the repository at this point in the history
* stat changes

* Re-add green overlay for night vis

* Character flag for green NVG overlay

* fix rigid coverage and change views

* astyle

* module holder flag and inventory enchantment checking fix

* set nv green overlay active

* IR + NVG working for ENVG

* fix

* minor changes and balance

* astyle and revert desc

* lint
  • Loading branch information
b0bhat authored Jun 9, 2024
1 parent 5d0da40 commit d5c7011
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 40 deletions.
6 changes: 6 additions & 0 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -4625,6 +4625,12 @@
}
]
},
{
"type": "effect_type",
"id": "nvg_green",
"name": [ "Night Vision Goggles (Green)" ],
"desc": [ "Your night vision goggles give a green tint to the world." ]
},
{
"type": "effect_type",
"id": "glowing_gas",
Expand Down
16 changes: 14 additions & 2 deletions data/json/enchantments.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,22 @@
"condition": "ALWAYS",
"values": [ { "value": "FOOTSTEP_NOISE", "multiply": 3 } ]
},
{
"type": "enchantment",
"id": "nvg_great",
"name": { "str": "Night Vision Goggles" },
"description": "You are wearing night vision goggles which allow you to see really well in the dark.",
"condition": "ACTIVE",
"has": "WORN",
"values": [ { "value": "NIGHT_VIS", "add": 14 } ]
},
{
"type": "enchantment",
"id": "nvg_good",
"name": { "str": "Night Vision Goggles" },
"description": "You are wearing night vision goggles which allow you to see quite well in the dark.",
"condition": "ACTIVE",
"has": "WORN",
"values": [ { "value": "NIGHT_VIS", "add": 12 } ]
},
{
Expand All @@ -57,15 +67,17 @@
"name": { "str": "Night Vision Goggles" },
"description": "You are wearing night vision goggles which allow you to see in the dark.",
"condition": "ACTIVE",
"values": [ { "value": "NIGHT_VIS", "add": 9 } ]
"has": "WORN",
"values": [ { "value": "NIGHT_VIS", "add": 10 } ]
},
{
"type": "enchantment",
"id": "nvg_bad",
"name": { "str": "Night Vision Goggles" },
"description": "You are wearing night vision goggles which allow you to poorly see in the dark.",
"condition": "ACTIVE",
"values": [ { "value": "NIGHT_VIS", "add": 5 } ]
"has": "WORN",
"values": [ { "value": "NIGHT_VIS", "add": 8 } ]
},
{
"id": "ench_climate_control_warm",
Expand Down
9 changes: 9 additions & 0 deletions data/json/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,11 @@
"id": "MISSION_ITEM",
"type": "json_flag"
},
{
"id": "MODULE_HOLDER",
"//": "Allows enchantment check to get modules in pockets of this item (modules are items which have an enchantment effect and the HAS:WORN flag.",
"type": "json_flag"
},
{
"id": "MOUNTED_GUN",
"info": "This weapon is <bad>too unwieldy</bad> to fire on its own and <info>must be mounted</info> on a vehicle or furniture (window, table, mound of dirt, etc.) before use.",
Expand Down Expand Up @@ -1690,6 +1695,10 @@
"id": "NPC_THROW_NOW",
"type": "json_flag"
},
{
"id": "NVG_GREEN",
"type": "json_flag"
},
{
"id": "ORGANIC",
"type": "json_flag"
Expand Down
51 changes: 34 additions & 17 deletions data/json/items/armor/head_attachments.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"type": "TOOL_ARMOR",
"category": "armor",
"name": { "str_sp": "night vision goggles" },
"description": "Last generation double-tube night vision device, designed to be mounted to a helmet. Currently raised up and out of the way.",
"description": "Last generation double-tube night vision device, designed to be mounted on a compatible helmet. Currently raised up and out of the way.",
"weight": "680 g",
"volume": "1200 ml",
"price": "10000 USD",
Expand Down Expand Up @@ -239,17 +239,21 @@
"default_magazine": "light_plus_battery_cell"
}
],
"relic_data": { "passive_effects": [ { "id": "nvg_good" } ] },
"relic_data": { "passive_effects": [ { "id": "nvg_normal" } ] },
"flags": [ "HELMET_FRONT_ATTACHMENT", "CANT_WEAR", "OUTER", "ELECTRONIC", "MUNDANE" ],
"armor": [ { "covers": [ "head" ], "encumbrance": 8, "coverage": 70, "specifically_covers": [ "head_forehead" ] } ]
"armor": [
{ "covers": [ "eyes" ], "coverage": 10, "encumbrance": 0, "rigid_layer_only": true },
{ "covers": [ "head" ], "encumbrance": 8, "coverage": 70, "specifically_covers": [ "head_forehead" ] }
]
},
{
"id": "military_nvg_on",
"type": "TOOL_ARMOR",
"copy-from": "military_nvg",
"name": { "str_sp": "night vision goggles (on)" },
"description": "Last generation double-tube night vision device, designed to be mounted to a helmet. Very limited field of view while activated. It is turned on, and continually draining batteries. Use it to turn it off.",
"description": "Last generation single-tube night vision device, designed to be mounted on a compatible helmet. Limited field of view while activated. It is turned on, and continually draining batteries. Use it to turn it off.",
"//": "AN/PVS-7",
"extend": { "flags": [ "NVG_GREEN" ] },
"power_draw": "140 mW",
"revert_to": "military_nvg",
"use_action": {
Expand All @@ -259,14 +263,14 @@
"msg": "Your %s deactivates.",
"target": "military_nvg"
},
"armor": [ { "covers": [ "eyes" ], "coverage": 100, "encumbrance": 20 } ]
"armor": [ { "covers": [ "eyes" ], "coverage": 100, "encumbrance": 20, "rigid_layer_only": true } ]
},
{
"id": "advanced_gpnvg",
"type": "TOOL_ARMOR",
"category": "armor",
"name": { "str_sp": "panoramic night vision goggles" },
"description": "Advanced GPNVG with four image intensifier tubes, allowing for a large field of view at night, designed to be mounted to a helmet. Currently raised up and out of the way.",
"description": "Advanced GPNVG with four image intensifier tubes, allowing for a large field of view at night, designed to be mounted on a compatible helmet. Currently raised up and out of the way.",
"weight": "765 g",
"volume": "1600 ml",
"price": "47000 USD",
Expand Down Expand Up @@ -294,19 +298,26 @@
"default_magazine": "medium_plus_battery_cell"
}
],
"relic_data": { "passive_effects": [ { "id": "nvg_normal" } ] },
"relic_data": { "passive_effects": [ { "id": "nvg_good" } ] },
"flags": [ "HELMET_FRONT_ATTACHMENT", "CANT_WEAR", "OUTER", "ELECTRONIC", "MUNDANE" ],
"armor": [
{ "covers": [ "head" ], "encumbrance": 12, "coverage": 80, "specifically_covers": [ "head_forehead", "head_crown" ] }
{ "covers": [ "eyes" ], "coverage": 10, "encumbrance": 0, "rigid_layer_only": true },
{
"covers": [ "head" ],
"encumbrance": 12,
"coverage": 80,
"specifically_covers": [ "head_forehead", "head_crown" ]
}
]
},
{
"id": "advanced_gpnvg_on",
"type": "TOOL_ARMOR",
"copy-from": "advanced_gpnvg",
"name": { "str_sp": "panoramic night vision goggles (on)" },
"description": "Advanced GPNVG with four image intensifier tubes, allowing for a large field of view at night, designed to be mounted to a helmet. It is turned on, and continually draining batteries. Use it to turn it off.",
"description": "Advanced GPNVG with four image intensifier tubes, allowing for a large field of view at night, designed to be mounted on a compatible helmet. It is turned on, and continually draining batteries. Use it to turn it off.",
"//": "GPNVG-18",
"extend": { "flags": [ "NVG_GREEN" ] },
"power_draw": "180 mW",
"revert_to": "advanced_gpnvg",
"use_action": {
Expand All @@ -317,7 +328,7 @@
"target": "advanced_gpnvg"
},
"armor": [
{ "covers": [ "eyes" ], "coverage": 100, "encumbrance": 15 },
{ "covers": [ "eyes" ], "coverage": 100, "encumbrance": 15, "rigid_layer_only": true },
{ "covers": [ "head" ], "encumbrance": 3, "coverage": 80, "specifically_covers": [ "head_crown" ] }
]
},
Expand All @@ -326,7 +337,7 @@
"type": "TOOL_ARMOR",
"category": "armor",
"name": { "str_sp": "enhanced night vision goggles" },
"description": "New and rare high-resolution thermal NVG device, designed to be mounted to a helmet. Lets you see in the dark, and detects heat signatures emitted by (un)living organisms. Currently raised up and out of the way.",
"description": "New and rare high-resolution thermal NVG device, designed to be mounted on a compatible helmet. Lets you see in the dark, and detects heat signatures emitted by (un)living organisms. Currently raised up and out of the way.",
"weight": "720 g",
"volume": "1400 ml",
"price": "10000 USD",
Expand Down Expand Up @@ -354,21 +365,27 @@
"default_magazine": "medium_plus_battery_cell"
}
],
"relic_data": { "passive_effects": [ { "id": "nvg_normal" } ] },
"relic_data": { "passive_effects": [ { "id": "nvg_good" } ] },
"flags": [ "HELMET_FRONT_ATTACHMENT", "CANT_WEAR", "OUTER", "ELECTRONIC", "MUNDANE" ],
"armor": [
{ "covers": [ "head" ], "encumbrance": 10, "coverage": 70, "specifically_covers": [ "head_forehead", "head_crown" ] }
{ "covers": [ "eyes" ], "coverage": 10, "encumbrance": 0, "rigid_layer_only": true },
{
"covers": [ "head" ],
"encumbrance": 10,
"coverage": 70,
"specifically_covers": [ "head_forehead", "head_crown" ]
}
]
},
{
"id": "enhanced_nvg_on",
"type": "TOOL_ARMOR",
"copy-from": "enhanced_nvg",
"name": { "str_sp": "enhanced night vision goggles (on)" },
"description": "New and rare high-resolution thermal NVG device, designed to be mounted to a helmet. Lets you see in the dark, and detects heat signatures emitted by (un)living organisms. It is turned on, and continually draining batteries. Use it to turn it off.",
"extend": { "flags": [ "IR_EFFECT" ] },
"description": "New and rare high-resolution thermal NVG device, designed to be mounted on a compatible helmet. Lets you see in the dark, and detects heat signatures emitted by (un)living organisms. It is turned on, and continually draining batteries. Use it to turn it off.",
"//": "AN/PSQ-42",
"power_draw": "250 W",
"extend": { "flags": [ "NVG_GREEN", "IR_EFFECT" ] },
"power_draw": "320 mW",
"revert_to": "enhanced_nvg",
"use_action": {
"ammo_scale": 0,
Expand All @@ -378,7 +395,7 @@
"target": "enhanced_nvg"
},
"armor": [
{ "covers": [ "eyes" ], "coverage": 100, "encumbrance": 10 },
{ "covers": [ "eyes" ], "coverage": 100, "encumbrance": 10, "rigid_layer_only": true },
{ "covers": [ "head" ], "encumbrance": 3, "coverage": 80, "specifically_covers": [ "head_crown" ] }
]
},
Expand Down
8 changes: 4 additions & 4 deletions data/json/items/armor/helmets.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"warmth": 20,
"material_thickness": 9,
"techniques": [ "WBLOCK_1" ],
"flags": [ "VARSIZE", "WATERPROOF", "STURDY", "PADDED" ],
"flags": [ "VARSIZE", "WATERPROOF", "STURDY", "PADDED", "MODULE_HOLDER" ],
"armor": [
{
"encumbrance_modifiers": [ "NONE" ],
Expand Down Expand Up @@ -363,7 +363,7 @@
"material_thickness": 8,
"environmental_protection": 2,
"techniques": [ "WBLOCK_1" ],
"flags": [ "VARSIZE", "WATERPROOF", "STURDY", "SUN_GLASSES", "PADDED" ],
"flags": [ "VARSIZE", "WATERPROOF", "STURDY", "SUN_GLASSES", "PADDED", "MODULE_HOLDER" ],
"pocket_data": [
{
"pocket_type": "CONTAINER",
Expand Down Expand Up @@ -397,7 +397,7 @@
"warmth": 20,
"material_thickness": 8,
"techniques": [ "WBLOCK_1" ],
"flags": [ "VARSIZE", "WATERPROOF", "STURDY", "PADDED" ],
"flags": [ "VARSIZE", "WATERPROOF", "STURDY", "PADDED", "MODULE_HOLDER" ],
"armor": [
{
"encumbrance_modifiers": [ "NONE" ],
Expand Down Expand Up @@ -2844,7 +2844,7 @@
"color": "dark_gray",
"warmth": 15,
"techniques": [ "WBLOCK_1" ],
"flags": [ "WATERPROOF", "PADDED" ],
"flags": [ "WATERPROOF", "PADDED", "MODULE_HOLDER" ],
"armor": [
{
"material": [
Expand Down
2 changes: 1 addition & 1 deletion data/json/items/tool_armor.json
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,7 @@
"name": { "str_pl": "pairs of light amp goggles (on)", "str": "pair of light amp goggles (on)" },
"description": "A pair of battery-powered goggles that use a infrared LED in conjunction with a IR camera, allowing you to see in the dark. It is turned on, and continually draining batteries. Use it to turn them off.",
"material": [ "plastic", "steel" ],
"extend": { "flags": [ "TRADER_AVOID" ] },
"extend": { "flags": [ "TRADER_AVOID", "NVG_GREEN" ] },
"//": "2019 commercial models can operate at under 0.375W with the IR illuminator on",
"power_draw": "375 mW",
"revert_to": "goggles_nv",
Expand Down
32 changes: 28 additions & 4 deletions data/mods/Aftershock/items/armor/exosuit/exosuit_frame.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,18 @@
}
],
"ammo": "battery",
"flags": [ "USE_UPS", "STURDY", "WATERPROOF", "ELECTRIC_IMMUNE", "COMBAT_TOGGLEABLE", "OUTER", "MUNDANE", "DEAF", "TARDIS" ],
"flags": [
"USE_UPS",
"STURDY",
"WATERPROOF",
"ELECTRIC_IMMUNE",
"COMBAT_TOGGLEABLE",
"OUTER",
"MUNDANE",
"DEAF",
"TARDIS",
"MODULE_HOLDER"
],
"relic_data": {
"passive_effects": [
{ "condition": "ACTIVE", "values": [ { "value": "STRENGTH", "add": 10 }, { "value": "CARRY_WEIGHT", "add": 20000 } ] }
Expand Down Expand Up @@ -346,7 +357,8 @@
"PARTIAL_DEAF",
"SUN_GLASSES",
"FLASH_PROTECTION",
"TARDIS"
"TARDIS",
"MODULE_HOLDER"
],
"power_draw": "6460 mW",
"revert_to": "modular_exosuit",
Expand Down Expand Up @@ -529,7 +541,18 @@
}
],
"ammo": "battery",
"flags": [ "USE_UPS", "STURDY", "WATERPROOF", "ELECTRIC_IMMUNE", "COMBAT_TOGGLEABLE", "OUTER", "MUNDANE", "DEAF", "TARDIS" ],
"flags": [
"USE_UPS",
"STURDY",
"WATERPROOF",
"ELECTRIC_IMMUNE",
"COMBAT_TOGGLEABLE",
"OUTER",
"MUNDANE",
"DEAF",
"TARDIS",
"MODULE_HOLDER"
],
"relic_data": { "passive_effects": [ { "id": "ench_exo_strength" } ] },
"use_action": [
{
Expand Down Expand Up @@ -561,7 +584,8 @@
"PARTIAL_DEAF",
"SUN_GLASSES",
"FLASH_PROTECTION",
"TARDIS"
"TARDIS",
"MODULE_HOLDER"
],
"relic_data": { "passive_effects": [ { "condition": "ACTIVE", "values": [ { "value": "STRENGTH", "add": 5 } ] } ] },
"power_draw": "5787 mW",
Expand Down
Loading

0 comments on commit d5c7011

Please sign in to comment.