Skip to content

Commit

Permalink
Add night vision helmet attachments (#73869)
Browse files Browse the repository at this point in the history
* night vision helmt attachment finally works!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

* Added infared, far nvg effect

* Added attachment flag, new nvg stats

* c++ formatting and adjust old light amp

* Added nvg distributions, adjusted light amp/ir goggle distributions

* Added crappier gnv effect, fixed minimap typo, changed nvg materials

* change night vision checking to update method, fixed typos

* revert harcoded nv

* Enchantment nv effect, reworked stats and behavior

* Check fixes

* cleanup

* cleanup

* Fixed filthy issue, balance
  • Loading branch information
b0bhat authored May 26, 2024
1 parent 6bc0802 commit 903ade8
Show file tree
Hide file tree
Showing 11 changed files with 314 additions and 68 deletions.
24 changes: 24 additions & 0 deletions data/json/enchantments.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,30 @@
"condition": "ALWAYS",
"values": [ { "value": "FOOTSTEP_NOISE", "multiply": 3 } ]
},
{
"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",
"values": [ { "value": "NIGHT_VIS", "add": 12 } ]
},
{
"type": "enchantment",
"id": "nvg_normal",
"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 } ]
},
{
"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 } ]
},
{
"id": "ench_climate_control_warm",
"type": "enchantment",
Expand Down
6 changes: 6 additions & 0 deletions data/json/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@
"info": "This item is attachable in the front of <info>hard hats and helmets</info> to protect your eyes or face.",
"restriction": "Item must be some kind of face shield"
},
{
"id": "HELMET_FRONT_ATTACHMENT",
"type": "json_flag",
"info": "This item is attachable in the front of <info>military helmets</info>.",
"restriction": "Item must be some kind of frontal helmet attachment"
},
{
"id": "HELMET_EAR_ATTACHMENT",
"type": "json_flag",
Expand Down
67 changes: 32 additions & 35 deletions data/json/itemgroups/Clothing_Gear/clothing.json
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,16 @@
{ "group": "clothing_military" },
{ "item": "elbow_pads", "prob": 10 },
{ "item": "knee_pads", "prob": 85 },
{ "item": "helmet_army", "prob": 80 },
{
"distribution": [ { "group": "army_helmet_nvg", "prob": 15 }, { "item": "helmet_army", "prob": 85 } ],
"prob": 80
},
{ "item": "gloves_tactical", "prob": 60 },
{ "group": "military_ballistic_vest", "prob": 90 },
{ "group": "molle_backpacks_and_accessories", "prob": 85 },
{ "group": "clothing_tactical_leg", "prob": 15 },
{
"distribution": [
{ "group": "clothing_glasses", "prob": 60 },
{ "item": "glasses_bal", "prob": 30 },
{ "item": "goggles_nv", "prob": 5, "charges": [ 0, 100 ] },
{ "item": "goggles_ir", "prob": 5, "charges": [ 0, 100 ] }
],
"distribution": [ { "group": "clothing_glasses", "prob": 60 }, { "item": "glasses_bal", "prob": 30 } ],
"prob": 20
},
{ "group": "clothing_watch", "prob": 5 }
Expand All @@ -312,18 +310,16 @@
{ "group": "clothing_military" },
{ "item": "elbow_pads", "prob": 10 },
{ "item": "knee_pads", "prob": 85 },
{ "item": "helmet_army", "prob": 80 },
{
"distribution": [ { "group": "army_helmet_nvg", "prob": 20 }, { "item": "helmet_army", "prob": 80 } ],
"prob": 80
},
{ "item": "gloves_tactical", "prob": 60 },
{ "group": "military_ballistic_vest_pristine", "prob": 90 },
{ "group": "molle_backpacks_and_accessories", "prob": 85 },
{ "group": "clothing_tactical_leg", "prob": 15 },
{
"distribution": [
{ "group": "clothing_glasses", "prob": 60 },
{ "item": "glasses_bal", "prob": 30 },
{ "item": "goggles_nv", "prob": 5, "charges": [ 50, 100 ] },
{ "item": "goggles_ir", "prob": 5, "charges": [ 50, 100 ] }
],
"distribution": [ { "group": "clothing_glasses", "prob": 60 }, { "item": "glasses_bal", "prob": 30 } ],
"prob": 20
},
{ "group": "clothing_watch", "prob": 5 }
Expand All @@ -337,18 +333,16 @@
{ "group": "clothing_military" },
{ "item": "elbow_pads", "prob": 10 },
{ "item": "knee_pads", "prob": 85 },
{ "item": "helmet_army", "prob": 80 },
{
"distribution": [ { "group": "army_helmet_nvg", "prob": 10 }, { "item": "helmet_army", "prob": 90 } ],
"prob": 80
},
{ "item": "gloves_tactical", "prob": 60 },
{ "group": "military_ballistic_vest", "prob": 100 },
{ "group": "molle_backpacks_and_accessories", "prob": 85 },
{ "group": "clothing_tactical_leg", "prob": 15 },
{
"distribution": [
{ "group": "clothing_glasses", "prob": 60 },
{ "item": "glasses_bal", "prob": 30 },
{ "item": "goggles_nv", "prob": 5, "charges": [ 0, 100 ] },
{ "item": "goggles_ir", "prob": 5, "charges": [ 0, 100 ] }
],
"distribution": [ { "group": "clothing_glasses", "prob": 60 }, { "item": "glasses_bal", "prob": 30 } ],
"prob": 20
},
{ "group": "clothing_watch", "prob": 5 }
Expand All @@ -363,18 +357,16 @@
{ "group": "clothing_military" },
{ "item": "elbow_pads", "prob": 10 },
{ "item": "knee_pads", "prob": 85 },
{ "item": "helmet_army", "prob": 80 },
{
"distribution": [ { "group": "army_helmet_nvg", "prob": 20 }, { "item": "helmet_army", "prob": 80 } ],
"prob": 80
},
{ "item": "gloves_tactical", "prob": 60 },
{ "group": "military_ballistic_vest_heavy", "prob": 90 },
{ "group": "molle_backpacks_and_accessories", "prob": 85 },
{ "group": "clothing_tactical_leg", "prob": 15 },
{
"distribution": [
{ "group": "clothing_glasses", "prob": 60 },
{ "item": "glasses_bal", "prob": 30 },
{ "item": "goggles_nv", "prob": 5, "charges": [ 0, 100 ] },
{ "item": "goggles_ir", "prob": 5, "charges": [ 0, 100 ] }
],
"distribution": [ { "group": "clothing_glasses", "prob": 60 }, { "item": "glasses_bal", "prob": 30 } ],
"prob": 20
},
{ "group": "clothing_watch", "prob": 5 }
Expand All @@ -389,18 +381,19 @@
{ "group": "clothing_military_winter" },
{ "item": "elbow_pads", "prob": 10 },
{ "item": "knee_pads", "prob": 85 },
{ "collection": [ { "item": "helmet_army" }, { "item": "helmet_liner" } ], "prob": 80 },
{
"collection": [
{ "distribution": [ { "group": "army_helmet_nvg", "prob": 15 }, { "item": "helmet_army", "prob": 85 } ] },
{ "item": "helmet_liner" }
],
"prob": 80
},
{ "collection": [ { "item": "gloves_liner", "prob": 60 }, { "item": "winter_gloves_army" } ], "prob": 80 },
{ "group": "military_ballistic_vest", "prob": 90 },
{ "group": "molle_backpacks_and_accessories", "prob": 85 },
{ "group": "clothing_tactical_leg", "prob": 15 },
{
"distribution": [
{ "group": "clothing_glasses", "prob": 60 },
{ "item": "glasses_bal", "prob": 30 },
{ "item": "goggles_nv", "prob": 5, "charges": [ 0, 100 ] },
{ "item": "goggles_ir", "prob": 5, "charges": [ 0, 100 ] }
],
"distribution": [ { "group": "clothing_glasses", "prob": 60 }, { "item": "glasses_bal", "prob": 30 } ],
"prob": 20
},
{ "group": "clothing_watch", "prob": 5 }
Expand Down Expand Up @@ -2953,6 +2946,7 @@
[ "chestguard_hard", 20 ],
[ "armguard_hard", 20 ],
[ "legguard_hard", 15 ],
{ "group": "army_helmet_nvg", "prob": 1 },
[ "helmet_army", 40 ],
[ "helmet_liner", 10 ],
[ "beret", 50 ],
Expand All @@ -2970,6 +2964,9 @@
[ "duffelbag", 15 ],
{ "item": "goggles_nv", "prob": 1, "charges": [ 0, 100 ] },
{ "item": "goggles_ir", "prob": 1, "charges": [ 0, 100 ] },
{ "item": "military_nvg", "prob": 1, "charges": [ 0, 100 ] },
{ "item": "advanced_gpnvg", "prob": 1, "charges": [ 0, 100 ] },
{ "item": "enhanced_nvg", "prob": 1, "charges": [ 0, 100 ] },
[ "optical_cloak", 1 ],
{ "item": "holo_cloak", "prob": 1, "charges": [ 0, 1000 ] },
{ "item": "mess_kit", "prob": 9 },
Expand Down
25 changes: 25 additions & 0 deletions data/json/itemgroups/Clothing_Gear/gear.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,31 @@
{ "item": "teargas_sprayer", "prob": 25, "charges": [ 1, 10 ] }
]
},
{
"type": "item_group",
"id": "army_helmet_nvg",
"subtype": "collection",
"entries": [ { "item": "helmet_army", "contents-group": "nvg_distribution" } ]
},
{
"type": "item_group",
"id": "tac_helmet_nvg",
"subtype": "collection",
"entries": [ { "item": "tac_helmet", "contents-group": "nvg_distribution" } ]
},
{
"type": "item_group",
"id": "nvg_distribution",
"items": [
{
"distribution": [
{ "item": "military_nvg", "prob": 60, "charges": [ 0, 100 ] },
{ "item": "advanced_gpnvg", "prob": 30, "charges": [ 0, 100 ] },
{ "item": "enhanced_nvg", "prob": 10, "charges": [ 0, 100 ] }
]
}
]
},
{
"id": "gear_medical",
"type": "item_group",
Expand Down
14 changes: 5 additions & 9 deletions data/json/itemgroups/military.json
Original file line number Diff line number Diff line change
Expand Up @@ -552,20 +552,16 @@
{ "item": "resonance_measurement_device", "prob": 10 },
{ "item": "elbow_pads", "prob": 80 },
{ "item": "knee_pads", "prob": 85 },
{ "item": "tac_helmet", "prob": 100 },
{
"distribution": [ { "group": "tac_helmet_nvg", "prob": 60 }, { "item": "tac_helmet", "prob": 40 } ],
"prob": 100
},
{ "item": "mask_gas", "prob": 100 },
{ "item": "gloves_tactical", "prob": 80 },
{ "group": "xedra_ballistic_vest_heavy_pristine", "prob": 100 },
{ "group": "clothing_tactical_leg", "prob": 80 },
{ "group": "clothing_watch", "prob": 45 },
{
"distribution": [
{ "item": "glasses_bal", "prob": 30 },
{ "item": "goggles_nv", "prob": 30, "charges": [ 50, 100 ] },
{ "item": "goggles_ir", "prob": 30, "charges": [ 50, 100 ] }
],
"prob": 100
},
{ "item": "glasses_bal", "prob": 30 },
{ "group": "xedra_gun" },
{ "group": "cop_melee" },
{ "group": "cop_holster_field" }
Expand Down
Loading

0 comments on commit 903ade8

Please sign in to comment.