From 8e51b9f03043f38681ec49ecb5b99b2c60b67559 Mon Sep 17 00:00:00 2001 From: Light-Wave <66904273+Light-Wave@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:33:17 +0100 Subject: [PATCH 001/158] Fixes scrap recipe --- data/mods/innawood/mining/recipes/smelting.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/innawood/mining/recipes/smelting.json b/data/mods/innawood/mining/recipes/smelting.json index 7aeb52a011b8c..e1c2b47553581 100644 --- a/data/mods/innawood/mining/recipes/smelting.json +++ b/data/mods/innawood/mining/recipes/smelting.json @@ -238,7 +238,7 @@ "autolearn": true, "book_learn": [ [ "textbook_armschina", 3 ], [ "textbook_fabrication", 3 ], [ "welding_book", 3 ] ], "//": "Hematite has around 70% yield of iron, total yield here is just over 69% at 3500 grams of steel. Estimated 2% carbon content has minimal effect on these numbers. Magnetite has around 80% yield, but ironsand isn't pure magnetite.", - "result_mult": 75, + "result_mult": 37, "using": [ [ "forging_standard", 4 ] ], "tools": [ [ [ "crucible", -1 ], [ "crucible_clay", -1 ] ] ], "components": [ From 820df61c108b8afedf05535ea2bb2449413dd00d Mon Sep 17 00:00:00 2001 From: LyleSY Date: Mon, 2 Dec 2024 19:59:51 -0500 Subject: [PATCH 002/158] more dusted zombie variants --- data/json/monsters/fungus_zombie.json | 156 ++++++++++++++++++++++++-- 1 file changed, 147 insertions(+), 9 deletions(-) diff --git a/data/json/monsters/fungus_zombie.json b/data/json/monsters/fungus_zombie.json index f31ced62122bd..d68d570b1fbfb 100644 --- a/data/json/monsters/fungus_zombie.json +++ b/data/json/monsters/fungus_zombie.json @@ -42,6 +42,36 @@ "relative": { "melee_dice_sides": 3, "armor": { "bash": 1, "electric": 2 } }, "extend": { "species": [ "FUNGUS" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_gasbag_dusted", + "type": "MONSTER", + "name": { "str": "dusted gasbag zombie" }, + "description": "This grotesquely swollen corpse has been heavily dusted with a thick gray powder.", + "copy-from": "mon_zombie_gasbag", + "default_faction": "zombie_dusted", + "color": "black_yellow", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_gasbag_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_gasbag_fungalize", + "type": "MONSTER", + "name": { "str": "bloated fungal stalk zombie" }, + "description": "This grotesquely swollen corpse has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_zombie_gasbag", + "default_faction": "fungus", + "color": "black_yellow", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "upgrades": { "age_grow": 1, "into": "mon_zombie_gasbag_fungus" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_gasbag_fungus", "type": "MONSTER", @@ -61,6 +91,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ] } }, + { + "id": "mon_zombie_smoker_dusted", + "type": "MONSTER", + "name": { "str": "dusted smoker zombie" }, + "description": "This smoke-shrouded corpse has been heavily dusted with a thick gray powder lighter in color than smoke and ash.", + "copy-from": "mon_zombie_smoker", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_smoker_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_smoker_fungalize", + "type": "MONSTER", + "name": { "str": "smoking fungal stalk zombie" }, + "description": "This smoke-shrouded corpse has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_zombie_smoker", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_zombie_smoker_fungus" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_smoker_fungus", "type": "MONSTER", @@ -80,6 +141,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "bash": 2, "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ] } }, + { + "id": "mon_skeleton_dusted", + "type": "MONSTER", + "name": { "str": "dusted skeletal zombie" }, + "description": "This moving corpse covered in knobby bone growths has been heavily dusted with a thick gray powder.", + "copy-from": "mon_skeleton", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_skeleton_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_skeleton_fungalize", + "type": "MONSTER", + "name": { "str": "skeletal fungal stalk zombie" }, + "description": "This already horrific moving corpse covered in bony growths has also grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_skeleton", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "moldy_bones", + "upgrades": { "age_grow": 1, "into": "mon_skeleton_fungus" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "type": "MONSTER", "id": "mon_skeleton_fungus", @@ -97,20 +189,35 @@ "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, { + "id": "mon_skeleton_hulk_dusted", "type": "MONSTER", - "id": "mon_skeleton_brute_fungus", - "name": { "str": "fungal skeletal brute" }, - "copy-from": "mon_skeleton_brute", - "description": "Fungi bloom from the crevices in the twisted bone growths that cover this creature. Spores linger in the air around it.", + "name": { "str": "dusted skeletal hulk" }, + "description": "This towering creature covered in plated bone has been heavily dusted with a thick gray powder.", + "copy-from": "mon_skeleton_hulk", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_skeleton_hulk_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_skeleton_hulk_fungalize", + "type": "MONSTER", + "name": { "str": "fungal stalk skeletal hulk" }, + "description": "Layers of plates of bone rise high above, ending in a short stalk of gray fungus bursting from the enormous bulging skull.", + "copy-from": "mon_skeleton_hulk", "default_faction": "fungus", - "bleed_rate": 0, + "color": "light_gray", + "bleed_rate": 50, "vision_day": 5, "vision_night": 5, "harvest": "moldy_bones", - "upgrades": false, - "proportional": { "hp": 0.75, "speed": 0.55 }, - "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "electric": 4 } }, - "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } + "upgrades": { "age_grow": 2, "into": "mon_skeleton_hulk_fungus" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } }, { "id": "mon_skeleton_hulk_fungus", @@ -128,6 +235,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_zombie_child_dusted", + "type": "MONSTER", + "name": { "str": "dusted zombie child", "str_pl": "dusted zombie children" }, + "description": "This small, stumbling child has been dusted with a thick gray powder. Something about the way it moves is uncanny.", + "copy-from": "mon_zombie_child_base", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_child_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_child_fungalize", + "type": "MONSTER", + "name": { "str": "fungal stalk child", "str_pl": "fungal stalk children" }, + "description": "This child moves slowly, as though sleepy. A short stalk of gray fungus has burst from the top of the little head.", + "copy-from": "mon_zombie_child_base", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_zombie_child_fungus" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_child_fungus", "type": "MONSTER", From cf681b6283702c5ca4fe705c40b4849c7a06d5b9 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Tue, 3 Dec 2024 19:26:01 -0500 Subject: [PATCH 003/158] more mushroom --- data/json/monsters/fungus_zombie.json | 137 ++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/data/json/monsters/fungus_zombie.json b/data/json/monsters/fungus_zombie.json index d68d570b1fbfb..e46590a6cab2d 100644 --- a/data/json/monsters/fungus_zombie.json +++ b/data/json/monsters/fungus_zombie.json @@ -188,6 +188,53 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_skeleton_brute_dusted", + "type": "MONSTER", + "name": { "str": "dusted skeletal brute" }, + "description": "This moving corpse covered in twisted bone growths has been heavily dusted with a thick gray powder.", + "copy-from": "mon_skeleton_brute", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_skeleton_brute_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_skeleton_brute_fungalize", + "type": "MONSTER", + "name": { "str": "skeletal fungal stalk brute" }, + "description": "This already horrific moving corpse covered in twisted bony growths has also grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_skeleton_brute", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "moldy_bones", + "upgrades": { "age_grow": 1, "into": "mon_skeleton_brute_fungus" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "type": "MONSTER", + "id": "mon_skeleton_brute_fungus", + "name": { "str": "fungal skeletal brute" }, + "copy-from": "mon_skeleton_brute", + "description": "Fungi bloom from the crevices in the twisted bone growths that cover this creature. Spores linger in the air around it.", + "default_faction": "fungus", + "bleed_rate": 0, + "vision_day": 5, + "vision_night": 5, + "harvest": "moldy_bones", + "upgrades": false, + "proportional": { "hp": 0.75, "speed": 0.55 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "electric": 4 } }, + "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } + }, { "id": "mon_skeleton_hulk_dusted", "type": "MONSTER", @@ -283,6 +330,36 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "bash": 2, "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_boomer_dusted", + "type": "MONSTER", + "name": { "str": "dusted boomer" }, + "description": "This rotund and bloated corpse has been heavily dusted with a thick gray powder.", + "copy-from": "mon_boomer", + "default_faction": "zombie_dusted", + "color": "light_gray_magenta", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_gasbag_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_boomer_fungalize", + "type": "MONSTER", + "name": { "str": "fungal stalk boomer" }, + "description": "This rotund and bloated corpse has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_boomer", + "default_faction": "fungus", + "color": "light_gray_magenta", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "upgrades": { "age_grow": 1, "into": "mon_zombie_gasbag_fungus" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_boomer_fungus", "type": "MONSTER", @@ -301,6 +378,35 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 100 ] ] } }, + { + "id": "mon_zombie_wretch_dusted", + "type": "MONSTER", + "name": { "str": "dusted zombie wretch", "str_pl": "dusted zombie wretches" }, + "description": "This small child lies on the ground shaking gently, dusted with a thick gray powder. The chest of the child appears to have broken open like a gory flower and there is strange pulsing movement and also unpleasant wet sounds within.", + "copy-from": "mon_zombie_wretch", + "default_faction": "zombie_dusted", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_wretch_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_wretch_fungalize", + "type": "MONSTER", + "name": { "str": "fungal stalk wretch", "str_pl": "fungal stalk wretches" }, + "description": "This small child lies on the ground smiling serenely, a short stalk of gray fungus bursting triumphantly from the top of the little head. The chest of the child appears to have broken open like a gory flower and there is strange pulsing movement and also unpleasant wet sounds within.", + "copy-from": "mon_zombie_wretch", + "default_faction": "fungus", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_fungal_wretch" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_fungal_wretch", "type": "MONSTER", @@ -327,6 +433,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ] } }, + { + "id": "mon_spawn_raptor_dusted", + "type": "MONSTER", + "name": { "str": "dusted raptor" }, + "description": "Heavily dusted with a thick gray powder, this small, winged predator darts through the air on three spongy wings that look like stretched human hands. A sheer, jagged spike juts out from the point where the wings meet.", + "copy-from": "mon_spawn_raptor", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_spawn_raptor_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_spawn_raptor_fungalize", + "type": "MONSTER", + "name": { "str": "fungal stalk raptor" }, + "description": "This small, winged predator darts through the air on three spongy wings that look like stretched human hands. A sheer, jagged spike juts out from the point where the wings meet, joined by a short stalk of gray fungus reaching upward.", + "copy-from": "mon_spawn_raptor", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_fungal_raptor" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_fungal_raptor", "type": "MONSTER", From 45fe831b4e3a4934719efa2cdb69c95cca6dec67 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Tue, 3 Dec 2024 20:30:23 -0500 Subject: [PATCH 004/158] smalll fixes --- data/json/monsters/fungus_zombie.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/json/monsters/fungus_zombie.json b/data/json/monsters/fungus_zombie.json index e46590a6cab2d..d2d24074d8ef5 100644 --- a/data/json/monsters/fungus_zombie.json +++ b/data/json/monsters/fungus_zombie.json @@ -300,7 +300,7 @@ "id": "mon_zombie_child_fungalize", "type": "MONSTER", "name": { "str": "fungal stalk child", "str_pl": "fungal stalk children" }, - "description": "This child moves slowly, as though sleepy. A short stalk of gray fungus has burst from the top of the little head.", + "description": "This child moves slowly, as though sleepy. A short stalk of gray fungus has burst from the top of the little head.", "copy-from": "mon_zombie_child_base", "default_faction": "fungus", "color": "light_gray", @@ -457,7 +457,6 @@ "color": "light_gray", "bleed_rate": 50, "vision_day": 5, - "vision_night": 5, "harvest": "zombie_humanoid_mushroom", "upgrades": { "age_grow": 1, "into": "mon_fungal_raptor" }, "proportional": { "speed": 0.3 }, From 64d2be7d1bec558598d99f2b083b0b79fe5c394f Mon Sep 17 00:00:00 2001 From: LyleSY Date: Wed, 4 Dec 2024 19:44:45 -0500 Subject: [PATCH 005/158] more --- data/json/monsters/fungus_zombie.json | 93 +++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/data/json/monsters/fungus_zombie.json b/data/json/monsters/fungus_zombie.json index d2d24074d8ef5..b61a5f0bc036c 100644 --- a/data/json/monsters/fungus_zombie.json +++ b/data/json/monsters/fungus_zombie.json @@ -474,6 +474,37 @@ "upgrades": false, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ] } }, + { + "id": "mon_zombie_runner_dusted", + "type": "MONSTER", + "name": { "str": "dusted zombie runner" }, + "description": "This recently-risen body has been heavily dusted with a thick gray powder, but still moves quickly.", + "copy-from": "mon_zombie_runner", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_runner_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_runner_fungalize", + "type": "MONSTER", + "name": { "str": "fungal stalk zombie runner" }, + "description": "This recently-risen body has grown a short stalk of gray fungus bursting from the skull. This appears to slow it down in some way.", + "copy-from": "mon_zombie_runner", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_zombie_runner_fungal" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_runner_fungal", "type": "MONSTER", @@ -491,6 +522,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "bash": 2, "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_zombie_rot_dusted", + "type": "MONSTER", + "name": { "str": "dusted decayed zombie" }, + "description": "This badly decayed corpse has been heavily dusted with a thick gray powder.", + "copy-from": "mon_zombie_rot", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_rot_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_rot_fungalize", + "type": "MONSTER", + "name": { "str": "decayed fungal stalk zombie" }, + "description": "This badly decayed corpse has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_zombie_rot", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_zombie_rot_fungal" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_rot_fungal", "type": "MONSTER", @@ -508,6 +570,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "bash": 2, "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_zombie_tough_dusted", + "type": "MONSTER", + "name": { "str": "dusted tough zombie" }, + "description": "This muscular moving corpse has been heavily dusted with a thick gray powder.", + "copy-from": "mon_zombie_tough", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_tough_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_tough_fungalize", + "type": "MONSTER", + "name": { "str": "tough fungal stalk zombie" }, + "description": "This muscular corpse has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_zombie_tough", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_zombie_tough_fungal" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_tough_fungal", "type": "MONSTER", From a8a3d56dc53cb4cd97148698ba269d4b1d033baf Mon Sep 17 00:00:00 2001 From: KaenbyouA <95231551+RedMisao@users.noreply.github.com> Date: Sat, 7 Dec 2024 01:03:48 -0500 Subject: [PATCH 006/158] Update MARTIALART_JSON.md --- doc/MARTIALART_JSON.md | 383 +++++++++++++++++++++++------------------ 1 file changed, 211 insertions(+), 172 deletions(-) diff --git a/doc/MARTIALART_JSON.md b/doc/MARTIALART_JSON.md index d5416564212be..9c94d7bb46aa9 100644 --- a/doc/MARTIALART_JSON.md +++ b/doc/MARTIALART_JSON.md @@ -1,221 +1,260 @@ # Martial arts and Techniques -### Martial arts +A Martial art (MA for short) just like in real life, is a set of physical practices, skills and stances for combat and sport. In CDDA, these represent different combat styles of the survivor. -```C++ +These are defined in JSON as `martial_art`, which sets rules for usage and application, and importantly, the list of `techniques` that can be used. + + +## Martial arts + +```json { "type": "martial_art", - "id": "style_debug", // Unique ID. Must be one continuous word, - // use underscores if necessary. - "name": "Debug Mastery", // In-game name displayed + "id": "style_debug", // Unique ID. Must be one continuous word, use underscores if necessary + "name": "Debug Mastery", // In-game name displayed "description": "A secret martial art used only by developers and cheaters.", // In-game description - "initiate": [ "You stand ready.", "%s stands ready." ], // Message shown when player or NPC chooses this art - "autolearn": [ [ "unarmed", "2" ] ], // A list of skill requirements that if met, automatically teach the player the martial art - "teachable": true, // Whether it's possible to teach this style between characters - "allow_all_weapons": true, // This martial art works always, no matter what weapon you equip (including no weapon) - "force_unarmed": true, // You never use equipped item to make attacks with this martial art, and will use only your fist, legs or another limbs you have - "prevent_weapon_blocking": true, // You never block using weapon with this martial art - "strictly_melee": true, // This martial art can be used only with some weapon, no way to use it with bare hands - "arm_block_with_bio_armor_arms": true, // Using this martial art, you can block damage using Arms Alloy Plating CBM - "leg_block_with_bio_armor_legs": true, // Using this martial art, you can block damage using Legs Alloy Plating CBM - "autolearn": [ [ "melee", 1 ] ], // This martial art is autolearned once you reach this level in specific skill or skills - "primary_skill": "bashing", // The difficulty and effectiveness of this martial art scales from this skill; unarmed by default - "learn_difficulty": 5, // Difficulty to learn a style from book based on "primary skill" - // Total chance to learn a style from a single read of the book is equal to one in (10 + learn_difficulty - primary_skill) - "arm_block": 99, // Unarmed skill level at which arm blocking is unlocked - "leg_block": 99, // Unarmed skill level at which arm blocking is unlocked - "nonstandard_block": 99, // Unarmed skill level at which blocking with "nonstandard" mutated limbs is unlocked - "static_buffs": [ // List of buffs that are automatically applied every turn; this syntax is applied for every field with `_buffs` in it's name - { - "id": "debug_elem_resist" // for detals of syntax see Buffs - } - ], - "onmove_buffs": [], // List of buffs that are automatically applied on movement - "onpause_buffs": [], // List of buffs that are automatically applied when passing a turn - "onhit_buffs": [], // List of buffs that are automatically applied on successful hit - "onattack_buffs": [], // List of buffs that are automatically applied after any attack, hit or miss - "ondodge_buffs": [], // List of buffs that are automatically applied on successful dodge - "onblock_buffs": [], // List of buffs that are automatically applied on successful block - "ongethit_buffs": [], // List of buffs that are automatically applied on being hit - "onmiss_buffs": [], // List of buffs that are automatically applied on a miss - "oncrit_buffs": [], // List of buffs that are automatically applied on a crit - "onkill_buffs": [], // List of buffs that are automatically applied upon killing an enemy - "static_eocs": [ // List of eocs that are automatically triggered every turn - "EOC_ID", + "initiate": [ "You stand ready.", "%s stands ready." ], // Message shown when player or NPC selects this MA + "autolearn": [ [ "unarmed", "2" ] ], // A list of skill requirements that if met, automatically teach the player the MA + "teachable": true, // Whether it's possible to teach this style between characters + "allow_all_weapons": true, // This MA always works, no matter what weapon is equipped (including no weapon) + "force_unarmed": true, // You never use the equipped item to make attacks with this MA, and will use only your fist, legs or another limbs you have + "prevent_weapon_blocking": true, // You never block using weapon with this MA + "strictly_melee": true, // This style can only be used with weapons, it can't be used with bare hands + "arm_block_with_bio_armor_arms": true, // Enables blocking damage using the Arms Alloy Plating CBM + "leg_block_with_bio_armor_legs": true, // Enables blocking damage using the Legs Alloy Plating CBM + "autolearn": [ [ "melee", 1 ] ], // The style is autolearned once you reach this level in specific skill or skills + "primary_skill": "bashing", // The difficulty and effectiveness of this MA scales from this skill (Default is "unarmed") + "learn_difficulty": 5, // Difficulty to learn the style from a book based on "primary_skill". Total chance to learn a style from a single read of the book is equal to one in (10 + learn_difficulty - primary_skill) + "arm_block": 99, // Unarmed skill level at which arm blocking is unlocked + "leg_block": 99, // Unarmed skill level at which arm blocking is unlocked + "nonstandard_block": 99, // Unarmed skill level at which blocking with "nonstandard" mutated limbs is unlocked + "static_buffs": [ { "id": "debug_elem_resist" } ], // List of buffs that are automatically applied every turn. Same syntax for the following fields with "_buffs" in their name. For further details, see Martial art buffs + "onmove_buffs": [ ], // List of buffs that are automatically applied on movement + "onpause_buffs": [ ], // List of buffs that are automatically applied when passing a turn + "onattack_buffs": [ ], // List of buffs that are automatically applied after any attack, hit or miss + "onhit_buffs": [ ], // List of buffs that are automatically applied on successful hit + "onmiss_buffs": [ ], // List of buffs that are automatically applied on a miss + "oncrit_buffs": [ ], // List of buffs that are automatically applied on a crit + "ongethit_buffs": [ ], // List of buffs that are automatically applied on being hit + "ondodge_buffs": [ ], // List of buffs that are automatically applied on successful dodge + "onblock_buffs": [ ], // List of buffs that are automatically applied on successful block + "onkill_buffs": [ ], // List of buffs that are automatically applied upon killing an enemy + "static_eocs": [ // List of eocs that are automatically triggered every turn + "EOC_ID", // Syntax allows either eoc IDs or as inline blocks { "id": "INLINE_EOC_ID" } ], - "onmove_eocs": [], // List of eocs that are automatically triggered on movement - "onpause_eocs": [], // List of eocs that are automatically triggered when passing a turn - "onhit_eocs": [], // List of eocs that are automatically triggered on successful hit - "onattack_eocs": [], // List of eocs that are automatically triggered after any attack, hit or miss - "ondodge_eocs": [], // List of eocs that are automatically triggered on successful dodge - "onblock_eocs": [], // List of eocs that are automatically triggered on successful block - "ongethit_eocs": [], // List of eocs that are automatically triggered on being hit - "onmiss_eocs": [], // List of eocs that are automatically triggered on a miss - "oncrit_eocs": [], // List of eocs that are automatically triggered on a crit - "onkill_eocs": [], // List of eocs that are automatically triggered upon killing an enemy - "techniques": [ // List of techniques available when this martial art is used + "onmove_eocs": [ ], // List of eocs that are automatically triggered on movement + "onpause_eocs": [ ], // List of eocs that are automatically triggered when passing a turn + "onattack_eocs": [ ], // List of eocs that are automatically triggered after any attack, hit or miss + "onhit_eocs": [ ], // List of eocs that are automatically triggered on successful hit + "onmiss_eocs": [ ], // List of eocs that are automatically triggered on a miss + "oncrit_eocs": [ ], // List of eocs that are automatically triggered on a crit + "ongethit_eocs": [ ], // List of eocs that are automatically triggered on being hit + "ondodge_eocs": [ ], // List of eocs that are automatically triggered on successful dodge + "onblock_eocs": [ ], // List of eocs that are automatically triggered on successful block + "onkill_eocs": [ ], // List of eocs that are automatically triggered upon killing an enemy + "techniques": [ // List of techniques available when this MA is used "tec_debug_slow", "tec_debug_arpen" ], - "weapons": [ "tonfa" ], // List of weapons usable with this art - "weapon_category": [ "WEAPON_CAT1" ] // Weapons that have one of the categories in here are usable with this art. + "weapons": [ "tonfa" ], // List of weapons usable with this art + "weapon_category": [ "MEDIUM_SWORDS" ] // List of weapons categories usable with this MA } ``` -### Techniques + +### Martial art buffs + +```json +... + { + "id": "debug_elem_resist", // Unique ID. Must be one continuous word + "name": "Elemental Resistance", // In-game name displayed, would be shown in character menu + "description": "You are a walking tank!\n\nBash armor increased by 100% of Strength (...)", // In-game description, would be shown in character menu + "buff_duration": 2, // Duration in turns that this buff lasts + "persists": false, // Allow buff to remain when changing to a new style + "unarmed_allowed": true, // Effect is applied when you have no weapon equipped + "melee_allowed": true, // Effect is applied when you have some melee weapon equipped + "strictly_unarmed": true, // Effect is applied only when you have no weapon whatsoever, even unarmed weapons + "wall_adjacent": true, // Effect is applied when you stand near the wall + "weapon_categories_allowed": [ "BLADES", "KNIVES" ], // Restrict buff to only these categories of weapons. If omitted, all weapon categories are allowed + "max_stacks": 8, // Maximum number of stacks on the buff. Buff bonuses are multiplied by current buff intensity + "bonus_blocks": 1, // Extra blocks per turn + "bonus_dodges": 1, // Extra dodges per turn + "flat_bonuses": [ ], // Flat bonuses, see Bonuses below + "mult_bonuses": [ ], // Multiplicative bonuses, see Bonuses below + } +... +``` + +Martial art buffs (`static_buffs`, `onmove_buffs`, etc.) are inlined in their parent `martial_art` as seen in the [previous example](MARTIALART_JSON.md#martial-arts), and thus lack their own `type`. + +Additionally, when read externally (such as, by EOCs), their syntax is `mabuff:ID`: + +```json + "condition": { "u_has_effect": "mabuff:buff_aikido_static1" }, +``` + + +## Techniques + +Techniques are special attacks performed while using a given MA style. These are automatically used according to their specific requirements, as defined in their JSON blocks: ```JSON { - "id": "tec_debug_arpen", // Unique ID. Must be one continuous word - "name": "phasing strike", // In-game name displayed - "attack_vectors": [ "vector_1", "vector_2" ], // What attack vector would be used for this technique; For more info see Attack vectors below - "unarmed_allowed": true, // Can an unarmed character use this technique - "weapon_categories_allowed": [ "BLADES", "KNIVES" ], // Restrict technique to only these categories of weapons. If omitted, all weapon categories are allowed. - "melee_allowed": true, // Means that ANY melee weapon can be used, NOT just the martial art's weapons - "powerful_knockback": true, // - "skill_requirements": [ { "name": "melee", "level": 3 } ], // Skills and their minimum levels required to use this technique. Can be any skill. - "weapon_damage_requirements": [ { "type": "bash", "min": 5 } ], // Minimum weapon damage required to use this technique. Can be any damage type. + "type": "technique", + "id": "tec_debug_arpen", // Unique ID. Must be one continuous word + "name": "phasing strike", // In-game name displayed + "attack_vectors": [ "vector_1", "vector_2" ], // What attack vector would be used for this technique. For more info see Attack vectors below + "unarmed_allowed": true, // Can an unarmed character use this technique + "weapon_categories_allowed": [ "BLADES", "KNIVES" ], // Restrict technique to only these categories of weapons. If omitted, all weapon categories are allowed + "melee_allowed": true, // Means that ANY melee weapon can be used, NOT just the MAs weapons + "powerful_knockback": true, // + "skill_requirements": [ { "name": "melee", "level": 3 } ], // Skills and their minimum levels required to use this technique. Can be any skill + "weapon_damage_requirements": [ { "type": "bash", "min": 5 } ], // Minimum weapon damage required to use this technique. Can be any damage type "required_buffs_any": [ "eskrima_hit_buff" ], // This technique requires any of the named buffs to be active "required_buffs_all": [ "eskrima_hit_buff" ], // This technique requires all of the named buffs to be active - "forbidden_buffs_any": [ "eskrima_hit_buff" ], // This technique is forbidden if any of the named buffs are active - "forbidden_buffs_all": [ "eskrima_hit_buff" ], // This technique is forbidden if all of the named buffs are active - "req_flags": [ "" ], // List of item flags the used weapon needs to be eligible for the technique - "required_char_flags": [ "" ], // List of "character" (bionic, trait, effect or bodypart) flags the character needs to be able to use this technique - "required_char_flags_all": [ "" ], // This technique requires all of the listed character flags to trigger - "forbidden_char_flags": [ "" ], // List of character flags disabling this technique - "needs_ammo": true, // Technique works only if weapon is loaded; Consume 1 charge per attack - "crit_tec": true, // This technique only works on a critical hit - "crit_ok": true, // This technique works on both normal and critical hits - "reach_tec": true, // This technique only works on a reach attack hit - "reach_ok": true, // This technique works on both normal and reach attack hits - "condition": "u_is_outside",// Optional (array of) dialog conditions the attack requires to trigger. Failing these will disqualify the tech from being selected - "condition_desc": "Needs X",// Description string describing the conditions of this attack (since dialog conditions can't be automatically evaluated) - "repeat_min": 1, // Technique's damage and any added effects are repeated rng(repeat_min, repeat_max) times. The target's armor and the effect's chances are applied for each repeat. + "forbidden_buffs_any": [ "eskrima_hit_buff" ], // This technique is forbidden if any of the named buffs are active + "forbidden_buffs_all": [ "eskrima_hit_buff" ], // This technique is forbidden if all of the named buffs are active + "req_flags": [ "" ], // List of item flags the used weapon needs to be eligible for the technique + "required_char_flags": [ "" ], // List of "character" (bionic, trait, effect or bodypart) flags the character needs to be able to use this technique + "required_char_flags_all": [ "" ], // This technique requires all of the listed character flags to trigger + "forbidden_char_flags": [ "" ], // List of character flags disabling this technique + "needs_ammo": true, // Technique works only if weapon is loaded. Consumes 1 charge per attack + "crit_tec": true, // This technique only works on a critical hit + "crit_ok": true, // This technique works on both normal and critical hits + "reach_tec": true, // This technique only works on a reach attack hit + "reach_ok": true, // This technique works on both normal and reach attack hits + "condition": "u_is_outside", // Array of dialog conditions the attack requires to trigger. Failing these will disqualify the tech from being selected. Same syntax as the eoc "condition" field + "condition_desc": "Needs X", // Description string describing the conditions of this attack (since dialog conditions can't be automatically evaluated) + "repeat_min": 1, // Technique's damage and any added effects are repeated rng(repeat_min, repeat_max) times. The target's armor and the effect's chances are applied for each repeat "repeat_max": 1, - "knockback_dist": 1, // Distance target is knocked back - "knockback_spread": 1, // The knockback may not send the target straight back - "knockback_follow": true, // Attacker will follow target if they are knocked back - "stun_dur": 2, // Duration that target is stunned for - "down_dur": 2, // Duration that target is downed for - "side_switch": true, // Technique moves the target behind user - "disarms": true, // This technique can disarm the opponent, triggers only against armed NPCs or monsters with the "WIELDED_WEAPON" flag - "take_weapon": true, // Technique will disarm and equip target's weapon if hands are free - "grab_break": true, // This technique may break a grab against the user - "aoe": "spin", // This technique has an area-of-effect; doesn't work against solo targets - "block_counter": true, // This technique may automatically counterattack on a successful block - "dodge_counter": true, // This technique may automatically counterattack on a successful dodge - "weighting": 2, // Affects likelihood this technique will be selected when many are available. Negative weighting means the technique is only included in the list of possible techs once out of every `weighting` times ( 1/3 for a weighting of -3) - "defensive": true, // Game won't try to select this technique when attacking - "miss_recovery": true, // Misses while attacking will use half as many moves - "messages": [ // What is printed when this technique is used by the player and by an npc + "knockback_dist": 1, // Distance target is knocked back + "knockback_spread": 1, // The knockback may not send the target straight back + "knockback_follow": true, // Attacker will follow target if they are knocked back + "stun_dur": 2, // Duration that target is stunned for + "down_dur": 2, // Duration that target is downed for + "side_switch": true, // Technique moves the target behind user + "disarms": true, // This technique can disarm the opponent, triggers only against armed NPCs or monsters with the "WIELDED_WEAPON" flag + "take_weapon": true, // Technique will disarm and equip target's weapon if hands are free + "grab_break": true, // This technique may break a grab against the user + "aoe": "spin", // This technique has an area-of-effect. Doesn't proc against solo targets + "block_counter": true, // This technique may automatically counterattack on a successful block + "dodge_counter": true, // This technique may automatically counterattack on a successful dodge + "weighting": 2, // Affects likelihood this technique will be selected when many are available. Negative weighting means the technique is only included in the list of possible techs once out of every `weighting` times ( 1/3 for a weighting of -3) + "defensive": true, // Game won't try to select this technique when attacking + "miss_recovery": true, // Misses while attacking will use half as many moves + "messages": [ // What is printed when this technique is used by the player and by an npc "You phase-strike %s", " phase-strikes %s" ], - "eocs": [ "EOC_ID", { "id": "INLINE_EOC_ID" } ], // EOCs that trigger each time this technique does, with the attacker as the speaker and the target as the listener - "mult_bonuses": , // Any bonuses, as described below - "flat_bonuses": , - "tech_effects": // List of effects applied by this technique, see below + "eocs": [ "EOC_ID", { "id": "INLINE_EOC_ID" } ], // EOCs that trigger each time this technique does, with the attacker as the speaker and the target as the listener. Syntax allows either eoc IDs or as inline blocks + "flat_bonuses": , // Any bonuses, see Bonuses below + "mult_bonuses": , + "tech_effects": // List of effects applied by this technique, see Bonuses below } ``` -### Attack vectors +All fields, except for the ID, type and name are optional. -Attack vectors define which (sub)bodypart is used for the attack in question, allow filtering of eligible bodyparts and apply the relevant worn armor's unarmed damage to the attack. Note for the (sub)part to apply its unarmed damage it needs unrestricted natural attacks. -```JSON -[ - { - "type": "attack_vector", // Always attack_vector - "id": "vector_hand", // ID - "limbs": [ "hand_l", "hand_r" ], // List of bodyparts used in this attack (relevant for HP/encumbrance/flag filtering) - "contact_area": [ "hand_fingers_l", "hand_fingers_r" ], // List of subbodyparts that can be used as a strike surface in the attack using the sbp's armor or intrinsic unarmed damage - "strict_limb_definition": false, // Bool, default false. When true *only* the bodyparts defined above are used for the vector, otherwise similar bodyparts can be used as long as both the contact area and the defined limb are similar, see JSON_INFO.md/Bodyparts for bodypart similarity - "armor_bonus": true, // Bool, default true, defines if the vector takes the unarmed damage bonus of the armor worn on the contact area into account - "required_limb_flags": [ "foo", "bar" ], // List of character flags required for the bodypart to be eligible for this vector - "forbidden_limb_flags": [ "foo", "bar" ], // List of character flags that disqualify a limb from being usable by this vector - "encumbrance_limit": 15, // Int, default 100, encumbrance of the limb above this will disqualify it from this vector - "bp_hp_limit": 75 , // Int, default 10, percent of bodypart limb HP necessary for the limbs to qualify for this vector. For minor (non-main) bodyparts the corresponding main part HP is taken into account. - "limb_req": [ [ "arm", 2] ] // Array of pairs. Limb type requirements for this vector. The character must have this many limbs of the given type above the limb's health limit (See JSON_INFO.md:Bodyparts). Requirements must all be met. +### Technique effects - } -] +```json +... + "tech_effects": [ + { + "id": "eff_expl", // Unique ID. Must be one continuous word + "chance": 100, // Percent chance to apply the effect on this attack + "permanent": false, // If true the effect won't decay (default: false) + "duration": 15, // Duration of the effect in turns + "on_damage": true, // If true the effect will only be applied if the attack succeeded in doing damage (default: true) + "req_flag": "ANY", // A single arbitrary character flag (from traits, bionics, effects, or bodyparts) required to apply this effect + "message": "Example" // The message to print if you successfully apply the effect, %s can be substituted for the target's name + } + ] +... ``` -### Tech effects -```C++ -"tech_effects": [ - { - "id": "eff_expl", // Unique ID. Must be one continuous word - "chance": 100, // Percent chance to apply the effect on this attack - "permanent": false, // If true the effect won't decay (default false) - "duration": 15, // Duration of the effect in turns - "on_damage": true, // If true the effect will only be applied if the attack succeeded in doing damage (default true) - "req_flag": "ANY", // A single arbitrary character flag (from traits, bionics, effects, or bodyparts) required to apply this effect - "message": "Example" // The message to print if you successfully apply the effect, %s can be substituted for the target's name - } -] +`tech_effects` are inlined in their parent `technique` as seen in the [previous example](MARTIALART_JSON.md#techniques), and thus lack their own `type`. + + +## Bonuses + +The fields `flat_bonuses` and `mult_bonuses` can contain any number of bonus entries: + +```json + "flat_bonuses": [ + { "stat": "dodge", "scale": 1.0 }, + { "stat": "damage", "type": "bash", "scaling-stat": "per", "scale": 0.15 } + ] ``` -### Buffs +Bonuses can be defined with the following values: -```C++ -{ - "id": "debug_elem_resist", // Unique ID. Must be one continuous word - "name": "Elemental Resistance", // In-game name displayed, would be shown in character menu - "description": "You are a walking tank!\n\nBash armor increased by 100% of Strength, Cut armor increased by 100% of Dexterity, Electricic armor increased by 100% of Intelligence, and Fire armor increased by 100% of Perception", // In-game description, would be shown in character menu - "buff_duration": 2, // Duration in turns that this buff lasts - "persists": false, // Allow buff to remain when changing to a new style - "unarmed_allowed": true, // Effect is applied when you have no weapon equipped - "melee_allowed": true, // Effect is applied when you have some melee weapon equipped - "strictly_unarmed": true, // Effect is applied only when you have no weapon whatsoever, even unarmed weapon - "wall_adjacent": true, // Effect is applied when you stand near the wall - "weapon_categories_allowed": [ "BLADES", "KNIVES" ], // Restrict buff to only these categories of weapons. If omitted, all weapon categories are allowed. - "max_stacks": 8, // Maximum number of stacks on the buff. Buff bonuses are multiplied by current buff intensity - "bonus_blocks": 1, // Extra blocks per turn - "bonus_dodges": 1, // Extra dodges per turn - "flat_bonuses": [], // Flat bonuses, see below - "mult_bonuses": [], // Multiplicative bonuses, see below -} +Field | Description +---- |---- +`stat` | Affected statistic. Can be any of: `hit`, `dodge`, `block`, `speed`, `movecost`, `damage`, `armor`, `arpen`. +`type` | Damage type for the affected statistic (`bash`, `cut`, `heat`, etc.). Only needed if the affected statistic is either `damage`, `armor`, or `arpen`. +`scale` | Value of the bonus. +`scaling-stat` | (Optional) Stat used for scaling. Can be any of the four classic stats (`str`, `dex`, `int`, `per`) or any skill (`bashing`, `dodge`, `unarmed`, `rifles`, `spellcraft`, etc.). If the scaling stat is specified, the value of the bonus is multiplied by the corresponding user stat/skill. + +* Bonuses must be written in the correct order. +* Tokens of "useless" type will not cause an error, but will not have any effect. For example, `speed` in a technique will have no effect (`movecost` should be used for techniques). +* Multiplicative bonuses only support `damage` and `movecost`. +* Flat bonuses are applied after multiplicative bonuses. + + +### Examples + +Incoming bashing damage is decreased by 30% of strength value. Only useful on buffs: + +```json + "flat_bonuses": [ { "stat": "armor", "type": "bash", "scaling-stat": "str", "scale": 0.3 } ] ``` -### Bonuses -The bonuses arrays contain any number of bonus entries like this: +All cutting damage done is multiplied by 10% of dexterity: -```C++ -{ - "stat": "damage", - "type": "bash", - "scaling-stat": "per", - "scale": 0.15 -} +```json + "mult_bonuses": [ { "stat": "damage", "type": "cut", "scaling-stat": "dex", "scale": 0.1 } ] ``` -"stat": affected statistic, any of: "hit", "dodge", "block", "speed", "movecost", "damage", "armor", "arpen", -"type": damage type for the affected statistic ("bash", "cut", "heat", etc.), only needed if the affected statistic is "damage", "armor", or "arpen". -"scale": the value of the bonus itself. -"scaling-stat": scaling stat, any of: "str", "dex", "int", "per", "bashing", "cutting", "dodge", "melee", "stabbing", "swimming", "unarmed", "marksmanship", "pistols", "rifles", "shotguns", "SMGs", "archery", "throwing", "launchers", "driving", "health care", "spellcraft". Optional. If the scaling stat is specified, the value of the bonus is multiplied by the corresponding user stat/skill. -Bonuses must be written in the correct order. +Move cost is decreased by 100% of strength value -Tokens of `useless` type will not cause an error, but will not have any effect. -For example, `speed` in a technique will have no effect (`movecost` should be used for techniques). Multiplicative bonuses are only for `damage` and `movecost`. +```json + "flat_bonuses": [ { "stat": "movecost", "scaling-stat": "str", "scale": -1.0 } ] +``` -Flat bonuses are applied after multiplicative bonuses. -Examples: -Incoming bashing damage is decreased by 30% of strength value. Only useful on buffs: -* `flat_bonuses: [ { "stat": "armor", "type": "bash", "scaling-stat": "str", "scale": 0.3 } ]` +## Attack vectors -All cutting damage dealt is multiplied by `(10% of dexterity)*(damage)`: -* `mult_bonuses: [ { "stat": "damage", "type": "cut", "scaling-stat": "dex", "scale": 0.1 } ]` +Attack vectors define which (sub)bodypart are used for the attack in question. It allows filtering eligible bodyparts and apply the relevant worn armor's unarmed damage to the attack. The list is present at [attack_vectors.json](/data/json/attack_vectors.json) + +Note: for the (sub)part to apply its unarmed damage it needs unrestricted natural attacks. + +```JSON +[ + { + "type": "attack_vector", // Always attack_vector + "id": "vector_hand", // Unique ID. Must be one continuous word + "limbs": [ "hand_l", "hand_r" ], // List of bodyparts used in this attack (relevant for HP/encumbrance/flag filtering) + "contact_area": [ "hand_fingers_l", "hand_fingers_r" ], // List of subbodyparts that can be used as a strike surface in the attack using the subbodypart's armor or intrinsic unarmed damage + "strict_limb_definition": false, // Bool, default false. When true *only* the bodyparts defined above are used for the vector, otherwise similar bodyparts can be used as long as both the contact area and the defined limb are similar, see JSON_INFO.md/Bodyparts for bodypart similarity + "armor_bonus": true, // Bool, defines if the vector takes the unarmed damage bonus of the armor worn on the contact area into account (default: true) + "required_limb_flags": [ "foo", "bar" ], // List of character flags required for the bodypart to be eligible for this vector + "forbidden_limb_flags": [ "foo", "bar" ], // List of character flags that disqualify a limb from being usable by this vector + "encumbrance_limit": 15, // Int, default 100, encumbrance of the limb above this will disqualify it from this vector + "bp_hp_limit": 75 , // Int, default 10, percent of bodypart limb HP necessary for the limbs to qualify for this vector. For minor (non-main) bodyparts the corresponding main part HP is taken into account + "limb_req": [ [ "arm", 2] ] // Array of pairs. Limb type requirements for this vector. The character must have this many limbs of the given type above the limb's health limit (See JSON_INFO.md:Bodyparts). Requirements must all be met + + } +] +``` -Move cost is decreased by 100% of strength value -* `flat_bonuses: [ { "stat": "movecost", "scaling-stat": "str", "scale": -1.0 } ]` -### Place relevant items in the world and chargen +## How to use -Starting trait selection of your martial art goes in mutations.json. Place your art in the right category (self-defense, Shaolin animal form, melee style, etc) +MA can be granted to characters in different ways. They can be `autolearn`ed (as in the MA example), learned from [books](JSON_INFO.md#books) (as `martial_art`), be granted by traits (as `initial_ma_styles`), or dynamically by [eocs](EFFECT_ON_CONDITION.md#u_learn_martial_artnpc_learn_martial_art). -Use json/itemgroups/ to place your martial art book and any martial weapons you've made for the art into spawns in various locations in the world. If you don't place your weapons in there, only recipes to craft them will be an option. From 9c9f2ca044636e1e1217b5b0d02e0b7470317202 Mon Sep 17 00:00:00 2001 From: GuardianDll Date: Sat, 7 Dec 2024 13:09:43 +0100 Subject: [PATCH 007/158] refactor and simplify force_add --- src/magic_enchantment.cpp | 186 ++++++++++---------------------------- src/magic_enchantment.h | 2 + 2 files changed, 50 insertions(+), 138 deletions(-) diff --git a/src/magic_enchantment.cpp b/src/magic_enchantment.cpp index 8a9ae0ca44902..cb6a1adb4e3be 100644 --- a/src/magic_enchantment.cpp +++ b/src/magic_enchantment.cpp @@ -810,179 +810,89 @@ void enchant_cache::force_add( const enchant_cache &rhs ) void enchant_cache::force_add( const enchantment &rhs, const Character &guy ) { const_dialogue d( get_const_talker_for( guy ), nullptr ); - for( const std::pair &pair_values : - rhs.values_add ) { - values_add[pair_values.first] += pair_values.second.evaluate( d ); - } - for( const std::pair &pair_values : - rhs.values_multiply ) { - // values do not multiply against each other, they add. - // so +10% and -10% will add to 0% - values_multiply[pair_values.first] += pair_values.second.evaluate( d ); - } - - for( const std::pair &pair_values : - rhs.skill_values_add ) { - skill_values_add[pair_values.first] += pair_values.second.evaluate( d ); - } - for( const std::pair &pair_values : - rhs.skill_values_multiply ) { - // values do not multiply against each other, they add. - // so +10% and -10% will add to 0% - skill_values_multiply[pair_values.first] += pair_values.second.evaluate( d ); - } - - for( const std::pair &pair_values : - rhs.damage_values_add ) { - damage_values_add[pair_values.first] += pair_values.second.evaluate( d ); - } - for( const std::pair &pair_values : - rhs.damage_values_multiply ) { - damage_values_multiply[pair_values.first] += pair_values.second.evaluate( d ); - } - - // from eval to cache, for char - for( const enchantment::special_vision &struc : rhs.special_vision_vector ) { - special_vision_vector.emplace_back( special_vision{ - struc.special_vision_descriptions_vector, struc.condition, struc.range.evaluate( d ), - struc.precise, struc.ignores_aiming_cone } ); - } - - hit_me_effect.insert( hit_me_effect.end(), rhs.hit_me_effect.begin(), rhs.hit_me_effect.end() ); - - hit_you_effect.insert( hit_you_effect.end(), rhs.hit_you_effect.begin(), rhs.hit_you_effect.end() ); - - ench_effects.insert( rhs.ench_effects.begin(), rhs.ench_effects.end() ); - - if( rhs.emitter ) { - emitter = rhs.emitter; - } - - for( const bodypart_changes &bp : rhs.modified_bodyparts ) { - modified_bodyparts.emplace_back( bp ); - } - - for( const trait_id &branch : rhs.mutations ) { - mutations.emplace( branch ); - } - - for( const std::pair> &act_pair : - rhs.intermittent_activation ) { - for( const fake_spell &fake : act_pair.second ) { - intermittent_activation[act_pair.first].emplace_back( fake ); - } - } - - details.emplace_back( rhs.name.translated(), rhs.description.translated() ); + force_add_with_dialogue( rhs, d ); } void enchant_cache::force_add( const enchantment &rhs, const monster &mon ) { const_dialogue d( get_const_talker_for( mon ), nullptr ); - for( const std::pair &pair_values : - rhs.values_add ) { - values_add[pair_values.first] += pair_values.second.evaluate( d ); - } - for( const std::pair &pair_values : - rhs.values_multiply ) { - // values do not multiply against each other, they add. - // so +10% and -10% will add to 0% - values_multiply[pair_values.first] += pair_values.second.evaluate( d ); - } - - for( const std::pair &pair_values : - rhs.skill_values_add ) { - skill_values_add[pair_values.first] += pair_values.second.evaluate( d ); - } - for( const std::pair &pair_values : - rhs.skill_values_multiply ) { - // values do not multiply against each other, they add. - // so +10% and -10% will add to 0% - skill_values_multiply[pair_values.first] += pair_values.second.evaluate( d ); - } - - for( const std::pair &pair_values : - rhs.damage_values_add ) { - damage_values_add[pair_values.first] += pair_values.second.evaluate( d ); - } - for( const std::pair &pair_values : - rhs.damage_values_multiply ) { - damage_values_multiply[pair_values.first] += pair_values.second.evaluate( d ); - } - - // from eval to cache, for monster - for( const enchantment::special_vision &struc : rhs.special_vision_vector ) { - special_vision_vector.emplace_back( special_vision{ - struc.special_vision_descriptions_vector, struc.condition, struc.range.evaluate( d ), - struc.precise, struc.ignores_aiming_cone } ); - } - - hit_me_effect.insert( hit_me_effect.end(), rhs.hit_me_effect.begin(), rhs.hit_me_effect.end() ); - - hit_you_effect.insert( hit_you_effect.end(), rhs.hit_you_effect.begin(), rhs.hit_you_effect.end() ); - - ench_effects.insert( rhs.ench_effects.begin(), rhs.ench_effects.end() ); - - if( rhs.emitter ) { - emitter = rhs.emitter; - } - - for( const bodypart_changes &bp : rhs.modified_bodyparts ) { - modified_bodyparts.emplace_back( bp ); - } - - for( const trait_id &branch : rhs.mutations ) { - mutations.emplace( branch ); - } - - for( const std::pair> &act_pair : - rhs.intermittent_activation ) { - for( const fake_spell &fake : act_pair.second ) { - intermittent_activation[act_pair.first].emplace_back( fake ); - } - } - - details.emplace_back( rhs.name.translated(), rhs.description.translated() ); + force_add_with_dialogue( rhs, d ); } void enchant_cache::force_add( const enchantment &rhs ) +{ + const_dialogue d( nullptr, nullptr ); + force_add_with_dialogue( rhs, d, false ); +} + +void enchant_cache::force_add_with_dialogue( const enchantment &rhs, const const_dialogue d, + const bool evaluate ) { for( const std::pair &pair_values : rhs.values_add ) { - values_add[pair_values.first] += pair_values.second.constant(); + if( evaluate ) { + values_add[pair_values.first] += pair_values.second.evaluate( d ); + } else { + values_add[pair_values.first] += pair_values.second.constant(); + } } for( const std::pair &pair_values : rhs.values_multiply ) { // values do not multiply against each other, they add. // so +10% and -10% will add to 0% - values_multiply[pair_values.first] += pair_values.second.constant(); + if( evaluate ) { + values_multiply[pair_values.first] += pair_values.second.evaluate( d ); + } else { + values_multiply[pair_values.first] += pair_values.second.constant(); + } } for( const std::pair &pair_values : rhs.skill_values_add ) { - skill_values_add[pair_values.first] += pair_values.second.constant(); + if( evaluate ) { + skill_values_add[pair_values.first] += pair_values.second.evaluate( d ); + } else { + skill_values_add[pair_values.first] += pair_values.second.constant(); + } } for( const std::pair &pair_values : rhs.skill_values_multiply ) { // values do not multiply against each other, they add. // so +10% and -10% will add to 0% - skill_values_multiply[pair_values.first] += pair_values.second.constant(); + if( evaluate ) { + skill_values_multiply[pair_values.first] += pair_values.second.evaluate( d ); + } else { + skill_values_multiply[pair_values.first] += pair_values.second.constant(); + } } for( const std::pair &pair_values : rhs.damage_values_add ) { - damage_values_add[pair_values.first] += pair_values.second.constant(); + if( evaluate ) { + damage_values_add[pair_values.first] += pair_values.second.evaluate( d ); + } else { + damage_values_add[pair_values.first] += pair_values.second.constant(); + } } for( const std::pair &pair_values : rhs.damage_values_multiply ) { - damage_values_multiply[pair_values.first] += pair_values.second.constant(); + if( evaluate ) { + damage_values_multiply[pair_values.first] += pair_values.second.evaluate( d ); + } else { + damage_values_multiply[pair_values.first] += pair_values.second.constant(); + } } - // from eval to cache, with constant for( const enchantment::special_vision &struc : rhs.special_vision_vector ) { - special_vision_vector.emplace_back( special_vision{ - struc.special_vision_descriptions_vector, struc.condition, struc.range.constant(), - struc.precise, struc.ignores_aiming_cone } ); + if( evaluate ) { + special_vision_vector.emplace_back( special_vision{ + struc.special_vision_descriptions_vector, struc.condition, struc.range.evaluate( d ), + struc.precise, struc.ignores_aiming_cone } ); + } else { + special_vision_vector.emplace_back( special_vision{ + struc.special_vision_descriptions_vector, struc.condition, struc.range.constant(), + struc.precise, struc.ignores_aiming_cone } ); + } } hit_me_effect.insert( hit_me_effect.end(), rhs.hit_me_effect.begin(), rhs.hit_me_effect.end() ); diff --git a/src/magic_enchantment.h b/src/magic_enchantment.h index 264d686c0ecee..e7e74dae70593 100644 --- a/src/magic_enchantment.h +++ b/src/magic_enchantment.h @@ -320,6 +320,8 @@ class enchant_cache : public enchantment void force_add( const enchantment &rhs, const monster &mon ); void force_add( const enchantment &rhs ); void force_add( const enchant_cache &rhs ); + void force_add_with_dialogue( const enchantment &rhs, const const_dialogue d, + const bool evaluate = true ); // modifies character stats, or does other passive effects void activate_passive( Character &guy ) const; From fbf71a0f66fc26fad25aa7a55f181a1a4ae42e12 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Sat, 7 Dec 2024 15:55:25 +0100 Subject: [PATCH 008/158] typified game.h and .cpp --- src/activity_handlers.cpp | 2 +- src/activity_item_handling.cpp | 2 +- src/avatar_action.cpp | 4 +- src/bionics.cpp | 10 +- src/cata_tiles.cpp | 4 +- src/character.cpp | 12 +- src/character.h | 2 +- src/character_body.cpp | 6 +- src/computer_session.cpp | 8 +- src/consumption.cpp | 2 +- src/creature.h | 2 +- src/debug_menu.cpp | 8 +- src/display.cpp | 4 +- src/game.cpp | 539 +++++++++++++++---------------- src/game.h | 96 +++--- src/handle_action.cpp | 33 +- src/iexamine.cpp | 6 +- src/item.cpp | 8 +- src/iuse.cpp | 12 +- src/iuse_actor.cpp | 4 +- src/magic_spell_effect.cpp | 6 +- src/map.cpp | 2 +- src/map.h | 8 +- src/mattack_actors.cpp | 2 +- src/medical_ui.cpp | 8 +- src/melee.cpp | 4 +- src/monattack.cpp | 45 +-- src/monmove.cpp | 26 +- src/monster.cpp | 14 +- src/monster.h | 4 +- src/mutation.cpp | 2 +- src/npc.cpp | 8 +- src/npc.h | 2 +- src/npcmove.cpp | 8 +- src/npctalk.cpp | 16 +- src/npctalk_funcs.cpp | 2 +- src/overmapbuffer.cpp | 2 +- src/pathfinding.cpp | 77 ++--- src/pickup.cpp | 2 +- src/player_display.cpp | 6 +- src/player_hardcoded_effects.cpp | 2 +- src/sounds.cpp | 2 +- src/suffer.cpp | 5 +- src/talker_avatar.cpp | 2 +- src/timed_event.cpp | 4 +- src/trapfunc.cpp | 24 +- src/weather.cpp | 8 +- tests/bionics_test.cpp | 2 +- tests/char_sight_test.cpp | 8 +- tests/char_suffer_test.cpp | 4 +- tests/effect_test.cpp | 2 +- tests/enchantments_test.cpp | 6 +- tests/eoc_test.cpp | 16 +- 53 files changed, 537 insertions(+), 556 deletions(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 3d2ecdd36a660..2924118de669c 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -2920,7 +2920,7 @@ static void rod_fish( Character *you, const std::vector &fishables ) monster *chosen_fish = random_entry( fishables ); chosen_fish->fish_population -= 1; if( chosen_fish->fish_population <= 0 ) { - g->catch_a_monster( chosen_fish, you->pos(), you, 50_hours ); + g->catch_a_monster( chosen_fish, you->pos_bub(), you, 50_hours ); } else { here.add_item_or_charges( you->pos_bub(), item::make_corpse( chosen_fish->type->id, calendar::turn + rng( 0_turns, diff --git a/src/activity_item_handling.cpp b/src/activity_item_handling.cpp index 710134401a5fe..3775a76811ca7 100644 --- a/src/activity_item_handling.cpp +++ b/src/activity_item_handling.cpp @@ -3092,7 +3092,7 @@ static bool generic_multi_activity_do( you.activity.targets.emplace_back( you, &best_rod ); // TODO: fix point types you.activity.coord_set = - g->get_fishable_locations( ACTIVITY_SEARCH_DISTANCE, src_loc.raw() ); + g->get_fishable_locations( ACTIVITY_SEARCH_DISTANCE, src_loc ); return false; } else if( reason == do_activity_reason::NEEDS_MINING ) { // if have enough batteries to continue etc. diff --git a/src/avatar_action.cpp b/src/avatar_action.cpp index 4e0b99894951f..5e67aefeabb48 100644 --- a/src/avatar_action.cpp +++ b/src/avatar_action.cpp @@ -458,7 +458,7 @@ bool avatar_action::move( avatar &you, map &m, const tripoint_rel_ms &d ) if( veh0 != nullptr && std::abs( veh0->velocity ) > 100 ) { if( veh1 == nullptr ) { if( query_yn( _( "Dive from moving vehicle?" ) ) ) { - g->moving_vehicle_dismount( dest_loc.raw() ); + g->moving_vehicle_dismount( dest_loc ); } return false; } else if( veh1 != veh0 ) { @@ -656,7 +656,7 @@ void avatar_action::swim( map &m, avatar &you, const tripoint_bub_ms &p ) you.setpos( p ); g->update_map( you ); - cata_event_dispatch::avatar_moves( old_abs_pos.raw(), you, m ); + cata_event_dispatch::avatar_moves( old_abs_pos, you, m ); if( m.veh_at( you.pos_bub() ).part_with_feature( VPFLAG_BOARDABLE, true ) ) { m.board_vehicle( you.pos_bub(), &you ); diff --git a/src/bionics.cpp b/src/bionics.cpp index 26c312a4c2ac9..30b574514c60d 100644 --- a/src/bionics.cpp +++ b/src/bionics.cpp @@ -873,7 +873,7 @@ bool Character::activate_bionic( bionic &bio, bool eff_only, bool *close_bionics add_msg_activate(); const w_point weatherPoint = *get_weather().weather_precise; int humidity = get_local_humidity( weatherPoint.humidity, get_weather().weather_id, - g->is_sheltered( player_character.pos() ) ); + g->is_sheltered( player_character.pos_bub() ) ); // thirst units = 5 mL int water_available = std::lround( humidity * 3.0 / 100.0 ); if( water_available == 0 ) { @@ -1069,13 +1069,13 @@ bool Character::activate_bionic( bionic &bio, bool eff_only, bool *close_bionics weather_manager &weather = get_weather(); const units::temperature player_local_temp = weather.get_temperature( player_character.pos() ); const int windpower = get_local_windpower( weather.windspeed + vehwindspeed, - cur_om_ter, get_location(), weather.winddirection, g->is_sheltered( pos() ) ); + cur_om_ter, get_location(), weather.winddirection, g->is_sheltered( pos_bub() ) ); add_msg_if_player( m_info, _( "Temperature: %s." ), print_temperature( player_local_temp ) ); const w_point weatherPoint = *weather.weather_precise; add_msg_if_player( m_info, _( "Relative Humidity: %s." ), print_humidity( get_local_humidity( weatherPoint.humidity, get_weather().weather_id, - g->is_sheltered( player_character.pos() ) ) ) ); + g->is_sheltered( player_character.pos_bub() ) ) ) ); add_msg_if_player( m_info, _( "Pressure: %s." ), print_pressure( static_cast( weatherPoint.pressure ) ) ); add_msg_if_player( m_info, _( "Wind Speed: %.1f %s." ), @@ -1438,7 +1438,7 @@ void Character::burn_fuel( bionic &bio ) bool solar_powered = ( !bio.id->fuel_opts.empty() && bio.id->fuel_opts.front() == fuel_type_sun_light ) || !result.connected_solar.empty(); - if( energy_gain == 0_J && solar_powered && !g->is_sheltered( pos() ) ) { + if( energy_gain == 0_J && solar_powered && !g->is_sheltered( pos_bub() ) ) { // Some sort of solar source const weather_type_id &wtype = current_weather( get_location() ); @@ -1709,7 +1709,7 @@ void Character::process_bionic( bionic &bio ) if( calendar::once_every( 5_minutes ) ) { const w_point weatherPoint = *get_weather().weather_precise; int humidity = get_local_humidity( weatherPoint.humidity, get_weather().weather_id, - g->is_sheltered( pos() ) ); + g->is_sheltered( pos_bub() ) ); // in thirst units = 5 mL water int water_available = std::lround( humidity * 3.0 / 100.0 ); // At 50% relative humidity or more, the player will draw 10 mL diff --git a/src/cata_tiles.cpp b/src/cata_tiles.cpp index ae2dfa1d7739c..8d685d8f75d7a 100644 --- a/src/cata_tiles.cpp +++ b/src/cata_tiles.cpp @@ -1945,10 +1945,10 @@ void cata_tiles::draw( const point &dest, const tripoint ¢er, int width, int false ); } if( you.controlling_vehicle ) { - std::optional indicator_offset = g->get_veh_dir_indicator_location( true ); + std::optional indicator_offset = g->get_veh_dir_indicator_location( true ); if( indicator_offset ) { draw_from_id_string( "cursor", TILE_CATEGORY::NONE, empty_string, - indicator_offset->xy() + + indicator_offset->raw().xy() + tripoint( you.posx(), you.posy(), center.z ), 0, 0, lit_level::LIT, false ); } diff --git a/src/character.cpp b/src/character.cpp index 64e59322931e7..fc07fc877fd60 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -1911,7 +1911,7 @@ void Character::dismount() add_msg_debug( debugmode::DF_CHARACTER, "dismount called when not riding" ); return; } - if( const std::optional pnt = choose_adjacent( _( "Dismount where?" ) ) ) { + if( const std::optional pnt = choose_adjacent_bub( _( "Dismount where?" ) ) ) { if( !g->is_empty( *pnt ) ) { add_msg( m_warning, _( "You cannot dismount there!" ) ); return; @@ -8190,7 +8190,7 @@ dealt_damage_instance Character::deal_damage( Creature *source, bodypart_id bp, // And slimespawners too if( has_trait( trait_SLIMESPAWNER ) && ( dam >= 10 ) && one_in( 20 - dam ) ) { - if( monster *const slime = g->place_critter_around( mon_player_blob, pos(), 1 ) ) { + if( monster *const slime = g->place_critter_around( mon_player_blob, pos_bub(), 1 ) ) { slime->friendly = -1; add_msg_if_player( m_warning, _( "A mass of slime is torn from you, and moves on its own!" ) ); } @@ -9983,11 +9983,11 @@ float Character::adjust_for_focus( float amount ) const return amount * ( effective_focus / 100.0f ); } -std::function Character::get_path_avoid() const +std::function Character::get_path_avoid() const { // TODO: Add known traps in a way that doesn't destroy performance - return [this]( const tripoint & p ) { + return [this]( const tripoint_bub_ms & p ) { Creature *critter = get_creature_tracker().creature_at( p, true ); return critter && critter->is_npc() && this->sees( *critter ); }; @@ -10954,7 +10954,7 @@ void Character::process_one_effect( effect &it, bool is_new ) void Character::process_effects() { //Special Removals - if( has_effect( effect_darkness ) && g->is_in_sunlight( pos() ) ) { + if( has_effect( effect_darkness ) && g->is_in_sunlight( pos_bub() ) ) { remove_effect( effect_darkness ); } if( has_trait( trait_M_IMMUNE ) && has_effect( effect_fungus ) ) { @@ -12225,7 +12225,7 @@ void Character::recalc_speed_bonus() // Ectothermic/COLDBLOOD4 is intended to buff folks in the Summer // Threshold-crossing has its charms ;-) if( g != nullptr ) { - if( has_trait( trait_SUNLIGHT_DEPENDENT ) && !g->is_in_sunlight( pos() ) ) { + if( has_trait( trait_SUNLIGHT_DEPENDENT ) && !g->is_in_sunlight( pos_bub() ) ) { //FIXME get trait name directly mod_speed_bonus( -( g->light_level( posz() ) >= 12 ? 5 : 10 ), _( "Sunlight Dependent" ) ); } diff --git a/src/character.h b/src/character.h index bca79ca5f3e90..0be6f0ae9beda 100644 --- a/src/character.h +++ b/src/character.h @@ -3281,7 +3281,7 @@ class Character : public Creature, public visitable int run_cost( int base_cost, bool diag = false ) const; const pathfinding_settings &get_pathfinding_settings() const override; - std::function get_path_avoid() const override; + std::function get_path_avoid() const override; /** * Get all hostile creatures currently visible to this player. */ diff --git a/src/character_body.cpp b/src/character_body.cpp index 7882ae0b3d349..654b832273920 100644 --- a/src/character_body.cpp +++ b/src/character_body.cpp @@ -503,10 +503,10 @@ void Character::update_bodytemp() // Sunlight const float scaled_sun_irradiance = incident_sun_irradiance( get_weather().weather_id, calendar::turn ) / max_sun_irradiance(); - const units::temperature_delta sunlight_warmth = !g->is_sheltered( pos() ) ? 3_C_delta * + const units::temperature_delta sunlight_warmth = !g->is_sheltered( pos_bub() ) ? 3_C_delta * scaled_sun_irradiance : 0_C_delta; - const int best_fire = get_best_fire( pos() ); + const int best_fire = get_best_fire( pos_bub() ); const units::temperature_delta lying_warmth = use_floor_warmth ? floor_warmth( pos() ) : 0_C_delta; const units::temperature water_temperature = @@ -519,7 +519,7 @@ void Character::update_bodytemp() // Difference between high and low is the "safe" heat - one we only apply if it's beneficial const units::temperature_delta mutation_heat_bonus = mutation_heat_high - mutation_heat_low; - const units::temperature_delta h_radiation = get_heat_radiation( pos() ); + const units::temperature_delta h_radiation = get_heat_radiation( pos_bub() ); // 111F (44C) is a temperature in which proteins break down: https://en.wikipedia.org/wiki/Burn // Blisters arbitrarily scale with the sqrt of the temperature difference in fahrenheit. diff --git a/src/computer_session.cpp b/src/computer_session.cpp index e6d743ab281fb..377a1966e940f 100644 --- a/src/computer_session.cpp +++ b/src/computer_session.cpp @@ -1623,8 +1623,8 @@ void computer_session::failure_alarm() void computer_session::failure_manhacks() { int num_robots = rng( 4, 8 ); - const tripoint_range range = - get_map().points_in_radius( get_player_character().pos(), 3 ); + const tripoint_range range = + get_map().points_in_radius( get_player_character().pos_bub(), 3 ); for( int i = 0; i < num_robots; i++ ) { if( g->place_critter_within( mon_manhack, range ) ) { add_msg( m_warning, _( "Manhacks drop from compartments in the ceiling." ) ); @@ -1634,8 +1634,8 @@ void computer_session::failure_manhacks() void computer_session::failure_secubots() { - const tripoint_range range = - get_map().points_in_radius( get_player_character().pos(), 3 ); + const tripoint_range range = + get_map().points_in_radius( get_player_character().pos_bub(), 3 ); if( g->place_critter_within( mon_secubot, range ) ) { add_msg( m_warning, _( "A secubot emerges from a compartment in the floor." ) ); } diff --git a/src/consumption.cpp b/src/consumption.cpp index 3bd4d698c16e7..ae8018fcda0da 100644 --- a/src/consumption.cpp +++ b/src/consumption.cpp @@ -1677,7 +1677,7 @@ bool Character::consume_effects( item &food ) mod_pain( 5 ); int numslime = 1; for( int i = 0; i < numslime; i++ ) { - if( monster *const slime = g->place_critter_around( mon_player_blob, pos(), 1 ) ) { + if( monster *const slime = g->place_critter_around( mon_player_blob, pos_bub(), 1 ) ) { slime->friendly = -1; } } diff --git a/src/creature.h b/src/creature.h index 048100ccd6665..8635369f1d8be 100644 --- a/src/creature.h +++ b/src/creature.h @@ -950,7 +950,7 @@ class Creature : public viewer /** Returns settings for pathfinding. */ virtual const pathfinding_settings &get_pathfinding_settings() const = 0; /** Returns a set of points we do not want to path through. */ - virtual std::function get_path_avoid() const = 0; + virtual std::function get_path_avoid() const = 0; bool underwater; void draw( const catacurses::window &w, const point_bub_ms &origin, bool inverted ) const; diff --git a/src/debug_menu.cpp b/src/debug_menu.cpp index 79fc663b51085..9dd497967a088 100644 --- a/src/debug_menu.cpp +++ b/src/debug_menu.cpp @@ -3597,10 +3597,10 @@ static void set_automove() return; } - // TODO: fix point types - auto rt = get_map().route( player_character.pos_bub(), tripoint_bub_ms( *dest ), - player_character.get_pathfinding_settings(), - player_character.get_path_avoid() ); + std::vector rt = get_map().route( player_character.pos_bub(), + tripoint_bub_ms( *dest ), + player_character.get_pathfinding_settings(), + player_character.get_path_avoid() ); if( !rt.empty() ) { player_character.set_destination( rt ); } else { diff --git a/src/display.cpp b/src/display.cpp index f3c3e1ecae2fc..c834e4c645881 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -249,7 +249,7 @@ std::string display::sundial_text_color( const Character &u, int width ) const int azm_pos = static_cast( std::round( azm / scale ) ) - 1; const int night_h = h >= h_dawn + 12 ? h - ( h_dawn + 12 ) : h + ( 12 - h_dawn ); std::string ret = "["; - if( g->is_sheltered( u.pos() ) ) { + if( g->is_sheltered( u.pos_bub() ) ) { ret += ( width > 0 ? std::string( width, '?' ) : "" ); } else { for( int i = 0; i < width; i++ ) { @@ -1507,7 +1507,7 @@ std::pair display::wind_text_color( const Character &u ) const oter_id &cur_om_ter = overmap_buffer.ter( u.global_omt_location() ); weather_manager &weather = get_weather(); double windpower = get_local_windpower( weather.windspeed, cur_om_ter, - u.get_location(), weather.winddirection, g->is_sheltered( u.pos() ) ); + u.get_location(), weather.winddirection, g->is_sheltered( u.pos_bub() ) ); // Wind descriptor followed by a directional arrow const std::string wind_text = get_wind_desc( windpower ) + " " + get_wind_arrow( diff --git a/src/game.cpp b/src/game.cpp index 6832e6e3a9b4b..6ec69c8a1c986 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1134,7 +1134,7 @@ bool game::start_game() update_map( u ); // Profession pets for( const mtype_id &elem : u.starting_pets ) { - if( monster *const mon = place_critter_around( elem, u.pos(), 5 ) ) { + if( monster *const mon = place_critter_around( elem, u.pos_bub(), 5 ) ) { mon->friendly = -1; mon->add_effect( effect_pet, 1_turns, true ); } else { @@ -1411,13 +1411,13 @@ void game::calc_driving_offset( vehicle *veh ) // The maximal offset will leave at least this many tiles // between the PC and the edge of the main window. static const int border_range = 2; - point max_offset( ( getmaxx( w_terrain ) + 1 ) / 2 - border_range - 1, - ( getmaxy( w_terrain ) + 1 ) / 2 - border_range - 1 ); + point_rel_ms max_offset( ( getmaxx( w_terrain ) + 1 ) / 2 - border_range - 1, + ( getmaxy( w_terrain ) + 1 ) / 2 - border_range - 1 ); // velocity at or below this results in no offset at all static const float min_offset_vel = 1 * vehicles::vmiph_per_tile; // velocity at or above this results in maximal offset - const float max_offset_vel = std::min( max_offset.y, max_offset.x ) * + const float max_offset_vel = std::min( max_offset.y(), max_offset.x() ) * vehicles::vmiph_per_tile; float velocity = veh->velocity; rl_vec2d offset = veh->move_vec(); @@ -1443,8 +1443,8 @@ void game::calc_driving_offset( vehicle *veh ) } offset.x *= rel_offset; offset.y *= rel_offset; - offset.x *= max_offset.x; - offset.y *= max_offset.y; + offset.x *= max_offset.x(); + offset.y *= max_offset.y(); // [ ----@---- ] sight=6 // [ --@------ ] offset=2 // [ -@------# ] offset=3 @@ -1458,35 +1458,35 @@ void game::calc_driving_offset( vehicle *veh ) // above leads to invisible area in front of the car. // It will display (getmax/2+offset) squares in one direction and // (getmax/2-offset) in the opposite direction (centered on the PC). - const point maxoff( ( sight * 2 + 1 - getmaxx( w_terrain ) ) / 2, - ( sight * 2 + 1 - getmaxy( w_terrain ) ) / 2 ); - if( maxoff.x <= 0 ) { + const point_rel_ms maxoff( ( sight * 2 + 1 - getmaxx( w_terrain ) ) / 2, + ( sight * 2 + 1 - getmaxy( w_terrain ) ) / 2 ); + if( maxoff.x() <= 0 ) { offset.x = 0; - } else if( offset.x > 0 && offset.x > maxoff.x ) { - offset.x = maxoff.x; - } else if( offset.x < 0 && -offset.x > maxoff.x ) { - offset.x = -maxoff.x; + } else if( offset.x > 0 && offset.x > maxoff.x() ) { + offset.x = maxoff.x(); + } else if( offset.x < 0 && -offset.x > maxoff.x() ) { + offset.x = -maxoff.x(); } - if( maxoff.y <= 0 ) { + if( maxoff.y() <= 0 ) { offset.y = 0; - } else if( offset.y > 0 && offset.y > maxoff.y ) { - offset.y = maxoff.y; - } else if( offset.y < 0 && -offset.y > maxoff.y ) { - offset.y = -maxoff.y; + } else if( offset.y > 0 && offset.y > maxoff.y() ) { + offset.y = maxoff.y(); + } else if( offset.y < 0 && -offset.y > maxoff.y() ) { + offset.y = -maxoff.y(); } // Turn the offset into a vector that increments the offset toward the desired position // instead of setting it there instantly, should smooth out jerkiness. const point_rel_ms offset_difference( -driving_view_offset + point( offset.x, offset.y ) ); - const point offset_sign( ( offset_difference.x() < 0 ) ? -1 : 1, - ( offset_difference.y() < 0 ) ? -1 : 1 ); + const point_rel_ms offset_sign( ( offset_difference.x() < 0 ) ? -1 : 1, + ( offset_difference.y() < 0 ) ? -1 : 1 ); // Shift the current offset in the direction of the calculated offset by one tile // per draw event, but snap to calculated offset if we're close enough to avoid jitter. offset.x = ( std::abs( offset_difference.x() ) > 1 ) ? - ( driving_view_offset.x() + offset_sign.x ) : offset.x; + ( driving_view_offset.x() + offset_sign.x() ) : offset.x; offset.y = ( std::abs( offset_difference.y() ) > 1 ) ? - ( driving_view_offset.y() + offset_sign.y ) : offset.y; + ( driving_view_offset.y() + offset_sign.y() ) : offset.y; set_driving_view_offset( { offset.x, offset.y } ); } @@ -1502,7 +1502,7 @@ void game::set_driving_view_offset( const point_rel_ms &p ) driving_view_offset.raw(); // TODO: Implement -= etc. for relative coordinates. } -void game::catch_a_monster( monster *fish, const tripoint &pos, Character *p, +void game::catch_a_monster( monster *fish, const tripoint_bub_ms &pos, Character *p, const time_duration &catch_duration ) // catching function { //spawn the corpse, rotten by a part of the duration @@ -1689,14 +1689,14 @@ static int maptile_field_intensity( maptile &mt, field_type_id fld ) return field_ptr == nullptr ? 0 : field_ptr->get_field_intensity(); } -units::temperature_delta get_heat_radiation( const tripoint &location ) +units::temperature_delta get_heat_radiation( const tripoint_bub_ms &location ) { units::temperature_delta temp_mod = units::from_kelvin_delta( 0 ); Character &player_character = get_player_character(); map &here = get_map(); // Convert it to an int id once, instead of 139 times per turn const field_type_id fd_fire_int = fd_fire.id(); - for( const tripoint_bub_ms &dest : here.points_in_radius( tripoint_bub_ms( location ), 6 ) ) { + for( const tripoint_bub_ms &dest : here.points_in_radius( location, 6 ) ) { int heat_intensity = 0; maptile mt = here.maptile_at( dest ); @@ -1711,28 +1711,28 @@ units::temperature_delta get_heat_radiation( const tripoint &location ) // No heat source here continue; } - if( player_character.pos_bub().raw() == location ) { - if( !here.clear_path( dest.raw(), location, -1, 1, 100 ) ) { + if( player_character.pos_bub() == location ) { + if( !here.clear_path( dest, location, -1, 1, 100 ) ) { continue; } - } else if( !here.sees( location, dest.raw(), -1 ) ) { + } else if( !here.sees( location, dest, -1 ) ) { continue; } // Ensure fire_dist >= 1 to avoid divide-by-zero errors. - const int fire_dist = std::max( 1, square_dist( dest.raw(), location ) ); + const int fire_dist = std::max( 1, square_dist( dest, location ) ); temp_mod += units::from_fahrenheit_delta( 6.f * heat_intensity * heat_intensity / fire_dist ); } return temp_mod; } -int get_best_fire( const tripoint &location ) +int get_best_fire( const tripoint_bub_ms &location ) { int best_fire = 0; Character &player_character = get_player_character(); map &here = get_map(); // Convert it to an int id once, instead of 139 times per turn const field_type_id fd_fire_int = fd_fire.id(); - for( const tripoint_bub_ms &dest : here.points_in_radius( tripoint_bub_ms( location ), 6 ) ) { + for( const tripoint_bub_ms &dest : here.points_in_radius( location, 6 ) ) { int heat_intensity = 0; maptile mt = here.maptile_at( dest ); @@ -1747,14 +1747,14 @@ int get_best_fire( const tripoint &location ) // No heat source here continue; } - if( player_character.pos_bub().raw() == location ) { - if( !here.clear_path( dest.raw(), location, -1, 1, 100 ) ) { + if( player_character.pos_bub() == location ) { + if( !here.clear_path( dest, location, -1, 1, 100 ) ) { continue; } - } else if( !here.sees( location, dest.raw(), -1 ) ) { + } else if( !here.sees( location, dest, -1 ) ) { continue; } - if( square_dist( dest.raw(), location ) <= 1 ) { + if( square_dist( dest, location ) <= 1 ) { // Extend limbs/lean over a single adjacent fire to warm up best_fire = std::max( best_fire, heat_intensity ); } @@ -1762,7 +1762,7 @@ int get_best_fire( const tripoint &location ) return best_fire; } -units::temperature_delta get_convection_temperature( const tripoint &location ) +units::temperature_delta get_convection_temperature( const tripoint_bub_ms &location ) { units::temperature_delta temp_mod = units::from_kelvin_delta( 0 ); map &here = get_map(); @@ -2523,24 +2523,24 @@ std::pair game::mouse_edge_scrolling( input_co } const input_event event = ctxt.get_raw_input(); if( event.type == input_event_t::mouse ) { - const point threshold( projected_window_width() / 100, projected_window_height() / 100 ); - if( event.mouse_pos.x <= threshold.x ) { + const point_rel_ms threshold( projected_window_width() / 100, projected_window_height() / 100 ); + if( event.mouse_pos.x <= threshold.x() ) { ret.first.x() -= speed; if( iso ) { ret.first.y() -= speed; } - } else if( event.mouse_pos.x >= projected_window_width() - threshold.x ) { + } else if( event.mouse_pos.x >= projected_window_width() - threshold.x() ) { ret.first.x() += speed; if( iso ) { ret.first.y() += speed; } } - if( event.mouse_pos.y <= threshold.y ) { + if( event.mouse_pos.y <= threshold.y() ) { ret.first.y() -= speed; if( iso ) { ret.first.x() += speed; } - } else if( event.mouse_pos.y >= projected_window_height() - threshold.y ) { + } else if( event.mouse_pos.y >= projected_window_height() - threshold.y() ) { ret.first.y() += speed; if( iso ) { ret.first.x() -= speed; @@ -3771,7 +3771,7 @@ struct npc_dist_to_player { void game::disp_NPCs() { const tripoint_abs_omt ppos = u.global_omt_location(); - const tripoint lpos = u.pos(); + const tripoint_bub_ms lpos = u.pos_bub(); const int scan_range = 120; std::vector> npcs = overmap_buffer.get_npcs_near_player( scan_range ); std::sort( npcs.begin(), npcs.end(), npc_dist_to_player() ); @@ -3830,16 +3830,16 @@ void game::disp_NPCs() } // A little helper to draw footstep glyphs. -static void draw_footsteps( const catacurses::window &window, const tripoint &offset ) +static void draw_footsteps( const catacurses::window &window, const tripoint_rel_ms &offset ) { wattron( window, c_yellow ); for( const tripoint &footstep : sounds::get_footstep_markers() ) { char glyph = '?'; - if( footstep.z != offset.z ) { // Here z isn't an offset, but a coordinate - glyph = footstep.z > offset.z ? '^' : 'v'; + if( footstep.z != offset.z() ) { // Here z isn't an offset, but a coordinate + glyph = footstep.z > offset.z() ? '^' : 'v'; } - mvwaddch( window, footstep.xy() + offset.xy(), glyph ); + mvwaddch( window, footstep.xy() + offset.raw().xy(), glyph ); } wattroff( window, c_yellow ); } @@ -3956,7 +3956,7 @@ void game::add_draw_callback( const shared_ptr_fast &cb ) invalidate_main_ui_adaptor(); } -static void draw_trail( const tripoint &start, const tripoint &end, bool bDrawX ); +static void draw_trail( const tripoint_bub_ms &start, const tripoint_bub_ms &end, bool bDrawX ); static shared_ptr_fast create_zone_callback( const std::optional &zone_start, @@ -3981,9 +3981,9 @@ static shared_ptr_fast create_zone_callback( } if( zone_blink && zone_start && zone_end ) { avatar &player_character = get_avatar(); - const point offset2( player_character.view_offset.xy().raw() + - point( player_character.posx() - getmaxx( g->w_terrain ) / 2, - player_character.posy() - getmaxy( g->w_terrain ) / 2 ) ); + const point_rel_ms offset2( player_character.view_offset.xy() + + point( player_character.posx() - getmaxx( g->w_terrain ) / 2, + player_character.posy() - getmaxy( g->w_terrain ) / 2 ) ); tripoint_rel_ms offset; #if defined(TILES) @@ -3991,7 +3991,7 @@ static shared_ptr_fast create_zone_callback( offset = tripoint_rel_ms::zero; //TILES } else { #endif - offset = tripoint_rel_ms( offset2.x, offset2.y, 0 ); //CURSES + offset = { offset2, 0}; //CURSES #if defined(TILES) } #endif @@ -4008,8 +4008,8 @@ static shared_ptr_fast create_zone_callback( } static shared_ptr_fast create_trail_callback( - const std::optional &trail_start, - const std::optional &trail_end, + const std::optional &trail_start, + const std::optional &trail_end, const bool &trail_end_x ) { @@ -4047,7 +4047,7 @@ void game::void_async_anim_curses() async_anim_layer_curses.clear(); } -void game::init_draw_blink_curses( const tripoint &p, const std::string &ncstr, +void game::init_draw_blink_curses( const tripoint_bub_ms &p, const std::string &ncstr, const nc_color &nccol ) { std::pair anim( ncstr, nccol ); @@ -4059,12 +4059,12 @@ void game::draw_blink_curses() // game::draw_blink_curses can be called multiple times, storing each animation to be played in blink_layer_curses // Iterate through every animation in async_anim_layer for( const auto &anim : blink_layer_curses ) { - const tripoint p = anim.first - u.view_offset.raw() + tripoint( POSX - u.posx(), POSY - u.posy(), - -u.posz() ); + const tripoint_bub_ms p = anim.first - u.view_offset + tripoint( POSX - u.posx(), POSY - u.posy(), + -u.posz() ); const std::string ncstr = anim.second.first; const nc_color nccol = anim.second.second; - mvwprintz( w_terrain, p.xy(), nccol, ncstr ); + mvwprintz( w_terrain, p.raw().xy(), nccol, ncstr ); } } @@ -4212,13 +4212,13 @@ void game::draw_critter( const Creature &critter, const tripoint_bub_ms ¢er // Monster is below // TODO: Make this show something more informative than just green 'v' // TODO: Allow looking at this mon with look command - init_draw_blink_curses( tripoint( critter.pos().xy(), center.z() ), "v", c_green_cyan ); + init_draw_blink_curses( { critter.pos_bub().xy(), center.z() }, "v", c_green_cyan ); } if( critter.posz() == center.z() + 1 && ( debug_mode || u.sees( critter ) ) && m.valid_move( critter.pos_bub(), critter.pos_bub() + tripoint::below, false, true ) ) { // Monster is above - init_draw_blink_curses( tripoint( critter.pos().xy(), center.z() ), "^", c_green_cyan ); + init_draw_blink_curses( { critter.pos_bub().xy(), center.z() }, "^", c_green_cyan ); } return; } @@ -4256,7 +4256,8 @@ void game::draw_ter( const tripoint_bub_ms ¢er, const bool looking, const bo m.draw( w_terrain, tripoint_bub_ms( center ) ); if( draw_sounds ) { - draw_footsteps( w_terrain, tripoint( -center.x(), -center.y(), center.z() ) + point( POSX, POSY ) ); + draw_footsteps( w_terrain, tripoint_rel_ms( -center.x(), -center.y(), center.z() ) + point( POSX, + POSY ) ); } for( Creature &critter : all_creatures() ) { @@ -4280,7 +4281,7 @@ void game::draw_ter( const tripoint_bub_ms ¢er, const bool looking, const bo } } -std::optional game::get_veh_dir_indicator_location( bool next ) const +std::optional game::get_veh_dir_indicator_location( bool next ) const { if( !get_option( "VEHICLE_DIR_INDICATOR" ) ) { return std::nullopt; @@ -4292,14 +4293,16 @@ std::optional game::get_veh_dir_indicator_location( bool next ) const vehicle *const veh = &vp->vehicle(); rl_vec2d face = next ? veh->dir_vec() : veh->face_vec(); float r = 10.0f; - return tripoint( static_cast( r * face.x ), static_cast( r * face.y ), u.pos().z ); + return tripoint_rel_ms( static_cast( r * face.x ), static_cast( r * face.y ), u.pos().z ); } void game::draw_veh_dir_indicator( bool next ) { - if( const std::optional indicator_offset = get_veh_dir_indicator_location( next ) ) { + if( const std::optional indicator_offset = get_veh_dir_indicator_location( + next ) ) { nc_color col = next ? c_white : c_dark_gray; - mvwputch( w_terrain, indicator_offset->xy() - u.view_offset.xy().raw() + point( POSX, POSY ), col, + mvwputch( w_terrain, indicator_offset->raw().xy() - u.view_offset.xy().raw() + point( POSX, POSY ), + col, 'X' ); } } @@ -4437,7 +4440,21 @@ field_entry *game::is_in_dangerous_field() return nullptr; } -std::unordered_set game::get_fishable_locations( int distance, const tripoint &fish_pos ) +std::unordered_set game::get_fishable_locations( int distance, + const tripoint_bub_ms &fish_pos ) +{ + const std::unordered_set temp = game::get_fishable_locations_bub( distance, + fish_pos ); + std::unordered_set result; + + for( const tripoint_bub_ms pos : temp ) { + result.insert( pos.raw() ); + } + + return result; +} +std::unordered_set game::get_fishable_locations_bub( int distance, + const tripoint_bub_ms &fish_pos ) { // We're going to get the contiguous fishable terrain starting at // the provided fishing location (e.g. where a line was cast or a fish @@ -4446,20 +4463,20 @@ std::unordered_set game::get_fishable_locations( int distance, const t // getting our fish from the location that we're ACTUALLY fishing, // rather than just somewhere in the vicinity. - std::unordered_set visited; + std::unordered_set visited; - const tripoint fishing_boundary_min( fish_pos + point( -distance, -distance ) ); - const tripoint fishing_boundary_max( fish_pos + point( distance, distance ) ); + const tripoint_bub_ms fishing_boundary_min( fish_pos + point( -distance, -distance ) ); + const tripoint_bub_ms fishing_boundary_max( fish_pos + point( distance, distance ) ); - const inclusive_cuboid fishing_boundaries( + const inclusive_cuboid fishing_boundaries( fishing_boundary_min, fishing_boundary_max ); - const auto get_fishable_terrain = [&]( tripoint starting_point, - std::unordered_set &fishable_terrain ) { - std::queue to_check; + const auto get_fishable_terrain = [&]( tripoint_bub_ms starting_point, + std::unordered_set &fishable_terrain ) { + std::queue to_check; to_check.push( starting_point ); while( !to_check.empty() ) { - const tripoint current_point = to_check.front(); + const tripoint_bub_ms current_point = to_check.front(); to_check.pop(); // We've been here before, so bail. @@ -4488,7 +4505,7 @@ std::unordered_set game::get_fishable_locations( int distance, const t // Starting at the provided location, get our fishable terrain // and populate a set with those locations which we'll then use // to determine if any fishable monsters are in those locations. - std::unordered_set fishable_points; + std::unordered_set fishable_points; get_fishable_terrain( fish_pos, fishable_points ); return fishable_points; @@ -4496,12 +4513,24 @@ std::unordered_set game::get_fishable_locations( int distance, const t std::vector game::get_fishable_monsters( std::unordered_set &fishable_locations ) +{ + std::unordered_set temp; + + for( const tripoint pos : fishable_locations ) { + temp.insert( tripoint_bub_ms( pos ) ); + } + + return game::get_fishable_monsters( temp ); +} + +std::vector game::get_fishable_monsters( std::unordered_set + &fishable_locations ) { std::vector unique_fish; for( monster &critter : all_monsters() ) { // If it is fishable... if( critter.has_flag( mon_flag_FISHABLE ) ) { - const tripoint critter_pos = critter.pos(); + const tripoint_bub_ms critter_pos = critter.pos_bub(); // ...and it is in a fishable location. if( fishable_locations.find( critter_pos ) != fishable_locations.end() ) { unique_fish.push_back( &critter ); @@ -4537,7 +4566,7 @@ void game::mon_info_update( ) } std::fill( dangerous.begin(), dangerous.end(), false ); - const tripoint view = u.pos() + u.view_offset.raw(); + const tripoint_bub_ms view = u.pos_bub() + u.view_offset; new_seen_mon.clear(); static time_point previous_turn = calendar::turn_zero; @@ -4547,8 +4576,8 @@ void game::mon_info_update( ) for( Creature *c : u.get_visible_creatures( MAPSIZE_X ) ) { monster *m = dynamic_cast( c ); npc *p = dynamic_cast( c ); - const direction dir_to_mon = direction_from( view.xy(), point( c->posx(), c->posy() ) ); - const point_rel_ms m2( -view.xy() + point( POSX + c->posx(), POSY + c->posy() ) ); + const direction dir_to_mon = direction_from( view.raw().xy(), point( c->posx(), c->posy() ) ); + const point_rel_ms m2( -view.raw().xy() + point( POSX + c->posx(), POSY + c->posy() ) ); int index = 8; if( !is_valid_in_w_terrain( m2 ) ) { // for compatibility with old code, see diagram below, it explains the values for index, @@ -5089,7 +5118,7 @@ template Character *game::critter_by_id( const character_id & ); template npc *game::critter_by_id( const character_id & ); template Creature *game::critter_by_id( const character_id & ); -static bool can_place_monster( const monster &mon, const tripoint &p ) +static bool can_place_monster( const monster &mon, const tripoint_bub_ms &p ) { creature_tracker &creatures = get_creature_tracker(); if( const monster *const critter = creatures.creature_at( p ) ) { @@ -5103,10 +5132,10 @@ static bool can_place_monster( const monster &mon, const tripoint &p ) if( creatures.creature_at( p ) ) { return false; } - return mon.will_move_to( p ) && mon.know_danger_at( p ); + return mon.will_move_to( p.raw() ) && mon.know_danger_at( p.raw() ); } -static bool can_place_npc( const tripoint &p ) +static bool can_place_npc( const tripoint_bub_ms &p ) { creature_tracker &creatures = get_creature_tracker(); if( const monster *const critter = creatures.creature_at( p ) ) { @@ -5121,35 +5150,26 @@ static bool can_place_npc( const tripoint &p ) return !g->is_dangerous_tile( p ); } -static std::optional choose_where_to_place_monster( const monster &mon, - const tripoint_range &range ) +static std::optional choose_where_to_place_monster( const monster &mon, + const tripoint_range &range ) { - return random_point( range, [&]( const tripoint & p ) { + return random_point( range, [&]( const tripoint_bub_ms & p ) { return can_place_monster( mon, p ); } ); } -monster *game::place_critter_at( const mtype_id &id, const tripoint &p ) -{ - return place_critter_around( id, p, 0 ); -} - monster *game::place_critter_at( const mtype_id &id, const tripoint_bub_ms &p ) { - return place_critter_around( id, p.raw(), 0 ); -} - -monster *game::place_critter_at( const shared_ptr_fast &mon, const tripoint &p ) -{ - return place_critter_around( mon, p, 0 ); + return place_critter_around( id, p, 0 ); } monster *game::place_critter_at( const shared_ptr_fast &mon, const tripoint_bub_ms &p ) { - return place_critter_around( mon, p.raw(), 0 ); + return place_critter_around( mon, p, 0 ); } -monster *game::place_critter_around( const mtype_id &id, const tripoint ¢er, const int radius ) +monster *game::place_critter_around( const mtype_id &id, const tripoint_bub_ms ¢er, + const int radius ) { // TODO: change this into an assert, it must never happen. if( id.is_null() ) { @@ -5161,11 +5181,11 @@ monster *game::place_critter_around( const mtype_id &id, const tripoint ¢er, } monster *game::place_critter_around( const shared_ptr_fast &mon, - const tripoint ¢er, + const tripoint_bub_ms ¢er, const int radius, bool forced ) { - std::optional where; + std::optional where; if( forced || can_place_monster( *mon, center ) ) { where = center; } @@ -5179,11 +5199,12 @@ monster *game::place_critter_around( const shared_ptr_fast &mon, if( !where ) { return nullptr; } - mon->spawn( *where ); + mon->spawn( where->raw() ); return critter_tracker->add( mon ) ? mon.get() : nullptr; } -monster *game::place_critter_within( const mtype_id &id, const tripoint_range &range ) +monster *game::place_critter_within( const mtype_id &id, + const tripoint_range &range ) { // TODO: change this into an assert, it must never happen. if( id.is_null() ) { @@ -5195,13 +5216,13 @@ monster *game::place_critter_within( const mtype_id &id, const tripoint_range &mon, - const tripoint_range &range ) + const tripoint_range &range ) { - const std::optional where = choose_where_to_place_monster( *mon, range ); + const std::optional where = choose_where_to_place_monster( *mon, range ); if( !where ) { return nullptr; } - mon->spawn( *where ); + mon->spawn( where->raw() ); return critter_tracker->add( mon ) ? mon.get() : nullptr; } @@ -5227,10 +5248,11 @@ void game::clear_zombies() critter_tracker->clear(); } -bool game::find_nearby_spawn_point( const tripoint &target, const mtype_id &mt, int min_radius, - int max_radius, tripoint &point, bool outdoor_only, bool indoor_only, bool open_air_allowed ) +bool game::find_nearby_spawn_point( const tripoint_bub_ms &target, const mtype_id &mt, + int min_radius, + int max_radius, tripoint_bub_ms &point, bool outdoor_only, bool indoor_only, bool open_air_allowed ) { - tripoint target_point; + tripoint_bub_ms target_point; //find a legal outdoor place to spawn based on the specified radius, //we just try a bunch of random points and use the first one that works, it none do then no spawn for( int attempts = 0; attempts < 75; attempts++ ) { @@ -5248,10 +5270,10 @@ bool game::find_nearby_spawn_point( const tripoint &target, const mtype_id &mt, return false; } -bool game::find_nearby_spawn_point( const tripoint &target, int min_radius, - int max_radius, tripoint &point, bool outdoor_only, bool indoor_only, bool open_air_allowed ) +bool game::find_nearby_spawn_point( const tripoint_bub_ms &target, int min_radius, + int max_radius, tripoint_bub_ms &point, bool outdoor_only, bool indoor_only, bool open_air_allowed ) { - tripoint target_point; + tripoint_bub_ms target_point; //find a legal outdoor place to spawn based on the specified radius, //we just try a bunch of random points and use the first one that works, it none do then no spawn for( int attempts = 0; attempts < 75; attempts++ ) { @@ -5275,7 +5297,7 @@ bool game::find_nearby_spawn_point( const tripoint &target, int min_radius, * a monster already in the target square. * @return Whether or not a hallucination was successfully spawned. */ -bool game::spawn_hallucination( const tripoint &p ) +bool game::spawn_hallucination( const tripoint_bub_ms &p ) { //Don't spawn hallucinations on open air if( get_map().has_flag( ter_furn_flag::TFLAG_NO_FLOOR, p ) ) { @@ -5315,7 +5337,7 @@ bool game::spawn_hallucination( const tripoint &p ) * a monster already in the target square. * @return Whether or not a hallucination was successfully spawned. */ -bool game::spawn_hallucination( const tripoint &p, const mtype_id &mt, +bool game::spawn_hallucination( const tripoint_bub_ms &p, const mtype_id &mt, std::optional lifespan ) { //Don't spawn hallucinations on open air @@ -5325,7 +5347,7 @@ bool game::spawn_hallucination( const tripoint &p, const mtype_id &mt, const shared_ptr_fast phantasm = make_shared_fast( mt ); phantasm->hallucination = true; - phantasm->spawn( p ); + phantasm->spawn( p.raw() ); if( lifespan.has_value() ) { phantasm->set_summon_time( lifespan.value() ); } @@ -5337,7 +5359,7 @@ bool game::spawn_hallucination( const tripoint &p, const mtype_id &mt, } } -bool game::spawn_npc( const tripoint &p, const string_id &npc_class, +bool game::spawn_npc( const tripoint_bub_ms &p, const string_id &npc_class, std::string &unique_id, std::vector &traits, std::optional lifespan ) { @@ -5450,26 +5472,21 @@ bool game::swap_critters( Creature &a, Creature &b ) bool game::is_empty( const tripoint &p ) { - return ( m.passable( p ) || m.has_flag( ter_furn_flag::TFLAG_LIQUID, p ) ) && - get_creature_tracker().creature_at( p ) == nullptr; + return is_empty( tripoint_bub_ms( p ) ); } bool game::is_empty( const tripoint_bub_ms &p ) { - return is_empty( p.raw() ); + return ( m.passable( p ) || m.has_flag( ter_furn_flag::TFLAG_LIQUID, p ) ) && + get_creature_tracker().creature_at( p ) == nullptr; } -bool game::is_in_sunlight( const tripoint &p ) +bool game::is_in_sunlight( const tripoint_bub_ms &p ) { return !is_sheltered( p ) && incident_sun_irradiance( get_weather().weather_id, calendar::turn ) > irradiance::minimal; } -bool game::is_sheltered( const tripoint &p ) -{ - return game::is_sheltered( tripoint_bub_ms( p ) ); -} - bool game::is_sheltered( const tripoint_bub_ms &p ) { const optional_vpart_position vp = m.veh_at( p ); @@ -5480,12 +5497,12 @@ bool game::is_sheltered( const tripoint_bub_ms &p ) is_inside; } -bool game::revive_corpse( const tripoint &p, item &it ) +bool game::revive_corpse( const tripoint_bub_ms &p, item &it ) { return revive_corpse( p, it, 1 ); } -bool game::revive_corpse( const tripoint &p, item &it, int radius ) +bool game::revive_corpse( const tripoint_bub_ms &p, item &it, int radius ) { if( !it.is_corpse() ) { debugmsg( "Tried to revive a non-corpse." ); @@ -5524,10 +5541,10 @@ bool game::revive_corpse( const tripoint &p, item &it, int radius ) } } - return place_critter_around( newmon_ptr, p, radius ); + return place_critter_around( newmon_ptr, tripoint_bub_ms( p ), radius ); } -void game::save_cyborg( item *cyborg, const tripoint &couch_pos, Character &installer ) +void game::save_cyborg( item *cyborg, const tripoint_bub_ms &couch_pos, Character &installer ) { int damage = cyborg->damage(); int dmg_lvl = cyborg->damage_level(); @@ -5623,7 +5640,7 @@ void game::open_gate( const tripoint_bub_ms &p ) gates::open_gate( p, u ); } -void game::moving_vehicle_dismount( const tripoint &dest_loc ) +void game::moving_vehicle_dismount( const tripoint_bub_ms &dest_loc ) { const optional_vpart_position vp = m.veh_at( u.pos_bub() ); if( !vp ) { @@ -5631,11 +5648,11 @@ void game::moving_vehicle_dismount( const tripoint &dest_loc ) return; } vehicle *const veh = &vp->vehicle(); - if( u.pos() == dest_loc ) { + if( u.pos_bub() == dest_loc ) { debugmsg( "Need somewhere to dismount towards." ); return; } - tileray ray( dest_loc.xy() + point( -u.posx(), -u.posy() ) ); + tileray ray( dest_loc.raw().xy() + point( -u.posx(), -u.posy() ) ); // TODO:: make dir() const correct! const units::angle d = ray.dir(); add_msg( _( "You dive from the %s." ), veh->name ); @@ -5742,11 +5759,11 @@ void game::control_vehicle() add_msg( _( "No vehicle controls found." ) ); return; } else if( num_valid_controls > 1 ) { - const std::optional temp = choose_adjacent( _( "Control vehicle where?" ) ); + const std::optional temp = choose_adjacent_bub( _( "Control vehicle where?" ) ); if( !vehicle_position ) { return; } else { - vehicle_position.value() = tripoint_bub_ms( temp.value() ); + vehicle_position.value() = temp.value(); } const optional_vpart_position vp = m.veh_at( *vehicle_position ); if( vp ) { @@ -5826,7 +5843,7 @@ bool game::npc_menu( npc &who ) if( choice == talk ) { u.talk_to( get_talker_for( who ) ); } else if( choice == swap_pos ) { - if( !prompt_dangerous_tile( who.pos() ) ) { + if( !prompt_dangerous_tile( who.pos_bub() ) ) { return true; } if( u.get_grab_type() == object_type::NONE ) { @@ -5851,10 +5868,10 @@ bool game::npc_menu( npc &who ) } // TODO: Make NPCs protest when displaced onto dangerous crap - tripoint oldpos = who.pos(); + tripoint_bub_ms oldpos = who.pos_bub(); who.move_away_from( u.pos_bub(), true ); u.mod_moves( -20 ); - if( oldpos != who.pos() ) { + if( oldpos != who.pos_bub() ) { add_msg( _( "%s moves out of the way." ), who.get_name() ); } else { add_msg( m_warning, _( "%s has nowhere to go!" ), who.get_name() ); @@ -6109,7 +6126,7 @@ void game::examine( const tripoint_bub_ms &examp, bool with_pickup ) const furn_t &xfurn_t = m.furn( examp ).obj(); const ter_t &xter_t = m.ter( examp ).obj(); - const tripoint player_pos = u.pos(); + const tripoint_bub_ms player_pos = u.pos_bub(); if( m.has_furn( examp ) ) { if( !u.cant_do_mounted() ) { @@ -6129,7 +6146,7 @@ void game::examine( const tripoint_bub_ms &examp, bool with_pickup ) // Did the player get moved? Bail out if so; our examp probably // isn't valid anymore. - if( player_pos != u.pos() ) { + if( player_pos != u.pos_bub() ) { return; } @@ -6139,7 +6156,7 @@ void game::examine( const tripoint_bub_ms &examp, bool with_pickup ) } // In case of teleport trap or somesuch - if( player_pos != u.pos() ) { + if( player_pos != u.pos_bub() ) { return; } @@ -6220,9 +6237,10 @@ bool game::warn_player_maybe_anger_local_faction( bool really_bad_offense, void game::pickup() { // Prompt for which adjacent/current tile to pick up items from - const std::optional where_ = choose_adjacent_highlight( _( "Pick up items where?" ), - _( "There is nothing to pick up nearby." ), - ACTION_PICKUP, false ); + const std::optional where_ = choose_adjacent_highlight_bub_ms( + _( "Pick up items where?" ), + _( "There is nothing to pick up nearby." ), + ACTION_PICKUP, false ); if( !where_ ) { return; } @@ -6236,11 +6254,6 @@ void game::pickup_all() u.pick_up( game_menus::inv::pickup() ); } -void game::pickup( const tripoint &p ) -{ - game::pickup( tripoint_bub_ms( p ) ); -} - void game::pickup( const tripoint_bub_ms &p ) { // Highlight target @@ -6257,15 +6270,15 @@ void game::pickup( const tripoint_bub_ms &p ) //represents carefully peeking around a corner, hence the large move cost. void game::peek() { - const std::optional p = choose_direction( _( "Peek where?" ), true ); + const std::optional p = choose_direction_rel_ms( _( "Peek where?" ), true ); if( !p ) { return; } tripoint_bub_ms new_pos = u.pos_bub() + *p; - if( p->z != 0 ) { + if( p->z() != 0 ) { // Character might peek to a different submap; ensures return location is accurate. const tripoint_abs_ms old_loc = u.get_location(); - vertical_move( p->z, false, true ); + vertical_move( p->z(), false, true ); if( old_loc != u.get_location() ) { new_pos = u.pos_bub(); @@ -6286,9 +6299,9 @@ void game::peek() void game::peek( const tripoint_bub_ms &p ) { u.mod_moves( -u.get_speed() * 2 ); - tripoint prev = u.pos(); + tripoint_bub_ms prev = u.pos_bub(); u.setpos( p ); - const bool is_same_pos = u.pos() == prev; + const bool is_same_pos = u.pos_bub() == prev; const bool is_standup_peek = is_same_pos && u.is_crouching(); tripoint_bub_ms center = p; m.build_map_cache( p.z() ); @@ -6768,12 +6781,12 @@ void game::print_graffiti_info( const tripoint_bub_ms &lp, const catacurses::win } } -bool game::check_zone( const zone_type_id &type, const tripoint &where ) const +bool game::check_zone( const zone_type_id &type, const tripoint_bub_ms &where ) const { return zone_manager::get_manager().has( type, m.getglobal( where ) ); } -bool game::check_near_zone( const zone_type_id &type, const tripoint &where ) const +bool game::check_near_zone( const zone_type_id &type, const tripoint_bub_ms &where ) const { return zone_manager::get_manager().has_near( type, m.getglobal( where ) ); } @@ -7510,7 +7523,6 @@ void game::pre_print_all_tile_info( const tripoint_bub_ms &lp, const catacurses: const visibility_variables &cache ) { // get global area info according to look_around caret position - // TODO: fix point types tripoint_abs_omt omp( coords::project_to( m.getglobal( lp ) ) ); const oter_id &cur_ter_m = overmap_buffer.ter( omp ); om_vision_level vision = overmap_buffer.seen( omp ); @@ -7548,11 +7560,11 @@ std::optional> game::safe_route_to( Character &who, }; route_t shortest_route; for( const tripoint_bub_ms &p : here.points_in_radius( target, threshold, 0 ) ) { - if( is_dangerous_tile( p.raw() ) ) { + if( is_dangerous_tile( p ) ) { continue; } const route_t route = here.route( who.pos_bub(), p, - who.get_pathfinding_settings(), [this]( const tripoint & p ) { + who.get_pathfinding_settings(), [this]( const tripoint_bub_ms & p ) { return is_dangerous_tile( p ); } ); if( route.empty() ) { @@ -7575,8 +7587,6 @@ std::optional game::look_around() return result.position; } -//look_around_result game::look_around( const bool show_window, tripoint ¢er, -// const tripoint &start_point, bool has_first_point, bool select_zone, bool peeking ) look_around_result game::look_around( const bool show_window, tripoint_bub_ms ¢er, const tripoint_bub_ms &start_point, bool has_first_point, @@ -7892,28 +7902,24 @@ look_around_result game::look_around( ly = mouse_pos->y(); } } - } else if( std::optional vec = ctxt.get_direction( action ) ) { + } else if( std::optional vec = ctxt.get_direction_rel_ms( action ) ) { if( fast_scroll ) { - vec->x *= soffset; - vec->y *= soffset; + vec->x() *= soffset; + vec->y() *= soffset; } - lx = lx + vec->x; - ly = ly + vec->y; - center.x() = center.x() + vec->x; - center.y() = center.y() + vec->y; + lx = lx + vec->x(); + ly = ly + vec->y(); + center.x() = center.x() + vec->x(); + center.y() = center.y() + vec->y(); } else if( action == "throw_blind" ) { result.peek_action = PA_BLIND_THROW; } else if( action == "zoom_in" ) { - // TODO: fix point types - center.x() = lp.x(); - center.y() = lp.y(); + center.xy() = lp.xy(); zoom_in(); mark_main_ui_adaptor_resize(); } else if( action == "zoom_out" ) { - // TODO: fix point types - center.x() = lp.x(); - center.y() = lp.y(); + center.xy() = lp.xy(); zoom_out(); mark_main_ui_adaptor_resize(); } @@ -7959,15 +7965,16 @@ look_around_result game::look_around( look_around_params looka_params ) } static void add_item_recursive( std::vector &item_order, - std::map &temp_items, const item *it, const tripoint &relative_pos ) + std::map &temp_items, const item *it, + const tripoint_rel_ms &relative_pos ) { const std::string name = it->tname(); if( std::find( item_order.begin(), item_order.end(), name ) == item_order.end() ) { item_order.push_back( name ); - temp_items[name] = map_item_stack( it, relative_pos ); + temp_items[name] = map_item_stack( it, relative_pos.raw() ); } else { - temp_items[name].add_at_pos( it, relative_pos ); + temp_items[name].add_at_pos( it, relative_pos.raw() ); } for( const item *content : it->all_known_contents() ) { @@ -7993,7 +8000,7 @@ std::vector game::find_nearby_items( int iRadius ) for( item &elem : m.i_at( points_p_it ) ) { const tripoint_rel_ms relative_pos = points_p_it - u.pos_bub(); - add_item_recursive( item_order, temp_items, &elem, relative_pos.raw() ); + add_item_recursive( item_order, temp_items, &elem, relative_pos ); } } } @@ -8006,25 +8013,25 @@ std::vector game::find_nearby_items( int iRadius ) return ret; } -void draw_trail( const tripoint &start, const tripoint &end, const bool bDrawX ) +void draw_trail( const tripoint_bub_ms &start, const tripoint_bub_ms &end, const bool bDrawX ) { std::vector pts; avatar &player_character = get_avatar(); tripoint_bub_ms center = player_character.pos_bub() + player_character.view_offset; if( start != end ) { //Draw trail - pts = line_to( tripoint_bub_ms( start ), tripoint_bub_ms( end ), 0, 0 ); + pts = line_to( start, end, 0, 0 ); } else { //Draw point pts.emplace_back( start ); } - g->draw_line( tripoint_bub_ms( end ), center, pts ); + g->draw_line( end, center, pts ); if( bDrawX ) { char sym = 'X'; - if( end.z > center.z() ) { + if( end.z() > center.z() ) { sym = '^'; - } else if( end.z < center.z() ) { + } else if( end.z() < center.z() ) { sym = 'v'; } if( pts.empty() ) { @@ -8039,7 +8046,7 @@ void draw_trail( const tripoint &start, const tripoint &end, const bool bDrawX ) void game::draw_trail_to_square( const tripoint_rel_ms &t, bool bDrawX ) { - ::draw_trail( u.pos_bub().raw(), u.pos_bub().raw() + t.raw(), bDrawX ); + ::draw_trail( u.pos_bub(), u.pos_bub() + t, bDrawX ); } static void centerlistview( const tripoint &active_item_position, int ui_width ) @@ -8622,8 +8629,8 @@ game::vmenu_ret game::list_items( const std::vector &item_list ) wnoutrefresh( w_item_info ); } ); - std::optional trail_start; - std::optional trail_end; + std::optional trail_start; + std::optional trail_end; bool trail_end_x = false; shared_ptr_fast trail_cb = create_trail_callback( trail_start, trail_end, trail_end_x ); @@ -8862,8 +8869,8 @@ game::vmenu_ret game::list_items( const std::vector &item_list ) if( activeItem ) { centerlistview( active_pos, width ); - trail_start = u.pos(); - trail_end = u.pos() + active_pos; + trail_start = u.pos_bub(); + trail_end = u.pos_bub() + active_pos; // Actually accessed from the terrain overlay callback `trail_cb` in the // call to `ui_manager::redraw`. //NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores) @@ -9153,8 +9160,8 @@ game::vmenu_ret game::list_monsters( const std::vector &monster_list } } ); - std::optional trail_start; - std::optional trail_end; + std::optional trail_start; + std::optional trail_end; bool trail_end_x = false; shared_ptr_fast trail_cb = create_trail_callback( trail_start, trail_end, trail_end_x ); @@ -9207,8 +9214,8 @@ game::vmenu_ret game::list_monsters( const std::vector &monster_list cCurMon = monster_list[iActive]; iActivePos = cCurMon->pos() - u.pos(); centerlistview( iActivePos, width ); - trail_start = u.pos(); - trail_end = cCurMon->pos(); + trail_start = u.pos_bub(); + trail_end = cCurMon->pos_bub(); // Actually accessed from the terrain overlay callback `trail_cb` in the // call to `ui_manager::redraw`. //NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores) @@ -9269,8 +9276,8 @@ void game::insert_item() void game::unload_container() { - if( const std::optional pnt = choose_adjacent( _( "Unload where?" ) ) ) { - u.drop( game_menus::inv::unload_container(), *pnt ); + if( const std::optional pnt = choose_adjacent_bub( _( "Unload where?" ) ) ) { + u.drop( game_menus::inv::unload_container(), pnt->raw() ); } } @@ -10393,11 +10400,6 @@ void game::set_safe_mode( safe_mode_type mode ) safe_mode_warning_logged = false; } -bool game::disable_robot( const tripoint &p ) -{ - return game::disable_robot( tripoint_bub_ms( p ) ); -} - bool game::disable_robot( const tripoint_bub_ms &p ) { monster *const mon_ptr = get_creature_tracker().creature_at( p ); @@ -10434,12 +10436,12 @@ bool game::disable_robot( const tripoint_bub_ms &p ) return false; } -bool game::is_dangerous_tile( const tripoint &dest_loc ) const +bool game::is_dangerous_tile( const tripoint_bub_ms &dest_loc ) const { return !get_dangerous_tile( dest_loc, 1 ).empty(); } -bool game::prompt_dangerous_tile( const tripoint &dest_loc, +bool game::prompt_dangerous_tile( const tripoint_bub_ms &dest_loc, std::vector *harmful_stuff ) const { if( u.has_effect( effect_stunned ) || u.has_effect( effect_psi_stunned ) ) { @@ -10463,12 +10465,6 @@ bool game::prompt_dangerous_tile( const tripoint &dest_loc, return true; } -std::vector game::get_dangerous_tile( const tripoint &dest_loc, - const size_t max ) const -{ - return game::get_dangerous_tile( tripoint_bub_ms( dest_loc ), max ); -} - std::vector game::get_dangerous_tile( const tripoint_bub_ms &dest_loc, const size_t max ) const { @@ -10717,16 +10713,16 @@ bool game::walk_move( const tripoint_bub_ms &dest_loc, const bool via_ramp, iexamine::ledge( u, tripoint_bub_ms( dest_loc ) ); return true; } else if( get_option( "DANGEROUS_TERRAIN_WARNING_PROMPT" ) == "ALWAYS" && - !prompt_dangerous_tile( dest_loc.raw(), &harmful_stuff ) ) { + !prompt_dangerous_tile( dest_loc, &harmful_stuff ) ) { return true; } else if( get_option( "DANGEROUS_TERRAIN_WARNING_PROMPT" ) == "RUNNING" && - ( !u.is_running() || !prompt_dangerous_tile( dest_loc.raw(), &harmful_stuff ) ) ) { + ( !u.is_running() || !prompt_dangerous_tile( dest_loc, &harmful_stuff ) ) ) { add_msg( m_warning, _( "Stepping into that %1$s looks risky. Run into it if you wish to enter anyway." ), enumerate_as_string( harmful_stuff ) ); return true; } else if( get_option( "DANGEROUS_TERRAIN_WARNING_PROMPT" ) == "CROUCHING" && - ( !u.is_crouching() || !prompt_dangerous_tile( dest_loc.raw(), &harmful_stuff ) ) ) { + ( !u.is_crouching() || !prompt_dangerous_tile( dest_loc, &harmful_stuff ) ) ) { add_msg( m_warning, _( "Stepping into that %1$s looks risky. Crouch and move into it if you wish to enter anyway." ), enumerate_as_string( harmful_stuff ) ); @@ -10872,7 +10868,7 @@ bool game::walk_move( const tripoint_bub_ms &dest_loc, const bool via_ramp, oldpos = oldpos - ms_shift.raw(); if( moving ) { - cata_event_dispatch::avatar_moves( old_abs_pos.raw(), u, m ); + cata_event_dispatch::avatar_moves( old_abs_pos, u, m ); // Add trail animation when sprinting if( get_option( "ANIMATIONS" ) && u.is_running() ) { @@ -10923,7 +10919,7 @@ bool game::walk_move( const tripoint_bub_ms &dest_loc, const bool via_ramp, } if( u.is_hauling() ) { - start_hauling( oldpos.raw() ); + start_hauling( oldpos ); } if( u.will_be_cramped_in_vehicle_tile( dest_loc_abs ) ) { @@ -11103,7 +11099,7 @@ point_rel_sm game::place_player( const tripoint_bub_ms &dest_loc, bool quick ) mon->process_triggers(); m.creature_in_field( *mon ); } - point_rel_sm submap_shift = point_rel_sm( update_map( u, z_level_changed ) ); + point_rel_sm submap_shift = update_map( u, z_level_changed ); // Important: don't use dest_loc after this line. `update_map` may have shifted the map // and dest_loc was not adjusted and therefore is still in the un-shifted system and probably wrong. // If you must use it you can calculate the position in the new, shifted system with @@ -11235,7 +11231,7 @@ point_rel_sm game::place_player( const tripoint_bub_ms &dest_loc, bool quick ) // List items here if( !quick && !m.has_flag( ter_furn_flag::TFLAG_SEALED, u.pos_bub() ) ) { if( get_option( "NO_AUTO_PICKUP_ZONES_LIST_ITEMS" ) || - !check_zone( zone_type_NO_AUTO_PICKUP, u.pos() ) ) { + !check_zone( zone_type_NO_AUTO_PICKUP, u.pos_bub() ) ) { const map_stack &ms = m.i_at( u.pos_bub() ); if( u.is_blind() && !ms.empty() ) { add_msg( _( "There's something here, but you can't see what it is." ) ); @@ -11444,8 +11440,8 @@ bool game::phasing_move_enchant( const tripoint_bub_ms &dest_loc, const int phas int tunneldist = 0; tripoint_bub_ms dest = dest_loc; - const tripoint d( sgn( dest.x() - u.posx() ), sgn( dest.y() - u.posy() ), - sgn( dest.z() - u.posz() ) ); + const tripoint_rel_ms d( sgn( dest.x() - u.posx() ), sgn( dest.y() - u.posy() ), + sgn( dest.z() - u.posz() ) ); creature_tracker &creatures = get_creature_tracker(); while( m.impassable( dest ) || @@ -11462,7 +11458,7 @@ bool game::phasing_move_enchant( const tripoint_bub_ms &dest_loc, const int phas } // vertical handling for adjacent tiles - if( d.z != 0 && !m.impassable( dest_loc ) && tunneldist == 0 ) { + if( d.z() != 0 && !m.impassable( dest_loc ) && tunneldist == 0 ) { tunneldist += 1; } @@ -11941,7 +11937,7 @@ bool game::fling_creature( Creature *c, const units::angle &dir, float flvel, bo tileray tdir( dir ); int range = flvel / 10; - tripoint pt = c->pos(); + tripoint_bub_ms pt = c->pos_bub(); creature_tracker &creatures = get_creature_tracker(); while( range > 0 ) { c->underwater = false; @@ -11949,8 +11945,8 @@ bool game::fling_creature( Creature *c, const units::angle &dir, float flvel, bo // or maybe even just redraw the changed tiles bool seen = is_u || u.sees( *c ); // To avoid redrawing when not seen tdir.advance(); - pt.x = c->posx() + tdir.dx(); - pt.y = c->posy() + tdir.dy(); + pt.x() = c->posx() + tdir.dx(); + pt.y() = c->posy() + tdir.dy(); float force = 0.0f; if( monster *const mon_ptr = creatures.creature_at( pt ) ) { @@ -11958,7 +11954,7 @@ bool game::fling_creature( Creature *c, const units::angle &dir, float flvel, bo // Approximate critter's "stopping power" with its max hp force = std::min( 1.5f * critter.type->hp, flvel ); const int damage = rng( force, force * 2.0f ) / 6; - c->impact( damage, pt ); + c->impact( damage, pt.raw() ); // Multiply zed damage by 6 because no body parts const int zed_damage = std::max( 0, ( damage - critter.get_armor_type( damage_bash, bodypart_id( "torso" ) ) ) * 6 ); @@ -11978,7 +11974,7 @@ bool game::fling_creature( Creature *c, const units::angle &dir, float flvel, bo force = flvel - 1; } const int damage = rng( force, force * 2.0f ) / 9; - c->impact( damage, pt ); + c->impact( damage, pt.raw() ); if( m.is_bashable( pt ) ) { // Only go through if we successfully make the tile passable m.bash( pt, flvel ); @@ -12001,7 +11997,7 @@ bool game::fling_creature( Creature *c, const units::angle &dir, float flvel, bo } // If we're flinging the player around, make sure the map stays centered on them. if( is_u ) { - update_map( pt.x, pt.y ); + update_map( pt.x(), pt.y() ); } else { you->setpos( pt ); } @@ -12098,11 +12094,11 @@ std::optional game::point_selection_menu( const std::vector find_empty_spot_nearby( const tripoint &pos ) +static std::optional find_empty_spot_nearby( const tripoint_bub_ms &pos ) { map &here = get_map(); creature_tracker &creatures = get_creature_tracker(); - for( const tripoint &p : here.points_in_radius( pos, 1 ) ) { + for( const tripoint_bub_ms &p : here.points_in_radius( pos, 1 ) ) { if( p == pos ) { continue; } @@ -12387,12 +12383,12 @@ void game::vertical_move( int movez, bool force, bool peeking ) bool rope_ladder = false; // TODO: Remove the stairfinding, make the mapgen gen aligned maps if( !force && !climbing && !swimming ) { - const std::optional pnt = find_or_make_stairs( m, z_after, rope_ladder, peeking, - u.pos() ); + const std::optional pnt = find_or_make_stairs( m, z_after, rope_ladder, peeking, + u.pos_bub() ); if( !pnt ) { return; } - stairs = tripoint_bub_ms( *pnt ); + stairs = *pnt; } std::vector monsters_following; @@ -12430,7 +12426,7 @@ void game::vertical_move( int movez, bool force, bool peeking ) const tripoint_bub_ms old_pos = u.pos_bub(); const tripoint_abs_ms old_abs_pos = here.getglobal( old_pos ); - point submap_shift; + point_rel_sm submap_shift; const bool z_level_changed = vertical_shift( z_after ); if( !force ) { submap_shift = update_map( stairs.x(), stairs.y(), z_level_changed ); @@ -12443,10 +12439,10 @@ void game::vertical_move( int movez, bool force, bool peeking ) creatures.creature_at( u.pos_bub(), true ) ) { std::string crit_name; bool player_displace = false; - std::optional displace = find_empty_spot_nearby( u.pos() ); + std::optional displace = find_empty_spot_nearby( u.pos_bub() ); if( !displace.has_value() ) { // They can always move to the previous location of the player. - displace = old_pos.raw(); + displace = old_pos; } npc *guy = creatures.creature_at( u.pos_bub(), true ); if( guy ) { @@ -12513,7 +12509,7 @@ void game::vertical_move( int movez, bool force, bool peeking ) if( u.is_hauling() ) { const tripoint_bub_ms adjusted_pos = old_pos - coords::project_to( point_rel_sm( submap_shift ) ).raw(); - start_hauling( adjusted_pos.raw() ); + start_hauling( adjusted_pos ); } here.invalidate_map_cache( here.get_abs_sub().z() ); @@ -12525,10 +12521,10 @@ void game::vertical_move( int movez, bool force, bool peeking ) u.recoil = MAX_RECOIL; - cata_event_dispatch::avatar_moves( old_abs_pos.raw(), u, m ); + cata_event_dispatch::avatar_moves( old_abs_pos, u, m ); } -void game::start_hauling( const tripoint &pos ) +void game::start_hauling( const tripoint_bub_ms &pos ) { std::vector candidate_items = m.get_haulable_items( pos ); // Find target items and quantities thereof for the new activity @@ -12575,9 +12571,10 @@ void game::start_hauling( const tripoint &pos ) u.assign_activity( actor ); } -std::optional game::find_stairs( const map &mp, int z_after, const tripoint &pos ) +std::optional game::find_stairs( const map &mp, int z_after, + const tripoint_bub_ms &pos ) { - const int movez = z_after - pos.z; + const int movez = z_after - pos.z(); const bool going_down_1 = movez == -1; const bool going_up_1 = movez == 1; @@ -12591,7 +12588,7 @@ std::optional game::find_stairs( const map &mp, int z_after, const tri // We did not find stairs directly above or below, so search the map for them // If there's empty space right below us, we can just go down that way. int best = INT_MAX; - std::optional stairs; + std::optional stairs; const int omtilesz = SEEX * 2 - 1; const tripoint_abs_ms abs_omt_base( project_to( project_to( mp.getglobal( pos ) ) ) ); @@ -12608,7 +12605,7 @@ std::optional game::find_stairs( const map &mp, int z_after, const tri ( going_up_1 && ( mp.has_flag( ter_furn_flag::TFLAG_GOES_DOWN, dest ) || mp.ter( dest ) == ter_t_manhole_cover ) ) || ( ( movez == 2 || movez == -2 ) && mp.ter( dest ) == ter_t_elevator ) ) ) { - stairs.emplace( dest.raw() ); + stairs.emplace( dest ); best = rl_dist( u.pos_bub(), dest ); } } @@ -12617,14 +12614,15 @@ std::optional game::find_stairs( const map &mp, int z_after, const tri return stairs; } -std::optional game::find_or_make_stairs( map &mp, const int z_after, bool &rope_ladder, - bool peeking, const tripoint &pos ) +std::optional game::find_or_make_stairs( map &mp, const int z_after, + bool &rope_ladder, + bool peeking, const tripoint_bub_ms &pos ) { - const bool is_avatar = u.pos() == pos; - const int movez = z_after - pos.z; + const bool is_avatar = u.pos_bub() == pos; + const int movez = z_after - pos.z(); // Try to find the stairs. - std::optional stairs = find_stairs( mp, z_after, pos ); + std::optional stairs = find_stairs( mp, z_after, pos ); creature_tracker &creatures = get_creature_tracker(); if( stairs.has_value() ) { @@ -12662,7 +12660,7 @@ std::optional game::find_or_make_stairs( map &mp, const int z_after, b // No stairs found! Try to make some rope_ladder = false; stairs.emplace( pos ); - stairs->z = z_after; + stairs->z() = z_after; // Check the destination area for lava. if( mp.ter( *stairs ) == ter_t_lava ) { if( movez < 0 && @@ -12818,34 +12816,34 @@ void game::vertical_notes( int z_before, int z_after ) } } -point game::update_map( Character &p, bool z_level_changed ) +point_rel_sm game::update_map( Character &p, bool z_level_changed ) { - point p2( p.posx(), p.posy() ); - return update_map( p2.x, p2.y, z_level_changed ); + point_bub_ms p2( p.pos_bub().xy() ); + return update_map( p2.x(), p2.y(), z_level_changed ); } -point game::update_map( int &x, int &y, bool z_level_changed ) +point_rel_sm game::update_map( int &x, int &y, bool z_level_changed ) { - point shift; + point_rel_sm shift; while( x < HALF_MAPSIZE_X ) { x += SEEX; - shift.x--; + shift.x()--; } while( x >= HALF_MAPSIZE_X + SEEX ) { x -= SEEX; - shift.x++; + shift.x()++; } while( y < HALF_MAPSIZE_Y ) { y += SEEY; - shift.y--; + shift.y()--; } while( y >= HALF_MAPSIZE_Y + SEEY ) { y -= SEEY; - shift.y++; + shift.y()++; } - if( shift == point::zero ) { + if( shift == point_rel_sm::zero ) { // adjust player position u.setpos( tripoint( x, y, m.get_abs_sub().z() ) ); if( z_level_changed ) { @@ -12854,27 +12852,27 @@ point game::update_map( int &x, int &y, bool z_level_changed ) update_overmap_seen(); } // Not actually shifting the submaps, all the stuff below would do nothing - return point::zero; + return point_rel_sm::zero; } // this handles loading/unloading submaps that have scrolled on or off the viewport // NOLINTNEXTLINE(cata-use-named-point-constants) - inclusive_rectangle size_1( point( -1, -1 ), point( 1, 1 ) ); - point remaining_shift = shift; - while( remaining_shift != point::zero ) { - point this_shift = clamp( remaining_shift, size_1 ); + inclusive_rectangle size_1( {-1, -1}, { 1, 1 } ); + point_rel_sm remaining_shift = shift; + while( remaining_shift != point_rel_sm::zero ) { + point_rel_sm this_shift = clamp( remaining_shift, size_1 ); m.shift( point_rel_sm( this_shift ) ); remaining_shift -= this_shift; } // Shift monsters - shift_monsters( tripoint( shift, 0 ) ); - const point shift_ms = coords::project_to( point_rel_sm( shift ) ).raw(); - u.shift_destination( -shift_ms ); + shift_monsters( { shift, 0 } ); + const point_rel_ms shift_ms = coords::project_to( shift ); + u.shift_destination( -shift_ms.raw() ); // Shift NPCs for( auto it = critter_tracker->active_npc.begin(); it != critter_tracker->active_npc.end(); ) { - ( *it )->shift( shift ); + ( *it )->shift( shift.raw() ); if( ( *it )->posx() < 0 || ( *it )->posx() >= MAPSIZE_X || ( *it )->posy() < 0 || ( *it )->posy() >= MAPSIZE_Y ) { //Remove the npc from the active list. It remains in the overmap list. @@ -12885,7 +12883,7 @@ point game::update_map( int &x, int &y, bool z_level_changed ) } } - scent.shift( shift_ms ); + scent.shift( shift_ms.raw() ); // Also ensure the player is on current z-level // m.get_abs_sub().z should later be removed, when there is no longer such a thing @@ -12992,14 +12990,14 @@ void game::despawn_nonlocal_monsters() } } -void game::shift_monsters( const tripoint &shift ) +void game::shift_monsters( const tripoint_rel_sm &shift ) { - if( shift == tripoint::zero ) { + if( shift == tripoint_rel_sm::zero ) { return; } for( monster &critter : all_monsters() ) { - if( shift.xy() != point::zero ) { - critter.shift( shift.xy() ); + if( shift.xy() != point_rel_sm::zero ) { + critter.shift( shift.raw().xy() ); } if( m.inbounds( critter.pos_bub() ) ) { @@ -13982,7 +13980,7 @@ void game::climb_down_using( const tripoint_bub_ms &examp, climbing_aid_id aid_i namespace cata_event_dispatch { -void avatar_moves( const tripoint &old_abs_pos, const avatar &u, const map &m ) +void avatar_moves( const tripoint_abs_ms &old_abs_pos, const avatar &u, const map &m ) { const tripoint_bub_ms new_pos = u.pos_bub(); const tripoint_abs_ms new_abs_pos = m.getglobal( new_pos ); @@ -13993,11 +13991,10 @@ void avatar_moves( const tripoint &old_abs_pos, const avatar &u, const map &m ) get_event_bus().send( mount_type, m.ter( new_pos ).id(), u.current_movement_mode(), u.is_underwater(), new_pos.z() ); - // TODO: fix point types - const tripoint_abs_omt old_abs_omt( coords::project_to( tripoint_abs_ms( - old_abs_pos ) ) ); - const tripoint_abs_omt new_abs_omt( coords::project_to( tripoint_abs_ms( - new_abs_pos ) ) ); + const tripoint_abs_omt old_abs_omt( coords::project_to( + old_abs_pos ) ); + const tripoint_abs_omt new_abs_omt( coords::project_to( + new_abs_pos ) ); if( old_abs_omt != new_abs_omt ) { const oter_id &cur_ter = overmap_buffer.ter( new_abs_omt ); const oter_id &past_ter = overmap_buffer.ter( old_abs_omt ); diff --git a/src/game.h b/src/game.h index a2b0c5be802f0..eae4212640af6 100644 --- a/src/game.h +++ b/src/game.h @@ -261,14 +261,14 @@ class game async_anim_layer_curses; // NOLINT(cata-serialize) public: - void init_draw_blink_curses( const tripoint &p, const std::string &ncstr, + void init_draw_blink_curses( const tripoint_bub_ms &p, const std::string &ncstr, const nc_color &nccol ); void draw_blink_curses(); void void_blink_curses(); bool has_blink_curses(); bool blink_active_phase = true; // NOLINT(cata-serialize) protected: - std::map> + std::map> blink_layer_curses; // NOLINT(cata-serialize) public: @@ -282,7 +282,7 @@ class game * @param next If true, bases it on the vehicle the vehicle will turn to next turn, * instead of the one it is currently facing. */ - std::optional get_veh_dir_indicator_location( bool next ) const; + std::optional get_veh_dir_indicator_location( bool next ) const; void draw_veh_dir_indicator( bool next ); /** @@ -291,13 +291,14 @@ class game * If peeking == true, forbids some exotic movement options */ void vertical_move( int z, bool force, bool peeking = false ); - void start_hauling( const tripoint &pos ); + void start_hauling( const tripoint_bub_ms &pos ); /** Returns the other end of the stairs (if any). May query, affect u etc. * @param pos Disable queries and msgs if not the same position as player. */ - std::optional find_stairs( const map &mp, int z_after, const tripoint &pos ); - std::optional find_or_make_stairs( map &mp, int z_after, bool &rope_ladder, - bool peeking, const tripoint &pos ); + std::optional find_stairs( const map &mp, int z_after, + const tripoint_bub_ms &pos ); + std::optional find_or_make_stairs( map &mp, int z_after, bool &rope_ladder, + bool peeking, const tripoint_bub_ms &pos ); /* * Prompt player on direction they want to climb up or down. */ @@ -351,17 +352,14 @@ class game * the one contained in @p mon). */ /** @{ */ - // TODO: Get rid of untyped overload. - monster *place_critter_at( const mtype_id &id, const tripoint &p ); monster *place_critter_at( const mtype_id &id, const tripoint_bub_ms &p ); - monster *place_critter_at( const shared_ptr_fast &mon, const tripoint &p ); monster *place_critter_at( const shared_ptr_fast &mon, const tripoint_bub_ms &p ); - monster *place_critter_around( const mtype_id &id, const tripoint ¢er, int radius ); - monster *place_critter_around( const shared_ptr_fast &mon, const tripoint ¢er, + monster *place_critter_around( const mtype_id &id, const tripoint_bub_ms ¢er, int radius ); + monster *place_critter_around( const shared_ptr_fast &mon, const tripoint_bub_ms ¢er, int radius, bool forced = false ); - monster *place_critter_within( const mtype_id &id, const tripoint_range &range ); + monster *place_critter_within( const mtype_id &id, const tripoint_range &range ); monster *place_critter_within( const shared_ptr_fast &mon, - const tripoint_range &range ); + const tripoint_range &range ); /** @} */ /** * Returns the approximate number of creatures in the reality bubble. @@ -376,19 +374,20 @@ class game /** Redirects to the creature_tracker clear() function. */ void clear_zombies(); /** Spawns a hallucination at a determined position. */ - bool spawn_hallucination( const tripoint &p ); + bool spawn_hallucination( const tripoint_bub_ms &p ); /** Spawns a hallucination at a determined position of a given monster. */ - bool spawn_hallucination( const tripoint &p, const mtype_id &mt, + bool spawn_hallucination( const tripoint_bub_ms &p, const mtype_id &mt, std::optional lifespan ); /** Spawns a npc at a determined position. */ - bool spawn_npc( const tripoint &p, const string_id &npc_class, std::string &unique_id, + bool spawn_npc( const tripoint_bub_ms &p, const string_id &npc_class, + std::string &unique_id, std::vector &traits, std::optional lifespan ); /** Finds somewhere to spawn a monster or npc. */ - bool find_nearby_spawn_point( const tripoint &target, const mtype_id &mt, int min_radius, - int max_radius, tripoint &point, bool outdoor_only, bool indoor_only, + bool find_nearby_spawn_point( const tripoint_bub_ms &target, const mtype_id &mt, int min_radius, + int max_radius, tripoint_bub_ms &point, bool outdoor_only, bool indoor_only, bool open_air_allowed = false ); - bool find_nearby_spawn_point( const tripoint &target, int min_radius, - int max_radius, tripoint &point, bool outdoor_only, bool indoor_only, + bool find_nearby_spawn_point( const tripoint_bub_ms &target, int min_radius, + int max_radius, tripoint_bub_ms &point, bool outdoor_only, bool indoor_only, bool open_air_allowed = false ); /** Swaps positions of two creatures */ bool swap_critters( Creature &, Creature & ); @@ -502,10 +501,8 @@ class game bool is_empty( const tripoint &p ); bool is_empty( const tripoint_bub_ms &p ); /** Returns true if p is outdoors and it is sunny. */ - bool is_in_sunlight( const tripoint &p ); + bool is_in_sunlight( const tripoint_bub_ms &p ); /** Returns true if p is indoors, underground, or in a car. */ - // TODO: Get rid of untyped overload. - bool is_sheltered( const tripoint &p ); bool is_sheltered( const tripoint_bub_ms &p ); /** * Revives a corpse at given location. The monster type and some of its properties are @@ -518,11 +515,11 @@ class game * If the monster was revived, the caller should remove the corpse item. * If reviving failed, the item is unchanged, as is the environment (no new monsters). */ - bool revive_corpse( const tripoint &p, item &it ); + bool revive_corpse( const tripoint_bub_ms &p, item &it ); // same as above, but with relaxed placement radius. - bool revive_corpse( const tripoint &p, item &it, int radius ); + bool revive_corpse( const tripoint_bub_ms &p, item &it, int radius ); /**Turns Broken Cyborg monster into Cyborg NPC via surgery*/ - void save_cyborg( item *cyborg, const tripoint &couch_pos, Character &installer ); + void save_cyborg( item *cyborg, const tripoint_bub_ms &couch_pos, Character &installer ); /** Asks if the player wants to cancel their activity, and if so cancels it. */ bool cancel_activity_query( const std::string &text ); /** Asks if the player wants to cancel their activity and if so cancels it. Additionally checks @@ -530,7 +527,7 @@ class game bool cancel_activity_or_ignore_query( distraction_type type, const std::string &text ); bool portal_storm_query( distraction_type type, const std::string &text ); /** Handles players exiting from moving vehicles. */ - void moving_vehicle_dismount( const tripoint &dest_loc ); + void moving_vehicle_dismount( const tripoint_bub_ms &dest_loc ); /** Returns the current remotely controlled vehicle. */ vehicle *remoteveh(); @@ -579,7 +576,7 @@ class game /** validate camps to ensure they are on the overmap list */ void validate_camps(); /** Picks and spawns a random fish from the remaining fish list when a fish is caught. */ - void catch_a_monster( monster *fish, const tripoint &pos, Character *p, + void catch_a_monster( monster *fish, const tripoint_bub_ms &pos, Character *p, const time_duration &catch_duration ); /** * Get the contiguous fishable locations starting at fish_pos, out to the specified distance. @@ -587,14 +584,21 @@ class game * @param fish_pos The location being fished. * @return A set of locations representing the valid contiguous fishable locations. */ - std::unordered_set get_fishable_locations( int distance, const tripoint &fish_pos ); + // TODO: Get rid of untyped overload. + std::unordered_set get_fishable_locations( int distance, + const tripoint_bub_ms &fish_pos ); + std::unordered_set get_fishable_locations_bub( int distance, + const tripoint_bub_ms &fish_pos ); /** * Get the fishable monsters within the provided fishable locations. * @param fishable_locations A set of locations which are valid fishable terrain. Any fishable monsters * are filtered by this collection to determine those which can actually be caught. * @return Fishable monsters within the specified fishable terrain. */ + // TODO: Get rid of untyped overload. std::vector get_fishable_monsters( std::unordered_set &fishable_locations ); + std::vector get_fishable_monsters( std::unordered_set + &fishable_locations ); /** Destroy / dissolve character items when in water. */ void water_affect_items( Character &ch ) const; @@ -616,17 +620,17 @@ class game field_entry *is_in_dangerous_field(); // Handles shifting coordinates transparently when moving between submaps. // Helper to make calling with a player pointer less verbose. - point update_map( Character &p, bool z_level_changed = false ); - point update_map( int &x, int &y, bool z_level_changed = false ); + point_rel_sm update_map( Character &p, bool z_level_changed = false ); + point_rel_sm update_map( int &x, int &y, bool z_level_changed = false ); void update_overmap_seen(); // Update which overmap tiles we can see void peek(); void peek( const tripoint_bub_ms &p ); std::optional look_debug(); - bool check_zone( const zone_type_id &type, const tripoint &where ) const; + bool check_zone( const zone_type_id &type, const tripoint_bub_ms &where ) const; /** Checks whether or not there is a zone of particular type nearby */ - bool check_near_zone( const zone_type_id &type, const tripoint &where ) const; + bool check_near_zone( const zone_type_id &type, const tripoint_bub_ms &where ) const; bool is_zones_manager_open() const; void zones_manager(); @@ -934,16 +938,12 @@ class game void set_critter_died(); void mon_info_update( ); //Update seen monsters information void cleanup_dead(); // Delete any dead NPCs/monsters - bool is_dangerous_tile( const tripoint &dest_loc ) const; - // TODO: Get rid of untyped overload. - std::vector get_dangerous_tile( const tripoint &dest_loc, size_t max = 0 ) const; + bool is_dangerous_tile( const tripoint_bub_ms &dest_loc ) const; std::vector get_dangerous_tile( const tripoint_bub_ms &dest_loc, size_t max = 0 ) const; - bool prompt_dangerous_tile( const tripoint &dest_loc, + bool prompt_dangerous_tile( const tripoint_bub_ms &dest_loc, std::vector *harmful_stuff = nullptr ) const; // Pick up items from the given point - // TODO: Get rid of untyped overloads. - void pickup( const tripoint &p ); void pickup( const tripoint_bub_ms &p ); private: void wield(); @@ -978,13 +978,13 @@ class game input_context get_player_input( std::string &action ); /** - * Shift all active monsters, the shift vector is the number of + * Shift all active monsters, the shift coordinate is the number of * shifted submaps. Monsters that are outside of the reality bubble after * shifting are despawned. * Note on z-levels: this works with vertical shifts, but currently all * monsters are despawned upon a vertical shift. */ - void shift_monsters( const tripoint &shift ); + void shift_monsters( const tripoint_rel_sm &shift ); public: /** * Despawn a specific monster, it's stored on the overmap. Also removes @@ -998,7 +998,7 @@ class game // Routine loop functions, approximately in order of execution void open_consume_item_menu(); // Custom menu for consuming specific group of items bool do_regular_action( action_id &act, avatar &player_character, - const std::optional &mouse_target ); + const std::optional &mouse_target ); bool handle_action(); bool try_get_right_click_action( action_id &act, const tripoint_bub_ms &mouse_target ); bool try_get_left_click_action( action_id &act, const tripoint_bub_ms &mouse_target ); @@ -1018,8 +1018,6 @@ class game * been done. false if the player did not choose any action and the function * has effectively done nothing. */ - // TODO: Get rid of untyped overload. - bool disable_robot( const tripoint &p ); bool disable_robot( const tripoint_bub_ms &p ); // Draws the pixel minimap based on the player's current location void draw_pixel_minimap( const catacurses::window &w ); @@ -1307,12 +1305,12 @@ class game // Returns temperature modifier from direct heat radiation of nearby sources // @param location Location affected by heat sources -units::temperature_delta get_heat_radiation( const tripoint &location ); +units::temperature_delta get_heat_radiation( const tripoint_bub_ms &location ); // Returns heat intensity of adjecent fires -int get_best_fire( const tripoint &location ); +int get_best_fire( const tripoint_bub_ms &location ); // Returns temperature modifier from hot air fields of given location -units::temperature_delta get_convection_temperature( const tripoint &location ); +units::temperature_delta get_convection_temperature( const tripoint_bub_ms &location ); namespace cata_event_dispatch { @@ -1320,7 +1318,7 @@ namespace cata_event_dispatch // @param p The point the avatar moved from in absolute coordinates // @param u The avatar (should have already moved to the new pos) // @param m The map the avatar is moving on -void avatar_moves( const tripoint &old_abs_pos, const avatar &u, const map &m ); +void avatar_moves( const tripoint_abs_ms &old_abs_pos, const avatar &u, const map &m ); } // namespace cata_event_dispatch bool are_we_quitting(); diff --git a/src/handle_action.cpp b/src/handle_action.cpp index 56b82c4c5f9c0..76d74a0aa7bc1 100644 --- a/src/handle_action.cpp +++ b/src/handle_action.cpp @@ -1497,30 +1497,30 @@ static void loot() mgr.cache_vzones(); flags |= g->check_near_zone( zone_type_LOOT_UNSORTED, - player_character.pos() ) ? SortLoot : 0; - flags |= g->check_near_zone( zone_type_UNLOAD_ALL, player_character.pos() ) || - g->check_near_zone( zone_type_STRIP_CORPSES, player_character.pos() ) ? UnloadLoot : 0; - if( g->check_near_zone( zone_type_FARM_PLOT, player_character.pos() ) ) { + player_character.pos_bub() ) ? SortLoot : 0; + flags |= g->check_near_zone( zone_type_UNLOAD_ALL, player_character.pos_bub() ) || + g->check_near_zone( zone_type_STRIP_CORPSES, player_character.pos_bub() ) ? UnloadLoot : 0; + if( g->check_near_zone( zone_type_FARM_PLOT, player_character.pos_bub() ) ) { flags |= FertilizePlots; flags |= MultiFarmPlots; } flags |= g->check_near_zone( zone_type_CONSTRUCTION_BLUEPRINT, - player_character.pos() ) ? ConstructPlots : 0; + player_character.pos_bub() ) ? ConstructPlots : 0; flags |= g->check_near_zone( zone_type_CHOP_TREES, - player_character.pos() ) ? Multichoptrees : 0; + player_character.pos_bub() ) ? Multichoptrees : 0; flags |= g->check_near_zone( zone_type_LOOT_WOOD, - player_character.pos() ) ? Multichopplanks : 0; + player_character.pos_bub() ) ? Multichopplanks : 0; flags |= g->check_near_zone( zone_type_VEHICLE_DECONSTRUCT, - player_character.pos() ) ? Multideconvehicle : 0; + player_character.pos_bub() ) ? Multideconvehicle : 0; flags |= g->check_near_zone( zone_type_VEHICLE_REPAIR, - player_character.pos() ) ? Multirepairvehicle : 0; + player_character.pos_bub() ) ? Multirepairvehicle : 0; flags |= g->check_near_zone( zone_type_LOOT_CORPSE, - player_character.pos() ) ? MultiButchery : 0; - flags |= g->check_near_zone( zone_type_MINING, player_character.pos() ) ? MultiMining : 0; + player_character.pos_bub() ) ? MultiButchery : 0; + flags |= g->check_near_zone( zone_type_MINING, player_character.pos_bub() ) ? MultiMining : 0; flags |= g->check_near_zone( zone_type_DISASSEMBLE, - player_character.pos() ) ? MultiDis : 0; - flags |= g->check_near_zone( zone_type_MOPPING, player_character.pos() ) ? MultiMopping : 0; + player_character.pos_bub() ) ? MultiDis : 0; + flags |= g->check_near_zone( zone_type_MOPPING, player_character.pos_bub() ) ? MultiMopping : 0; if( flags == 0 ) { add_msg( m_info, _( "There is no compatible zone nearby." ) ); add_msg( m_info, _( "Compatible zones are %s and %s" ), @@ -2239,7 +2239,7 @@ static std::map get_actions_disabled_mounted() } bool game::do_regular_action( action_id &act, avatar &player_character, - const std::optional &mouse_target ) + const std::optional &mouse_target ) { item_location weapon = player_character.get_wielded_item(); const bool in_shell = player_character.has_active_mutation( trait_SHELL2 ) @@ -2489,7 +2489,7 @@ bool game::do_regular_action( action_id &act, avatar &player_character, case ACTION_PICKUP: case ACTION_PICKUP_ALL: if( mouse_target ) { - pickup( *mouse_target ); + pickup( tripoint_bub_ms( *mouse_target ) ); } else { if( act == ACTION_PICKUP_ALL ) { pickup_all(); @@ -3276,8 +3276,7 @@ bool game::handle_action() // actions allowed only while alive if( !player_character.is_dead_state() ) { - if( !do_regular_action( act, player_character, - mouse_target ? std::make_optional( mouse_target->raw() ) : std::nullopt ) ) { + if( !do_regular_action( act, player_character, mouse_target ) ) { return false; } } diff --git a/src/iexamine.cpp b/src/iexamine.cpp index 35da4af1990f0..36f688bd7d88c 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -1379,7 +1379,7 @@ void iexamine::elevator( Character &you, const tripoint_bub_ms &examp ) if( you.is_avatar() ) { g->vertical_shift( movez ); g->update_map( you, true ); - cata_event_dispatch::avatar_moves( old_abs_pos.raw(), *you.as_avatar(), get_map() ); + cata_event_dispatch::avatar_moves( old_abs_pos, *you.as_avatar(), get_map() ); } } @@ -2073,7 +2073,7 @@ void iexamine::pedestal_wyrm( Character &you, const tripoint_bub_ms &examp ) get_event_bus().send(); for( const tripoint_bub_ms &p : here.points_on_zlevel() ) { if( here.ter( p ) == ter_t_orifice ) { - g->place_critter_around( mon_dark_wyrm, p.raw(), 1 ); + g->place_critter_around( mon_dark_wyrm, p, 1 ); } } @@ -5789,7 +5789,7 @@ void iexamine::autodoc( Character &you, const tripoint_bub_ms &examp ) } int choice_index = uilist( _( "Choose bionic to uninstall" ), choice_names ); if( choice_index == 0 ) { - g->save_cyborg( &cyborg, couch_pos.raw(), you ); + g->save_cyborg( &cyborg, couch_pos, you ); } else { popup( _( "UNKNOWN COMMAND. Autodoc Mk. XI. Crashed." ) ); return; diff --git a/src/item.cpp b/src/item.cpp index 607694cc5cb22..d21c6e562e86c 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -12967,8 +12967,8 @@ bool item::process_temperature_rot( float insulation, const tripoint_bub_ms &pos units::temperature_delta temp_mod; // Toilets and vending machines will try to get the heat radiation and convection during mapgen and segfault. if( !g->new_game ) { - temp_mod = get_heat_radiation( pos.raw() ); - temp_mod += get_convection_temperature( pos.raw() ); + temp_mod = get_heat_radiation( pos ); + temp_mod += get_convection_temperature( pos ); temp_mod += here.get_temperature_mod( pos ); } else { temp_mod = units::from_kelvin_delta( 0 ); @@ -13361,7 +13361,7 @@ bool item::process_corpse( map &here, Character *carrier, const tripoint_bub_ms here.trap_set( pos, trap_id( "tr_dormant_corpse" ) ); } else if( trap_here->loadid != trap_id( "tr_dormant_corpse" ) ) { // if there is a trap, but it isn't the right one, we need to revive the zombie manually. - return g->revive_corpse( pos.raw(), *this, 3 ); + return g->revive_corpse( pos, *this, 3 ); } return false; } @@ -13377,7 +13377,7 @@ bool item::process_corpse( map &here, Character *carrier, const tripoint_bub_ms return false; } if( rng( 0, volume() / units::legacy_volume_factor ) > burnt && - g->revive_corpse( pos.raw(), *this ) ) { + g->revive_corpse( pos, *this ) ) { if( carrier == nullptr ) { if( corpse->in_species( species_ROBOT ) ) { add_msg_if_player_sees( pos, m_warning, _( "A nearby robot has repaired itself and stands up!" ) ); diff --git a/src/iuse.cpp b/src/iuse.cpp index 5de739c47da5b..3c59888fe25ca 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -1742,7 +1742,7 @@ std::optional iuse::remove_all_mods( Character *p, item *, const tripoint_b static bool good_fishing_spot( const tripoint_bub_ms &pos, Character *p ) { - std::unordered_set fishable_locations = g->get_fishable_locations( 60, pos.raw() ); + std::unordered_set fishable_locations = g->get_fishable_locations_bub( 60, pos ); std::vector fishables = g->get_fishable_monsters( fishable_locations ); map &here = get_map(); // isolated little body of water with no definite fish population @@ -1785,7 +1785,7 @@ std::optional iuse::fishing_rod( Character *p, item *it, const tripoint_bub p->add_msg_if_player( _( "You cast your line and wait to hook something…" ) ); p->assign_activity( ACT_FISH, to_moves( 5_hours ), 0, 0, it->tname() ); p->activity.targets.emplace_back( *p, it ); - p->activity.coord_set = g->get_fishable_locations( 60, found->raw() ); + p->activity.coord_set = g->get_fishable_locations( 60, *found ); return 0; } @@ -1884,7 +1884,7 @@ std::optional iuse::fish_trap_tick( Character *p, item *it, const tripoint_ } //get the fishables around the trap's spot - std::unordered_set fishable_locations = g->get_fishable_locations( 60, pos.raw() ); + std::unordered_set fishable_locations = g->get_fishable_locations_bub( 60, pos ); std::vector fishables = g->get_fishable_monsters( fishable_locations ); for( int i = 0; i < fishes; i++ ) { player.practice( skill_survival, rng( 3, 10 ) ); @@ -1893,7 +1893,7 @@ std::optional iuse::fish_trap_tick( Character *p, item *it, const tripoint_ // reduce the abstract fish_population marker of that fish chosen_fish->fish_population -= 1; if( chosen_fish->fish_population <= 0 ) { - g->catch_a_monster( chosen_fish, pos.raw(), p, 300_hours ); //catch the fish! + g->catch_a_monster( chosen_fish, pos, p, 300_hours ); //catch the fish! } else { here.add_item_or_charges( pos, item::make_corpse( chosen_fish->type->id, calendar::turn + rng( 0_turns, @@ -7518,7 +7518,7 @@ static bool multicooker_hallu( Character &p ) case 6: if( !one_in( 5 ) ) { add_msg( m_warning, _( "The multi-cooker runs away!" ) ); - if( monster *const m = g->place_critter_around( mon_hallu_multicooker, p.pos(), 1 ) ) { + if( monster *const m = g->place_critter_around( mon_hallu_multicooker, p.pos_bub(), 1 ) ) { m->hallucination = true; m->add_effect( effect_run, 1_turns, true ); } @@ -8077,7 +8077,7 @@ bool item::release_monster( const tripoint_bub_ms &target, const int radius ) debugmsg( _( "Error restoring monster: %s" ), e.what() ); return false; } - if( !g->place_critter_around( new_monster, target.raw(), radius ) ) { + if( !g->place_critter_around( new_monster, target, radius ) ) { return false; } erase_var( "contained_name" ); diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index 67b64fa01336c..6211c41996ab8 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -944,14 +944,14 @@ std::optional place_monster_iuse::use( Character *p, item &it, const tripoi newmon.init_from_item( it ); if( place_randomly ) { // place_critter_around returns the same pointer as its parameter (or null) - if( !g->place_critter_around( newmon_ptr, p->pos(), 1 ) ) { + if( !g->place_critter_around( newmon_ptr, p->pos_bub(), 1 ) ) { p->add_msg_if_player( m_info, _( "There is no adjacent square to release the %s in!" ), newmon.name() ); return std::nullopt; } } else { const std::string query = string_format( _( "Place the %s where?" ), newmon.name() ); - const std::optional pnt_ = choose_adjacent( query ); + const std::optional pnt_ = choose_adjacent_bub( query ); if( !pnt_ ) { return std::nullopt; } diff --git a/src/magic_spell_effect.cpp b/src/magic_spell_effect.cpp index 60194d6d18e15..57d3543dc4a17 100644 --- a/src/magic_spell_effect.cpp +++ b/src/magic_spell_effect.cpp @@ -1544,7 +1544,7 @@ void spell_effect::revive( const spell &sp, Creature &caster, const tripoint_bub !mt->has_flag( mon_flag_NO_NECRO ) ) ) { continue; } - if( g->revive_corpse( aoe.raw(), corpse ) ) { + if( g->revive_corpse( aoe, corpse ) ) { here.i_rem( aoe, &corpse ); break; } @@ -1567,7 +1567,7 @@ void spell_effect::revive_dormant( const spell &sp, Creature &caster, continue; } // relaxed revive with radius. - if( g->revive_corpse( aoe.raw(), corpse, 3 ) ) { + if( g->revive_corpse( aoe, corpse, 3 ) ) { here.i_rem( aoe, &corpse ); break; } @@ -1942,7 +1942,7 @@ void spell_effect::slime_split_on_death( const spell &sp, Creature &caster, shared_ptr_fast mon = make_shared_fast( slime_id ); mon->ammo = mon->type->starting_ammo; if( mon->will_move_to( dest.raw() ) && mon->know_danger_at( dest.raw() ) ) { - if( monster *const blob = g->place_critter_around( mon, dest.raw(), 0 ) ) { + if( monster *const blob = g->place_critter_around( mon, dest, 0 ) ) { sp.make_sound( dest, caster ); if( !permanent ) { blob->set_summon_time( sp.duration_turns( caster ) ); diff --git a/src/map.cpp b/src/map.cpp index 97a20b51092ab..5757b92dbdcf1 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -4926,7 +4926,7 @@ bool map::open_door( Creature const &u, const tripoint_bub_ms &p, const bool ins if( u.has_trait( trait_SCHIZOPHRENIC ) && u.is_avatar() && one_in( 50 ) && !ter.has_flag( ter_furn_flag::TFLAG_TRANSPARENT ) ) { tripoint_bub_ms mp = p + point_rel_ms( -2 * u.pos_bub().xy().raw() ) + tripoint_rel_ms{ 2 * p.x(), 2 * p.y(), p.z() }; - g->spawn_hallucination( mp.raw() ); + g->spawn_hallucination( mp ); } } diff --git a/src/map.h b/src/map.h index 24de5e19ecf88..5d99f67e39dc0 100644 --- a/src/map.h +++ b/src/map.h @@ -773,15 +773,9 @@ class map * @param settings Structure describing pathfinding parameters. * @param pre_closed Never path through those points. They can still be the source or the destination. */ - // TODO: fix point types (remove the first overload) - std::vector route( const tripoint &f, const tripoint &t, - const pathfinding_settings &settings, - const std::function &avoid = []( const tripoint & ) { - return false; - } ) const; std::vector route( const tripoint_bub_ms &f, const tripoint_bub_ms &t, const pathfinding_settings &settings, - const std::function &avoid = []( const tripoint & ) { + const std::function &avoid = []( const tripoint_bub_ms & ) { return false; } ) const; diff --git a/src/mattack_actors.cpp b/src/mattack_actors.cpp index 7e6421c1294e4..56f1434d20381 100644 --- a/src/mattack_actors.cpp +++ b/src/mattack_actors.cpp @@ -1177,7 +1177,7 @@ bool gun_actor::call( monster &z ) const bool gun_actor::try_target( monster &z, Creature &target ) const { - if( require_sunlight && !g->is_in_sunlight( z.pos() ) ) { + if( require_sunlight && !g->is_in_sunlight( z.pos_bub() ) ) { add_msg_debug( debugmode::DF_MATTACK, "Requires sunlight" ); if( one_in( 3 ) ) { add_msg_if_player_sees( z, failure_msg.translated(), z.name() ); diff --git a/src/medical_ui.cpp b/src/medical_ui.cpp index dbb1312d05626..76fdc7d8b3985 100644 --- a/src/medical_ui.cpp +++ b/src/medical_ui.cpp @@ -537,15 +537,15 @@ static medical_column draw_effects_summary( const int column_count, Character &y effects_column.add_column_line( selection_line( starvation_name, starvation_text, max_width ) ); } - if( you.has_trait( trait_TROGLO3 ) && g->is_in_sunlight( you.pos() ) ) { + if( you.has_trait( trait_TROGLO3 ) && g->is_in_sunlight( you.pos_bub() ) ) { effects_column.add_column_line( selection_line( "In Sunlight", "The sunlight irritates you terribly.\n", max_width ) ); - } else if( you.has_trait( trait_TROGLO2 ) && g->is_in_sunlight( you.pos() ) && + } else if( you.has_trait( trait_TROGLO2 ) && g->is_in_sunlight( you.pos_bub() ) && incident_sun_irradiance( get_weather().weather_id, calendar::turn ) > irradiance::low ) { effects_column.add_column_line( selection_line( "In Sunlight", "The sunlight irritates you badly.\n", max_width ) ); } else if( ( you.has_trait( trait_TROGLO ) || you.has_trait( trait_TROGLO2 ) ) && - g->is_in_sunlight( you.pos() ) && + g->is_in_sunlight( you.pos_bub() ) && incident_sun_irradiance( get_weather().weather_id, calendar::turn ) > irradiance::moderate ) { effects_column.add_column_line( selection_line( "In Sunlight", "The sunlight irritates you.\n", max_width ) ); @@ -626,7 +626,7 @@ static medical_column draw_stats_summary( const int column_count, Character &you "Starving" : "Underfed" ); speed_detail_str += colorize( string_format( _( "%s -%2d%%\n" ), pge_str, pen ), c_red ); } - if( you.has_trait( trait_SUNLIGHT_DEPENDENT ) && !g->is_in_sunlight( you.pos() ) ) { + if( you.has_trait( trait_SUNLIGHT_DEPENDENT ) && !g->is_in_sunlight( you.pos_bub() ) ) { pen = ( g->light_level( you.posz() ) >= 12 ? 5 : 10 ); pge_str = pgettext( "speed penalty", "Out of Sunlight " ); speed_detail_str += colorize( string_format( _( "%s -%2d%%\n" ), pge_str, pen ), c_red ); diff --git a/src/melee.cpp b/src/melee.cpp index c777e8f3acde5..bbc7d22bfcf02 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -1808,7 +1808,7 @@ void Character::perform_technique( const ma_technique &technique, Creature &t, new_.y = b.y; } - const tripoint &dest = tripoint( new_, b.z ); + const tripoint_bub_ms &dest{ new_.x, new_.y, b.z }; if( g->is_empty( dest ) ) { t.setpos( dest ); } @@ -1838,7 +1838,7 @@ void Character::perform_technique( const ma_technique &technique, Creature &t, // Check if it's possible to move to the new tile bool move_issue = - g->is_dangerous_tile( prev_pos.raw() ) || // Tile contains fire, etc + g->is_dangerous_tile( prev_pos ) || // Tile contains fire, etc ( to_swimmable && to_deepwater ) || // Dive into deep water is_mounted() || ( veh0 != nullptr && std::abs( veh0->velocity ) > 100 ) || // Diving from moving vehicle diff --git a/src/monattack.cpp b/src/monattack.cpp index df5994af5323c..9f2a69d005aad 100644 --- a/src/monattack.cpp +++ b/src/monattack.cpp @@ -365,7 +365,7 @@ bool mattack::split( monster *z ) { bool split_performed = false; while( z->get_hp() / 2 > z->type->hp ) { - monster *const spawn = g->place_critter_around( z->type->id, z->pos(), 1 ); + monster *const spawn = g->place_critter_around( z->type->id, z->pos_bub(), 1 ); if( !spawn ) { break; } @@ -1088,7 +1088,7 @@ bool mattack::resurrect( monster *z ) Character &player_character = get_player_character(); bool sees_necromancer = player_character.sees( *z ); - std::vector> corpses; + std::vector> corpses; // Find all corpses that we can see within 10 tiles. int range = 10; bool found_eligible_corpse = false; @@ -1178,7 +1178,7 @@ bool mattack::resurrect( monster *z ) return false; } - std::pair raised = random_entry( corpses ); + std::pair raised = random_entry( corpses ); // To appease static analysis cata_assert( raised.second ); // NOLINTNEXTLINE(clang-analyzer-core.CallAndMessage) @@ -1460,7 +1460,7 @@ bool mattack::grow_vine( monster *z ) z->mod_moves( -to_moves( 1_seconds ) ); // Attempt to fill up to 8 surrounding tiles. for( int i = 0; i < rng( 1, 8 ); ++i ) { - if( monster *const vine = g->place_critter_around( mon_creeper_vine, z->pos(), 1 ) ) { + if( monster *const vine = g->place_critter_around( mon_creeper_vine, z->pos_bub(), 1 ) ) { vine->make_ally( *z ); // Store position of parent hub in vine goal point. vine->set_dest( z->get_location() ); @@ -1525,7 +1525,7 @@ bool mattack::vine( monster *z ) !one_in( dist_from_hub ) ) { return true; } - if( monster *const vine = g->place_critter_around( mon_creeper_vine, z->pos(), 1 ) ) { + if( monster *const vine = g->place_critter_around( mon_creeper_vine, z->pos_bub(), 1 ) ) { vine->make_ally( *z ); vine->reset_special( "VINE" ); // Store position of parent hub in vine goal point. @@ -1593,12 +1593,12 @@ bool mattack::triffid_heartbeat( monster *z ) int tries = 0; while( here.route( player_character.pos_bub(), z->pos_bub(), root_pathfind ).empty() && tries < 20 ) { - point p( rng( player_character.posx(), z->posx() - 3 ), - rng( player_character.posy(), z->posy() - 3 ) ); - tripoint dest( p, z->posz() ); + point_bub_ms p( rng( player_character.posx(), z->posx() - 3 ), + rng( player_character.posy(), z->posy() - 3 ) ); + tripoint_bub_ms dest( p, z->posz() ); tries++; here.ter_set( dest, ter_t_dirt ); - if( rl_dist( dest, player_character.pos() ) > 3 && g->num_creatures() < 30 && + if( rl_dist( dest, player_character.pos_bub() ) > 3 && g->num_creatures() < 30 && !creatures.creature_at( dest ) && one_in( 20 ) ) { // Spawn an extra monster mtype_id montype = mon_triffid; if( one_in( 4 ) ) { @@ -1616,7 +1616,7 @@ bool mattack::triffid_heartbeat( monster *z ) // Spawn a monster in (about) every second surrounding tile. for( int i = 0; i < 4; ++i ) { - if( monster *const triffid = g->place_critter_around( mon_triffid, z->pos(), 1 ) ) { + if( monster *const triffid = g->place_critter_around( mon_triffid, z->pos_bub(), 1 ) ) { triffid->make_ally( *z ); } } @@ -1986,8 +1986,8 @@ bool mattack::fungus_fortify( monster *z ) // Oops, can't reach. ): // How's about we spawn more tendrils? :) // Aimed at the player, too? Sure! - const tripoint hit_pos = target->pos() + point( rng( -1, 1 ), rng( -1, 1 ) ); - if( hit_pos == target->pos() && !target->uncanny_dodge() ) { + const tripoint_bub_ms hit_pos = target->pos_bub() + point( rng( -1, 1 ), rng( -1, 1 ) ); + if( hit_pos == target->pos_bub() && !target->uncanny_dodge() ) { const bodypart_id &hit = body_part_hit_by_plant(); //~ %s is bodypart name in accusative. add_msg( m_bad, _( "A fungal tendril bursts forth from the earth and pierces your %s!" ), @@ -2141,18 +2141,18 @@ bool mattack::formblob( monster *z ) } bool didit = false; - std::vector pts = closest_points_first( z->pos(), 1 ); + std::vector pts = closest_points_first( z->pos_bub(), 1 ); // Don't check own tile pts.erase( pts.begin() ); creature_tracker &creatures = get_creature_tracker(); - for( const tripoint &dest : pts ) { + for( const tripoint_bub_ms &dest : pts ) { Creature *critter = creatures.creature_at( dest ); if( critter == nullptr ) { if( z->get_speed_base() > mon_blob_small->speed + 35 && rng( 0, 250 ) < z->get_speed_base() ) { // If we're big enough, spawn a baby blob. shared_ptr_fast mon = make_shared_fast( mon_blob_small ); mon->ammo = mon->type->starting_ammo; - if( mon->will_move_to( dest ) && mon->know_danger_at( dest ) ) { + if( mon->will_move_to( dest.raw() ) && mon->know_danger_at( dest.raw() ) ) { didit = true; z->set_speed_base( z->get_speed_base() - mon_blob_small->speed ); if( monster *const blob = g->place_critter_around( mon, dest, 0 ) ) { @@ -3213,7 +3213,7 @@ bool mattack::breathe( monster *z ) return true; } - if( monster *const spawned = g->place_critter_around( breather_type, z->pos(), 1 ) ) { + if( monster *const spawned = g->place_critter_around( breather_type, z->pos_bub(), 1 ) ) { spawned->reset_special( "BREATHE" ); spawned->make_ally( *z ); } @@ -3505,7 +3505,7 @@ bool mattack::darkman( monster *z ) if( rl_dist( z->pos(), player_character.pos() ) > 40 ) { return false; } - if( monster *const shadow = g->place_critter_around( mon_shadow, z->pos(), 1 ) ) { + if( monster *const shadow = g->place_critter_around( mon_shadow, z->pos_bub(), 1 ) ) { z->mod_moves( -to_moves( 1_seconds ) * 0.1 ); shadow->make_ally( *z ); add_msg_if_player_sees( *z, m_warning, _( "A shadow splits from the %s!" ), z->name() ); @@ -3826,7 +3826,7 @@ bool mattack::evolve_kill_strike( monster *z ) z->name() ); return true; } - tripoint const target_pos = target->pos(); + tripoint_bub_ms const target_pos = target->pos_bub(); const std::string target_name = target->disp_name(); int damage_dealt = target->deal_damage( z, bodypart_id( "torso" ), damage ).total_damage(); @@ -3882,7 +3882,7 @@ bool mattack::leech_spawner( monster *z ) const int monsters_spawned = rng( 1, 4 ); const mtype_id monster_type = one_in( 3 ) ? mon_leech_root_runner : mon_leech_root_drone; for( int i = 0; i < monsters_spawned; i++ ) { - if( monster *const new_mon = g->place_critter_around( monster_type, z->pos(), 1 ) ) { + if( monster *const new_mon = g->place_critter_around( monster_type, z->pos_bub(), 1 ) ) { if( u_see ) { add_msg( m_warning, _( "An egg pod ruptures and a %s crawls out from the remains!" ), new_mon->name() ); @@ -3926,7 +3926,8 @@ bool mattack::tindalos_teleport( monster *z ) return false; } if( one_in( 7 ) ) { - if( monster *const afterimage = g->place_critter_around( mon_hound_tindalos_afterimage, z->pos(), + if( monster *const afterimage = g->place_critter_around( mon_hound_tindalos_afterimage, + z->pos_bub(), 1 ) ) { z->mod_moves( -to_moves( 1_seconds ) * 1.4 ); afterimage->make_ally( *z ); @@ -3983,7 +3984,7 @@ bool mattack::flesh_tendril( monster *z ) if( one_in( 2 ) ) { spawned = mon_zombie_gasbag_impaler; } - if( monster *const summoned = g->place_critter_around( spawned, z->pos(), 1 ) ) { + if( monster *const summoned = g->place_critter_around( spawned, z->pos_bub(), 1 ) ) { z->mod_moves( -to_moves( 1_seconds ) ); summoned->make_ally( *z ); get_map().propagate_field( z->pos_bub(), fd_gibs_flesh, 75, 1 ); @@ -4535,7 +4536,7 @@ static int grenade_helper( monster *const z, Creature *const target, const int d return -1; } - const tripoint where = empty_neighbors.first[get_random_index( empty_neighbor_count )]; + const tripoint_bub_ms where{ empty_neighbors.first[get_random_index( empty_neighbor_count )] }; if( monster *const hack = g->place_critter_at( actor->mtypeid, where ) ) { hack->make_ally( *z ); diff --git a/src/monmove.cpp b/src/monmove.cpp index f8c50e90a1cdc..b5f58a05b36ec 100644 --- a/src/monmove.cpp +++ b/src/monmove.cpp @@ -168,7 +168,7 @@ bool monster::will_move_to( const tripoint &p ) const return false; } - if( has_flag( mon_flag_SUNDEATH ) && g->is_in_sunlight( p ) ) { + if( has_flag( mon_flag_SUNDEATH ) && g->is_in_sunlight( tripoint_bub_ms( p ) ) ) { return false; } @@ -1019,21 +1019,21 @@ void monster::move() } if( !is_wandering() || move_without_target ) { - while( !path.empty() && path.front() == pos() ) { + while( !path.empty() && path.front() == pos_bub() ) { path.erase( path.begin() ); } const pathfinding_settings &pf_settings = get_pathfinding_settings(); if( pf_settings.max_dist >= rl_dist( get_location(), get_dest() ) && - ( path.empty() || rl_dist( pos(), path.front() ) >= 2 || path.back() != local_dest.raw() ) ) { + ( path.empty() || rl_dist( pos_bub(), path.front() ) >= 2 || path.back() != local_dest ) ) { // We need a new path if( can_pathfind() ) { - path = here.route( pos(), local_dest.raw(), pf_settings, get_path_avoid() ); + path = here.route( pos_bub(), local_dest, pf_settings, get_path_avoid() ); if( path.empty() ) { increment_pathfinding_cd(); } } else { - path = here.straight_route( pos(), local_dest.raw() ); + path = here.straight_route( pos_bub(), local_dest ); if( !path.empty() ) { if( std::any_of( path.begin(), path.end(), get_path_avoid() ) ) { path.clear(); @@ -1046,8 +1046,8 @@ void monster::move() } // Try to respect old paths, even if we can't pathfind at the moment - if( !path.empty() && path.back() == local_dest.raw() ) { - destination = tripoint_bub_ms( path.front() ); + if( !path.empty() && path.back() == local_dest ) { + destination = path.front(); moved = true; pathed = true; } else { @@ -2326,7 +2326,8 @@ bool monster::will_reach( const point &p ) return false; } - auto path = get_map().route( pos(), tripoint( p, posz() ), get_pathfinding_settings() ); + const std::vector path = get_map().route( pos_bub(), tripoint_bub_ms( p.x, p.y, + posz() ), get_pathfinding_settings() ); if( path.empty() ) { return false; } @@ -2352,22 +2353,23 @@ int monster::turns_to_reach( const point &p ) { map &here = get_map(); // HACK: This function is a(n old) temporary hack that should soon be removed - auto path = here.route( pos(), tripoint( p, posz() ), get_pathfinding_settings() ); + const std::vector path = here.route( pos_bub(), tripoint_bub_ms( p.x, p.y, + posz() ), get_pathfinding_settings() ); if( path.empty() ) { return 999; } double turns = 0.; for( size_t i = 0; i < path.size(); i++ ) { - const tripoint &next = path[i]; + const tripoint_bub_ms &next = path[i]; if( here.impassable( next ) ) { // No bashing through, it looks stupid when you go back and find // the doors intact. return 999; } else if( i == 0 ) { - turns += static_cast( calc_movecost( pos(), next ) ) / get_speed(); + turns += static_cast( calc_movecost( pos(), next.raw() ) ) / get_speed(); } else { - turns += static_cast( calc_movecost( path[i - 1], next ) ) / get_speed(); + turns += static_cast( calc_movecost( path[i - 1].raw(), next.raw() ) ) / get_speed(); } } diff --git a/src/monster.cpp b/src/monster.cpp index cdc9bb9d8ad92..39b0a90f04ca5 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -513,8 +513,8 @@ void monster::try_upgrade( bool pin_time ) continue; } for( int i = 0; i < mgr.pack_size; i++ ) { - tripoint spawn_pos; - if( g->find_nearby_spawn_point( pos(), mgr.name, 1, *type->upgrade_multi_range, + tripoint_bub_ms spawn_pos; + if( g->find_nearby_spawn_point( pos_bub(), mgr.name, 1, *type->upgrade_multi_range, spawn_pos, false, false ) ) { monster *spawned = g->place_critter_at( mgr.name, spawn_pos ); if( spawned ) { @@ -3412,7 +3412,7 @@ void monster::process_effects() add_msg_if_player_sees( *this, m_warning, healing_format_string, name() ); } - if( type->regenerates_in_dark && !g->is_in_sunlight( pos() ) ) { + if( type->regenerates_in_dark && !g->is_in_sunlight( pos_bub() ) ) { const float light = get_map().ambient_light_at( pos_bub() ); // Magic number 10000 was chosen so that a floodlight prevents regeneration in a range of 20 tiles const float dHP = 50.0 * std::exp( - light * light / 10000 ); @@ -3490,7 +3490,7 @@ void monster::process_effects() } // If this critter dies in sunlight, check & assess damage. - if( has_flag( mon_flag_SUNDEATH ) && g->is_in_sunlight( pos() ) ) { + if( has_flag( mon_flag_SUNDEATH ) && g->is_in_sunlight( pos_bub() ) ) { add_msg_if_player_sees( *this, m_good, _( "The %s burns horribly in the sunlight!" ), name() ); apply_damage( nullptr, bodypart_id( "torso" ), 100 ); if( hp < 0 ) { @@ -4071,9 +4071,9 @@ const pathfinding_settings &monster::get_pathfinding_settings() const return type->path_settings; } -std::function monster::get_path_avoid() const +std::function monster::get_path_avoid() const { - return [this]( const tripoint & p ) { + return [this]( const tripoint_bub_ms & p ) { map &here = get_map(); // If we can't move there and can't bash it, don't path through it. if( !can_move_to( p ) && ( bash_skill() <= 0 || !here.is_bashable( p ) ) ) { @@ -4089,7 +4089,7 @@ std::function monster::get_path_avoid() const } else { return false; } - if( rl_dist( p, pos() ) <= radius && get_creature_tracker().creature_at( p ) ) { + if( rl_dist( p, pos_bub() ) <= radius && get_creature_tracker().creature_at( p ) ) { return true; } return false; diff --git a/src/monster.h b/src/monster.h index 29ec1e619e036..38e239baf959e 100644 --- a/src/monster.h +++ b/src/monster.h @@ -620,7 +620,7 @@ class monster : public Creature void on_load(); const pathfinding_settings &get_pathfinding_settings() const override; - std::function get_path_avoid() const override; + std::function get_path_avoid() const override; double calculate_by_enchantment( double modify, enchant_vals::mod value, bool round_output = false ) const; private: @@ -643,7 +643,7 @@ class monster : public Creature time_point stomach_timer; monster_horde_attraction horde_attraction = MHA_NULL; /** Found path. Note: Not used by monsters that don't pathfind! **/ - std::vector path; + std::vector path; // Exponential backoff for stuck monsters. Massively reduces pathfinding CPU. time_point pathfinding_cd = calendar::turn; diff --git a/src/mutation.cpp b/src/mutation.cpp index b666a83d95d8d..abf819a605d5b 100644 --- a/src/mutation.cpp +++ b/src/mutation.cpp @@ -869,7 +869,7 @@ void Character::activate_mutation( const trait_id &mut ) invoke_item( &burrowing_item ); return; // handled when the activity finishes } else if( mut == trait_SLIMESPAWNER ) { - monster *const slime = g->place_critter_around( mon_player_blob, pos(), 1 ); + monster *const slime = g->place_critter_around( mon_player_blob, pos_bub(), 1 ); if( !slime ) { // Oops, no room to divide! add_msg_if_player( m_bad, _( "You focus, but are too hemmed in to birth a new slime microbian!" ) ); diff --git a/src/npc.cpp b/src/npc.cpp index 74751a2c6df8b..e3b46f998e38e 100644 --- a/src/npc.cpp +++ b/src/npc.cpp @@ -1170,11 +1170,11 @@ void npc::spawn_at_precise( const tripoint_abs_ms &p ) void npc::place_on_map() { - if( g->is_empty( pos() ) || is_mounted() ) { + if( g->is_empty( pos_bub() ) || is_mounted() ) { return; } - for( const tripoint &p : closest_points_first( pos(), SEEX + 1 ) ) { + for( const tripoint_bub_ms &p : closest_points_first( pos_bub(), SEEX + 1 ) ) { if( g->is_empty( p ) ) { setpos( p ); return; @@ -3470,9 +3470,9 @@ const pathfinding_settings &npc::get_pathfinding_settings( bool no_bashing ) con return *path_settings; } -std::function npc::get_path_avoid() const +std::function npc::get_path_avoid() const { - return [this]( const tripoint & p ) { + return [this]( const tripoint_bub_ms & p ) { if( get_creature_tracker().creature_at( p ) ) { return true; } diff --git a/src/npc.h b/src/npc.h index ebd75381a8355..59466cfdc7f87 100644 --- a/src/npc.h +++ b/src/npc.h @@ -1198,7 +1198,7 @@ class npc : public Character const pathfinding_settings &get_pathfinding_settings() const override; const pathfinding_settings &get_pathfinding_settings( bool no_bashing ) const; - std::function get_path_avoid() const override; + std::function get_path_avoid() const override; // Item discovery and fetching diff --git a/src/npcmove.cpp b/src/npcmove.cpp index 6f4975bae48cf..f36ed9f6354b4 100644 --- a/src/npcmove.cpp +++ b/src/npcmove.cpp @@ -2868,7 +2868,7 @@ bool npc::can_move_to( const tripoint_bub_ms &p, bool no_bashing ) const // Allow moving into any bashable spots, but penalize them during pathing // Doors are not passable for hallucinations return( rl_dist( pos_bub(), p ) <= 1 && here.has_floor_or_water( p ) && - !g->is_dangerous_tile( p.raw() ) && + !g->is_dangerous_tile( p ) && ( here.passable( p ) || ( can_open_door( p, !here.is_outside( pos_bub() ) ) && !is_hallucination() ) || ( !no_bashing && here.bash_rating( smash_ability(), p ) > 0 ) ) @@ -3347,7 +3347,7 @@ void npc::worker_downtime() tripoint_abs_ms( temp_camp->get_bb_pos() ) ), 10 ) ) { if( creatures.creature_at( elem ) || !could_move_onto( elem ) || here.has_flag( ter_furn_flag::TFLAG_DEEP_WATER, elem ) || - !here.has_floor_or_water( elem ) || g->is_dangerous_tile( elem.raw() ) ) { + !here.has_floor_or_water( elem ) || g->is_dangerous_tile( elem ) ) { continue; } pts.push_back( elem ); @@ -3551,7 +3551,7 @@ void npc::find_item() for( const tripoint_bub_ms &p : closest_points_first( pos_bub(), range ) ) { // TODO: Make this sight check not overdraw nearby tiles // TODO: Optimize that zone check - if( is_player_ally() && g->check_zone( zone_type_NO_NPC_PICKUP, p.raw() ) ) { + if( is_player_ally() && g->check_zone( zone_type_NO_NPC_PICKUP, p ) ) { add_msg_debug( debugmode::DF_NPC_ITEMAI, "%s didn't pick up an item because it's in a no-pickup zone.", name ); continue; @@ -3667,7 +3667,7 @@ void npc::pick_up_item() if( ( !here.has_items( wanted_item_pos ) && !has_cargo && !here.is_harvestable( wanted_item_pos ) && sees( wanted_item_pos ) ) || - ( is_player_ally() && g->check_zone( zone_type_NO_NPC_PICKUP, wanted_item_pos.raw() ) ) ) { + ( is_player_ally() && g->check_zone( zone_type_NO_NPC_PICKUP, wanted_item_pos ) ) ) { // Items we wanted no longer exist and we can see it // Or player who is leading us doesn't want us to pick it up fetching_item = false; diff --git a/src/npctalk.cpp b/src/npctalk.cpp index 996110d74e0c8..9d6a4111db121 100644 --- a/src/npctalk.cpp +++ b/src/npctalk.cpp @@ -6698,7 +6698,7 @@ talk_effect_fun_t::func f_spawn_monster( const JsonObject &jo, std::string_view int visible_spawns = 0; int spawns = 0; for( int i = 0; i < hallucination_count; i++ ) { - tripoint spawn_point; + tripoint_bub_ms spawn_point; if( !use_target_monster ) { if( group ) { target_monster = monster( MonsterGroupManager::GetRandomMonsterFromGroup( target_mongroup ) ); @@ -6707,7 +6707,7 @@ talk_effect_fun_t::func f_spawn_monster( const JsonObject &jo, std::string_view target_monster = *copy->as_monster(); } } - if( g->find_nearby_spawn_point( target_pos.raw(), target_monster.type->id, min_radius, + if( g->find_nearby_spawn_point( target_pos, target_monster.type->id, min_radius, max_radius, spawn_point, outdoor_only, indoor_only, open_air_allowed ) ) { lifespan = dov_lifespan.evaluate( d ); if( lifespan.value() == 0_seconds ) { @@ -6728,7 +6728,7 @@ talk_effect_fun_t::func f_spawn_monster( const JsonObject &jo, std::string_view } } for( int i = 0; i < real_count; i++ ) { - tripoint spawn_point; + tripoint_bub_ms spawn_point; if( !use_target_monster ) { if( group ) { target_monster = monster( MonsterGroupManager::GetRandomMonsterFromGroup( target_mongroup ) ); @@ -6737,7 +6737,7 @@ talk_effect_fun_t::func f_spawn_monster( const JsonObject &jo, std::string_view target_monster = *copy->as_monster(); } } - if( g->find_nearby_spawn_point( target_pos.raw(), target_monster.type->id, min_radius, + if( g->find_nearby_spawn_point( target_pos, target_monster.type->id, min_radius, max_radius, spawn_point, outdoor_only, indoor_only, open_air_allowed ) ) { monster *spawned = g->place_critter_at( target_monster.type->id, spawn_point ); if( spawned ) { @@ -6833,8 +6833,8 @@ talk_effect_fun_t::func f_spawn_npc( const JsonObject &jo, std::string_view memb int visible_spawns = 0; int spawns = 0; for( int i = 0; i < real_count; i++ ) { - tripoint spawn_point; - if( g->find_nearby_spawn_point( target_pos.raw(), min_radius, + tripoint_bub_ms spawn_point; + if( g->find_nearby_spawn_point( target_pos, min_radius, max_radius, spawn_point, outdoor_only, indoor_only, open_air_allowed ) ) { lifespan = dov_lifespan.evaluate( d ); if( lifespan.value() == 0_seconds ) { @@ -6853,8 +6853,8 @@ talk_effect_fun_t::func f_spawn_npc( const JsonObject &jo, std::string_view memb } cur_traits.emplace_back( trait_HALLUCINATION ); for( int i = 0; i < hallucination_count; i++ ) { - tripoint spawn_point; - if( g->find_nearby_spawn_point( target_pos.raw(), min_radius, + tripoint_bub_ms spawn_point; + if( g->find_nearby_spawn_point( target_pos, min_radius, max_radius, spawn_point, outdoor_only, indoor_only, open_air_allowed ) ) { lifespan = dov_lifespan.evaluate( d ); if( lifespan.value() == 0_seconds ) { diff --git a/src/npctalk_funcs.cpp b/src/npctalk_funcs.cpp index cba63c99aaff3..91c6c57e4d38e 100644 --- a/src/npctalk_funcs.cpp +++ b/src/npctalk_funcs.cpp @@ -231,7 +231,7 @@ void talk_function::buy_cow( npc &p ) void spawn_animal( npc &p, const mtype_id &mon ) { - if( monster *const mon_ptr = g->place_critter_around( mon, p.pos(), 1 ) ) { + if( monster *const mon_ptr = g->place_critter_around( mon, p.pos_bub(), 1 ) ) { mon_ptr->friendly = -1; mon_ptr->add_effect( effect_pet, 1_turns, true ); } else { diff --git a/src/overmapbuffer.cpp b/src/overmapbuffer.cpp index 5a086ba57bf6a..d2afdd5956743 100644 --- a/src/overmapbuffer.cpp +++ b/src/overmapbuffer.cpp @@ -1600,7 +1600,7 @@ void overmapbuffer::spawn_monster( const tripoint_abs_sm &p, bool spawn_nonlocal cata_assert( here.inbounds( local ) ); } monster *const placed = g->place_critter_around( make_shared_fast( this_monster ), - local.raw(), 0, true ); + local, 0, true ); if( placed ) { placed->on_load(); } diff --git a/src/pathfinding.cpp b/src/pathfinding.cpp index 207d7368a94a6..3590be598a915 100644 --- a/src/pathfinding.cpp +++ b/src/pathfinding.cpp @@ -390,27 +390,27 @@ int map::extra_cost( const tripoint_bub_ms &cur, const tripoint_bub_ms &p, return pass_cost + avoid_cost; } -std::vector map::route( const tripoint &f, const tripoint &t, - const pathfinding_settings &settings, - const std::function &avoid ) const +std::vector map::route( const tripoint_bub_ms &f, const tripoint_bub_ms &t, + const pathfinding_settings &settings, + const std::function &avoid ) const { /* TODO: If the origin or destination is out of bound, figure out the closest * in-bounds point and go to that, then to the real origin/destination. */ - std::vector ret; + std::vector ret; if( f == t || !inbounds( f ) ) { return ret; } if( !inbounds( t ) ) { - tripoint clipped = t; + tripoint_bub_ms clipped = t; clip_to_bounds( clipped ); return route( f, clipped, settings, avoid ); } // First, check for a simple straight line on flat ground // Except when the line contains a pre-closed tile - we need to do regular pathing then - if( f.z == t.z ) { + if( f.z() == t.z() ) { auto line_path = straight_route( f, t ); if( !line_path.empty() ) { if( std::none_of( line_path.begin(), line_path.end(), avoid ) ) { @@ -427,14 +427,16 @@ std::vector map::route( const tripoint &f, const tripoint &t, const int max_length = settings.max_length; const int pad = 16; // Should be much bigger - low value makes pathfinders dumb! - tripoint_bub_ms min( std::min( f.x, t.x ) - pad, std::min( f.y, t.y ) - pad, std::min( f.z, t.z ) ); - tripoint_bub_ms max( std::max( f.x, t.x ) + pad, std::max( f.y, t.y ) + pad, std::max( f.z, t.z ) ); + tripoint_bub_ms min( std::min( f.x(), t.x() ) - pad, std::min( f.y(), t.y() ) - pad, + std::min( f.z(), t.z() ) ); + tripoint_bub_ms max( std::max( f.x(), t.x() ) + pad, std::max( f.y(), t.y() ) + pad, + std::max( f.z(), t.z() ) ); clip_to_bounds( min.x(), min.y(), min.z() ); clip_to_bounds( max.x(), max.y(), max.z() ); pf.reset( min.z(), max.z() ); - pf.add_point( 0, 0, f, f ); + pf.add_point( 0, 0, f.raw(), f.raw() ); bool done = false; @@ -449,10 +451,10 @@ std::vector map::route( const tripoint &f, const tripoint &t, if( layer.gscore[parent_index] > max_length ) { // Shortest path would be too long, return empty vector - return std::vector(); + return std::vector(); } - if( cur.raw() == t ) { + if( cur == t ) { done = true; break; } @@ -465,8 +467,8 @@ std::vector map::route( const tripoint &f, const tripoint &t, // 7 3 5 // 1 . 2 // 6 4 8 - constexpr std::array x_offset{{ -1, 1, 0, 0, 1, -1, -1, 1 }}; - constexpr std::array y_offset{{ 0, 0, -1, 1, -1, 1, -1, 1 }}; + constexpr std::array x_offset{ { -1, 1, 0, 0, 1, -1, -1, 1 } }; + constexpr std::array y_offset{ { 0, 0, -1, 1, -1, 1, -1, 1 } }; for( size_t i = 0; i < 8; i++ ) { const tripoint_bub_ms p( cur.x() + x_offset[i], cur.y() + y_offset[i], cur.z() ); const int index = flat_index( p.xy().raw() ); @@ -476,7 +478,7 @@ std::vector map::route( const tripoint &f, const tripoint &t, continue; } - if( p.raw() != t && avoid( p.raw() ) ) { + if( p != t && avoid( p ) ) { layer.closed[index] = true; continue; } @@ -515,7 +517,7 @@ std::vector map::route( const tripoint &f, const tripoint &t, path_data_layer &layer = pf.get_layer( p.z() - 1 ); // From cur, not p, because we won't be walking on air pf.add_point( layer.gscore[parent_index] + 10, - layer.score[parent_index] + 10 + 2 * rl_dist( below.raw(), t ), + layer.score[parent_index] + 10 + 2 * rl_dist( below, t ), cur.raw(), below.raw() ); } @@ -526,7 +528,7 @@ std::vector map::route( const tripoint &f, const tripoint &t, } } - pf.add_point( newg, newg + 2 * rl_dist( p.raw(), t ), cur.raw(), p.raw() ); + pf.add_point( newg, newg + 2 * rl_dist( p, t ), cur.raw(), p.raw() ); } // TODO: We should be able to go up ramps even if we can't climb stairs. @@ -541,8 +543,8 @@ std::vector map::route( const tripoint &f, const tripoint &t, const ter_t &parent_terrain = parent_tile.get_ter_t(); if( settings.allow_climb_stairs && cur.z() > min.z() && parent_terrain.has_flag( ter_furn_flag::TFLAG_GOES_DOWN ) ) { - std::optional opt_dest = g->find_or_make_stairs( get_map(), - cur.z() - 1, rope_ladder, false, cur.raw() ); + std::optional opt_dest = g->find_or_make_stairs( get_map(), + cur.z() - 1, rope_ladder, false, cur ); if( !opt_dest ) { continue; } @@ -553,14 +555,14 @@ std::vector map::route( const tripoint &f, const tripoint &t, } path_data_layer &layer = pf.get_layer( dest.z() ); pf.add_point( layer.gscore[parent_index] + 2, - layer.score[parent_index] + 2 * rl_dist( dest.raw(), t ), + layer.score[parent_index] + 2 * rl_dist( dest, t ), cur.raw(), dest.raw() ); } } if( settings.allow_climb_stairs && cur.z() < max.z() && parent_terrain.has_flag( ter_furn_flag::TFLAG_GOES_UP ) ) { - std::optional opt_dest = g->find_or_make_stairs( get_map(), - cur.z() + 1, rope_ladder, false, cur.raw() ); + std::optional opt_dest = g->find_or_make_stairs( get_map(), + cur.z() + 1, rope_ladder, false, cur ); if( !opt_dest ) { continue; } @@ -571,7 +573,7 @@ std::vector map::route( const tripoint &f, const tripoint &t, } path_data_layer &layer = pf.get_layer( dest.z() ); pf.add_point( layer.gscore[parent_index] + 2, - layer.score[parent_index] + 2 * rl_dist( dest.raw(), t ), + layer.score[parent_index] + 2 * rl_dist( dest, t ), cur.raw(), dest.raw() ); } } @@ -584,7 +586,7 @@ std::vector map::route( const tripoint &f, const tripoint &t, continue; } pf.add_point( layer.gscore[parent_index] + 4, - layer.score[parent_index] + 4 + 2 * rl_dist( above.raw(), t ), + layer.score[parent_index] + 4 + 2 * rl_dist( above, t ), cur.raw(), above.raw() ); } } @@ -597,7 +599,7 @@ std::vector map::route( const tripoint &f, const tripoint &t, continue; } pf.add_point( layer.gscore[parent_index] + 4, - layer.score[parent_index] + 4 + 2 * rl_dist( above.raw(), t ), + layer.score[parent_index] + 4 + 2 * rl_dist( above, t ), cur.raw(), above.raw() ); } } @@ -610,7 +612,7 @@ std::vector map::route( const tripoint &f, const tripoint &t, continue; } pf.add_point( layer.gscore[parent_index] + 4, - layer.score[parent_index] + 4 + 2 * rl_dist( below.raw(), t ), + layer.score[parent_index] + 4 + 2 * rl_dist( below, t ), cur.raw(), below.raw() ); } } @@ -619,12 +621,12 @@ std::vector map::route( const tripoint &f, const tripoint &t, if( done ) { ret.reserve( rl_dist( f, t ) * 2 ); - tripoint cur = t; + tripoint_bub_ms cur = t; // Just to limit max distance, in case something weird happens for( int fdist = max_length; fdist != 0; fdist-- ) { - const int cur_index = flat_index( cur.xy() ); - const path_data_layer &layer = pf.get_layer( cur.z ); - const tripoint &par = layer.parent[cur_index]; + const int cur_index = flat_index( cur.raw().xy() ); + const path_data_layer &layer = pf.get_layer( cur.z() ); + const tripoint_bub_ms &par = tripoint_bub_ms( layer.parent[cur_index] ); if( cur == f ) { break; } @@ -632,9 +634,9 @@ std::vector map::route( const tripoint &f, const tripoint &t, ret.push_back( cur ); // Jumps are acceptable on 1 z-level changes // This is because stairs teleport the player too - if( rl_dist( cur, par ) > 1 && std::abs( cur.z - par.z ) != 1 ) { + if( rl_dist( cur, par ) > 1 && std::abs( cur.z() - par.z() ) != 1 ) { debugmsg( "Jump in our route! %d:%d:%d->%d:%d:%d", - cur.x, cur.y, cur.z, par.x, par.y, par.z ); + cur.x(), cur.y(), cur.z(), par.x(), par.y(), par.z() ); return ret; } @@ -646,16 +648,3 @@ std::vector map::route( const tripoint &f, const tripoint &t, return ret; } - -std::vector map::route( const tripoint_bub_ms &f, const tripoint_bub_ms &t, - const pathfinding_settings &settings, - const std::function &avoid ) const -{ - std::vector raw_result = route( f.raw(), t.raw(), settings, avoid ); - std::vector result; - std::transform( raw_result.begin(), raw_result.end(), std::back_inserter( result ), - []( const tripoint & p ) { - return tripoint_bub_ms( p ); - } ); - return result; -} diff --git a/src/pickup.cpp b/src/pickup.cpp index b9d408110636c..ae3f579e970ab 100644 --- a/src/pickup.cpp +++ b/src/pickup.cpp @@ -422,7 +422,7 @@ void Pickup::autopickup( const tripoint &p ) } } // Bail out if this square cannot be auto-picked-up - if( g->check_zone( zone_type_NO_AUTO_PICKUP, p ) || + if( g->check_zone( zone_type_NO_AUTO_PICKUP, tripoint_bub_ms( p ) ) || local.has_flag( ter_furn_flag::TFLAG_SEALED, p ) ) { return; } diff --git a/src/player_display.cpp b/src/player_display.cpp index 9dd30454b559d..9e6dfd6e9b0c9 100644 --- a/src/player_display.cpp +++ b/src/player_display.cpp @@ -1585,12 +1585,12 @@ void Character::disp_info( bool customize_character ) effect_name_and_text.emplace_back( starvation_name, starvation_text ); } - if( has_trait( trait_TROGLO3 ) && g->is_in_sunlight( pos() ) ) { + if( has_trait( trait_TROGLO3 ) && g->is_in_sunlight( pos_bub() ) ) { effect_name_and_text.emplace_back( _( "In Sunlight" ), _( "The sunlight irritates you terribly.\n" "Strength - 4; Dexterity - 4; Intelligence - 4; Perception - 4" ) ); - } else if( has_trait( trait_TROGLO2 ) && g->is_in_sunlight( pos() ) ) { + } else if( has_trait( trait_TROGLO2 ) && g->is_in_sunlight( pos_bub() ) ) { if( incident_sun_irradiance( get_weather().weather_id, calendar::turn ) > irradiance::moderate ) { effect_name_and_text.emplace_back( _( "In Sunlight" ), _( "The sunlight irritates you badly.\n" @@ -1601,7 +1601,7 @@ void Character::disp_info( bool customize_character ) "Strength - 1; Dexterity - 1; Intelligence - 1; Perception - 1" ) ); } - } else if( has_trait( trait_TROGLO ) && g->is_in_sunlight( pos() ) && + } else if( has_trait( trait_TROGLO ) && g->is_in_sunlight( pos_bub() ) && incident_sun_irradiance( get_weather().weather_id, calendar::turn ) > irradiance::moderate ) { effect_name_and_text.emplace_back( _( "In Sunlight" ), _( "The sunlight irritates you.\n" diff --git a/src/player_hardcoded_effects.cpp b/src/player_hardcoded_effects.cpp index d8c3b240b63a4..a32e96e1703ba 100644 --- a/src/player_hardcoded_effects.cpp +++ b/src/player_hardcoded_effects.cpp @@ -452,7 +452,7 @@ static void eff_fun_hallu( Character &u, effect &it ) u.add_miss_reason( _( "Dancing fractals distract you." ), 2 ); u.mod_str_bonus( -1 ); if( u.is_avatar() && one_in( 50 ) ) { - g->spawn_hallucination( u.pos() + tripoint( rng( -10, 10 ), rng( -10, 10 ), 0 ) ); + g->spawn_hallucination( u.pos_bub() + tripoint( rng( -10, 10 ), rng( -10, 10 ), 0 ) ); } } else if( dur == comedownTime ) { if( one_in( 42 ) ) { diff --git a/src/sounds.cpp b/src/sounds.cpp index a7ad98780497c..6ed6ccd3478c0 100644 --- a/src/sounds.cpp +++ b/src/sounds.cpp @@ -1153,7 +1153,7 @@ void sfx::do_ambient() const bool is_deaf = player_character.is_deaf(); const int heard_volume = get_heard_volume( player_character.pos() ); const bool is_underground = player_character.pos().z < 0; - const bool is_sheltered = g->is_sheltered( player_character.pos() ); + const bool is_sheltered = g->is_sheltered( player_character.pos_bub() ); const bool night = is_night( calendar::turn ); const bool weather_changed = get_weather().weather_id != previous_weather || diff --git a/src/suffer.cpp b/src/suffer.cpp index 30eeb61191be1..fee24ef96e6d8 100644 --- a/src/suffer.cpp +++ b/src/suffer.cpp @@ -684,7 +684,7 @@ void suffer::from_asthma( Character &you, const int current_stim ) void suffer::in_sunlight( Character &you ) { - const tripoint position = you.pos(); + const tripoint_bub_ms position = you.pos_bub(); if( !g->is_in_sunlight( position ) ) { return; @@ -701,7 +701,8 @@ void suffer::in_sunlight( Character &you ) const bool has_hat = you.wearing_something_on( bodypart_id( "head" ) ); const float weather_factor = std::min( incident_sun_irradiance( get_weather().weather_id, calendar::turn ) / irradiance::moderate, 1.f ); - const int player_local_temp = units::to_fahrenheit( get_weather().get_temperature( position ) ); + const int player_local_temp = units::to_fahrenheit( get_weather().get_temperature( + position.raw() ) ); const int flux = ( player_local_temp - 65 ) / 2; if( !has_hat ) { sunlight_nutrition += ( 100 + flux ) * weather_factor; diff --git a/src/talker_avatar.cpp b/src/talker_avatar.cpp index 5ddcec5046821..4766f0769860d 100644 --- a/src/talker_avatar.cpp +++ b/src/talker_avatar.cpp @@ -77,7 +77,7 @@ bool talker_avatar::buy_monster( talker &seller, const mtype_id &mtype, int cost } for( int i = 0; i < count; i++ ) { - monster *const mon_ptr = g->place_critter_around( mtype, me_chr->pos(), 3 ); + monster *const mon_ptr = g->place_critter_around( mtype, me_chr->pos_bub(), 3 ); if( !mon_ptr ) { add_msg_debug( debugmode::DF_TALKER, "Cannot place u_buy_monster, no valid placement locations." ); break; diff --git a/src/timed_event.cpp b/src/timed_event.cpp index 9aa8c6b3c5887..3f33ca50200e3 100644 --- a/src/timed_event.cpp +++ b/src/timed_event.cpp @@ -119,7 +119,7 @@ void timed_event::actualize() // 50% chance to spawn a dark wyrm near every orifice on the level. for( const tripoint_bub_ms &p : here.points_on_zlevel() ) { if( here.ter( p ) == ter_id( "t_orifice" ) ) { - g->place_critter_around( mon_dark_wyrm, p.raw(), 1 ); + g->place_critter_around( mon_dark_wyrm, p, 1 ); } } @@ -274,7 +274,7 @@ void timed_event::actualize() } }; const mtype_id &montype = random_entry( temple_monsters ); - g->place_critter_around( montype, player_character.pos(), 2 ); + g->place_critter_around( montype, player_character.pos_bub(), 2 ); } break; diff --git a/src/trapfunc.cpp b/src/trapfunc.cpp index 6add116c5c118..7be1ecf0c62f2 100644 --- a/src/trapfunc.cpp +++ b/src/trapfunc.cpp @@ -1603,15 +1603,15 @@ bool trapfunc::shadow( const tripoint &p, Creature *c, item * ) map &here = get_map(); // Monsters and npcs are completely ignored here, should they? for( int tries = 0; tries < 10; tries++ ) { - tripoint monp = p; + tripoint_bub_ms monp{ p }; if( one_in( 2 ) ) { - monp.x = p.x + rng( -5, +5 ); - monp.y = p.y + ( one_in( 2 ) ? -5 : +5 ); + monp.x() = p.x + rng( -5, +5 ); + monp.y() = p.y + ( one_in( 2 ) ? -5 : +5 ); } else { - monp.x = p.x + ( one_in( 2 ) ? -5 : +5 ); - monp.y = p.y + rng( -5, +5 ); + monp.x() = p.x + ( one_in( 2 ) ? -5 : +5 ); + monp.y() = p.y + rng( -5, +5 ); } - if( !here.sees( monp, p, 10 ) ) { + if( !here.sees( monp, tripoint_bub_ms( p ), 10 ) ) { continue; } if( monster *const spawned = g->place_critter_at( mon_shadow, monp ) ) { @@ -1729,15 +1729,15 @@ bool trapfunc::snake( const tripoint &p, Creature *, item * ) } if( one_in( 3 ) ) { for( int tries = 0; tries < 10; tries++ ) { - tripoint monp = p; + tripoint_bub_ms monp{ p }; if( one_in( 2 ) ) { - monp.x = p.x + rng( -5, +5 ); - monp.y = p.y + ( one_in( 2 ) ? -5 : +5 ); + monp.x() = p.x + rng( -5, +5 ); + monp.y() = p.y + ( one_in( 2 ) ? -5 : +5 ); } else { - monp.x = p.x + ( one_in( 2 ) ? -5 : +5 ); - monp.y = p.y + rng( -5, +5 ); + monp.x() = p.x + ( one_in( 2 ) ? -5 : +5 ); + monp.y() = p.y + rng( -5, +5 ); } - if( !here.sees( monp, p, 10 ) ) { + if( !here.sees( monp, tripoint_bub_ms( p ), 10 ) ) { continue; } if( monster *const spawned = g->place_critter_at( mon_shadow_snake, monp ) ) { diff --git a/src/weather.cpp b/src/weather.cpp index 384ac6157d3d0..d67ca385c18c2 100644 --- a/src/weather.cpp +++ b/src/weather.cpp @@ -98,7 +98,7 @@ void glare( const weather_type_id &w ) { Character &player_character = get_player_character();//todo npcs, also //General prerequisites for glare - if( g->is_sheltered( player_character.pos() ) || + if( g->is_sheltered( player_character.pos_bub() ) || player_character.in_sleep_state() || player_character.worn_with_flag( json_flag_SUN_GLASSES ) || player_character.has_flag( json_flag_GLARE_RESIST ) || @@ -965,9 +965,9 @@ units::temperature weather_manager::get_temperature( const tripoint &location ) if( !g->new_game ) { units::temperature_delta temp_mod; - temp_mod = get_heat_radiation( location ); - temp_mod += get_convection_temperature( location ); - temp_mod += get_map().get_temperature_mod( location ); + temp_mod = get_heat_radiation( tripoint_bub_ms( location ) ); + temp_mod += get_convection_temperature( tripoint_bub_ms( location ) ); + temp_mod += get_map().get_temperature_mod( tripoint_bub_ms( location ) ); temp += temp_mod; } diff --git a/tests/bionics_test.cpp b/tests/bionics_test.cpp index 06d7a8c73e4a5..7372b2a4e2fad 100644 --- a/tests/bionics_test.cpp +++ b/tests/bionics_test.cpp @@ -522,7 +522,7 @@ TEST_CASE( "fueled_bionics", "[bionics] [item]" ) g->reset_light_level(); scoped_weather_override weather_clear( WEATHER_CLEAR ); calendar::turn = calendar::turn_zero + 12_hours; - REQUIRE( g->is_in_sunlight( dummy.pos() ) ); + REQUIRE( g->is_in_sunlight( dummy.pos_bub() ) ); // Connect solar backpack dummy.worn.wear_item( dummy, item( "pants_cargo" ), false, false ); diff --git a/tests/char_sight_test.cpp b/tests/char_sight_test.cpp index 75ea99c443989..c777aaa74a2c0 100644 --- a/tests/char_sight_test.cpp +++ b/tests/char_sight_test.cpp @@ -63,7 +63,7 @@ TEST_CASE( "light_and_fine_detail_vision_mod", "[character][sight][light][vision calendar::turn = calendar::turn_zero + 9_hours + 30_minutes; // Build map cache including lightmap here.build_map_cache( 0, false ); - REQUIRE( g->is_in_sunlight( dummy.pos() ) ); + REQUIRE( g->is_in_sunlight( dummy.pos_bub() ) ); // ambient_light_at is ~100.0 at this time of day (this fails if lightmap cache is not built) REQUIRE( here.ambient_light_at( dummy.pos_bub() ) == Approx( 100.0f ).margin( 1 ) ); @@ -90,7 +90,7 @@ TEST_CASE( "light_and_fine_detail_vision_mod", "[character][sight][light][vision tripoint const z_shift = GENERATE( tripoint::above, tripoint::zero ); dummy.setpos( dummy.pos() + z_shift ); // This implicitly rebuilds the light map. CAPTURE( z_shift ); - REQUIRE_FALSE( g->is_in_sunlight( dummy.pos() ) ); + REQUIRE_FALSE( g->is_in_sunlight( dummy.pos_bub() ) ); REQUIRE( here.ambient_light_at( dummy.pos_bub() ) == Approx( LIGHT_AMBIENT_MINIMAL ) ); // 7.3 is LIGHT_AMBIENT_MINIMAL, a dark cloudy night, unlit indoors @@ -170,7 +170,7 @@ TEST_CASE( "character_sight_limits", "[character][sight][vision]" ) GIVEN( "it is midnight with a new moon" ) { calendar::turn = calendar::turn_zero; here.build_map_cache( 0, false ); - REQUIRE_FALSE( g->is_in_sunlight( dummy.pos() ) ); + REQUIRE_FALSE( g->is_in_sunlight( dummy.pos_bub() ) ); THEN( "sight limit is 60 tiles away" ) { dummy.recalc_sight_limits(); @@ -318,7 +318,7 @@ TEST_CASE( "ursine_vision", "[character][ursine][vision]" ) calendar::turn = calendar::turn_zero + 9_hours + 30_minutes; here.build_map_cache( 0, false ); light_here = here.ambient_light_at( dummy.pos_bub() ); - REQUIRE( g->is_in_sunlight( dummy.pos() ) ); + REQUIRE( g->is_in_sunlight( dummy.pos_bub() ) ); REQUIRE( light_here == Approx( 100.0f ).margin( 1 ) ); THEN( "impaired sight, with 12 tiles of range" ) { diff --git a/tests/char_suffer_test.cpp b/tests/char_suffer_test.cpp index b0715991bd32b..489aa3a43586e 100644 --- a/tests/char_suffer_test.cpp +++ b/tests/char_suffer_test.cpp @@ -127,7 +127,7 @@ TEST_CASE( "suffering_from_albinism", "[char][suffer][albino]" ) item longshirt( "test_longshirt" ); GIVEN( "avatar is in sunlight with the albino trait" ) { - REQUIRE( g->is_in_sunlight( dummy.pos() ) ); + REQUIRE( g->is_in_sunlight( dummy.pos_bub() ) ); dummy.toggle_trait( trait_ALBINO ); REQUIRE( dummy.has_trait( trait_ALBINO ) ); @@ -225,7 +225,7 @@ TEST_CASE( "suffering_from_sunburn", "[char][suffer][sunburn]" ) item longshirt( "test_longshirt" ); GIVEN( "avatar is in sunlight with the solar sensitivity trait" ) { - REQUIRE( g->is_in_sunlight( dummy.pos() ) ); + REQUIRE( g->is_in_sunlight( dummy.pos_bub() ) ); dummy.toggle_trait( trait_SUNBURN ); REQUIRE( dummy.has_trait( trait_SUNBURN ) ); diff --git a/tests/effect_test.cpp b/tests/effect_test.cpp index 632f410dfa469..656fcc6b1ede2 100644 --- a/tests/effect_test.cpp +++ b/tests/effect_test.cpp @@ -742,7 +742,7 @@ static void test_deadliness( const effect &applied, const int expected_dead, con // Place a hundred debug monsters, our subjects for( int i = 0; i < 10; ++i ) { for( int j = 0; j < 10; ++j ) { - tripoint cursor( i + 20, j + 20, 0 ); + tripoint_bub_ms cursor( i + 20, j + 20, 0 ); mons.push_back( g->place_critter_at( pseudo_debug_mon, cursor ) ); // make sure they're there! diff --git a/tests/enchantments_test.cpp b/tests/enchantments_test.cpp index 4144f63df8e0b..2e74b1a2af9b9 100644 --- a/tests/enchantments_test.cpp +++ b/tests/enchantments_test.cpp @@ -233,7 +233,7 @@ TEST_CASE( "Enchantment_ATTACK_SPEED_test", "[magic][enchantments]" ) clear_map(); Character &guy = get_player_character(); clear_avatar(); - g->place_critter_at( pseudo_debug_mon, tripoint::south ); + g->place_critter_at( pseudo_debug_mon, tripoint_bub_ms( tripoint::south ) ); creature_tracker &creatures = get_creature_tracker(); Creature &mon = *creatures.creature_at( tripoint::south ); int moves_spent_on_attacks = 0; @@ -292,7 +292,7 @@ TEST_CASE( "Enchantment_MELEE_STAMINA_CONSUMPTION_test", "[magic][enchantments]" clear_map(); Character &guy = get_player_character(); clear_avatar(); - g->place_critter_at( pseudo_debug_mon, tripoint::south ); + g->place_critter_at( pseudo_debug_mon, tripoint_bub_ms( tripoint::south ) ); creature_tracker &creatures = get_creature_tracker(); Creature &mon = *creatures.creature_at( tripoint::south ); int stamina_init = 0; @@ -361,7 +361,7 @@ TEST_CASE( "Enchantment_MELEE_TO_HIT_test", "[magic][enchantments]" ) clear_map(); Character &guy = get_player_character(); clear_avatar(); - g->place_critter_at( pseudo_debug_mon, tripoint::south ); + g->place_critter_at( pseudo_debug_mon, tripoint_bub_ms( tripoint::south ) ); creature_tracker &creatures = get_creature_tracker(); Creature &mon = *creatures.creature_at( tripoint::south ); double hit_rate = 0; diff --git a/tests/eoc_test.cpp b/tests/eoc_test.cpp index 77897d49d912c..228f88a6f4fec 100644 --- a/tests/eoc_test.cpp +++ b/tests/eoc_test.cpp @@ -667,14 +667,14 @@ TEST_CASE( "EOC_monsters_nearby", "[eoc][math_parser]" ) global_variables &globvars = get_globals(); globvars.clear_global_values(); - g->place_critter_at( mon_zombie, a.pos() + tripoint::east ); - monster *friendo = g->place_critter_at( mon_zombie, a.pos() + tripoint{ 2, 0, 0 } ); - g->place_critter_at( mon_triffid, a.pos() + tripoint{ 3, 0, 0 } ); - g->place_critter_at( mon_zombie_tough, a.pos() + tripoint::north ); - g->place_critter_at( mon_zombie_tough, a.pos() + tripoint{ 0, 2, 0 } ); - g->place_critter_at( mon_zombie_tough, a.pos() + tripoint{ 0, 3, 0 } ); - g->place_critter_at( mon_zombie_smoker, a.pos() + tripoint{ 10, 0, 0 } ); - g->place_critter_at( mon_zombie_smoker, a.pos() + tripoint{ 11, 0, 0 } ); + g->place_critter_at( mon_zombie, a.pos_bub() + tripoint::east ); + monster *friendo = g->place_critter_at( mon_zombie, a.pos_bub() + tripoint{ 2, 0, 0 } ); + g->place_critter_at( mon_triffid, a.pos_bub() + tripoint{ 3, 0, 0 } ); + g->place_critter_at( mon_zombie_tough, a.pos_bub() + tripoint::north ); + g->place_critter_at( mon_zombie_tough, a.pos_bub() + tripoint{ 0, 2, 0 } ); + g->place_critter_at( mon_zombie_tough, a.pos_bub() + tripoint{ 0, 3, 0 } ); + g->place_critter_at( mon_zombie_smoker, a.pos_bub() + tripoint{ 10, 0, 0 } ); + g->place_critter_at( mon_zombie_smoker, a.pos_bub() + tripoint{ 11, 0, 0 } ); REQUIRE( globvars.get_global_value( "mons" ).empty() ); dialogue d( get_talker_for( get_avatar() ), std::make_unique() ); From adfb6fef759f816953a824284361ba0825c3960b Mon Sep 17 00:00:00 2001 From: Alex Mooney Date: Sun, 8 Dec 2024 12:54:58 -0800 Subject: [PATCH 009/158] Don't start oxytorch if you can't succeed --- src/activity_actor.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/activity_actor.cpp b/src/activity_actor.cpp index b56692c593fe0..c95b779c87e1e 100644 --- a/src/activity_actor.cpp +++ b/src/activity_actor.cpp @@ -5390,7 +5390,7 @@ std::unique_ptr disassemble_activity_actor::deserialize( JsonVal return actor.clone(); } -void oxytorch_activity_actor::start( player_activity &act, Character &/*who*/ ) +void oxytorch_activity_actor::start( player_activity &act, Character &who ) { const map &here = get_map(); @@ -5421,9 +5421,14 @@ void oxytorch_activity_actor::start( player_activity &act, Character &/*who*/ ) act.set_to_null(); return; } - - add_msg_debug( debugmode::DF_ACTIVITY, "%s moves_total: %d", act.id().str(), act.moves_total ); - act.moves_left = act.moves_total; + if ( tool->ammo_sufficient( &who, act.moves_total / 100 ) ) { + add_msg_debug( debugmode::DF_ACTIVITY, "%s moves_total: %d", act.id().str(), act.moves_total ); + act.moves_left = act.moves_total; + } else { + who.add_msg_if_player( m_bad, _( "Your %1$s doesn't have enough charges." ), tool->tname() ); + act.set_to_null(); + return; + } } void oxytorch_activity_actor::do_turn( player_activity &/*act*/, Character &who ) From 65e716491977980e827f17c87a5f5f3172821ef4 Mon Sep 17 00:00:00 2001 From: Alex Mooney Date: Sun, 8 Dec 2024 13:27:51 -0800 Subject: [PATCH 010/158] Apply C++ autoformatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/activity_actor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/activity_actor.cpp b/src/activity_actor.cpp index c95b779c87e1e..966ab39426180 100644 --- a/src/activity_actor.cpp +++ b/src/activity_actor.cpp @@ -5421,7 +5421,7 @@ void oxytorch_activity_actor::start( player_activity &act, Character &who ) act.set_to_null(); return; } - if ( tool->ammo_sufficient( &who, act.moves_total / 100 ) ) { + if( tool->ammo_sufficient( &who, act.moves_total / 100 ) ) { add_msg_debug( debugmode::DF_ACTIVITY, "%s moves_total: %d", act.id().str(), act.moves_total ); act.moves_left = act.moves_total; } else { From 794198919ed020a60ec9e5970137d8433449f30c Mon Sep 17 00:00:00 2001 From: David Seguin Date: Mon, 9 Dec 2024 03:09:17 +0000 Subject: [PATCH 011/158] Weekly Changelog 2024-12-02 to 2024-12-09 --- data/changelog.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/data/changelog.txt b/data/changelog.txt index e7102d754a9c1..7a03b8ab35f0c 100644 --- a/data/changelog.txt +++ b/data/changelog.txt @@ -192,6 +192,7 @@ Items salvaged from cutting will now be placed in vehicle, if you're cutting the tile layering supports item variants Some herbivore threshold mutants can now eat usually unpalatable raw fruit and vegetables Query the player on whether they really want to cut up other people's stuff +Updates the long pole ## Content: @@ -407,6 +408,15 @@ Wildlife foods adjust morale Add dormant zombies to more locations Add tupelo and nannyberry, hobblebush and autumn olive trees New exodii rifle +Remade the 3x3 hospital +Some houses are under construction +Tiny acetylene tank, a new default magazine for acetylene lamps +combines all four previous fursuits into one item through variants +Convert star vampire blood-drinking attack to EoC +Add water pipe and spawns +Added tucked pocket to leather backpack +Make hiking backpack sheaths hold a single item +Make Pulp Fiction pawnshop unique ## Interface: @@ -532,6 +542,8 @@ shorten `memorize` hint in crafting GUI search some little improvements to the AIM drop menu Allow fine user customization of ImGui colors Migrate scores window to imgui +Audit `satiety` +Crafting GUI filter: by bodypart coverage; Add filter by layer (for crafting GUI, AIM, inventory etc.);;; make them two lines in the changelog, please ## Mods: @@ -873,6 +885,24 @@ Mods can add categories to the help menu Martial Mastery: Insight is cleared when using other martial arts [MoM] Change id of Sense Minds sensing effect to use new tileset sprite [MoM/XE] Add deactivate_conditions to recurring EoCs that don't need to recur for everyone +[Xedra Evolved] Add new time related powers for each default dream class +[Xedra Evolved] Add Commanding the Grasses as an intro trait for Arvore, make Hungry Thirsty Roots require leveling other spells +[Xedra Evolved] Fix seedbearer trait +[Xedra Evolved] Add UNCANNY_DODGE hidden trait to appropriate Paraclesian effect + use new enchant +Aftershock: Replace exosuit forcefield with backpack generator +[MoM] Extend Nether Attunement widget to other sidebars +[Innawoods] Delays the shadow lieutenant boss spawn (and its warnings) by three seasons (mid winter by default). Innawoods only. +[MoM] Add new `u_cancel_activity` to unlocking new power/wakeful rest +[Xedra Evolved] Add The Root of the Mountain trait for Ierde +[DinoMod] nedcolbertia +[Xedra Evolved] Arvore One with the Forest + the Forest's Warning updates +[MoM] Feral vitakinetics can drain your weariness +[DinoMod] shady rework +[Xedra Evolved] Reasonable Werewolf nerfs +[DinoMod] pluralize CBM dino names +[Xedra Evolved] Fix sylph translocate text +[Xedra Evolved] Add Viridescent Vessel spell to Arvore +[Xedra Evolved] Add treesung gear ## Balance: @@ -1371,6 +1401,19 @@ fix limb drying rate and related test data crash on keybind reset in UILIST Fix broken macOS build due removed folder Fix an EOC that was looping infinitely and starting more loops as you travel +[Xedra Evolved] Fix Ruach sidebar descriptions +makes batons with plastic grips not shock you +Allow attacking with CANNOT_MOVE flag +Added ownership to several places of Tacoma Commune ranch camp +[MoM] Fix In the Zone perk +Forbid learning spells from spellbooks with low morale +Stop item spawning magic from putting items on ground when a player is available +Fixes to scores menu +Fix standing tank deconstruction +Fix mutations with `remove_rigid` removing `INTEGRATED` armor +Appliance interaction menu is no longer cut off at the bottom +[Xedra Evolved] Fix lilit ruach draining crash +Fix invalid dereference when construction pre_terrain is empty ## Performance: From 0dac5048168c82ef9b650ad6ab983183c814fdaf Mon Sep 17 00:00:00 2001 From: LyleSY Date: Sun, 8 Dec 2024 23:18:59 -0500 Subject: [PATCH 012/158] rest of human zombies --- data/json/monsters/fungus_zombie.json | 186 ++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) diff --git a/data/json/monsters/fungus_zombie.json b/data/json/monsters/fungus_zombie.json index b61a5f0bc036c..7e985122ccbd9 100644 --- a/data/json/monsters/fungus_zombie.json +++ b/data/json/monsters/fungus_zombie.json @@ -618,6 +618,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "bash": 2, "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_zombie_brute_dusted", + "type": "MONSTER", + "name": { "str": "dusted brute zombie" }, + "description": "This zombie's entire body bulges with distended muscles heavily dusted with a thick gray powder.", + "copy-from": "mon_zombie_brute", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_brute_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_brute_fungalize", + "type": "MONSTER", + "name": { "str": "fungal stalk brute" }, + "description": "This inhumanly muscular corpse has numerous festering wounds and has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_zombie_brute", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_zombie_brute_fungal" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_brute_fungal", "type": "MONSTER", @@ -635,6 +666,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "bash": 2, "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_zombie_hulk_dusted", + "type": "MONSTER", + "name": { "str": "dusted zombie hulk" }, + "description": "This zombie's muscular body has swollen to six times the size of an average person and has been heavily dusted with a thick gray powder.", + "copy-from": "mon_zombie_hulk", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_hulk_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_hulk_fungalize", + "type": "MONSTER", + "name": { "str": "fungal stalk hulk" }, + "description": "This enormous muscular corpse has swollen six times larger and has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_zombie_hulk", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_zombie_hulk_fungal" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_hulk_fungal", "type": "MONSTER", @@ -652,6 +714,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "bash": 2, "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_zombie_crawler_dusted", + "type": "MONSTER", + "name": { "str": "dusted crawling zombie" }, + "description": "This moving corpse with badly damaged legs has been heavily dusted with a thick gray powder.", + "copy-from": "mon_zombie_crawler", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_crawler_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_crawler_fungalize", + "type": "MONSTER", + "name": { "str": "crawling fungal stalk zombie" }, + "description": "This moving corpse with badly damaged legs has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_zombie_crawler", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_zombie_crawler_fungal" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_crawler_fungal", "type": "MONSTER", @@ -669,6 +762,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "bash": 2, "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_zombie_fat_dusted", + "type": "MONSTER", + "name": { "str": "dusted fat zombie" }, + "description": "This heavy moving corpse has been heavily dusted with a thick gray powder.", + "copy-from": "mon_zombie_fat", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_fat_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_fat_fungalize", + "type": "MONSTER", + "name": { "str": "fat fungal stalk zombie" }, + "description": "This heavy corpse has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_zombie_fat", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_zombie_fat_fungus" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_fat_fungus", "type": "MONSTER", @@ -686,6 +810,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "bash": 2, "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_beekeeper_dusted", + "type": "MONSTER", + "name": { "str": "dusted scarred zombie" }, + "description": "This heavily scarred moving corpse has been covered with a thick gray powder.", + "copy-from": "mon_beekeeper", + "default_faction": "zombie_dusted", + "color": "light_gray", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_beekeeper_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_beekeeper_fungalize", + "type": "MONSTER", + "name": { "str": "scarred fungal stalk zombie" }, + "description": "This heavily scarred moving corpse has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_beekeeper", + "default_faction": "fungus", + "color": "light_gray", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_beekeeper_fungal" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_beekeeper_fungal", "type": "MONSTER", @@ -703,6 +858,37 @@ "relative": { "melee_skill": -1, "melee_dice": -1, "melee_dice_sides": 3, "armor": { "bash": 2, "electric": 4 } }, "extend": { "species": [ "FUNGUS" ], "flags": [ "NO_FUNG_DMG" ], "special_attacks": [ [ "FUNGUS", 200 ] ] } }, + { + "id": "mon_zombie_acidic_dusted", + "type": "MONSTER", + "name": { "str": "dusted acidic zombie" }, + "description": "This acrid smelling moving corpse has been covered with a thick gray powder.", + "copy-from": "mon_zombie_acidic", + "default_faction": "zombie_dusted", + "color": "light_gray_yellow", + "vision_day": 10, + "upgrades": { "age_grow": 1, "into": "mon_zombie_acidic_fungalize" }, + "proportional": { "speed": 0.6 }, + "relative": { "melee_skill": -1, "melee_dice": -1 }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, + { + "id": "mon_zombie_acidic_fungalize", + "type": "MONSTER", + "name": { "str": "acidic fungal stalk zombie" }, + "description": "This sickly looking moving corpse with prominent yellow veins has grown a short stalk of gray fungus bursting from the skull.", + "copy-from": "mon_zombie_acidic", + "default_faction": "fungus", + "color": "light_gray_yellow", + "bleed_rate": 50, + "vision_day": 5, + "vision_night": 5, + "harvest": "zombie_humanoid_mushroom", + "upgrades": { "age_grow": 1, "into": "mon_zombie_fungus_acidic" }, + "proportional": { "speed": 0.3 }, + "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, + "extend": { "flags": [ "NO_FUNG_DMG" ] } + }, { "id": "mon_zombie_fungus_acidic", "type": "MONSTER", From af827a85bd8e4d56efc059961ab593f8ce3f0a1e Mon Sep 17 00:00:00 2001 From: LyleSY Date: Sun, 8 Dec 2024 23:23:48 -0500 Subject: [PATCH 013/158] fungalize classics --- data/json/monsters/zed-classic.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/json/monsters/zed-classic.json b/data/json/monsters/zed-classic.json index b0df3271b1d49..46fe530dcb289 100644 --- a/data/json/monsters/zed-classic.json +++ b/data/json/monsters/zed-classic.json @@ -66,7 +66,7 @@ "melee_dice_sides": 4, "melee_damage": [ { "damage_type": "cut", "amount": 2 } ], "death_drops": { "subtype": "collection", "groups": [ [ "default_zombie_clothes", 100 ], [ "hive", 80 ] ] }, - "fungalize_into": "mon_beekeeper_fungal", + "fungalize_into": "mon_beekeeper_dusted", "upgrades": false, "armor": { "bash": 6, "cut": 8, "bullet": 6, "electric": 1 }, "extend": { "weakpoint_sets": [ "wps_natural_armor" ], "families": [ "prof_wp_nat_armored" ] } @@ -109,7 +109,7 @@ { "id": "bite_humanoid", "attack_upper": false, "cooldown": 5 }, { "id": "scratch_humanoid", "attack_upper": false } ], - "fungalize_into": "mon_zombie_crawler_fungal", + "fungalize_into": "mon_zombie_crawler_dusted", "upgrades": { "half_life": 30, "into_group": "GROUP_ZOMBIE_CRAWLER_UPGRADE" }, "extend": { "flags": [ "ATTACK_LOWER", "GEN_DORMANT" ] }, "delete": { "flags": [ "PUSH_MON" ] } @@ -126,7 +126,7 @@ "color": "green", "melee_skill": 3, "melee_dice_sides": 4, - "fungalize_into": "mon_zombie_fat_fungus", + "fungalize_into": "mon_zombie_fat_dusted", "upgrades": { "half_life": 32, "into_group": "GROUP_ZOMBIE_FAT" }, "armor": { "bash": 5, "cut": 3, "bullet": 2, "electric": 2 }, "extend": { "weakpoint_sets": [ "wps_humanoid_head_small" ], "flags": [ "GEN_DORMANT" ] } @@ -186,7 +186,7 @@ "melee_skill": 1, "melee_dice_sides": 2, "grab_strength": 15, - "fungalize_into": "mon_zombie_rot_fungal", + "fungalize_into": "mon_zombie_rot_dusted", "upgrades": { "half_life": 43, "into": "mon_devourer" }, "extend": { "flags": [ "GEN_DORMANT" ] } }, @@ -224,7 +224,7 @@ { "id": "bite_humanoid", "cooldown": 5, "min_mul": 0.7 }, { "id": "scratch_humanoid" } ], - "fungalize_into": "mon_zombie_tough_fungal", + "fungalize_into": "mon_zombie_tough_dusted", "armor": { "bash": 2, "cut": 1, "bullet": 1, "electric": 2 }, "extend": { "weakpoint_sets": [ "wps_humanoid_head_small" ], "flags": [ "GEN_DORMANT" ] } }, From 995b705e6b9c67ef1121a840f727a26e1401a5e4 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Sun, 8 Dec 2024 23:26:27 -0500 Subject: [PATCH 014/158] fungalize raptor --- data/json/monsters/zed-winged.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/monsters/zed-winged.json b/data/json/monsters/zed-winged.json index 3c46e3d866dfc..6cf6ebfd8fa53 100644 --- a/data/json/monsters/zed-winged.json +++ b/data/json/monsters/zed-winged.json @@ -107,7 +107,7 @@ "decay": "zombie_decay_bone", "special_attacks": [ { "id": "impale", "damage_max_instance": [ { "damage_type": "stab", "amount": 15, "armor_multiplier": 0.6 } ] } ], "upgrades": { "half_life": 42, "into_group": "GROUP_ZOMBIE_RAPTOR_UPGRADES" }, - "fungalize_into": "mon_fungal_raptor", + "fungalize_into": "mon_spawn_raptor_dusted", "flags": [ "SEES", "HEARS", From 120dfdccd21c5403ab8e559e6fc72c52bd641f15 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Sun, 8 Dec 2024 23:27:58 -0500 Subject: [PATCH 015/158] fungalize acid man --- data/json/monsters/zed_acid.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/json/monsters/zed_acid.json b/data/json/monsters/zed_acid.json index 21275451ff34f..7838261a5a50e 100644 --- a/data/json/monsters/zed_acid.json +++ b/data/json/monsters/zed_acid.json @@ -12,7 +12,7 @@ "harvest": "zombie_humanoid_acid", "death_function": { "message": "The %s's body leaks acid.", "effect": { "id": "death_acid", "hit_self": true } }, "upgrades": { "half_life": 30, "into": "mon_zombie_spitter" }, - "fungalize_into": "mon_zombie_fungus_acidic", + "fungalize_into": "mon_zombie_acidic_dusted", "extend": { "flags": [ "ACIDPROOF", "ACID_BLOOD" ], "special_attacks": [ [ "ACID_BARF", 10 ] ] } }, { @@ -56,7 +56,7 @@ ], "special_when_hit": [ "ACIDSPLASH", 100 ], "death_function": { "message": "The %s's body leaks acid.", "effect": { "id": "death_acid", "hit_self": true } }, - "fungalize_into": "mon_zombie_fungus_acidic", + "fungalize_into": "mon_zombie_acidic_dusted", "upgrades": false, "armor": { "bash": 10, "cut": 2, "stab": 12, "bullet": 2, "electric": 2 }, "extend": { @@ -83,7 +83,7 @@ "special_attacks": [ [ "ACID", 20 ] ], "death_function": { "message": "The %s's body leaks acid.", "effect": { "id": "death_acid", "hit_self": true } }, "upgrades": { "half_life": 42, "into": "mon_zombie_corrosive" }, - "fungalize_into": "mon_zombie_fungus_acidic", + "fungalize_into": "mon_zombie_acidic_dusted", "extend": { "flags": [ "ACIDPROOF", "ACID_BLOOD", "RANGED_ATTACKER" ], "weakpoint_sets": [ "wps_humanoid_head_big" ] } }, { From 42abe5f06f36acbdc86312d8854287f991068515 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Sun, 8 Dec 2024 23:30:14 -0500 Subject: [PATCH 016/158] fungalize the children --- data/json/monsters/zed_children.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/json/monsters/zed_children.json b/data/json/monsters/zed_children.json index 36064420b0276..56403555525a4 100644 --- a/data/json/monsters/zed_children.json +++ b/data/json/monsters/zed_children.json @@ -25,7 +25,7 @@ "//": "default zombie children clothing (always), additional items from child_items_pockets (sometimes)" }, "burn_into": "mon_zombie_child_scorched", - "fungalize_into": "mon_zombie_child_fungus", + "fungalize_into": "mon_zombie_child_dusted", "upgrades": { "half_life": 30, "into_group": "GROUP_CHILD_ZOMBIE_UPGRADE" }, "extend": { "weakpoint_sets": [ "wps_humanoid_child_body", "wps_humanoid_head_big" ], "families": [ "prof_wp_child" ] }, "delete": { "flags": [ "PUSH_MON" ] } @@ -171,7 +171,7 @@ "monster_message": "Ripping and tearing, a small beast burrows free of the wretch's abdomen!" } ], - "fungalize_into": "mon_fungal_wretch", + "fungalize_into": "mon_zombie_wretch_dusted", "upgrades": false, "flags": [ "SEES", "HEARS", "IMMOBILE", "WARM", "POISON", "NO_BREATHE", "FILTHY" ] } From 6469a647e3235ddebd5699d418654cc68c6d5d91 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Sun, 8 Dec 2024 23:34:34 -0500 Subject: [PATCH 017/158] fungal fixes for bony liches --- data/json/monsters/zed_command.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/json/monsters/zed_command.json b/data/json/monsters/zed_command.json index 5b6df50f79fc6..8f9e1ab06eef6 100644 --- a/data/json/monsters/zed_command.json +++ b/data/json/monsters/zed_command.json @@ -16,6 +16,7 @@ "vision_day": 30, "vision_night": 3, "harvest": "mr_bones", + "fungalize_into": "mon_skeleton_dusted", "armor": { "cut": 15, "stab": 30, "acid": 3, "bullet": 24, "electric": 3 }, "extend": { "weakpoint_sets": [ "wps_bone_armor" ], "families": [ "prof_wp_skeleton" ] } }, @@ -32,6 +33,7 @@ "vision_day": 30, "vision_night": 3, "harvest": "mr_bones", + "fungalize_into": "mon_skeleton_brute_dusted", "armor": { "cut": 15, "stab": 30, "acid": 3, "bullet": 24, "electric": 3 }, "extend": { "weakpoint_sets": [ "wps_bone_armor" ], "families": [ "prof_wp_skeleton" ] } } From 527f48c628c13327a94651a36a7350a9a7251f48 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Sun, 8 Dec 2024 23:37:11 -0500 Subject: [PATCH 018/158] fungal boomers --- data/json/monsters/zed_explosive.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/json/monsters/zed_explosive.json b/data/json/monsters/zed_explosive.json index 00a5b1ed88fd7..86b339542cdff 100644 --- a/data/json/monsters/zed_explosive.json +++ b/data/json/monsters/zed_explosive.json @@ -18,7 +18,7 @@ "death_drops": { "subtype": "collection", "groups": [ [ "default_zombie_death_drops", 100 ], [ "explode_zed", 100 ] ] }, "death_function": { "effect": { "id": "death_boomer", "hit_self": true }, "message": "The %s explodes!", "corpse_type": "NO_CORPSE" }, "upgrades": { "half_life": 42, "into_group": "GROUP_ZOMBIE_BOOMER_UPGRADE" }, - "fungalize_into": "mon_boomer_fungus", + "fungalize_into": "mon_boomer_dusted", "armor": { "electric": 2 }, "extend": { "flags": [ "BILE_BLOOD" ], "weakpoint_sets": [ "wps_humanoid_head_small" ], "special_attacks": [ [ "BOOMER", 20 ] ] } }, @@ -80,7 +80,7 @@ "emit_fields": [ { "emit_id": "emit_toxic_leak", "delay": "1 s" } ], "special_attacks": [ [ "SUICIDE", 20 ], [ "scratch", 15 ] ], "death_function": { "message": "The %s explodes!", "effect": { "id": "death_gas", "hit_self": true }, "corpse_type": "NO_CORPSE" }, - "fungalize_into": "mon_zombie_gasbag_fungus", + "fungalize_into": "mon_gasbag_dusted", "armor": { "electric": 1 }, "delete": { "flags": [ "BILE_BLOOD", "BASHES", "GROUP_BASH" ], "special_attacks": [ "BOOMER" ] } }, From 3ffdef22cbaf8f360c9d39c4bc8d9473291ac1f2 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Sun, 8 Dec 2024 23:41:44 -0500 Subject: [PATCH 019/158] fungalize misc --- data/json/monsters/zed_misc.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/json/monsters/zed_misc.json b/data/json/monsters/zed_misc.json index 34207ff7ccd29..2bf82c9007275 100644 --- a/data/json/monsters/zed_misc.json +++ b/data/json/monsters/zed_misc.json @@ -104,7 +104,7 @@ "bleed_rate": 80, "grab_strength": 15, "upgrades": { "half_life": 24, "into": "mon_zombie_brute" }, - "fungalize_into": "mon_zombie_tough_fungal", + "fungalize_into": "mon_zombie_tough_dusted", "armor": { "bash": 3, "cut": 2, "bullet": 2, "electric": 2 }, "extend": { "flags": [ "SMELLS", "PUSH_VEH" ], @@ -138,7 +138,7 @@ "grab_strength": 30, "burn_into": "mon_zombie_scorched_brute", "upgrades": { "half_life": 42, "into_group": "GROUP_ZOMBIE_BRUTE" }, - "fungalize_into": "mon_zombie_brute_fungal", + "fungalize_into": "mon_zombie_brute_dusted", "armor": { "bash": 4, "cut": 6, "bullet": 5, "electric": 2 }, "extend": { "flags": [ "SMELLS", "PUSH_VEH" ], @@ -292,7 +292,7 @@ "death_function": { "eoc": "EOC_NEMESIS_DIED" }, "upgrades": false, "armor": { "bash": 15, "cut": 15, "bullet": 15, "electric": 6 }, - "fungalize_into": "mon_zombie_hulk_fungal", + "fungalize_into": "mon_zombie_hulk_dusted", "extend": { "flags": [ "ALL_SEEING", "GOODHEARING", "SMELLS", "KEENNOSE", "DESTROYS", "PUSH_VEH", "NEMESIS", "LOUDMOVES" ], "weakpoint_sets": [ "wps_humanoid_head_small" ], @@ -406,7 +406,7 @@ "special_attacks": [ { "id": "grab" }, { "id": "scratch_humanoid" }, { "id": "bite_humanoid" }, { "id": "smash", "throw_strength": 96 } ], "death_drops": "mon_zombie_hulk_death_drops", "burn_into": "mon_zombie_fiend", - "fungalize_into": "mon_zombie_hulk_fungal", + "fungalize_into": "mon_zombie_hulk_dusted", "upgrades": false, "armor": { "bash": 8, "cut": 12, "bullet": 10, "electric": 5 }, "extend": { @@ -580,7 +580,7 @@ } ], "upgrades": { "half_life": 35, "into": "mon_zombie_hunter" }, - "fungalize_into": "mon_zombie_runner_fungal" + "fungalize_into": "mon_zombie_runner_dusted" }, { "id": "mon_zombie_regenerating", @@ -799,7 +799,7 @@ "vision_day": 50, "emit_fields": [ { "emit_id": "emit_smoke_stream", "delay": "1 s" } ], "death_function": { "effect": { "id": "death_smokeburst", "hit_self": true }, "message": "The %s explodes!" }, - "fungalize_into": "mon_zombie_smoker_fungus", + "fungalize_into": "mon_zombie_smoker_dusted", "upgrades": { "half_life": 30, "into": "mon_smoker_brute" }, "armor": { "heat": 5, "electric": 1 }, "extend": { "flags": [ "HARDTOSHOOT" ] } From 0fcd2c841c6dfcbcd06c0a728c2f128a8adbfd79 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Sun, 8 Dec 2024 23:45:27 -0500 Subject: [PATCH 020/158] fungalize skeletals --- data/json/monsters/zed_skeletal.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/json/monsters/zed_skeletal.json b/data/json/monsters/zed_skeletal.json index ec99179734ddf..931e304b400c0 100644 --- a/data/json/monsters/zed_skeletal.json +++ b/data/json/monsters/zed_skeletal.json @@ -15,7 +15,7 @@ "harvest": "mr_bones", "special_attacks": [ { "id": "grab", "cooldown": 21 }, { "id": "scratch_humanoid" }, { "id": "bite_humanoid", "cooldown": 5 } ], "upgrades": { "half_life": 32, "into_group": "GROUP_SKELETON_UPGRADE" }, - "fungalize_into": "mon_skeleton_fungus", + "fungalize_into": "mon_skeleton_dusted", "armor": { "cut": 15, "stab": 30, "acid": 3, "bullet": 24, "electric": 3 }, "extend": { "weakpoint_sets": [ "wps_bone_armor" ], "families": [ "prof_wp_skeleton" ] } }, @@ -48,7 +48,7 @@ } ], "upgrades": { "half_life": 45, "into": "mon_skeleton_hulk" }, - "fungalize_into": "mon_skeleton_brute_fungus", + "fungalize_into": "mon_skeleton_brute_dusted", "armor": { "bash": 12, "cut": 30, "acid": 1, "bullet": 30, "electric": 4 }, "extend": { "weakpoint_sets": [ "wps_bone_armor" ], "families": [ "prof_wp_skeleton" ] } }, @@ -74,7 +74,7 @@ [ "PARROT", 8 ] ], "special_when_hit": [ "ZAPBACK", 100 ], - "fungalize_into": "mon_skeleton_fungus", + "fungalize_into": "mon_skeleton_dusted", "upgrades": false, "armor": { "cut": 15, "stab": 30, "acid": 3, "bullet": 30 }, "extend": { @@ -109,7 +109,7 @@ "damage_max_instance": [ { "damage_type": "cut", "amount": 23, "armor_multiplier": 0.8 } ] } ], - "fungalize_into": "mon_skeleton_hulk_fungus", + "fungalize_into": "mon_skeleton_hulk_dusted", "armor": { "bash": 20, "cut": 45, "bullet": 36, "electric": 8 }, "extend": { "weakpoint_sets": [ "wps_bone_armor" ], "families": [ "prof_wp_skeleton" ] } }, @@ -163,7 +163,7 @@ "scents_tracked": [ "sc_human", "sc_fetid" ], "special_attacks": [ { "id": "cut_throat", "damage_max_instance": [ { "damage_type": "cut", "amount": 40 } ], "cooldown": 15 } ], "upgrades": { "half_life": 32, "into": "mon_skeleton_reaper" }, - "fungalize_into": "mon_skeleton_brute_fungus", + "fungalize_into": "mon_skeleton_brute_dusted", "burn_into": "mon_zombie_scorched_brute", "armor": { "bash": 10, "cut": 35, "stab": 30, "acid": 4, "bullet": 25, "electric": 5 }, "extend": { "flags": [ "SMELLS" ] }, @@ -190,7 +190,7 @@ { "id": "impale", "damage_max_instance": [ { "damage_type": "stab", "amount": 40 } ], "cooldown": 20 } ], "upgrades": false, - "fungalize_into": "mon_skeleton_brute_fungus", + "fungalize_into": "mon_skeleton_brute_dusted", "burn_into": "mon_zombie_scorched_brute", "armor": { "bash": 15, "cut": 35, "stab": 35, "acid": 4, "bullet": 30, "electric": 5 }, "extend": { "flags": [ "PUSH_VEH" ] }, From f4c075e396ed5dcffff7eedc851b39cff6d81652 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Sun, 8 Dec 2024 23:48:01 -0500 Subject: [PATCH 021/158] small fixes --- data/json/monsters/fungus_zombie.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/json/monsters/fungus_zombie.json b/data/json/monsters/fungus_zombie.json index 7e985122ccbd9..696b54b92b2ce 100644 --- a/data/json/monsters/fungus_zombie.json +++ b/data/json/monsters/fungus_zombie.json @@ -339,7 +339,7 @@ "default_faction": "zombie_dusted", "color": "light_gray_magenta", "vision_day": 10, - "upgrades": { "age_grow": 1, "into": "mon_gasbag_fungalize" }, + "upgrades": { "age_grow": 1, "into": "mon_boomer_fungalize" }, "proportional": { "speed": 0.6 }, "relative": { "melee_skill": -1, "melee_dice": -1 }, "extend": { "flags": [ "NO_FUNG_DMG" ] } @@ -355,7 +355,7 @@ "bleed_rate": 50, "vision_day": 5, "vision_night": 5, - "upgrades": { "age_grow": 1, "into": "mon_zombie_gasbag_fungus" }, + "upgrades": { "age_grow": 1, "into": "mon_boomer_fungus" }, "proportional": { "speed": 0.3 }, "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, "extend": { "flags": [ "NO_FUNG_DMG" ] } @@ -692,7 +692,7 @@ "vision_day": 5, "vision_night": 5, "harvest": "zombie_humanoid_mushroom", - "upgrades": { "age_grow": 1, "into": "mon_zombie_hulk_fungal" }, + "upgrades": { "age_grow": 2, "into": "mon_zombie_hulk_fungal" }, "proportional": { "speed": 0.3 }, "relative": { "melee_skill": -1, "melee_dice": -1, "armor": { "bash": 1, "electric": 2 } }, "extend": { "flags": [ "NO_FUNG_DMG" ] } From 31ac4e2ac6e8e56c283fc946692c2115884428eb Mon Sep 17 00:00:00 2001 From: Milopetilo Date: Mon, 9 Dec 2024 12:14:06 +0100 Subject: [PATCH 022/158] Update outpost.json --- data/json/mapgen/outpost.json | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/data/json/mapgen/outpost.json b/data/json/mapgen/outpost.json index 22e82b5844681..2f1f9d3c82e9d 100644 --- a/data/json/mapgen/outpost.json +++ b/data/json/mapgen/outpost.json @@ -79,14 +79,7 @@ { "monster": "mon_turret_searchlight", "x": 1, "y": 22 }, { "monster": "mon_turret_searchlight", "x": 22, "y": 1 } ], - "monster": { - ".": [ - { "monster": "mon_zombie_soldier", "chance": 2 }, - { "monster": "mon_dispatch", "chance": 1 }, - { "monster": "mon_dispatch_military", "chance": 1 }, - { "monster": "mon_secubot", "chance": 5 } - ] - } + "monster": { ".": [ { "group": "GROUP_MIL_BASE", "chance": 9 } ] } } }, { @@ -210,14 +203,7 @@ { "monster": "mon_turret_searchlight", "x": 1, "y": 22 }, { "monster": "mon_turret_searchlight", "x": 22, "y": 1 } ], - "monster": { - ".": [ - { "monster": "mon_zombie_soldier", "chance": 2 }, - { "monster": "mon_dispatch", "chance": 1 }, - { "monster": "mon_dispatch_military", "chance": 1 }, - { "monster": "mon_secubot", "chance": 5 } - ] - } + "monster": { ".": [ { "group": "GROUP_MIL_BASE", "chance": 9 } ] } } }, { From 5a45bcf441cfc7ba5d2adec823d7ce00075845d4 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 29 Nov 2024 13:24:56 +0000 Subject: [PATCH 023/158] Rename file before changing to an overlay to make the blame easier to follow hopefully --- .../No_Hope/{regional_map_settings.json => region_overlay.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename data/mods/No_Hope/{regional_map_settings.json => region_overlay.json} (100%) diff --git a/data/mods/No_Hope/regional_map_settings.json b/data/mods/No_Hope/region_overlay.json similarity index 100% rename from data/mods/No_Hope/regional_map_settings.json rename to data/mods/No_Hope/region_overlay.json From d259d657cb25c0b69cc6b7a0f6af9629e621b351 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 29 Nov 2024 13:25:22 +0000 Subject: [PATCH 024/158] Change No Hope's region settings to an overlay --- data/mods/No_Hope/region_overlay.json | 868 +------------------------- 1 file changed, 3 insertions(+), 865 deletions(-) diff --git a/data/mods/No_Hope/region_overlay.json b/data/mods/No_Hope/region_overlay.json index 7f900a5ff8ac9..e83c20a93e1de 100644 --- a/data/mods/No_Hope/region_overlay.json +++ b/data/mods/No_Hope/region_overlay.json @@ -1,457 +1,7 @@ [ { - "type": "region_settings", - "id": "default", - "//": "TODO: Change to an overlay", - "default_oter": [ - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "open_air", - "field", - "solid_earth", - "empty_rock", - "empty_rock", - "deep_rock", - "deep_rock", - "deep_rock", - "deep_rock", - "deep_rock", - "deep_rock", - "deep_rock" - ], - "default_groundcover": [ [ "t_region_groundcover", 1 ] ], - "region_terrain_and_furniture": { - "terrain": { - "t_region_groundcover": { "t_grass": 12000, "t_grass_dead": 2000, "t_dirt": 1000 }, - "t_region_groundcover_urban": { "t_grass": 20, "t_grass_dead": 3 }, - "t_region_groundcover_forest": { "t_grass_long": 5, "t_grass_tall": 1, "t_moss": 1, "t_grass_dead": 3 }, - "t_region_groundcover_swamp": { "t_grass_long": 300, "t_grass_tall": 100, "t_moss": 200, "t_dirt": 200 }, - "t_region_groundcover_barren": { "t_dirt": 30, "t_grass_dead": 2, "t_railroad_rubble": 1 }, - "t_region_grass": { "t_grass": 1 }, - "t_region_soil": { "t_dirt": 1 }, - "t_region_shrub": { - "t_underbrush": 30, - "t_shrub": 15, - "t_fern": 5, - "t_shrub_blueberry": 2, - "t_shrub_strawberry": 2, - "t_shrub_blackberry": 2, - "t_shrub_raspberry": 2, - "t_shrub_huckleberry": 2, - "t_shrub_rose": 2, - "t_shrub_hydrangea": 2, - "t_shrub_lilac": 2, - "t_shrub_grape": 1 - }, - "t_region_shrub_plains": { "t_region_shrub": 1 }, - "t_region_shrub_fruit": { - "t_shrub_blueberry": 6, - "t_shrub_strawberry": 6, - "t_shrub_raspberry": 4, - "t_shrub_grape": 4, - "t_shrub_blackberry": 2, - "t_shrub_huckleberry": 2, - "t_shrub_peanut": 1 - }, - "t_region_shrub_decorative": { "t_shrub": 3, "t_fern": 1, "t_shrub_rose": 2, "t_shrub_hydrangea": 2, "t_shrub_lilac": 2, "t_bamboo_long": 1 }, - "t_region_tree_forest_dense": { - "t_tree": 18, - "t_tree_blackjack": 10, - "t_tree_hickory": 18, - "t_tree_pine": 9, - "t_tree_maple": 7, - "t_tree_birch": 7, - "t_tree_beech": 7, - "t_tree_cottonwood": 4, - "t_tree_elm": 4, - "t_tree_cherry": 4, - "t_tree_plum": 2, - "t_region_tree_dead": 5, - "t_region_tree_forest_other": 5 - }, - "t_region_tree_forest_other": { - "t_tree_willow": 15, - "t_tree_alder": 15, - "t_tree_chestnut": 10, - "t_tree_basswood": 10, - "t_tree_hazelnut": 10, - "t_tree_apple": 10, - "t_tree_coffee": 1, - "t_tree_apricot": 2, - "t_tree_peach": 1, - "t_tree_pear": 1, - "t_tree_elderberry": 10, - "t_tree_mulberry": 10, - "t_tree_juniper": 5 - }, - "t_region_tree_forest": { "t_region_tree_forest_dense": 2, "t_region_tree_forest_other": 1 }, - "t_region_tree": { - "t_tree": 128, - "t_tree_young": 128, - "t_tree_birch": 16, - "t_tree_elm": 16, - "t_tree_cottonwood": 16, - "t_tree_basswood": 16, - "t_tree_alder": 16, - "t_tree_pine": 32, - "t_tree_maple": 32, - "t_tree_willow": 32, - "t_tree_hickory": 16, - "t_tree_walnut": 8, - "t_tree_chestnut": 8, - "t_tree_hazelnut": 2, - "t_tree_beech": 2, - "t_tree_blackjack": 8, - "t_tree_coffee": 2, - "t_tree_apple": 2, - "t_tree_apricot": 2, - "t_tree_cherry": 2, - "t_tree_juniper": 2, - "t_tree_peach": 2, - "t_tree_pear": 2, - "t_tree_plum": 2, - "t_tree_elderberry": 2, - "t_tree_mulberry": 2, - "t_region_tree_dead": 48 - }, - "t_region_tree_shade": { - "t_tree": 64, - "t_tree_young": 32, - "t_tree_birch": 16, - "t_tree_elm": 16, - "t_tree_cottonwood": 16, - "t_tree_basswood": 16, - "t_tree_alder": 16, - "t_tree_maple": 32, - "t_tree_willow": 32, - "t_tree_hickory": 16, - "t_tree_chestnut": 8, - "t_tree_blackjack": 8, - "t_tree_coffee": 2, - "t_tree_elderberry": 2, - "t_tree_mulberry": 2, - "t_tree_dead": 2 - }, - "t_region_tree_fruit": { - "t_tree_young": 4, - "t_tree_apple": 2, - "t_tree_apricot": 2, - "t_tree_cherry": 2, - "t_tree_peach": 2, - "t_tree_pear": 2, - "t_tree_plum": 2, - "t_tree_elderberry": 2, - "t_tree_mulberry": 2, - "t_tree_dead": 4 - }, - "t_region_tree_dead": { - "t_tree_hickory_dead": 8, - "t_tree_dead": 7, - "t_tree_dead_warped": 1, - "t_tree_deadpine": 3, - "t_tree_deadpine_warped": 1 - }, - "t_region_tree_nut": { - "t_tree_hickory": 16, - "t_tree_hickory_dead": 16, - "t_tree_walnut": 8, - "t_tree_chestnut": 8, - "t_tree_young": 4, - "t_tree_beech": 2, - "t_tree_hazelnut": 2, - "t_tree_coffee": 2, - "t_tree_dead": 4 - }, - "t_region_tree_evergreen": { "t_tree_pine": 32, "t_tree_juniper": 16, "t_tree_deadpine": 2 } - }, - "furniture": { - "f_region_flower": { - "f_black_eyed_susan": 100, - "f_lily": 100, - "f_flower_tulip": 100, - "f_flower_spurge": 100, - "f_chamomile": 100, - "f_dandelion": 100, - "f_dahlia": 100, - "f_bluebell": 100, - "f_sunflower": 100 - }, - "f_region_flower_decorative": { - "f_lily": 4, - "f_flower_tulip": 4, - "f_black_eyed_susan": 3, - "f_bluebell": 2, - "f_maianthemum_stellatum": 2, - "f_flower_spurge": 1, - "f_dahlia": 1, - "f_salsify": 1, - "f_chicory": 1, - "f_sunflower": 1 - }, - "f_region_weed": { - "f_chamomile": 400, - "f_carrot_wild": 300, - "f_salsify": 300, - "f_datura": 300, - "f_japanese_knotweed": 300, - "f_bluebell": 200, - "f_burdock": 100, - "f_dahlia": 100, - "f_lily": 100, - "f_sunflower": 100, - "f_mustard": 100 - }, - "f_region_plain": { - "f_dandelion": 600, - "f_flower_spurge": 400, - "f_chamomile": 400, - "f_carrot_wild": 300, - "f_salsify": 300, - "f_datura": 300, - "f_japanese_knotweed": 200, - "f_dahlia": 200, - "f_maianthemum_stellatum": 200, - "f_mutpoppy": 200, - "f_black_eyed_susan": 100, - "f_flower_tulip": 100, - "f_mustard": 100, - "f_sunflower": 100, - "f_jerusalem_artichoke": 100, - "f_lily": 100, - "f_chicory": 100 - }, - "f_region_forest": { - "f_burdock": 2000, - "f_bluebell": 600, - "f_wild_sarsaparilla": 600, - "f_lily": 500, - "f_chamomile": 500, - "f_japanese_knotweed": 300, - "f_carrot_wild": 300, - "f_salsify": 300, - "f_dahlia": 200, - "f_mutpoppy": 100, - "f_maianthemum_stellatum": 100, - "f_wintergreen": 100 - }, - "f_region_forest_dense": { - "f_burdock": 2000, - "f_bluebell": 800, - "f_lily": 500, - "f_wild_sarsaparilla": 400, - "f_salsify": 300, - "f_wintergreen": 200 - }, - "f_region_forest_water": { "f_burdock": 4, "f_japanese_knotweed": 2, "f_lily": 1 }, - "f_region_water_plant": { "f_cattails": 15, "f_lilypad": 1, "f_lotus": 5 } - } - }, - "river_scale": 1.0, - "overmap_lake_settings": { - "noise_threshold_lake": 0.25, - "lake_size_min": 20, - "lake_depth": -5, - "shore_extendable_overmap_terrain": [ "forest", "forest_thick", "forest_water", "field" ], - "shore_extendable_overmap_terrain_aliases": [ - { "om_terrain": "island_forest", "om_terrain_match_type": "TYPE", "alias": "forest" }, - { "om_terrain": "island_forest_thick", "om_terrain_match_type": "TYPE", "alias": "forest_thick" }, - { "om_terrain": "island_forest_water", "om_terrain_match_type": "TYPE", "alias": "forest_water" }, - { "om_terrain": "island_field", "om_terrain_match_type": "TYPE", "alias": "field" } - ] - }, - "overmap_ocean_settings": { - "noise_threshold_ocean": 0.25, - "ocean_size_min": 100, - "ocean_depth": -9, - "ocean_start_north": 500, - "ocean_start_east": 10, - "ocean_start_west": 1000, - "ocean_start_south": 0, - "sandy_beach_width": 6 - }, - "overmap_ravine_settings": { "num_ravines": 0, "ravine_width": 3, "ravine_range": 45, "ravine_depth": -3 }, - "overmap_forest_settings": { - "noise_threshold_forest": 0.2, - "noise_threshold_forest_thick": 0.25, - "noise_threshold_swamp_adjacent_water": 0.3, - "noise_threshold_swamp_isolated": 0.6, - "river_floodplain_buffer_distance_min": 3, - "river_floodplain_buffer_distance_max": 15 - }, - "overmap_connection_settings": { - "intra_city_road_connection": "local_road", - "inter_city_road_connection": "local_road", - "trail_connection": "forest_trail", - "sewer_connection": "sewer_tunnel", - "subway_connection": "subway_tunnel", - "rail_connection": "local_railroad" - }, - "forest_mapgen_settings": { - "forest": { - "terrains": [ "forest", "special_forest" ], - "sparseness_adjacency_factor": 3, - "item_group": "forest", - "item_group_chance": 60, - "item_spawn_iterations": 1, - "clear_groundcover": false, - "groundcover": { "t_region_groundcover_forest": 1 }, - "clear_components": false, - "components": { - "trees": { "sequence": 0, "chance": 12, "clear_types": false, "types": { "t_region_tree_forest": 128, "t_tree_young": 32 } }, - "shrubs_and_flowers": { "sequence": 1, "chance": 10, "clear_types": false, "types": { "t_region_shrub": 120, "f_region_forest": 10 } }, - "clutter": { - "sequence": 2, - "chance": 80, - "clear_types": false, - "types": { - "t_trunk": 128, - "t_dirtmound": 128, - "f_boulder_small": 128, - "f_rubble_rock": 32, - "f_boulder_medium": 8, - "f_boulder_large": 1, - "t_pit": 1, - "t_pit_shallow": 1 - } - }, - "water": { "sequence": 3, "chance": 512, "clear_types": false, "types": { "t_puddle": 1 } } - }, - "clear_terrain_furniture": false, - "terrain_furniture": { } - }, - "forest_thick": { - "terrains": [ - "bandit_cabin", - "bandit_garage_1", - "bandit_garage_2", - "campsite", - "campsite_a", - "campsite_cabin_incomplete", - "campsite_field_biker", - "campsite_field_biker_destroyed", - "cave", - "central_lab_entrance", - "derelict_property", - "desolatebarn", - "forest_thick", - "forest_trail", - "forest_trail_intersection", - "homelesscamp", - "moonshine_still", - "moonshine_still_1", - "moonshine_still_2", - "natural_spring", - "special_forest_thick", - "spider_pit", - "standing_stones", - "ws_survivor_bunker_f0" - ], - "sparseness_adjacency_factor": 4, - "item_group": "forest", - "item_group_chance": 60, - "item_spawn_iterations": 1, - "clear_groundcover": false, - "groundcover": { "t_region_groundcover_forest": 1 }, - "clear_components": false, - "components": { - "trees": { "sequence": 0, "chance": 5, "clear_types": false, "types": { "t_region_tree_forest_dense": 100, "t_tree_young": 5 } }, - "shrubs_and_flowers": { "sequence": 1, "chance": 5, "clear_types": false, "types": { "t_region_shrub": 130, "f_region_forest_dense": 10 } }, - "clutter": { - "sequence": 2, - "chance": 64, - "clear_types": false, - "types": { - "t_trunk": 64, - "t_dirtmound": 64, - "f_boulder_small": 32, - "f_rubble_rock": 32, - "f_boulder_medium": 16, - "f_boulder_large": 4, - "t_pit": 1, - "t_pit_shallow": 1 - } - }, - "water": { "sequence": 3, "chance": 512, "clear_types": false, "types": { "t_puddle": 1 } } - }, - "clear_terrain_furniture": false, - "terrain_furniture": { } - }, - "forest_water": { - "terrains": [ "forest_water", "hunter_shack", "hunter_shack_1", "shipwreck_river_1", "shipwreck_river_2" ], - "sparseness_adjacency_factor": 2, - "item_group": "forest", - "item_group_chance": 60, - "item_spawn_iterations": 1, - "clear_groundcover": false, - "groundcover": { "t_region_groundcover_swamp": 1 }, - "clear_components": false, - "components": { - "trees": { - "sequence": 0, - "chance": 45, - "clear_types": false, - "types": { - "t_tree": 40, - "t_tree_young": 80, - "t_tree_pine": 40, - "t_tree_birch": 20, - "t_tree_elm": 20, - "t_tree_cottonwood": 20, - "t_tree_alder": 80, - "t_tree_maple": 40, - "t_tree_willow": 40, - "t_tree_walnut": 8, - "t_tree_chestnut": 8, - "t_tree_hazelnut": 2, - "t_tree_beech": 2, - "t_tree_hickory": 8, - "t_tree_apple": 2, - "t_tree_cherry": 2, - "t_tree_juniper": 2, - "t_tree_peach": 2, - "t_tree_pear": 2, - "t_tree_plum": 2, - "t_tree_elderberry": 2, - "t_tree_mulberry": 2, - "t_region_tree_dead": 90 - } - }, - "shrubs_and_flowers": { "sequence": 1, "chance": 15, "clear_types": false, "types": { "t_region_shrub": 80, "f_region_forest_water": 30 } }, - "clutter": { - "sequence": 2, - "chance": 75, - "clear_types": false, - "types": { "t_trunk": 1, "f_boulder_small": 2, "f_boulder_medium": 1 } - }, - "water": { - "sequence": 3, - "chance": 2, - "clear_types": false, - "types": { "t_swater_sh": 6, "t_swater_dp": 1, "t_water_murky": 12 } - } - }, - "clear_terrain_furniture": false, - "terrain_furniture": { "t_water_murky": { "chance": 2, "clear_furniture": false, "furniture": { "f_region_water_plant": 1 } } } - } - }, - "forest_trail_settings": { - "chance": 2, - "border_point_chance": 2, - "minimum_forest_size": 100, - "random_point_min": 4, - "random_point_max": 50, - "random_point_size_scalar": 100, - "trailhead_chance": 1, - "trailhead_road_distance": 6, - "trailheads": { "trailhead_basic": 1, "trailhead_outhouse": 1, "trailhead_shack": 1 } - }, + "type": "region_overlay", + "regions": [ "all" ], "map_extras": { "forest": { "chance": 40, @@ -685,417 +235,6 @@ "ocean_shore": { "chance": 1, "extras": { "mx_reed": 100 } }, "sewer": { "chance": 80, "extras": { "mx_null": 100 } } }, - "city": { - "shop_radius": 30, - "shop_sigma": 50, - "park_radius": 20, - "park_sigma": 80, - "houses": { - "2storyModern01": 5, - "2storyModern02": 50, - "2StoryModern03": 50, - "house_w_1": 50, - "house_two_story_basement": 50, - "multi_unit_two_story_basement": 40, - "multi_unit_three_story_basement": 30, - "house_crack1": 5, - "house_crack2": 5, - "house_crack3": 5, - "house_wooded": 50, - "house_prepper": 20, - "house_prepper2": 10, - "house_fortified": 20, - "duplex": 50, - "house_duplex2": 50, - "house_duplex3": 50, - "house_duplex4": 50, - "house_duplex5": 50, - "house_duplex6": 50, - "house_duplex7": 50, - "house_duplex8": 50, - "house_duplex9": 50, - "house_duplex10": 50, - "house_duplex11": 50, - "house_w_2": 50, - "house_w_3": 50, - "house_w_4": 50, - "house_w_5": 50, - "house_w_6": 50, - "house_01": 50, - "house_02": 50, - "house_03": 50, - "house_04": 50, - "house_05": 50, - "house_06": 50, - "house_07": 50, - "house_08": 50, - "house_09": 20, - "house_10": 50, - "house_11": 50, - "house_12": 50, - "house_13": 50, - "house_14": 50, - "house_15": 50, - "house_16": 50, - "house_17": 50, - "house_18": 50, - "house_19": 50, - "house_20": 50, - "house_21": 50, - "house_22": 50, - "house_23": 50, - "house_24": 50, - "house_25": 50, - "house_26": 50, - "house_27": 50, - "house_28": 50, - "house_29": 50, - "house_30": 50, - "house_31": 50, - "house_32": 50, - "house_33": 50, - "house_34": 50, - "house_35": 50, - "house_36": 50, - "house_37": 50, - "house_38": 50, - "house_39": 50, - "house_40": 50, - "house_41": 50, - "house_42": 50, - "house_garage": 50, - "house_garage2": 50, - "house_garage3": 50, - "house_garage4": 50, - "house_garage5": 50, - "house_garage6": 50, - "house_garage7": 50, - "house_garage8": 50, - "rural_house1": 50, - "rural_house2": 50, - "garden_house_1": 50, - "house_toolshed": 50, - "house_suicide": 20, - "house_quiverfull": 30, - "house_rv": 50, - "house_porch": 50, - "house_patio": 50, - "house_modern_1": 50, - "house_library": 50, - "house_detatched1": 50, - "house_detatched2": 50, - "house_detatched3": 50, - "house_detatched4": 50, - "house_detatched5": 50, - "house_detatched6": 50, - "house_detatched7": 50, - "house_detatched8": 50, - "house_detatched9": 50, - "house_detatched10": 50, - "house_dogs": 50, - "house_gardener": 50, - "house_inner_garden": 50, - "urban_1_house": 50, - "urban_2_house": 50, - "urban_dd_house": 1, - "urban_3_house": 50, - "urban_4_house_basement": 50, - "urban_5_house": 50, - "urban_6_house": 50, - "urban_7_house_garden": 50, - "urban_8_house_brick_garden": 50, - "urban_9_house_garage_loft": 50, - "urban_10_house_brick_pool": 50, - "urban_11_house_brick": 50, - "urban_12_house": 50, - "urban_15_house": 50, - "urban_16_house_ranch": 50, - "urban_17_house_ranch": 50, - "urban_18_victorian": 50, - "emptyresidentiallot": 20, - "house_vacant": 7, - "house_vacant1": 7, - "house_vacant2": 7, - "house_vacant3": 7, - "apartments_con_new": 10, - "apartments_mod_new": 10, - "s_apt": 30, - "s_apt_2": 30, - "school": 15, - "motel_city": 10, - "fishing_pond_city": 10 - }, - "parks": { - "park": 50, - "park_2": 50, - "park_3": 50, - "park_4": 50, - "park_5": 50, - "park_6": 50, - "park_7": 50, - "pool": 20, - "pool_1": 20, - "pool_2": 20, - "pool_3": 20, - "pool_4": 20, - "pool_5": 20, - "pool_6": 20, - "playground": 40, - "playground_1": 40, - "dog_park": 20, - "volleyball_court": 30, - "tennis_court": 30, - "baskeball_court": 30, - "skate_park_ramp": 20, - "skate_park": 20, - "park_maze": 10, - "park_maze_2": 10, - "small_wooded_trail": 30, - "small_wooded_trail_2": 30, - "pavilion": 100, - "pavilion_1": 100, - "cemetery_small": 200, - "Pond": 200, - "communitygarden": 75, - "communitygarden_2": 75, - "communitygarden_3": 75, - "publicgarden": 100, - "publicgarden_2": 100, - "cathedral": 50, - "football_field": 25, - "baseball_field": 50, - "botanical_garden": 100, - "zoo": 25, - "stadium": 25, - "stadium_football": 25, - "cemetery_city": 50, - "public_pond_city": 50, - "cemetery_religious_city": 25, - "cs_private_park": 100, - "cs_public_art_piece": 100, - "cs_public_space": 100, - "cs_city_dump_small": 100, - "cs_open_sewer": 100 - }, - "shops": { - "bus_station": 200, - "city_block_2": 300, - "textile_mill_museum": 50, - "abandoned_textile_mill": 20, - "s_apt": 50, - "s_apt_2": 50, - "urban_13_dense_house_apt_house": 300, - "urban_14_dense_house_mart_food": 200, - "urban_25_dense_diner_apt": 200, - "urban_29_dense_row": 200, - "town_hall": 150, - "craft_shop": 200, - "craft_shop_1": 200, - "craft_shop_2": 200, - "craft_shop_3": 200, - "s_gas": 500, - "s_gas_1": 500, - "s_pharm": 300, - "s_pharm_1": 300, - "s_cosmetic": 300, - "s_grocery": 1500, - "s_grocery_1": 1500, - "s_hardware": 400, - "s_hardware_1": 400, - "s_hardware_2": 400, - "s_hardware_3": 400, - "s_hunting": 300, - "s_sports": 500, - "dojo": 200, - "dojo_1": 200, - "gym": 100, - "gym_fitness": 200, - "gym_fitness_1": 200, - "s_liquor": 500, - "s_gun": 200, - "s_gun_looted": 200, - "s_gun_1": 200, - "s_gun_2": 200, - "s_gun_3": 200, - "s_gun_3_looted": 200, - "s_gun_4": 200, - "s_gun_4_looted": 200, - "s_gunstore": 200, - "s_gunstore_looted": 200, - "s_clothes": 450, - "s_clothes_1": 200, - "s_clothes_2": 200, - "s_clothes_3": 100, - "s_clothes_4": 300, - "s_clothes_5": 100, - "s_clothes_6": 450, - "s_library": 200, - "s_library_1": 200, - "s_library_2": 200, - "s_bookstore": 200, - "s_bookstore_1": 200, - "s_bookstore_2": 200, - "s_restaurant": 400, - "s_restaurant_foodplace": 400, - "s_restaurant_1": 400, - "s_restaurant_2": 400, - "s_restaurant_3": 400, - "s_diner": 400, - "sub_station": 1600, - "bank": 300, - "bank_1": 300, - "s_pizza_parlor": 400, - "s_pizza_parlor_1": 400, - "bar": 400, - "bar_1": 400, - "s_electronics": 400, - "s_electronics_1": 400, - "s_electronicstore": 400, - "pawn": 300, - "pawn_1": 300, - "pawn_pf": 50, - "mil_surplus": 200, - "mil_surplus_1": 200, - "mil_surplus_2": 200, - "s_garage": 300, - "s_garage_1": 300, - "s_garage_2": 300, - "station_radio": 300, - "station_radio_1": 300, - "office_doctor": 200, - "office_doctor_1": 200, - "office_doctor_2": 200, - "office_tower_collapsed": 250, - "s_restaurant_fast": 400, - "s_restaurant_fast_1": 400, - "s_restaurant_coffee": 200, - "s_restaurant_coffee_1": 200, - "s_restaurant_coffee_2": 100, - "s_teashop": 100, - "s_teashop_1": 100, - "bowling_alley": 200, - "church": 200, - "church_1": 200, - "office_cubical": 200, - "office_cubical_1": 200, - "furniture": 200, - "abstorefront": 200, - "abstorefront_1": 200, - "abstorefront_2": 200, - "police": 100, - "police_1": 100, - "police_2": 100, - "police_dept": 1250, - "fire_station": 200, - "fire_station_1": 200, - "home_improvement": 200, - "s_lot": 400, - "s_arcade": 200, - "s_games": 200, - "s_jewelry_shop": 200, - "s_antique": 200, - "s_gardening": 200, - "s_dive_shop": 300, - "museum": 100, - "s_music": 200, - "s_laundromat": 100, - "s_laundromat_1": 100, - "veterinarian": 200, - "animalpound": 200, - "animalshelter": 100, - "mortuary": 100, - "smallscrapyard": 100, - "stripclub": 100, - "stripclub_1": 100, - "stripclub_2": 100, - "orchard": 200, - "dispensary": 100, - "dispensary_1": 100, - "dispensary_2": 100, - "headshop": 100, - "small_office": 200, - "art_gallery": 200, - "small_storage_units": 150, - "small_storage_units_1": 150, - "construction_site": 600, - "post_office": 200, - "post_office_1": 200, - "candy_shop": 200, - "candy_shop_1": 200, - "bakery": 200, - "icecream_shop": 200, - "s_butcher": 200, - "s_butcher_1": 200, - "s_butcher_2": 200, - "s_bike_shop": 100, - "s_bike_shop_1": 100, - "paintball_field": 100, - "paintball_field_1": 100, - "smoke_lounge": 100, - "smoke_lounge_1": 100, - "gambling_hall": 100, - "gambling_hall_1": 100, - "music_venue": 100, - "music_venue_1": 100, - "dump": 100, - "recyclecenter": 100, - "recyclecenter_1": 100, - "recyclecenter_2": 100, - "landfill": 100, - "warehouse": 100, - "abandonedwarehouse": 100, - "abandonedwarehouse_1": 100, - "abandonedwarehouse_2": 100, - "abandonedwarehouse_3": 100, - "abandonedwarehouse_4": 100, - "emptycommerciallot": 100, - "lancenter": 100, - "lancenter_1": 100, - "dollarstore": 200, - "dollarstore_1": 200, - "s_vfw": 100, - "s_daycare": 100, - "s_thrift": 100, - "s_petstore": 100, - "s_petstore_1": 100, - "s_petstore_2": 100, - "megastore": 150, - "hotel_1": 75, - "hotel_2": 75, - "hotel_3": 75, - "hospital": 175, - "urban_35_hospital": 175, - "public_works": 200, - "office_tower": 150, - "office_tower_2": 150, - "office_skyscraper": 300, - "office_tower_large": 300, - "office_tower_hiddenlab": 50, - "mall": 100, - "home_improvement_superstore_new": 150, - "lumberyard": 75, - "landscaping_supply_co": 150, - "storage_units_large": 125, - "storage_units_medium": 125, - "shopping_plaza": 125, - "movie_theater": 75, - "garage_gas_city": 250, - "2fmotel_city": 50, - "cs_car_dealership": 200, - "cs_car_showroom": 100, - "s_cardealer": 200, - "s_camping": 300, - "cs_gardening_allotment": 100, - "cs_internet_cafe": 100, - "cs_market_small": 100, - "cs_sex_shop": 100, - "cs_tire_shop": 100, - "homeless_shelter": 100, - "parking_garage": 200, - "salon": 500, - "strip_mall": 750 - } - }, "weather": { "base_temperature": 6.5, "base_humidity": 90.0, @@ -1103,7 +242,6 @@ "base_wind": 3.4, "base_wind_distrib_peaks": 80, "base_wind_season_variation": 50 - }, - "overmap_feature_flag_settings": { "clear_blacklist": false, "blacklist": [ ], "clear_whitelist": false, "whitelist": [ ] } + } } ] From 44564f101d93902ceaf0b121b62e1ce749f8f1ae Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:17:18 +0000 Subject: [PATCH 025/158] Remove null sewer extras --- .../overmap/overmap_terrain/overmap_terrain_waste_junk.json | 3 +-- data/json/regional_map_settings.json | 1 - data/mods/No_Hope/region_overlay.json | 3 +-- data/mods/TropiCataclysm/tropical_regional_map_settings.json | 3 +-- data/mods/desert_region/desert_regional_map_settings.json | 3 +-- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/data/json/overmap/overmap_terrain/overmap_terrain_waste_junk.json b/data/json/overmap/overmap_terrain/overmap_terrain_waste_junk.json index 692ba1e708938..cc1c0a243ebb0 100644 --- a/data/json/overmap/overmap_terrain/overmap_terrain_waste_junk.json +++ b/data/json/overmap/overmap_terrain/overmap_terrain_waste_junk.json @@ -5,8 +5,7 @@ "vision_levels": "underground_dirt", "name": "sewer", "color": "green", - "see_cost": "full_high", - "extras": "sewer" + "see_cost": "full_high" }, { "type": "overmap_terrain", diff --git a/data/json/regional_map_settings.json b/data/json/regional_map_settings.json index 1a1452a6ed7b8..a17d60e66b0ee 100644 --- a/data/json/regional_map_settings.json +++ b/data/json/regional_map_settings.json @@ -751,7 +751,6 @@ }, "river": { "chance": 1, "extras": { "mx_null": 66, "mx_riverside_boat": 1, "mx_reed": 33 } }, "lake_shore": { "chance": 2, "extras": { "mx_reed": 100 } }, - "sewer": { "chance": 80, "extras": { "mx_null": 100 } }, "agricultural": { "chance": 38, "extras": { diff --git a/data/mods/No_Hope/region_overlay.json b/data/mods/No_Hope/region_overlay.json index e83c20a93e1de..51ba0961099a9 100644 --- a/data/mods/No_Hope/region_overlay.json +++ b/data/mods/No_Hope/region_overlay.json @@ -232,8 +232,7 @@ }, "river": { "chance": 3, "extras": { "mx_reed": 100 } }, "lake_shore": { "chance": 2, "extras": { "mx_reed": 100 } }, - "ocean_shore": { "chance": 1, "extras": { "mx_reed": 100 } }, - "sewer": { "chance": 80, "extras": { "mx_null": 100 } } + "ocean_shore": { "chance": 1, "extras": { "mx_reed": 100 } } }, "weather": { "base_temperature": 6.5, diff --git a/data/mods/TropiCataclysm/tropical_regional_map_settings.json b/data/mods/TropiCataclysm/tropical_regional_map_settings.json index 5e3581d7d61b2..1b66ca9cfd226 100644 --- a/data/mods/TropiCataclysm/tropical_regional_map_settings.json +++ b/data/mods/TropiCataclysm/tropical_regional_map_settings.json @@ -730,8 +730,7 @@ } }, "river": { "chance": 3, "extras": { "mx_reed": 100 } }, - "lake_shore": { "chance": 2, "extras": { "mx_reed": 100 } }, - "sewer": { "chance": 80, "extras": { "mx_null": 100 } } + "lake_shore": { "chance": 2, "extras": { "mx_reed": 100 } } }, "city": { "shop_radius": 30, diff --git a/data/mods/desert_region/desert_regional_map_settings.json b/data/mods/desert_region/desert_regional_map_settings.json index 47b13c5bfa430..7596777116a2e 100644 --- a/data/mods/desert_region/desert_regional_map_settings.json +++ b/data/mods/desert_region/desert_regional_map_settings.json @@ -366,8 +366,7 @@ } }, "river": { "chance": 3, "extras": { "mx_reed": 100 } }, - "lake_shore": { "chance": 2, "extras": { "mx_reed": 100 } }, - "sewer": { "chance": 80, "extras": { "mx_null": 100 } } + "lake_shore": { "chance": 2, "extras": { "mx_reed": 100 } } }, "city": { "shop_radius": 30, From b67d0903e0cae6977e562d17387b425857aae804 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:29:01 +0000 Subject: [PATCH 026/158] Remove now redundant same weight extras --- data/mods/No_Hope/region_overlay.json | 169 +------------------------- 1 file changed, 2 insertions(+), 167 deletions(-) diff --git a/data/mods/No_Hope/region_overlay.json b/data/mods/No_Hope/region_overlay.json index 51ba0961099a9..93b4ba0b5db85 100644 --- a/data/mods/No_Hope/region_overlay.json +++ b/data/mods/No_Hope/region_overlay.json @@ -6,37 +6,10 @@ "forest": { "chance": 40, "extras": { - "mx_blackberry_patch": 1000, - "mx_point_dead_vegetation": 500, - "mx_point_burned_ground": 500, - "mx_grove": 500, - "mx_shrubbery": 500, - "mx_spider": 200, - "mx_clearcut": 125, - "mx_pond": 125, - "mx_pond_forest": 125, - "mx_pond_forest_2": 125, - "mx_clay_deposit": 125, - "mx_knotweed_patch": 120, - "mx_nest_wasp": 50, - "mx_grass2": 40, - "mx_casings": 30, - "mx_fallen_shed": 30, - "mx_corpses": 30, - "mx_collegekids": 25, - "mx_grass": 20, "mx_science": 20, - "mx_toxic_waste": 10, "mx_crater": 10, "mx_supplydrop": 8, "mx_military": 8, - "mx_drugdeal": 8, - "mx_mass_grave": 5, - "mx_portal": 3, - "mx_portal_in": 3, - "mx_helicopter": 1, - "mx_exocrash_1": 1, - "mx_exocrash_2": 1, "mx_bandits_ambush": 5, "mx_bandits_grave": 2, "mx_bandits_outpost": 2 @@ -45,38 +18,10 @@ "forest_thick": { "chance": 30, "extras": { - "mx_blackberry_patch": 1300, - "mx_grove": 500, - "mx_shrubbery": 500, - "mx_point_dead_vegetation": 500, - "mx_point_burned_ground": 500, - "mx_spider": 200, - "mx_clearcut": 125, - "mx_pond": 125, - "mx_pond_forest": 125, - "mx_pond_forest_2": 125, - "mx_clay_deposit": 125, - "mx_knotweed_patch": 100, - "mx_casings": 30, - "mx_corpses": 30, "mx_science": 20, - "mx_nest_wasp": 25, "mx_collegekids": 25, - "mx_drugdeal": 20, - "mx_grass2": 20, - "mx_fallen_shed": 20, - "mx_toxic_waste": 15, "mx_crater": 10, - "mx_grass": 10, - "mx_military": 8, - "mx_mass_grave": 5, "mx_supplydrop": 5, - "mx_portal": 3, - "mx_portal_in": 3, - "mx_jabberwock": 1, - "mx_exocrash_1": 1, - "mx_helicopter": 1, - "mx_exocrash_2": 1, "mx_bandits_ambush": 5, "mx_bandits_grave": 2, "mx_bandits_outpost": 2 @@ -85,30 +30,10 @@ "forest_water": { "chance": 20, "extras": { - "mx_pond": 240, - "mx_pond_swamp": 240, - "mx_pond_swamp_2": 240, - "mx_spider": 200, - "mx_clay_deposit": 140, - "mx_knotweed_patch": 140, - "mx_nest_dermatik": 75, - "mx_point_dead_vegetation": 60, "mx_science": 50, "mx_military": 25, "mx_supplydrop": 25, "mx_crater": 20, - "mx_drugdeal": 20, - "mx_fallen_shed": 10, - "mx_casings": 60, - "mx_corpses": 80, - "mx_grass2": 20, - "mx_grass": 10, - "mx_toxic_waste": 10, - "mx_portal": 8, - "mx_portal_in": 7, - "mx_helicopter": 5, - "mx_exocrash_1": 1, - "mx_exocrash_2": 1, "mx_bandits_ambush": 5, "mx_bandits_grave": 2, "mx_bandits_outpost": 2 @@ -117,32 +42,8 @@ "field": { "chance": 6, "extras": { - "mx_grass": 3500, - "mx_grass2": 3500, - "mx_trees2": 800, - "mx_point_burned_ground": 500, - "mx_point_dead_vegetation": 500, - "mx_trees": 500, - "mx_knotweed_patch": 250, - "mx_fallen_shed": 200, - "mx_pond": 200, - "mx_casings": 200, "mx_crater": 150, - "mx_nest_wasp": 50, - "mx_mass_grave": 50, - "mx_grave": 50, "mx_supplydrop": 40, - "mx_Trapdoor_spider_den": 40, - "mx_collegekids": 30, - "mx_drugdeal": 30, - "mx_corpses": 30, - "mx_toxic_waste": 10, - "mx_portal": 10, - "mx_portal_in": 10, - "mx_science": 10, - "mx_military": 4, - "mx_exocrash_1": 5, - "mx_exocrash_2": 5, "mx_bandits_ambush": 10, "mx_bandits_campsite": 10, "mx_bandits_grave": 10, @@ -155,84 +56,18 @@ "mx_helicopter": 10, "mx_military": 50, "mx_science": 400, - "mx_collegekids": 500, - "mx_roadblock": 830, - "mx_roadblock_mil": 170, "mx_bandits_block": 800, "mx_drugdeal": 300, "mx_supplydrop": 100, - "mx_portal": 50, "mx_crater": 100, - "mx_portal_in": 40, - "mx_roadworks": 1000, - "mx_mayhem": 500, - "mx_casings": 1000, - "mx_corpses": 300, - "mx_prison_bus": 150, - "mx_prison_van": 10, - "mx_exocrash_1": 5, - "mx_exocrash_2": 5, "mx_bandits_ambush": 100 } }, - "bridgehead_ground": { "chance": 5, "extras": { "mx_minefield": 100 } }, - "road_nesw_manhole": { "chance": 20, "extras": { "mx_city_trap": 100 } }, "build": { "chance": 90, - "extras": { - "mx_bugout": 20, - "mx_house_spider": 40, - "mx_house_wasp": 30, - "mx_military": 5, - "mx_science": 12, - "mx_collegekids": 15, - "mx_portal": 5, - "mx_crater": 60, - "mx_portal_in": 3, - "mx_point_burned_ground": 5, - "mx_casings": 30, - "mx_looters": 10, - "mx_corpses": 30, - "mx_bandits_ambush": 10, - "mx_bandits_hideout": 10 - } - }, - "marloss": { "chance": 20, "extras": { "mx_marloss_pilgrimage": 100 } }, - "subway": { - "chance": 75, - "extras": { "mx_military": 5, "mx_science": 12, "mx_drugdeal": 5, "mx_casings": 10, "mx_bandits_ambush": 5 } - }, - "lab_subway": { "chance": 25, "extras": { "mx_military": 5, "mx_science": 15, "mx_portal": 3, "mx_portal_in": 3 } }, - "research_facility_lot": { - "chance": 3, - "extras": { - "mx_helicopter": 15, - "mx_military": 65, - "mx_collegekids": 1, - "mx_portal": 200, - "mx_crater": 180, - "mx_portal_in": 30, - "mx_point_burned_ground": 100, - "mx_casings": 30, - "mx_exocrash_1": 1, - "mx_exocrash_2": 1 - } - }, - "research_facility_interior": { - "chance": 2, - "extras": { - "mx_jabberwock": 1, - "mx_military": 5, - "mx_portal": 100, - "mx_crater": 300, - "mx_portal_in": 40, - "mx_point_burned_ground": 125, - "mx_casings": 30 - } + "extras": { "mx_bugout": 20, "mx_science": 12, "mx_crater": 60, "mx_bandits_ambush": 10, "mx_bandits_hideout": 10 } }, - "river": { "chance": 3, "extras": { "mx_reed": 100 } }, - "lake_shore": { "chance": 2, "extras": { "mx_reed": 100 } }, - "ocean_shore": { "chance": 1, "extras": { "mx_reed": 100 } } + "subway": { "chance": 100, "extras": { "mx_casings": 10, "mx_bandits_ambush": 5 } } }, "weather": { "base_temperature": 6.5, From 906884d8fc31e143e57cf294aa4e3a4509a306d1 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:31:50 +0000 Subject: [PATCH 027/158] Remove now redundant extra chance fields --- data/mods/No_Hope/region_overlay.json | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/data/mods/No_Hope/region_overlay.json b/data/mods/No_Hope/region_overlay.json index 93b4ba0b5db85..927204b62dc09 100644 --- a/data/mods/No_Hope/region_overlay.json +++ b/data/mods/No_Hope/region_overlay.json @@ -4,7 +4,6 @@ "regions": [ "all" ], "map_extras": { "forest": { - "chance": 40, "extras": { "mx_science": 20, "mx_crater": 10, @@ -16,7 +15,6 @@ } }, "forest_thick": { - "chance": 30, "extras": { "mx_science": 20, "mx_collegekids": 25, @@ -28,7 +26,6 @@ } }, "forest_water": { - "chance": 20, "extras": { "mx_science": 50, "mx_military": 25, @@ -40,7 +37,6 @@ } }, "field": { - "chance": 6, "extras": { "mx_crater": 150, "mx_supplydrop": 40, @@ -51,7 +47,6 @@ } }, "road": { - "chance": 75, "extras": { "mx_helicopter": 10, "mx_military": 50, @@ -63,11 +58,8 @@ "mx_bandits_ambush": 100 } }, - "build": { - "chance": 90, - "extras": { "mx_bugout": 20, "mx_science": 12, "mx_crater": 60, "mx_bandits_ambush": 10, "mx_bandits_hideout": 10 } - }, - "subway": { "chance": 100, "extras": { "mx_casings": 10, "mx_bandits_ambush": 5 } } + "build": { "extras": { "mx_bugout": 20, "mx_science": 12, "mx_crater": 60, "mx_bandits_ambush": 10, "mx_bandits_hideout": 10 } }, + "subway": { "extras": { "mx_casings": 10, "mx_bandits_ambush": 5 } } }, "weather": { "base_temperature": 6.5, From 7494378836ca46e18197b01aba658a0494aef838 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Mon, 9 Dec 2024 07:05:02 -0500 Subject: [PATCH 028/158] dedupe vision for dusted crawler --- data/json/monsters/fungus_zombie.json | 1 - 1 file changed, 1 deletion(-) diff --git a/data/json/monsters/fungus_zombie.json b/data/json/monsters/fungus_zombie.json index 696b54b92b2ce..e546274ef79a6 100644 --- a/data/json/monsters/fungus_zombie.json +++ b/data/json/monsters/fungus_zombie.json @@ -722,7 +722,6 @@ "copy-from": "mon_zombie_crawler", "default_faction": "zombie_dusted", "color": "light_gray", - "vision_day": 10, "upgrades": { "age_grow": 1, "into": "mon_zombie_crawler_fungalize" }, "proportional": { "speed": 0.6 }, "relative": { "melee_skill": -1, "melee_dice": -1 }, From b7459631eeabc24c45def8990cb3467500168a4c Mon Sep 17 00:00:00 2001 From: DSeyka <66876732+DSeyka@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:20:22 +0300 Subject: [PATCH 029/158] Update swords_and_blades.json --- data/json/items/melee/swords_and_blades.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/items/melee/swords_and_blades.json b/data/json/items/melee/swords_and_blades.json index a00535d896abd..fafb3d40f7da0 100644 --- a/data/json/items/melee/swords_and_blades.json +++ b/data/json/items/melee/swords_and_blades.json @@ -648,7 +648,7 @@ "material": [ "steel", "plastic" ], "symbol": ";", "color": "red", - "qualities": [ [ "CUT", 2 ], [ "SAW_W", 1 ], [ "SAW_M", 1 ], [ "SCREW", 1 ], [ "BUTCHER", 8 ] ], + "qualities": [ [ "CUT", 2 ], [ "SAW_W", 1 ], [ "SAW_M", 1 ], [ "SCREW", 1 ], [ "LEATHER_AWL", 1 ], [ "BUTCHER", 8 ] ], "flags": [ "ALLOWS_BODY_BLOCK" ], "melee_damage": { "stab": 6 }, "weapon_category": [ "SHIVS" ] From 38c0e81c252fbcefb5d2a3b24ff6c2d14ac5fc0d Mon Sep 17 00:00:00 2001 From: Alex Mooney Date: Mon, 9 Dec 2024 22:58:35 -0800 Subject: [PATCH 030/158] Prompt when torch doesn't have enough charge --- src/activity_actor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/activity_actor.cpp b/src/activity_actor.cpp index 966ab39426180..1130d04eaec3a 100644 --- a/src/activity_actor.cpp +++ b/src/activity_actor.cpp @@ -5421,11 +5421,14 @@ void oxytorch_activity_actor::start( player_activity &act, Character &who ) act.set_to_null(); return; } - if( tool->ammo_sufficient( &who, act.moves_total / 100 ) ) { + if( tool->ammo_sufficient( &who, act.moves_total / 100 ) || + query_yn( + _( "Your %1$s doesn't have enough charges to complete the job. Continue anyway?" ), tool->tname() + ) + ) { add_msg_debug( debugmode::DF_ACTIVITY, "%s moves_total: %d", act.id().str(), act.moves_total ); act.moves_left = act.moves_total; } else { - who.add_msg_if_player( m_bad, _( "Your %1$s doesn't have enough charges." ), tool->tname() ); act.set_to_null(); return; } From 856288c515c40591ba5111eae176a5626d465c14 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:55:11 +0100 Subject: [PATCH 031/158] Yeet huge if else --- src/faction_camp.cpp | 131 +++++++++++-------------------------------- 1 file changed, 32 insertions(+), 99 deletions(-) diff --git a/src/faction_camp.cpp b/src/faction_camp.cpp index 6a2cd4446932c..6b3992c1d6026 100644 --- a/src/faction_camp.cpp +++ b/src/faction_camp.cpp @@ -113,38 +113,15 @@ static const mongroup_id GROUP_CAMP_HUNTING( "GROUP_CAMP_HUNTING" ); static const mongroup_id GROUP_CAMP_HUNTING_LARGE( "GROUP_CAMP_HUNTING_LARGE" ); static const mongroup_id GROUP_CAMP_TRAPPING( "GROUP_CAMP_TRAPPING" ); -static const oter_str_id oter_dirt_road_3way_forest_east( "dirt_road_3way_forest_east" ); -static const oter_str_id oter_dirt_road_3way_forest_north( "dirt_road_3way_forest_north" ); -static const oter_str_id oter_dirt_road_3way_forest_south( "dirt_road_3way_forest_south" ); -static const oter_str_id oter_dirt_road_3way_forest_west( "dirt_road_3way_forest_west" ); -static const oter_str_id oter_dirt_road_forest_east( "dirt_road_forest_east" ); -static const oter_str_id oter_dirt_road_forest_north( "dirt_road_forest_north" ); -static const oter_str_id oter_dirt_road_forest_south( "dirt_road_forest_south" ); -static const oter_str_id oter_dirt_road_forest_west( "dirt_road_forest_west" ); -static const oter_str_id oter_dirt_road_turn_forest_east( "dirt_road_turn_forest_east" ); -static const oter_str_id oter_dirt_road_turn_forest_north( "dirt_road_turn_forest_north" ); -static const oter_str_id oter_dirt_road_turn_forest_south( "dirt_road_turn_forest_south" ); -static const oter_str_id oter_dirt_road_turn_forest_west( "dirt_road_turn_forest_west" ); -static const oter_str_id oter_forest( "forest" ); -static const oter_str_id oter_forest_thick( "forest_thick" ); -static const oter_str_id oter_rural_road_3way_forest_east( "rural_road_3way_forest_east" ); -static const oter_str_id oter_rural_road_3way_forest_north( "rural_road_3way_forest_north" ); -static const oter_str_id oter_rural_road_3way_forest_south( "rural_road_3way_forest_south" ); -static const oter_str_id oter_rural_road_3way_forest_west( "rural_road_3way_forest_west" ); -static const oter_str_id oter_rural_road_forest_east( "rural_road_forest_east" ); -static const oter_str_id oter_rural_road_forest_north( "rural_road_forest_north" ); -static const oter_str_id oter_rural_road_forest_south( "rural_road_forest_south" ); -static const oter_str_id oter_rural_road_forest_west( "rural_road_forest_west" ); -static const oter_str_id oter_rural_road_turn1_forest_east( "rural_road_turn1_forest_east" ); -static const oter_str_id oter_rural_road_turn1_forest_north( "rural_road_turn1_forest_north" ); -static const oter_str_id oter_rural_road_turn1_forest_south( "rural_road_turn1_forest_south" ); -static const oter_str_id oter_rural_road_turn1_forest_west( "rural_road_turn1_forest_west" ); -static const oter_str_id oter_rural_road_turn_forest_east( "rural_road_turn_forest_east" ); -static const oter_str_id oter_rural_road_turn_forest_north( "rural_road_turn_forest_north" ); -static const oter_str_id oter_rural_road_turn_forest_south( "rural_road_turn_forest_south" ); -static const oter_str_id oter_rural_road_turn_forest_west( "rural_road_turn_forest_west" ); -static const oter_str_id oter_special_forest( "special_forest" ); -static const oter_str_id oter_special_forest_thick( "special_forest_thick" ); +static const oter_type_str_id oter_type_field( "field" ); +static const oter_type_str_id oter_type_forest( "forest" ); +static const oter_type_str_id oter_type_forest_thick( "forest_thick" ); +static const oter_type_str_id oter_type_forest_trail( "forest_trail" ); +static const oter_type_str_id oter_type_forest_water( "forest_water" ); +static const oter_type_str_id oter_type_rural_road( "rural_road" ); +static const oter_type_str_id oter_type_rural_road_forest( "rural_road_forest" ); +static const oter_type_str_id oter_type_special_forest( "special_forest" ); +static const oter_type_str_id oter_type_special_forest_thick( "special_forest_thick" ); static const skill_id skill_bashing( "bashing" ); static const skill_id skill_combat( "combat" ); @@ -2517,75 +2494,31 @@ static void change_cleared_terrain( tripoint_abs_omt forest ) { if( om_cutdown_trees_est( forest ) < 5 ) { const oter_id &omt_trees = overmap_buffer.ter( forest ); - const std::string omt_trees_string = static_cast( omt_trees.id() ); - - if( omt_trees_string.find( "dirt_road" ) != std::string::npos ) {} - - if( omt_trees.id() == oter_dirt_road_forest_north ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_north" ) ); - } else if( omt_trees.id() == oter_dirt_road_forest_east ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_east" ) ); - } else if( omt_trees.id() == oter_dirt_road_forest_south ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_south" ) ); - } else if( omt_trees.id() == oter_dirt_road_forest_west ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_west" ) ); - } else if( omt_trees.id() == oter_dirt_road_3way_forest_north ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_3way_north" ) ); - } else if( omt_trees.id() == oter_dirt_road_3way_forest_east ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_3way_east" ) ); - } else if( omt_trees.id() == oter_dirt_road_3way_forest_south ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_3way_south" ) ); - } else if( omt_trees.id() == oter_dirt_road_3way_forest_west ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_3way_west" ) ); - } else if( omt_trees.id() == oter_dirt_road_turn_forest_north ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_turn_north" ) ); - } else if( omt_trees.id() == oter_dirt_road_turn_forest_east ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_turn_east" ) ); - } else if( omt_trees.id() == oter_dirt_road_turn_forest_south ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_turn_south" ) ); - } else if( omt_trees.id() == oter_dirt_road_turn_forest_west ) { - overmap_buffer.ter_set( forest, oter_id( "dirt_road_turn_west" ) ); - } - - else if( omt_trees.id() == oter_forest || omt_trees.id() == oter_forest_thick || - omt_trees.id() == oter_special_forest || omt_trees.id() == oter_special_forest_thick || - omt_trees_string.find( "forest_trail" ) != std::string::npos ) { - overmap_buffer.ter_set( forest, oter_id( "field" ) ); - } else if( omt_trees.id() == oter_rural_road_forest_north ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_north" ) ); - } else if( omt_trees.id() == oter_rural_road_forest_east ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_east" ) ); - } else if( omt_trees.id() == oter_rural_road_forest_south ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_south" ) ); - } else if( omt_trees.id() == oter_rural_road_forest_west ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_west" ) ); - } else if( omt_trees.id() == oter_rural_road_3way_forest_north ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_3way_north" ) ); - } else if( omt_trees.id() == oter_rural_road_3way_forest_east ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_3way_east" ) ); - } else if( omt_trees.id() == oter_rural_road_3way_forest_south ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_3way_south" ) ); - } else if( omt_trees.id() == oter_rural_road_3way_forest_west ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_3way_west" ) ); - } else if( omt_trees.id() == oter_rural_road_turn_forest_north ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_turn_north" ) ); - } else if( omt_trees.id() == oter_rural_road_turn_forest_east ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_turn_east" ) ); - } else if( omt_trees.id() == oter_rural_road_turn_forest_south ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_turn_south" ) ); - } else if( omt_trees.id() == oter_rural_road_turn_forest_west ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_turn_west" ) ); - } else if( omt_trees.id() == oter_rural_road_turn1_forest_north ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_turn1_north" ) ); - } else if( omt_trees.id() == oter_rural_road_turn1_forest_east ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_turn1_east" ) ); - } else if( omt_trees.id() == oter_rural_road_turn1_forest_south ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_turn1_south" ) ); - } else if( omt_trees.id() == oter_rural_road_turn1_forest_west ) { - overmap_buffer.ter_set( forest, oter_id( "rural_road_turn1_west" ) ); - } else { + + // Oter types before and after clear cutting, if value (after) is linear, key (before) should also be linear, otherwise any combination of rotatable/linear/not rotatable should work + const std::unordered_map clear_cut_conversion = { + { oter_type_forest, oter_type_field }, + { oter_type_forest_thick, oter_type_field }, + { oter_type_special_forest, oter_type_field }, + { oter_type_special_forest_thick, oter_type_field }, + { oter_type_forest_trail, oter_type_field }, + { oter_type_rural_road_forest, oter_type_rural_road } + }; + auto converted_it = clear_cut_conversion.find( omt_trees->get_type_id() ); + + if( converted_it == clear_cut_conversion.end() ) { popup( _( "%s isn't a recognized terrain. Please file a bug report." ), omt_trees.id().c_str() ); return; + } else { + const oter_type_str_id &oter_type_clearcut = converted_it->second; + oter_id oter_to_place; + // Maintain rotation + if( oter_type_clearcut->is_linear() ) { + oter_to_place = oter_type_clearcut->get_linear( omt_trees->get_line() ); + } else { + oter_to_place = oter_type_clearcut->get_rotated( omt_trees->get_dir() ); + } + overmap_buffer.ter_set( forest, oter_to_place ); } popup( _( "The logged tile has been cleared and cannot be logged further after this mission." ), omt_trees.id().c_str() ); From 847cffd98b571e9b45cdee7bb8a34fbcadc50704 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Wed, 3 Apr 2024 13:42:38 +0100 Subject: [PATCH 032/158] Update log sources --- src/faction_camp.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/faction_camp.cpp b/src/faction_camp.cpp index 6b3992c1d6026..8d678b6804baa 100644 --- a/src/faction_camp.cpp +++ b/src/faction_camp.cpp @@ -117,7 +117,7 @@ static const oter_type_str_id oter_type_field( "field" ); static const oter_type_str_id oter_type_forest( "forest" ); static const oter_type_str_id oter_type_forest_thick( "forest_thick" ); static const oter_type_str_id oter_type_forest_trail( "forest_trail" ); -static const oter_type_str_id oter_type_forest_water( "forest_water" ); +static const oter_type_str_id oter_type_forest_trail_intersection( "forest_trail_intersection" ); static const oter_type_str_id oter_type_rural_road( "rural_road" ); static const oter_type_str_id oter_type_rural_road_forest( "rural_road_forest" ); static const oter_type_str_id oter_type_special_forest( "special_forest" ); @@ -2499,13 +2499,14 @@ static void change_cleared_terrain( tripoint_abs_omt forest ) const std::unordered_map clear_cut_conversion = { { oter_type_forest, oter_type_field }, { oter_type_forest_thick, oter_type_field }, - { oter_type_special_forest, oter_type_field }, - { oter_type_special_forest_thick, oter_type_field }, { oter_type_forest_trail, oter_type_field }, - { oter_type_rural_road_forest, oter_type_rural_road } + { oter_type_forest_trail_intersection, oter_type_field }, + { oter_type_rural_road_forest, oter_type_rural_road }, + { oter_type_special_forest, oter_type_field }, + { oter_type_special_forest_thick, oter_type_field } }; - auto converted_it = clear_cut_conversion.find( omt_trees->get_type_id() ); + auto converted_it = clear_cut_conversion.find( omt_trees->get_type_id() ); if( converted_it == clear_cut_conversion.end() ) { popup( _( "%s isn't a recognized terrain. Please file a bug report." ), omt_trees.id().c_str() ); return; From f8380ef97ab35b7b6a35938a411c4f9d50925ff5 Mon Sep 17 00:00:00 2001 From: GuardianDll Date: Tue, 10 Dec 2024 18:38:07 +0100 Subject: [PATCH 033/158] replace ARMOR_ and EXTRA_ enchantments with dedicated fields, remove ITEM_ARMOR_ as not used --- data/json/artifact/relic_procgen_data.json | 168 ---------- data/json/effects.json | 27 +- data/json/mutations/mutations.json | 4 +- data/mods/Aftershock/items/item_enchants.json | 6 +- data/mods/Aftershock/player/bionics.json | 3 +- data/mods/Aftershock/spells/enchantments.json | 14 +- .../BombasticPerks/perkdata/bellringer.json | 2 +- data/mods/BombasticPerks/perkdata/empath.json | 10 +- .../Spells/attunements/Crusader.json | 10 +- .../Spells/attunements/Force_Mage.json | 10 +- .../Spells/attunements/Gaias_Chosen.json | 16 +- data/mods/Magiclysm/effects/effects.json | 38 +-- .../Magiclysm/enchantments/Basic_Classes.json | 4 +- .../mods/Magiclysm/items/enchanted_boots.json | 4 +- .../Magiclysm/items/enchanted_bracers.json | 24 +- .../Magiclysm/items/enchanted_clothes.json | 2 +- .../mods/Magiclysm/items/enchanted_rings.json | 42 +-- data/mods/Magiclysm/items/ethereal_items.json | 4 +- data/mods/Magiclysm/items/item_enchants.json | 38 ++- data/mods/Magiclysm/items/obsolete.json | 6 - .../Magiclysm/mutations/debug_mutations.json | 6 +- data/mods/Magiclysm/traits/attunements.json | 25 +- .../effects/effects_monster.json | 38 +-- .../effects/effects_potions.json | 4 +- .../effects/effects_psionic.json | 88 ++---- .../enchantments/enchantments_baneful.json | 13 +- .../enchantments/enchantments_player.json | 32 +- .../mods/MindOverMatter/items/armor/belt.json | 30 +- .../mutations/psi_passives.json | 6 +- data/mods/Xedra_Evolved/effects/effects.json | 107 +++---- .../Xedra_Evolved/enchantments/armor.json | 3 +- .../itemgroups/map_extra_itemgroups.json | 72 ----- .../Xedra_Evolved/items/inventor/armor.json | 10 +- .../Xedra_Evolved/mutations/mutations.json | 10 +- .../paraclesians/ierde_mutation_spells.json | 5 +- .../paraclesians/salamander_mutations.json | 2 +- .../paraclesians/sylph_mutations.json | 9 +- .../paraclesians/undine_mutation_spells.json | 26 +- .../Xedra_Evolved/mutations/temporary.json | 2 +- .../procgen/dreamsmith_procgen.json | 292 ------------------ data/mods/Xedra_Evolved/spells/XAEA.json | 2 +- .../spells/integrated_armor_spells.json | 14 +- doc/MAGIC.md | 77 ++--- src/character.h | 6 - src/character_armor.cpp | 51 +-- src/character_attire.cpp | 30 -- src/creature.h | 1 + src/magic_enchantment.cpp | 266 +++++++++++----- src/magic_enchantment.h | 51 ++- src/melee.cpp | 5 - src/monster.cpp | 34 +- src/monster.h | 2 - 52 files changed, 554 insertions(+), 1197 deletions(-) diff --git a/data/json/artifact/relic_procgen_data.json b/data/json/artifact/relic_procgen_data.json index 91ee1af746fa8..74468b390bf0c 100644 --- a/data/json/artifact/relic_procgen_data.json +++ b/data/json/artifact/relic_procgen_data.json @@ -85,62 +85,6 @@ "increment": 0.2, "power_per_increment": 10 }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_ACID", - "increment": 0.1, - "power_per_increment": -125 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_BASH", - "increment": 0.1, - "power_per_increment": -250 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_CUT", - "increment": 0.1, - "power_per_increment": -250 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_ELEC", - "increment": 0.1, - "power_per_increment": -125 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_HEAT", - "increment": 0.1, - "power_per_increment": -125 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_STAB", - "increment": 0.1, - "power_per_increment": -250 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_BULLET", - "increment": 0.1, - "power_per_increment": -250 - }, { "weight": 50, "min_value": -0.4, @@ -364,62 +308,6 @@ "increment": 0.2, "power_per_increment": 10 }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_ACID", - "increment": 0.1, - "power_per_increment": -125 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_BASH", - "increment": 0.1, - "power_per_increment": -250 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_CUT", - "increment": 0.1, - "power_per_increment": -250 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_ELEC", - "increment": 0.1, - "power_per_increment": -125 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_HEAT", - "increment": 0.1, - "power_per_increment": -125 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_STAB", - "increment": 0.1, - "power_per_increment": -250 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_BULLET", - "increment": 0.1, - "power_per_increment": -250 - }, { "weight": 50, "min_value": -0.4, @@ -647,62 +535,6 @@ "increment": 0.2, "power_per_increment": 10 }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_ACID", - "increment": 0.1, - "power_per_increment": -125 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_BASH", - "increment": 0.1, - "power_per_increment": -250 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_CUT", - "increment": 0.1, - "power_per_increment": -250 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_ELEC", - "increment": 0.1, - "power_per_increment": -125 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_HEAT", - "increment": 0.1, - "power_per_increment": -125 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_STAB", - "increment": 0.1, - "power_per_increment": -250 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_BULLET", - "increment": 0.1, - "power_per_increment": -250 - }, { "weight": 50, "min_value": -0.4, diff --git a/data/json/effects.json b/data/json/effects.json index 67dcbe289b171..f1386b5fa50a2 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -570,13 +570,13 @@ "enchantments": [ { "condition": "ALWAYS", - "values": [ - { "value": "SPEED", "multiply": -0.5 }, - { "value": "ARMOR_BASH", "add": 15 }, - { "value": "ARMOR_STAB", "add": 15 }, - { "value": "ARMOR_CUT", "add": 15 }, - { "value": "ARMOR_BULLET", "add": 50 } - ] + "incoming_damage_mod": [ + { "type": "bash", "add": 15 }, + { "type": "stab", "add": 15 }, + { "type": "cut", "add": 15 }, + { "type": "bullet", "add": 50 } + ], + "values": [ { "value": "SPEED", "multiply": -0.5 } ] } ] }, @@ -591,12 +591,13 @@ "enchantments": [ { "condition": "ALWAYS", - "values": [ - { "value": "SPEED", "multiply": { "math": [ "Nemesis_iteration * 0.01" ] } }, - { "value": "ARMOR_BASH", "add": { "math": [ "Nemesis_iteration * -1" ] } }, - { "value": "ARMOR_STAB", "add": { "math": [ "Nemesis_iteration * -1" ] } }, - { "value": "ARMOR_CUT", "add": { "math": [ "Nemesis_iteration * -1" ] } } - ] + "incoming_damage_mod": [ + { "type": "bash", "add": { "math": [ "Nemesis_iteration * -1" ] } }, + { "type": "stab", "add": { "math": [ "Nemesis_iteration * -1" ] } }, + { "type": "cut", "add": { "math": [ "Nemesis_iteration * -1" ] } }, + { "type": "bullet", "add": { "math": [ "Nemesis_iteration * -1" ] } } + ], + "values": [ { "value": "SPEED", "multiply": { "math": [ "Nemesis_iteration * 0.01" ] } } ] } ] }, diff --git a/data/json/mutations/mutations.json b/data/json/mutations/mutations.json index ede2f6249c9ad..5c29886209e84 100644 --- a/data/json/mutations/mutations.json +++ b/data/json/mutations/mutations.json @@ -2903,8 +2903,8 @@ "enchantments": [ { "condition": "ALWAYS", + "incoming_damage_mod_post_absorbed": [ { "type": "bash", "multiply": 0.4 } ], "values": [ - { "value": "EXTRA_BASH", "multiply": 0.4 }, { "value": "MOVE_COST", "multiply": -0.1 }, { "value": "ATTACK_SPEED", "multiply": -0.1 }, { "value": "CARRY_WEIGHT", "multiply": -0.2 } @@ -7162,8 +7162,8 @@ "category": [ "BIRD", "SLIME", "ELFA" ], "enchantments": [ { + "incoming_damage_mod_post_absorbed": [ { "type": "bash", "multiply": 0.8 } ], "values": [ - { "value": "EXTRA_BASH", "multiply": 0.8 }, { "value": "MOVE_COST", "multiply": -0.2 }, { "value": "ATTACK_SPEED", "multiply": -0.2 }, { "value": "CARRY_WEIGHT", "multiply": -0.4 } diff --git a/data/mods/Aftershock/items/item_enchants.json b/data/mods/Aftershock/items/item_enchants.json index 75498d900a1cd..eb1c88c9d9a7e 100644 --- a/data/mods/Aftershock/items/item_enchants.json +++ b/data/mods/Aftershock/items/item_enchants.json @@ -6,7 +6,7 @@ "condition": "ALWAYS", "name": { "str": "Cold Barrier" }, "description": "Reduces incoming cold damage by 25%.", - "values": [ { "value": "ARMOR_COLD", "multiply": -0.25 } ] + "incoming_damage_mod": [ { "type": "cold", "multiply": -0.25 } ] }, { "type": "enchantment", @@ -56,7 +56,7 @@ "has": "WORN", "condition": "ACTIVE", "name": { "str": "Low Energy Forcefield" }, - "values": [ { "value": "ARMOR_BASH", "add": -25 }, { "value": "ARMOR_CUT", "add": -25 } ], + "incoming_damage_mod": [ { "type": "bash", "add": -25 }, { "type": "cut", "add": -25 } ], "description": "Reduces incoming bash and cut damage by 25." }, { @@ -65,7 +65,7 @@ "has": "WORN", "condition": "ACTIVE", "name": { "str": "High Energy Forcefield" }, - "values": [ { "value": "ARMOR_BULLET", "add": -40 }, { "value": "ARMOR_STAB", "add": -40 } ], + "incoming_damage_mod": [ { "type": "stab", "add": -40 }, { "type": "bullet", "add": -40 } ], "description": "Reduces incoming pierce and bullet damage by 40." }, { diff --git a/data/mods/Aftershock/player/bionics.json b/data/mods/Aftershock/player/bionics.json index fdd04e964bf74..776f325ebd8c0 100644 --- a/data/mods/Aftershock/player/bionics.json +++ b/data/mods/Aftershock/player/bionics.json @@ -179,9 +179,8 @@ "enchantments": [ { "condition": "ACTIVE", + "incoming_damage_mod": [ { "type": "biological", "add": -7 }, { "type": "cold", "add": -5 } ], "values": [ - { "value": "ARMOR_BIO", "add": -7 }, - { "value": "ARMOR_COLD", "add": -5 }, { "value": "PAIN_REMOVE", "add": 45 }, { "value": "METABOLISM", "multiply": 1.5 }, { "value": "REGEN_HP", "multiply": 2 } diff --git a/data/mods/Aftershock/spells/enchantments.json b/data/mods/Aftershock/spells/enchantments.json index d2637716eec10..14f54fc9e5987 100644 --- a/data/mods/Aftershock/spells/enchantments.json +++ b/data/mods/Aftershock/spells/enchantments.json @@ -42,25 +42,25 @@ "type": "enchantment", "id": "protect_cold", "condition": "ACTIVE", - "values": [ { "value": "ARMOR_COLD", "add": -15 } ] + "incoming_damage_mod": [ { "type": "cold", "add": -15 } ] }, { "type": "enchantment", "id": "forcefield_bash_cut_weak", "condition": "ACTIVE", - "values": [ { "value": "ARMOR_BASH", "add": -5 }, { "value": "ARMOR_CUT", "add": -5 } ] + "incoming_damage_mod": [ { "type": "bash", "add": -5 }, { "type": "cut", "add": -5 } ] }, { "type": "enchantment", "id": "forcefield_bash_cut_medium", "condition": "ACTIVE", - "values": [ { "value": "ARMOR_BASH", "add": -15 }, { "value": "ARMOR_CUT", "add": -15 } ] + "incoming_damage_mod": [ { "type": "bash", "add": -15 }, { "type": "cut", "add": -15 } ] }, { "type": "enchantment", "id": "forcefield_bash_cut_heavy", "condition": "ACTIVE", - "values": [ { "value": "ARMOR_BASH", "add": -25 }, { "value": "ARMOR_CUT", "add": -25 } ] + "incoming_damage_mod": [ { "type": "bash", "add": -25 }, { "type": "cut", "add": -25 } ] }, { "type": "enchantment", @@ -74,7 +74,7 @@ "npc_message": "%1$s's shield goes off with a flash of light and sound." } ], - "values": [ { "value": "ARMOR_BULLET", "add": -10 }, { "value": "ARMOR_STAB", "add": -10 } ] + "incoming_damage_mod": [ { "type": "stab", "add": -10 }, { "type": "bullet", "add": -10 } ] }, { "type": "enchantment", @@ -88,13 +88,13 @@ "npc_message": "%1$s's shield goes off with an arc of electricity." } ], - "values": [ { "value": "ARMOR_BULLET", "add": -20 }, { "value": "ARMOR_STAB", "add": -20 } ] + "incoming_damage_mod": [ { "type": "stab", "add": -20 }, { "type": "bullet", "add": -20 } ] }, { "type": "enchantment", "id": "forcefield_ballistic_piercing_heavy", "condition": "ACTIVE", "intermittent_activation": { "effects": [ { "frequency": "1 hour", "spell_effects": [ { "id": "radiation_field" } ] } ] }, - "values": [ { "value": "ARMOR_BULLET", "add": -40 }, { "value": "ARMOR_STAB", "add": -40 } ] + "incoming_damage_mod": [ { "type": "stab", "add": -40 }, { "type": "bullet", "add": -40 } ] } ] diff --git a/data/mods/BombasticPerks/perkdata/bellringer.json b/data/mods/BombasticPerks/perkdata/bellringer.json index 25b79e5770a8c..4922472d4ef46 100644 --- a/data/mods/BombasticPerks/perkdata/bellringer.json +++ b/data/mods/BombasticPerks/perkdata/bellringer.json @@ -27,6 +27,6 @@ "apply_message": "", "rating": "bad", "max_duration": "1 s", - "enchantments": [ { "values": [ { "value": "ARMOR_BASH", "multiply": -0.33 } ] } ] + "incoming_damage_mod": [ { "type": "bash", "multiply": -0.33 } ] } ] diff --git a/data/mods/BombasticPerks/perkdata/empath.json b/data/mods/BombasticPerks/perkdata/empath.json index 9d248a960df72..0665f25b987cf 100644 --- a/data/mods/BombasticPerks/perkdata/empath.json +++ b/data/mods/BombasticPerks/perkdata/empath.json @@ -141,11 +141,11 @@ "enchantments": [ { "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_BASH", "add": -8.0 }, - { "value": "ARMOR_CUT", "add": -8.0 }, - { "value": "ARMOR_BULLET", "add": -8.0 }, - { "value": "ARMOR_ACID", "multiply": 0.0 } + "incoming_damage_mod": [ + { "type": "acid", "multiply": -1 }, + { "type": "bash", "add": -8 }, + { "type": "cut", "add": -8 }, + { "type": "bullet", "add": -8 } ] } ] diff --git a/data/mods/Magiclysm/Spells/attunements/Crusader.json b/data/mods/Magiclysm/Spells/attunements/Crusader.json index 0cdd3aeee79d3..ac545159195e9 100644 --- a/data/mods/Magiclysm/Spells/attunements/Crusader.json +++ b/data/mods/Magiclysm/Spells/attunements/Crusader.json @@ -37,11 +37,11 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_CUT", "add": -6 }, - { "value": "ARMOR_BASH", "add": -6 }, - { "value": "ARMOR_STAB", "add": -6 }, - { "value": "ARMOR_BULLET", "add": -3 } + "incoming_damage_mod": [ + { "type": "bash", "add": -6 }, + { "type": "stab", "add": -6 }, + { "type": "cut", "add": -6 }, + { "type": "bullet", "add": -3 } ] } ] diff --git a/data/mods/Magiclysm/Spells/attunements/Force_Mage.json b/data/mods/Magiclysm/Spells/attunements/Force_Mage.json index f7e74e2e99449..16eb0b00a7b21 100644 --- a/data/mods/Magiclysm/Spells/attunements/Force_Mage.json +++ b/data/mods/Magiclysm/Spells/attunements/Force_Mage.json @@ -42,11 +42,11 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_BASH", "multiply": -0.3 }, - { "value": "ARMOR_CUT", "multiply": -0.3 }, - { "value": "ARMOR_STAB", "multiply": -0.3 }, - { "value": "ARMOR_BULLET", "multiply": -0.3 } + "incoming_damage_mod": [ + { "type": "bash", "multiply": -0.3 }, + { "type": "stab", "multiply": -0.3 }, + { "type": "cut", "multiply": -0.3 }, + { "type": "bullet", "multiply": -0.3 } ] } ] diff --git a/data/mods/Magiclysm/Spells/attunements/Gaias_Chosen.json b/data/mods/Magiclysm/Spells/attunements/Gaias_Chosen.json index 5116bca226a13..d61f4f004c03b 100644 --- a/data/mods/Magiclysm/Spells/attunements/Gaias_Chosen.json +++ b/data/mods/Magiclysm/Spells/attunements/Gaias_Chosen.json @@ -65,20 +65,6 @@ "name": [ "Terra Armor" ], "desc": [ "Your body is covered in dense, ethereal shell, that protect you." ], "remove_message": "Your lost your terra shell.", - "enchantments": [ - { - "values": [ - { "value": "ARMOR_ACID", "add": { "math": [ "u_spell_level('terra_armor') * -3" ] } }, - { "value": "ARMOR_BASH", "add": { "math": [ "u_spell_level('terra_armor') * -3" ] } }, - { "value": "ARMOR_BIO", "add": { "math": [ "u_spell_level('terra_armor') * -3" ] } }, - { "value": "ARMOR_BULLET", "add": { "math": [ "u_spell_level('terra_armor') * -3" ] } }, - { "value": "ARMOR_COLD", "add": { "math": [ "u_spell_level('terra_armor') * -3" ] } }, - { "value": "ARMOR_CUT", "add": { "math": [ "u_spell_level('terra_armor') * -3" ] } }, - { "value": "ARMOR_ELEC", "add": { "math": [ "u_spell_level('terra_armor') * -3" ] } }, - { "value": "ARMOR_HEAT", "add": { "math": [ "u_spell_level('terra_armor') * -3" ] } }, - { "value": "ARMOR_STAB", "add": { "math": [ "u_spell_level('terra_armor') * -3" ] } } - ] - } - ] + "enchantments": [ { "values": [ { "value": "ARMOR_ALL", "add": { "math": [ "u_spell_level('terra_armor') * -3" ] } } ] } ] } ] diff --git a/data/mods/Magiclysm/effects/effects.json b/data/mods/Magiclysm/effects/effects.json index 9ebae7ee90fc1..1e0e9bf3bde98 100644 --- a/data/mods/Magiclysm/effects/effects.json +++ b/data/mods/Magiclysm/effects/effects.json @@ -250,7 +250,7 @@ "remove_message": "The tingling fades.", "enchantments": [ { - "values": [ { "value": "ARMOR_ACID", "multiply": { "math": [ "((u_spell_level('acid_resistance') * -0.02) - 0.2)" ] } } ] + "incoming_damage_mod": [ { "type": "acid", "multiply": { "math": [ "((u_spell_level('acid_resistance') * -0.02) - 0.2)" ] } } ] } ] }, @@ -261,7 +261,7 @@ "desc": [ "You are greatly protected from acid damage." ], "apply_message": "Your body tingles.", "remove_message": "The tingling fades.", - "enchantments": [ { "values": [ { "value": "ARMOR_ACID", "multiply": -0.75 } ] } ] + "enchantments": [ { "incoming_damage_mod": [ { "type": "acid", "multiply": -0.75 } ] } ] }, { "type": "effect_type", @@ -740,7 +740,7 @@ "remove_message": "Sparks under your skin vanish.", "rating": "good", "show_intensity": false, - "enchantments": [ { "values": [ { "value": "ARMOR_ELEC", "add": -35 } ] } ] + "enchantments": [ { "incoming_damage_mod": [ { "type": "electric", "add": -35 } ] } ] }, { "type": "effect_type", @@ -822,7 +822,7 @@ "show_intensity": false, "enchantments": [ { - "values": [ { "value": "ARMOR_BASH", "add": -10 }, { "value": "ARMOR_CUT", "add": -10 }, { "value": "ARMOR_STAB", "add": -10 } ] + "incoming_damage_mod": [ { "type": "bash", "add": -10 }, { "type": "stab", "add": -10 }, { "type": "cut", "add": -10 } ] } ] }, @@ -1016,10 +1016,8 @@ "enchantments": [ { "emitter": "emit_kelvinist_anti_cold", - "values": [ - { "value": "CLIMATE_CONTROL_HEAT", "add": 50 }, - { "value": "ARMOR_COLD", "add": { "math": [ "( u_spell_level('kelvinist_anti_cold') * -1)" ] } } - ] + "incoming_damage_mod": [ { "type": "cold", "add": { "math": [ "( u_spell_level('kelvinist_anti_cold') * -1)" ] } } ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 50 } ] } ] }, @@ -1035,10 +1033,8 @@ "enchantments": [ { "emitter": "emit_kelvinist_anti_heat", - "values": [ - { "value": "CLIMATE_CONTROL_CHILL", "add": 50 }, - { "value": "ARMOR_HEAT", "add": { "math": [ "( u_spell_level('kelvinist_anti_heat') * -1)" ] } } - ] + "incoming_damage_mod": [ { "type": "heat", "add": { "math": [ "( u_spell_level('kelvinist_anti_heat') * -1)" ] } } ], + "values": [ { "value": "CLIMATE_CONTROL_CHILL", "add": 50 } ] } ] }, @@ -1353,7 +1349,7 @@ "show_in_info": true, "blocks_effects": [ "blisters" ], "removes_effects": [ "onfire" ], - "enchantments": [ { "values": [ { "value": "ARMOR_HEAT", "multiply": -1 } ] } ], + "enchantments": [ { "incoming_damage_mod": [ { "type": "heat", "multiply": -1 } ] } ], "flags": [ "HEAT_IMMUME" ] }, { @@ -1827,21 +1823,7 @@ "rating": "good", "show_intensity": false, "show_in_info": false, - "enchantments": [ - { - "values": [ - { "value": "ARMOR_BASH", "add": -20 }, - { "value": "ARMOR_CUT", "add": -20 }, - { "value": "ARMOR_STAB", "add": -20 }, - { "value": "ARMOR_BULLET", "add": -20 }, - { "value": "ARMOR_HEAT", "add": -20 }, - { "value": "ARMOR_COLD", "add": -20 }, - { "value": "ARMOR_ELEC", "add": -20 }, - { "value": "ARMOR_ACID", "add": -20 }, - { "value": "ARMOR_BIO", "add": -20 } - ] - } - ] + "enchantments": [ { "values": [ { "value": "ARMOR_ALL", "add": -20 } ] } ] }, { "id": "sun_mage_buff", diff --git a/data/mods/Magiclysm/enchantments/Basic_Classes.json b/data/mods/Magiclysm/enchantments/Basic_Classes.json index cc99974721be6..86cbf92367a2d 100644 --- a/data/mods/Magiclysm/enchantments/Basic_Classes.json +++ b/data/mods/Magiclysm/enchantments/Basic_Classes.json @@ -2,11 +2,11 @@ { "type": "enchantment", "id": "KELVINIST", - "values": [ { "value": "ARMOR_HEAT", "add": { "math": [ "u_school_level('KELVINIST') / -6" ] } } ] + "incoming_damage_mod": [ { "type": "heat", "add": { "math": [ "u_school_level('KELVINIST') / -6" ] } } ] }, { "type": "enchantment", "id": "STORMSHAPER", - "values": [ { "value": "ARMOR_ELEC", "add": { "math": [ "u_school_level('STORMSHAPER') / -6" ] } } ] + "incoming_damage_mod": [ { "type": "electric", "add": { "math": [ "u_school_level('STORMSHAPER') / -6" ] } } ] } ] diff --git a/data/mods/Magiclysm/items/enchanted_boots.json b/data/mods/Magiclysm/items/enchanted_boots.json index 4b54f6c90a417..76fe8420b1d00 100644 --- a/data/mods/Magiclysm/items/enchanted_boots.json +++ b/data/mods/Magiclysm/items/enchanted_boots.json @@ -187,7 +187,9 @@ "material_thickness": 3, "environmental_protection": 3, "flags": [ "WATERPROOF", "STURDY" ], - "relic_data": { "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "ARMOR_ELEC", "add": -20 } ] } ] }, + "relic_data": { + "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "incoming_damage_mod": [ { "type": "electric", "add": -20 } ] } ] + }, "material": [ "leather" ], "armor": [ { diff --git a/data/mods/Magiclysm/items/enchanted_bracers.json b/data/mods/Magiclysm/items/enchanted_bracers.json index c0a1cbc6310b0..42471ab86eec7 100644 --- a/data/mods/Magiclysm/items/enchanted_bracers.json +++ b/data/mods/Magiclysm/items/enchanted_bracers.json @@ -40,11 +40,11 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_CUT", "add": -2 }, - { "value": "ARMOR_BASH", "add": -2 }, - { "value": "ARMOR_STAB", "add": -2 }, - { "value": "ARMOR_BULLET", "add": -1 } + "incoming_damage_mod": [ + { "type": "bash", "add": -2 }, + { "type": "stab", "add": -2 }, + { "type": "cut", "add": -2 }, + { "type": "bullet", "add": -1 } ] } ] @@ -64,11 +64,11 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_CUT", "add": -4 }, - { "value": "ARMOR_BASH", "add": -4 }, - { "value": "ARMOR_STAB", "add": -4 }, - { "value": "ARMOR_BULLET", "add": -2 } + "incoming_damage_mod": [ + { "type": "bash", "add": -4 }, + { "type": "stab", "add": -4 }, + { "type": "cut", "add": -4 }, + { "type": "bullet", "add": -2 } ] } ] @@ -86,7 +86,7 @@ "flags": [ "BELTED", "STURDY", "BLOCK_WHILE_WORN", "NO_UNLOAD", "NO_RELOAD" ], "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "24 h", "regenerate_ammo": true }, - "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "ARMOR_ELEC", "add": -5 } ] } ] + "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "incoming_damage_mod": [ { "type": "electric", "add": -5 } ] } ] }, "use_action": { "type": "cast_spell", "spell_id": "jolt", "no_fail": true, "level": 15, "need_worn": true } }, @@ -102,7 +102,7 @@ "flags": [ "BELTED", "STURDY", "BLOCK_WHILE_WORN", "NO_UNLOAD", "NO_RELOAD" ], "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "24 h", "regenerate_ammo": true }, - "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "ARMOR_ELEC", "add": -10 } ] } ] + "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "incoming_damage_mod": [ { "type": "electric", "add": -10 } ] } ] }, "use_action": { "type": "cast_spell", "spell_id": "lightning_bolt", "no_fail": true, "level": 15, "need_worn": true } }, diff --git a/data/mods/Magiclysm/items/enchanted_clothes.json b/data/mods/Magiclysm/items/enchanted_clothes.json index 4885672885a53..96f6d55ac1bbe 100644 --- a/data/mods/Magiclysm/items/enchanted_clothes.json +++ b/data/mods/Magiclysm/items/enchanted_clothes.json @@ -48,7 +48,7 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ { "value": "ARMOR_BULLET", "add": -8 }, { "value": "ARMOR_STAB", "add": -3 }, { "value": "ARMOR_CUT", "add": -3 } ] + "incoming_damage_mod": [ { "type": "stab", "add": -3 }, { "type": "cut", "add": -3 }, { "type": "bullet", "add": -8 } ] } ] } diff --git a/data/mods/Magiclysm/items/enchanted_rings.json b/data/mods/Magiclysm/items/enchanted_rings.json index d4a5e27deefde..d3c175c351c7e 100644 --- a/data/mods/Magiclysm/items/enchanted_rings.json +++ b/data/mods/Magiclysm/items/enchanted_rings.json @@ -362,11 +362,11 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_CUT", "add": -2 }, - { "value": "ARMOR_BASH", "add": -2 }, - { "value": "ARMOR_STAB", "add": -2 }, - { "value": "ARMOR_BULLET", "add": -1 } + "incoming_damage_mod": [ + { "type": "bash", "add": -2 }, + { "type": "stab", "add": -2 }, + { "type": "cut", "add": -2 }, + { "type": "bullet", "add": -1 } ] } ] @@ -384,11 +384,11 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_CUT", "add": -4 }, - { "value": "ARMOR_BASH", "add": -4 }, - { "value": "ARMOR_STAB", "add": -4 }, - { "value": "ARMOR_BULLET", "add": -2 } + "incoming_damage_mod": [ + { "type": "bash", "add": -4 }, + { "type": "stab", "add": -4 }, + { "type": "cut", "add": -4 }, + { "type": "bullet", "add": -2 } ] } ] @@ -406,11 +406,11 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_CUT", "add": -6 }, - { "value": "ARMOR_BASH", "add": -6 }, - { "value": "ARMOR_STAB", "add": -6 }, - { "value": "ARMOR_BULLET", "add": -3 } + "incoming_damage_mod": [ + { "type": "bash", "add": -6 }, + { "type": "stab", "add": -6 }, + { "type": "cut", "add": -6 }, + { "type": "bullet", "add": -3 } ] } ] @@ -428,11 +428,11 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_CUT", "add": -8 }, - { "value": "ARMOR_BASH", "add": -8 }, - { "value": "ARMOR_STAB", "add": -8 }, - { "value": "ARMOR_BULLET", "add": -4 } + "incoming_damage_mod": [ + { "type": "bash", "add": -8 }, + { "type": "stab", "add": -8 }, + { "type": "cut", "add": -8 }, + { "type": "bullet", "add": -4 } ] } ] @@ -499,7 +499,7 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ { "value": "ARMOR_HEAT", "multiply": -0.5 } ], + "incoming_damage_mod": [ { "type": "heat", "multiply": -0.5 } ], "ench_effects": [ { "effect": "effect_mring_fire_protection", "intensity": 1 } ] } ] diff --git a/data/mods/Magiclysm/items/ethereal_items.json b/data/mods/Magiclysm/items/ethereal_items.json index 5b5f32a18c84b..3a5a55a36621c 100644 --- a/data/mods/Magiclysm/items/ethereal_items.json +++ b/data/mods/Magiclysm/items/ethereal_items.json @@ -1472,11 +1472,11 @@ "condition": "ALWAYS", "hit_me_effect": [ { "id": "druid_thorn_skin_attacked", "hit_self": false, "once_in": 2 } ], "melee_damage_bonus": [ { "type": "stab", "add": 3 } ], + "incoming_damage_mod": [ { "type": "heat", "multiply": 0.6 } ], "values": [ { "value": "DEXTERITY", "add": -1 }, { "value": "STRENGTH", "add": 1 }, - { "value": "CLIMATE_CONTROL_HEAT", "add": 20 }, - { "value": "ARMOR_HEAT", "multiply": 0.6 } + { "value": "CLIMATE_CONTROL_HEAT", "add": 20 } ] } ] diff --git a/data/mods/Magiclysm/items/item_enchants.json b/data/mods/Magiclysm/items/item_enchants.json index e1b6f0c5ec830..315fe3e8c6098 100644 --- a/data/mods/Magiclysm/items/item_enchants.json +++ b/data/mods/Magiclysm/items/item_enchants.json @@ -26,31 +26,33 @@ "condition": "ALWAYS", "name": { "str": "Magic armor" }, "description": "This magical armor improves with your intelligence and the spell's level.", - "values": [ + "incoming_damage_mod": [ { - "value": "ARMOR_BASH", + "type": "bash", "add": { "math": [ "((u_val('intelligence') * 1.5) + (u_spell_level('spirit_armor') + u_spell_level('spirit_armor_plus')) * 0.5) * -1" ] } }, { - "value": "ARMOR_CUT", + "type": "stab", "add": { "math": [ "((u_val('intelligence') * 1.5) + (u_spell_level('spirit_armor') + u_spell_level('spirit_armor_plus')) * 0.5) * -1" ] } }, { - "value": "ARMOR_STAB", + "type": "cut", "add": { "math": [ "((u_val('intelligence') * 1.5) + (u_spell_level('spirit_armor') + u_spell_level('spirit_armor_plus')) * 0.5) * -1" ] } }, { - "value": "ARMOR_BULLET", + "type": "bullet", "add": { "math": [ "((u_val('intelligence') * 1.5) + (u_spell_level('spirit_armor') + u_spell_level('spirit_armor_plus')) * 0.5) * -1" ] } - }, + } + ], + "values": [ { "value": "LUMINATION", "add": { @@ -95,9 +97,9 @@ "name": { "str": "Caustic Aura" }, "description": "A thin shell of acid hangs in the air around you.", "hit_me_effect": [ { "id": "corrosive_aura_spell" } ], - "values": [ + "incoming_damage_mod": [ { - "value": "ARMOR_ACID", + "type": "acid", "add": { "math": [ "(-2 - (0.5 * u_spell_level('biomancer_caustic_aura')) - (0.5 * u_spell_level('biomancer_caustic_aura_plus')))" ] } @@ -169,16 +171,18 @@ "name": { "str": "Luck Bone" }, "//": "relic_data is set when the item is created and then never changes, so each luck-bone should have random minor effects. All deliberately picked so they can't be seen on the character sheet", "description": "The spirits within are giving you their blessing.", + "incoming_damage_mod": [ + { "type": "bash", "add": { "math": [ "rand(3) * -1" ] } }, + { "type": "cut", "add": { "math": [ "rand(3) * -1" ] } }, + { "type": "stab", "add": { "math": [ "rand(3) * -1" ] } }, + { "type": "bullet", "add": { "math": [ "rand(3) * -1" ] } }, + { "type": "acid", "add": { "math": [ "rand(3) * -1" ] } }, + { "type": "electric", "add": { "math": [ "rand(3) * -1" ] } }, + { "type": "heat", "add": { "math": [ "rand(3) * -1" ] } }, + { "type": "cold", "add": { "math": [ "rand(3) * -1" ] } }, + { "type": "biological", "add": { "math": [ "rand(3) * -1" ] } } + ], "values": [ - { "value": "ARMOR_ACID", "add": { "math": [ "rand(3) * -1" ] } }, - { "value": "ARMOR_BASH", "add": { "math": [ "rand(3) * -1" ] } }, - { "value": "ARMOR_BIO", "add": { "math": [ "rand(3) * -1" ] } }, - { "value": "ARMOR_BULLET", "add": { "math": [ "rand(3) * -1" ] } }, - { "value": "ARMOR_COLD", "add": { "math": [ "rand(3) * -1" ] } }, - { "value": "ARMOR_CUT", "add": { "math": [ "rand(3) * -1" ] } }, - { "value": "ARMOR_ELEC", "add": { "math": [ "rand(3) * -1" ] } }, - { "value": "ARMOR_HEAT", "add": { "math": [ "rand(3) * -1" ] } }, - { "value": "ARMOR_STAB", "add": { "math": [ "rand(3) * -1" ] } }, { "value": "FORCEFIELD", "add": { "math": [ "rand(5) * 0.01" ] } }, { "value": "EVASION", "add": { "math": [ "rand(5) * 0.01" ] } }, { "value": "LEARNING_FOCUS", "add": { "math": [ "rand(5)" ] } }, diff --git a/data/mods/Magiclysm/items/obsolete.json b/data/mods/Magiclysm/items/obsolete.json index d3a90688d23b8..c080dcf18dad3 100644 --- a/data/mods/Magiclysm/items/obsolete.json +++ b/data/mods/Magiclysm/items/obsolete.json @@ -113,9 +113,6 @@ "UNBREAKABLE", "ALLOWS_NATURAL_ATTACKS" ], - "relic_data": { - "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "ARMOR_ACID", "multiply": -0.25 } ] } ] - }, "armor": [ { "encumbrance": 0, @@ -146,9 +143,6 @@ "UNBREAKABLE", "ALLOWS_NATURAL_ATTACKS" ], - "relic_data": { - "passive_effects": [ { "has": "WORN", "condition": "ALWAYS", "values": [ { "value": "ARMOR_ACID", "multiply": -0.6 } ] } ] - }, "armor": [ { "encumbrance": 0, diff --git a/data/mods/Magiclysm/mutations/debug_mutations.json b/data/mods/Magiclysm/mutations/debug_mutations.json index f11a45d569b70..10819831da2a9 100644 --- a/data/mods/Magiclysm/mutations/debug_mutations.json +++ b/data/mods/Magiclysm/mutations/debug_mutations.json @@ -9,7 +9,11 @@ "description": { "str": "To cast bug killing spells.", "//~": "NO_I18N" }, "debug": false, "enchantments": [ - { "condition": "ALWAYS", "values": [ { "value": "ARMOR_BULLET", "add": -100 }, { "value": "PERCEPTION", "add": 15 } ] } + { + "condition": "ALWAYS", + "incoming_damage_mod": [ { "type": "bullet", "add": -100 } ], + "values": [ { "value": "PERCEPTION", "add": 15 } ] + } ] }, { diff --git a/data/mods/Magiclysm/traits/attunements.json b/data/mods/Magiclysm/traits/attunements.json index a92a54722fe38..02bd7c08abc6a 100644 --- a/data/mods/Magiclysm/traits/attunements.json +++ b/data/mods/Magiclysm/traits/attunements.json @@ -306,8 +306,8 @@ "spells_learned": [ [ "quake", 5 ], [ "rock_blast", 5 ] ], "enchantments": [ { + "incoming_damage_mod": [ { "type": "cut", "add": -15 } ], "values": [ - { "value": "ARMOR_CUT", "add": -15 }, { "value": "STRENGTH", "add": 5 }, { "value": "MAX_STAMINA", "multiply": 3 }, { "value": "REGEN_STAMINA", "multiply": 3 } @@ -353,11 +353,8 @@ "description": "You have used your expertise in Biomancy to change your body more toward your affinity for fire as a Kelvinist. Fire doesn't bother you as much anymore, and your blood is flammable when it touches the air, resulting in a gout of flame when something hurts you. You are also starting to study more spells that focus on using your own body's affinity for fire.\n\nSalamander: Your Fire Elemental abilities grant you good resistance to temperature conditions and heat damage. Also, your body emits streams of blistering heat towards anyone who attacks you.", "enchantments": [ { - "values": [ - { "value": "ARMOR_HEAT", "multiply": -0.4 }, - { "value": "CLIMATE_CONTROL_HEAT", "add": 30 }, - { "value": "CLIMATE_CONTROL_CHILL", "add": 10 } - ] + "incoming_damage_mod": [ { "type": "heat", "multiply": -0.4 } ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 30 }, { "value": "CLIMATE_CONTROL_CHILL", "add": 10 } ] }, { "hit_me_effect": [ @@ -682,11 +679,8 @@ "enchantments": [ { "melee_damage_bonus": [ { "type": "cold", "add": 9 } ], - "values": [ - { "value": "ARMOR_COLD", "multiply": -0.4 }, - { "value": "CLIMATE_CONTROL_HEAT", "add": 10 }, - { "value": "CLIMATE_CONTROL_CHILL", "add": 30 } - ] + "incoming_damage_mod": [ { "type": "cold", "multiply": -0.4 } ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 10 }, { "value": "CLIMATE_CONTROL_CHILL", "add": 30 } ] }, { "hit_you_effect": [ @@ -780,7 +774,7 @@ "purifiable": false, "valid": false, "description": "This attunement grants you a magical control over the forces of magnetism.\n\nPower: Your Magnetism Mage abilities grant you a good defense against firearms, perfect electric immunity, and the ability to see electric creatures from any distance.", - "enchantments": [ "ELECTRIC_VISION", { "values": [ { "value": "ARMOR_BULLET", "add": -50 } ] } ], + "enchantments": [ "ELECTRIC_VISION", { "incoming_damage_mod": [ { "type": "bullet", "add": -50 } ] } ], "prereqs": [ "STORMSHAPER", "EARTHSHAPER" ], "spells_learned": [ [ "railgun", 5 ], [ "magnetismmage_electrolaser", 5 ], [ "robot_disabler_explosion", 5 ] ], "cancels": [ @@ -1040,7 +1034,7 @@ "description": "You've used your knowledge of Biomancy to change your body into a form befitting a Stormshaper. You can better withstand the power of electricity, and sparks leap from your skin when something hits you. You're beginning to study spells that utilize your body's affinity for the electric.\n\nCyclone: Your Storm Elemental abilities grant you total electric immunity, and reflective zippers to anyone who tries to attack you.", "prereqs": [ "STORMSHAPER", "BIOMANCER" ], "enchantments": [ - { "values": [ { "value": "ARMOR_ELEC", "multiply": -0.4 } ] }, + { "incoming_damage_mod": [ { "type": "electric", "multiply": -0.4 } ] }, { "hit_me_effect": [ { @@ -1282,7 +1276,10 @@ "spells_learned": [ [ "lava_bomb_main", 5 ], [ "vulcanist_pyroclastic_flow", 5 ] ], "prereqs": [ "EARTHSHAPER", "KELVINIST" ], "enchantments": [ - { "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 30 }, { "value": "ARMOR_HEAT", "multiply": -1.0 } ] }, + { + "incoming_damage_mod": [ { "type": "heat", "multiply": -1 } ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 30 } ] + }, { "ench_effects": [ { "effect": "effect_vulcanist_no_smoke_or_blisters", "intensity": 1 } ] } ], "cancels": [ diff --git a/data/mods/MindOverMatter/effects/effects_monster.json b/data/mods/MindOverMatter/effects/effects_monster.json index 19415d3e02007..a3a61128b8890 100644 --- a/data/mods/MindOverMatter/effects/effects_monster.json +++ b/data/mods/MindOverMatter/effects/effects_monster.json @@ -103,7 +103,7 @@ "show_in_info": true, "enchantments": [ { - "values": [ { "value": "ARMOR_CUT", "add": -6 }, { "value": "ARMOR_BASH", "add": -9 }, { "value": "ARMOR_STAB", "add": -4 } ] + "incoming_damage_mod": [ { "type": "bash", "add": -9 }, { "type": "stab", "add": -4 }, { "type": "cut", "add": -6 } ] } ] }, @@ -223,7 +223,7 @@ "id": "effect_monster_pyrokinetic_fire_immunity", "name": [ "Flame Immunity" ], "desc": [ "You are immune to fire." ], - "enchantments": [ { "values": [ { "value": "ARMOR_HEAT", "multiply": -1 } ] } ] + "enchantments": [ { "incoming_damage_mod": [ { "type": "heat", "multiply": -1 } ] } ] }, { "type": "effect_type", @@ -233,13 +233,13 @@ "show_in_info": true, "enchantments": [ { - "values": [ - { "value": "ARMOR_CUT", "multiply": -0.1 }, - { "value": "ARMOR_BASH", "multiply": -0.1 }, - { "value": "ARMOR_STAB", "multiply": -0.1 }, - { "value": "ARMOR_BULLET", "multiply": -0.1 }, - { "value": "SPEED", "multiply": 0.03 } - ] + "incoming_damage_mod": [ + { "type": "bash", "multiply": -0.1 }, + { "type": "stab", "multiply": -0.1 }, + { "type": "cut", "multiply": -0.1 }, + { "type": "bullet", "multiply": -0.1 } + ], + "values": [ { "value": "SPEED", "multiply": 0.03 } ] } ] }, @@ -252,11 +252,11 @@ "flags": [ "TELEKIN_SHIELD" ], "enchantments": [ { - "values": [ - { "value": "ARMOR_CUT", "add": -15 }, - { "value": "ARMOR_BASH", "add": -10 }, - { "value": "ARMOR_STAB", "add": -20 }, - { "value": "ARMOR_BULLET", "add": -35 } + "incoming_damage_mod": [ + { "type": "bash", "add": -10 }, + { "type": "stab", "add": -20 }, + { "type": "cut", "add": -15 }, + { "type": "bullet", "add": -35 } ] } ] @@ -270,11 +270,11 @@ "flags": [ "TELEKIN_SHIELD" ], "enchantments": [ { - "values": [ - { "value": "ARMOR_CUT", "add": -25 }, - { "value": "ARMOR_BASH", "add": -18 }, - { "value": "ARMOR_STAB", "add": -32 }, - { "value": "ARMOR_BULLET", "add": -50 } + "incoming_damage_mod": [ + { "type": "bash", "add": -18 }, + { "type": "stab", "add": -32 }, + { "type": "cut", "add": -25 }, + { "type": "bullet", "add": -50 } ] } ] diff --git a/data/mods/MindOverMatter/effects/effects_potions.json b/data/mods/MindOverMatter/effects/effects_potions.json index ee13166685848..3a0b8bc3de456 100644 --- a/data/mods/MindOverMatter/effects/effects_potions.json +++ b/data/mods/MindOverMatter/effects/effects_potions.json @@ -43,7 +43,7 @@ "flags": [ "BLEED_IMMUNE", "STEADY" ], "enchantments": [ { - "values": [ { "value": "ARMOR_CUT", "add": -4 }, { "value": "ARMOR_BASH", "add": -6 }, { "value": "ARMOR_STAB", "add": -3 } ] + "incoming_damage_mod": [ { "type": "bash", "add": -6 }, { "type": "stab", "add": -3 }, { "type": "cut", "add": -4 } ] } ] }, @@ -66,7 +66,7 @@ "pain_max_val": [ 10 ], "pain_tick": [ 200 ] }, - "enchantments": [ { "values": [ { "value": "ARMOR_BASH", "add": 4 } ] } ] + "enchantments": [ { "incoming_damage_mod": [ { "type": "bash", "add": 4 } ] } ] }, { "type": "effect_type", diff --git a/data/mods/MindOverMatter/effects/effects_psionic.json b/data/mods/MindOverMatter/effects/effects_psionic.json index 087eb662ddd69..26a36d4435b6d 100644 --- a/data/mods/MindOverMatter/effects/effects_psionic.json +++ b/data/mods/MindOverMatter/effects/effects_psionic.json @@ -240,19 +240,21 @@ "blocks_effects": [ "bleed", "hypovolemia", "dermatik" ], "enchantments": [ { - "values": [ - { - "value": "ARMOR_CUT", - "add": { "math": [ "( -4 * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" ] } - }, + "incoming_damage_mod": [ { - "value": "ARMOR_BASH", + "type": "bash", "add": { "math": [ "( -6 * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" ] } }, { - "value": "ARMOR_STAB", + "type": "stab", "add": { "math": [ "( -3 * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" ] } }, + { + "type": "cut", + "add": { "math": [ "( -4 * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" ] } + } + ], + "values": [ { "value": "PAIN", "multiply": { @@ -671,31 +673,7 @@ { "values": [ { - "value": "ARMOR_CUT", - "add": { "math": [ "( ( u_discern_weakness_clear_power_level * 1.5) + 2) * u_discern_weakness_clear_intelligence" ] } - }, - { - "value": "ARMOR_BASH", - "add": { "math": [ "( ( u_discern_weakness_clear_power_level * 1.5) + 2) * u_discern_weakness_clear_intelligence" ] } - }, - { - "value": "ARMOR_STAB", - "add": { "math": [ "( ( u_discern_weakness_clear_power_level * 1.5) + 2) * u_discern_weakness_clear_intelligence" ] } - }, - { - "value": "ARMOR_BULLET", - "add": { "math": [ "( ( u_discern_weakness_clear_power_level * 1.5) + 2) * u_discern_weakness_clear_intelligence" ] } - }, - { - "value": "ARMOR_ELEC", - "add": { "math": [ "( ( u_discern_weakness_clear_power_level * 1.5) + 2) * u_discern_weakness_clear_intelligence" ] } - }, - { - "value": "ARMOR_HEAT", - "add": { "math": [ "( ( u_discern_weakness_clear_power_level * 1.5) + 2) * u_discern_weakness_clear_intelligence" ] } - }, - { - "value": "ARMOR_COLD", + "value": "ARMOR_ALL", "add": { "math": [ "( ( u_discern_weakness_clear_power_level * 1.5) + 2) * u_discern_weakness_clear_intelligence" ] } } ] @@ -1702,7 +1680,7 @@ "max_duration": "7 days", "max_intensity": 95, "blocks_effects": [ "blisters" ], - "enchantments": [ { "values": [ { "value": "ARMOR_HEAT", "multiply": -1.0 } ] } ], + "enchantments": [ { "incoming_damage_mod": [ { "type": "heat", "multiply": -1 } ] } ], "flags": [ "HEAT_IMMUNE" ] }, { @@ -1717,25 +1695,25 @@ "max_intensity": 41, "enchantments": [ { - "values": [ + "incoming_damage_mod": [ { - "value": "ARMOR_CUT", + "type": "bash", "multiply": { "math": [ - "( ( u_spell_level('telekinetic_momentum') * -0.005 ) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" + "( ( u_spell_level('telekinetic_momentum') * -0.01 ) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" ] } }, { - "value": "ARMOR_BASH", + "type": "stab", "multiply": { "math": [ - "( ( u_spell_level('telekinetic_momentum') * -0.01 ) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" + "( ( u_spell_level('telekinetic_momentum') * -0.005 ) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" ] } }, { - "value": "ARMOR_STAB", + "type": "cut", "multiply": { "math": [ "( ( u_spell_level('telekinetic_momentum') * -0.005 ) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" @@ -1743,13 +1721,15 @@ } }, { - "value": "ARMOR_BULLET", + "type": "bullet", "multiply": { "math": [ "( ( u_spell_level('telekinetic_momentum') * -0.02 ) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" ] } - }, + } + ], + "values": [ { "value": "MOVE_COST", "multiply": { @@ -1854,33 +1834,33 @@ "flags": [ "TELEKIN_SHIELD" ], "enchantments": [ { - "values": [ + "incoming_damage_mod": [ { - "value": "ARMOR_CUT", + "type": "bash", "add": { "math": [ - "( -3 + ( u_spell_level('telekinetic_shield') * -1) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" + "( -2 + ( u_spell_level('telekinetic_shield') * -0.5) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" ] } }, { - "value": "ARMOR_BASH", + "type": "stab", "add": { "math": [ - "( -2 + ( u_spell_level('telekinetic_shield') * -0.5) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" + "( -5 + ( u_spell_level('telekinetic_shield') * -1.5) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" ] } }, { - "value": "ARMOR_STAB", + "type": "cut", "add": { "math": [ - "( -5 + ( u_spell_level('telekinetic_shield') * -1.5) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" + "( -3 + ( u_spell_level('telekinetic_shield') * -1) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" ] } }, { - "value": "ARMOR_BULLET", + "type": "bullet", "add": { "math": [ "( -12 + ( u_spell_level('telekinetic_shield') * -2.5) * (scaling_factor(u_val('intelligence') ) ) ) * u_nether_attunement_power_scaling" @@ -1916,11 +1896,11 @@ "removes_effects": [ "grabbed" ], "enchantments": [ { - "values": [ - { "value": "ARMOR_CUT", "add": -100000 }, - { "value": "ARMOR_BASH", "add": -100000 }, - { "value": "ARMOR_STAB", "add": -100000 }, - { "value": "ARMOR_BULLET", "add": -100000 } + "incoming_damage_mod": [ + { "type": "bash", "add": -100000 }, + { "type": "stab", "add": -100000 }, + { "type": "cut", "add": -100000 }, + { "type": "bullet", "add": -100000 } ] } ], diff --git a/data/mods/MindOverMatter/enchantments/enchantments_baneful.json b/data/mods/MindOverMatter/enchantments/enchantments_baneful.json index 3b176124d5f72..6ed86f753ee30 100644 --- a/data/mods/MindOverMatter/enchantments/enchantments_baneful.json +++ b/data/mods/MindOverMatter/enchantments/enchantments_baneful.json @@ -3,12 +3,13 @@ "type": "enchantment", "id": "ench_nemesis_buff", "condition": "ALWAYS", - "values": [ - { "value": "SPEED", "add": { "math": [ "Nemesis_iteration * 1" ] } }, - { "value": "ARMOR_BASH", "add": { "math": [ "Nemesis_iteration * -1" ] } }, - { "value": "ARMOR_STAB", "add": { "math": [ "Nemesis_iteration * -1" ] } }, - { "value": "ARMOR_CUT", "add": { "math": [ "Nemesis_iteration * -1" ] } } - ] + "incoming_damage_mod": [ + { "type": "bash", "add": { "math": [ "Nemesis_iteration * -1" ] } }, + { "type": "stab", "add": { "math": [ "Nemesis_iteration * -1" ] } }, + { "type": "cut", "add": { "math": [ "Nemesis_iteration * -1" ] } }, + { "type": "bullet", "add": { "math": [ "Nemesis_iteration * -1" ] } } + ], + "values": [ { "value": "SPEED", "add": { "math": [ "Nemesis_iteration * 1" ] } } ] }, { "type": "enchantment", diff --git a/data/mods/MindOverMatter/enchantments/enchantments_player.json b/data/mods/MindOverMatter/enchantments/enchantments_player.json index 4efff57cbdefd..325452da4bf94 100644 --- a/data/mods/MindOverMatter/enchantments/enchantments_player.json +++ b/data/mods/MindOverMatter/enchantments/enchantments_player.json @@ -91,7 +91,7 @@ "condition": "ALWAYS", "has": "HELD", "hit_you_effect": [ { "id": "electrokin_zap_attack", "hit_self": false, "once_in": 2 } ], - "values": [ { "value": "ARMOR_ELEC", "add": { "math": [ "u_spell_level('electrokinetic_melee_attacks') * -1" ] } } ] + "incoming_damage_mod": [ { "type": "electric", "add": { "math": [ "u_spell_level('electrokinetic_melee_attacks') * -1" ] } } ] }, { "id": "electrokin_zap_attack", @@ -129,36 +129,38 @@ "condition": "ALWAYS", "has": "HELD", "emitter": "emit_pyrokin_cloak", - "values": [ + "incoming_damage_mod": [ { - "value": "CLIMATE_CONTROL_CHILL", - "add": { + "type": "heat", + "multiply": { "math": [ - "(60 + ( u_spell_level('pyrokinetic_cloak') * 4) * ( ( u_val('intelligence') + 10) / 20 ) ) * u_nether_attunement_power_scaling" + "( ( u_spell_level('pyrokinetic_cloak') * -1) * ( ( u_val('intelligence') + 10) / 20 ) ) * u_nether_attunement_power_scaling" ] } }, { - "value": "CLIMATE_CONTROL_HEAT", - "add": { + "type": "cold", + "multiply": { "math": [ - "( ( u_spell_level('pyrokinetic_cloak') * 10) * ( ( u_val('intelligence') + 10) / 20 ) ) * u_nether_attunement_power_scaling" + "( ( u_spell_level('pyrokinetic_cloak') * -3) * ( ( u_val('intelligence') + 10) / 20 ) ) * u_nether_attunement_power_scaling" ] } - }, + } + ], + "values": [ { - "value": "ARMOR_HEAT", + "value": "CLIMATE_CONTROL_CHILL", "add": { "math": [ - "( ( u_spell_level('pyrokinetic_cloak') * -1) * ( ( u_val('intelligence') + 10) / 20 ) ) * u_nether_attunement_power_scaling" + "(60 + ( u_spell_level('pyrokinetic_cloak') * 4) * ( ( u_val('intelligence') + 10) / 20 ) ) * u_nether_attunement_power_scaling" ] } }, { - "value": "ARMOR_COLD", + "value": "CLIMATE_CONTROL_HEAT", "add": { "math": [ - "( ( u_spell_level('pyrokinetic_cloak') * -3) * ( ( u_val('intelligence') + 10) / 20 ) ) * u_nether_attunement_power_scaling" + "( ( u_spell_level('pyrokinetic_cloak') * 10) * ( ( u_val('intelligence') + 10) / 20 ) ) * u_nether_attunement_power_scaling" ] } } @@ -268,7 +270,7 @@ "id": "enchant_electrokin_potion", "condition": "ALWAYS", "has": "HELD", - "values": [ { "value": "ARMOR_ELEC", "add": -5 } ], + "incoming_damage_mod": [ { "type": "electric", "add": -5 } ], "hit_me_effect": [ { "id": "electro_potion_attacked", "hit_self": false } ] }, { @@ -297,7 +299,7 @@ "id": "enchant_pyrokin_potion", "condition": "ALWAYS", "has": "HELD", - "values": [ { "value": "ARMOR_HEAT", "add": -50 } ], + "incoming_damage_mod": [ { "type": "heat", "add": -50 } ], "hit_me_effect": [ { "id": "pyro_aura_attacked", "hit_self": false } ] }, { diff --git a/data/mods/MindOverMatter/items/armor/belt.json b/data/mods/MindOverMatter/items/armor/belt.json index 6aef8bcb67b11..90b0bb7112501 100644 --- a/data/mods/MindOverMatter/items/armor/belt.json +++ b/data/mods/MindOverMatter/items/armor/belt.json @@ -42,11 +42,11 @@ "has": "WORN", "condition": "ACTIVE", "ench_effects": [ { "effect": "effect_shield_belt_telekin_protection", "intensity": 1 } ], - "values": [ - { "value": "ARMOR_CUT", "add": -15 }, - { "value": "ARMOR_BASH", "add": -8 }, - { "value": "ARMOR_STAB", "add": -20 }, - { "value": "ARMOR_BULLET", "add": -40 } + "incoming_damage_mod": [ + { "type": "bash", "add": -8 }, + { "type": "stab", "add": -20 }, + { "type": "cut", "add": -15 }, + { "type": "bullet", "add": -40 } ] } ], @@ -70,22 +70,7 @@ "type": "transform" } ], - "extend": { "flags": [ "NO_TAKEOFF" ] }, - "relic_data": { - "passive_effects": [ - { - "has": "WORN", - "condition": "ACTIVE", - "ench_effects": [ { "effect": "effect_shield_belt_telekin_protection", "intensity": 1 } ], - "values": [ - { "value": "ARMOR_CUT", "add": -15 }, - { "value": "ARMOR_BASH", "add": -8 }, - { "value": "ARMOR_STAB", "add": -20 }, - { "value": "ARMOR_BULLET", "add": -40 } - ] - } - ] - } + "extend": { "flags": [ "NO_TAKEOFF" ] } }, { "id": "psionic_shield_belt_broken", @@ -166,7 +151,8 @@ { "has": "WORN", "condition": "ALWAYS", - "values": [ { "value": "ARMOR_HEAT", "multiply": -1.0 }, { "value": "CLIMATE_CONTROL_CHILL", "add": 1000 } ] + "incoming_damage_mod": [ { "type": "heat", "multiply": -1 } ], + "values": [ { "value": "CLIMATE_CONTROL_CHILL", "add": 1000 } ] } ] } diff --git a/data/mods/MindOverMatter/mutations/psi_passives.json b/data/mods/MindOverMatter/mutations/psi_passives.json index 9bef1d20049cd..3ecf5917204f6 100644 --- a/data/mods/MindOverMatter/mutations/psi_passives.json +++ b/data/mods/MindOverMatter/mutations/psi_passives.json @@ -83,10 +83,8 @@ "purifiable": false, "enchantments": [ { - "values": [ - { "value": "ARMOR_ELEC", "add": { "math": [ "u_spell_level_sum('school': 'ELECTROKINETIC') / -0.2" ] } }, - { "value": "PAIN", "multiply": { "math": [ "u_spell_level_sum('school': 'ELECTROKINETIC') * -0.00035" ] } } - ] + "incoming_damage_mod": [ { "type": "electric", "add": { "math": [ "u_spell_level_sum('school': 'ELECTROKINETIC') / -0.2" ] } } ], + "values": [ { "value": "PAIN", "multiply": { "math": [ "u_spell_level_sum('school': 'ELECTROKINETIC') * -0.00035" ] } } ] } ] }, diff --git a/data/mods/Xedra_Evolved/effects/effects.json b/data/mods/Xedra_Evolved/effects/effects.json index a458053215e1f..ebcd36807bb7e 100644 --- a/data/mods/Xedra_Evolved/effects/effects.json +++ b/data/mods/Xedra_Evolved/effects/effects.json @@ -162,7 +162,7 @@ "name": [ "Shadow Damage Reduction" ], "desc": [ "You are flatter and less real in ways that makes you less susceptible to damage." ], "show_in_info": true, - "enchantments": [ { "values": [ { "value": "ARMOR_BULLET", "multiply": -0.75 }, { "value": "ARMOR_BASH", "multiply": -0.75 } ] } ] + "enchantments": [ { "incoming_damage_mod": [ { "type": "bash", "multiply": -0.75 }, { "type": "bullet", "multiply": -0.75 } ] } ] }, { "type": "effect_type", @@ -551,9 +551,9 @@ "rating": "good", "enchantments": [ { - "values": [ + "incoming_damage_mod": [ { - "value": "ARMOR_BASH", + "type": "bash", "multiply": { "math": [ "max(((vampire_total_tier_one_traits() * -0.01) + (vampire_total_tier_two_traits() * -0.02) + (vampire_total_tier_three_traits() * -0.04) + (vampire_total_tier_four_traits_plus_potence() * -0.06)), -0.66)" @@ -561,23 +561,23 @@ } }, { - "value": "ARMOR_CUT", + "type": "stab", "multiply": { "math": [ - "max(((vampire_total_tier_one_traits() * -0.005) + (vampire_total_tier_two_traits() * -0.01) + (vampire_total_tier_three_traits() * -0.02) + (vampire_total_tier_four_traits_plus_potence() * -0.03)), -0.33)" + "max(((vampire_total_tier_one_traits() * -0.003) + (vampire_total_tier_two_traits() * -0.007) + (vampire_total_tier_three_traits() * -0.015) + (vampire_total_tier_four_traits_plus_potence() * -0.025)), -0.25)" ] } }, { - "value": "ARMOR_STAB", + "type": "cut", "multiply": { "math": [ - "max(((vampire_total_tier_one_traits() * -0.003) + (vampire_total_tier_two_traits() * -0.007) + (vampire_total_tier_three_traits() * -0.015) + (vampire_total_tier_four_traits_plus_potence() * -0.025)), -0.25)" + "max(((vampire_total_tier_one_traits() * -0.005) + (vampire_total_tier_two_traits() * -0.01) + (vampire_total_tier_three_traits() * -0.02) + (vampire_total_tier_four_traits_plus_potence() * -0.03)), -0.33)" ] } }, { - "value": "ARMOR_BULLET", + "type": "bullet", "multiply": { "math": [ "max(((vampire_total_tier_one_traits() * -0.012) + (vampire_total_tier_two_traits() * -0.025) + (vampire_total_tier_three_traits() * -0.05) + (vampire_total_tier_four_traits_plus_potence() * -0.075)), -0.85)" @@ -741,21 +741,7 @@ "rating": "good", "show_intensity": false, "//": "+1 armor for each lvl", - "enchantments": [ - { - "values": [ - { "value": "ARMOR_BASH", "add": { "math": [ "-1 * u_spell_level('spell_endurance')" ] } }, - { "value": "ARMOR_CUT", "add": { "math": [ "-1 * u_spell_level('spell_endurance')" ] } }, - { "value": "ARMOR_STAB", "add": { "math": [ "-1 * u_spell_level('spell_endurance')" ] } }, - { "value": "ARMOR_BULLET", "add": { "math": [ "-1 * u_spell_level('spell_endurance')" ] } }, - { "value": "ARMOR_ACID", "add": { "math": [ "-1 * u_spell_level('spell_endurance')" ] } }, - { "value": "ARMOR_BIO", "add": { "math": [ "-1 * u_spell_level('spell_endurance')" ] } }, - { "value": "ARMOR_COLD", "add": { "math": [ "-1 * u_spell_level('spell_endurance')" ] } }, - { "value": "ARMOR_ELEC", "add": { "math": [ "-1 * u_spell_level('spell_endurance')" ] } }, - { "value": "ARMOR_HEAT", "add": { "math": [ "-1 * u_spell_level('spell_endurance')" ] } } - ] - } - ] + "enchantments": [ { "values": [ { "value": "ARMOR_ALL", "add": { "math": [ "-1 * u_spell_level('spell_endurance')" ] } } ] } ] }, { "id": "spell_melee_damage", @@ -800,21 +786,8 @@ "show_intensity": false, "max_intensity": 2, "int_add_val": 1, - "enchantments": [ - { - "values": [ - { "value": "ARMOR_BASH", "add": { "math": [ "10 * u_spell_level('spell_weak')" ] } }, - { "value": "ARMOR_CUT", "add": { "math": [ "10 * u_spell_level('spell_weak')" ] } }, - { "value": "ARMOR_STAB", "add": { "math": [ "10 * u_spell_level('spell_weak')" ] } }, - { "value": "ARMOR_BULLET", "add": { "math": [ "10 * u_spell_level('spell_weak')" ] } }, - { "value": "ARMOR_ACID", "add": { "math": [ "10 * u_spell_level('spell_weak')" ] } }, - { "value": "ARMOR_BIO", "add": { "math": [ "10 * u_spell_level('spell_weak')" ] } }, - { "value": "ARMOR_COLD", "add": { "math": [ "10 * u_spell_level('spell_weak')" ] } }, - { "value": "ARMOR_ELEC", "add": { "math": [ "10 * u_spell_level('spell_weak')" ] } }, - { "value": "ARMOR_HEAT", "add": { "math": [ "10 * u_spell_level('spell_weak')" ] } } - ] - } - ] + "//": "todo: doesn't do anything, because monster do not have u_spell_level('spell_weak'); solution: store u_spell_level('spell_weak') as monster variable, and use variable in calculations instead", + "enchantments": [ { "values": [ { "value": "ARMOR_ALL", "add": { "math": [ "10 * u_spell_level('spell_weak')" ] } } ] } ] }, { "type": "effect_type", @@ -1238,12 +1211,12 @@ "removes_effects": [ "stunned", "dazed", "downed" ], "enchantments": [ { - "values": [ - { "value": "ARMOR_BASH", "multiply": -0.25 }, - { "value": "ARMOR_BULLET", "multiply": -0.25 }, - { "value": "ARMOR_CUT", "multiply": -0.25 }, - { "value": "ARMOR_STAB", "multiply": -0.25 }, - { "value": "ARMOR_HEAT", "multiply": -0.25 } + "incoming_damage_mod": [ + { "type": "bash", "multiply": -0.25 }, + { "type": "stab", "multiply": -0.25 }, + { "type": "cut", "multiply": -0.25 }, + { "type": "bullet", "multiply": -0.25 }, + { "type": "heat", "multiply": -0.25 } ] } ], @@ -1259,13 +1232,13 @@ "rating": "good", "enchantments": [ { - "values": [ - { "value": "ARMOR_BASH", "multiply": -0.3 }, - { "value": "ARMOR_BULLET", "multiply": -0.3 }, - { "value": "ARMOR_CUT", "multiply": -0.3 }, - { "value": "ARMOR_STAB", "multiply": -0.3 }, - { "value": "MOVE_COST", "multiply": 0.1 } - ] + "incoming_damage_mod": [ + { "type": "bash", "multiply": -0.3 }, + { "type": "stab", "multiply": -0.3 }, + { "type": "cut", "multiply": -0.3 }, + { "type": "bullet", "multiply": -0.3 } + ], + "values": [ { "value": "MOVE_COST", "multiply": 0.1 } ] } ], "flags": [ "BLEEDSLOW1" ] @@ -1420,7 +1393,12 @@ "rating": "good", "show_in_info": true, "removes_effects": [ "onfire", "blisters" ], - "enchantments": [ { "values": [ { "value": "CLIMATE_CONTROL_CHILL", "add": 1000 }, { "value": "ARMOR_HEAT", "add": -1000 } ] } ] + "enchantments": [ + { + "incoming_damage_mod": [ { "type": "heat", "add": -1000 } ], + "values": [ { "value": "CLIMATE_CONTROL_CHILL", "add": 1000 } ] + } + ] }, { "type": "effect_type", @@ -1430,7 +1408,12 @@ "desc": [ "" ], "rating": "good", "removes_effects": [ "onfire", "blisters" ], - "enchantments": [ { "values": [ { "value": "CLIMATE_CONTROL_CHILL", "add": 1000 }, { "value": "ARMOR_HEAT", "add": -1000 } ] } ] + "enchantments": [ + { + "incoming_damage_mod": [ { "type": "heat", "add": -1000 } ], + "values": [ { "value": "CLIMATE_CONTROL_CHILL", "add": 1000 } ] + } + ] }, { "type": "effect_type", @@ -1675,7 +1658,7 @@ "enchantments": [ { "hit_me_effect": [ { "id": "undine_acid_resist_ally_thorns", "hit_self": false, "once_in": 3 } ], - "values": [ { "value": "ARMOR_ACID", "multiply": -0.75 } ] + "incoming_damage_mod": [ { "type": "acid", "multiply": -0.75 } ] } ] }, @@ -2428,21 +2411,7 @@ "rating": "bad", "show_intensity": false, "show_in_info": true, - "enchantments": [ - { - "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_BASH", "add": -15 }, - { "value": "ARMOR_STAB", "add": -15 }, - { "value": "ARMOR_CUT", "add": -15 }, - { "value": "ARMOR_HEAT", "add": -15 }, - { "value": "ARMOR_COLD", "add": -15 }, - { "value": "ARMOR_ELEC", "add": -15 }, - { "value": "ARMOR_ACID", "add": -15 }, - { "value": "ARMOR_BULLET", "add": -15 } - ] - } - ] + "enchantments": [ { "condition": "ALWAYS", "values": [ { "value": "ARMOR_ALL", "add": -15 } ] } ] }, { "id": "effect_moon_withdrawal", diff --git a/data/mods/Xedra_Evolved/enchantments/armor.json b/data/mods/Xedra_Evolved/enchantments/armor.json index 7df85a9ffcec7..a5674a0dfb588 100644 --- a/data/mods/Xedra_Evolved/enchantments/armor.json +++ b/data/mods/Xedra_Evolved/enchantments/armor.json @@ -6,7 +6,8 @@ "type": "enchantment", "has": "WORN", "condition": "ALWAYS", - "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 20 }, { "value": "ARMOR_COLD", "add": -15 } ] + "incoming_damage_mod": [ { "type": "cold", "add": -15 } ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 20 } ] }, { "id": "ench_climate_periapta_feline", diff --git a/data/mods/Xedra_Evolved/itemgroups/map_extra_itemgroups.json b/data/mods/Xedra_Evolved/itemgroups/map_extra_itemgroups.json index f4964850ea256..88ea41f345730 100644 --- a/data/mods/Xedra_Evolved/itemgroups/map_extra_itemgroups.json +++ b/data/mods/Xedra_Evolved/itemgroups/map_extra_itemgroups.json @@ -187,78 +187,6 @@ "increment": 0.2, "power_per_increment": 100 }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_ACID", - "increment": 0.1, - "power_per_increment": -500 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_BASH", - "increment": 0.1, - "power_per_increment": -500 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_BIO", - "increment": 0.1, - "power_per_increment": -500 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_COLD", - "increment": 0.1, - "power_per_increment": -500 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_CUT", - "increment": 0.1, - "power_per_increment": -500 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_ELEC", - "increment": 0.1, - "power_per_increment": -500 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_HEAT", - "increment": 0.1, - "power_per_increment": -500 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_STAB", - "increment": 0.1, - "power_per_increment": -500 - }, - { - "weight": 100, - "min_value": -0.2, - "max_value": 1, - "type": "ARMOR_BULLET", - "increment": 0.1, - "power_per_increment": -500 - }, { "weight": 50, "min_value": -0.4, diff --git a/data/mods/Xedra_Evolved/items/inventor/armor.json b/data/mods/Xedra_Evolved/items/inventor/armor.json index 2a7906ecc6d9a..d64bacc52f029 100644 --- a/data/mods/Xedra_Evolved/items/inventor/armor.json +++ b/data/mods/Xedra_Evolved/items/inventor/armor.json @@ -308,11 +308,11 @@ { "has": "WORN", "condition": "ACTIVE", - "values": [ - { "value": "ARMOR_CUT", "multiply": -0.5 }, - { "value": "ARMOR_BASH", "multiply": -0.5 }, - { "value": "ARMOR_STAB", "multiply": -0.5 }, - { "value": "ARMOR_BULLET", "multiply": -0.5 } + "incoming_damage_mod": [ + { "type": "bash", "multiply": -0.5 }, + { "type": "stab", "multiply": -0.5 }, + { "type": "cut", "multiply": -0.5 }, + { "type": "bullet", "multiply": -0.5 } ] } ] diff --git a/data/mods/Xedra_Evolved/mutations/mutations.json b/data/mods/Xedra_Evolved/mutations/mutations.json index 608bb54f2601d..f8e848158467d 100644 --- a/data/mods/Xedra_Evolved/mutations/mutations.json +++ b/data/mods/Xedra_Evolved/mutations/mutations.json @@ -227,11 +227,11 @@ "deactivated_eocs": [ "EOC_VAMPIRIC_RESILIENCE_deactivated" ], "enchantments": [ { - "values": [ - { "value": "ARMOR_BASH", "multiply": -0.05 }, - { "value": "ARMOR_CUT", "multiply": -0.03 }, - { "value": "ARMOR_STAB", "multiply": -0.02 }, - { "value": "ARMOR_BULLET", "multiply": -0.08 } + "incoming_damage_mod": [ + { "type": "bash", "multiply": -0.05 }, + { "type": "stab", "multiply": -0.02 }, + { "type": "cut", "multiply": -0.03 }, + { "type": "bullet", "multiply": -0.08 } ] } ] diff --git a/data/mods/Xedra_Evolved/mutations/paraclesians/ierde_mutation_spells.json b/data/mods/Xedra_Evolved/mutations/paraclesians/ierde_mutation_spells.json index 340551a6521c4..95cb3b42def1e 100644 --- a/data/mods/Xedra_Evolved/mutations/paraclesians/ierde_mutation_spells.json +++ b/data/mods/Xedra_Evolved/mutations/paraclesians/ierde_mutation_spells.json @@ -12,13 +12,12 @@ "has": "HELD", "condition": "ALWAYS", "skills": [ { "value": "dodge", "multiply": -1 } ], + "incoming_damage_mod": [ { "type": "bash", "multiply": -0.5 }, { "type": "cut", "multiply": -0.66 } ], "values": [ { "value": "ATTACK_SPEED", "multiply": 2 }, { "value": "MOVE_COST", "multiply": 1 }, { "value": "BONUS_DODGE", "multiply": -1 }, - { "value": "FOOTSTEP_NOISE", "multiply": 4 }, - { "value": "ARMOR_CUT", "multiply": -0.66 }, - { "value": "ARMOR_BASH", "multiply": -0.5 } + { "value": "FOOTSTEP_NOISE", "multiply": 4 } ] }, { diff --git a/data/mods/Xedra_Evolved/mutations/paraclesians/salamander_mutations.json b/data/mods/Xedra_Evolved/mutations/paraclesians/salamander_mutations.json index e5fa1157d5472..8118e2d967106 100644 --- a/data/mods/Xedra_Evolved/mutations/paraclesians/salamander_mutations.json +++ b/data/mods/Xedra_Evolved/mutations/paraclesians/salamander_mutations.json @@ -585,7 +585,7 @@ "enchantments": [ { "condition": "ALWAYS", - "values": [ { "value": "ARMOR_HEAT", "multiply": -1 }, { "value": "ARMOR_COLD", "multiply": 0.5 } ], + "incoming_damage_mod": [ { "type": "heat", "multiply": -1 }, { "type": "cold", "multiply": 0.5 } ], "ench_effects": [ { "effect": "effect_hidden_flame_immunity", "intensity": 1 } ] } ], diff --git a/data/mods/Xedra_Evolved/mutations/paraclesians/sylph_mutations.json b/data/mods/Xedra_Evolved/mutations/paraclesians/sylph_mutations.json index b7713a1cf3c60..4e24bc8ab794f 100644 --- a/data/mods/Xedra_Evolved/mutations/paraclesians/sylph_mutations.json +++ b/data/mods/Xedra_Evolved/mutations/paraclesians/sylph_mutations.json @@ -223,7 +223,8 @@ "enchantments": [ { "condition": "ALWAYS", - "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 15 }, { "value": "ARMOR_COLD", "add": -10 } ] + "incoming_damage_mod": [ { "type": "cold", "add": -10 } ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 15 } ] } ], "category": [ "SYLPH" ] @@ -240,7 +241,8 @@ "enchantments": [ { "condition": "ALWAYS", - "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 45 }, { "value": "ARMOR_COLD", "multiply": -0.75 } ] + "incoming_damage_mod": [ { "type": "cold", "multiply": -0.75 } ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 45 } ] } ], "category": [ "SYLPH" ] @@ -259,7 +261,8 @@ "enchantments": [ { "condition": "ALWAYS", - "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 150 }, { "value": "ARMOR_COLD", "multiply": -0.75 } ] + "incoming_damage_mod": [ { "type": "cold", "multiply": -0.75 } ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 150 } ] } ] }, diff --git a/data/mods/Xedra_Evolved/mutations/paraclesians/undine_mutation_spells.json b/data/mods/Xedra_Evolved/mutations/paraclesians/undine_mutation_spells.json index c364459ddf940..eb51ad776b824 100644 --- a/data/mods/Xedra_Evolved/mutations/paraclesians/undine_mutation_spells.json +++ b/data/mods/Xedra_Evolved/mutations/paraclesians/undine_mutation_spells.json @@ -3,24 +3,20 @@ "type": "enchantment", "id": "undine_resist_acid", "condition": "ALWAYS", - "values": [ { "value": "ARMOR_ACID", "multiply": -0.25 } ] + "incoming_damage_mod": [ { "type": "acid", "multiply": -0.25 } ] }, { "type": "enchantment", "id": "undine_resist_fire", "condition": "ALWAYS", - "values": [ { "value": "ARMOR_HEAT", "multiply": -0.5 } ] + "incoming_damage_mod": [ { "type": "heat", "multiply": -0.5 } ] }, { "type": "enchantment", "id": "ench_undine_water_body", "condition": "ALWAYS", "has": "HELD", - "values": [ - { "value": "ARMOR_BASH", "multiply": -0.1 }, - { "value": "ARMOR_CUT", "multiply": -0.2 }, - { "value": "ARMOR_BULLET", "multiply": -0.5 } - ] + "incoming_damage_mod": [ { "type": "bash", "multiply": -0.1 }, { "type": "cut", "multiply": -0.2 }, { "type": "bullet", "multiply": -0.5 } ] }, { "type": "enchantment", @@ -38,14 +34,14 @@ "id": "ench_undine_water_form_armor", "condition": "ALWAYS", "has": "HELD", - "values": [ - { "value": "ARMOR_BASH", "multiply": -0.4 }, - { "value": "ARMOR_CUT", "multiply": -0.6 }, - { "value": "ARMOR_STAB", "multiply": -0.8 }, - { "value": "ARMOR_BULLET", "multiply": -1.0 }, - { "value": "ARMOR_COLD", "multiply": 2.0 }, - { "value": "CLIMATE_CONTROL_HEAT", "add": -20 } - ] + "incoming_damage_mod": [ + { "type": "bash", "multiply": -0.4 }, + { "type": "stab", "multiply": -0.8 }, + { "type": "cut", "multiply": -0.6 }, + { "type": "bullet", "multiply": -1.0 }, + { "type": "cold", "multiply": 2 } + ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": -20 } ] }, { "type": "enchantment", diff --git a/data/mods/Xedra_Evolved/mutations/temporary.json b/data/mods/Xedra_Evolved/mutations/temporary.json index 9ba208f235464..4f88eb2c0d16d 100644 --- a/data/mods/Xedra_Evolved/mutations/temporary.json +++ b/data/mods/Xedra_Evolved/mutations/temporary.json @@ -379,12 +379,12 @@ }, { "condition": "ALWAYS", + "incoming_damage_mod_post_absorbed": [ { "type": "bash", "multiply": 0.8 } ], "values": [ { "value": "PERCEPTION", "add": 4 }, { "value": "BODYTEMP_SLEEP", "add": 0.5 }, { "value": "OVERMAP_SIGHT", "add": 4 }, { "value": "METABOLISM", "multiply": -0.2 }, - { "value": "EXTRA_BASH", "multiply": 0.8 }, { "value": "MOVE_COST", "multiply": -0.2 }, { "value": "ATTACK_SPEED", "multiply": -0.2 }, { "value": "CARRY_WEIGHT", "multiply": -0.1 }, diff --git a/data/mods/Xedra_Evolved/procgen/dreamsmith_procgen.json b/data/mods/Xedra_Evolved/procgen/dreamsmith_procgen.json index 2de9e0d4f06a5..ad760764f6dd4 100644 --- a/data/mods/Xedra_Evolved/procgen/dreamsmith_procgen.json +++ b/data/mods/Xedra_Evolved/procgen/dreamsmith_procgen.json @@ -212,79 +212,6 @@ "id": "dreamsmith_lottery_def_head", "//": "In addition to stats and armor, this pool should related to perception, sight, or vision", "passive_add_procgen_values": [ - { "weight": 100, "min_value": -1, "max_value": -20, "type": "ARMOR_ACID", "increment": -1, "power_per_increment": 75 }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BASH", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BIO", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BULLET", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_COLD", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_CUT", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_ELEC", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_HEAT", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_STAB", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, { "weight": 100, "min_value": 1, @@ -357,79 +284,6 @@ "id": "dreamsmith_lottery_def_body", "//": "In addition to stats and armor, this pool should related to the concept of defense or avoiding attack or environmental protection", "passive_add_procgen_values": [ - { "weight": 100, "min_value": -1, "max_value": -20, "type": "ARMOR_ACID", "increment": -1, "power_per_increment": 75 }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BASH", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BIO", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BULLET", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_COLD", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_CUT", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_ELEC", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_HEAT", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_STAB", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, { "weight": 100, "min_value": 1, @@ -574,79 +428,6 @@ "id": "dreamsmith_lottery_def_hands", "//": "In addition to stats and armor, this pool should related to the concept of adroitness or martial skill", "passive_add_procgen_values": [ - { "weight": 100, "min_value": -1, "max_value": -20, "type": "ARMOR_ACID", "increment": -1, "power_per_increment": 75 }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BASH", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BIO", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BULLET", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_COLD", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_CUT", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_ELEC", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_HEAT", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_STAB", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, { "weight": 100, "min_value": 1, @@ -755,79 +536,6 @@ "id": "dreamsmith_lottery_def_feet", "//": "In addition to stats and armor, this pool should related to the movement or stealth", "passive_add_procgen_values": [ - { "weight": 100, "min_value": -1, "max_value": -20, "type": "ARMOR_ACID", "increment": -1, "power_per_increment": 75 }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BASH", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BIO", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_BULLET", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_COLD", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_CUT", - "increment": -1, - "power_per_increment": 150, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_ELEC", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_HEAT", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, - { - "weight": 100, - "min_value": -1, - "max_value": -20, - "type": "ARMOR_STAB", - "increment": -1, - "power_per_increment": 75, - "ench_has": "WORN" - }, { "weight": 100, "min_value": 1, diff --git a/data/mods/Xedra_Evolved/spells/XAEA.json b/data/mods/Xedra_Evolved/spells/XAEA.json index 122320c16e988..a03a9a5509314 100644 --- a/data/mods/Xedra_Evolved/spells/XAEA.json +++ b/data/mods/Xedra_Evolved/spells/XAEA.json @@ -343,7 +343,7 @@ "remove_message": "Electric clouds are gone.", "rating": "good", "show_intensity": false, - "enchantments": [ { "emitter": "emit_shock_cloud_big", "values": [ { "value": "ARMOR_ELEC", "add": -100 } ] } ] + "enchantments": [ { "emitter": "emit_shock_cloud_big", "incoming_damage_mod": [ { "type": "electric", "add": -100 } ] } ] }, { "id": "XAEA_mod_moves", diff --git a/data/mods/Xedra_Evolved/spells/integrated_armor_spells.json b/data/mods/Xedra_Evolved/spells/integrated_armor_spells.json index 981d547cf3647..a5fa3d96d440a 100644 --- a/data/mods/Xedra_Evolved/spells/integrated_armor_spells.json +++ b/data/mods/Xedra_Evolved/spells/integrated_armor_spells.json @@ -19,11 +19,8 @@ "name": { "str": "Salamander" }, "description": "Your Fire Elemental abilities grant you good resistance to temperature conditions and heat damage. Also your body emits streams of heat into anyone who attack you.", "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_HEAT", "multiply": -0.2 }, - { "value": "CLIMATE_CONTROL_HEAT", "add": 15 }, - { "value": "CLIMATE_CONTROL_CHILL", "add": 10 } - ], + "incoming_damage_mod": [ { "type": "heat", "multiply": -0.2 } ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 15 }, { "value": "CLIMATE_CONTROL_CHILL", "add": 10 } ], "hit_me_effect": [ { "id": "integrated_coal_skin_burnback", @@ -52,11 +49,8 @@ "name": { "str": "Salamonstrous" }, "description": "Your Fire Elemental abilities grant you good resistance to temperature conditions and heat damage. Also your body emits streams of heat into anyone who attack you.", "condition": "ALWAYS", - "values": [ - { "value": "ARMOR_HEAT", "multiply": -0.5 }, - { "value": "CLIMATE_CONTROL_HEAT", "add": 45 }, - { "value": "CLIMATE_CONTROL_CHILL", "add": 10 } - ], + "incoming_damage_mod": [ { "type": "heat", "multiply": -0.5 } ], + "values": [ { "value": "CLIMATE_CONTROL_HEAT", "add": 45 }, { "value": "CLIMATE_CONTROL_CHILL", "add": 10 } ], "hit_me_effect": [ { "id": "integrated_coal_skin_burnback", diff --git a/doc/MAGIC.md b/doc/MAGIC.md index 2b481a6035736..c59bfcae18741 100644 --- a/doc/MAGIC.md +++ b/doc/MAGIC.md @@ -655,7 +655,31 @@ There are two possible syntaxes. The first is by defining an enchantment object "modified_bodyparts": [ { "gain": "test_corvid_beak" }, { "lose": "torso" } ], "mutations": [ "GILLS", "MEMBRANE", "AMPHIBIAN", "WAYFARER", "WILDSHAPE:FISH" ], "ench_effects": [ { "effect": "invisibility", "intensity": 1 } ], - "melee_damage_bonus": [ { "type": "bash", "add": 10 } ] + "melee_damage_bonus": [ // adds this amount of damage to attack; adding damage adds flat number to attacks, multiplier multiplies existing damage after adding + { "type": "bash", "add": 10 }, // add 10 would straight add 10 damage of this type to each attack + { "type": "cut", "add": -3 }, // add -3 would decrease any cut damage up to zero + { "type": "heat", "multiply": 0.5 }, // 0.5 would mean damage be increased by 50% + { "type": "acid", "multiply": -0.5 }, // -0.5 would mean 50% decrease of damage + { "type": "necrotic", "add": 10, "multiply": 0.1 }, // any damage_type is supported + { "type": "biological", "add": { "math": [ "Nemesis_iteration * -1" ] } } // supports math and stuff, works for both character/npcs and monsters. multiple `melee_damage_bonus`es of the same type do stack + ], + "incoming_damage_mod": [ // any incoming damage would be modified by this value + { "type": "bash", "add": 10 }, // adding would increase the taken damage (hurt more!) + { "type": "stab", "add": -8 }, // negative adding would subtract damage taken by this amount + { "type": "cut", "multiply": -0.5 }, // multiplication would multiply entire damage; -0.5 would result in 50% of damage being removed + { "type": "bullet", "add": 1 }, // `"multiply": 1` would double all incoming bullet damage + { "type": "electric", "add": { "math": [ "rand(3) * -1" ] } }, // supports math and stuff, works for both character/npcs and monsters. multiple `incoming_damage_mod`es of the same type do stack + { "type": "acid", "add": 1, "multiply": 1 } // damage is subtracted before your physical armor (chain mail or similar), best works for decreasing incoming damage, as if character has additional layer of armor + ], + "incoming_damage_mod_post_absorbed": [ // works exactly same as incoming_damage_mod, but is applied after your physical armor (chain mail or similar), so best works for adding damage, as if character is specifically suseptible to this type of damage + { "type": "bash", "add": 10 }, + { "type": "stab", "add": -8 }, + { "type": "cut", "multiply": -0.5 }, + { "type": "bullet", "add": 1 }, + { "type": "electric", "add": { "math": [ "rand(3) * -1" ] } }, + { "type": "acid", "add": 1, "multiply": 1 } + ], + "intermittent_activation": { "effects": [ { @@ -836,16 +860,7 @@ The following is a list of possible enchantment `values`: Character status value | Description --- |--- -`ARMOR_ACID` | Negative values give armor against the damage, positive values make you accept more damage of this type. -`ARMOR_ALL` | -`ARMOR_BASH` | -`ARMOR_BIO` | -`ARMOR_BULLET` | -`ARMOR_COLD` | -`ARMOR_CUT` | -`ARMOR_ELEC` | -`ARMOR_HEAT` | -`ARMOR_STAB` | +`ARMOR_ALL` | Gives this amount of protection against any damage type except one with "no_resist": true. For more precise changes use incoming_damage_mod or item_armor_bonus `ATTACK_NOISE` | Affects the amount of noise you make while melee attacking. `ATTACK_SPEED` | Affects attack speed of item, even if it's not the one you're wielding, and throwing cost (capped at 25 moves). `"add": 10` adds 10 moves to each attack (makes it longer), `"add": -10` makes each attack faster for 10 moves; `"multiply": 1` doubles the speed of each attack `AVOID_FRIENDRY_FIRE` | Flat chance for your character to avoid friendry fire if there is a friend in the line of fire. From 0.0 (no chance) to 1.0 (never frindly fire). @@ -869,15 +884,6 @@ Character status value | Description `DODGE_CHANCE` | Modifies the probability to dodge an attack. Default is 0, so better to use `add` `EFFECTIVE_HEALTH_MOD` | If this is anything other than zero (which it defaults to) you will use it instead of your actual health mod. `EQUIPMENT_DAMAGE_CHANCE` | Modifies the likelihood that weapons and armor take durability damage. Since it's a percent, using 'multiply' is recommended. Positive values increase likelihood of damage while negative values decrease likelihood. `multiply`: -1 and below result in indestructible equipment. -`EXTRA_ACID` | EXTRA_TYPE increases received damage of the selected type. -`EXTRA_BASH` | -`EXTRA_BIO` | -`EXTRA_BULLET` | -`EXTRA_COLD` | -`EXTRA_CUT` | -`EXTRA_ELEC` | -`EXTRA_HEAT` | -`EXTRA_STAB` | `EXTRA_ELEC_PAIN` | Multiplier on electric damage received, the result is applied as extra pain. `EVASION` | Flat chance for your character to dodge incoming attacks regardless of other modifiers. From 0.0 (no evasion chance) to 1.0 (100% evasion chance). `FALL_DAMAGE` | Affects the amount of fall damage you take. @@ -962,15 +968,6 @@ Character status value | Description Enchanted item value | Description --- |--- -`ITEM_ARMOR_ACID` | -`ITEM_ARMOR_BASH` | -`ITEM_ARMOR_BIO` | -`ITEM_ARMOR_BULLET` | -`ITEM_ARMOR_COLD` | -`ITEM_ARMOR_CUT` | -`ITEM_ARMOR_ELEC` | -`ITEM_ARMOR_HEAT` | -`ITEM_ARMOR_STAB` | `ITEM_ATTACK_SPEED` | ### Enchantments on monsters @@ -978,16 +975,6 @@ A small subset of enchantments can be applied to monsters via effects. These are Character status value | Description --- |--- -`ARMOR_ACID` | Negative values give armor against the damage, positive values make the monster accept more damage of this type. -`ARMOR_ALL` | -`ARMOR_BASH` | -`ARMOR_BIO` | -`ARMOR_BULLET` | -`ARMOR_COLD` | -`ARMOR_CUT` | -`ARMOR_ELEC` | -`ARMOR_HEAT` | -`ARMOR_STAB` | `REGEN_HP` | Affects the rate the monster recovers hp. `VISION_RANGE` | Affects monster vision range, both day and night one. `SPEED` | Affects the base speed of the monster. @@ -996,11 +983,11 @@ Character status value | Description ### Enchantment value examples ```C++ - { "value": "ARMOR_ELEC", "add": -20 } // subtracts 20 points of incoming electrical damage + { "incoming_damage_mod": [ { "type": "electric", "add": -20 } ] }, // subtracts 20 points of incoming electrical damage { "value": "ATTACK_SPEED", "add": -60 } // subtracts 60 attack moves, making the attacker faster - { "value": "ARMOR_COLD", "multiply": -0.4 } // subtracts 40% of incoming cold damage - { "value": "ARMOR_HEAT", "multiply": 0.4 } // increases damage taken from fire by 40% - { "value": "ARMOR_CUT", "add": 2 } // increases incoming cut damage by 2 - { "value": "ARMOR_BIO", "multiply": -1.4 } // subtracts 100 percent of incoming biological damage, heals for the remaining 40% - { "value": "ARMOR_ACID", "multiply": 1.4 } // increases incoming acid damage by 140% + { "incoming_damage_mod": [ { "type": "cold", "multiply": -0.4 } ] } // subtracts 40% of incoming cold damage + { "incoming_damage_mod": [ { "type": "heat", "multiply": 0.4 } ] } // increases damage taken from fire by 40% + { "incoming_damage_mod": [ { "type": "cut", "add": 2 } ] } // increases incoming cut damage by 2 + { "incoming_damage_mod": [ { "type": "biological", "multiply": -1.4 } ] } // subtracts 100 percent of incoming biological damage + { "incoming_damage_mod": [ { "type": "acid", "multiply": 1.4 } ] } // increases incoming acid damage by 140% ``` diff --git a/src/character.h b/src/character.h index bca79ca5f3e90..6a69dcadf940c 100644 --- a/src/character.h +++ b/src/character.h @@ -1148,8 +1148,6 @@ class Character : public Creature, public visitable void perform_technique( const ma_technique &technique, Creature &t, damage_instance &di, int &move_cost, item_location &cur_weapon ); - // modifies the damage dealt based on the character's enchantments - damage_instance modify_damage_dealt_with_enchantments( const damage_instance &dam ) const override; /** * Sets up a melee attack and handles melee attack function calls * @param t Creature to attack @@ -4175,10 +4173,6 @@ class Character : public Creature, public visitable mutable time_point next_climate_control_check; mutable bool last_climate_control_ret; - // a cache of all active enchantment values. - // is recalculated every turn in Character::recalculate_enchantment_cache - pimpl enchantment_cache; - private: /* cached recipes, which are invalidated if the turn changes */ mutable time_point cached_recipe_turn; diff --git a/src/character_armor.cpp b/src/character_armor.cpp index 3e19e5cbaeefa..ea15d14b89e23 100644 --- a/src/character_armor.cpp +++ b/src/character_armor.cpp @@ -128,30 +128,12 @@ static void armor_enchantment_adjust( Character &guy, damage_unit &du ) if( du.amount < 0.1f ) { return; } - // FIXME: hardcoded damage types -> enchantments - if( du.type == STATIC( damage_type_id( "acid" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ACID ); - } else if( du.type == STATIC( damage_type_id( "bash" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_BASH ); - } else if( du.type == STATIC( damage_type_id( "biological" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_BIO ); - } else if( du.type == STATIC( damage_type_id( "cold" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_COLD ); - } else if( du.type == STATIC( damage_type_id( "cut" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_CUT ); - } else if( du.type == STATIC( damage_type_id( "electric" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ELEC ); - } else if( du.type == STATIC( damage_type_id( "heat" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_HEAT ); - } else if( du.type == STATIC( damage_type_id( "stab" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_STAB ); - } else if( du.type == STATIC( damage_type_id( "bullet" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_BULLET ); + double total = guy.enchantment_cache->modify_damage_units_by_armor_protection( du.type, du.amount ); + if( !du.type->no_resist ) { + total += guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ALL ); } - if( du.type != STATIC( damage_type_id( "pure" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ALL ); - } - du.amount = std::max( 0.0f, du.amount ); + + du.amount = std::max( 0.0, total ); } void destroyed_armor_msg( Character &who, const std::string &pre_damage_name ) @@ -170,27 +152,8 @@ void destroyed_armor_msg( Character &who, const std::string &pre_damage_name ) void post_absorbed_damage_enchantment_adjust( Character &guy, damage_unit &du ) { - // FIXME: hardcoded damage types -> enchantments - if( du.type == STATIC( damage_type_id( "acid" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::EXTRA_ACID ); - } else if( du.type == STATIC( damage_type_id( "bash" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::EXTRA_BASH ); - } else if( du.type == STATIC( damage_type_id( "biological" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::EXTRA_BIO ); - } else if( du.type == STATIC( damage_type_id( "cold" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::EXTRA_COLD ); - } else if( du.type == STATIC( damage_type_id( "cut" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::EXTRA_CUT ); - } else if( du.type == STATIC( damage_type_id( "electric" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::EXTRA_ELEC ); - } else if( du.type == STATIC( damage_type_id( "heat" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::EXTRA_HEAT ); - } else if( du.type == STATIC( damage_type_id( "stab" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::EXTRA_STAB ); - } else if( du.type == STATIC( damage_type_id( "bullet" ) ) ) { - du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::EXTRA_BULLET ); - } - du.amount = std::max( 0.0f, du.amount ); + du.amount = std::max( 0.0, guy.enchantment_cache->modify_damage_units_by_extra_damage( du.type, + du.amount ) ); } const weakpoint *Character::absorb_hit( const weakpoint_attack &, const bodypart_id &bp, diff --git a/src/character_attire.cpp b/src/character_attire.cpp index 1bd9d06d193ff..ae1bddd0a0bfb 100644 --- a/src/character_attire.cpp +++ b/src/character_attire.cpp @@ -1867,35 +1867,6 @@ item &outfit::front() return worn.front(); } -static void item_armor_enchantment_adjust( Character &guy, damage_unit &du, item &armor ) -{ - //If we're not dealing any damage of the given type, don't even bother. - if( du.amount < 0.1f ) { - return; - } - // FIXME: hardcoded damage types -> enchantments - if( du.type == STATIC( damage_type_id( "acid" ) ) ) { - du.amount = armor.calculate_by_enchantment( guy, du.amount, enchant_vals::mod::ITEM_ARMOR_ACID ); - } else if( du.type == STATIC( damage_type_id( "bash" ) ) ) { - du.amount = armor.calculate_by_enchantment( guy, du.amount, enchant_vals::mod::ITEM_ARMOR_BASH ); - } else if( du.type == STATIC( damage_type_id( "biological" ) ) ) { - du.amount = armor.calculate_by_enchantment( guy, du.amount, enchant_vals::mod::ITEM_ARMOR_BIO ); - } else if( du.type == STATIC( damage_type_id( "cold" ) ) ) { - du.amount = armor.calculate_by_enchantment( guy, du.amount, enchant_vals::mod::ITEM_ARMOR_COLD ); - } else if( du.type == STATIC( damage_type_id( "cut" ) ) ) { - du.amount = armor.calculate_by_enchantment( guy, du.amount, enchant_vals::mod::ITEM_ARMOR_CUT ); - } else if( du.type == STATIC( damage_type_id( "electric" ) ) ) { - du.amount = armor.calculate_by_enchantment( guy, du.amount, enchant_vals::mod::ITEM_ARMOR_ELEC ); - } else if( du.type == STATIC( damage_type_id( "heat" ) ) ) { - du.amount = armor.calculate_by_enchantment( guy, du.amount, enchant_vals::mod::ITEM_ARMOR_HEAT ); - } else if( du.type == STATIC( damage_type_id( "stab" ) ) ) { - du.amount = armor.calculate_by_enchantment( guy, du.amount, enchant_vals::mod::ITEM_ARMOR_STAB ); - } else if( du.type == STATIC( damage_type_id( "bullet" ) ) ) { - du.amount = armor.calculate_by_enchantment( guy, du.amount, enchant_vals::mod::ITEM_ARMOR_BULLET ); - } - du.amount = std::max( 0.0f, du.amount ); -} - void outfit::absorb_damage( Character &guy, damage_unit &elem, bodypart_id bp, std::list &worn_remains, bool &armor_destroyed ) { @@ -1926,7 +1897,6 @@ void outfit::absorb_damage( Character &guy, damage_unit &elem, bodypart_id bp, const std::string pre_damage_name = armor.tname(); bool destroy = false; - item_armor_enchantment_adjust( guy, elem, armor ); // Heat damage can set armor on fire // Even though it doesn't cause direct physical damage to it // FIXME: Hardcoded damage type diff --git a/src/creature.h b/src/creature.h index 048100ccd6665..2bfd7e63d182b 100644 --- a/src/creature.h +++ b/src/creature.h @@ -910,6 +910,7 @@ class Creature : public viewer virtual bool has_grab_break_tec() const = 0; virtual int get_throw_resist() const; + pimpl enchantment_cache; /* * Setters for stats and bonuses */ diff --git a/src/magic_enchantment.cpp b/src/magic_enchantment.cpp index cb6a1adb4e3be..263e9e68b5754 100644 --- a/src/magic_enchantment.cpp +++ b/src/magic_enchantment.cpp @@ -129,34 +129,7 @@ namespace io case enchant_vals::mod::LEARNING_FOCUS: return "LEARNING_FOCUS"; case enchant_vals::mod::RECOIL_MODIFIER: return "RECOIL_MODIFIER"; case enchant_vals::mod::ARMOR_ALL: return "ARMOR_ALL"; - case enchant_vals::mod::ARMOR_ACID: return "ARMOR_ACID"; - case enchant_vals::mod::ARMOR_BASH: return "ARMOR_BASH"; - case enchant_vals::mod::ARMOR_BIO: return "ARMOR_BIO"; - case enchant_vals::mod::ARMOR_COLD: return "ARMOR_COLD"; - case enchant_vals::mod::ARMOR_CUT: return "ARMOR_CUT"; - case enchant_vals::mod::ARMOR_ELEC: return "ARMOR_ELEC"; - case enchant_vals::mod::ARMOR_HEAT: return "ARMOR_HEAT"; - case enchant_vals::mod::ARMOR_STAB: return "ARMOR_STAB"; - case enchant_vals::mod::ARMOR_BULLET: return "ARMOR_BULLET"; - case enchant_vals::mod::EXTRA_BASH: return "EXTRA_BASH"; - case enchant_vals::mod::EXTRA_CUT: return "EXTRA_CUT"; - case enchant_vals::mod::EXTRA_STAB: return "EXTRA_STAB"; - case enchant_vals::mod::EXTRA_BULLET: return "EXTRA_BULLET"; - case enchant_vals::mod::EXTRA_HEAT: return "EXTRA_HEAT"; - case enchant_vals::mod::EXTRA_COLD: return "EXTRA_COLD"; - case enchant_vals::mod::EXTRA_ELEC: return "EXTRA_ELEC"; - case enchant_vals::mod::EXTRA_ACID: return "EXTRA_ACID"; - case enchant_vals::mod::EXTRA_BIO: return "EXTRA_BIO"; case enchant_vals::mod::EXTRA_ELEC_PAIN: return "EXTRA_ELEC_PAIN"; - case enchant_vals::mod::ITEM_ARMOR_BASH: return "ITEM_ARMOR_BASH"; - case enchant_vals::mod::ITEM_ARMOR_CUT: return "ITEM_ARMOR_CUT"; - case enchant_vals::mod::ITEM_ARMOR_STAB: return "ITEM_ARMOR_STAB"; - case enchant_vals::mod::ITEM_ARMOR_BULLET: return "ITEM_ARMOR_BULLET"; - case enchant_vals::mod::ITEM_ARMOR_HEAT: return "ITEM_ARMOR_HEAT"; - case enchant_vals::mod::ITEM_ARMOR_COLD: return "ITEM_ARMOR_COLD"; - case enchant_vals::mod::ITEM_ARMOR_ELEC: return "ITEM_ARMOR_ELEC"; - case enchant_vals::mod::ITEM_ARMOR_ACID: return "ITEM_ARMOR_ACID"; - case enchant_vals::mod::ITEM_ARMOR_BIO: return "ITEM_ARMOR_BIO"; case enchant_vals::mod::ITEM_ATTACK_SPEED: return "ITEM_ATTACK_SPEED"; case enchant_vals::mod::EQUIPMENT_DAMAGE_CHANCE: return "EQUIPMENT_DAMAGE_CHANCE"; case enchant_vals::mod::CLIMATE_CONTROL_HEAT: return "CLIMATE_CONTROL_HEAT"; @@ -245,6 +218,29 @@ void load_add_and_multiply( const JsonObject &jo, const bool &is_child, } } +template +void load_add_and_multiply( const JsonObject &jo, const std::string_view array_key, + const std::string &type_key, std::map &add_map, std::map &mult_map ) +{ + if( jo.has_array( array_key ) ) { + for( const JsonObject value_obj : jo.get_array( array_key ) ) { + + const TKey value = TKey( value_obj.get_string( type_key ) ); + const double add = value_obj.get_float( "add", 0.0 ); + const double mult = value_obj.get_float( "multiply", 0.0 ); + + if( add != 0.0 ) { + add_map.emplace( value, add ); + } + + if( mult != 0.0 ) { + mult_map.emplace( value, mult ); + } + + } + } +} + void enchantment::load_enchantment( const JsonObject &jo, const std::string &src ) { spell_factory.load( jo, src ); @@ -335,16 +331,7 @@ bool enchantment::is_monster_relevant() const // Check add values. for( const std::pair &pair_values : values_add ) { - if( pair_values.first == enchant_vals::mod::ARMOR_ACID || - pair_values.first == enchant_vals::mod::ARMOR_ALL || - pair_values.first == enchant_vals::mod::ARMOR_BASH || - pair_values.first == enchant_vals::mod::ARMOR_BIO || - pair_values.first == enchant_vals::mod::ARMOR_BULLET || - pair_values.first == enchant_vals::mod::ARMOR_COLD || - pair_values.first == enchant_vals::mod::ARMOR_CUT || - pair_values.first == enchant_vals::mod::ARMOR_ELEC || - pair_values.first == enchant_vals::mod::ARMOR_HEAT || - pair_values.first == enchant_vals::mod::ARMOR_STAB || + if( pair_values.first == enchant_vals::mod::ARMOR_ALL || pair_values.first == enchant_vals::mod::REGEN_HP || pair_values.first == enchant_vals::mod::VISION_RANGE || pair_values.first == enchant_vals::mod::SPEED || @@ -356,16 +343,7 @@ bool enchantment::is_monster_relevant() const // Check mult values. for( const std::pair &pair_values : values_multiply ) { - if( pair_values.first == enchant_vals::mod::ARMOR_ACID || - pair_values.first == enchant_vals::mod::ARMOR_ALL || - pair_values.first == enchant_vals::mod::ARMOR_BASH || - pair_values.first == enchant_vals::mod::ARMOR_BIO || - pair_values.first == enchant_vals::mod::ARMOR_BULLET || - pair_values.first == enchant_vals::mod::ARMOR_COLD || - pair_values.first == enchant_vals::mod::ARMOR_CUT || - pair_values.first == enchant_vals::mod::ARMOR_ELEC || - pair_values.first == enchant_vals::mod::ARMOR_HEAT || - pair_values.first == enchant_vals::mod::ARMOR_STAB || + if( pair_values.first == enchant_vals::mod::ARMOR_ALL || pair_values.first == enchant_vals::mod::REGEN_HP || pair_values.first == enchant_vals::mod::VISION_RANGE || pair_values.first == enchant_vals::mod::SPEED || @@ -373,6 +351,12 @@ bool enchantment::is_monster_relevant() const return true; } } + + if( damage_values_add.size() != 0 || damage_values_multiply.size() != 0 || + armor_values_add.size() != 0 || armor_values_multiply.size() != 0 ) { + return true; + } + return false; } @@ -466,12 +450,18 @@ void enchantment::load( const JsonObject &jo, const std::string_view, load_add_and_multiply( jo, is_child, "values", "value", values_add, values_multiply ); - load_add_and_multiply( jo, is_child, "skills", "value", skill_values_add, - skill_values_multiply ); + load_add_and_multiply( jo, is_child, "skills", "value", + skill_values_add, skill_values_multiply ); load_add_and_multiply( jo, is_child, "melee_damage_bonus", "type", damage_values_add, damage_values_multiply ); + load_add_and_multiply( jo, is_child, "incoming_damage_mod", "type", + armor_values_add, armor_values_multiply ); + + load_add_and_multiply( jo, is_child, "incoming_damage_mod_post_absorbed", "type", + extra_damage_add, extra_damage_multiply ); + if( !is_child && jo.has_array( "special_vision" ) ) { for( const JsonObject vision_obj : jo.get_array( "special_vision" ) ) { special_vision _vision; @@ -520,7 +510,34 @@ void enchant_cache::load( const JsonObject &jo, const std::string_view, "MOTION_VISION_RANGE", "SIGHT_RANGE_FAE", "SIGHT_RANGE_NETHER", - "SIGHT_RANGE_MINDS" + "SIGHT_RANGE_MINDS", + "ARMOR_ACID", + "ARMOR_BASH", + "ARMOR_BIO", + "ARMOR_COLD", + "ARMOR_CUT", + "ARMOR_ELEC", + "ARMOR_HEAT", + "ARMOR_STAB", + "ARMOR_BULLET", + "EXTRA_BASH", + "EXTRA_CUT", + "EXTRA_STAB", + "EXTRA_BULLET", + "EXTRA_HEAT", + "EXTRA_COLD", + "EXTRA_ELEC", + "EXTRA_ACID", + "EXTRA_BIO", + "ITEM_ARMOR_BASH", + "ITEM_ARMOR_CUT", + "ITEM_ARMOR_STAB", + "ITEM_ARMOR_BULLET", + "ITEM_ARMOR_HEAT", + "ITEM_ARMOR_COLD", + "ITEM_ARMOR_ELEC", + "ITEM_ARMOR_ACID", + "ITEM_ARMOR_BIO" // values above to be removed after 0.I }; @@ -546,33 +563,17 @@ void enchant_cache::load( const JsonObject &jo, const std::string_view, } } - if( jo.has_array( "skills" ) ) { - for( const JsonObject value_obj : jo.get_array( "skills" ) ) { - const skill_id value = skill_id( value_obj.get_string( "value" ) ); - const int add = value_obj.get_int( "add", 0 ); - const double mult = value_obj.get_float( "multiply", 0.0 ); - if( add != 0 ) { - skill_values_add.emplace( value, add ); - } - if( mult != 0.0 ) { - skill_values_multiply.emplace( value, static_cast( mult ) ); - } - } - } + load_add_and_multiply( jo, "skills", "value", + skill_values_add, skill_values_multiply ); - if( jo.has_array( "melee_damage_bonus" ) ) { - for( const JsonObject value_obj : jo.get_array( "melee_damage_bonus" ) ) { - const damage_type_id value = damage_type_id( value_obj.get_string( "type" ) ); - const int add = value_obj.get_int( "add", 0 ); - const double mult = value_obj.get_float( "multiply", 0.0 ); - if( add != 0 ) { - damage_values_add.emplace( value, add ); - } - if( mult != 0.0 ) { - damage_values_multiply.emplace( value, static_cast( mult ) ); - } - } - } + load_add_and_multiply( jo, "melee_damage_bonus", "type", + damage_values_add, damage_values_multiply ); + + load_add_and_multiply( jo, "incoming_damage_mod", "type", + armor_values_add, armor_values_multiply ); + + load_add_and_multiply( jo, "incoming_damage_mod_post_absorbed", "type", + extra_damage_add, extra_damage_multiply ); if( jo.has_array( "special_vision" ) ) { for( const JsonObject vision_obj : jo.get_array( "special_vision" ) ) { @@ -753,11 +754,11 @@ void enchant_cache::force_add( const enchant_cache &rhs ) values_multiply[pair_values.first] += pair_values.second; } - for( const std::pair &pair_values : + for( const std::pair &pair_values : rhs.skill_values_add ) { skill_values_add[pair_values.first] += pair_values.second; } - for( const std::pair &pair_values : + for( const std::pair &pair_values : rhs.skill_values_multiply ) { // values do not multiply against each other, they add. // so +10% and -10% will add to 0% @@ -774,6 +775,25 @@ void enchant_cache::force_add( const enchant_cache &rhs ) damage_values_multiply[pair_values.first] += pair_values.second; } + for( const std::pair &pair_values : rhs.armor_values_add ) { + armor_values_add[pair_values.first] += pair_values.second; + } + for( const std::pair &pair_values : + rhs.armor_values_multiply ) { + // values do not multiply against each other, they add. + // so +10% and -10% will add to 0% + armor_values_multiply[pair_values.first] += pair_values.second; + } + + for( const std::pair &pair_values : rhs.extra_damage_add ) { + extra_damage_add[pair_values.first] += pair_values.second; + } + for( const std::pair &pair_values : + rhs.extra_damage_multiply ) { + // values do not multiply against each other, they add. + // so +10% and -10% will add to 0% + extra_damage_multiply[pair_values.first] += pair_values.second; + } // from cache to cache? for( const special_vision &struc : rhs.special_vision_vector ) { special_vision_vector.emplace_back( special_vision{ @@ -883,6 +903,39 @@ void enchant_cache::force_add_with_dialogue( const enchantment &rhs, const const } } + for( const std::pair &pair_values : + rhs.armor_values_add ) { + if( evaluate ) { + armor_values_add[pair_values.first] += pair_values.second.evaluate( d ); + } else { + armor_values_add[pair_values.first] += pair_values.second.constant(); + } + } + for( const std::pair &pair_values : + rhs.armor_values_multiply ) { + if( evaluate ) { + armor_values_multiply[pair_values.first] += pair_values.second.evaluate( d ); + } else { + armor_values_multiply[pair_values.first] += pair_values.second.constant(); + } + } + + for( const std::pair &pair_values : + rhs.extra_damage_add ) { + if( evaluate ) { + extra_damage_add[pair_values.first] += pair_values.second.evaluate( d ); + } else { + extra_damage_add[pair_values.first] += pair_values.second.constant(); + } + } + for( const std::pair &pair_values : + rhs.extra_damage_multiply ) { + if( evaluate ) { + extra_damage_multiply[pair_values.first] += pair_values.second.evaluate( d ); + } else { + extra_damage_multiply[pair_values.first] += pair_values.second.constant(); + } + } for( const enchantment::special_vision &struc : rhs.special_vision_vector ) { if( evaluate ) { special_vision_vector.emplace_back( special_vision{ @@ -1031,7 +1084,7 @@ double enchant_cache::get_value_add( const enchant_vals::mod value ) const return found->second; } -int enchant_cache::get_skill_value_add( const skill_id &value ) const +double enchant_cache::get_skill_value_add( const skill_id &value ) const { const auto found = skill_values_add.find( value ); if( found == skill_values_add.cend() ) { @@ -1049,6 +1102,24 @@ int enchant_cache::get_damage_add( const damage_type_id &value ) const return found->second; } +int enchant_cache::get_armor_add( const damage_type_id &value ) const +{ + const auto found = armor_values_add.find( value ); + if( found == armor_values_add.cend() ) { + return 0; + } + return found->second; +} + +int enchant_cache::get_extra_damage_add( const damage_type_id &value ) const +{ + const auto found = extra_damage_add.find( value ); + if( found == extra_damage_add.cend() ) { + return 0; + } + return found->second; +} + double enchant_cache::get_value_multiply( const enchant_vals::mod value ) const { const auto found = values_multiply.find( value ); @@ -1121,6 +1192,24 @@ double enchant_cache::get_damage_multiply( const damage_type_id &value ) const return found->second; } +double enchant_cache::get_armor_multiply( const damage_type_id &value ) const +{ + const auto found = armor_values_multiply.find( value ); + if( found == armor_values_multiply.cend() ) { + return 0; + } + return found->second; +} + +double enchant_cache::get_extra_damage_multiply( const damage_type_id &value ) const +{ + const auto found = extra_damage_multiply.find( value ); + if( found == extra_damage_multiply.cend() ) { + return 0; + } + return found->second; +} + double enchant_cache::modify_value( const enchant_vals::mod mod_val, double value ) const { value += get_value_add( mod_val ); @@ -1182,6 +1271,25 @@ double enchant_cache::modify_melee_damage( const damage_type_id &mod_val, double return value; } +double enchant_cache::modify_damage_units_by_armor_protection( const damage_type_id &mod_val, + double value ) const +{ + // since it's armor bonus, and we modify the damage units applied on damage absorbtion + // we decrease said value; 10 damage taken and +6 damage mitigation + // result in [10 - 6 =] 4 damage taken + value += get_armor_add( mod_val ); + value *= 1.0 + get_armor_multiply( mod_val ); + return value; +} + +double enchant_cache::modify_damage_units_by_extra_damage( const damage_type_id &mod_val, + double value ) const +{ + value += get_extra_damage_add( mod_val ); + value *= 1.0 + get_extra_damage_multiply( mod_val ); + return value; +} + int enchant_cache::mult_bonus( enchant_vals::mod value_type, int base_value ) const { return get_value_multiply( value_type ) * base_value; diff --git a/src/magic_enchantment.h b/src/magic_enchantment.h index e7e74dae70593..b6ac369273aeb 100644 --- a/src/magic_enchantment.h +++ b/src/magic_enchantment.h @@ -103,36 +103,9 @@ enum class mod : int { MENDING_MODIFIER, STOMACH_SIZE_MULTIPLIER, LEARNING_FOCUS, - ARMOR_ACID, ARMOR_ALL, - ARMOR_BASH, - ARMOR_BIO, - ARMOR_BULLET, - ARMOR_COLD, - ARMOR_CUT, - ARMOR_ELEC, - ARMOR_HEAT, - ARMOR_STAB, - EXTRA_BASH, - EXTRA_CUT, - EXTRA_STAB, - EXTRA_BULLET, - EXTRA_HEAT, - EXTRA_COLD, - EXTRA_ELEC, - EXTRA_ACID, - EXTRA_BIO, EXTRA_ELEC_PAIN, RECOIL_MODIFIER, //affects recoil when shooting a gun - ITEM_ARMOR_BASH, - ITEM_ARMOR_CUT, - ITEM_ARMOR_STAB, - ITEM_ARMOR_BULLET, - ITEM_ARMOR_HEAT, - ITEM_ARMOR_COLD, - ITEM_ARMOR_ELEC, - ITEM_ARMOR_ACID, - ITEM_ARMOR_BIO, ITEM_ATTACK_SPEED, EQUIPMENT_DAMAGE_CHANCE, CLIMATE_CONTROL_HEAT, @@ -263,6 +236,12 @@ class enchantment std::map damage_values_add; // NOLINT(cata-serialize) std::map damage_values_multiply; // NOLINT(cata-serialize) + std::map armor_values_add; // NOLINT(cata-serialize) + std::map armor_values_multiply; // NOLINT(cata-serialize) + + std::map extra_damage_add; // NOLINT(cata-serialize) + std::map extra_damage_multiply; // NOLINT(cata-serialize) + std::vector hit_me_effect; std::vector hit_you_effect; @@ -315,6 +294,8 @@ class enchant_cache : public enchantment time_duration modify_value( enchant_vals::mod mod_val, time_duration value ) const; double modify_melee_damage( const damage_type_id &mod_val, double value ) const; + double modify_damage_units_by_armor_protection( const damage_type_id &mod_val, double value ) const; + double modify_damage_units_by_extra_damage( const damage_type_id &mod_val, double value ) const; // adds two enchantments together and ignores their conditions void force_add( const enchantment &rhs, const Character &guy ); void force_add( const enchantment &rhs, const monster &mon ); @@ -329,10 +310,14 @@ class enchant_cache : public enchantment double get_value_multiply( enchant_vals::mod value ) const; int mult_bonus( enchant_vals::mod value_type, int base_value ) const; - int get_skill_value_add( const skill_id &value ) const; + double get_skill_value_add( const skill_id &value ) const; int get_damage_add( const damage_type_id &value ) const; + int get_armor_add( const damage_type_id &value ) const; + int get_extra_damage_add( const damage_type_id &value ) const; double get_skill_value_multiply( const skill_id &value ) const; double get_damage_multiply( const damage_type_id &value ) const; + double get_armor_multiply( const damage_type_id &value ) const; + double get_extra_damage_multiply( const damage_type_id &value ) const; int skill_mult_bonus( const skill_id &value_type, int base_value ) const; // attempts to add two like enchantments together. // if their conditions don't match, return false. else true. @@ -391,12 +376,18 @@ class enchant_cache : public enchantment std::map values_multiply; // NOLINT(cata-serialize) // the exact same as above, though specifically for skills - std::map skill_values_add; // NOLINT(cata-serialize) - std::map skill_values_multiply; // NOLINT(cata-serialize) + std::map skill_values_add; // NOLINT(cata-serialize) + std::map skill_values_multiply; // NOLINT(cata-serialize) std::map damage_values_add; // NOLINT(cata-serialize) std::map damage_values_multiply; // NOLINT(cata-serialize) + std::map armor_values_add; // NOLINT(cata-serialize) + std::map armor_values_multiply; // NOLINT(cata-serialize) + + std::map extra_damage_add; // NOLINT(cata-serialize) + std::map extra_damage_multiply; // NOLINT(cata-serialize) + }; template struct enum_traits; diff --git a/src/melee.cpp b/src/melee.cpp index c777e8f3acde5..ea6a92711bf95 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -508,11 +508,6 @@ bool Character::melee_attack( Creature &t, bool allow_special ) } damage_instance Creature::modify_damage_dealt_with_enchantments( const damage_instance &dam ) const -{ - return dam; -} - -damage_instance Character::modify_damage_dealt_with_enchantments( const damage_instance &dam ) const { damage_instance modified; diff --git a/src/monster.cpp b/src/monster.cpp index cdc9bb9d8ad92..beceaab98fd20 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -231,37 +231,19 @@ static int compute_kill_xp( const mtype_id &mon_type ) return mon_type->difficulty + mon_type->difficulty_base; } -// adjusts damage unit depending on type by enchantments. static void armor_enchantment_adjust( monster &mon, damage_unit &du ) { //If we're not dealing any damage of the given type, don't even bother. if( du.amount < 0.1f ) { return; } - // FIXME: hardcoded damage types -> enchantments - if( du.type == STATIC( damage_type_id( "acid" ) ) ) { - du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ACID ); - } else if( du.type == STATIC( damage_type_id( "bash" ) ) ) { - du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_BASH ); - } else if( du.type == STATIC( damage_type_id( "biological" ) ) ) { - du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_BIO ); - } else if( du.type == STATIC( damage_type_id( "cold" ) ) ) { - du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_COLD ); - } else if( du.type == STATIC( damage_type_id( "cut" ) ) ) { - du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_CUT ); - } else if( du.type == STATIC( damage_type_id( "electric" ) ) ) { - du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ELEC ); - } else if( du.type == STATIC( damage_type_id( "heat" ) ) ) { - du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_HEAT ); - } else if( du.type == STATIC( damage_type_id( "stab" ) ) ) { - du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_STAB ); - } else if( du.type == STATIC( damage_type_id( "bullet" ) ) ) { - du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_BULLET ); - } - if( du.type != STATIC( damage_type_id( "pure" ) ) ) { - du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ALL ); - } - du.amount = std::max( 0.0f, du.amount ); + + double total = mon.enchantment_cache->modify_damage_units_by_armor_protection( du.type, du.amount ); + if( !du.type->no_resist ) { + total += mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ALL ); + } + + du.amount = std::max( 0.0, total ); } monster::monster() @@ -2091,6 +2073,8 @@ bool monster::melee_attack( Creature &target, float accuracy ) damage.add_damage( damage_bash, dice( type->melee_dice, type->melee_sides ) ); } + modify_damage_dealt_with_enchantments( damage ); + dealt_damage_instance dealt_dam; if( hitspread >= 0 ) { diff --git a/src/monster.h b/src/monster.h index 29ec1e619e036..0f08b861913a3 100644 --- a/src/monster.h +++ b/src/monster.h @@ -587,8 +587,6 @@ class monster : public Creature std::optional lastseen_turn; - pimpl enchantment_cache; - // Stair data. int staircount = 0; From 78d2f9059ca854c25367654f27ee6eba81a353cc Mon Sep 17 00:00:00 2001 From: GuardianDll Date: Tue, 10 Dec 2024 20:08:22 +0100 Subject: [PATCH 034/158] move few function from character/monster to creature --- src/character.cpp | 11 ----------- src/character.h | 2 -- src/character_armor.cpp | 22 ++-------------------- src/character_attire.h | 1 - src/creature.cpp | 32 ++++++++++++++++++++++++++++++++ src/creature.h | 4 ++++ src/item.cpp | 27 --------------------------- src/item.h | 2 -- src/monster.cpp | 30 +++--------------------------- src/monster.h | 2 -- 10 files changed, 41 insertions(+), 92 deletions(-) diff --git a/src/character.cpp b/src/character.cpp index 64e59322931e7..733cdd127c327 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -7746,17 +7746,6 @@ void Character::recalculate_enchantment_cache() recalc_hp(); } -double Character::calculate_by_enchantment( double modify, enchant_vals::mod value, - bool round_output ) const -{ - modify += enchantment_cache->get_value_add( value ); - modify *= 1.0 + enchantment_cache->get_value_multiply( value ); - if( round_output ) { - modify = std::round( modify ); - } - return modify; -} - void Character::passive_absorb_hit( const bodypart_id &bp, damage_unit &du ) const { // >0 check because some mutations provide negative armor diff --git a/src/character.h b/src/character.h index 6a69dcadf940c..af8a574726ba6 100644 --- a/src/character.h +++ b/src/character.h @@ -1572,8 +1572,6 @@ class Character : public Creature, public visitable // recalculates enchantment cache by iterating through all held, worn, and wielded items void recalculate_enchantment_cache(); // gets add and mult value from enchantment cache - double calculate_by_enchantment( double modify, enchant_vals::mod value, - bool round_output = false ) const; /** Returns true if the player has any martial arts buffs attached */ bool has_mabuff( const mabuff_id &buff_id ) const; diff --git a/src/character_armor.cpp b/src/character_armor.cpp index ea15d14b89e23..766f8f2f3d846 100644 --- a/src/character_armor.cpp +++ b/src/character_armor.cpp @@ -122,19 +122,7 @@ int Character::get_env_resist( bodypart_id bp ) const // adjusts damage unit depending on type by enchantments. // the ITEM_ enchantments only affect the damage resistance for that one item, while the others affect all of them -static void armor_enchantment_adjust( Character &guy, damage_unit &du ) -{ - //If we're not dealing any damage of the given type, don't even bother. - if( du.amount < 0.1f ) { - return; - } - double total = guy.enchantment_cache->modify_damage_units_by_armor_protection( du.type, du.amount ); - if( !du.type->no_resist ) { - total += guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ALL ); - } - du.amount = std::max( 0.0, total ); -} void destroyed_armor_msg( Character &who, const std::string &pre_damage_name ) { @@ -150,12 +138,6 @@ void destroyed_armor_msg( Character &who, const std::string &pre_damage_name ) pre_damage_name ); } -void post_absorbed_damage_enchantment_adjust( Character &guy, damage_unit &du ) -{ - du.amount = std::max( 0.0, guy.enchantment_cache->modify_damage_units_by_extra_damage( du.type, - du.amount ) ); -} - const weakpoint *Character::absorb_hit( const weakpoint_attack &, const bodypart_id &bp, damage_instance &dam ) { @@ -209,13 +191,13 @@ const weakpoint *Character::absorb_hit( const weakpoint_attack &, const bodypart } } - armor_enchantment_adjust( *this, elem ); + adjust_taken_damage_by_enchantments( elem ); worn.absorb_damage( *this, elem, bp, worn_remains, armor_destroyed ); passive_absorb_hit( bp, elem ); - post_absorbed_damage_enchantment_adjust( *this, elem ); + adjust_taken_damage_by_enchantments_post_absorbed( elem ); elem.amount = std::max( elem.amount, 0.0f ); } map &here = get_map(); diff --git a/src/character_attire.h b/src/character_attire.h index a3697a7f86d22..bc1de53091fb7 100644 --- a/src/character_attire.h +++ b/src/character_attire.h @@ -263,7 +263,6 @@ class outfit }; units::mass get_selected_stack_weight( const item *i, const std::map &without ); -void post_absorbed_damage_enchantment_adjust( Character &guy, damage_unit &du ); void destroyed_armor_msg( Character &who, const std::string &pre_damage_name ); #endif // CATA_SRC_CHARACTER_ATTIRE_H diff --git a/src/creature.cpp b/src/creature.cpp index d102156bc51df..2ad7701d58cb4 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -3359,6 +3359,38 @@ void Creature::knock_back_from( const tripoint &p ) knock_back_to( to ); } +double Creature::calculate_by_enchantment( double modify, enchant_vals::mod value, + bool round_output ) const +{ + modify += enchantment_cache->get_value_add( value ); + modify *= 1.0 + enchantment_cache->get_value_multiply( value ); + if( round_output ) { + modify = std::round( modify ); + } + return modify; +} + +void Creature::adjust_taken_damage_by_enchantments( damage_unit &du ) const +{ + //If we're not dealing any damage of the given type, don't even bother. + if( du.amount < 0.1f ) { + return; + } + + double total = enchantment_cache->modify_damage_units_by_armor_protection( du.type, du.amount ); + if( !du.type->no_resist ) { + total += calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ALL ); + } + + du.amount = std::max( 0.0, total ); +} + +void Creature::adjust_taken_damage_by_enchantments_post_absorbed( damage_unit &du ) const +{ + du.amount = std::max( 0.0, enchantment_cache->modify_damage_units_by_extra_damage( du.type, + du.amount ) ); +} + void Creature::add_msg_if_player( const translation &msg ) const { return add_msg_if_player( msg.translated() ); diff --git a/src/creature.h b/src/creature.h index 2bfd7e63d182b..2869425097a17 100644 --- a/src/creature.h +++ b/src/creature.h @@ -439,6 +439,10 @@ class Creature : public viewer // TODO: this is just a shim so knockbacks work void knock_back_from( const tripoint &p ); + double calculate_by_enchantment( double modify, enchant_vals::mod value, + bool round_output = false ) const; + void adjust_taken_damage_by_enchantments( damage_unit &du ) const; + void adjust_taken_damage_by_enchantments_post_absorbed( damage_unit &du ) const; virtual void knock_back_to( const tripoint &to ) = 0; // Converts the "cover_vitals" protection on the specified body part into diff --git a/src/item.cpp b/src/item.cpp index 607694cc5cb22..ce24b2d7922b8 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -10152,33 +10152,6 @@ std::vector item::get_defined_enchantments() const return type->relic_data->get_defined_enchantments(); } -double item::calculate_by_enchantment( const Character &owner, double modify, - enchant_vals::mod value, bool round_value ) const -{ - double add_value = 0.0; - double mult_value = 1.0; - for( const enchant_cache &ench : get_proc_enchantments() ) { - if( ench.is_active( owner, *this ) ) { - add_value += ench.get_value_add( value ); - mult_value += ench.get_value_multiply( value ); - } - } - if( type->relic_data ) { - for( const enchantment &ench : type->relic_data->get_defined_enchantments() ) { - if( ench.is_active( owner, *this ) ) { - add_value += ench.get_value_add( value, owner ); - mult_value += ench.get_value_multiply( value, owner ); - } - } - } - modify += add_value; - modify *= mult_value; - if( round_value ) { - modify = std::round( modify ); - } - return modify; -} - double item::calculate_by_enchantment_wield( const Character &owner, double modify, enchant_vals::mod value, bool round_value ) const diff --git a/src/item.h b/src/item.h index 609de1e482bdb..461fd00251b50 100644 --- a/src/item.h +++ b/src/item.h @@ -2937,8 +2937,6 @@ class item : public visitable std::vector get_proc_enchantments() const; std::vector get_defined_enchantments() const; - double calculate_by_enchantment( const Character &owner, double modify, enchant_vals::mod value, - bool round_value = false ) const; // calculates the enchantment value as if this item were wielded. double calculate_by_enchantment_wield( const Character &owner, double modify, enchant_vals::mod value, diff --git a/src/monster.cpp b/src/monster.cpp index beceaab98fd20..3abc3cffe529b 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -231,21 +231,6 @@ static int compute_kill_xp( const mtype_id &mon_type ) return mon_type->difficulty + mon_type->difficulty_base; } -static void armor_enchantment_adjust( monster &mon, damage_unit &du ) -{ - //If we're not dealing any damage of the given type, don't even bother. - if( du.amount < 0.1f ) { - return; - } - - double total = mon.enchantment_cache->modify_damage_units_by_armor_protection( du.type, du.amount ); - if( !du.type->no_resist ) { - total += mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ALL ); - } - - du.amount = std::max( 0.0, total ); -} - monster::monster() { unset_dest(); @@ -2012,7 +1997,7 @@ const weakpoint *monster::absorb_hit( const weakpoint_attack &attack, const body const weakpoint *wp = type->weakpoints.select_weakpoint( attack ); wp->apply_to( r ); for( damage_unit &elem : dam.damage_units ) { - armor_enchantment_adjust( *this, elem ); + adjust_taken_damage_by_enchantments( elem ); add_msg_debug( debugmode::DF_MONSTER, "Dam Type: %s :: Dam Amt: %.1f :: Ar Pen: %.1f :: Armor Mult: %.1f", elem.type.c_str(), elem.amount, elem.res_pen, elem.res_mult ); @@ -2023,7 +2008,9 @@ const weakpoint *monster::absorb_hit( const weakpoint_attack &attack, const body r.get_effective_resist( elem ) ); elem.amount -= std::min( r.get_effective_resist( elem ) + get_worn_armor_val( elem.type ), elem.amount ); + adjust_taken_damage_by_enchantments_post_absorbed( elem ); } + wp->apply_to( dam, attack.is_crit ); return wp; } @@ -4079,14 +4066,3 @@ std::function monster::get_path_avoid() const return false; }; } - -double monster::calculate_by_enchantment( double modify, enchant_vals::mod value, - bool round_output ) const -{ - modify += enchantment_cache->get_value_add( value ); - modify *= 1.0 + enchantment_cache->get_value_multiply( value ); - if( round_output ) { - modify = std::round( modify ); - } - return modify; -} diff --git a/src/monster.h b/src/monster.h index 0f08b861913a3..4608d104e2c3f 100644 --- a/src/monster.h +++ b/src/monster.h @@ -619,8 +619,6 @@ class monster : public Creature const pathfinding_settings &get_pathfinding_settings() const override; std::function get_path_avoid() const override; - double calculate_by_enchantment( double modify, enchant_vals::mod value, - bool round_output = false ) const; private: void process_trigger( mon_trigger trig, int amount ); void process_trigger( mon_trigger trig, const std::function &amount_func ); From 6efeaaf457cd8b7e581c06aab5d4ba9549e08654 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:28:23 +0000 Subject: [PATCH 035/158] Replace more raw strings --- src/faction_camp.cpp | 333 +++++++++++++++++++------------------------ 1 file changed, 144 insertions(+), 189 deletions(-) diff --git a/src/faction_camp.cpp b/src/faction_camp.cpp index 8d678b6804baa..dabd67bfbad7d 100644 --- a/src/faction_camp.cpp +++ b/src/faction_camp.cpp @@ -103,6 +103,9 @@ static const item_group_id Item_spawn_data_forest( "forest" ); static const item_group_id Item_spawn_data_gathering_faction_camp_firewood( "gathering_faction_camp_firewood" ); +static const itype_id itype_camp_meal_large( "camp_meal_large" ); +static const itype_id itype_camp_meal_medium( "camp_meal_medium" ); +static const itype_id itype_camp_meal_small( "camp_meal_small" ); static const itype_id itype_duffelbag( "duffelbag" ); static const itype_id itype_fungal_seeds( "fungal_seeds" ); static const itype_id itype_log( "log" ); @@ -113,11 +116,17 @@ static const mongroup_id GROUP_CAMP_HUNTING( "GROUP_CAMP_HUNTING" ); static const mongroup_id GROUP_CAMP_HUNTING_LARGE( "GROUP_CAMP_HUNTING_LARGE" ); static const mongroup_id GROUP_CAMP_TRAPPING( "GROUP_CAMP_TRAPPING" ); +static const oter_str_id oter_faction_hide_site_0( "faction_hide_site_0" ); +static const oter_str_id oter_field( "field" ); + +static const oter_type_str_id oter_type_faction_hide_site_0( "faction_hide_site_0" ); static const oter_type_str_id oter_type_field( "field" ); static const oter_type_str_id oter_type_forest( "forest" ); static const oter_type_str_id oter_type_forest_thick( "forest_thick" ); static const oter_type_str_id oter_type_forest_trail( "forest_trail" ); static const oter_type_str_id oter_type_forest_trail_intersection( "forest_trail_intersection" ); +static const oter_type_str_id oter_type_forest_water( "forest_water" ); +static const oter_type_str_id oter_type_road( "road" ); static const oter_type_str_id oter_type_rural_road( "rural_road" ); static const oter_type_str_id oter_type_rural_road_forest( "rural_road_forest" ); static const oter_type_str_id oter_type_special_forest( "special_forest" ); @@ -156,23 +165,28 @@ static const ter_str_id ter_t_trunk( "t_trunk" ); static const trait_id trait_DEBUG_HS( "DEBUG_HS" ); +static const update_mapgen_id +update_mapgen_faction_expansion_salt_water_pipe_N( "faction_expansion_salt_water_pipe_N" ); +static const update_mapgen_id +update_mapgen_faction_expansion_salt_water_pipe_NE( "faction_expansion_salt_water_pipe_NE" ); +static const update_mapgen_id +update_mapgen_faction_expansion_salt_water_pipe_swamp_N( "faction_expansion_salt_water_pipe_swamp_N" ); +static const update_mapgen_id +update_mapgen_faction_expansion_salt_water_pipe_swamp_NE( "faction_expansion_salt_water_pipe_swamp_NE" ); +static const update_mapgen_id update_mapgen_faction_wall_level_E_0( "faction_wall_level_E_0" ); static const update_mapgen_id update_mapgen_faction_wall_level_E_1( "faction_wall_level_E_1" ); -//static const update_mapgen_id update_mapgen_faction_wall_level_N_1( -// faction_wall_level_n_1_string.c_str() ); +static const update_mapgen_id update_mapgen_faction_wall_level_N_0( "faction_wall_level_N_0" ); +static const update_mapgen_id update_mapgen_faction_wall_level_N_1( "faction_wall_level_N_1" ); +static const update_mapgen_id update_mapgen_faction_wall_level_S_0( "faction_wall_level_S_0" ); static const update_mapgen_id update_mapgen_faction_wall_level_S_1( "faction_wall_level_S_1" ); +static const update_mapgen_id update_mapgen_faction_wall_level_W_0( "faction_wall_level_W_0" ); static const update_mapgen_id update_mapgen_faction_wall_level_W_1( "faction_wall_level_W_1" ); static const zone_type_id zone_type_CAMP_FOOD( "CAMP_FOOD" ); static const zone_type_id zone_type_CAMP_STORAGE( "CAMP_STORAGE" ); -// Moved the constant compound "string" declaration into a jumble here rather than where they belong -// because placing them together with their context is rejected by 'cata-static-string_id-constants, -warnings-as-errors' static const std::string faction_wall_level_n_0_string = "faction_wall_level_N_0"; static const std::string faction_wall_level_n_1_string = "faction_wall_level_N_1"; -static const std::string faction_hide_site_0_string = "faction_hide_site_0"; -static const oter_str_id oter_faction_hide_site_0( faction_hide_site_0_string ); -static const update_mapgen_id update_mapgen_faction_wall_level_N_1( - faction_wall_level_n_1_string.c_str() ); static const std::string camp_om_fortifications_trench_parameter = faction_wall_level_n_0_string; static const std::string camp_om_fortifications_spiked_trench_parameter = @@ -186,6 +200,7 @@ static const std::string var_timer_time_of_last_succession = // These strings are matched against recipe group 'building_type'. Definite candidates for JSON definitions of // the various UI strings corresponding to these groups. +// TODO: Replace with enum? static const std::string base_recipe_group_string = "BASE"; static const std::string cook_recipe_group_string = "COOK"; static const std::string farm_recipe_group_string = "FARM"; @@ -262,10 +277,9 @@ static bool om_set_hide_site( npc &comp, const tripoint_abs_omt &omt_tgt, */ static tripoint_abs_omt om_target_tile( const tripoint_abs_omt &omt_pos, int min_range = 1, int range = 1, - const std::vector &possible_om_types = {}, ot_match_type match_type = - ot_match_type::exact, bool must_see = true, - const tripoint_abs_omt &source = tripoint_abs_omt::invalid, - bool bounce = false, const std::optional &message = std::nullopt ); + const std::unordered_set &possible_om_types = {}, bool must_see = true, + const tripoint_abs_omt &source = tripoint_abs_omt::invalid, bool bounce = false, + const std::optional &message = std::nullopt ); static void om_range_mark( const tripoint_abs_omt &origin, int range, bool add_notes = true, const std::string &message = "Y;X: MAX RANGE" ); static void om_line_mark( @@ -311,22 +325,6 @@ static std::string camp_trip_description( const time_duration &total_time, */ static bool survive_random_encounter( npc &comp, std::string &situation, int favor, int threat ); -// Hard coded blueprint names used to route the code to the salt water pipe code. -static const std::string faction_expansion_salt_water_pipe_swamp_base = - "faction_expansion_salt_water_pipe_swamp_"; -static const std::string faction_expansion_salt_water_pipe_swamp_N = - faction_expansion_salt_water_pipe_swamp_base + "N"; -static const std::string faction_expansion_salt_water_pipe_swamp_NE = - faction_expansion_salt_water_pipe_swamp_base + "NE"; -static const std::string faction_expansion_salt_water_pipe_base = - "faction_expansion_salt_water_pipe_"; -static const std::string faction_expansion_salt_water_pipe_N = - faction_expansion_salt_water_pipe_base + - "N"; -static const std::string faction_expansion_salt_water_pipe_NE = - faction_expansion_salt_water_pipe_base + - "NE"; - static std::string mission_ui_activity_of( const mission_id &miss_id ) { const std::string dir_abbr = base_camps::all_directions.at( @@ -1390,7 +1388,7 @@ void basecamp::get_available_missions( mission_data &mission_key, map &here ) for( const auto &dir : base_camps::all_directions ) { if( dir.first != base_camps::base_dir && expansions.find( dir.first ) == expansions.end() ) { const oter_id &omt_ref = overmap_buffer.ter( omt_pos + dir.first ); - if( !free_non_field_found && omt_ref != oter_id( "field" ) ) { + if( !free_non_field_found && omt_ref->get_type_id() != oter_type_field ) { free_non_field_found = true; } if( !possible_expansion_found ) { @@ -2078,10 +2076,10 @@ comp_list basecamp::start_multi_mission( const mission_id &miss_id, void basecamp::start_upgrade( const mission_id &miss_id ) { const recipe &making = *recipe_id( miss_id.parameters ); - if( making.get_blueprint().str() == faction_expansion_salt_water_pipe_swamp_N ) { + if( making.get_blueprint() == update_mapgen_faction_expansion_salt_water_pipe_swamp_N ) { start_salt_water_pipe( miss_id ); return; - } else if( making.get_blueprint().str() == faction_expansion_salt_water_pipe_N ) { + } else if( making.get_blueprint() == update_mapgen_faction_expansion_salt_water_pipe_N ) { continue_salt_water_pipe( miss_id ); return; } @@ -2496,7 +2494,7 @@ static void change_cleared_terrain( tripoint_abs_omt forest ) const oter_id &omt_trees = overmap_buffer.ter( forest ); // Oter types before and after clear cutting, if value (after) is linear, key (before) should also be linear, otherwise any combination of rotatable/linear/not rotatable should work - const std::unordered_map clear_cut_conversion = { + static const std::unordered_map clear_cut_conversion = { { oter_type_forest, oter_type_field }, { oter_type_forest_thick, oter_type_field }, { oter_type_forest_trail, oter_type_field }, @@ -2526,18 +2524,17 @@ static void change_cleared_terrain( tripoint_abs_omt forest ) } } -static const std::vector terrains_forest = { "forest", "forest_thick", "forest_trail", "rural_road_forest", "rural_road_turn_forest", "rural_road_turn1_forest", "rural_road_3way_forest", "dirt_road_forest", "dirt_road_3way_forest", "dirt_road_turn_forest", "forest_trail_intersection", "special_forest", "special_forest_thick", "forest_trail_isolated", "forest_trail_end" }; -static const std::vector terrains_field_swamp_forest = [] { - std::vector tmp = terrains_forest; - tmp.emplace_back( "field" ); - tmp.emplace_back( "forest_water" ); +static const std::unordered_set terrains_forest = { oter_type_forest, oter_type_forest_thick, oter_type_forest_trail, oter_type_forest_trail_intersection, oter_type_rural_road_forest, oter_type_special_forest, oter_type_special_forest_thick }; +static const std::unordered_set terrains_field_swamp_forest = [] { + std::unordered_set tmp = terrains_forest; + tmp.insert( oter_type_field ); + tmp.insert( oter_type_forest_water ); return tmp; }(); - void basecamp::start_cut_logs( const mission_id &miss_id, float exertion_level ) { - tripoint_abs_omt forest = om_target_tile( omt_pos, 1, 50, terrains_forest, ot_match_type::type, + tripoint_abs_omt forest = om_target_tile( omt_pos, 1, 50, terrains_forest, _( "Select a forest (or road/trail) from %d to %d tiles away." ) ); if( !forest.is_invalid() ) { standard_npc sample_npc( "Temp" ); @@ -2583,7 +2580,7 @@ void basecamp::start_cut_logs( const mission_id &miss_id, float exertion_level ) void basecamp::start_clearcut( const mission_id &miss_id, float exertion_level ) { popup( _( "Forests are the only valid cutting locations, with forest dirt roads, forest rural roads, and trails being valid as well. Note that it's likely both forest and field roads look exactly the same after having been cleared." ) ); - tripoint_abs_omt forest = om_target_tile( omt_pos, 1, 50, terrains_forest, ot_match_type::type ); + tripoint_abs_omt forest = om_target_tile( omt_pos, 1, 50, terrains_forest ); if( !forest.is_invalid() ) { standard_npc sample_npc( "Temp" ); sample_npc.set_fake( true ); @@ -2616,9 +2613,8 @@ void basecamp::start_clearcut( const mission_id &miss_id, float exertion_level ) void basecamp::start_setup_hide_site( const mission_id &miss_id, float exertion_level ) { - tripoint_abs_omt forest = om_target_tile( omt_pos, 10, 90, terrains_field_swamp_forest, - ot_match_type::type, - true, omt_pos, true, _( "Select a forest, swamp, or field from %d to %d tiles away." ) ); + tripoint_abs_omt forest = om_target_tile( omt_pos, 10, 90, terrains_field_swamp_forest, true, + omt_pos, true, _( "Select a forest, swamp, or field from %d to %d tiles away." ) ); if( !forest.is_invalid() ) { pf::simple_path path = overmap_buffer.get_travel_path( omt_pos, forest, overmap_path_params::for_npc() ); @@ -2658,13 +2654,12 @@ void basecamp::start_setup_hide_site( const mission_id &miss_id, float exertion_ } static const tripoint_omt_ms relay_site_stash{ 11, 10, 0 }; -static const std::vector hide_locations = { faction_hide_site_0_string }; void basecamp::start_relay_hide_site( const mission_id &miss_id, float exertion_level ) { - tripoint_abs_omt forest = om_target_tile( omt_pos, 10, 90, hide_locations, ot_match_type::exact, - true, omt_pos, true, string_format( - _( "Select an existing hide site from %d to %d tiles away." ), 10, 90 ) ); + const std::unordered_set hide_locations = { oter_type_faction_hide_site_0 }; + tripoint_abs_omt forest = om_target_tile( omt_pos, 10, 90, hide_locations, true, omt_pos, true, + string_format( _( "Select an existing hide site from %d to %d tiles away." ), 10, 90 ) ); if( !forest.is_invalid() ) { pf::simple_path path = overmap_buffer.get_travel_path( omt_pos, forest, overmap_path_params::for_npc() ); @@ -2731,54 +2726,48 @@ void basecamp::start_relay_hide_site( const mission_id &miss_id, float exertion_ // Stupid "the const qualified parameter 'comp' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param,-warnings-as-errors]" demands the pointer to be referenced... static void apply_fortifications( const mission_id &miss_id, const npc_ptr *comp, bool start ) { - update_mapgen_id build_n{ faction_wall_level_n_0_string }; - update_mapgen_id build_e{ "faction_wall_level_E_0" }; - update_mapgen_id build_s{ "faction_wall_level_S_0" }; - update_mapgen_id build_w{ "faction_wall_level_W_0" }; - if( miss_id.parameters == faction_wall_level_n_1_string || - // Handling of old format (changed mid 0.F) below - ( miss_id.parameters.empty() && - comp[0]->companion_mission_role_id == faction_wall_level_n_1_string ) ) { - build_n = update_mapgen_faction_wall_level_N_1; - build_e = update_mapgen_faction_wall_level_E_1; - build_s = update_mapgen_faction_wall_level_S_1; - build_w = update_mapgen_faction_wall_level_W_1; - } - update_mapgen_id build_first = build_e; - update_mapgen_id build_second = build_w; - bool build_dir_NS = comp[0]->companion_mission_points[0].y() != - comp[0]->companion_mission_points[1].y(); - if( build_dir_NS ) { - build_first = build_s; - build_second = build_n; - } - //Add fences auto &build_point = comp[0]->companion_mission_points; + static const std::array, 4> pits { { + { update_mapgen_faction_wall_level_S_0, update_mapgen_faction_wall_level_N_0 }, + { update_mapgen_faction_wall_level_E_0, update_mapgen_faction_wall_level_W_0 }, + { update_mapgen_faction_wall_level_S_1, update_mapgen_faction_wall_level_N_1 }, + { update_mapgen_faction_wall_level_E_1, update_mapgen_faction_wall_level_W_1 } + } }; + const bool is_ns = build_point[0].y() != build_point[1].y(); + const bool is_spiked = miss_id.parameters == faction_wall_level_n_1_string || + // Handling of old format (changed mid 0.F) below + ( miss_id.parameters.empty() && + comp[0]->companion_mission_role_id == faction_wall_level_n_1_string ); + const std::pair &build = is_spiked ? + ( is_ns ? pits[0] : pits[1] ) : + ( is_ns ? pits[2] : pits[3] ); + + //Add fences for( size_t pt = 0; pt < build_point.size(); pt++ ) { //First point is always at top or west since they are built in a line and sorted if( pt == 0 ) { if( !start ) { - run_mapgen_update_func( build_first, build_point[pt], {} ); + run_mapgen_update_func( build.first, build_point[pt], {} ); } - apply_construction_marker( build_first, build_point[pt], + apply_construction_marker( build.first, build_point[pt], miss_id.mapgen_args, false, false, false, start ); } else if( pt == build_point.size() - 1 ) { if( !start ) { - run_mapgen_update_func( build_second, build_point[pt], {} ); + run_mapgen_update_func( build.second, build_point[pt], {} ); } - apply_construction_marker( build_second, build_point[pt], + apply_construction_marker( build.second, build_point[pt], miss_id.mapgen_args, false, false, false, start ); } else { if( !start ) { - run_mapgen_update_func( build_first, build_point[pt], {} ); - run_mapgen_update_func( build_second, build_point[pt], {} ); + run_mapgen_update_func( build.first, build_point[pt], {} ); + run_mapgen_update_func( build.second, build_point[pt], {} ); } - apply_construction_marker( build_first, build_point[pt], + apply_construction_marker( build.first, build_point[pt], miss_id.mapgen_args, false, false, false, start ); - apply_construction_marker( build_second, build_point[pt], + apply_construction_marker( build.second, build_point[pt], miss_id.mapgen_args, false, false, false, start ); } @@ -2790,14 +2779,13 @@ void basecamp::start_fortifications( const mission_id &miss_id, float exertion_l popup( _( "Select a start and end point. Line must be straight. Fields, forests, and " "swamps are valid fortification locations. In addition to existing fortification " "constructions." ) ); - tripoint_abs_omt start = om_target_tile( omt_pos, 2, 90, terrains_field_swamp_forest, - ot_match_type::type, true, omt_pos, _( "Select a start point from %d to %d tiles away." ) ); + tripoint_abs_omt start = om_target_tile( omt_pos, 2, 90, terrains_field_swamp_forest, true, omt_pos, + _( "Select a start point from %d to %d tiles away." ) ); if( start.is_invalid() ) { return; } - tripoint_abs_omt stop = om_target_tile( omt_pos, 2, 90, terrains_field_swamp_forest, - ot_match_type::type, - true, start, _( "Select an end point from %d to %d tiles away." ) ); + tripoint_abs_omt stop = om_target_tile( omt_pos, 2, 90, terrains_field_swamp_forest, true, start, + _( "Select an end point from %d to %d tiles away." ) ); if( stop.is_invalid() ) { return; } @@ -2840,16 +2828,8 @@ void basecamp::start_fortifications( const mission_id &miss_id, float exertion_l time_duration travel_time = 0_hours; int dist = 0; for( tripoint_abs_omt &fort_om : fortify_om ) { - bool valid = false; - const oter_id &omt_ref = overmap_buffer.ter( fort_om ); - for( const std::string &pos_om : terrains_field_swamp_forest ) { - if( omt_ref.id().c_str() == pos_om ) { - valid = true; - break; - } - } - - if( !valid ) { + const oter_type_str_id &omt_ref = overmap_buffer.ter( fort_om )->get_type_id(); + if( terrains_field_swamp_forest.find( omt_ref ) == terrains_field_swamp_forest.end() ) { popup( _( "Invalid terrain in construction path." ) ); return; } @@ -3159,13 +3139,13 @@ bool basecamp::common_salt_water_pipe_construction( mirror_horizontal, rotation ); if( orthogonal ) { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_swamp_N }; - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_swamp_N, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, true ); } else { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_swamp_NE }; - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_swamp_NE, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, true ); } @@ -3200,13 +3180,13 @@ bool basecamp::common_salt_water_pipe_construction( mirror_vertical, mirror_horizontal, rotation ); if( orthogonal ) { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_N }; - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_N, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, true ); } else { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_NE }; - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_NE, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, true ); } @@ -3215,13 +3195,13 @@ bool basecamp::common_salt_water_pipe_construction( mirror_horizontal, rotation ); if( orthogonal ) { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_N }; - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_N, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, true ); } else { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_NE }; - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_NE, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, true ); } @@ -3266,29 +3246,18 @@ void basecamp::start_salt_water_pipe( const mission_id &miss_id ) pipe = new expansion_salt_water_pipe; pipe->expansion = dir; pipe->connection_direction = connection_dir; - - std::string allowed_start_location = - "forest_water"; // That's what a swamp is called, for some reason. - std::vector allowed_locations = { - "forest", "forest_thick", "forest_trail", "field", "road" - }; + const oter_type_str_id &allowed_start_location = oter_type_forest_water; + const std::unordered_set allowed_locations = { oter_type_forest, oter_type_forest_thick, oter_type_forest_trail, oter_type_field, oter_type_road }; PathMap path_map; for( int i = -max_salt_water_pipe_distance; i <= max_salt_water_pipe_distance; i++ ) { for( int k = -max_salt_water_pipe_distance; k <= max_salt_water_pipe_distance; k++ ) { tripoint_abs_omt tile = tripoint_abs_omt( omt_pos.x() + dir.x + connection_dir.x + i, omt_pos.y() + dir.y + connection_dir.y + k, omt_pos.z() ); - const oter_id &omt_ref = overmap_buffer.ter( tile ); - bool match = false; - for( const std::string &pos_om : allowed_locations ) { - if( omt_ref->get_type_id() == oter_type_str_id( pos_om ) ) { - match = true; - break; - } - } - if( match ) { + const oter_type_str_id &omt_ref = overmap_buffer.ter( tile )->get_type_id(); + if( allowed_locations.find( omt_ref ) != allowed_locations.end() ) { path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_legal; - } else if( omt_ref->get_type_id() == oter_type_str_id( allowed_start_location ) ) { + } else if( omt_ref == allowed_start_location ) { path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_swamp; } else { path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_illegal; @@ -4016,9 +3985,9 @@ bool basecamp::upgrade_return( const mission_id &miss_id ) return false; } - if( making.get_blueprint().str() == faction_expansion_salt_water_pipe_swamp_N ) { + if( making.get_blueprint() == update_mapgen_faction_expansion_salt_water_pipe_swamp_N ) { return salt_water_pipe_swamp_return( miss_id, npc_list ); - } else if( making.get_blueprint().str() == faction_expansion_salt_water_pipe_N ) { + } else if( making.get_blueprint() == update_mapgen_faction_expansion_salt_water_pipe_N ) { return salt_water_pipe_return( miss_id, npc_list ); } @@ -4205,17 +4174,19 @@ bool basecamp::salt_water_pipe_swamp_return( const mission_id &miss_id, mirror_horizontal, rotation ); if( orthogonal ) { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_swamp_N }; - run_mapgen_update_func( id, pipe->segments[segment_number].point, {}, nullptr, true, + run_mapgen_update_func( update_mapgen_faction_expansion_salt_water_pipe_swamp_N, + pipe->segments[segment_number].point, {}, nullptr, true, mirror_horizontal, mirror_vertical, rotation ); - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_swamp_N, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, false ); } else { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_swamp_NE }; - run_mapgen_update_func( id, pipe->segments[segment_number].point, {}, nullptr, true, + run_mapgen_update_func( update_mapgen_faction_expansion_salt_water_pipe_swamp_NE, + pipe->segments[segment_number].point, {}, nullptr, true, mirror_horizontal, mirror_vertical, rotation ); - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_swamp_NE, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, false ); } @@ -4305,17 +4276,19 @@ bool basecamp::salt_water_pipe_return( const mission_id &miss_id, mirror_vertical, mirror_horizontal, rotation ); if( orthogonal ) { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_N }; - run_mapgen_update_func( id, pipe->segments[segment_number].point, {}, nullptr, true, + run_mapgen_update_func( update_mapgen_faction_expansion_salt_water_pipe_N, + pipe->segments[segment_number].point, {}, nullptr, true, mirror_horizontal, mirror_vertical, rotation ); - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_N, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, false ); } else { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_NE }; - run_mapgen_update_func( id, pipe->segments[segment_number].point, {}, nullptr, true, + run_mapgen_update_func( update_mapgen_faction_expansion_salt_water_pipe_NE, + pipe->segments[segment_number].point, {}, nullptr, true, mirror_horizontal, mirror_vertical, rotation ); - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_NE, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, false ); } @@ -4324,17 +4297,19 @@ bool basecamp::salt_water_pipe_return( const mission_id &miss_id, mirror_horizontal, rotation ); if( orthogonal ) { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_N }; - run_mapgen_update_func( id, pipe->segments[segment_number].point, {}, nullptr, true, + run_mapgen_update_func( update_mapgen_faction_expansion_salt_water_pipe_N, + pipe->segments[segment_number].point, {}, nullptr, true, mirror_horizontal, mirror_vertical, rotation ); - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_N, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, false ); } else { - const update_mapgen_id id{ faction_expansion_salt_water_pipe_NE }; - run_mapgen_update_func( id, pipe->segments[segment_number].point, {}, nullptr, true, + run_mapgen_update_func( update_mapgen_faction_expansion_salt_water_pipe_NE, + pipe->segments[segment_number].point, {}, nullptr, true, mirror_horizontal, mirror_vertical, rotation ); - apply_construction_marker( id, pipe->segments[segment_number].point, + apply_construction_marker( update_mapgen_faction_expansion_salt_water_pipe_NE, + pipe->segments[segment_number].point, miss_id.mapgen_args, mirror_horizontal, mirror_vertical, rotation, false ); } @@ -4568,7 +4543,7 @@ bool basecamp::survey_field_return( const mission_id &miss_id ) } } - if( overmap_buffer.ter_existing( where ) == oter_id( "field" ) ) { + if( overmap_buffer.ter_existing( where ) == oter_field ) { if( query_yn( _( "This location is already a field. Do you want to finish this mission? If not, another tile can be checked." ) ) ) { finish_return( *comp, true, abort_msg, skill_construction.str(), 0 ); @@ -4601,7 +4576,7 @@ bool basecamp::survey_field_return( const mission_id &miss_id ) } } - overmap_buffer.ter_set( where, oter_id( "field" ) ); + overmap_buffer.ter_set( where, oter_field ); if( query_yn( _( "This location has now been converted into a field! Do you want to finish the mission? If not, another tile can be checked." ) ) ) { finish_return( *comp, true, abort_msg, skill_construction.str(), 0 ); @@ -5038,11 +5013,11 @@ mass_volume om_harvest_itm( const npc_ptr &comp, const tripoint_abs_omt &omt_tgt } tripoint_abs_omt om_target_tile( const tripoint_abs_omt &omt_pos, int min_range, int range, - const std::vector &possible_om_types, ot_match_type match_type, bool must_see, + const std::unordered_set &possible_om_types, bool must_see, const tripoint_abs_omt &source, bool bounce, const std::optional &message ) { bool errors = false; - std::vector bounce_locations = { faction_hide_site_0_string }; + const std::unordered_set bounce_locations = { oter_type_faction_hide_site_0 }; tripoint_abs_omt where; om_range_mark( omt_pos, range ); @@ -5069,7 +5044,7 @@ tripoint_abs_omt om_target_tile( const tripoint_abs_omt &omt_pos, int min_range, tripoint_abs_omt omt_tgt = where; - const oter_id &omt_ref = overmap_buffer.ter( omt_tgt ); + const oter_type_str_id &omt_ref = overmap_buffer.ter( omt_tgt )->get_type_id(); if( must_see && overmap_buffer.seen( omt_tgt ) == om_vision_level::unseen ) { errors = true; @@ -5077,32 +5052,24 @@ tripoint_abs_omt om_target_tile( const tripoint_abs_omt &omt_pos, int min_range, } if( !errors ) { - for( const std::string &pos_om : bounce_locations ) { - if( bounce && omt_ref.id().c_str() == pos_om && range > 5 ) { + for( const oter_type_str_id &pos_om : bounce_locations ) { + if( bounce && pos_om == omt_ref && range > 5 ) { if( query_yn( _( "Do you want to bounce off this location to extend range?" ) ) ) { om_line_mark( omt_pos, omt_tgt ); tripoint_abs_omt dest = - om_target_tile( omt_tgt, 2, range * .75, possible_om_types, match_type, true, - omt_tgt, true ); + om_target_tile( omt_tgt, 2, range * .75, possible_om_types, true, omt_tgt, true ); om_line_mark( omt_pos, omt_tgt, false ); return dest; } } } - if( possible_om_types.empty() ) { + if( possible_om_types.empty() || possible_om_types.find( omt_ref ) != possible_om_types.end() ) { return omt_tgt; } - - for( const std::string &pos_om : possible_om_types ) { - if( is_ot_match( pos_om, omt_ref, match_type ) ) { - return omt_tgt; - } - } } - return om_target_tile( omt_pos, min_range, range, possible_om_types, match_type, must_see, - omt_pos ); + return om_target_tile( omt_pos, min_range, range, possible_om_types, must_see, omt_pos ); } void om_range_mark( const tripoint_abs_omt &origin, int range, bool add_notes, @@ -5226,7 +5193,7 @@ bool om_set_hide_site( npc &comp, const tripoint_abs_omt &omt_tgt, target_bay.save(); - overmap_buffer.ter_set( omt_tgt, oter_id( faction_hide_site_0_string ) ); + overmap_buffer.ter_set( omt_tgt, oter_faction_hide_site_0 ); overmap_buffer.reveal( omt_tgt.xy(), 3, 0 ); return true; @@ -5274,8 +5241,7 @@ pf::simple_path om_companion_path( const tripoint_abs_omt &sta if( range == 0 ) { message = _( "Confirm again to finalize the path, or cancel to undo." ); } - tripoint_abs_omt spt = om_target_tile( last, 0, range, {}, ot_match_type::exact, false, last, - false, message ); + tripoint_abs_omt spt = om_target_tile( last, 0, range, {}, false, last, false, message ); if( spt.is_invalid() ) { if( scout_segments.empty() ) { return {}; @@ -5309,9 +5275,9 @@ pf::simple_path om_companion_path( const tripoint_abs_omt &sta range -= note_pts.cost / 24; last = spt; - const oter_id &omt_ref = overmap_buffer.ter( last ); + const oter_type_str_id &omt_ref = overmap_buffer.ter( last )->get_type_id(); - if( bounce && omt_ref.id() == oter_faction_hide_site_0 ) { + if( bounce && omt_ref == oter_type_faction_hide_site_0 ) { range = def_range * .75; def_range = range; } @@ -5648,23 +5614,18 @@ std::string basecamp::farm_description( const point &dir, size_t &plots_count, farm_ops operation ) { std::pair farm_data = farm_action( dir, operation ); - std::string entry; plots_count = farm_data.first; switch( operation ) { case farm_ops::harvest: - entry += _( "Harvestable: " ) + std::to_string( plots_count ) + "\n" + farm_data.second; - break; + return _( "Harvestable: " ) + std::to_string( plots_count ) + "\n" + farm_data.second; case farm_ops::plant: - entry += _( "Ready for Planting: " ) + std::to_string( plots_count ) + "\n"; - break; + return _( "Ready for Planting: " ) + std::to_string( plots_count ) + "\n"; case farm_ops::plow: - entry += _( "Needs Plowing: " ) + std::to_string( plots_count ) + "\n"; - break; + return _( "Needs Plowing: " ) + std::to_string( plots_count ) + "\n"; default: debugmsg( "Farm operations called with no operation" ); - break; + return {}; } - return entry; } // food supply @@ -5822,14 +5783,10 @@ int basecamp::time_to_food( time_duration total_time, float work_exertion_level, item basecamp::make_fake_food( const nutrients &to_use ) const { - // This is dumb, but effective. - std::string food_id = "camp_meal_small"; - if( to_use.kcal() > 3000 ) { - food_id = "camp_meal_large"; - } else if( to_use.kcal() > 1000 ) { - food_id = "camp_meal_medium"; - } - item food_item( food_id ); + //TODO: If we're dynamically deciding its nutrition why not weight + volume and them just append the name like this? + item food_item = to_use.kcal() > 3000 ? + item( itype_camp_meal_large ) : to_use.kcal() > 1000 ? + item( itype_camp_meal_medium ) : item( itype_camp_meal_small ); // Set the default nutritional of the item. // This doesn't persist through save/load, but that's ok, we will be eating it immediately. food_item.get_comestible()->set_default_nutrition( to_use ); @@ -5975,17 +5932,15 @@ bool basecamp::distribute_food( bool player_command ) return false; } - std::string popup_msg; - if( nutrients_to_add.kcal() > 0 ) { - popup_msg = string_format( _( "You distribute %d kcal worth of food to your companions." ), - nutrients_to_add.kcal() ); - } else { - popup_msg = _( "You distribute vitamins and medicine to your companions." ); - } - if( player_command ) { - popup( popup_msg ); + if( nutrients_to_add.kcal() > 0 ) { + popup( string_format( _( "You distribute %d kcal worth of food to your companions." ), + nutrients_to_add.kcal() ) ); + } else { + popup( _( "You distribute vitamins and medicine to your companions." ) ); + } } + camp_food_supply( nutrients_to_add ); return true; } From ebe523bfa1a0689c6276547718c7d9c15f779d52 Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:18:49 -0600 Subject: [PATCH 036/158] Initial implementation --- .../monsters/feral_psychics.json | 93 +++++++++++++++++++ .../monsters/monster_eoc_attacks.json | 35 +++++++ .../monsters/monsters_spells.json | 50 ++++++++++ 3 files changed, 178 insertions(+) diff --git a/data/mods/MindOverMatter/monsters/feral_psychics.json b/data/mods/MindOverMatter/monsters/feral_psychics.json index 97d8f7d7be4ef..f0eb6ac7966f7 100644 --- a/data/mods/MindOverMatter/monsters/feral_psychics.json +++ b/data/mods/MindOverMatter/monsters/feral_psychics.json @@ -1445,5 +1445,98 @@ ], "flags": [ "NO_FUNG_DMG", "WIELDED_WEAPON" ] } + }, + { + "id": "mon_feral_human_vita3", + "type": "MONSTER", + "name": "feral regenerator", + "description": "This feral human doesn't even have bloodshot eyes. Their skin positively glows, and as you watch them brush past a jagged chunk of wood to get to you, the wound they receive immediately stops bleeding and rapidly begins to close.", + "copy-from": "mon_feral_psion_default", + "proportional": { "hp": 1.75 }, + "color": "green", + "symbol": "@", + "morale": 45, + "regen_morale": true, + "regenerates": 5, + "regeneration_modifiers": [ [ "effect_vitakin_hurt", -2 ], [ "effect_psi_null", -5 ], [ "effect_feral_regeneration", 10 ] ], + "bleed_rate": 0, + "death_drops": "feral_humans_death_drops_vita", + "zombify_into": "mon_zombie_survivor", + "anger_triggers": [ "FRIEND_DIED", "FRIEND_ATTACKED", "HURT" ], + "extend": { + "special_attacks": [ + { "id": "feral_weapon_pipe" }, + { + "type": "monster_attack", + "attack_type": "melee", + "id": "mon_vitakinetic_laceration", + "cooldown": { "math": [ "6 + rand(12)" ] }, + "accuracy": 8, + "move_cost": 60, + "damage_max_instance": [ { "damage_type": "biological", "amount": 25 } ], + "effects": [ + { "id": "bleed", "duration": [ 60, 120 ], "intensity": [ 1, 10 ], "chance": 50, "affect_hit_bp": true }, + { "id": "psi_vitakinetic_degeneration", "duration": [ 600, 2400 ] } + ], + "dodgeable": true, + "blockable": true, + "condition": { "not": { "u_has_flag": "NO_PSIONICS" } }, + "hit_dmg_u": "%1$s touches you and wounds open on your flesh!", + "hit_dmg_npc": "%1$s touches and wounds open on their flesh!", + "miss_msg_u": "%1$s tries to touch you, but you dodge!", + "miss_msg_npc": "%1$s tries to touch , but they dodge!", + "no_dmg_msg_u": "%1$s touches you but only hits your armor.", + "no_dmg_msg_npc": "%1$s touches but only hits their armor." + }, + { + "type": "monster_attack", + "attack_type": "melee", + "id": "mon_vitakinetic_weakness_", + "cooldown": { "math": [ "6 + rand(12)" ] }, + "accuracy": 7, + "move_cost": 60, + "damage_max_instance": [ { "damage_type": "biological", "amount": 1 } ], + "dodgeable": true, + "blockable": true, + "eoc": [ "EOC_FERAL_VITAKIN3_ENERVATING_TOUCH" ], + "condition": { "not": { "u_has_flag": "NO_PSIONICS" } }, + "hit_dmg_u": "%1$s touches you and you feel weaker!", + "hit_dmg_npc": "%1$s touches and they flinch!", + "miss_msg_u": "%1$s tries to touch you, but you dodge!", + "miss_msg_npc": "%1$s tries to touch , but they dodge!", + "no_dmg_msg_u": "%1$s touches you but only hits your armor.", + "no_dmg_msg_npc": "%1$s touches but only hits their armor." + }, + { + "type": "monster_attack", + "attack_type": "melee", + "id": "mon_vitakinetic_degeneration_3", + "cooldown": { "math": [ "8 + rand(16)" ] }, + "accuracy": 7, + "move_cost": 60, + "damage_max_instance": [ { "damage_type": "biological", "amount": 1 } ], + "dodgeable": true, + "blockable": true, + "eoc": [ "EOC_FERAL_VITAKIN3_DEGENERATING_TOUCH" ], + "condition": { "not": { "u_has_flag": "NO_PSIONICS" } }, + "hit_dmg_u": "%1$s touches you and you feel weaker!", + "hit_dmg_npc": "%1$s touches and they flinch!", + "miss_msg_u": "%1$s tries to touch you, but you dodge!", + "miss_msg_npc": "%1$s tries to touch , but they dodge!", + "no_dmg_msg_u": "%1$s touches you but only hits your armor.", + "no_dmg_msg_npc": "%1$s touches but only hits their armor." + }, + { + "id": "psi_vitakin3_regeneration", + "type": "spell", + "spell_data": { "id": "vitakinetic_regeneration_monster" }, + "cooldown": { "math": [ "8 + rand(16)" ] }, + "allow_no_target": true, + "condition": { "not": { "u_has_flag": "NO_PSIONICS" } }, + "monster_message": "%1$s closes their eyes and their wounds begin healing at a rapid pace!" + } + ], + "flags": [ "NO_FUNG_DMG", "WIELDED_WEAPON" ] + } } ] diff --git a/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json b/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json index c81f7ce91d99e..989503a13842f 100644 --- a/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json +++ b/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json @@ -20,5 +20,40 @@ { "math": [ "n_calories('dont_affect_weariness': true)", "+=", "200" ] } ], "false_effect": [ { "npc_add_effect": "effect_vitakinetic_health_down_monster", "intensity": 3, "duration": [ 620000, 1620000 ] } ] + }, + { + "type": "effect_on_condition", + "id": "EOC_FERAL_VITAKIN2_ENERVATING_TOUCH", + "condition": "npc_is_character", + "effect": [ + { "npc_add_effect": "effect_vitakinetic_healing_down", "duration": [ 620000, 1620000 ] }, + { "math": [ "n_calories()", "-=", "350" ] }, + { "math": [ "n_calories('dont_affect_weariness': true)", "+=", "350" ] } + ], + "false_effect": [ { "npc_add_effect": "effect_vitakinetic_health_down_monster", "intensity": 3, "duration": [ 620000, 1620000 ] } ] + }, + { + "type": "effect_on_condition", + "id": "EOC_VITAKIN_FERAL_VITA3_DEGENERATING_TOUCH", + "condition": "npc_is_character", + "effect": [ + { "u_cast_spell": { "id": "vita_feral_vitakin3_degenerating_touch", "hit_self": true } }, + { "npc_message": "Your flesh begins decaying before your eyes!", "type": "bad" } + ], + "false_effect": [ + { + "if": { + "and": [ + { "not": { "npc_has_species": "ROBOT" } }, + { "not": { "npc_has_species": "ROBOT_FLYING" } }, + { "not": { "npc_has_species": "NETHER_EMANATION" } } + ] + }, + "then": [ + { "npc_cast_spell": { "id": "vita_feral_vitakin3_degenerating_touch_monster", "hit_self": true } }, + { "npc_message": "Your flesh begins decaying before your eyes!", "type": "bad" } + ] + } + ] } ] diff --git a/data/mods/MindOverMatter/monsters/monsters_spells.json b/data/mods/MindOverMatter/monsters/monsters_spells.json index edbae7ef5bec5..27acb0a263d4e 100644 --- a/data/mods/MindOverMatter/monsters/monsters_spells.json +++ b/data/mods/MindOverMatter/monsters/monsters_spells.json @@ -1214,6 +1214,56 @@ "min_duration": 200, "max_duration": 600 }, + { + "id": "vita_feral_vitakin3_degenerating_touch", + "type": "SPELL", + "name": { "str": "[Ψ]Degenerating Touch Self From Monster", "//~": "NO_I18N" }, + "description": { "str": "You are degenerating. RIP.", "//~": "NO_I18N" }, + "message": "", + "teachable": false, + "valid_targets": [ "self" ], + "spell_class": "VITAKINETIC", + "skill": "metaphysics", + "flags": [ + "PSIONIC", + "CONCENTRATE", + "SILENT", + "NO_HANDS", + "RANDOM_DAMAGE", + "NO_LEGS", + "SPLIT_DAMAGE", + "RANDOM_DURATION", + "NO_EXPLOSION_SFX" + ], + "effect": "attack", + "effect_str": "effect_vita_degenerating_touch", + "damage_type": "biological", + "shape": "blast", + "min_dot": 3, + "max_dot": 10, + "min_duration": 1500, + "max_duration": 6500 + }, + { + "id": "vita_feral_vitakin3_degenerating_touch_monster", + "type": "SPELL", + "name": { "str": "[Ψ]Degenerating Touch Self From Monster to Monster", "//~": "NO_I18N" }, + "description": { "str": "You are degenerating. RIP.", "//~": "NO_I18N" }, + "message": "", + "teachable": false, + "valid_targets": [ "self" ], + "spell_class": "VITAKINETIC", + "skill": "metaphysics", + "flags": [ "PSIONIC", "CONCENTRATE", "SILENT", "NO_HANDS", "NO_LEGS", "RANDOM_DAMAGE", "RANDOM_DURATION", "NO_EXPLOSION_SFX" ], + "effect": "attack", + "effect_str": "effect_vita_degenerating_touch", + "damage_type": "biological", + "shape": "blast", + "min_dot": 1, + "max_dot": 4, + "min_duration": 1500, + "max_duration": 6500 + }, { "type": "SPELL", "id": "hidebehind_apply_mindsight", From 5eac595763fa13ea15a6f31dba4e9eaa406eee7c Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:23:31 -0600 Subject: [PATCH 037/158] Add upgrades --- data/mods/MindOverMatter/monsters/feral_psychics.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/mods/MindOverMatter/monsters/feral_psychics.json b/data/mods/MindOverMatter/monsters/feral_psychics.json index f0eb6ac7966f7..92798f790ee9e 100644 --- a/data/mods/MindOverMatter/monsters/feral_psychics.json +++ b/data/mods/MindOverMatter/monsters/feral_psychics.json @@ -1388,7 +1388,7 @@ "bleed_rate": 0, "death_drops": "feral_humans_death_drops_vita", "zombify_into": "mon_zombie_survivor", - "anger_triggers": [ "FRIEND_DIED", "FRIEND_ATTACKED", "HURT" ], + "upgrades": { "half_life": 45, "into": "mon_feral_human_vita3" }, "extend": { "special_attacks": [ { "id": "feral_weapon_pipe" }, @@ -1475,8 +1475,8 @@ "move_cost": 60, "damage_max_instance": [ { "damage_type": "biological", "amount": 25 } ], "effects": [ - { "id": "bleed", "duration": [ 60, 120 ], "intensity": [ 1, 10 ], "chance": 50, "affect_hit_bp": true }, - { "id": "psi_vitakinetic_degeneration", "duration": [ 600, 2400 ] } + { "id": "bleed", "duration": [ 60, 120 ], "intensity": [ 1, 10 ], "chance": 75, "affect_hit_bp": true }, + { "id": "psi_vitakinetic_degeneration", "duration": [ 1200, 6000 ] } ], "dodgeable": true, "blockable": true, From 5e4bb34487b3c572b93221e651b9e425ff596a8b Mon Sep 17 00:00:00 2001 From: George Kightly Date: Tue, 10 Dec 2024 20:34:02 +0000 Subject: [PATCH 038/158] Add sorting by price to weight ratio --- src/advanced_inv.cpp | 13 +++++++++++++ src/advanced_inv_pane.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/advanced_inv.cpp b/src/advanced_inv.cpp index 5a9c44e9a658f..d4cd5c60e9b42 100644 --- a/src/advanced_inv.cpp +++ b/src/advanced_inv.cpp @@ -234,6 +234,8 @@ std::string advanced_inventory::get_sortname( advanced_inv_sortby sortby ) return _( "barter value" ); case SORTBY_PRICEPERVOLUME: return _( "barter value / volume" ); + case SORTBY_PRICEPERWEIGHT: + return _( "barter value / weight" ); case SORTBY_STACKS: return _( "amount" ); } @@ -663,6 +665,16 @@ struct advanced_inv_sorter { } break; } + case SORTBY_PRICEPERWEIGHT: { + const double price_density1 = static_cast( d1.items.front()->price( true ) ) / + static_cast( std::max( 1l, d1.items.front()->weight().value() ) ); + const double price_density2 = static_cast( d2.items.front()->price( true ) ) / + static_cast( std::max( 1l, d2.items.front()->weight().value() ) ); + if( price_density1 != price_density2 ) { + return price_density1 > price_density2; + } + break; + } case SORTBY_STACKS: if( d1.stacks != d2.stacks ) { return d1.stacks > d2.stacks; @@ -1243,6 +1255,7 @@ bool advanced_inventory::show_sort_menu( advanced_inventory_pane &pane ) sm.addentry( SORTBY_SPOILAGE, true, 's', get_sortname( SORTBY_SPOILAGE ) ); sm.addentry( SORTBY_PRICE, true, 'b', get_sortname( SORTBY_PRICE ) ); sm.addentry( SORTBY_PRICEPERVOLUME, true, 'r', get_sortname( SORTBY_PRICEPERVOLUME ) ); + sm.addentry( SORTBY_PRICEPERWEIGHT, true, 'g', get_sortname( SORTBY_PRICEPERWEIGHT ) ); sm.addentry( SORTBY_STACKS, true, 't', get_sortname( SORTBY_STACKS ) ); // Pre-select current sort. sm.selected = pane.sortby - SORTBY_NONE; diff --git a/src/advanced_inv_pane.h b/src/advanced_inv_pane.h index 7de001f5b8a04..87c48b57a3b39 100644 --- a/src/advanced_inv_pane.h +++ b/src/advanced_inv_pane.h @@ -32,6 +32,7 @@ enum advanced_inv_sortby { SORTBY_SPOILAGE, SORTBY_PRICE, SORTBY_PRICEPERVOLUME, + SORTBY_PRICEPERWEIGHT, SORTBY_STACKS }; From 48e6d465c7952dc32856d16be7e2fa3043e82537 Mon Sep 17 00:00:00 2001 From: GuardianDll Date: Tue, 10 Dec 2024 20:16:08 +0100 Subject: [PATCH 039/158] add missed deserialization code --- src/magic_enchantment.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/magic_enchantment.cpp b/src/magic_enchantment.cpp index 263e9e68b5754..125bddffc6c0c 100644 --- a/src/magic_enchantment.cpp +++ b/src/magic_enchantment.cpp @@ -700,6 +700,36 @@ void enchant_cache::serialize( JsonOut &jsout ) const } jsout.end_array(); + jsout.member( "incoming_damage_mod" ); + jsout.start_array(); + for( const damage_type &dt : damage_type::get_all() ) { + jsout.start_object(); + jsout.member( "type", dt.id ); + if( get_armor_add( dt.id ) != 0 ) { + jsout.member( "add", get_armor_add( dt.id ) ); + } + if( get_armor_multiply( dt.id ) != 0 ) { + jsout.member( "multiply", get_armor_multiply( dt.id ) ); + } + jsout.end_object(); + } + jsout.end_array(); + + jsout.member( "incoming_damage_mod_post_absorbed" ); + jsout.start_array(); + for( const damage_type &dt : damage_type::get_all() ) { + jsout.start_object(); + jsout.member( "type", dt.id ); + if( get_extra_damage_add( dt.id ) != 0 ) { + jsout.member( "add", get_extra_damage_add( dt.id ) ); + } + if( get_extra_damage_multiply( dt.id ) != 0 ) { + jsout.member( "multiply", get_extra_damage_multiply( dt.id ) ); + } + jsout.end_object(); + } + jsout.end_array(); + jsout.member( "special_vision" ); jsout.start_array(); for( const special_vision &struc : special_vision_vector ) { From 1ba510213d6b898856e515eb85a0226d5abfac70 Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:02:19 -0600 Subject: [PATCH 040/158] Death effects --- .../monsters/death_effects.json | 14 ++++++++++++++ .../monsters/feral_psychics.json | 19 ++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/data/mods/MindOverMatter/monsters/death_effects.json b/data/mods/MindOverMatter/monsters/death_effects.json index e32a8cfea297d..b2ee78cc81d2a 100644 --- a/data/mods/MindOverMatter/monsters/death_effects.json +++ b/data/mods/MindOverMatter/monsters/death_effects.json @@ -202,5 +202,19 @@ "max_level": 1, "min_aoe": 12, "max_aoe": 12 + }, + { + "type": "effect_on_condition", + "id": "EOC_VITAKIN3_DEATH_EFFECT", + "effect": [ + { "u_spawn_monster": "mon_feral_human_vita3_revived", "min_radius": 1 }, + { "u_location_variable": { "context_val": "loc" }, "monster": "mon_feral_human_vita3_revived" }, + { "run_eocs": "EOC_VITAKIN3_DEATH_EFFECT_2", "alpha_loc": { "context_val": "loc" } } + ] + }, + { + "type": "effect_on_condition", + "id": "EOC_VITAKIN3_DEATH_EFFECT_2", + "effect": [ { "u_add_effect": "effect_feral_regeneration", "duration": [ "15 seconds", "30 seconds" ] } ] } ] diff --git a/data/mods/MindOverMatter/monsters/feral_psychics.json b/data/mods/MindOverMatter/monsters/feral_psychics.json index 92798f790ee9e..050be2f64c6a3 100644 --- a/data/mods/MindOverMatter/monsters/feral_psychics.json +++ b/data/mods/MindOverMatter/monsters/feral_psychics.json @@ -1376,7 +1376,7 @@ "id": "mon_feral_human_vita2", "type": "MONSTER", "name": "feral regenerator", - "description": "This feral human doesn't even have bloodshot eyes. Their skin positively glows, and as you watch them brush past a jagged chunk of wood to get to you, the wound they receive immediately stops bleeding and rapidly begins to close.", + "description": "This feral human doesn't even have bloodshot eyes. Their skin shines, their eyes are clear, and they move with a relaxed confidence among the apocalypse. Only the indifference of the nearby zombies indicates something is deeply wrong.", "copy-from": "mon_feral_psion_default", "proportional": { "hp": 1.45 }, "color": "green", @@ -1449,8 +1449,8 @@ { "id": "mon_feral_human_vita3", "type": "MONSTER", - "name": "feral regenerator", - "description": "This feral human doesn't even have bloodshot eyes. Their skin positively glows, and as you watch them brush past a jagged chunk of wood to get to you, the wound they receive immediately stops bleeding and rapidly begins to close.", + "name": "font of vitality", + "description": "This is the healthiest person you've even seen, especially after the end of the world. Their skin positively glows, and as you watch them brush past a jagged chunk of wood to get to you, the wound they receive immediately stops bleeding and rapidly begins to close.", "copy-from": "mon_feral_psion_default", "proportional": { "hp": 1.75 }, "color": "green", @@ -1463,6 +1463,11 @@ "death_drops": "feral_humans_death_drops_vita", "zombify_into": "mon_zombie_survivor", "anger_triggers": [ "FRIEND_DIED", "FRIEND_ATTACKED", "HURT" ], + "death_function": { + "eoc": "EOC_VITAKIN3_DEATH_EFFECT", + "message": "As %s succumbs to their wounds, they suddenly rise up with new vitality!", + "corpse_type": "NO_CORPSE" + }, "extend": { "special_attacks": [ { "id": "feral_weapon_pipe" }, @@ -1538,5 +1543,13 @@ ], "flags": [ "NO_FUNG_DMG", "WIELDED_WEAPON" ] } + }, + { + "id": "mon_feral_human_vita3_revived", + "type": "MONSTER", + "name": "font of vitality", + "description": "This is the healthiest person you've even seen, especially after the end of the world. Their skin positively glows, and as you watch them brush past a jagged chunk of wood to get to you, the wound they receive immediately stops bleeding and rapidly begins to close.", + "copy-from": "mon_feral_human_vita3", + "death_function": { } } ] From 9b254f80624ac35520f9b7f992d6cd52542fdaf1 Mon Sep 17 00:00:00 2001 From: GuardianDll Date: Tue, 10 Dec 2024 22:30:14 +0100 Subject: [PATCH 041/158] misc --- src/creature.cpp | 2 +- src/magic_enchantment.cpp | 3 --- src/melee.cpp | 9 ++++++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/creature.cpp b/src/creature.cpp index 2ad7701d58cb4..404b13d79de58 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -3379,7 +3379,7 @@ void Creature::adjust_taken_damage_by_enchantments( damage_unit &du ) const double total = enchantment_cache->modify_damage_units_by_armor_protection( du.type, du.amount ); if( !du.type->no_resist ) { - total += calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ALL ); + total = calculate_by_enchantment( total, enchant_vals::mod::ARMOR_ALL ); } du.amount = std::max( 0.0, total ); diff --git a/src/magic_enchantment.cpp b/src/magic_enchantment.cpp index 125bddffc6c0c..208f46d98dde4 100644 --- a/src/magic_enchantment.cpp +++ b/src/magic_enchantment.cpp @@ -1304,9 +1304,6 @@ double enchant_cache::modify_melee_damage( const damage_type_id &mod_val, double double enchant_cache::modify_damage_units_by_armor_protection( const damage_type_id &mod_val, double value ) const { - // since it's armor bonus, and we modify the damage units applied on damage absorbtion - // we decrease said value; 10 damage taken and +6 damage mitigation - // result in [10 - 6 =] 4 damage taken value += get_armor_add( mod_val ); value *= 1.0 + get_armor_multiply( mod_val ); return value; diff --git a/src/melee.cpp b/src/melee.cpp index ea6a92711bf95..8d9e03a1f1637 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -524,9 +524,12 @@ damage_instance Creature::modify_damage_dealt_with_enchantments( const damage_in continue; } - modified.add_damage( dt.id, enchantment_cache->modify_melee_damage( dt.id, 0.0f ) ); - modified.add_damage( dt.id, enchantment_cache->modify_value( enchant_vals::mod::MELEE_DAMAGE, - 0.0f ) ); + double dmg_mod = enchantment_cache->modify_melee_damage( dt.id, 0.0f ); + if( dmg_mod != 0 ) { + modified.add_damage( dt.id, dmg_mod ); + modified.add_damage( dt.id, enchantment_cache->modify_value( enchant_vals::mod::MELEE_DAMAGE, + 0.0f ) ); + } } return modified; From 7b09ca89837babb42153d9fa862d4ac2be55545b Mon Sep 17 00:00:00 2001 From: Kevin Granade Date: Tue, 10 Dec 2024 15:34:38 -0800 Subject: [PATCH 042/158] Apply suggestions from code review Co-authored-by: Brambor --- data/changelog.txt | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/data/changelog.txt b/data/changelog.txt index 7a03b8ab35f0c..57f958a6b8edb 100644 --- a/data/changelog.txt +++ b/data/changelog.txt @@ -192,7 +192,6 @@ Items salvaged from cutting will now be placed in vehicle, if you're cutting the tile layering supports item variants Some herbivore threshold mutants can now eat usually unpalatable raw fruit and vegetables Query the player on whether they really want to cut up other people's stuff -Updates the long pole ## Content: @@ -410,13 +409,6 @@ Add tupelo and nannyberry, hobblebush and autumn olive trees New exodii rifle Remade the 3x3 hospital Some houses are under construction -Tiny acetylene tank, a new default magazine for acetylene lamps -combines all four previous fursuits into one item through variants -Convert star vampire blood-drinking attack to EoC -Add water pipe and spawns -Added tucked pocket to leather backpack -Make hiking backpack sheaths hold a single item -Make Pulp Fiction pawnshop unique ## Interface: @@ -543,7 +535,8 @@ some little improvements to the AIM drop menu Allow fine user customization of ImGui colors Migrate scores window to imgui Audit `satiety` -Crafting GUI filter: by bodypart coverage; Add filter by layer (for crafting GUI, AIM, inventory etc.);;; make them two lines in the changelog, please +Add filter for body part coverage to the crafting GUI +Add filter for clothing layer to the crafting GUI, AIM, inventory etc. ## Mods: @@ -886,23 +879,8 @@ Martial Mastery: Insight is cleared when using other martial arts [MoM] Change id of Sense Minds sensing effect to use new tileset sprite [MoM/XE] Add deactivate_conditions to recurring EoCs that don't need to recur for everyone [Xedra Evolved] Add new time related powers for each default dream class -[Xedra Evolved] Add Commanding the Grasses as an intro trait for Arvore, make Hungry Thirsty Roots require leveling other spells -[Xedra Evolved] Fix seedbearer trait -[Xedra Evolved] Add UNCANNY_DODGE hidden trait to appropriate Paraclesian effect + use new enchant Aftershock: Replace exosuit forcefield with backpack generator -[MoM] Extend Nether Attunement widget to other sidebars -[Innawoods] Delays the shadow lieutenant boss spawn (and its warnings) by three seasons (mid winter by default). Innawoods only. [MoM] Add new `u_cancel_activity` to unlocking new power/wakeful rest -[Xedra Evolved] Add The Root of the Mountain trait for Ierde -[DinoMod] nedcolbertia -[Xedra Evolved] Arvore One with the Forest + the Forest's Warning updates -[MoM] Feral vitakinetics can drain your weariness -[DinoMod] shady rework -[Xedra Evolved] Reasonable Werewolf nerfs -[DinoMod] pluralize CBM dino names -[Xedra Evolved] Fix sylph translocate text -[Xedra Evolved] Add Viridescent Vessel spell to Arvore -[Xedra Evolved] Add treesung gear ## Balance: @@ -1401,19 +1379,7 @@ fix limb drying rate and related test data crash on keybind reset in UILIST Fix broken macOS build due removed folder Fix an EOC that was looping infinitely and starting more loops as you travel -[Xedra Evolved] Fix Ruach sidebar descriptions -makes batons with plastic grips not shock you Allow attacking with CANNOT_MOVE flag -Added ownership to several places of Tacoma Commune ranch camp -[MoM] Fix In the Zone perk -Forbid learning spells from spellbooks with low morale -Stop item spawning magic from putting items on ground when a player is available -Fixes to scores menu -Fix standing tank deconstruction -Fix mutations with `remove_rigid` removing `INTEGRATED` armor -Appliance interaction menu is no longer cut off at the bottom -[Xedra Evolved] Fix lilit ruach draining crash -Fix invalid dereference when construction pre_terrain is empty ## Performance: From 57e3cf4777ec47378cf04159634df9a46dbe0351 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Fri, 6 Sep 2024 23:56:21 -0500 Subject: [PATCH 043/158] Stomachs --- .../harvest_monster_hunter_gracken.json | 176 ++++++++++++- data/mods/Xedra_Evolved/items/carnivore.json | 53 ++++ .../monsters/monster_overrides.json | 232 ++++++++++++++++++ 3 files changed, 450 insertions(+), 11 deletions(-) create mode 100644 data/mods/Xedra_Evolved/monsters/monster_overrides.json diff --git a/data/mods/Xedra_Evolved/harvest_monster_hunter_gracken.json b/data/mods/Xedra_Evolved/harvest_monster_hunter_gracken.json index 0dd090641f67e..421882969dfb3 100644 --- a/data/mods/Xedra_Evolved/harvest_monster_hunter_gracken.json +++ b/data/mods/Xedra_Evolved/harvest_monster_hunter_gracken.json @@ -3,16 +3,170 @@ "id": "zombie_grabber", "//": "zombie with long gangly arms", "type": "harvest", - "message": "", - "entries": [ - { "drop": "skull_human_tainted", "type": "bone", "scale_num": [ 1, 1 ], "max": 1 }, - { "drop": "meat_tainted", "type": "flesh", "mass_ratio": 0.25 }, - { "drop": "blood_tainted", "type": "blood", "mass_ratio": 0.1 }, - { "drop": "fat_tainted", "type": "flesh", "mass_ratio": 0.08 }, - { "drop": "tainted_innards", "type": "offal", "mass_ratio": 0.15 }, - { "drop": "tainted_marrow", "type": "bone", "mass_ratio": 0.005 }, - { "drop": "bone_tainted", "type": "bone", "mass_ratio": 0.1 }, - { "drop": "grappler_sinew", "mass_ratio": 0.00035 } - ] + "copy-from": "zombie_grabber", + "delete": { "entries": [ { "drop": "sinew", "mass_ratio": 0.00035 } ] }, + "extend": { + "entries": [ + { "drop": "grappler_sinew", "mass_ratio": 0.00035 } + ] + } + }, + { + "id": "pig_with_skull", + "type": "harvest", + "copy-from": "pig_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "omnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "boar_with_skull", + "type": "harvest", + "copy-from": "boar_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "omnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "sheep_with_skull", + "type": "harvest", + "copy-from": "sheep_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "ruminant_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "goat_with_skull", + "type": "harvest", + "copy-from": "goat_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "ruminant_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "cow_with_skull", + "type": "harvest", + "copy-from": "cow_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "ruminant_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "horse_with_skull", + "type": "harvest", + "copy-from": "horse_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "herbivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "deer_with_skull", + "type": "harvest", + "copy-from": "deer_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "ruminant_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "moose_with_skull", + "type": "harvest", + "copy-from": "moose_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "ruminant_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "tusked_moose_with_skull", + "type": "harvest", + "copy-from": "tusked_moose_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "ruminant_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "dog_with_skull_fur", + "type": "harvest", + "copy-from": "dog_with_skull_fur", + "extend": { "entries": [ { "drop": "carnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "dog_with_skull_fur_mutant", + "type": "harvest", + "copy-from": "dog_with_skull_fur_mutant", + "extend": { "entries": [ { "drop": "carnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "dog_with_skull_leather", + "type": "harvest", + "copy-from": "dog_with_skull_leather", + "extend": { "entries": [ { "drop": "carnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "cougar_with_skull", + "type": "harvest", + "copy-from": "cougar_with_skull", + "extend": { "entries": [ { "drop": "carnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "raccoon_with_skull", + "type": "harvest", + "copy-from": "raccoon_with_skull", + "extend": { "entries": [ { "drop": "small_omnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "raccoon_with_skull_mutant", + "type": "harvest", + "copy-from": "raccoon_with_skull_mutant", + "extend": { "entries": [ { "drop": "small_omnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "bear_with_skull", + "type": "harvest", + "copy-from": "bear_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "omnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "opossum_with_skull", + "type": "harvest", + "copy-from": "opossum_with_skull", + "extend": { "entries": [ { "drop": "small_omnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "skunk_with_skull", + "type": "harvest", + "copy-from": "skunk_with_skull", + "extend": { "entries": [ { "drop": "small_omnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "beaver_with_skull", + "type": "harvest", + "copy-from": "beaver_with_skull", + "extend": { "entries": [ { "drop": "small_herbivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "dog_triclopean_with_skull", + "type": "harvest", + "copy-from": "dog_triclopean_with_skull", + "extend": { "entries": [ { "drop": "small_carnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "spideer_with_skull", + "type": "harvest", + "copy-from": "spideer_with_skull", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "ruminant_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "cerbearus_with_skulls", + "type": "harvest", + "copy-from": "cerbearus_with_skulls", + "delete": { "entries": [ { "drop": "stomach_large", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] }, + "extend": { "entries": [ { "drop": "omnivore_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "giant_ant", + "type": "harvest", + "message": "", + "copy-from": "arachnid", + "extend": { "entries": [ { "drop": "ant_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } + }, + { + "id": "giant_acid_ant", + "type": "harvest", + "message": "", + "copy-from": "arachnid_acid", + "extend": { "entries": [ { "drop": "ant_stomach", "scale_num": [ 1, 1 ], "max": 1, "type": "offal" } ] } } ] diff --git a/data/mods/Xedra_Evolved/items/carnivore.json b/data/mods/Xedra_Evolved/items/carnivore.json index 9d21ac23a2cc3..cb07194296ef1 100644 --- a/data/mods/Xedra_Evolved/items/carnivore.json +++ b/data/mods/Xedra_Evolved/items/carnivore.json @@ -126,5 +126,58 @@ "fun": 5, "flags": [ "EATEN_HOT", "SMOKED", "SMOKABLE" ], "smoking_result": "dry_meat" + }, + { + "id": "omnivore_stomach", + "copy-from": "stomach", + "type": "COMESTIBLE", + "name": { "str": "omnivore stomach" }, + "description": "The stomach of an omnivorous creature. It is surprisingly durable." + }, + { + "id": "ruminant_stomach", + "copy-from": "stomach", + "type": "COMESTIBLE", + "name": { "str": "ruminant stomach" }, + "description": "The four stomachs of a grazing creature. It is surprisingly durable.", + "proportional": { "weight": 2.0, "volume": 2.0, "price": 1.5, "calories": 2.0 } + }, + { + "id": "herbivore_stomach", + "copy-from": "stomach", + "type": "COMESTIBLE", + "name": { "str": "herbivore stomach" }, + "description": "The stomach of a herbivore. It is surprisingly durable." + }, + { + "id": "carnivore_stomach", + "copy-from": "stomach", + "type": "COMESTIBLE", + "name": { "str": "carnivore stomach" }, + "description": "The stomach of an carnivorous creature. It is surprisingly durable." + }, + { + "id": "small_omnivore_stomach", + "copy-from": "stomach", + "type": "COMESTIBLE", + "name": { "str": "small omnivore stomach" }, + "description": "The stomach of a small omnivorous creature. It is surprisingly durable.", + "proportional": { "weight": 0.5, "volume": 0.5, "price": 0.5, "calories": 0.5 } + }, + { + "id": "small_herbivore_stomach", + "copy-from": "stomach", + "type": "COMESTIBLE", + "name": { "str": "small herbivore stomach" }, + "description": "The stomach of a small herbivore. It is surprisingly durable.", + "proportional": { "weight": 0.5, "volume": 0.5, "price": 0.5, "calories": 0.5 } + }, + { + "id": "ant_stomach", + "copy-from": "stomach", + "type": "COMESTIBLE", + "name": { "str": "ant stomach" }, + "description": "The two stomachs of a giant ant. One stomach is for digestion and one stomach is for storing food for the colony.", + "proportional": { "weight": 1.5, "volume": 1.5, "calories": 1.25 } } ] diff --git a/data/mods/Xedra_Evolved/monsters/monster_overrides.json b/data/mods/Xedra_Evolved/monsters/monster_overrides.json new file mode 100644 index 0000000000000..e10c85085eca8 --- /dev/null +++ b/data/mods/Xedra_Evolved/monsters/monster_overrides.json @@ -0,0 +1,232 @@ +[ + { + "id": "mon_bear_cub", + "type": "MONSTER", + "copy-from": "mon_bear", + "name": { "str": "black bear cub" }, + "description": "A juvenile American black bear. This one isn't much of a threat, but be wary of its parent; black bears are known for their protectiveness.", + "volume": "40750 ml", + "weight": "40750 g", + "hp": 20, + "speed": 90, + "symbol": "b", + "morale": 30, + "melee_skill": 2, + "melee_dice": 2, + "melee_dice_sides": 3, + "stomach_size": 500, + "melee_damage": [ { "damage_type": "cut", "amount": 2 } ], + "dodge": 2, + "harvest": "mammal_fur", + "dissect": "dissect_ursine_sample_single", + "special_attacks": [ [ "EAT_FOOD", 60 ], { "type": "bite", "cooldown": 30, "infection_chance": 44 } ], + "upgrades": { "age_grow": 480, "into": "mon_bear" } + }, + { + "id": "mon_bear", + "type": "MONSTER", + "name": { "str": "black bear" }, + "description": "The American black bear. A large omnivorous scavenger, it has powerful claws and jaws, and is an effective ambush hunter. Most individuals are shy around humans, but they're fiercely protective of their cubs.", + "default_faction": "bear", + "bodytype": "bear", + "categories": [ "WILDLIFE" ], + "species": [ "MAMMAL" ], + "volume": "154250 ml", + "weight": "154250 g", + "hp": 100, + "speed": 140, + "material": [ "flesh" ], + "symbol": "B", + "color": "dark_gray", + "aggression": -10, + "morale": 60, + "aggro_character": false, + "melee_skill": 6, + "melee_dice": 4, + "melee_dice_sides": 6, + "melee_damage": [ { "damage_type": "cut", "amount": 4 } ], + "dodge": 3, + "vision_day": 30, + "stomach_size": 3000, + "vision_night": 10, + "path_settings": { "max_dist": 10 }, + "anger_triggers": [ "HURT", "PLAYER_NEAR_BABY" ], + "fear_triggers": [ "SOUND" ], + "zombify_into": "mon_zombear", + "harvest": "bear_with_skull", + "dissect": "dissect_ursine_sample_small", + "families": [ "prof_gross_anatomy", "prof_intro_biology", "prof_physiology" ], + "reproduction": { "baby_monster": "mon_bear_cub", "baby_count": 1, "baby_timer": 700 }, + "//": "220 days gestation period, the mother and cubs remain together for 16-17 months.", + "baby_flags": [ "SPRING" ], + "special_attacks": [ [ "EAT_FOOD", 20 ], { "type": "bite", "cooldown": 15, "infection_chance": 44 }, [ "BROWSE", 40 ] ], + "flags": [ "SEES", "HEARS", "SMELLS", "ANIMAL", "PATH_AVOID_DANGER", "WARM", "BASHES", "PUSH_MON", "CORNERED_FIGHTER", "EATS" ], + "armor": { "bash": 2, "electric": 1 } + }, + { + "id": "mon_beaver", + "type": "MONSTER", + "name": { "str": "beaver" }, + "description": "The North American beaver, the continent's largest rodent. Its paddle-shaped tail helps ferry it through the water, and its prominent teeth can chew through wood, which it uses to build dam-like nests in lakes and streams.", + "default_faction": "herbivore", + "bodytype": "bear", + "categories": [ "WILDLIFE" ], + "species": [ "MAMMAL" ], + "volume": "20250 ml", + "weight": "20250 g", + "hp": 16, + "speed": 90, + "material": [ "flesh" ], + "symbol": "r", + "color": "brown", + "aggression": -35, + "morale": 15, + "aggro_character": false, + "melee_dice": 1, + "melee_dice_sides": 6, + "melee_damage": [ { "damage_type": "cut", "amount": 6 } ], + "dodge": 2, + "harvest": "beaver_with_skull", + "dissect": "dissect_mouse_sample_small", + "families": [ "prof_gross_anatomy", "prof_intro_biology", "prof_physiology" ], + "anger_triggers": [ "PLAYER_CLOSE", "HURT" ], + "fear_triggers": [ "SOUND" ], + "zombify_into": "mon_zombeaver", + "special_attacks": [ { "type": "bite", "cooldown": 15 } ], + "flags": [ "SEES", "HEARS", "SMELLS", "ANIMAL", "PATH_AVOID_DANGER", "SWIMS", "WARM", "WATER_CAMOUFLAGE" ] + }, + { + "id": "mon_boar_wild_piglet", + "type": "MONSTER", + "name": { "str": "wild boar piglet" }, + "description": "Originally not native in the U.S., this wild omnivore is a crossbreed between the Eurasian wild boar escaped from hunting reserves and the domesticated pig gone feral in the wilderness. This one is just a baby, and is surprisingly cute.", + "default_faction": "pig", + "bodytype": "pig", + "categories": [ "WILDLIFE" ], + "species": [ "MAMMAL" ], + "volume": "10 L", + "weight": "10 kg", + "hp": 5, + "speed": 90, + "material": [ "flesh" ], + "symbol": "b", + "color": "brown", + "looks_like": "mon_pig_piglet", + "aggression": -10, + "morale": 10, + "aggro_character": false, + "melee_skill": 1, + "melee_dice": 1, + "melee_dice_sides": 2, + "melee_damage": [ { "damage_type": "cut", "amount": 1 } ], + "dodge": 4, + "stomach_size": 300, + "harvest": "mammal_small_boar", + "weakpoint_sets": [ "wps_animal_quadruped" ], + "families": [ "prof_gross_anatomy", "prof_intro_biology", "prof_physiology", "prof_wp_ungulate" ], + "path_settings": { "max_dist": 10 }, + "fear_triggers": [ "SOUND", "PLAYER_CLOSE" ], + "upgrades": { "age_grow": 38, "into": "mon_boar_wild" }, + "biosignature": { "biosig_item": "feces_manure", "biosig_timer": 7 }, + "special_attacks": [ [ "EAT_FOOD", 40 ], [ "EAT_CARRION", 60 ] ], + "flags": [ "SEES", "HEARS", "SMELLS", "ANIMAL", "PATH_AVOID_DANGER", "WARM", "KEENNOSE", "EATS", "SMALL_HIDER" ] + }, + { + "id": "mon_boar_wild", + "type": "MONSTER", + "name": { "str": "wild boar" }, + "description": "Originally not native in the U.S., this wild omnivore is a crossbreed between the Eurasian wild boar escaped from hunting reserves and the domesticated pig gone feral in the wilderness. Its population has skyrocketed during the last few decades.", + "looks_like": "mon_pig", + "default_faction": "pig", + "bodytype": "pig", + "categories": [ "WILDLIFE" ], + "species": [ "MAMMAL" ], + "volume": "108500 ml", + "weight": "100 kg", + "hp": 60, + "speed": 110, + "material": [ "flesh" ], + "symbol": "b", + "color": "brown", + "aggression": 20, + "morale": 20, + "aggro_character": false, + "melee_skill": 5, + "melee_dice": 2, + "melee_dice_sides": 8, + "melee_damage": [ { "damage_type": "cut", "amount": 5 } ], + "dodge": 2, + "stomach_size": 1700, + "harvest": "boar_with_skull", + "weakpoint_sets": [ "wps_animal_quadruped" ], + "families": [ "prof_gross_anatomy", "prof_intro_biology", "prof_physiology", "prof_wp_ungulate" ], + "reproduction": { "baby_monster": "mon_boar_wild_piglet", "baby_count": 8, "baby_timer": 154 }, + "baby_flags": [ "SPRING", "SUMMER", "AUTUMN", "WINTER" ], + "biosignature": { "biosig_item": "feces_manure", "biosig_timer": 2 }, + "path_settings": { "max_dist": 10 }, + "anger_triggers": [ "PLAYER_WEAK", "FRIEND_ATTACKED", "HURT" ], + "fear_triggers": [ "SOUND", "PLAYER_CLOSE" ], + "zombify_into": "mon_zpig_brute", + "special_attacks": [ [ "EAT_FOOD", 20 ], [ "EAT_CARRION", 60 ] ], + "flags": [ + "SEES", + "HEARS", + "SMELLS", + "PET_MOUNTABLE", + "ANIMAL", + "PATH_AVOID_DANGER", + "WARM", + "KEENNOSE", + "CORNERED_FIGHTER", + "EATS" + ], + "armor": { "bash": 2, "cut": 1 } + }, + { + "id": "mon_bobcat", + "type": "MONSTER", + "name": { "str": "bobcat" }, + "description": "A spotted wild cat living across much of North America. It is not a serious threat to humans, but it can be aggressive when threatened.", + "default_faction": "cat", + "bodytype": "dog", + "categories": [ "WILDLIFE" ], + "species": [ "MAMMAL" ], + "volume": "8600 ml", + "weight": "8600 g", + "hp": 16, + "speed": 150, + "material": [ "flesh" ], + "symbol": "c", + "color": "brown", + "aggression": -25, + "morale": 1, + "aggro_character": false, + "melee_skill": 6, + "melee_dice": 1, + "melee_dice_sides": 6, + "melee_damage": [ { "damage_type": "cut", "amount": 2 } ], + "dodge": 8, + "vision_night": 20, + "fear_triggers": [ "SOUND", "PLAYER_CLOSE" ], + "harvest": "cat_medium_with_skull", + "families": [ "prof_gross_anatomy", "prof_intro_biology", "prof_physiology" ], + "dissect": "dissect_feline_sample_single", + "flags": [ "SEES", "HEARS", "GOODHEARING", "SMELLS", "ANIMAL", "PATH_AVOID_DANGER", "WARM", "HIT_AND_RUN", "SMALL_HIDER" ] + }, + { + "id": "mon_ant", + "type": "MONSTER", + "name": { "str": "giant ant" }, + "description": "An enormous red ant covered in chitinous plates. She possesses a pair of wriggling antennae and vicious-looking mandibles.", + "copy-from": "mon_ant", + "harvest": "giant_ant" + }, + { + "id": "mon_ant_acid", + "type": "MONSTER", + "name": { "str": "giant acidic ant" }, + "description": "A monstrous brown ant with a swollen abdomen that ends with a small orifice at the tip. Glistening liquid seems to drip out periodically.", + "copy-from": "mon_ant_acid", + "harvest": "giant_acid_ant" + } +] \ No newline at end of file From 9b410e6892e18775499413612330d91b34a7de92 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 11:06:50 -0500 Subject: [PATCH 044/158] Update xe_playable_gracken.json --- .../mutations/xe_playable_gracken.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json index fe179bf81a8c0..6f5897d81d099 100644 --- a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json +++ b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json @@ -22,6 +22,7 @@ "SHADE_SKIN", "SHADE_LEGS", "SHADE_ARMS", + "SHADE_EYES", "SHADE_HANDS", "SHADE_FEET", "SHADE_STOMACH", @@ -57,6 +58,21 @@ "purifiable": false, "threshold": true }, + { + "type": "mutation", + "id": "SHADE_EYES", + "name": { "str": "Shade Eyes" }, + "description": "Bright yellow eyes shine out from the shadowy crevices of your face.", + "//": "This is the baseline Gracken eyes mutation. TODO: Jsonify nightvision so you can ditch the NIGHTVISION trait.", + "types": [ "EYES" ], + "purifiable": false, + "mixed_effect": true, + "points": 1, + "visibility": 4, + "ugliness": 1, + "category": [ "GRACKEN" ], + "threshreq": [ "THRESH_SPECIES_GRACKEN" ] + }, { "type": "mutation", "id": "NIGHTVISION", From 4c24c4c91876b8d2ed26c44cc9419fa04fa3b2ee Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 08:00:15 -0500 Subject: [PATCH 045/158] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/mods/Xedra_Evolved/harvest_monster_hunter_gracken.json | 6 +----- data/mods/Xedra_Evolved/monsters/monster_overrides.json | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/data/mods/Xedra_Evolved/harvest_monster_hunter_gracken.json b/data/mods/Xedra_Evolved/harvest_monster_hunter_gracken.json index 421882969dfb3..94c192afa9e21 100644 --- a/data/mods/Xedra_Evolved/harvest_monster_hunter_gracken.json +++ b/data/mods/Xedra_Evolved/harvest_monster_hunter_gracken.json @@ -5,11 +5,7 @@ "type": "harvest", "copy-from": "zombie_grabber", "delete": { "entries": [ { "drop": "sinew", "mass_ratio": 0.00035 } ] }, - "extend": { - "entries": [ - { "drop": "grappler_sinew", "mass_ratio": 0.00035 } - ] - } + "extend": { "entries": [ { "drop": "grappler_sinew", "mass_ratio": 0.00035 } ] } }, { "id": "pig_with_skull", diff --git a/data/mods/Xedra_Evolved/monsters/monster_overrides.json b/data/mods/Xedra_Evolved/monsters/monster_overrides.json index e10c85085eca8..a4ddc832cd55f 100644 --- a/data/mods/Xedra_Evolved/monsters/monster_overrides.json +++ b/data/mods/Xedra_Evolved/monsters/monster_overrides.json @@ -1,5 +1,5 @@ [ - { + { "id": "mon_bear_cub", "type": "MONSTER", "copy-from": "mon_bear", @@ -229,4 +229,4 @@ "copy-from": "mon_ant_acid", "harvest": "giant_acid_ant" } -] \ No newline at end of file +] From 18f4028d506232b5bca80148a9af4c36f045c4ab Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 14:56:32 -0500 Subject: [PATCH 046/158] Gracken Eyes --- data/mods/Xedra_Evolved/body_parts.json | 43 +++++++++++++++++++ .../mutations/xe_playable_gracken.json | 3 +- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/data/mods/Xedra_Evolved/body_parts.json b/data/mods/Xedra_Evolved/body_parts.json index 2cb2d08576892..14e39acdff215 100644 --- a/data/mods/Xedra_Evolved/body_parts.json +++ b/data/mods/Xedra_Evolved/body_parts.json @@ -135,6 +135,49 @@ "name": "stalker eye", "name_multiple": "stalker eyes" }, + { + "id": "gracken_eyes", + "type": "body_part", + "name": "gracken's eyes", + "accusative": { "ctxt": "bodypart_accusative", "str": "gracken's eyes" }, + "heading": "s. eyes", + "heading_multiple": "s. eyes", + "encumbrance_text": "Ranged combat is hampered.", + "encumbrance_limit": 60, + "main_part": "head", + "opposite_part": "gracken_eyes", + "hit_size": 0.5, + "hit_difficulty": 1.15, + "limb_type": "sensor", + "limb_score_mods": [ { "limb_score": "vision", "modifier": 1 }, { "limb_score": "night_vis", "modifier": 1.5 } ], + "side": "both", + "base_hp": 60, + "drench_capacity": 0, + "flags": [ "IGNORE_TEMP", "LIMB_UPPER", "BIONIC_LIMB" ], + "smash_message": "You use your flippin' face to smash the %s. EXTREME.", + "sub_parts": [ "stalker_eye", "stalker_eye" ], + "effects_on_hit": [ + { + "id": "blind", + "dmg_threshold": 3, + "dmg_scale_increment": 3, + "chance": 50, + "chance_dmg_scaling": 5, + "duration": 1, + "duration_dmg_scaling": 0.5 + } + ] + }, + { + "id": "gracken_eye", + "type": "sub_body_part", + "max_coverage": 10, + "parent": "bp_null", + "side": 2, + "opposite": "gracken_eye", + "name": "gracken eye", + "name_multiple": "gracken eyes" + }, { "id": "devil_tail", "type": "body_part", diff --git a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json index 6f5897d81d099..2853195e3bca5 100644 --- a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json +++ b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json @@ -71,7 +71,8 @@ "visibility": 4, "ugliness": 1, "category": [ "GRACKEN" ], - "threshreq": [ "THRESH_SPECIES_GRACKEN" ] + "threshreq": [ "THRESH_SPECIES_GRACKEN" ], + "enchantments": [ { "condition": "ALWAYS", "modified_bodyparts": [ { "lose": "eyes" }, { "gain": "gracken_eyes" } ] } ] }, { "type": "mutation", From dd3d4a4d5edfc5761ad0190f7ce0f270b49e8421 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 20:06:47 -0500 Subject: [PATCH 047/158] Flagify Carnivore Update consumption.cpp --- data/json/mutations/mutations.json | 1 + .../mutations/xe_playable_gracken.json | 44 ++++++++++++++++++- src/consumption.cpp | 12 ++--- src/item.cpp | 3 +- 4 files changed, 50 insertions(+), 10 deletions(-) diff --git a/data/json/mutations/mutations.json b/data/json/mutations/mutations.json index ede2f6249c9ad..34a725a882c4e 100644 --- a/data/json/mutations/mutations.json +++ b/data/json/mutations/mutations.json @@ -7888,6 +7888,7 @@ "types": [ "DIET" ], "cancels": [ "VEGAN" ], "category": [ "LIZARD", "SPIDER", "CHIMERA", "RAPTOR", "FELINE", "BATRACHIAN", "BEAST", "LUPINE" ], + "flags": [ "CARNIVORE_DIET" ], "vitamin_rates": [ [ "vitC", -1200 ] ] }, { diff --git a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json index 2853195e3bca5..e917b0507d80d 100644 --- a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json +++ b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json @@ -245,7 +245,7 @@ "name": { "str": "Shade Stomach" }, "description": "Your dietary needs are so minimized that you could travel months or years without eating. There are consequences to this. One is an inability to process normal food. Another is a pretty constant state of weariness, but this is the best way to handle interdimensional travel until you are able to develop an organ to consume local foods. The ambient energies here are much weaker than what you normally encounter out in the Nether between universes, you need exposure to nuclear radiation to gain calories on this planet, for now.", "//": "This is the baseline Gracken stomach mutation.", - "types": [ "STOMACH" ], + "types": [ "DIET" ], "purifiable": false, "mixed_effect": true, "points": 1, @@ -261,6 +261,47 @@ "category": [ "GRACKEN" ], "threshreq": [ "THRESH_SPECIES_GRACKEN" ] }, + { + "type": "mutation", + "id": "SHADE_OMNIVORE", + "name": { "str": "Omnivorous Stomach" }, + "description": "You eat a wide variety of foods native to this world that would be appropriate for the dominant species.", + "//": "This is one path of Gracken stomach mutations.", + "types": [ "DIET" ], + "purifiable": false, + "mixed_effect": true, + "points": 1, + "category": [ "GRACKEN" ], + "threshreq": [ "THRESH_SPECIES_GRACKEN" ] + }, + { + "type": "mutation", + "id": "SHADE_CARNIVORE", + "name": { "str": "Carnivorous Stomach" }, + "description": "You eat an exclusively meat based diet as befits an apex predator of this planet.", + "//": "This is one path of Gracken stomach mutations.", + "types": [ "DIET" ], + "purifiable": false, + "mixed_effect": true, + "points": 1, + "category": [ "GRACKEN" ], + "threshreq": [ "THRESH_SPECIES_GRACKEN" ], + "flags": [ "CARNIVORE_DIET" ], + "vitamin_rates": [ [ "vitC", -1200 ] ] + }, + { + "type": "mutation", + "id": "SHADE_HERBIVORE", + "name": { "str": "Carnivorous Stomach" }, + "description": "You eat a herbivorous diet. The benefit of this is you never have to kill for your food. Unless the plants were trying to kill you first.", + "//": "This is one path of Gracken stomach mutations.", + "types": [ "DIET" ], + "purifiable": false, + "mixed_effect": true, + "points": 1, + "category": [ "GRACKEN" ], + "threshreq": [ "THRESH_SPECIES_GRACKEN" ] + }, { "type": "mutation", "id": "SHADE_EVOLUTION_GLAND", @@ -276,7 +317,6 @@ "type": "mutation", "id": "RADIOTROPHIC", "name": { "str": "Radiotrophic" }, - "types": [ "DIET" ], "points": 3, "vitamin_cost": 160, "description": "Your system has adapted to radiation. While irradiated, you will convert the radiation into calories.", diff --git a/src/consumption.cpp b/src/consumption.cpp index 3bd4d698c16e7..b9d04a1a05109 100644 --- a/src/consumption.cpp +++ b/src/consumption.cpp @@ -116,6 +116,7 @@ static const json_character_flag json_flag_HEMOVORE( "HEMOVORE" ); static const json_character_flag json_flag_IMMUNE_SPOIL( "IMMUNE_SPOIL" ); static const json_character_flag json_flag_NUMB( "NUMB" ); static const json_character_flag json_flag_PARAIMMUNE( "PARAIMMUNE" ); +static const json_character_flag json_flag_CARNIVORE_DIET( "CARNIVORE_DIET" ); static const json_character_flag json_flag_PRED1( "PRED1" ); static const json_character_flag json_flag_PRED2( "PRED2" ); static const json_character_flag json_flag_PRED3( "PRED3" ); @@ -156,7 +157,6 @@ static const trait_id trait_AMORPHOUS( "AMORPHOUS" ); static const trait_id trait_ANTIFRUIT( "ANTIFRUIT" ); static const trait_id trait_ANTIJUNK( "ANTIJUNK" ); static const trait_id trait_ANTIWHEAT( "ANTIWHEAT" ); -static const trait_id trait_CARNIVORE( "CARNIVORE" ); static const trait_id trait_EATDEAD( "EATDEAD" ); static const trait_id trait_EATHEALTH( "EATHEALTH" ); static const trait_id trait_GOURMAND( "GOURMAND" ); @@ -232,7 +232,7 @@ static int compute_default_effective_kcal( const item &comest, const Character & kcal *= 0.75f; } - if( you.has_trait( trait_CARNIVORE ) && comest.has_flag( flag_CARNIVORE_OK ) && + if( you.has_flag( flag_CARNIVORE_DIET ) && comest.has_flag( flag_CARNIVORE_OK ) && comest.has_any_vitamin( carnivore_blacklist ) ) { // TODO: Comment pizza scrapping kcal *= 0.5f; @@ -918,7 +918,7 @@ ret_val Character::can_eat( const item &food ) const return ret_val::make_failure( INEDIBLE_MUTATION, _( "Ugh, you can't drink that!" ) ); } - if( has_trait( trait_CARNIVORE ) && compute_effective_nutrients( food ).kcal() > 0 && + if( has_flag( flag_CARNIVORE_DIET ) && compute_effective_nutrients( food ).kcal() > 0 && food.has_any_vitamin( carnivore_blacklist ) && !food.has_flag( flag_CARNIVORE_OK ) ) { return ret_val::make_failure( INEDIBLE_MUTATION, _( "Eww. Inedible plant stuff!" ) ); @@ -993,7 +993,7 @@ ret_val Character::will_eat( const item &food, bool interactive ) } } - const bool carnivore = has_trait( trait_CARNIVORE ); + const bool carnivore = has_flag( flag_CARNIVORE_DIET ); const bool food_is_human_flesh = food.has_vitamin( vitamin_human_flesh_vitamin ) || ( food.has_flag( flag_STRICT_HUMANITARIANISM ) && !has_flag( json_flag_STRICT_HUMANITARIAN ) ); @@ -1432,7 +1432,7 @@ void Character::modify_morale( item &food, const int nutr ) // Organs are still usually negative due to fun values as low as -35. // The PREDATOR_FUN flag shouldn't be on human flesh, to not interfere with sapiovores/cannibalism. if( food.has_flag( flag_PREDATOR_FUN ) ) { - const bool carnivore = has_trait( trait_CARNIVORE ); + const bool carnivore = has_flag( flag_CARNIVORE_DIET ); const bool culler = has_flag( json_flag_PRED1 ); const bool hunter = has_flag( json_flag_PRED2 ); const bool predator = has_flag( json_flag_PRED3 ); @@ -1477,7 +1477,7 @@ void Character::modify_morale( item &food, const int nutr ) } // Carnivores CAN eat junk food, but they won't like it much. // Pizza-scraping happens in consume_effects. - if( has_trait( trait_CARNIVORE ) && !food.has_flag( flag_CARNIVORE_OK ) ) { + if( has_flag( flag_CARNIVORE_DIET ) && !food.has_flag( flag_CARNIVORE_OK ) ) { add_msg_if_player( m_bad, _( "Your stomach begins gurgling and you feel bloated and ill." ) ); add_morale( morale_no_digest, -25, -125, 30_minutes, 24_minutes ); } diff --git a/src/item.cpp b/src/item.cpp index 607694cc5cb22..384dd67a82a6a 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -216,7 +216,6 @@ static const species_id species_ROBOT( "ROBOT" ); static const sub_bodypart_str_id sub_body_part_torso_lower( "torso_lower" ); static const sub_bodypart_str_id sub_body_part_torso_upper( "torso_upper" ); -static const trait_id trait_CARNIVORE( "CARNIVORE" ); static const trait_id trait_JITTERY( "JITTERY" ); static const trait_id trait_LIGHTWEIGHT( "LIGHTWEIGHT" ); static const trait_id trait_TOLERANCE( "TOLERANCE" ); @@ -2756,7 +2755,7 @@ void item::food_info( const item *food_item, std::vector &info, std::abs( static_cast( food_item->count() ) * batch ) ); } if( food_item->corpse != nullptr && parts->test( iteminfo_parts::FOOD_SMELL ) && - ( debug || ( g != nullptr && player_character.has_trait( trait_CARNIVORE ) ) ) ) { + ( debug || ( g != nullptr && player_character.has_flag( flag_CARNIVORE_DIET ) ) ) ) { info.emplace_back( "FOOD", _( "Smells like: " ) + food_item->corpse->nname() ); } From d72ee161ecea5e33dd33bd289839ab8f1b1beb8d Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 21:01:23 -0500 Subject: [PATCH 048/158] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json index e917b0507d80d..601f24b41eb4b 100644 --- a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json +++ b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json @@ -267,7 +267,7 @@ "name": { "str": "Omnivorous Stomach" }, "description": "You eat a wide variety of foods native to this world that would be appropriate for the dominant species.", "//": "This is one path of Gracken stomach mutations.", - "types": [ "DIET" ], + "types": [ "DIET" ], "purifiable": false, "mixed_effect": true, "points": 1, @@ -280,7 +280,7 @@ "name": { "str": "Carnivorous Stomach" }, "description": "You eat an exclusively meat based diet as befits an apex predator of this planet.", "//": "This is one path of Gracken stomach mutations.", - "types": [ "DIET" ], + "types": [ "DIET" ], "purifiable": false, "mixed_effect": true, "points": 1, @@ -295,7 +295,7 @@ "name": { "str": "Carnivorous Stomach" }, "description": "You eat a herbivorous diet. The benefit of this is you never have to kill for your food. Unless the plants were trying to kill you first.", "//": "This is one path of Gracken stomach mutations.", - "types": [ "DIET" ], + "types": [ "DIET" ], "purifiable": false, "mixed_effect": true, "points": 1, From 4e10abc69e6fc8ad0ffe292fc2c75f99c8ec2b59 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 22:07:39 -0500 Subject: [PATCH 049/158] Update flags.json --- data/json/flags.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/json/flags.json b/data/json/flags.json index 9ad8ad6c6b3e1..9ff0b5ab373dc 100644 --- a/data/json/flags.json +++ b/data/json/flags.json @@ -1341,6 +1341,10 @@ "id": "CANNIBAL", "type": "json_flag" }, + { + "id": "CARNIVORE_DIET", + "type": "json_flag" + }, { "id": "CARNIVORE_OK", "type": "json_flag" From 149a34118b413d3a0d07e65da2549aabf37482b4 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 22:15:39 -0500 Subject: [PATCH 050/158] Revert "Update flags.json" This reverts commit b98cd498a113d6cd5cb1ad0a2f15b261e2dd0bbf. --- data/json/flags.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/data/json/flags.json b/data/json/flags.json index 9ff0b5ab373dc..9ad8ad6c6b3e1 100644 --- a/data/json/flags.json +++ b/data/json/flags.json @@ -1341,10 +1341,6 @@ "id": "CANNIBAL", "type": "json_flag" }, - { - "id": "CARNIVORE_DIET", - "type": "json_flag" - }, { "id": "CARNIVORE_OK", "type": "json_flag" From 11114945d59dbbb0c45f35677319432360e05d84 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 22:17:02 -0500 Subject: [PATCH 051/158] Update consumption.cpp --- src/consumption.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/consumption.cpp b/src/consumption.cpp index b9d04a1a05109..aadc2d67b15bf 100644 --- a/src/consumption.cpp +++ b/src/consumption.cpp @@ -232,7 +232,7 @@ static int compute_default_effective_kcal( const item &comest, const Character & kcal *= 0.75f; } - if( you.has_flag( flag_CARNIVORE_DIET ) && comest.has_flag( flag_CARNIVORE_OK ) && + if( you.has_flag( json_flag_CARNIVORE_DIET ) && comest.has_flag( flag_CARNIVORE_OK ) && comest.has_any_vitamin( carnivore_blacklist ) ) { // TODO: Comment pizza scrapping kcal *= 0.5f; @@ -918,7 +918,7 @@ ret_val Character::can_eat( const item &food ) const return ret_val::make_failure( INEDIBLE_MUTATION, _( "Ugh, you can't drink that!" ) ); } - if( has_flag( flag_CARNIVORE_DIET ) && compute_effective_nutrients( food ).kcal() > 0 && + if( has_flag( json_flag_CARNIVORE_DIET ) && compute_effective_nutrients( food ).kcal() > 0 && food.has_any_vitamin( carnivore_blacklist ) && !food.has_flag( flag_CARNIVORE_OK ) ) { return ret_val::make_failure( INEDIBLE_MUTATION, _( "Eww. Inedible plant stuff!" ) ); @@ -993,7 +993,7 @@ ret_val Character::will_eat( const item &food, bool interactive ) } } - const bool carnivore = has_flag( flag_CARNIVORE_DIET ); + const bool carnivore = has_flag( json_flag_CARNIVORE_DIET ); const bool food_is_human_flesh = food.has_vitamin( vitamin_human_flesh_vitamin ) || ( food.has_flag( flag_STRICT_HUMANITARIANISM ) && !has_flag( json_flag_STRICT_HUMANITARIAN ) ); @@ -1432,7 +1432,7 @@ void Character::modify_morale( item &food, const int nutr ) // Organs are still usually negative due to fun values as low as -35. // The PREDATOR_FUN flag shouldn't be on human flesh, to not interfere with sapiovores/cannibalism. if( food.has_flag( flag_PREDATOR_FUN ) ) { - const bool carnivore = has_flag( flag_CARNIVORE_DIET ); + const bool carnivore = has_flag( json_flag_CARNIVORE_DIET ); const bool culler = has_flag( json_flag_PRED1 ); const bool hunter = has_flag( json_flag_PRED2 ); const bool predator = has_flag( json_flag_PRED3 ); @@ -1477,7 +1477,7 @@ void Character::modify_morale( item &food, const int nutr ) } // Carnivores CAN eat junk food, but they won't like it much. // Pizza-scraping happens in consume_effects. - if( has_flag( flag_CARNIVORE_DIET ) && !food.has_flag( flag_CARNIVORE_OK ) ) { + if( has_flag( json_flag_CARNIVORE_DIET ) && !food.has_flag( flag_CARNIVORE_OK ) ) { add_msg_if_player( m_bad, _( "Your stomach begins gurgling and you feel bloated and ill." ) ); add_morale( morale_no_digest, -25, -125, 30_minutes, 24_minutes ); } From 75a4c3250440172a0a869052a4053c897e99e77e Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 22:54:58 -0500 Subject: [PATCH 052/158] Update item.cpp --- src/item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item.cpp b/src/item.cpp index 384dd67a82a6a..a112691029e94 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -2755,7 +2755,7 @@ void item::food_info( const item *food_item, std::vector &info, std::abs( static_cast( food_item->count() ) * batch ) ); } if( food_item->corpse != nullptr && parts->test( iteminfo_parts::FOOD_SMELL ) && - ( debug || ( g != nullptr && player_character.has_flag( flag_CARNIVORE_DIET ) ) ) ) { + ( debug || ( g != nullptr && player_character.has_flag( json_flag_CARNIVORE_DIET ) ) ) ) { info.emplace_back( "FOOD", _( "Smells like: " ) + food_item->corpse->nname() ); } From cdbb848486e63c8f7609f1d648b6340a8d4d7c8d Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 23:00:51 -0500 Subject: [PATCH 053/158] Update flag.h --- src/flag.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/flag.h b/src/flag.h index 75932914c8681..f281506dcae1f 100644 --- a/src/flag.h +++ b/src/flag.h @@ -69,6 +69,7 @@ extern const flag_id flag_CAMERA_PRO; extern const flag_id flag_CANNIBAL; extern const flag_id flag_CANT_HEAL_EVERYONE; extern const flag_id flag_CANT_WEAR; +extern const flag_id flag_CARNIVORE_DIET; extern const flag_id flag_CARNIVORE_OK; extern const flag_id flag_CASING; extern const flag_id flag_CATTLE; From 6784cef7a1ec197d9cea604fdd7254e480174883 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sat, 7 Sep 2024 23:46:29 -0500 Subject: [PATCH 054/158] Update item.cpp --- src/item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item.cpp b/src/item.cpp index a112691029e94..384dd67a82a6a 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -2755,7 +2755,7 @@ void item::food_info( const item *food_item, std::vector &info, std::abs( static_cast( food_item->count() ) * batch ) ); } if( food_item->corpse != nullptr && parts->test( iteminfo_parts::FOOD_SMELL ) && - ( debug || ( g != nullptr && player_character.has_flag( json_flag_CARNIVORE_DIET ) ) ) ) { + ( debug || ( g != nullptr && player_character.has_flag( flag_CARNIVORE_DIET ) ) ) ) { info.emplace_back( "FOOD", _( "Smells like: " ) + food_item->corpse->nname() ); } From de308c238aee1dccb471c16f9c1b2f2a5e16889b Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sun, 8 Dec 2024 01:27:40 -0600 Subject: [PATCH 055/158] Update data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json Co-authored-by: Anton Burmistrov --- data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json index 601f24b41eb4b..575e63b12ebaf 100644 --- a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json +++ b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json @@ -292,7 +292,7 @@ { "type": "mutation", "id": "SHADE_HERBIVORE", - "name": { "str": "Carnivorous Stomach" }, + "name": { "str": "Herbivore Stomach" }, "description": "You eat a herbivorous diet. The benefit of this is you never have to kill for your food. Unless the plants were trying to kill you first.", "//": "This is one path of Gracken stomach mutations.", "types": [ "DIET" ], From af2ba230d9ac00ec61bf615f509ebf6d3cf009ef Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sun, 8 Dec 2024 01:27:48 -0600 Subject: [PATCH 056/158] Update data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json Co-authored-by: Anton Burmistrov --- data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json index 575e63b12ebaf..5a4da2b2a4ace 100644 --- a/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json +++ b/data/mods/Xedra_Evolved/mutations/xe_playable_gracken.json @@ -278,7 +278,7 @@ "type": "mutation", "id": "SHADE_CARNIVORE", "name": { "str": "Carnivorous Stomach" }, - "description": "You eat an exclusively meat based diet as befits an apex predator of this planet.", + "description": "You eat an exclusively meat-based diet as befits an apex predator of this planet.", "//": "This is one path of Gracken stomach mutations.", "types": [ "DIET" ], "purifiable": false, From 0ad395d1a0345fedea3c1d4e8c8116f8d5d3edff Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:11:07 -0600 Subject: [PATCH 057/158] Update consumption.cpp --- src/consumption.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/consumption.cpp b/src/consumption.cpp index aadc2d67b15bf..306f0df1acfec 100644 --- a/src/consumption.cpp +++ b/src/consumption.cpp @@ -112,11 +112,11 @@ static const itype_id itype_syringe( "syringe" ); static const json_character_flag json_flag_BLOODFEEDER( "BLOODFEEDER" ); static const json_character_flag json_flag_CANNIBAL( "CANNIBAL" ); +static const json_character_flag json_flag_CARNIVORE_DIET( "CARNIVORE_DIET" ); static const json_character_flag json_flag_HEMOVORE( "HEMOVORE" ); static const json_character_flag json_flag_IMMUNE_SPOIL( "IMMUNE_SPOIL" ); static const json_character_flag json_flag_NUMB( "NUMB" ); static const json_character_flag json_flag_PARAIMMUNE( "PARAIMMUNE" ); -static const json_character_flag json_flag_CARNIVORE_DIET( "CARNIVORE_DIET" ); static const json_character_flag json_flag_PRED1( "PRED1" ); static const json_character_flag json_flag_PRED2( "PRED2" ); static const json_character_flag json_flag_PRED3( "PRED3" ); From 1ab3d0323b5cf31c64eed1bf0ef49df24989cf97 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Mon, 9 Dec 2024 21:28:42 -0600 Subject: [PATCH 058/158] Update item.cpp --- src/item.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/item.cpp b/src/item.cpp index 384dd67a82a6a..37fa2815b18dd 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -187,6 +187,7 @@ static const itype_id itype_water_clean( "water_clean" ); static const itype_id itype_waterproof_gunmod( "waterproof_gunmod" ); static const json_character_flag json_flag_CANNIBAL( "CANNIBAL" ); +static const json_character_flag json_flag_CARNIVORE_DIET( "CARNIVORE_DIET" ); static const json_character_flag json_flag_IMMUNE_SPOIL( "IMMUNE_SPOIL" ); static const json_character_flag json_flag_PSYCHOPATH( "PSYCHOPATH" ); static const json_character_flag json_flag_SAPIOVORE( "SAPIOVORE" ); From a3e97c7335b4dc322d3528033d98b4e3d0fa552d Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Mon, 9 Dec 2024 23:34:51 -0600 Subject: [PATCH 059/158] Update src/item.cpp --- src/item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item.cpp b/src/item.cpp index 37fa2815b18dd..4389bd437e75a 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -2756,7 +2756,7 @@ void item::food_info( const item *food_item, std::vector &info, std::abs( static_cast( food_item->count() ) * batch ) ); } if( food_item->corpse != nullptr && parts->test( iteminfo_parts::FOOD_SMELL ) && - ( debug || ( g != nullptr && player_character.has_flag( flag_CARNIVORE_DIET ) ) ) ) { + ( debug || ( g != nullptr && player_character.has_flag( json_flag_CARNIVORE_DIET ) ) ) ) { info.emplace_back( "FOOD", _( "Smells like: " ) + food_item->corpse->nname() ); } From b6346376784e9817a83352bfc2b7a1a45282ca4f Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:45:37 -0600 Subject: [PATCH 060/158] Apply suggestions from code review --- data/mods/Xedra_Evolved/body_parts.json | 2 +- data/mods/Xedra_Evolved/monsters/monster_overrides.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/mods/Xedra_Evolved/body_parts.json b/data/mods/Xedra_Evolved/body_parts.json index 14e39acdff215..bea58ec29a783 100644 --- a/data/mods/Xedra_Evolved/body_parts.json +++ b/data/mods/Xedra_Evolved/body_parts.json @@ -149,7 +149,7 @@ "hit_size": 0.5, "hit_difficulty": 1.15, "limb_type": "sensor", - "limb_score_mods": [ { "limb_score": "vision", "modifier": 1 }, { "limb_score": "night_vis", "modifier": 1.5 } ], + "limb_scores": [ [ "vision", 1.0 ], [ "night_vis", 1.5 ], [ "reaction", 1 ] ], "side": "both", "base_hp": 60, "drench_capacity": 0, diff --git a/data/mods/Xedra_Evolved/monsters/monster_overrides.json b/data/mods/Xedra_Evolved/monsters/monster_overrides.json index a4ddc832cd55f..264daa76306db 100644 --- a/data/mods/Xedra_Evolved/monsters/monster_overrides.json +++ b/data/mods/Xedra_Evolved/monsters/monster_overrides.json @@ -56,7 +56,7 @@ "harvest": "bear_with_skull", "dissect": "dissect_ursine_sample_small", "families": [ "prof_gross_anatomy", "prof_intro_biology", "prof_physiology" ], - "reproduction": { "baby_monster": "mon_bear_cub", "baby_count": 1, "baby_timer": 700 }, + "reproduction": { "baby_type": { "baby_monster": "mon_bear_cub" }, "baby_count": 1, "baby_timer": 700 }, "//": "220 days gestation period, the mother and cubs remain together for 16-17 months.", "baby_flags": [ "SPRING" ], "special_attacks": [ [ "EAT_FOOD", 20 ], { "type": "bite", "cooldown": 15, "infection_chance": 44 }, [ "BROWSE", 40 ] ], @@ -160,7 +160,7 @@ "harvest": "boar_with_skull", "weakpoint_sets": [ "wps_animal_quadruped" ], "families": [ "prof_gross_anatomy", "prof_intro_biology", "prof_physiology", "prof_wp_ungulate" ], - "reproduction": { "baby_monster": "mon_boar_wild_piglet", "baby_count": 8, "baby_timer": 154 }, + "reproduction": { "baby_type": { "baby_monster": "mon_boar_wild_piglet" }, "baby_count": 8, "baby_timer": 154 }, "baby_flags": [ "SPRING", "SUMMER", "AUTUMN", "WINTER" ], "biosignature": { "biosig_item": "feces_manure", "biosig_timer": 2 }, "path_settings": { "max_dist": 10 }, From 2e86350f0c2385fd7c01496baf5423dc406576a2 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Tue, 10 Dec 2024 22:59:20 -0600 Subject: [PATCH 061/158] Initial commit --- .../MindOverMatter/monsters/death_effects.json | 14 ++++++++++++-- .../MindOverMatter/monsters/feral_psychics.json | 5 ++--- .../monsters/monster_eoc_attacks.json | 2 +- .../MindOverMatter/monsters/monsters_spells.json | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/data/mods/MindOverMatter/monsters/death_effects.json b/data/mods/MindOverMatter/monsters/death_effects.json index b2ee78cc81d2a..e5ffd5654958e 100644 --- a/data/mods/MindOverMatter/monsters/death_effects.json +++ b/data/mods/MindOverMatter/monsters/death_effects.json @@ -207,8 +207,18 @@ "type": "effect_on_condition", "id": "EOC_VITAKIN3_DEATH_EFFECT", "effect": [ - { "u_spawn_monster": "mon_feral_human_vita3_revived", "min_radius": 1 }, - { "u_location_variable": { "context_val": "loc" }, "monster": "mon_feral_human_vita3_revived" }, + { "u_location_variable": { "context_val": "spawn_place" }, "min_radius": 0 }, + { + "u_map_run_item_eocs": "all", + "loc": { "context_val": "spawn_place" }, + "true_eocs": [ { "id": "EOC_EOC_VITAKIN3_DEATH_EFFECT_HANDLING_DELETE_NPC_ITEMS", "effect": [ "npc_die" ] } ] + }, + { + "u_spawn_monster": "mon_feral_human_vita3_revived", + "target_var": { "context_val": "spawn_place" }, + "min_radius": 0 + }, + { "u_location_variable": { "context_val": "loc" }, "monster": "mon_feral_human_vita3_revived", "min_radius": 2 }, { "run_eocs": "EOC_VITAKIN3_DEATH_EFFECT_2", "alpha_loc": { "context_val": "loc" } } ] }, diff --git a/data/mods/MindOverMatter/monsters/feral_psychics.json b/data/mods/MindOverMatter/monsters/feral_psychics.json index 050be2f64c6a3..9b1e93a91f15a 100644 --- a/data/mods/MindOverMatter/monsters/feral_psychics.json +++ b/data/mods/MindOverMatter/monsters/feral_psychics.json @@ -1465,8 +1465,7 @@ "anger_triggers": [ "FRIEND_DIED", "FRIEND_ATTACKED", "HURT" ], "death_function": { "eoc": "EOC_VITAKIN3_DEATH_EFFECT", - "message": "As %s succumbs to their wounds, they suddenly rise up with new vitality!", - "corpse_type": "NO_CORPSE" + "message": "As %s succumbs to their wounds, they suddenly rise up with new vitality!" }, "extend": { "special_attacks": [ @@ -1522,7 +1521,7 @@ "damage_max_instance": [ { "damage_type": "biological", "amount": 1 } ], "dodgeable": true, "blockable": true, - "eoc": [ "EOC_FERAL_VITAKIN3_DEGENERATING_TOUCH" ], + "eoc": [ "EOC_VITAKIN_FERAL_VITA3_DEGENERATING_TOUCH" ], "condition": { "not": { "u_has_flag": "NO_PSIONICS" } }, "hit_dmg_u": "%1$s touches you and you feel weaker!", "hit_dmg_npc": "%1$s touches and they flinch!", diff --git a/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json b/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json index 989503a13842f..73a41384ca1bc 100644 --- a/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json +++ b/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json @@ -23,7 +23,7 @@ }, { "type": "effect_on_condition", - "id": "EOC_FERAL_VITAKIN2_ENERVATING_TOUCH", + "id": "EOC_FERAL_VITAKIN3_ENERVATING_TOUCH", "condition": "npc_is_character", "effect": [ { "npc_add_effect": "effect_vitakinetic_healing_down", "duration": [ 620000, 1620000 ] }, diff --git a/data/mods/MindOverMatter/monsters/monsters_spells.json b/data/mods/MindOverMatter/monsters/monsters_spells.json index 27acb0a263d4e..1fd2aca856285 100644 --- a/data/mods/MindOverMatter/monsters/monsters_spells.json +++ b/data/mods/MindOverMatter/monsters/monsters_spells.json @@ -1239,7 +1239,7 @@ "effect_str": "effect_vita_degenerating_touch", "damage_type": "biological", "shape": "blast", - "min_dot": 3, + "min_dot": 4, "max_dot": 10, "min_duration": 1500, "max_duration": 6500 From 31a8c3a5c4bc1faf578f54c23debad660c4be24b Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Tue, 10 Dec 2024 22:59:41 -0600 Subject: [PATCH 062/158] Fixes --- .../MindOverMatter/monsters/death_effects.json | 14 ++++++++++++-- .../MindOverMatter/monsters/feral_psychics.json | 5 ++--- .../monsters/monster_eoc_attacks.json | 2 +- .../MindOverMatter/monsters/monsters_spells.json | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/data/mods/MindOverMatter/monsters/death_effects.json b/data/mods/MindOverMatter/monsters/death_effects.json index b2ee78cc81d2a..e5ffd5654958e 100644 --- a/data/mods/MindOverMatter/monsters/death_effects.json +++ b/data/mods/MindOverMatter/monsters/death_effects.json @@ -207,8 +207,18 @@ "type": "effect_on_condition", "id": "EOC_VITAKIN3_DEATH_EFFECT", "effect": [ - { "u_spawn_monster": "mon_feral_human_vita3_revived", "min_radius": 1 }, - { "u_location_variable": { "context_val": "loc" }, "monster": "mon_feral_human_vita3_revived" }, + { "u_location_variable": { "context_val": "spawn_place" }, "min_radius": 0 }, + { + "u_map_run_item_eocs": "all", + "loc": { "context_val": "spawn_place" }, + "true_eocs": [ { "id": "EOC_EOC_VITAKIN3_DEATH_EFFECT_HANDLING_DELETE_NPC_ITEMS", "effect": [ "npc_die" ] } ] + }, + { + "u_spawn_monster": "mon_feral_human_vita3_revived", + "target_var": { "context_val": "spawn_place" }, + "min_radius": 0 + }, + { "u_location_variable": { "context_val": "loc" }, "monster": "mon_feral_human_vita3_revived", "min_radius": 2 }, { "run_eocs": "EOC_VITAKIN3_DEATH_EFFECT_2", "alpha_loc": { "context_val": "loc" } } ] }, diff --git a/data/mods/MindOverMatter/monsters/feral_psychics.json b/data/mods/MindOverMatter/monsters/feral_psychics.json index 050be2f64c6a3..9b1e93a91f15a 100644 --- a/data/mods/MindOverMatter/monsters/feral_psychics.json +++ b/data/mods/MindOverMatter/monsters/feral_psychics.json @@ -1465,8 +1465,7 @@ "anger_triggers": [ "FRIEND_DIED", "FRIEND_ATTACKED", "HURT" ], "death_function": { "eoc": "EOC_VITAKIN3_DEATH_EFFECT", - "message": "As %s succumbs to their wounds, they suddenly rise up with new vitality!", - "corpse_type": "NO_CORPSE" + "message": "As %s succumbs to their wounds, they suddenly rise up with new vitality!" }, "extend": { "special_attacks": [ @@ -1522,7 +1521,7 @@ "damage_max_instance": [ { "damage_type": "biological", "amount": 1 } ], "dodgeable": true, "blockable": true, - "eoc": [ "EOC_FERAL_VITAKIN3_DEGENERATING_TOUCH" ], + "eoc": [ "EOC_VITAKIN_FERAL_VITA3_DEGENERATING_TOUCH" ], "condition": { "not": { "u_has_flag": "NO_PSIONICS" } }, "hit_dmg_u": "%1$s touches you and you feel weaker!", "hit_dmg_npc": "%1$s touches and they flinch!", diff --git a/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json b/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json index 989503a13842f..73a41384ca1bc 100644 --- a/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json +++ b/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json @@ -23,7 +23,7 @@ }, { "type": "effect_on_condition", - "id": "EOC_FERAL_VITAKIN2_ENERVATING_TOUCH", + "id": "EOC_FERAL_VITAKIN3_ENERVATING_TOUCH", "condition": "npc_is_character", "effect": [ { "npc_add_effect": "effect_vitakinetic_healing_down", "duration": [ 620000, 1620000 ] }, diff --git a/data/mods/MindOverMatter/monsters/monsters_spells.json b/data/mods/MindOverMatter/monsters/monsters_spells.json index 27acb0a263d4e..1fd2aca856285 100644 --- a/data/mods/MindOverMatter/monsters/monsters_spells.json +++ b/data/mods/MindOverMatter/monsters/monsters_spells.json @@ -1239,7 +1239,7 @@ "effect_str": "effect_vita_degenerating_touch", "damage_type": "biological", "shape": "blast", - "min_dot": 3, + "min_dot": 4, "max_dot": 10, "min_duration": 1500, "max_duration": 6500 From 4ecc467f7c38eb2dd3c5e123b89dc49b5504f248 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Wed, 11 Dec 2024 00:30:57 -0600 Subject: [PATCH 063/158] Update data/mods/Xedra_Evolved/items/carnivore.json --- data/mods/Xedra_Evolved/items/carnivore.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data/mods/Xedra_Evolved/items/carnivore.json b/data/mods/Xedra_Evolved/items/carnivore.json index cb07194296ef1..11c1835f1f6c7 100644 --- a/data/mods/Xedra_Evolved/items/carnivore.json +++ b/data/mods/Xedra_Evolved/items/carnivore.json @@ -155,6 +155,14 @@ "type": "COMESTIBLE", "name": { "str": "carnivore stomach" }, "description": "The stomach of an carnivorous creature. It is surprisingly durable." + }, + { + "id": "small_carnivore_stomach", + "copy-from": "stomach", + "type": "COMESTIBLE", + "name": { "str": "small carnivore stomach" }, + "description": "The stomach of a small carnivorous creature. It is surprisingly durable.", + "proportional": { "weight": 0.5, "volume": 0.5, "price": 0.5, "calories": 0.5 } }, { "id": "small_omnivore_stomach", From d5a09b7ea3fdcfa0b40e6a82ada120d37ad67f92 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Wed, 11 Dec 2024 00:41:21 -0600 Subject: [PATCH 064/158] Update gracken_trait_improvements.json --- .../items/gracken_trait_improvements.json | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/data/mods/Xedra_Evolved/items/gracken_trait_improvements.json b/data/mods/Xedra_Evolved/items/gracken_trait_improvements.json index 879c117e29faf..15bb79fed32af 100644 --- a/data/mods/Xedra_Evolved/items/gracken_trait_improvements.json +++ b/data/mods/Xedra_Evolved/items/gracken_trait_improvements.json @@ -120,5 +120,59 @@ } ] } + }, + { + "id": "gracken_herbivorous_stomach", + "copy-from": "gracken_improvement_general", + "type": "COMESTIBLE", + "name": { "str_sp": "Gracken Herbivorous Stomach" }, + "looks_like": "offal", + "description": "An organ that allows a mature Gracken to convert their diet to an herbivorous one.", + "use_action": { + "type": "effect_on_conditions", + "description": "Changed your diet to eating only plants.", + "effect_on_conditions": [ + { + "id": "herbivorous_stomach", + "effect": [ { "u_message": "You exchanged your previous stomach for this." }, { "u_add_trait": "SHADE_HERBIVORE" } ] + } + ] + } + }, + { + "id": "gracken_omnivorous_stomach", + "copy-from": "gracken_improvement_general", + "type": "COMESTIBLE", + "name": { "str_sp": "Gracken Dextrous Hands" }, + "looks_like": "offal", + "description": "An organ that allows a mature Gracken to convert their diet to an omnivorous one.", + "use_action": { + "type": "effect_on_conditions", + "description": "Changed your diet to eating most things.", + "effect_on_conditions": [ + { + "id": "omnivorous_stomach", + "effect": [ { "u_message": "You exchanged your previous stomach for this." }, { "u_add_trait": "SHADE_OMNIVORE" } ] + } + ] + } + }, + { + "id": "gracken_carnivorous_stomach", + "copy-from": "gracken_improvement_general", + "type": "COMESTIBLE", + "name": { "str_sp": "Gracken Dextrous Hands" }, + "looks_like": "offal", + "description": "An organ that allows a mature Gracken to convert their diet to an carnivorous one.", + "use_action": { + "type": "effect_on_conditions", + "description": "Changed your diet to meat eating.", + "effect_on_conditions": [ + { + "id": "carnivorous_stomach", + "effect": [ { "u_message": "You exchanged your previous stomach for this." }, { "u_add_trait": "SHADE_CARNIVORE" } ] + } + ] + } } ] From 99cacc1d2e72a5892876cc3eaa6f169fdb10fcf1 Mon Sep 17 00:00:00 2001 From: Anton Simakov <67688115+GuardianDll@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:25:17 +0100 Subject: [PATCH 065/158] please clang --- data/mods/BombasticPerks/perkdata/bellringer.json | 2 +- src/magic_enchantment.cpp | 6 +++--- src/magic_enchantment.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/mods/BombasticPerks/perkdata/bellringer.json b/data/mods/BombasticPerks/perkdata/bellringer.json index 4922472d4ef46..62940ca4a2d3b 100644 --- a/data/mods/BombasticPerks/perkdata/bellringer.json +++ b/data/mods/BombasticPerks/perkdata/bellringer.json @@ -27,6 +27,6 @@ "apply_message": "", "rating": "bad", "max_duration": "1 s", - "incoming_damage_mod": [ { "type": "bash", "multiply": -0.33 } ] + "enchantments": [ { "incoming_damage_mod": [ { "type": "bash", "multiply": -0.33 } ] } ] } ] diff --git a/src/magic_enchantment.cpp b/src/magic_enchantment.cpp index 208f46d98dde4..03e9fc239bfdc 100644 --- a/src/magic_enchantment.cpp +++ b/src/magic_enchantment.cpp @@ -352,8 +352,8 @@ bool enchantment::is_monster_relevant() const } } - if( damage_values_add.size() != 0 || damage_values_multiply.size() != 0 || - armor_values_add.size() != 0 || armor_values_multiply.size() != 0 ) { + if( !damage_values_add.empty() || !damage_values_multiply.empty() || + !armor_values_add.empty() || !armor_values_multiply.empty() ) { return true; } @@ -875,7 +875,7 @@ void enchant_cache::force_add( const enchantment &rhs ) force_add_with_dialogue( rhs, d, false ); } -void enchant_cache::force_add_with_dialogue( const enchantment &rhs, const const_dialogue d, +void enchant_cache::force_add_with_dialogue( const enchantment &rhs, const const_dialogue &d, const bool evaluate ) { for( const std::pair &pair_values : diff --git a/src/magic_enchantment.h b/src/magic_enchantment.h index b6ac369273aeb..9527a77b98fc6 100644 --- a/src/magic_enchantment.h +++ b/src/magic_enchantment.h @@ -301,8 +301,8 @@ class enchant_cache : public enchantment void force_add( const enchantment &rhs, const monster &mon ); void force_add( const enchantment &rhs ); void force_add( const enchant_cache &rhs ); - void force_add_with_dialogue( const enchantment &rhs, const const_dialogue d, - const bool evaluate = true ); + void force_add_with_dialogue( const enchantment &rhs, const_dialogue d, + bool evaluate = true ); // modifies character stats, or does other passive effects void activate_passive( Character &guy ) const; From 3caacba7b772e08e96ba2df0cf2d2b2ac68a438b Mon Sep 17 00:00:00 2001 From: Anton Simakov <67688115+GuardianDll@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:42:18 +0100 Subject: [PATCH 066/158] Update src/magic_enchantment.h Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/magic_enchantment.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/magic_enchantment.h b/src/magic_enchantment.h index 9527a77b98fc6..a21d5e24f4e4d 100644 --- a/src/magic_enchantment.h +++ b/src/magic_enchantment.h @@ -302,7 +302,7 @@ class enchant_cache : public enchantment void force_add( const enchantment &rhs ); void force_add( const enchant_cache &rhs ); void force_add_with_dialogue( const enchantment &rhs, const_dialogue d, - bool evaluate = true ); + bool evaluate = true ); // modifies character stats, or does other passive effects void activate_passive( Character &guy ) const; From a26e5bfa72d0bacc3d3c5322a386b96e1fb8aa76 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Wed, 11 Dec 2024 08:20:55 -0500 Subject: [PATCH 067/158] names no more than three words --- data/json/monsters/fungus_zombie.json | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/data/json/monsters/fungus_zombie.json b/data/json/monsters/fungus_zombie.json index e546274ef79a6..a6abc861b3c5d 100644 --- a/data/json/monsters/fungus_zombie.json +++ b/data/json/monsters/fungus_zombie.json @@ -59,8 +59,8 @@ { "id": "mon_gasbag_fungalize", "type": "MONSTER", - "name": { "str": "bloated fungal stalk zombie" }, - "description": "This grotesquely swollen corpse has grown a short stalk of gray fungus bursting from the skull.", + "name": { "str": "fungal cherry bomb" }, + "description": "This grotesquely swollen corpse has grown a short stalk of gray fungus bursting from the skull. The overall visual effect is similar to a cherry or upside down lollipop.", "copy-from": "mon_zombie_gasbag", "default_faction": "fungus", "color": "black_yellow", @@ -108,7 +108,7 @@ { "id": "mon_zombie_smoker_fungalize", "type": "MONSTER", - "name": { "str": "smoking fungal stalk zombie" }, + "name": { "str": "fungal stalk smoker" }, "description": "This smoke-shrouded corpse has grown a short stalk of gray fungus bursting from the skull.", "copy-from": "mon_zombie_smoker", "default_faction": "fungus", @@ -158,7 +158,7 @@ { "id": "mon_skeleton_fungalize", "type": "MONSTER", - "name": { "str": "skeletal fungal stalk zombie" }, + "name": { "str": "fungal stalk skeleton" }, "description": "This already horrific moving corpse covered in bony growths has also grown a short stalk of gray fungus bursting from the skull.", "copy-from": "mon_skeleton", "default_faction": "fungus", @@ -205,7 +205,7 @@ { "id": "mon_skeleton_brute_fungalize", "type": "MONSTER", - "name": { "str": "skeletal fungal stalk brute" }, + "name": { "str": "fungalizing bone brute" }, "description": "This already horrific moving corpse covered in twisted bony growths has also grown a short stalk of gray fungus bursting from the skull.", "copy-from": "mon_skeleton_brute", "default_faction": "fungus", @@ -222,7 +222,7 @@ { "type": "MONSTER", "id": "mon_skeleton_brute_fungus", - "name": { "str": "fungal skeletal brute" }, + "name": { "str": "fungal bone brute" }, "copy-from": "mon_skeleton_brute", "description": "Fungi bloom from the crevices in the twisted bone growths that cover this creature. Spores linger in the air around it.", "default_faction": "fungus", @@ -252,7 +252,7 @@ { "id": "mon_skeleton_hulk_fungalize", "type": "MONSTER", - "name": { "str": "fungal stalk skeletal hulk" }, + "name": { "str": "fungal stalk juggernaut" }, "description": "Layers of plates of bone rise high above, ending in a short stalk of gray fungus bursting from the enormous bulging skull.", "copy-from": "mon_skeleton_hulk", "default_faction": "fungus", @@ -491,7 +491,7 @@ { "id": "mon_zombie_runner_fungalize", "type": "MONSTER", - "name": { "str": "fungal stalk zombie runner" }, + "name": { "str": "fungal stalk runner" }, "description": "This recently-risen body has grown a short stalk of gray fungus bursting from the skull. This appears to slow it down in some way.", "copy-from": "mon_zombie_runner", "default_faction": "fungus", @@ -539,7 +539,7 @@ { "id": "mon_zombie_rot_fungalize", "type": "MONSTER", - "name": { "str": "decayed fungal stalk zombie" }, + "name": { "str": "fungal stalk rotter" }, "description": "This badly decayed corpse has grown a short stalk of gray fungus bursting from the skull.", "copy-from": "mon_zombie_rot", "default_faction": "fungus", @@ -587,7 +587,7 @@ { "id": "mon_zombie_tough_fungalize", "type": "MONSTER", - "name": { "str": "tough fungal stalk zombie" }, + "name": { "str": "fungal stalk bulk" }, "description": "This muscular corpse has grown a short stalk of gray fungus bursting from the skull.", "copy-from": "mon_zombie_tough", "default_faction": "fungus", @@ -730,7 +730,7 @@ { "id": "mon_zombie_crawler_fungalize", "type": "MONSTER", - "name": { "str": "crawling fungal stalk zombie" }, + "name": { "str": "fungal stalk crawler" }, "description": "This moving corpse with badly damaged legs has grown a short stalk of gray fungus bursting from the skull.", "copy-from": "mon_zombie_crawler", "default_faction": "fungus", @@ -778,7 +778,7 @@ { "id": "mon_zombie_fat_fungalize", "type": "MONSTER", - "name": { "str": "fat fungal stalk zombie" }, + "name": { "str": "fungal stalk feeder" }, "description": "This heavy corpse has grown a short stalk of gray fungus bursting from the skull.", "copy-from": "mon_zombie_fat", "default_faction": "fungus", @@ -826,7 +826,7 @@ { "id": "mon_beekeeper_fungalize", "type": "MONSTER", - "name": { "str": "scarred fungal stalk zombie" }, + "name": { "str": "fungalizing scarred zombie" }, "description": "This heavily scarred moving corpse has grown a short stalk of gray fungus bursting from the skull.", "copy-from": "mon_beekeeper", "default_faction": "fungus", @@ -874,7 +874,7 @@ { "id": "mon_zombie_acidic_fungalize", "type": "MONSTER", - "name": { "str": "acidic fungal stalk zombie" }, + "name": { "str": "fungalizing acid zombie" }, "description": "This sickly looking moving corpse with prominent yellow veins has grown a short stalk of gray fungus bursting from the skull.", "copy-from": "mon_zombie_acidic", "default_faction": "fungus", From aa4c2c81b32414a3a9476e0fa6338da457b05962 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Wed, 11 Dec 2024 08:24:07 -0500 Subject: [PATCH 068/158] document monster name length --- doc/MONSTERS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/MONSTERS.md b/doc/MONSTERS.md index 2ebd973ae3312..6e46a007cce01 100644 --- a/doc/MONSTERS.md +++ b/doc/MONSTERS.md @@ -21,7 +21,7 @@ These properties are required for all monsters: Property | Description --- | --- -`name` | (string or object) Monster name, and optional plural name and translation context +`name` | (string or object) Monster name, and optional plural name and translation context. Three words maximum. `description` | (string) In-game description of the monster, in one or two sentences `hp` | (integer) Hit points. Also see [monster HP scaling in GAME_BALANCE.md](GAME_BALANCE.md#monster-hp-scaling) `volume` | (string) Volume of the creature's body, as an integer with metric units, ex. `"35 L"` or `"1500 ml"`. Used to calculate monster size, size influences melee hit chances on different-sized targets. From 37e57a41a9513a51b8dd91b8da28826ef26e89d8 Mon Sep 17 00:00:00 2001 From: LyleSY Date: Wed, 11 Dec 2024 08:26:04 -0500 Subject: [PATCH 069/158] Update dictionary.txt --- tools/spell_checker/dictionary.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/spell_checker/dictionary.txt b/tools/spell_checker/dictionary.txt index ae4d71f44128f..6a1c8cb8f9e49 100644 --- a/tools/spell_checker/dictionary.txt +++ b/tools/spell_checker/dictionary.txt @@ -2163,6 +2163,7 @@ Fuji fulleroclathrate fullscreen fumarolic +fungalizing fungaloid fungaloids fungideer From 199750b906b8b34f29cd0fa8c5b25b68b75ed034 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:32:04 +0000 Subject: [PATCH 070/158] Remove now redundant weather fields --- data/mods/No_Hope/region_overlay.json | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/data/mods/No_Hope/region_overlay.json b/data/mods/No_Hope/region_overlay.json index 927204b62dc09..5f89cda0c30a1 100644 --- a/data/mods/No_Hope/region_overlay.json +++ b/data/mods/No_Hope/region_overlay.json @@ -61,13 +61,6 @@ "build": { "extras": { "mx_bugout": 20, "mx_science": 12, "mx_crater": 60, "mx_bandits_ambush": 10, "mx_bandits_hideout": 10 } }, "subway": { "extras": { "mx_casings": 10, "mx_bandits_ambush": 5 } } }, - "weather": { - "base_temperature": 6.5, - "base_humidity": 90.0, - "base_pressure": 1015.0, - "base_wind": 3.4, - "base_wind_distrib_peaks": 80, - "base_wind_season_variation": 50 - } + "weather": { "base_humidity": 90.0 } } ] From 88b2832b63d2caa54a369e9eb1397cddec238ba9 Mon Sep 17 00:00:00 2001 From: Maleclypse <54345792+Maleclypse@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:44:31 -0600 Subject: [PATCH 071/158] Update data/mods/Xedra_Evolved/items/carnivore.json Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/mods/Xedra_Evolved/items/carnivore.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/Xedra_Evolved/items/carnivore.json b/data/mods/Xedra_Evolved/items/carnivore.json index 11c1835f1f6c7..ed10863f7f016 100644 --- a/data/mods/Xedra_Evolved/items/carnivore.json +++ b/data/mods/Xedra_Evolved/items/carnivore.json @@ -156,7 +156,7 @@ "name": { "str": "carnivore stomach" }, "description": "The stomach of an carnivorous creature. It is surprisingly durable." }, - { + { "id": "small_carnivore_stomach", "copy-from": "stomach", "type": "COMESTIBLE", From b408dd34c00bae67b784704af13ee06d5bd2de30 Mon Sep 17 00:00:00 2001 From: strategictraveler Date: Sat, 7 Dec 2024 22:05:19 +0000 Subject: [PATCH 072/158] Update Gentoo dependencies --- doc/COMPILING/COMPILING.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/COMPILING/COMPILING.md b/doc/COMPILING/COMPILING.md index 846d04d380764..ff9f5cfd303e3 100644 --- a/doc/COMPILING/COMPILING.md +++ b/doc/COMPILING/COMPILING.md @@ -167,12 +167,10 @@ The -j2 flag means it will compile with two parallel processes. It can be omitte If you want sound and graphics, make sure to emerge with the following: ```bash -USE="flac fluidsynth mad midi mod modplug mp3 playtools vorbis wav png" \ +USE="vorbis png" \ emerge -1va emerge media-libs/libsdl2 media-libs/sdl2-gfx media-libs/sdl2-image media-libs/sdl2-mixer media-libs/sdl2-ttf ``` -It may also be possible to get away with fewer dependencies, but this set has been tested. - Once the above libraries are installed, compile with: make -j$(nproc) TILES=1 SOUND=1 RELEASE=1 From 8df5b80ef2e383cac5167439a1c09c83799caf50 Mon Sep 17 00:00:00 2001 From: Anton Simakov <67688115+GuardianDll@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:32:57 +0100 Subject: [PATCH 073/158] please clang --- src/magic_enchantment.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/magic_enchantment.h b/src/magic_enchantment.h index a21d5e24f4e4d..f91fd480e06df 100644 --- a/src/magic_enchantment.h +++ b/src/magic_enchantment.h @@ -301,7 +301,7 @@ class enchant_cache : public enchantment void force_add( const enchantment &rhs, const monster &mon ); void force_add( const enchantment &rhs ); void force_add( const enchant_cache &rhs ); - void force_add_with_dialogue( const enchantment &rhs, const_dialogue d, + void force_add_with_dialogue( const enchantment &rhs, const const_dialogue &d, bool evaluate = true ); // modifies character stats, or does other passive effects From a6fdfdc3de22a24911ddf396733e44b93a1c51b5 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:16:29 +0000 Subject: [PATCH 074/158] Replace pointless confusing bool that negates the rest of the function with an early return --- src/faction_camp.cpp | 242 +++++++++++++++++++++---------------------- 1 file changed, 117 insertions(+), 125 deletions(-) diff --git a/src/faction_camp.cpp b/src/faction_camp.cpp index dabd67bfbad7d..967110f8c522b 100644 --- a/src/faction_camp.cpp +++ b/src/faction_camp.cpp @@ -3227,167 +3227,159 @@ void basecamp::start_salt_water_pipe( const mission_id &miss_id ) } expansion_salt_water_pipe *pipe = nullptr; - bool pipe_is_new = true; for( expansion_salt_water_pipe *element : salt_water_pipes ) { if( element->expansion == dir ) { if( element->segments[0].finished ) { debugmsg( "Trying to start construction of a salt water pipe that's already been constructed" ); - return; } // Assume we've started the construction but it has been cancelled. - pipe = element; - pipe_is_new = false; - break; + return; } } - if( pipe_is_new ) { - pipe = new expansion_salt_water_pipe; - pipe->expansion = dir; - pipe->connection_direction = connection_dir; - const oter_type_str_id &allowed_start_location = oter_type_forest_water; - const std::unordered_set allowed_locations = { oter_type_forest, oter_type_forest_thick, oter_type_forest_trail, oter_type_field, oter_type_road }; - PathMap path_map; - - for( int i = -max_salt_water_pipe_distance; i <= max_salt_water_pipe_distance; i++ ) { - for( int k = -max_salt_water_pipe_distance; k <= max_salt_water_pipe_distance; k++ ) { - tripoint_abs_omt tile = tripoint_abs_omt( omt_pos.x() + dir.x + connection_dir.x + i, - omt_pos.y() + dir.y + connection_dir.y + k, omt_pos.z() ); - const oter_type_str_id &omt_ref = overmap_buffer.ter( tile )->get_type_id(); - if( allowed_locations.find( omt_ref ) != allowed_locations.end() ) { - path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_legal; - } else if( omt_ref == allowed_start_location ) { - path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_swamp; - } else { - path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_illegal; - } - // if this is an expansion tile, forbid it. Only allocated ones have their type changed. - if( i >= -dir.x - connection_dir.x - 1 && i <= -dir.x - connection_dir.x + 1 && - k >= -dir.y - connection_dir.y - 1 && k <= -dir.y - connection_dir.y + 1 ) { - path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_illegal; - } + pipe = new expansion_salt_water_pipe; + pipe->expansion = dir; + pipe->connection_direction = connection_dir; + const oter_type_str_id &allowed_start_location = oter_type_forest_water; + const std::unordered_set allowed_locations = { oter_type_forest, oter_type_forest_thick, oter_type_forest_trail, oter_type_field, oter_type_road }; + PathMap path_map; + + for( int i = -max_salt_water_pipe_distance; i <= max_salt_water_pipe_distance; i++ ) { + for( int k = -max_salt_water_pipe_distance; k <= max_salt_water_pipe_distance; k++ ) { + tripoint_abs_omt tile = tripoint_abs_omt( omt_pos.x() + dir.x + connection_dir.x + i, + omt_pos.y() + dir.y + connection_dir.y + k, omt_pos.z() ); + const oter_type_str_id &omt_ref = overmap_buffer.ter( tile )->get_type_id(); + if( allowed_locations.find( omt_ref ) != allowed_locations.end() ) { + path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_legal; + } else if( omt_ref == allowed_start_location ) { + path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_swamp; + } else { + path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_illegal; + } + // if this is an expansion tile, forbid it. Only allocated ones have their type changed. + if( i >= -dir.x - connection_dir.x - 1 && i <= -dir.x - connection_dir.x + 1 && + k >= -dir.y - connection_dir.y - 1 && k <= -dir.y - connection_dir.y + 1 ) { + path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] = salt_pipe_illegal; } } + } - if( path_map[max_salt_water_pipe_distance][max_salt_water_pipe_distance] == salt_pipe_illegal ) { - auto e = expansions.find( dir ); - basecamp::update_provides( miss_id.parameters, e->second ); + if( path_map[max_salt_water_pipe_distance][max_salt_water_pipe_distance] == salt_pipe_illegal ) { + auto e = expansions.find( dir ); + basecamp::update_provides( miss_id.parameters, e->second ); - popup( _( "This functionality cannot be constructed as the tile directly adjacent to " - "this expansion is not of a type a pipe can be constructed through. Supported " - "terrain is forest, field, road, and swamp. This recipe will now be " - "removed from the set of available recipes and won't show up again." ) ); - return; - } + popup( _( "This functionality cannot be constructed as the tile directly adjacent to " + "this expansion is not of a type a pipe can be constructed through. Supported " + "terrain is forest, field, road, and swamp. This recipe will now be " + "removed from the set of available recipes and won't show up again." ) ); + return; + } - point destination; - double destination_cost = -10000.0; - bool path_found = false; + point destination; + double destination_cost = -10000.0; + bool path_found = false; - if( path_map[max_salt_water_pipe_distance][max_salt_water_pipe_distance] == - salt_pipe_swamp ) { // The connection_dir tile is a swamp tile - destination = point::zero; - path_found = true; - } else { - path_map[max_salt_water_pipe_distance][max_salt_water_pipe_distance] = - 1.0; // Always an orthogonal connection to the connection tile. - - for( int distance = 1; distance <= max_salt_water_pipe_length; distance++ ) { - int dist = distance > max_salt_water_pipe_distance ? max_salt_water_pipe_distance : distance; - for( int i = -dist; i <= dist; i++ ) { // No path that can be extended can reach further than dist. - for( int k = -dist; k <= dist; k++ ) { - if( path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] > - 0.0 ) { // Tile has been assigned a distance and isn't a swamp - point temp = check_salt_pipe_neighbors( path_map, { i, k } ); - if( !temp.is_invalid() ) { - if( path_map[max_salt_water_pipe_distance + temp.x][max_salt_water_pipe_distance + temp.y] > - destination_cost ) { - destination_cost = path_map[max_salt_water_pipe_distance + temp.x][max_salt_water_pipe_distance + - temp.y]; - destination = temp; - path_found = true; - } + if( path_map[max_salt_water_pipe_distance][max_salt_water_pipe_distance] == + salt_pipe_swamp ) { // The connection_dir tile is a swamp tile + destination = point::zero; + path_found = true; + } else { + path_map[max_salt_water_pipe_distance][max_salt_water_pipe_distance] = + 1.0; // Always an orthogonal connection to the connection tile. + + for( int distance = 1; distance <= max_salt_water_pipe_length; distance++ ) { + int dist = distance > max_salt_water_pipe_distance ? max_salt_water_pipe_distance : distance; + for( int i = -dist; i <= dist; i++ ) { // No path that can be extended can reach further than dist. + for( int k = -dist; k <= dist; k++ ) { + if( path_map[max_salt_water_pipe_distance + i][max_salt_water_pipe_distance + k] > + 0.0 ) { // Tile has been assigned a distance and isn't a swamp + point temp = check_salt_pipe_neighbors( path_map, { i, k } ); + if( !temp.is_invalid() ) { + if( path_map[max_salt_water_pipe_distance + temp.x][max_salt_water_pipe_distance + temp.y] > + destination_cost ) { + destination_cost = path_map[max_salt_water_pipe_distance + temp.x][max_salt_water_pipe_distance + + temp.y]; + destination = temp; + path_found = true; } } } } } } + } - if( !path_found ) { - auto e = expansions.find( dir ); - basecamp::update_provides( miss_id.parameters, e->second ); + if( !path_found ) { + auto e = expansions.find( dir ); + basecamp::update_provides( miss_id.parameters, e->second ); - popup( _( "This functionality cannot be constructed as no valid path to a swamp has " - "been found with a maximum length (20 tiles) at a maximum range of 10 tiles. " - "Supported terrain is forest, field, and road. This recipe will now be " - "removed from the set of available recipes and won't show up again." ) ); - return; - }; + popup( _( "This functionality cannot be constructed as no valid path to a swamp has " + "been found with a maximum length (20 tiles) at a maximum range of 10 tiles. " + "Supported terrain is forest, field, and road. This recipe will now be " + "removed from the set of available recipes and won't show up again." ) ); + return; + }; - point candidate; - // Flip the sign of the starting swamp tile to fit the logic expecting positive values rather than check that it isn't the first one every time. - path_map[max_salt_water_pipe_distance + destination.x][max_salt_water_pipe_distance + destination.y] - = -path_map[max_salt_water_pipe_distance + destination.x][max_salt_water_pipe_distance + - destination.y]; - - while( destination != point::zero ) { - pipe->segments.push_back( { tripoint_abs_omt( omt_pos.x() + dir.x + connection_dir.x + destination.x, omt_pos.y() + dir.y + connection_dir.y + destination.y, omt_pos.z() ), false, false } ); - path_found = false; // Reuse of existing variable after its original usability has been passed. - for( int i = -1; i <= 1; i++ ) { - for( int k = -1; k <= 1; k++ ) { - if( destination.x + i > -max_salt_water_pipe_distance && - destination.x + i < max_salt_water_pipe_distance && - destination.y + k > -max_salt_water_pipe_distance && - destination.y + k < max_salt_water_pipe_distance ) { - if( path_map[max_salt_water_pipe_distance + destination.x + i][max_salt_water_pipe_distance + - destination.y + k] > 0.0 && - path_map[max_salt_water_pipe_distance + destination.x + i][max_salt_water_pipe_distance + - destination.y + k] < path_map[max_salt_water_pipe_distance + - destination.x][max_salt_water_pipe_distance + destination.y] ) { - if( path_found ) { - if( path_map [max_salt_water_pipe_distance + candidate.x][max_salt_water_pipe_distance + - candidate.y] > - path_map[max_salt_water_pipe_distance + destination.x + i][max_salt_water_pipe_distance + - destination.y + k] ) { - candidate = destination + point( i, k ); - } - } else { - candidate = destination + point( i, k ); - path_found = true; + point candidate; + // Flip the sign of the starting swamp tile to fit the logic expecting positive values rather than check that it isn't the first one every time. + path_map[max_salt_water_pipe_distance + destination.x][max_salt_water_pipe_distance + destination.y] + = -path_map[max_salt_water_pipe_distance + destination.x][max_salt_water_pipe_distance + + destination.y]; + + while( destination != point::zero ) { + pipe->segments.push_back( { tripoint_abs_omt( omt_pos.x() + dir.x + connection_dir.x + destination.x, omt_pos.y() + dir.y + connection_dir.y + destination.y, omt_pos.z() ), false, false } ); + path_found = false; // Reuse of existing variable after its original usability has been passed. + for( int i = -1; i <= 1; i++ ) { + for( int k = -1; k <= 1; k++ ) { + if( destination.x + i > -max_salt_water_pipe_distance && + destination.x + i < max_salt_water_pipe_distance && + destination.y + k > -max_salt_water_pipe_distance && + destination.y + k < max_salt_water_pipe_distance ) { + if( path_map[max_salt_water_pipe_distance + destination.x + i][max_salt_water_pipe_distance + + destination.y + k] > 0.0 && + path_map[max_salt_water_pipe_distance + destination.x + i][max_salt_water_pipe_distance + + destination.y + k] < path_map[max_salt_water_pipe_distance + + destination.x][max_salt_water_pipe_distance + destination.y] ) { + if( path_found ) { + if( path_map [max_salt_water_pipe_distance + candidate.x][max_salt_water_pipe_distance + + candidate.y] > + path_map[max_salt_water_pipe_distance + destination.x + i][max_salt_water_pipe_distance + + destination.y + k] ) { + candidate = destination + point( i, k ); } + } else { + candidate = destination + point( i, k ); + path_found = true; } } } } - destination = candidate; } - - pipe->segments.push_back( { tripoint_abs_omt( omt_pos.x() + dir.x + connection_dir.x, omt_pos.y() + dir.y + connection_dir.y, omt_pos.z() ), false, false } ); + destination = candidate; } + pipe->segments.push_back( { tripoint_abs_omt( omt_pos.x() + dir.x + connection_dir.x, omt_pos.y() + dir.y + connection_dir.y, omt_pos.z() ), false, false } ); + if( common_salt_water_pipe_construction( miss_id, pipe, 0 ) ) { - if( pipe_is_new ) { - pipe->segments[0].started = true; - salt_water_pipes.push_back( pipe ); - - // Provide "salt_water_pipe_*_scheduled" for all the segments needed. - // The guts of basecamp::update_provides modified to feed it generated tokens rather than - // those actually in the recipe, as the tokens needed can't be determined by the recipe. - // Shouldn't need to check that the tokens don't exist previously, so could just set them to 1. - auto e = expansions.find( dir ); - for( size_t i = 1; i < pipe->segments.size(); i++ ) { - std::string token = salt_water_pipe_string_base; - token += std::to_string( i ); - token += salt_water_pipe_string_suffix; - if( e->second.provides.find( token ) == e->second.provides.end() ) { - e->second.provides[token] = 0; - } - e->second.provides[token]++; + pipe->segments[0].started = true; + salt_water_pipes.push_back( pipe ); + + // Provide "salt_water_pipe_*_scheduled" for all the segments needed. + // The guts of basecamp::update_provides modified to feed it generated tokens rather than + // those actually in the recipe, as the tokens needed can't be determined by the recipe. + // Shouldn't need to check that the tokens don't exist previously, so could just set them to 1. + auto e = expansions.find( dir ); + for( size_t i = 1; i < pipe->segments.size(); i++ ) { + std::string token = salt_water_pipe_string_base; + token += std::to_string( i ); + token += salt_water_pipe_string_suffix; + if( e->second.provides.find( token ) == e->second.provides.end() ) { + e->second.provides[token] = 0; } + e->second.provides[token]++; } - } else if( pipe_is_new ) { + } else { delete pipe; } } From d7411cd81d0f963bc666e5fdbb7f35733015acc1 Mon Sep 17 00:00:00 2001 From: Andrew Krieger Date: Wed, 11 Dec 2024 10:00:34 -0800 Subject: [PATCH 075/158] Fix perspective shift in construction --- src/construction.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/construction.cpp b/src/construction.cpp index 42c1f92962c7b..85a194e137b41 100644 --- a/src/construction.cpp +++ b/src/construction.cpp @@ -560,7 +560,8 @@ construction_id construction_menu( const bool blueprint ) tilecontext->set_disable_occlusion( true ); g->invalidate_main_ui_adaptor(); #endif - restore_on_out_of_scope restore_view( player_character.view_offset ); + std::unique_ptr> restore_view = + std::make_unique>( player_character.view_offset ); const auto recalc_buffer = [&]() { //leave room for top and bottom UI text @@ -1061,7 +1062,7 @@ construction_id construction_menu( const bool blueprint ) add_msg( m_info, _( "It is too dark to construct right now." ) ); } else { draw_preview.reset(); - restore_view.cancel(); + restore_view.reset(); restore_ui.reset(); ui.reset(); place_construction( { constructs[select] } ); From f650c3cb1c460b37f49541db08353e2d6a4edc0d Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:22:32 +0100 Subject: [PATCH 076/158] Update children_notes.json --- data/json/snippets/children_notes.json | 173 +++++++++++++++++++++---- 1 file changed, 147 insertions(+), 26 deletions(-) diff --git a/data/json/snippets/children_notes.json b/data/json/snippets/children_notes.json index 4108b46054b28..7922e4db5d08e 100644 --- a/data/json/snippets/children_notes.json +++ b/data/json/snippets/children_notes.json @@ -6,287 +6,408 @@ "text": [ { "id": "note_child_1", + "name": "Dad said he was going to get groceries…", "text": "\"Dad said he was going to get groceries two days ago. he didnt come home yet. he told me to stay inside the shelter but im getting scared. i think i remember where the grocery store is.\"" }, - { "id": "note_child_2", "text": "\"i calld 911 but no one was there\"" }, + { "id": "note_child_2", "name": "i calld 911…", "text": "\"i calld 911 but no one was there\"" }, { "id": "note_child_3", + "name": "My window lit up at midnight…", "text": "\"My window lit up at midnight. I tried seeing what it was but it broke. My ears hurt.\"" }, - { "id": "note_child_4", "text": "\"I want mom's pancakes\"" }, + { "id": "note_child_4", "name": "I want mom's pancakes", "text": "\"I want mom's pancakes\"" }, { "id": "note_child_5", + "name": "Uncle buried ms Carmichael…", "text": "\"Uncle buried ms Carmichael after she got sick but she's not in the backyard anymore. Uncle isn't home either.\"" }, { "id": "note_child_6", + "name": "Cooper killed the neighbors cat…", "text": "\"Cooper killed the neighbors cat today. dad shoot him. He was not in the backyart when we came home.\"" }, - { "id": "note_child_7", "text": "\"Today I saw a butterfly the size of my head\"" }, - { "id": "note_child_8", "text": "\"I miss mom and dad. Where is everyone?\"" }, + { + "id": "note_child_7", + "name": "Today I saw a butterfly…", + "text": "\"Today I saw a butterfly the size of my head\"" + }, + { "id": "note_child_8", "name": "I miss mom and dad…", "text": "\"I miss mom and dad. Where is everyone?\"" }, { "id": "note_child_9", + "name": "DaIsy gOT eaTTEN…", "text": "\"DaIsy gOT eaTTEN by a giant roa… (the rest of the note is just unreadable smudges)\"" }, - { "id": "note_child_10", "text": "\"Mommy, where are you? I miss you…\"" }, - { "id": "note_child_11", "text": "\"Daddy, where are you? I'm scared…\"" }, - { "id": "note_child_12", "text": "\"I'm hungry\"" }, - { "id": "note_child_13", "text": "\"I want to play with jimmy, why did daddy said to get away from him?\"" }, - { "id": "note_child_14", "text": "\"Daddy hasn't wake up yet…\"" }, - { "id": "note_child_15", "text": "\"Daddy said we are going on an adventure!\"" }, - { "id": "note_child_16", "text": "\"Katty is feeling bad, mommy hasn't returned\"" }, - { "id": "note_child_17", "text": "\"I want to see mommy\"" }, - { "id": "note_child_18", "text": "\"I want to see daddy\"" }, - { "id": "note_child_19", "text": "\"I feel cold…\"" }, - { "id": "note_child_20", "text": "\"I want a hug\"" }, - { "id": "note_child_21", "text": "\"I saw a huge mushroom yesterday. I feel itchy.\"" }, - { "id": "note_child_22", "text": "\"I don't want to leave the house, but I'm hungry…\"" }, - { "id": "note_child_23", "text": "\"I went and keeped only necesary items like dad told me\"" }, - { "id": "note_child_24", "text": "\"Mommy cried the other day… I don't want to be here anymore.\"" }, - { "id": "note_child_25", "text": "\"Uncle Tim said we are going on a trip, but I just want to see daddy.\"" }, + { "id": "note_child_10", "name": "Mommy, where are you?", "text": "\"Mommy, where are you? I miss you…\"" }, + { "id": "note_child_11", "name": "Daddy, where are you?", "text": "\"Daddy, where are you? I'm scared…\"" }, + { "id": "note_child_12", "name": "I'm hungry", "text": "\"I'm hungry\"" }, + { + "id": "note_child_13", + "name": "I want to play with jimmy…", + "text": "\"I want to play with jimmy, why did daddy said to get away from him?\"" + }, + { "id": "note_child_14", "name": "Daddy hasn't wake up yet…", "text": "\"Daddy hasn't wake up yet…\"" }, + { + "id": "note_child_15", + "name": "Daddy said we are going on an adventure!", + "text": "\"Daddy said we are going on an adventure!\"" + }, + { + "id": "note_child_16", + "name": "Katty is feeling bad…", + "text": "\"Katty is feeling bad, mommy hasn't returned\"" + }, + { "id": "note_child_17", "name": "I want to see mommy", "text": "\"I want to see mommy\"" }, + { "id": "note_child_18", "name": "I want to see daddy", "text": "\"I want to see daddy\"" }, + { "id": "note_child_19", "name": "I feel cold…", "text": "\"I feel cold…\"" }, + { "id": "note_child_20", "name": "I want a hug", "text": "\"I want a hug\"" }, + { + "id": "note_child_21", + "name": "I saw a huge mushroom yesterday…", + "text": "\"I saw a huge mushroom yesterday. I feel itchy.\"" + }, + { + "id": "note_child_22", + "name": "I don't want to leave the house…", + "text": "\"I don't want to leave the house, but I'm hungry…\"" + }, + { + "id": "note_child_23", + "name": "I went and keeped only necesary items…", + "text": "\"I went and keeped only necesary items like dad told me\"" + }, + { + "id": "note_child_24", + "name": "Mommy cried the other day…", + "text": "\"Mommy cried the other day… I don't want to be here anymore.\"" + }, + { + "id": "note_child_25", + "name": "Uncle Tim said we are going on a trip…", + "text": "\"Uncle Tim said we are going on a trip, but I just want to see daddy.\"" + }, { "id": "note_child_26", + "name": "dear diary. mr pendanski showed me…", "text": "\"dear diary. mr pendanski showed me how to boil water today. he told me it stopps it from making us sick like ma and pa got sick.\"" }, { "id": "note_child_27", + "name": "mommy and daddy told me to wait here…", "text": "\"mommy and daddy told me to wait here untill they got back, but I dont know when theyre coming home. they've been gone for two days now. good thing I have rufus, hes a good dog.\"" }, { "id": "note_child_28", + "name": "Dear diary- My parents are stupid…", "text": "\"Dear diary- My parents are stupid. I told Dad to not go outside today, but he wouldn't listen. Said it was all a hoax. Now he's beaten up pretty bad, Mom's got the bandages out to help him. Jimmy lost his toy today, a red stuffed bear. Looks like I'll have to help him with that.\"" }, { "id": "note_child_29", + "name": "Dad and I have been living in the woods…", "text": "\"Dad and I have been living in the woods for a week now. He gives me his pistol when he is out hunting. It wasn't enough to stop the werewolf that attacked me. So I had to hide in a small hole for a whole night where it couldn't reach me. Luckily dad found me and killed it. He also said he will make me a werewolf jacket for my birthday. A WEREWOLF JACKET, IHAVETHECOOLESTDADINTHEWORLD.\"" }, { "id": "note_child_30", + "name": "I discovered 10 new stars tonight…", "text": "\"I discovered 10 new stars tonight! To bad that mom and dad aren't home. They even forgot to close the front door.\"" }, { "id": "note_child_31", + "name": "An unrecognizable child's drawing", "text": "\"An unrecognizable child's drawing made with what appears to be blood and feces.\"" }, { "id": "note_child_32", + "name": "We all ate together as a big happy family…", "text": "\"We all ate together as a big happy family. Even Mike was there even though mom normally puts him to bed at 8pm. Atleast he won't cry in the middle of the night anymore.\"" }, { "id": "note_child_33", + "name": "Daddy and Mommy, some really scary storm is happening…", "text": "\"Daddy and Mommy, some really scary storm is happening outside. I hear some people telling me everything will be okay and everything will be over if I get out, so I'm going with them to help find you, and if not i left a message to you so you know where I'm gone! I'm just too hungry to keep waiting anymore… I'm sorry.\"" }, { "id": "note_child_34", + "name": "Mommy is behind me forcing me to draw…", "text": "\"Mommy is behind me forcing me to draw and write notes. I don't know why, but she has been acting weirder everyday, and I think she hurt daddy… I'm scared im scared, someone help, im scared im… (The rest of the note seems to be endless begging for help until it ends in a bloody smear)\"" }, { "id": "note_child_35", + "name": "I hate it here…", "text": "\"I hate it here. I want to go home. Abba and Ima told me things would be okay and we will be here a for a few days and then a bus will come take us and we will be safe but I heard them arguing last night. Ima cried. I'm scared. I wanna go home.\"" }, { "id": "note_child_36", + "name": "A child's drawing of a house", "text": "\"A child's drawing of a house with three stick figures outside. The sky is a swirling mess of a dozen contrasting colors with purple and red blotches in it. The three figures are frowning.\"" }, { "id": "note_child_37", + "name": "I saw two huge dragonflies…", "text": "\"I saw two huge dragonflies hugging. It was kinda cute but my brother just said they were having sex. He's gross.\"" }, { "id": "note_child_38", + "name": "There is some really pretty floating swirly outside…", "text": "\"There is some really pretty floating swirly outside. I was told to not go near it, but I can hear voices from it. I want to see what's inside.\"" }, { "id": "note_child_39", + "name": "I can hear mom's voice…", "text": "\"I can hear mom's voice crying my name and crying for help in the forest.\"" }, { "id": "note_child_40", + "name": "Mom is acting weird…", "text": "\"Mom is acting weird. She thinks I'm 2 and that Mike still lives here and that she's still married to dad. It's like my little sister doesn't exist to her so I have to take care of her now. She's just a baby and it's so hard.\"" }, { "id": "note_child_41", + "name": "Mom fell asleep in the bathtub…", "text": "\"Mom fell asleep in the bathtub. I keep trying to wake her up but she's getting cold.\"" }, { "id": "note_child_42", + "name": "The crows I used to feed have gotten HUGE…", "text": "\"The crows I used to feed have gotten HUGE! One brought me a super pretty watch and another an earring but there was weird black gunk on it.\"" }, { "id": "note_child_43", + "name": "Felt queasy and threw up yesterday…", "text": "\"Felt queasy and threw up yesterday, puke looked weird. I took pills for stomach ache but I don't feel any better.\"" }, { "id": "note_child_44", + "name": "I got woke up by mom and dad…", "text": "\"I got woke up by mom and dad trembling on their sleep and drooling a lot. I think it is that weird big crow we ate the other day. I don't feel too good as well…\"" }, { "id": "note_child_45", + "name": "We going to hide in the subways…", "text": "\"We going to hide in the subways, but I keep hearing really weird screams down there.\"" }, { "id": "note_child_46", + "name": "I saved a puppy…", "text": "\"I saved a puppy that was being harassed by giant bugs the other day. He is scratching a lot but seems fine, i hope i can keep him.\"" }, { "id": "note_child_47", + "name": "I'm alone in this shelter now…", "text": "\"I'm alone in this shelter now… i can see some people outside but they are just standing there really quiet and not doing anything. The monsters seems to ignore them too, maybe they will help me?\"" }, { "id": "note_child_48", + "name": "In case of emergency fill out this form…", "text": "\"In case of emergency fill out this form so that you may present it to emergency personnel for identification purposes. Keep this form with your emergency supplies. If You need to request new copies of this form, speak with the school safety office. Remember to keep calm, and stay in one location if possible, this will help emergency personnel to find you. If this form is found please contact Oak Grove Elementary School. Name: Aiden. Parent or Guardian: Mommy Daddy. Phone number where you can be reached: I don't remember I think it has a 5 in it. Teacher: Miss daisy. Current location: I dont no I'm scared, Im hear all alone. Medical Conditions ie diabetes: I dont no what that is. Additional Information: Why is everyone acting so weird?!\"" }, { "id": "note_child_49", + "name": "After we were evacuated…", "text": "\"After we were evacuated and I had to leave my toys behind I started collecting empty bullets. The soldiers here sometimes give me more. Lieutenant Mora gave me two little ones today, but she looked upset. I asked her where mom and pa were because I saw them in the back of the camp with her and some soldiers, there was something wrong with dad's face. Mrs Mora just hugged me and started crying.\"" }, { "id": "note_child_50", + "name": "Mom went to pick up Cristy early…", "text": "\"Mom went to pick up Cristy early from school today, but she isn't back yet. I don't know why the monster outside is wearing her face.\"" }, { "id": "note_child_51", - "text": "\"It's a drawing of a small stick figure cowering in the corner. The rest of the page is colored black, with strange faces sneering and laughing at them.\"" + "name": "A drawing of a small stick figure", + "text": "\"A drawing of a small stick figure cowering in the corner. The rest of the page is colored black, with strange faces sneering and laughing at them.\"" }, { "id": "note_child_52", + "name": "I saw millie playing in the playground…", "text": "\"I saw millie playing in the playground, but all she does is walk around in circles.\"" }, - { "id": "note_child_53", "text": "\"nobody ever tells me anything so im gonna run away, i hate you mom\"" }, + { + "id": "note_child_53", + "name": "nobody ever tells me anything…", + "text": "\"nobody ever tells me anything so im gonna run away, i hate you mom\"" + }, { "id": "note_child_54", + "name": "i want chocolate bars…", "text": "\"i want chocolate bars i want lollipops i want ice cream i want gummy bears i want bubble gum but i dont want another protien bar\"" }, { "id": "note_child_55", + "name": "today we didnt really learn anything…", "text": "\"today we didnt really learn anything, the teacher kept talking about random things and threw a pencil at me when I asked to go to the bathroom\"" }, { "id": "note_child_56", + "name": "the neigbors dogs kept playing…", "text": "\"the neigbors dogs kept playing with each other all day they played so much they split raspberry jam evrywere it was very funny\"" }, { "id": "note_child_57", + "name": "Dear Diary, I was at the park today with Percy…", "text": "\"Dear Diary, I was at the park today with Percy. Danny always told me that she was very sad when her dog died, so I broke Percy's neck because I wanted to see how I'd feel. I think I was sad for a little, but I kept playing with him but I had to stop after too many pieces fell off and Percy became gross. I buried him in the park so mom and dad wouldn't find out, but Mr. Luca and Mrs Annaliese saw me. I'm scared they'll tell on me. Daddy thinks I don't know where he keeps the keys to his gun safe.\"" }, { "id": "note_child_58", + "name": "Dear diary. Mommy and dad have been making us live in the basement…", "text": "\"Dear diary. Mommy and dad have been making us live in the basement for the last few days. It's to keep us safe, they say, but it gets really stuffy during the night and I can't sleep, so I sometimes sneak upstairs. Sometimes I talk to Aunt Maria. She always stays in the back yard and appears when the sky goes all weird and when scary noises come from outside. I always ask her to come in, but she tells me she can't and that I should go out instead. I think it's because dad doesn't want her around, he always told me she died in 2001. He's a liar, and I think he wants the monsters to eat her. The door's always locked, but I can reach the garage controls.\"" }, { "id": "note_child_59", + "name": "I saw Mr. Henderson today…", "text": "\"I saw Mr. Henderson today, but he didn't say hi back. His eyes were all white and he didn't have his glasses on. He just stood there in the yard staring at the sky.\"" }, { "id": "note_child_60", + "name": "Mommy says we're going to grandma's house…", "text": "\"Mommy says we're going to grandma's house, but grandma lives in heaven. I'm confused.\"" }, { "id": "note_child_61", + "name": "Daddy told me to hide in the closet…", "text": "\"Daddy told me to hide in the closet, but it's been forever and he hasn't come back yet. I'm really scared.\"" }, { "id": "note_child_62", + "name": "Mommy locked me in the attic…", "text": "\"Mommy locked me in the attic and said not to come out, but I can hear strange noises downstairs.\"" }, { "id": "note_child_63", + "name": "I miss my friends…", "text": "\"I miss my friends. I wonder if they are okay. I hope I can see them soon.\"" }, { "id": "note_child_64", + "name": "Daddy said he will be right back…", "text": "\"Daddy said he will be right back, but it's been a whole day. I hope he is okay.\"" }, { "id": "note_child_65", + "name": "I found an old photo of us at the beach…", "text": "\"I found an old photo of us at the beach. I miss those days. Why can't we go back?\"" }, { "id": "note_child_66", + "name": "Mommy said the monsters are not real…", "text": "\"Mommy said the monsters are not real, but I saw one today. It was in our backyard.\"" }, { "id": "note_child_67", + "name": "I saw a rainbow today…", "text": "\"I saw a rainbow today. It made me happy for a little while. I wish mommy and daddy were here to see it too.\"" }, { "id": "note_child_68", + "name": "The lights went out last night…", "text": "\"The lights went out last night and I was so scared. I wish mommy and daddy were here.\"" }, { "id": "note_child_69", + "name": "Mommy and daddy are always busy…", "text": "\"Mommy and daddy are always busy. I wish they would play with me like they used to.\"" }, { "id": "note_child_70", + "name": "I saw a big bird today…", "text": "\"I saw a big bird today. It was bigger than me! I wanted to show mommy but she wasn't home.\"" }, { "id": "note_child_71", + "name": "I made a drawing for mommy and daddy…", "text": "\"I made a drawing for mommy and daddy, but they haven't come home to see it yet.\"" }, { "id": "note_child_72", + "name": "I don't like the dark…", "text": "\"I don't like the dark. It's scary and makes me feel alone. I wish mommy and daddy were here.\"" }, { "id": "note_child_73", + "name": "I heard a loud noise outside last night…", "text": "\"I heard a loud noise outside last night. It sounded like a monster. I'm scared.\"" }, { "id": "note_child_74", + "name": "I found an old teddy bear in the attic…", "text": "\"I found an old teddy bear in the attic. It reminds me of when mommy and daddy used to read me stories before bed.\"" }, - { "id": "note_child_75", "text": "\"I don't want to be alone anymore. I miss mommy and daddy so much.\"" }, + { + "id": "note_child_75", + "name": "I don't want to be alone anymore…", + "text": "\"I don't want to be alone anymore. I miss mommy and daddy so much.\"" + }, { "id": "note_child_76", + "name": "Mommy said she would be right back…", "text": "\"Mommy said she would be right back, but she hasn't come home yet. I'm really scared.\"" }, - { "id": "note_child_77", "text": "\"I heard mommy and daddy fighting last night. I hope they are okay.\"" }, + { + "id": "note_child_77", + "name": "I heard mommy and daddy fighting…", + "text": "\"I heard mommy and daddy fighting last night. I hope they are okay.\"" + }, { "id": "note_child_78", + "name": "I miss going to school…", "text": "\"I miss going to school and seeing my friends. I hope we can go back soon.\"" }, { "id": "note_child_79", + "name": "I found an old book in the attic…", "text": "\"I found an old book in the attic. It has pictures of mommy and daddy when they were young. I wish I could ask them about it.\"" }, { "id": "note_child_80", + "name": "I heard a strange noise outside…", "text": "\"I heard a strange noise outside last night. It sounded like someone crying. I'm scared.\"" }, - { "id": "note_child_81", "text": "\"I wish mommy and daddy would come home. I miss them so much.\"" }, + { + "id": "note_child_81", + "name": "I wish mommy and daddy would come home…", + "text": "\"I wish mommy and daddy would come home. I miss them so much.\"" + }, { "id": "note_child_82", + "name": "I saw a shooting star last night…", "text": "\"I saw a shooting star last night. I made a wish that mommy and daddy would come home.\"" }, { "id": "note_child_83", + "name": "I found an old toy car in the attic…", "text": "\"I found an old toy car in the attic. It reminds me of when daddy used to play with me.\"" }, { "id": "note_child_84", + "name": "I heard a loud noise outside last night…", "text": "\"I heard a loud noise outside last night. It scared me so much. I wish mommy and daddy were here.\"" }, - { "id": "note_child_85", "text": "\"I miss playing outside with my friends. I hope we can go back soon.\"" }, + { + "id": "note_child_85", + "name": "I miss playing outside with my friends…", + "text": "\"I miss playing outside with my friends. I hope we can go back soon.\"" + }, { "id": "note_child_86", + "name": "I found an old photo album in the attic…", "text": "\"I found an old photo album in the attic. It has pictures of our family trips. I wish we could go on another trip.\"" }, { "id": "note_child_87", + "name": "I heard mommy and daddy talking…", "text": "\"I heard mommy and daddy talking about leaving. I don't want them to go.\"" }, { "id": "note_child_88", + "name": "I miss mommy's hugs and daddy's bedtime stories…", "text": "\"I miss mommy's hugs and daddy's bedtime stories. I hope they come home soon.\"" }, { "id": "note_child_89", + "name": "I found an old doll in the attic…", "text": "\"I found an old doll in the attic. It reminds me of when mommy used to play with me.\"" }, { "id": "note_child_90", + "name": "I heard a strange noise outside last night…", "text": "\"I heard a strange noise outside last night. It sounded like a monster. I'm really scared.\"" } ] From 6ef0b96886db9803f46ae95311c1edb2ade71041 Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:50:53 -0600 Subject: [PATCH 077/158] u -> npc --- data/mods/MindOverMatter/monsters/death_effects.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/data/mods/MindOverMatter/monsters/death_effects.json b/data/mods/MindOverMatter/monsters/death_effects.json index e5ffd5654958e..e0f3e0edf3279 100644 --- a/data/mods/MindOverMatter/monsters/death_effects.json +++ b/data/mods/MindOverMatter/monsters/death_effects.json @@ -207,18 +207,22 @@ "type": "effect_on_condition", "id": "EOC_VITAKIN3_DEATH_EFFECT", "effect": [ - { "u_location_variable": { "context_val": "spawn_place" }, "min_radius": 0 }, + { "npc_location_variable": { "context_val": "spawn_place" }, "min_radius": 0 }, { - "u_map_run_item_eocs": "all", + "npc_map_run_item_eocs": "all", "loc": { "context_val": "spawn_place" }, "true_eocs": [ { "id": "EOC_EOC_VITAKIN3_DEATH_EFFECT_HANDLING_DELETE_NPC_ITEMS", "effect": [ "npc_die" ] } ] }, { - "u_spawn_monster": "mon_feral_human_vita3_revived", + "npc_spawn_monster": "mon_feral_human_vita3_revived", "target_var": { "context_val": "spawn_place" }, "min_radius": 0 }, - { "u_location_variable": { "context_val": "loc" }, "monster": "mon_feral_human_vita3_revived", "min_radius": 2 }, + { + "npc_location_variable": { "context_val": "loc" }, + "monster": "mon_feral_human_vita3_revived", + "min_radius": 2 + }, { "run_eocs": "EOC_VITAKIN3_DEATH_EFFECT_2", "alpha_loc": { "context_val": "loc" } } ] }, From e929afadc6c825cdfc9f08e58ca10d6eefeeec92 Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:00:29 -0600 Subject: [PATCH 078/158] Initial commit --- data/mods/MindOverMatter/mutations/temporary.json | 10 ++++++++++ .../mods/MindOverMatter/powers/clairsentience_eoc.json | 2 ++ 2 files changed, 12 insertions(+) diff --git a/data/mods/MindOverMatter/mutations/temporary.json b/data/mods/MindOverMatter/mutations/temporary.json index cc5e9deffa108..a322867151c3e 100644 --- a/data/mods/MindOverMatter/mutations/temporary.json +++ b/data/mods/MindOverMatter/mutations/temporary.json @@ -227,6 +227,16 @@ [ "fabrication", 6 ] ] }, + { + "type": "mutation", + "id": "CLAIR_ASTRAL_PROJECTION_APPEARANCE", + "name": { "str": "Astral Form", "//~": "NO_I18N" }, + "description": { "str": "You're a disembodied mind so you're all glowy and blue. Spooky!", "//~": "NO_I18N" }, + "points": 0, + "valid": false, + "player_display": false, + "override_look": { "id": "mon_hologram", "tile_category": "monster" } + }, { "type": "mutation", "id": "TELEKINETIC_LIFTER_1", diff --git a/data/mods/MindOverMatter/powers/clairsentience_eoc.json b/data/mods/MindOverMatter/powers/clairsentience_eoc.json index af625623e51f7..10cbc6084fbab 100644 --- a/data/mods/MindOverMatter/powers/clairsentience_eoc.json +++ b/data/mods/MindOverMatter/powers/clairsentience_eoc.json @@ -190,6 +190,7 @@ { "u_add_effect": "effect_clair_astral_projection", "duration": "PERMANENT" }, { "u_add_effect": "incorporeal", "duration": "PERMANENT" }, { "u_message": "As you meditate, you feel your spirit slipping free from your body.", "type": "good" }, + { "u_add_trait": "CLAIR_ASTRAL_PROJECTION_APPEARANCE" }, { "u_spawn_item": "body_astral_projection", "suppress_message": true }, { "u_spawn_item": "item_clair_astral_projection_cord", "suppress_message": true, "force_equip": true }, { "math": [ "u_spell_level('clair_astral_projection_return') = 0" ] } @@ -202,6 +203,7 @@ { "u_remove_item_with": "item_clair_astral_projection_cord" }, { "u_lose_effect": "effect_clair_astral_projection" }, { "u_lose_effect": "incorporeal" }, + { "u_lose_trait": "CLAIR_ASTRAL_PROJECTION_APPEARANCE" }, { "math": [ "u_spell_level('clair_astral_projection_passwall') = -1" ] }, { "math": [ "u_spell_level('clair_astral_projection_return') = -1" ] }, { From 8c952b07253196a6ce0ad791ce0e15ef4a7f24a2 Mon Sep 17 00:00:00 2001 From: Zhilkin Serg Date: Wed, 11 Dec 2024 23:06:19 +0300 Subject: [PATCH 079/158] Fix executable name for notiles targets --- msvc-full-features/Cataclysm-vcpkg-static.vcxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/msvc-full-features/Cataclysm-vcpkg-static.vcxproj b/msvc-full-features/Cataclysm-vcpkg-static.vcxproj index 2bded692dcdaf..3300a63d0f803 100644 --- a/msvc-full-features/Cataclysm-vcpkg-static.vcxproj +++ b/msvc-full-features/Cataclysm-vcpkg-static.vcxproj @@ -115,7 +115,7 @@ false - cataclysm-tiles + cataclysm-notiles false @@ -123,7 +123,7 @@ false - cataclysm-tiles + cataclysm-notiles false @@ -135,11 +135,11 @@ false - cataclysm-tiles + cataclysm-notiles false - cataclysm-tiles + cataclysm-notiles false @@ -151,11 +151,11 @@ false - cataclysm-tiles + cataclysm-notiles false - cataclysm-tiles + cataclysm-notiles From 3c595363e32db1f7ae4ec1e70593ebdfaab7a074 Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:13:51 +0100 Subject: [PATCH 080/158] desk fan --- data/json/items/generic.json | 9 +++++---- data/json/uncraft/recipe_deconstruction.json | 6 +++--- data/mods/TEST_DATA/known_bad_density.json | 1 - 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/data/json/items/generic.json b/data/json/items/generic.json index 0afcebabe6959..922303b85f988 100644 --- a/data/json/items/generic.json +++ b/data/json/items/generic.json @@ -2142,16 +2142,17 @@ "name": { "str": "desk fan" }, "description": "A small fan, used to propel air around a room.", "color": "light_gray", - "price": "10 USD", + "price": "25 USD", "price_postapoc": "10 cent", "material": [ "aluminum", "plastic" ], - "flags": [ "WATER_BREAK" ], + "flags": [ "WATER_BREAK", "FRAGILE_MELEE" ], "ammo": [ "battery" ], "charges_per_use": 4, "use_action": [ { "type": "link_up", "cable_length": 3, "charge_rate": "35 W" } ], "charged_qualities": [ [ "WINNOW", 1 ] ], - "weight": "2857 g", - "volume": "1 L", + "weight": "1588 g", + "volume": "19265 ml", + "//": "Based on https://www.amazon.com/dp/B000U9WXEC, although the volume calculated from package dimensions has been multiplied by 0.5 because there really is not a reasonable way to calculate fan volume without the numbers going into extremes", "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "melee_damage": { "bash": 4 } }, diff --git a/data/json/uncraft/recipe_deconstruction.json b/data/json/uncraft/recipe_deconstruction.json index 769b90b58e025..19bba557da2ef 100644 --- a/data/json/uncraft/recipe_deconstruction.json +++ b/data/json/uncraft/recipe_deconstruction.json @@ -2561,9 +2561,9 @@ "result": "fan", "type": "uncraft", "activity_level": "LIGHT_EXERCISE", - "time": "2 m", - "qualities": [ { "id": "SCREW", "level": 1 } ], - "components": [ [ [ "scrap_aluminum", 1 ] ], [ [ "plastic_chunk", 3 ] ], [ [ "motor_micro", 1 ] ], [ [ "cable", 2 ] ] ] + "time": "5 m", + "qualities": [ { "id": "SCREW", "level": 1 }, { "id": "SAW_M", "level": 1 } ], + "components": [ [ [ "scrap_aluminum", 10 ] ], [ [ "plastic_chunk", 15 ] ], [ [ "motor_micro", 1 ] ], [ [ "cable", 30 ] ] ] }, { "result": "fancy_sunglasses", diff --git a/data/mods/TEST_DATA/known_bad_density.json b/data/mods/TEST_DATA/known_bad_density.json index 91ecb0dddefd6..14696cf01656c 100644 --- a/data/mods/TEST_DATA/known_bad_density.json +++ b/data/mods/TEST_DATA/known_bad_density.json @@ -43,7 +43,6 @@ "vortex", "wasp_sting", "hotdogs_cooked", - "fan", "poppysyrup", "broken_lab_security_drone_BM2", "bot_lab_security_drone_BS", From 9866a698467da12c80a8acb1c344874041b086f4 Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:07:51 -0600 Subject: [PATCH 081/158] Initial commit --- .../Magiclysm/itemgroups/death_drops.json | 122 ++++++++++++++++++ data/mods/Magiclysm/monsters/goblin.json | 86 +----------- 2 files changed, 127 insertions(+), 81 deletions(-) diff --git a/data/mods/Magiclysm/itemgroups/death_drops.json b/data/mods/Magiclysm/itemgroups/death_drops.json index 8d29adc804a9d..bb03402dd878c 100644 --- a/data/mods/Magiclysm/itemgroups/death_drops.json +++ b/data/mods/Magiclysm/itemgroups/death_drops.json @@ -244,6 +244,128 @@ } ] }, + { + "id": "goblin_warrior_death_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "group": "feral_goblin_death_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "goblin_armor_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "item": "cudgel", "prob": 95, "damage": [ 1, 4 ] } + ] + }, + { + "id": "goblin_slinger_death_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "group": "feral_goblin_death_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "goblin_armor_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "item": "sling", "prob": 95, "damage": [ 1, 4 ] } + ] + }, + { + "id": "goblin_chieftan_death_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "group": "feral_goblin_death_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "goblin_armor_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "goblin_chieftan_weapon_drops", "prob": 95, "damage": [ 1, 4 ] } + ] + }, + { + "id": "goblin_armor_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "item": "helmet_scrap_xs", "prob": 40, "damage": [ 1, 4 ] }, + { "item": "xs_legguard_scrap", "prob": 40, "damage": [ 1, 4 ] }, + { "item": "xs_boots_scrap", "prob": 40, "damage": [ 1, 4 ] }, + { "item": "xs_armguard_scrap", "prob": 40, "damage": [ 1, 4 ] }, + { "item": "xs_cuirass_scrap", "prob": 40, "damage": [ 1, 4 ] } + ] + }, + { + "id": "goblin_chieftan_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ + { "group": "survivor_stabbing", "prob": 96, "damage": [ 1, 4 ] }, + { "item": "spear_steel_plus_one", "prob": 3, "damage": [ 1, 4 ] }, + { "item": "rune_biomancer_weapon", "prob": 1, "damage": [ 1, 4 ] } + ] + }, + { + "id": "goblin_bugbear_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "group": "bugbear_armor_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "bugbear_clothing_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "bugbear_weapon_drops", "prob": 95, "damage": [ 1, 4 ] } + ] + }, + { + "id": "goblin_bugbear_stalker_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "group": "bugbear_armor_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "bugbear_clothing_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "bugbear_stalker_weapon_drops", "prob": 95, "damage": [ 1, 4 ] } + ] + }, + { + "id": "bugbear_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "item": "survivor_machete", "prob": 98 }, { "item": "broadsword_plus_one", "prob": 2 } ] + }, + { + "id": "bugbear_stalker_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "group": "survivor_stabbing", "prob": 97 }, { "item": "spear_steel_plus_one", "prob": 3 } ] + }, + { + "id": "bugbear_clothing_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "item": "loincloth_fur", "prob": 75 }, + { "item": "footrags_fur", "prob": 25 }, + { "item": "gloves_wraps_fur", "prob": 25 }, + { "item": "bellywrap_fur", "prob": 10 }, + { "item": "chestwrap_fur", "prob": 25 } + ] + }, + { + "id": "bugbear_armor_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "item": "xl_helmet_larmor", "prob": 20 }, + { "item": "xl_gauntlets_larmor", "prob": 20 }, + { "item": "xl_boots_larmor", "prob": 20 }, + { "item": "xl_armguard_larmor", "prob": 20 }, + { "item": "xl_armor_larmor_chest", "prob": 10 } + ] + }, + { + "id": "orc_warrior_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "group": "bugbear_armor_drops", "prob": 96 }, + { "item": "loincloth_fur", "prob": 10 }, + { "item": "footrags_fur", "prob": 10 }, + { "item": "gloves_wraps_fur", "prob": 10 }, + { "item": "bellywrap_fur", "prob": 5 }, + { "item": "chestwrap_fur", "prob": 5 }, + { "group": "bugbear_stalker_drops", "prob": 95 } + ] + }, { "id": "mossling_drops", "type": "item_group", diff --git a/data/mods/Magiclysm/monsters/goblin.json b/data/mods/Magiclysm/monsters/goblin.json index 38bfa11d342c2..0cb7bb81aad0c 100644 --- a/data/mods/Magiclysm/monsters/goblin.json +++ b/data/mods/Magiclysm/monsters/goblin.json @@ -45,18 +45,7 @@ "no_dmg_msg_npc": "%1$s hits 's %2$s without penetrating their armor." } ], - "death_drops": { - "subtype": "collection", - "items": [ - { "group": "feral_goblin_death_drops", "prob": 100 }, - { "item": "helmet_scrap_xs", "prob": 40 }, - { "item": "xs_legguard_scrap", "prob": 40 }, - { "item": "xs_boots_scrap", "prob": 40 }, - { "item": "xs_armguard_scrap", "prob": 40 }, - { "item": "xs_cuirass_scrap", "prob": 40 }, - { "item": "cudgel", "prob": 95 } - ] - }, + "death_drops": "goblin_warrior_death_drops", "armor": { "bash": 12, "cut": 12, "bullet": 4 }, "zombify_into": "mon_zombie_goblin", "flags": [ "SEES", "HEARS", "HAS_MIND", "WARM", "BASHES", "PATH_AVOID_DANGER", "REVIVES", "GROUP_MORALE", "WIELDED_WEAPON" ] @@ -68,18 +57,7 @@ "description": "A goblin, but like something out of history. Over the dirty, tattered remnants of their street clothes, they're wearing improvised armor and carrying a sling with a pouch for extra stones. They look at you like a wolf seeing a particularly juicy hunk of lamb.", "copy-from": "mon_goblin_warrior", "melee_skill": 2, - "death_drops": { - "subtype": "collection", - "items": [ - { "group": "feral_goblin_death_drops", "prob": 100 }, - { "item": "helmet_scrap", "prob": 40 }, - { "item": "legguard_scrap", "prob": 40 }, - { "item": "boots_scrap", "prob": 40 }, - { "item": "armguard_scrap", "prob": 40 }, - { "item": "cuirass_scrap", "prob": 40 }, - { "item": "sling", "prob": 95 } - ] - }, + "death_drops": "goblin_slinger_death_drops", "starting_ammo": { "pebble": 30 }, "extend": { "special_attacks": [ @@ -129,25 +107,7 @@ "no_dmg_msg_npc": "%1$s hits 's %2$s without penetrating their armor." } ], - "death_drops": { - "subtype": "collection", - "items": [ - { "group": "feral_goblin_death_drops", "prob": 100 }, - { "item": "helmet_scrap", "prob": 40 }, - { "item": "legguard_scrap", "prob": 40 }, - { "item": "boots_scrap", "prob": 40 }, - { "item": "armguard_scrap", "prob": 40 }, - { "item": "cuirass_scrap", "prob": 40 }, - { - "distribution": [ - { "group": "survivor_stabbing", "prob": 96 }, - { "item": "spear_steel_plus_one", "prob": 3 }, - { "item": "rune_biomancer_weapon", "prob": 1 } - ], - "prob": 100 - } - ] - } + "death_drops": "goblin_chieftan_death_drops" }, { "type": "MONSTER", @@ -324,25 +284,7 @@ } ], "path_settings": { "avoid_traps": true, "avoid_sharp": true }, - "death_drops": { - "subtype": "collection", - "items": [ - { "item": "xl_helmet_larmor", "prob": 20 }, - { "item": "xl_gauntlets_larmor", "prob": 20 }, - { "item": "xl_boots_larmor", "prob": 20 }, - { "item": "xl_armguard_larmor", "prob": 20 }, - { "item": "xl_armor_larmor_chest", "prob": 10 }, - { "item": "loincloth_fur", "prob": 10 }, - { "item": "footrags_fur", "prob": 10 }, - { "item": "gloves_wraps_fur", "prob": 10 }, - { "item": "bellywrap_fur", "prob": 5 }, - { "item": "chestwrap_fur", "prob": 5 }, - { - "distribution": [ { "item": "survivor_machete", "prob": 98 }, { "item": "broadsword_plus_one", "prob": 2 } ], - "prob": 100 - } - ] - }, + "death_drops": "goblin_bugbear_death_drops", "armor": { "bash": 4, "cut": 12, "bullet": 8 }, "flags": [ "SEES", @@ -384,25 +326,7 @@ "no_dmg_msg_npc": "%1$s hits 's %2$s without penetrating their armor." } ], - "death_drops": { - "subtype": "collection", - "items": [ - { "item": "xl_helmet_larmor", "prob": 20 }, - { "item": "xl_gauntlets_larmor", "prob": 20 }, - { "item": "xl_boots_larmor", "prob": 20 }, - { "item": "xl_armguard_larmor", "prob": 20 }, - { "item": "xl_armor_larmor_chest", "prob": 10 }, - { "item": "loincloth_fur", "prob": 10 }, - { "item": "footrags_fur", "prob": 10 }, - { "item": "gloves_wraps_fur", "prob": 10 }, - { "item": "bellywrap_fur", "prob": 5 }, - { "item": "chestwrap_fur", "prob": 5 }, - { - "distribution": [ { "group": "survivor_stabbing", "prob": 97 }, { "item": "spear_steel_plus_one", "prob": 3 } ], - "prob": 100 - } - ] - }, + "death_drops": "goblin_bugbear_stalker_drops", "extend": { "flags": [ "CAMOUFLAGE", "SILENTMOVES" ] } } ] From 9981d11b9efcbb55303ab3b92cdb56354d5effe4 Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:20:05 -0600 Subject: [PATCH 082/158] Add orcs --- .../Magiclysm/itemgroups/death_drops.json | 88 +++++++++++++++++-- data/mods/Magiclysm/monsters/orcs.json | 84 +----------------- 2 files changed, 84 insertions(+), 88 deletions(-) diff --git a/data/mods/Magiclysm/itemgroups/death_drops.json b/data/mods/Magiclysm/itemgroups/death_drops.json index bb03402dd878c..ebba5261b7e70 100644 --- a/data/mods/Magiclysm/itemgroups/death_drops.json +++ b/data/mods/Magiclysm/itemgroups/death_drops.json @@ -353,17 +353,89 @@ ] }, { - "id": "orc_warrior_drops", + "id": "orc_warrior_death_drops", "type": "item_group", "subtype": "collection", "entries": [ - { "group": "bugbear_armor_drops", "prob": 96 }, - { "item": "loincloth_fur", "prob": 10 }, - { "item": "footrags_fur", "prob": 10 }, - { "item": "gloves_wraps_fur", "prob": 10 }, - { "item": "bellywrap_fur", "prob": 5 }, - { "item": "chestwrap_fur", "prob": 5 }, - { "group": "bugbear_stalker_drops", "prob": 95 } + { "group": "orc_armor_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "bugbear_clothing_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "orc_warrior_weapon_drops", "prob": 95, "damage": [ 1, 4 ] } + ] + }, + { + "id": "orc_archer_death_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "group": "orc_armor_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "bugbear_clothing_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "orc_archer_melee_weapon_drops", "prob": 50, "damage": [ 1, 4 ] }, + { "group": "orc_archer_ranged_weapon_drops", "prob": 50, "damage": [ 1, 4 ] } + ] + }, + { + "id": "orc_blood_warrior_death_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "group": "orc_armor_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "bugbear_clothing_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "orc_blood_warrior_weapon_drops", "prob": 95, "damage": [ 1, 4 ] } + ] + }, + { + "id": "orc_blood_mage_death_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "group": "orc_armor_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "bugbear_clothing_drops", "prob": 100, "damage": [ 1, 4 ] }, + { "group": "magic_plants_common", "prob": 10 }, + { "group": "magic_plants_uncommon", "prob": 1 } + ] + }, + { + "id": "orc_warrior_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ + { "item": "survivor_machete", "prob": 96 }, + { "item": "arming_sword_plus_one", "prob": 2 }, + { "item": "broadsword_plus_one", "prob": 2 } + ] + }, + { + "id": "orc_armor_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "item": "helmet_scrap", "prob": 20 }, + { "item": "armguard_scrap", "prob": 20 }, + { "item": "boots_scrap", "prob": 20 }, + { "item": "legguard_scrap", "prob": 20 }, + { "item": "cuirass_scrap", "prob": 10 } + ] + }, + { + "id": "orc_archer_melee_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "item": "sheath", "contents-item": "knife_combat", "prob": 100 } ] + }, + { + "id": "orc_archer_ranged_weapon_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ { "item": "longbow", "prob": 85 }, { "item": "quiver_large", "contents-group": "quiver_orc_archer", "prob": 50 } ] + }, + { + "id": "orc_blood_warrior_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ + { "item": "mace_pipe_large", "prob": 96 }, + { "item": "mace_plus_one", "prob": 2 }, + { "item": "warhammer_plus_one", "prob": 2 } ] }, { diff --git a/data/mods/Magiclysm/monsters/orcs.json b/data/mods/Magiclysm/monsters/orcs.json index 7f7772bada1f3..42e96804fa402 100644 --- a/data/mods/Magiclysm/monsters/orcs.json +++ b/data/mods/Magiclysm/monsters/orcs.json @@ -71,29 +71,7 @@ ], "path_settings": { "avoid_traps": true, "avoid_sharp": true }, "zombify_into": "mon_zorc", - "death_drops": { - "subtype": "collection", - "items": [ - { "item": "helmet_scrap", "prob": 20 }, - { "item": "legguard_scrap", "prob": 20 }, - { "item": "boots_scrap", "prob": 20 }, - { "item": "armguard_scrap", "prob": 20 }, - { "item": "cuirass_scrap", "prob": 10 }, - { "item": "loincloth_fur", "prob": 10 }, - { "item": "footrags_fur", "prob": 10 }, - { "item": "gloves_wraps_fur", "prob": 10 }, - { "item": "bellywrap_fur", "prob": 5 }, - { "item": "chestwrap_fur", "prob": 5 }, - { - "distribution": [ - { "item": "survivor_machete", "prob": 96 }, - { "item": "arming_sword_plus_one", "prob": 2 }, - { "item": "broadsword_plus_one", "prob": 2 } - ], - "prob": 100 - } - ] - }, + "death_drops": "orc_warrior_death_drops", "flags": [ "SEES", "HEARS", "HAS_MIND", "WARM", "BASHES", "PATH_AVOID_DANGER", "SWARMS", "GROUP_MORALE", "WIELDED_WEAPON" ] }, { @@ -103,24 +81,7 @@ "description": "Like a goblin, but stretched and exaggerated until they're as tall as a human but much more heavily muscled, wearing improvised armor and carrying a bow. They smile silently, baring a set of sharp teeth, as they aim at you.", "copy-from": "mon_orc_warrior", "melee_skill": 2, - "death_drops": { - "subtype": "collection", - "items": [ - { "item": "helmet_scrap", "prob": 40 }, - { "item": "legguard_scrap", "prob": 40 }, - { "item": "boots_scrap", "prob": 40 }, - { "item": "armguard_scrap", "prob": 40 }, - { "item": "cuirass_scrap", "prob": 40 }, - { "item": "loincloth_fur", "prob": 10 }, - { "item": "footrags_fur", "prob": 10 }, - { "item": "gloves_wraps_fur", "prob": 10 }, - { "item": "bellywrap_fur", "prob": 5 }, - { "item": "chestwrap_fur", "prob": 5 }, - { "item": "longbow", "prob": 100 }, - { "item": "sheath", "contents-item": "knife_combat", "prob": 50 }, - { "item": "quiver_large", "contents-group": "quiver_orc_archer", "prob": 100 } - ] - }, + "death_drops": "orc_archer_death_drops", "starting_ammo": { "arrow_wood_heavy": 60 }, "extend": { "special_attacks": [ @@ -175,29 +136,7 @@ "no_dmg_msg_npc": "%1$s hits 's %2$s without penetrating their armor." } ], - "death_drops": { - "subtype": "collection", - "items": [ - { "item": "helmet_scrap", "prob": 20 }, - { "item": "legguard_scrap", "prob": 10 }, - { "item": "boots_scrap", "prob": 10 }, - { "item": "armguard_scrap", "prob": 30 }, - { "item": "cuirass_scrap", "prob": 20 }, - { "item": "loincloth_fur", "prob": 10 }, - { "item": "footrags_fur", "prob": 10 }, - { "item": "gloves_wraps_fur", "prob": 10 }, - { "item": "bellywrap_fur", "prob": 5 }, - { "item": "chestwrap_fur", "prob": 5 }, - { - "distribution": [ - { "item": "mace_pipe_large", "prob": 96 }, - { "item": "mace_plus_one", "prob": 2 }, - { "item": "warhammer_plus_one", "prob": 2 } - ], - "prob": 100 - } - ] - } + "death_drops": "orc_blood_warrior_death_drops" }, { "id": "mon_orc_mage_blood", @@ -240,21 +179,6 @@ "monster_message": "%1$s makes a frenzied cry and as they point, %3$s is surrounded by a red glow." } ], - "death_drops": { - "subtype": "collection", - "items": [ - { "item": "helmet_scrap", "prob": 20 }, - { "item": "legguard_scrap", "prob": 10 }, - { "item": "boots_scrap", "prob": 10 }, - { "item": "cuirass_scrap", "prob": 20 }, - { "item": "loincloth_fur", "prob": 10 }, - { "item": "footrags_fur", "prob": 10 }, - { "item": "gloves_wraps_fur", "prob": 10 }, - { "item": "bellywrap_fur", "prob": 5 }, - { "item": "chestwrap_fur", "prob": 5 }, - { "group": "magic_plants_common", "prob": 10 }, - { "group": "magic_plants_uncommon", "prob": 1 } - ] - } + "death_drops": "orc_blood_mage_death_drops" } ] From 613fa375e1c80d712723f3a700bf79bf4837e09a Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:37:38 -0600 Subject: [PATCH 083/158] Add Innawood integration --- .../Magiclysm/itemgroups/death_drops.json | 1 + .../innawood/orc_goblin_lootgroups.json | 93 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json diff --git a/data/mods/Magiclysm/itemgroups/death_drops.json b/data/mods/Magiclysm/itemgroups/death_drops.json index ebba5261b7e70..9a0307a0282f1 100644 --- a/data/mods/Magiclysm/itemgroups/death_drops.json +++ b/data/mods/Magiclysm/itemgroups/death_drops.json @@ -349,6 +349,7 @@ { "item": "xl_gauntlets_larmor", "prob": 20 }, { "item": "xl_boots_larmor", "prob": 20 }, { "item": "xl_armguard_larmor", "prob": 20 }, + { "item": "xl_legguard_larmor", "prob": 20 }, { "item": "xl_armor_larmor_chest", "prob": 10 } ] }, diff --git a/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json b/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json new file mode 100644 index 0000000000000..c755853fbceb5 --- /dev/null +++ b/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json @@ -0,0 +1,93 @@ +[ + { + "id": "goblin_armor_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "item": "helmet_larmor_xs", "prob": 40 }, + { "item": "xs_legguard_larmor", "prob": 40 }, + { "item": "xs_boots_larmor", "prob": 40 }, + { "item": "xs_armguard_larmor", "prob": 40 }, + { "item": "xs_gauntlets_larmor", "prob": 40 }, + { "item": "armor_larmor_chest_xs", "prob": 40 } + ] + }, + { + "id": "goblin_chieftan_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "group": "survivor_stabbing", "prob": 99 }, { "item": "rune_biomancer_weapon", "prob": 1 } ] + }, + { + "id": "bugbear_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "item": "survivor_cutting", "prob": 100 } ] + }, + { + "id": "bugbear_stalker_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "group": "survivor_stabbing", "prob": 100 } ] + }, + { + "id": "bugbear_armor_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "item": "xl_helmet_larmor", "prob": 20 }, + { "item": "xl_gauntlets_larmor", "prob": 20 }, + { "item": "xl_boots_larmor", "prob": 20 }, + { "item": "xl_armguard_larmor", "prob": 20 }, + { "item": "xl_legguard_larmor", "prob": 20 }, + { "item": "xl_armor_larmor_chest", "prob": 10 } + ] + }, + { + "id": "orc_warrior_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ + { "item": "survivor_machete", "prob": 96 }, + { "item": "arming_sword_plus_one", "prob": 2 }, + { "item": "broadsword_plus_one", "prob": 2 } + ] + }, + { + "id": "orc_armor_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "item": "helmet_larmor", "prob": 40 }, + { "item": "legguard_larmor", "prob": 40 }, + { "item": "boots_larmor", "prob": 40 }, + { "item": "armguard_larmor", "prob": 40 }, + { "item": "gauntlets_larmor", "prob": 40 }, + { "item": "armor_larmor_chest", "prob": 40 } + ] + }, + { + "id": "orc_archer_melee_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "item": "sheath", "contents-item": "primitive_knife", "prob": 100 } ] + }, + { + "id": "orc_archer_ranged_weapon_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ { "item": "longbow", "prob": 85 }, { "item": "quiver_large", "contents-group": "quiver_orc_archer", "prob": 50 } ] + }, + { + "id": "orc_blood_warrior_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "item": "lizardfolk_club", "prob": 100 } ] + }, + { + "type": "item_group", + "subtype": "collection", + "id": "quiver_orc_archer", + "entries": [ { "item": "arrow_heavy_fire_hardened_fletched", "count": [ 1, 6 ], "charges": [ 1, 10 ] } ] + } +] From b2d480904cfa5a8c48ddbafef3f79ca390e9ab40 Mon Sep 17 00:00:00 2001 From: Zhilkin Serg Date: Wed, 11 Dec 2024 19:55:04 +0300 Subject: [PATCH 084/158] Migrate ma details menu to imgui --- data/raw/keybindings.json | 28 ++++ src/martialarts.cpp | 323 +++++++++++++++++++++++++------------- 2 files changed, 240 insertions(+), 111 deletions(-) diff --git a/data/raw/keybindings.json b/data/raw/keybindings.json index 4d005f545b637..c917de2aa789d 100644 --- a/data/raw/keybindings.json +++ b/data/raw/keybindings.json @@ -4875,6 +4875,34 @@ "name": "Toggle NPC group", "bindings": [ { "input_method": "keyboard_any", "key": "n" } ] }, + { + "type": "keybinding", + "id": "TOGGLE_GENERAL_INFO_GROUP", + "category": "MA_DETAILS_UI", + "name": "Toggle general info group", + "bindings": [ { "input_method": "keyboard_any", "key": "g" } ] + }, + { + "type": "keybinding", + "id": "TOGGLE_BUFFS_GROUP", + "category": "MA_DETAILS_UI", + "name": "Toggle buffs group", + "bindings": [ { "input_method": "keyboard_any", "key": "b" } ] + }, + { + "type": "keybinding", + "id": "TOGGLE_TECHNIQUES_GROUP", + "category": "MA_DETAILS_UI", + "name": "Toggle techniques group", + "bindings": [ { "input_method": "keyboard_any", "key": "t" } ] + }, + { + "type": "keybinding", + "id": "TOGGLE_WEAPONS_GROUP", + "category": "MA_DETAILS_UI", + "name": "Toggle weapons group", + "bindings": [ { "input_method": "keyboard_any", "key": "w" } ] + }, { "type": "keybinding", "id": "HELP_KEYBINDINGS", diff --git a/src/martialarts.cpp b/src/martialarts.cpp index 08f0e89a9e8e7..32db72ba66598 100644 --- a/src/martialarts.cpp +++ b/src/martialarts.cpp @@ -2182,79 +2182,141 @@ std::string ma_technique::get_description() const return dump; } -bool ma_style_callback::key( const input_context &ctxt, const input_event &event, int entnum, - uilist * ) +class ma_details_ui { - const std::string &action = ctxt.input_to_action( event ); - if( action != "SHOW_DESCRIPTION" ) { - return false; - } - matype_id style_selected; - const size_t index = entnum; - if( index >= offset && index - offset < styles.size() ) { - style_selected = styles[index - offset]; + friend class ma_details_ui_impl; + public: + void draw_ma_details_ui( const matype_id &style_selected ); +}; + +class ma_details_ui_impl : public cataimgui::window +{ + public: + std::string last_action; + explicit ma_details_ui_impl( const matype_id &style_selected ) : cataimgui::window( + string_format( _( "Martial art style details - %s" ), + style_selected.obj().name.translated().c_str() ), + ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNav ) { + ma_style = style_selected; + }; + void init_data(); + + private: + void draw_ma_details_text() const; + + size_t window_width = ImGui::GetMainViewport()->Size.x * 8 / 9; + size_t window_height = ImGui::GetMainViewport()->Size.y * 8 / 9; + + bool general_info_group_collapsed = false; + bool buffs_group_collapsed = false; + bool techniques_group_collapsed = false; + bool weapons_group_collapsed = false; + + matype_id ma_style; + std::vector general_info_text; + std::map buffs_text; + std::map techniques_text; + std::map weapons_text; + int buffs_total = 0; + int weapons_total = 0; + + protected: + void draw_controls() override; +}; + +void ma_details_ui::draw_ma_details_ui( const matype_id &style_selected ) +{ + input_context ctxt( "MA_DETAILS_UI" ); + ma_details_ui_impl p_impl( style_selected ); + + p_impl.init_data(); + + ctxt.register_navigate_ui_list(); + ctxt.register_leftright(); + ctxt.register_action( "TOGGLE_GENERAL_INFO_GROUP" ); + ctxt.register_action( "TOGGLE_BUFFS_GROUP" ); + ctxt.register_action( "TOGGLE_TECHNIQUES_GROUP" ); + ctxt.register_action( "TOGGLE_WEAPONS_GROUP" ); + ctxt.register_action( "SELECT" ); + ctxt.register_action( "MOUSE_MOVE" ); + ctxt.register_action( "HELP_KEYBINDINGS" ); + ctxt.register_action( "QUIT" ); + // Smooths out our handling, makes tabs load immediately after input instead of waiting for next. + ctxt.set_timeout( 10 ); + + while( true ) { + ui_manager::redraw_invalidated(); + + p_impl.last_action = ctxt.handle_input(); + + if( p_impl.last_action == "QUIT" || !p_impl.get_is_open() ) { + break; + } } - if( !style_selected.str().empty() ) { - const martialart &ma = style_selected.obj(); +} + +void ma_details_ui_impl::init_data() +{ + general_info_text.clear(); + buffs_text.clear(); + techniques_text.clear(); + weapons_text.clear(); + + buffs_total = 0; + weapons_total = 0; - std::string buffer; + if( !ma_style.str().empty() ) { + + const martialart &ma = ma_style.obj(); if( ma.force_unarmed ) { - buffer += _( "This style forces you to use unarmed strikes, even if wielding a weapon." ); - buffer += "\n"; + general_info_text.emplace_back( + _( "This style forces you to use unarmed strikes, even if wielding a weapon." ) ); } else if( ma.allow_all_weapons ) { - buffer += _( "This style can be used with all weapons." ); - buffer += "\n"; + general_info_text.emplace_back( _( "This style can be used with all weapons." ) ); } else if( ma.strictly_melee ) { - buffer += _( "This is an armed combat style." ); - buffer += "\n"; + general_info_text.emplace_back( _( "This is an armed combat style." ) ); } - buffer += "--\n"; - if( ma.arm_block_with_bio_armor_arms || ma.arm_block != 99 || - ma.leg_block_with_bio_armor_legs || ma.leg_block != 99 || + ma.leg_block_with_bio_armor_legs || ma.leg_block != 99 || ma.nonstandard_block != 99 ) { Character &u = get_player_character(); - int unarmed_skill = u.get_skill_level( skill_unarmed ); + int unarmed_skill = u.get_skill_level( skill_unarmed ); if( u.has_active_bionic( bio_cqb ) ) { unarmed_skill = BIO_CQB_LEVEL; } if( ma.arm_block_with_bio_armor_arms ) { - buffer += _( "You can arm block by installing the Arms Alloy Plating CBM" ); - buffer += "\n"; + general_info_text.emplace_back( + _( "You can arm block by installing the Arms Alloy Plating CBM" ) ); } else if( ma.arm_block != 99 ) { - buffer += string_format( - _( "You can arm block at unarmed combat: %s/%s" ), - unarmed_skill, ma.arm_block ) + "\n"; + general_info_text.emplace_back( string_format( + _( "You can arm block at unarmed combat: %s/%s" ), + unarmed_skill, ma.arm_block ) ); } if( ma.leg_block_with_bio_armor_legs ) { - buffer += _( "You can leg block by installing the Legs Alloy Plating CBM" ); - buffer += "\n"; + general_info_text.emplace_back( + _( "You can leg block by installing the Legs Alloy Plating CBM" ) ); } else if( ma.leg_block != 99 ) { - buffer += string_format( - _( "You can leg block at unarmed combat: %s/%s" ), - unarmed_skill, ma.leg_block ); - buffer += "\n"; - } - if( ma.nonstandard_block != 99 ) { - buffer += string_format( - _( "You can block with mutated limbs at unarmed combat: %s/%s" ), - unarmed_skill, ma.nonstandard_block ); - buffer += "\n"; + general_info_text.emplace_back( string_format( + _( "You can leg block at unarmed combat: %s/%s" ), + unarmed_skill, ma.leg_block ) ); + if( ma.nonstandard_block != 99 ) { + general_info_text.emplace_back( string_format( + _( "You can block with mutated limbs at unarmed combat: %s/%s" ), + unarmed_skill, ma.nonstandard_block ) ); + } } - buffer += "--\n"; } auto buff_desc = [&]( const std::string & title, const std::vector &buffs, bool passive = false ) { if( !buffs.empty() ) { - buffer += string_format( _( "
%s buffs:
" ), title ); for( const auto &buff : buffs ) { - buffer += "\n" + buff->get_description( passive ); + buffs_total++; + buffs_text[ title ] = buff->get_description( passive ); } - buffer += "--\n"; } }; @@ -2271,9 +2333,7 @@ bool ma_style_callback::key( const input_context &ctxt, const input_event &event buff_desc( _( "Get hit" ), ma.ongethit_buffs ); for( const auto &tech : ma.techniques ) { - buffer += string_format( _( "
Technique:
%s " ), - tech.obj().name ) + "\n"; - buffer += tech.obj().get_description() + "--\n"; + techniques_text[ tech.obj().name.translated() ] = tech.obj().get_description(); } // Copy set to vector for sorting @@ -2281,7 +2341,7 @@ bool ma_style_callback::key( const input_context &ctxt, const input_event &event std::copy( ma.weapons.begin(), ma.weapons.end(), std::back_inserter( valid_ma_weapons ) ); for( const itype *itp : item_controller->all() ) { const itype_id &weap_id = itp->get_id(); - if( ma.has_weapon( weap_id ) ) { + if( ma.has_weapon( weap_id ) ) { valid_ma_weapons.emplace_back( weap_id ); } } @@ -2314,9 +2374,9 @@ bool ma_style_callback::key( const input_context &ctxt, const input_event &event // Weapons that are uncategorized or not in the martial art's weapon categories weaps_by_cat[weapon_category_OTHER_INVALID_WEAP_CAT].push_back( wname ); } + weapons_total++; } - buffer += std::string( "" ) + _( "Weapons" ) + std::string( "" ) + "\n"; bool has_other_cat = false; for( auto &weaps : weaps_by_cat ) { if( weaps.first == weapon_category_OTHER_INVALID_WEAP_CAT ) { @@ -2333,83 +2393,124 @@ bool ma_style_callback::key( const input_context &ctxt, const input_event &event w_cat = weaps.first.str() + " - MISSING JSON DEFINITION"; } - buffer += std::string( "
" ) + w_cat + std::string( ":
" ); - buffer += enumerate_as_string( weaps.second ) + "\n"; + weapons_text.emplace( w_cat, enumerate_as_string( weaps.second ) ); } if( has_other_cat ) { std::vector &weaps = weaps_by_cat[weapon_category_OTHER_INVALID_WEAP_CAT]; weaps.erase( std::unique( weaps.begin(), weaps.end() ), weaps.end() ); - buffer += std::string( "
" ) + _( "OTHER" ) + std::string( ":
" ); - buffer += enumerate_as_string( weaps ) + "\n"; + weapons_text.emplace( _( "OTHER" ), enumerate_as_string( weaps ) ); } - buffer += "--\n"; } + } +} - catacurses::window w; +void ma_details_ui_impl::draw_ma_details_text() const +{ + // TODO: Need to make proper width calculations + const float window_width_in_chars = window_width * 0.4; - const std::string text = replace_colors( buffer ); - int width = 0; - int height = 0; - int iLines = 0; - int selected = 0; + if( !general_info_text.empty() && + ImGui::CollapsingHeader( _( "General info" ), + general_info_group_collapsed ? ImGuiTreeNodeFlags_None : ImGuiTreeNodeFlags_DefaultOpen ) ) { + for( const auto &entry : general_info_text ) { + cataimgui::draw_colored_text( entry, window_width_in_chars ); + ImGui::NewLine(); + } + } - ui_adaptor ui; - ui.on_screen_resize( [&]( ui_adaptor & ui ) { - w = catacurses::newwin( TERMY * 0.9, FULL_SCREEN_WIDTH, - point( TERMX - FULL_SCREEN_WIDTH, TERMY * 0.1 ) / 2 ); + if( !buffs_text.empty() && + ImGui::CollapsingHeader( string_format( _( "Buffs (%d in %d categories)" ), + buffs_total, buffs_text.size() ).c_str(), + buffs_group_collapsed ? ImGuiTreeNodeFlags_None : ImGuiTreeNodeFlags_DefaultOpen ) ) { + for( const auto &entry : buffs_text ) { + cataimgui::draw_colored_text( string_format( _( "
%s buffs:
" ), entry.first ) ); + ImGui::NewLine(); + cataimgui::draw_colored_text( entry.second, window_width_in_chars ); + ImGui::Separator(); + } + } - width = catacurses::getmaxx( w ) - 4; - height = catacurses::getmaxy( w ) - 2; + if( !techniques_text.empty() && + ImGui::CollapsingHeader( string_format( _( "Techniques (%d)" ), techniques_text.size() ).c_str(), + techniques_group_collapsed ? ImGuiTreeNodeFlags_None : ImGuiTreeNodeFlags_DefaultOpen ) ) { + for( const auto &entry : techniques_text ) { + cataimgui::draw_colored_text( string_format( _( "
Technique:
%s" ), + entry.first ) ); + ImGui::NewLine(); + cataimgui::draw_colored_text( entry.second, window_width_in_chars ); + ImGui::Separator(); + } + } - const auto vFolded = foldstring( text, width ); - iLines = vFolded.size(); + if( !weapons_text.empty() && + ImGui::CollapsingHeader( string_format( _( "Weapons (%d in %d categories)" ), + weapons_total, weapons_text.size() ).c_str(), + weapons_group_collapsed ? ImGuiTreeNodeFlags_None : ImGuiTreeNodeFlags_DefaultOpen ) ) { + for( const auto &entry : weapons_text ) { + cataimgui::draw_colored_text( string_format( _( "
%s
" ), entry.first ) ); + ImGui::NewLine(); + cataimgui::draw_colored_text( entry.second, window_width_in_chars ); + ImGui::Separator(); + } + } +} - if( iLines < height ) { - selected = 0; - } else if( selected >= iLines - height ) { - selected = iLines - height; - } +void ma_details_ui_impl::draw_controls() +{ + ImGui::SetWindowSize( ImVec2( window_width, window_height ), ImGuiCond_Once ); - ui.position_from_window( w ); - } ); - ui.mark_resize(); - - scrollbar sb; - - input_context ctxt; - sb.set_draggable( ctxt ); - ctxt.register_navigate_ui_list(); - ctxt.register_action( "QUIT" ); - ctxt.register_action( "HELP_KEYBINDINGS" ); - - ui.on_redraw( [&]( const ui_adaptor & ) { - werase( w ); - fold_and_print_from( w, point( 2, 1 ), width, selected, c_light_gray, text ); - draw_border( w, BORDER_COLOR, string_format( _( " Style: %s " ), ma.name ) ); - sb.offset_x( 0 ) - .offset_y( 1 ) - .content_size( iLines ) - .viewport_pos( selected ) - .viewport_size( height ) - .slot_color( BORDER_COLOR ) - .scroll_to_last( false ) - .apply( w ); - wnoutrefresh( w ); - } ); + if( last_action == "QUIT" ) { + return; + } else if( last_action == "TOGGLE_GENERAL_INFO_GROUP" ) { + general_info_group_collapsed = !general_info_group_collapsed; + } else if( last_action == "TOGGLE_BUFFS_GROUP" ) { + buffs_group_collapsed = !buffs_group_collapsed; + } else if( last_action == "TOGGLE_TECHNIQUES_GROUP" ) { + techniques_group_collapsed = !techniques_group_collapsed; + } else if( last_action == "TOGGLE_WEAPONS_GROUP" ) { + weapons_group_collapsed = !weapons_group_collapsed; + } else if( last_action == "UP" ) { + ImGui::SetScrollY( ImGui::GetScrollY() - ImGui::GetTextLineHeightWithSpacing() ); + } else if( last_action == "DOWN" ) { + ImGui::SetScrollY( ImGui::GetScrollY() + ImGui::GetTextLineHeightWithSpacing() ); + } else if( last_action == "LEFT" ) { + ImGui::SetScrollX( ImGui::GetScrollX() - ImGui::CalcTextSize( "x" ).x ); + } else if( last_action == "RIGHT" ) { + ImGui::SetScrollX( ImGui::GetScrollX() + ImGui::CalcTextSize( "x" ).x ); + } else if( last_action == "PAGE_UP" ) { + ImGui::SetScrollY( ImGui::GetScrollY() - window_height ); + } else if( last_action == "PAGE_DOWN" ) { + ImGui::SetScrollY( ImGui::GetScrollY() + window_height ); + } else if( last_action == "HOME" ) { + ImGui::SetScrollY( 0 ); + } else if( last_action == "END" ) { + ImGui::SetScrollY( ImGui::GetScrollMaxY() ); + } + + draw_ma_details_text(); +} + +static void show_ma_details_ui( const matype_id &style_selected ) +{ + ma_details_ui new_instance; + new_instance.draw_ma_details_ui( style_selected ); +} - do { - ui_manager::redraw(); - const size_t scroll_lines = catacurses::getmaxy( w ) - 3; - std::string action = ctxt.handle_input(); +bool ma_style_callback::key( const input_context &ctxt, const input_event &event, int entnum, + uilist * ) +{ + const std::string &action = ctxt.input_to_action( event ); + if( entnum == 0 || action != "SHOW_DESCRIPTION" ) { + return false; + } - if( action == "QUIT" ) { - break; - } else if( sb.handle_dragging( action, ctxt.get_coordinates_text( catacurses::stdscr ), - selected ) - || navigate_ui_list( action, selected, scroll_lines, iLines - height + 1, false ) ) { - // NO FURTHER ACTION REQUIRED - } - } while( true ); + matype_id style_selected; + const size_t index = entnum; + if( index >= offset && index - offset < styles.size() ) { + style_selected = styles[index - offset]; } + + show_ma_details_ui( style_selected ); + return true; } From 5cbe014f7a76755dd7a5a8e8c3c54fbde48edaa0 Mon Sep 17 00:00:00 2001 From: Brambor Date: Fri, 6 Dec 2024 15:32:14 +0100 Subject: [PATCH 085/158] lcmatch instead of wildcard_match for (by)product filter `r:` --- src/crafting_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crafting_gui.cpp b/src/crafting_gui.cpp index 0a6f4fbecfd45..c6049894b9731 100644 --- a/src/crafting_gui.cpp +++ b/src/crafting_gui.cpp @@ -1043,7 +1043,7 @@ static recipe_subset filter_recipes( const recipe_subset &available_recipes, case 'r': { recipe_subset result; for( const itype *e : item_controller->all() ) { - if( wildcard_match( e->nname( 1 ), qry_filter_str.substr( 2 ) ) ) { + if( lcmatch( e->nname( 1 ), qry_filter_str.substr( 2 ) ) ) { result.include( recipe_subset( available_recipes, available_recipes.recipes_that_produce( e->get_id() ) ) ); } @@ -1093,7 +1093,7 @@ static const std::vector prefixes = { { 'm', to_translation( "yes" ), to_translation( "recipe memorized (or not)" ) }, { 'P', to_translation( "Blacksmithing" ), to_translation( "proficiency used to craft" ) }, { 'l', to_translation( "5" ), to_translation( "difficulty of the recipe as a number or range" ) }, - { 'r', to_translation( "buttermilk" ), to_translation( "recipe's (by)products; use * as wildcard" ) }, + { 'r', to_translation( "buttermilk" ), to_translation( "recipe's (by)products" ) }, { 'L', to_translation( "122 cm" ), to_translation( "result can contain item of length" ) }, { 'V', to_translation( "450 ml" ), to_translation( "result can contain item of volume" ) }, { 'M', to_translation( "250 kg" ), to_translation( "result can contain item of mass" ) }, From 74b7dba2dd0ea4d5273f971d53c0692a401b9657 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Wed, 11 Dec 2024 20:47:20 -0600 Subject: [PATCH 086/158] Fixes --- .../Magiclysm/itemgroups/death_drops.json | 4 +- .../innawood/orc_goblin_lootgroups.json | 202 ++++++++++-------- data/mods/Magiclysm/monsters/goblin.json | 2 +- 3 files changed, 112 insertions(+), 96 deletions(-) diff --git a/data/mods/Magiclysm/itemgroups/death_drops.json b/data/mods/Magiclysm/itemgroups/death_drops.json index 9a0307a0282f1..f58777b089ba8 100644 --- a/data/mods/Magiclysm/itemgroups/death_drops.json +++ b/data/mods/Magiclysm/itemgroups/death_drops.json @@ -297,7 +297,7 @@ ] }, { - "id": "goblin_bugbear_drops", + "id": "goblin_bugbear_death_drops", "type": "item_group", "subtype": "collection", "entries": [ @@ -307,7 +307,7 @@ ] }, { - "id": "goblin_bugbear_stalker_drops", + "id": "goblin_bugbear_stalker_death_drops", "type": "item_group", "subtype": "collection", "entries": [ diff --git a/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json b/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json index c755853fbceb5..e378aaa341908 100644 --- a/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json +++ b/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json @@ -1,93 +1,109 @@ -[ - { - "id": "goblin_armor_drops", - "type": "item_group", - "subtype": "collection", - "entries": [ - { "item": "helmet_larmor_xs", "prob": 40 }, - { "item": "xs_legguard_larmor", "prob": 40 }, - { "item": "xs_boots_larmor", "prob": 40 }, - { "item": "xs_armguard_larmor", "prob": 40 }, - { "item": "xs_gauntlets_larmor", "prob": 40 }, - { "item": "armor_larmor_chest_xs", "prob": 40 } - ] - }, - { - "id": "goblin_chieftan_weapon_drops", - "type": "item_group", - "subtype": "distribution", - "entries": [ { "group": "survivor_stabbing", "prob": 99 }, { "item": "rune_biomancer_weapon", "prob": 1 } ] - }, - { - "id": "bugbear_weapon_drops", - "type": "item_group", - "subtype": "distribution", - "entries": [ { "item": "survivor_cutting", "prob": 100 } ] - }, - { - "id": "bugbear_stalker_weapon_drops", - "type": "item_group", - "subtype": "distribution", - "entries": [ { "group": "survivor_stabbing", "prob": 100 } ] - }, - { - "id": "bugbear_armor_drops", - "type": "item_group", - "subtype": "collection", - "entries": [ - { "item": "xl_helmet_larmor", "prob": 20 }, - { "item": "xl_gauntlets_larmor", "prob": 20 }, - { "item": "xl_boots_larmor", "prob": 20 }, - { "item": "xl_armguard_larmor", "prob": 20 }, - { "item": "xl_legguard_larmor", "prob": 20 }, - { "item": "xl_armor_larmor_chest", "prob": 10 } - ] - }, - { - "id": "orc_warrior_weapon_drops", - "type": "item_group", - "subtype": "distribution", - "entries": [ - { "item": "survivor_machete", "prob": 96 }, - { "item": "arming_sword_plus_one", "prob": 2 }, - { "item": "broadsword_plus_one", "prob": 2 } - ] - }, - { - "id": "orc_armor_drops", - "type": "item_group", - "subtype": "collection", - "entries": [ - { "item": "helmet_larmor", "prob": 40 }, - { "item": "legguard_larmor", "prob": 40 }, - { "item": "boots_larmor", "prob": 40 }, - { "item": "armguard_larmor", "prob": 40 }, - { "item": "gauntlets_larmor", "prob": 40 }, - { "item": "armor_larmor_chest", "prob": 40 } - ] - }, - { - "id": "orc_archer_melee_weapon_drops", - "type": "item_group", - "subtype": "distribution", - "entries": [ { "item": "sheath", "contents-item": "primitive_knife", "prob": 100 } ] - }, - { - "id": "orc_archer_ranged_weapon_drops", - "type": "item_group", - "subtype": "collection", - "entries": [ { "item": "longbow", "prob": 85 }, { "item": "quiver_large", "contents-group": "quiver_orc_archer", "prob": 50 } ] - }, - { - "id": "orc_blood_warrior_weapon_drops", - "type": "item_group", - "subtype": "distribution", - "entries": [ { "item": "lizardfolk_club", "prob": 100 } ] - }, - { - "type": "item_group", - "subtype": "collection", - "id": "quiver_orc_archer", - "entries": [ { "item": "arrow_heavy_fire_hardened_fletched", "count": [ 1, 6 ], "charges": [ 1, 10 ] } ] - } -] +[ + { + "type": "item_group", + "subtype": "collection", + "id": "feral_goblin_death_drops", + "entries": [ + { "group": "shoes_unisex", "prob": 40, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, + { "group": "npc_hat", "prob": 10, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, + { "group": "male_underwear_bottom", "prob": 100, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, + { "group": "female_underwear_top", "prob": 100, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, + { "item": "chestwrap_leather", "prob": 20, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, + { "group": "pants_male", "prob": 75, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, + { "group": "npc_coat", "prob": 2, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, + { "group": "npc_gloves", "prob": 50, "damage": [ 1, 4 ] }, + { "item": "wicker_backpack", "prob": 1, "damage": [ 1, 4 ] } + ] + }, + { + "id": "goblin_armor_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "item": "helmet_larmor_xs", "prob": 40 }, + { "item": "xs_legguard_larmor", "prob": 40 }, + { "item": "xs_boots_larmor", "prob": 40 }, + { "item": "xs_armguard_larmor", "prob": 40 }, + { "item": "xs_gauntlets_larmor", "prob": 40 }, + { "item": "armor_larmor_chest_xs", "prob": 40 } + ] + }, + { + "id": "goblin_chieftan_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "group": "survivor_stabbing", "prob": 99 }, { "item": "rune_biomancer_weapon", "prob": 1 } ] + }, + { + "id": "bugbear_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "group": "survivor_cutting", "prob": 100 } ] + }, + { + "id": "bugbear_stalker_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "group": "survivor_stabbing", "prob": 100 } ] + }, + { + "id": "bugbear_armor_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "item": "xl_helmet_larmor", "prob": 20 }, + { "item": "xl_gauntlets_larmor", "prob": 20 }, + { "item": "xl_boots_larmor", "prob": 20 }, + { "item": "xl_armguard_larmor", "prob": 20 }, + { "item": "xl_legguard_larmor", "prob": 20 }, + { "item": "xl_armor_larmor_chest", "prob": 10 } + ] + }, + { + "id": "orc_warrior_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ + { "item": "survivor_machete", "prob": 96 }, + { "item": "arming_sword_plus_one", "prob": 2 }, + { "item": "broadsword_plus_one", "prob": 2 } + ] + }, + { + "id": "orc_armor_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ + { "item": "helmet_larmor", "prob": 40 }, + { "item": "legguard_larmor", "prob": 40 }, + { "item": "boots_larmor", "prob": 40 }, + { "item": "armguard_larmor", "prob": 40 }, + { "item": "gauntlets_larmor", "prob": 40 }, + { "item": "armor_larmor_chest", "prob": 40 } + ] + }, + { + "id": "orc_archer_melee_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "item": "sheath", "contents-item": "primitive_knife", "prob": 100 } ] + }, + { + "id": "orc_archer_ranged_weapon_drops", + "type": "item_group", + "subtype": "collection", + "entries": [ { "item": "longbow", "prob": 85 }, { "item": "quiver_large", "contents-group": "quiver_orc_archer", "prob": 50 } ] + }, + { + "id": "orc_blood_warrior_weapon_drops", + "type": "item_group", + "subtype": "distribution", + "entries": [ { "item": "lizardfolk_club", "prob": 100 } ] + }, + { + "type": "item_group", + "subtype": "collection", + "id": "quiver_orc_archer", + "entries": [ { "item": "arrow_heavy_fire_hardened_fletched", "count": [ 1, 6 ], "charges": [ 1, 10 ] } ] + } +] diff --git a/data/mods/Magiclysm/monsters/goblin.json b/data/mods/Magiclysm/monsters/goblin.json index 0cb7bb81aad0c..5772f94ab9d9c 100644 --- a/data/mods/Magiclysm/monsters/goblin.json +++ b/data/mods/Magiclysm/monsters/goblin.json @@ -326,7 +326,7 @@ "no_dmg_msg_npc": "%1$s hits 's %2$s without penetrating their armor." } ], - "death_drops": "goblin_bugbear_stalker_drops", + "death_drops": "goblin_bugbear_stalker_death_drops", "extend": { "flags": [ "CAMOUFLAGE", "SILENTMOVES" ] } } ] From dfa3de4508017d5b8848e42498359c4f07742101 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Wed, 11 Dec 2024 21:01:22 -0600 Subject: [PATCH 087/158] Fix encampment itemgroups --- .../innawood/orc_goblin_lootgroups.json | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json b/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json index e378aaa341908..daf849678e367 100644 --- a/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json +++ b/data/mods/Magiclysm/mod_interactions/innawood/orc_goblin_lootgroups.json @@ -1,4 +1,21 @@ [ + { + "type": "item_group", + "id": "bed", + "subtype": "distribution", + "entries": [ { "item": "grass_blanket", "prob": 2500 } ] + }, + { + "type": "item_group", + "id": "midden_heap", + "//": "a large pile of trash, made for goblin encampments.", + "subtype": "collection", + "items": [ + { "group": "trash_forest", "prob": 95 }, + { "group": "trash_forest", "prob": 70 }, + { "group": "trash_forest", "prob": 25 } + ] + }, { "type": "item_group", "subtype": "collection", @@ -11,7 +28,7 @@ { "item": "chestwrap_leather", "prob": 20, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, { "group": "pants_male", "prob": 75, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, { "group": "npc_coat", "prob": 2, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, - { "group": "npc_gloves", "prob": 50, "damage": [ 1, 4 ] }, + { "group": "npc_gloves", "prob": 50, "damage": [ 1, 4 ], "custom-flags": [ "UNDERSIZE" ] }, { "item": "wicker_backpack", "prob": 1, "damage": [ 1, 4 ] } ] }, From 39a3e408e486450a37eec82f341211e34a7ae5b6 Mon Sep 17 00:00:00 2001 From: Kevin Granade Date: Wed, 11 Dec 2024 22:26:15 -0800 Subject: [PATCH 088/158] Remove mingw cross build (#78495) We don't ship cross compiles anymore and there really isn't a place for it since we do have native builds. --- .github/workflows/matrix.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index 868d8893b4588..baaa6eb3b6b70 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -166,25 +166,6 @@ jobs: ccache_limit: 4G ccache_key: linux-gcc-11-asan - - compiler: g++ - os: ubuntu-latest - cmake: 0 - native: - pch: 1 - tiles: 1 - sound: 1 - localize: 1 - libbacktrace: 1 - title: GCC 12, Ubuntu cross-compile to MinGW-Win64, Tiles, Sound - ldflags: -static-libgcc -static-libstdc++ - mxe_target: x86_64-w64-mingw32.static.gcc12 - wine: wine - # ~285MB in a clean build - # ~36MB compressed - # observed usage: 3.0GB -> 350MB - ccache_limit: 2G - ccache_key: mingw-gcc-12 - - compiler: g++-9 os: ubuntu-latest cmake: 1 From 3f45a03f037f2a1d438736e9adbe11ac250a837f Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 09:53:06 -0600 Subject: [PATCH 089/158] Fix death effects --- .../monsters/death_effects.json | 23 +++++-------------- .../monsters/feral_psychics.json | 5 ++-- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/data/mods/MindOverMatter/monsters/death_effects.json b/data/mods/MindOverMatter/monsters/death_effects.json index e0f3e0edf3279..e5a95aa21a200 100644 --- a/data/mods/MindOverMatter/monsters/death_effects.json +++ b/data/mods/MindOverMatter/monsters/death_effects.json @@ -208,27 +208,16 @@ "id": "EOC_VITAKIN3_DEATH_EFFECT", "effect": [ { "npc_location_variable": { "context_val": "spawn_place" }, "min_radius": 0 }, - { - "npc_map_run_item_eocs": "all", - "loc": { "context_val": "spawn_place" }, - "true_eocs": [ { "id": "EOC_EOC_VITAKIN3_DEATH_EFFECT_HANDLING_DELETE_NPC_ITEMS", "effect": [ "npc_die" ] } ] - }, - { - "npc_spawn_monster": "mon_feral_human_vita3_revived", - "target_var": { "context_val": "spawn_place" }, - "min_radius": 0 - }, - { - "npc_location_variable": { "context_val": "loc" }, - "monster": "mon_feral_human_vita3_revived", - "min_radius": 2 - }, - { "run_eocs": "EOC_VITAKIN3_DEATH_EFFECT_2", "alpha_loc": { "context_val": "loc" } } + { "npc_spawn_monster": "mon_feral_human_vita3_revived", "real_count": 1, "min_radius": 0, "max_radius": 0 }, + { "run_eocs": "EOC_VITAKIN3_DEATH_EFFECT_2", "alpha_loc": { "context_val": "spawn_place" } } ] }, { "type": "effect_on_condition", "id": "EOC_VITAKIN3_DEATH_EFFECT_2", - "effect": [ { "u_add_effect": "effect_feral_regeneration", "duration": [ "15 seconds", "30 seconds" ] } ] + "effect": [ + { "math": [ "u_hp('ALL') = 25" ] }, + { "u_add_effect": "effect_feral_regeneration", "duration": [ "15 seconds", "30 seconds" ] } + ] } ] diff --git a/data/mods/MindOverMatter/monsters/feral_psychics.json b/data/mods/MindOverMatter/monsters/feral_psychics.json index 9b1e93a91f15a..52b8de2bbca4f 100644 --- a/data/mods/MindOverMatter/monsters/feral_psychics.json +++ b/data/mods/MindOverMatter/monsters/feral_psychics.json @@ -1460,12 +1460,12 @@ "regenerates": 5, "regeneration_modifiers": [ [ "effect_vitakin_hurt", -2 ], [ "effect_psi_null", -5 ], [ "effect_feral_regeneration", 10 ] ], "bleed_rate": 0, - "death_drops": "feral_humans_death_drops_vita", "zombify_into": "mon_zombie_survivor", "anger_triggers": [ "FRIEND_DIED", "FRIEND_ATTACKED", "HURT" ], "death_function": { "eoc": "EOC_VITAKIN3_DEATH_EFFECT", - "message": "As %s succumbs to their wounds, they suddenly rise up with new vitality!" + "message": "As %s succumbs to their wounds, they suddenly rise up with new vigor!", + "corpse_type": "NO_CORPSE" }, "extend": { "special_attacks": [ @@ -1549,6 +1549,7 @@ "name": "font of vitality", "description": "This is the healthiest person you've even seen, especially after the end of the world. Their skin positively glows, and as you watch them brush past a jagged chunk of wood to get to you, the wound they receive immediately stops bleeding and rapidly begins to close.", "copy-from": "mon_feral_human_vita3", + "death_drops": "feral_humans_death_drops_vita", "death_function": { } } ] From 6aeaca2d01614023a13e6392d3452b861f6ac348 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 09:58:25 -0600 Subject: [PATCH 090/158] Font of vitality won't reapply regeneration if it already has regeneration --- data/mods/MindOverMatter/monsters/feral_psychics.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/mods/MindOverMatter/monsters/feral_psychics.json b/data/mods/MindOverMatter/monsters/feral_psychics.json index 52b8de2bbca4f..a315dbf749541 100644 --- a/data/mods/MindOverMatter/monsters/feral_psychics.json +++ b/data/mods/MindOverMatter/monsters/feral_psychics.json @@ -1439,7 +1439,7 @@ "spell_data": { "id": "vitakinetic_regeneration_monster" }, "cooldown": { "math": [ "10 + rand(20)" ] }, "allow_no_target": true, - "condition": { "not": { "u_has_flag": "NO_PSIONICS" } }, + "condition": { "and": [ { "not": { "u_has_flag": "NO_PSIONICS" } }, { "not": { "u_has_effect": "effect_feral_regeneration" } } ] }, "monster_message": "%1$s closes their eyes and their wounds begin healing at a rapid pace!" } ], @@ -1536,7 +1536,7 @@ "spell_data": { "id": "vitakinetic_regeneration_monster" }, "cooldown": { "math": [ "8 + rand(16)" ] }, "allow_no_target": true, - "condition": { "not": { "u_has_flag": "NO_PSIONICS" } }, + "condition": { "and": [ { "not": { "u_has_flag": "NO_PSIONICS" } }, { "not": { "u_has_effect": "effect_feral_regeneration" } } ] }, "monster_message": "%1$s closes their eyes and their wounds begin healing at a rapid pace!" } ], From 0924be5b172fa6ef1b4f2f239f9921791d654048 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 10:08:44 -0600 Subject: [PATCH 091/158] Add font of vitality health down effect --- .../effects/effects_monster.json | 20 +++++++++++++++++++ .../monsters/monster_eoc_attacks.json | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/data/mods/MindOverMatter/effects/effects_monster.json b/data/mods/MindOverMatter/effects/effects_monster.json index 19415d3e02007..791a5d062ddbd 100644 --- a/data/mods/MindOverMatter/effects/effects_monster.json +++ b/data/mods/MindOverMatter/effects/effects_monster.json @@ -358,6 +358,26 @@ }, "vitamins": [ { "vitamin": "iron", "rate": [ [ -10, -10 ] ], "tick": [ "1 m" ] } ] }, + { + "type": "effect_type", + "id": "effect_vitakinetic_healing_down_super", + "name": [ "Feeling Extremely Unwell" ], + "desc": [ "You feel exhausted and shaky." ], + "apply_message": "", + "remove_message": "The feeling of weakness fades away.", + "rating": "bad", + "max_duration": "18 hours", + "base_mods": { + "str_mod": [ -3 ], + "dex_mod": [ -1 ], + "h_mod_min": [ -3 ], + "h_mod_chance": [ 1 ], + "h_mod_chance_bot": [ 4 ], + "h_mod_tick": [ 300 ], + "healing_rate": [ 0.25 ] + }, + "vitamins": [ { "vitamin": "iron", "rate": [ [ -10, -10 ] ], "tick": [ "1 m" ] } ] + }, { "type": "effect_type", "id": "psi_vitakinetic_degeneration", diff --git a/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json b/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json index 73a41384ca1bc..3ca92510931e5 100644 --- a/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json +++ b/data/mods/MindOverMatter/monsters/monster_eoc_attacks.json @@ -26,7 +26,7 @@ "id": "EOC_FERAL_VITAKIN3_ENERVATING_TOUCH", "condition": "npc_is_character", "effect": [ - { "npc_add_effect": "effect_vitakinetic_healing_down", "duration": [ 620000, 1620000 ] }, + { "npc_add_effect": "effect_vitakinetic_healing_down_super", "duration": [ 620000, 1620000 ] }, { "math": [ "n_calories()", "-=", "350" ] }, { "math": [ "n_calories('dont_affect_weariness': true)", "+=", "350" ] } ], From d346ac7adbdf1ca0f4471b7322611c1d5afa61ad Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 10:20:42 -0600 Subject: [PATCH 092/158] Initial commit --- data/mods/Magiclysm/Spells/classless.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/mods/Magiclysm/Spells/classless.json b/data/mods/Magiclysm/Spells/classless.json index e34088fa13d4c..f3ae02127f0d2 100644 --- a/data/mods/Magiclysm/Spells/classless.json +++ b/data/mods/Magiclysm/Spells/classless.json @@ -494,6 +494,9 @@ "type": "effect_on_condition", "id": "EOC_CLASSLESS_CLEAN_CLOTHING_AND_SELF", "effect": [ + { "u_lose_effect": "bile_irritant" }, + { "u_lose_effect": "bile_stink" }, + { "u_lose_effect": "boomered", "target_part": "eyes" }, { "u_lose_effect": "wet" }, { "u_lose_effect": "wet", "target_part": "head" }, { "u_lose_effect": "wet", "target_part": "arm_l" }, From a314eb0a4e10be0c8f672645444149981991aed8 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 10:21:18 -0600 Subject: [PATCH 093/158] Lose morale too --- data/mods/Magiclysm/Spells/classless.json | 1 + 1 file changed, 1 insertion(+) diff --git a/data/mods/Magiclysm/Spells/classless.json b/data/mods/Magiclysm/Spells/classless.json index f3ae02127f0d2..8b35ac711ed0c 100644 --- a/data/mods/Magiclysm/Spells/classless.json +++ b/data/mods/Magiclysm/Spells/classless.json @@ -496,6 +496,7 @@ "effect": [ { "u_lose_effect": "bile_irritant" }, { "u_lose_effect": "bile_stink" }, + { "u_lose_morale": "morale_bile" }, { "u_lose_effect": "boomered", "target_part": "eyes" }, { "u_lose_effect": "wet" }, { "u_lose_effect": "wet", "target_part": "head" }, From 90f6ca6350df1e199fef915723a813fc74e5b0d7 Mon Sep 17 00:00:00 2001 From: George Kightly Date: Thu, 12 Dec 2024 16:42:14 +0000 Subject: [PATCH 094/158] Make long suffix uppercase for Clang --- src/advanced_inv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/advanced_inv.cpp b/src/advanced_inv.cpp index d4cd5c60e9b42..dd5f4476e08e1 100644 --- a/src/advanced_inv.cpp +++ b/src/advanced_inv.cpp @@ -667,9 +667,9 @@ struct advanced_inv_sorter { } case SORTBY_PRICEPERWEIGHT: { const double price_density1 = static_cast( d1.items.front()->price( true ) ) / - static_cast( std::max( 1l, d1.items.front()->weight().value() ) ); + static_cast( std::max( 1L, d1.items.front()->weight().value() ) ); const double price_density2 = static_cast( d2.items.front()->price( true ) ) / - static_cast( std::max( 1l, d2.items.front()->weight().value() ) ); + static_cast( std::max( 1L, d2.items.front()->weight().value() ) ); if( price_density1 != price_density2 ) { return price_density1 > price_density2; } From aba6e34a47f71140bd619141b5be4227399858b4 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 10:48:03 -0600 Subject: [PATCH 095/158] Add str_pl --- data/mods/MindOverMatter/monsters/feral_psychics.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/mods/MindOverMatter/monsters/feral_psychics.json b/data/mods/MindOverMatter/monsters/feral_psychics.json index a315dbf749541..b22abbe78ee78 100644 --- a/data/mods/MindOverMatter/monsters/feral_psychics.json +++ b/data/mods/MindOverMatter/monsters/feral_psychics.json @@ -1449,7 +1449,7 @@ { "id": "mon_feral_human_vita3", "type": "MONSTER", - "name": "font of vitality", + "name": { "str": "font of vitality", "str_pl": "fonts of vitality" }, "description": "This is the healthiest person you've even seen, especially after the end of the world. Their skin positively glows, and as you watch them brush past a jagged chunk of wood to get to you, the wound they receive immediately stops bleeding and rapidly begins to close.", "copy-from": "mon_feral_psion_default", "proportional": { "hp": 1.75 }, @@ -1546,7 +1546,7 @@ { "id": "mon_feral_human_vita3_revived", "type": "MONSTER", - "name": "font of vitality", + "name": { "str": "font of vitality", "str_pl": "fonts of vitality" }, "description": "This is the healthiest person you've even seen, especially after the end of the world. Their skin positively glows, and as you watch them brush past a jagged chunk of wood to get to you, the wound they receive immediately stops bleeding and rapidly begins to close.", "copy-from": "mon_feral_human_vita3", "death_drops": "feral_humans_death_drops_vita", From 9ab9b45c398de8db0d6f59e9b73640a8b68f684f Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:58:39 +0000 Subject: [PATCH 096/158] Add the ability to hide/unhide wall wiring sprite --- data/raw/keybindings.json | 7 +++++++ src/veh_appliance.cpp | 15 +++++++++++++++ src/veh_appliance.h | 5 +++++ src/vehicle.h | 3 +++ src/vehicle_display.cpp | 3 +++ 5 files changed, 33 insertions(+) diff --git a/data/raw/keybindings.json b/data/raw/keybindings.json index 4d005f545b637..389735123a80e 100644 --- a/data/raw/keybindings.json +++ b/data/raw/keybindings.json @@ -1799,6 +1799,13 @@ "name": "Plug in appliance", "bindings": [ { "input_method": "keyboard_any", "key": "g" } ] }, + { + "type": "keybinding", + "id": "HIDE", + "category": "APP_INTERACT", + "name": "Hide/Unhide wiring", + "bindings": [ { "input_method": "keyboard_any", "key": "h" } ] + }, { "type": "keybinding", "id": "DISCONNECT_GRID", diff --git a/src/veh_appliance.cpp b/src/veh_appliance.cpp index cbc5bac267d57..c79d83fcfd24d 100644 --- a/src/veh_appliance.cpp +++ b/src/veh_appliance.cpp @@ -536,6 +536,13 @@ void veh_app_interact::plug() } } +void veh_app_interact::hide() +{ + const int part_idx = veh->part_at( veh->coord_translate( a_point ) ); + vehicle_part &vp = veh->part( part_idx ); + vp.hidden = !vp.hidden; +} + void veh_app_interact::populate_app_actions() { map &here = get_map(); @@ -585,6 +592,14 @@ void veh_app_interact::populate_app_actions() string_format( "%s%s", ctxt.get_action_name( "PLUG" ), //~ An addendum to Plug In's description, as in: Plug in appliance / merge power grid". veh->is_powergrid() ? _( " / merge power grid" ) : "" ) ); +#if defined(TILES) + // Hide + app_actions.emplace_back( [this]() { + hide(); + } ); + imenu.addentry( -1, use_tiles && vp->info().has_flag( flag_WIRING ), + ctxt.keys_bound_to( "HIDE" ).front(), ctxt.get_action_name( "HIDE" ) ); +#endif if( veh->is_powergrid() && veh->part_count() > 1 && !vp->info().has_flag( VPFLAG_WALL_MOUNTED ) ) { // Disconnect from power grid diff --git a/src/veh_appliance.h b/src/veh_appliance.h index 923f6580efe15..e456ade5aac90 100644 --- a/src/veh_appliance.h +++ b/src/veh_appliance.h @@ -139,6 +139,11 @@ class veh_app_interact * Connects the power cable to selected tile. */ void plug(); + /** + * Function associated with the "HIDE" action. + * Hides the selected tiles sprite. + */ + void hide(); /** * The main loop of the appliance UI. Redraws windows, checks for input, and * performs selected actions. The loop exits once an activity is assigned diff --git a/src/vehicle.h b/src/vehicle.h index eb49f8986dc1a..0a680fa1b7634 100644 --- a/src/vehicle.h +++ b/src/vehicle.h @@ -519,6 +519,9 @@ struct vehicle_part { /** door is locked */ bool locked = false; + // If the part's sprite/symbol shouldn't be shown + bool hidden = false; + /** direction the part is facing */ units::angle direction = 0_degrees; diff --git a/src/vehicle_display.cpp b/src/vehicle_display.cpp index bb63d0e400723..7ad79c78a64dd 100644 --- a/src/vehicle_display.cpp +++ b/src/vehicle_display.cpp @@ -66,6 +66,9 @@ vpart_display vehicle::get_display_of_tile( const point_rel_ms &dp, bool rotate, } const vehicle_part &vp = part( part_idx ); + if( vp.hidden ) { + return {}; + } const vpart_info &vpi = vp.info(); auto variant_it = vpi.variants.find( vp.variant ); From af0f2987ecb663489f326ec5ed6fa634fe73669a Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:02:20 +0000 Subject: [PATCH 097/158] Add WIRED_WALL to walls missing it in parametrized_walls_palette --- data/json/furniture_and_terrain/terrain-walls.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/json/furniture_and_terrain/terrain-walls.json b/data/json/furniture_and_terrain/terrain-walls.json index 9a6cb3a9f98fe..7f2c4b700d136 100644 --- a/data/json/furniture_and_terrain/terrain-walls.json +++ b/data/json/furniture_and_terrain/terrain-walls.json @@ -59,7 +59,8 @@ "name": { "str": "abstract concrete wall", "//~": "NO_I18N" }, "description": "Encompasses most concrete-like walls. If you see this in-game, it's a bug.", "roof": "t_concrete_roof", - "color": "light_gray" + "color": "light_gray", + "extend": { "flags": [ "WIRED_WALL" ] } }, { "type": "terrain", @@ -68,7 +69,8 @@ "name": { "str": "abstract brick wall", "//~": "NO_I18N" }, "description": "Encompasses most brick-like walls. If you see this in-game, it's a bug.", "roof": "t_brick_roof", - "color": "brown" + "color": "brown", + "extend": { "flags": [ "WIRED_WALL" ] } }, { "type": "terrain", From 338c0e512b3bc2a350e890a2920554442ccb486f Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 11:20:16 -0600 Subject: [PATCH 098/158] Initial commit --- .../Magiclysm/mutations/fantasy_species.json | 19 ++++++++++++------- data/mods/Magiclysm/professions.json | 2 +- .../Magiclysm/traits/fantasy_species.json | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/data/mods/Magiclysm/mutations/fantasy_species.json b/data/mods/Magiclysm/mutations/fantasy_species.json index 5134eb1941869..a2cffd9cb806b 100644 --- a/data/mods/Magiclysm/mutations/fantasy_species.json +++ b/data/mods/Magiclysm/mutations/fantasy_species.json @@ -330,6 +330,17 @@ "category": [ "SPECIES_ELF" ], "threshreq": [ "THRESH_SPECIES_ELF" ] }, + { + "type": "mutation", + "id": "ELVEN_SIGHT", + "name": { "str": "Elvensight" }, + "points": 2, + "description": "Like a cat, elven eyes are well-attuned to low levels of light, able to pick up even the slightest glimmer. You have greatly-enhanced night vision.", + "types": [ "EYES" ], + "category": [ "SPECIES_ELF" ], + "threshreq": [ "THRESH_SPECIES_ELF" ], + "enchantments": [ { "values": [ { "value": "NIGHT_VIS", "add": 5 } ] } ] + }, { "type": "mutation", "id": "ELVEN_HEARING", @@ -341,7 +352,7 @@ "category": [ "SPECIES_ELF" ], "threshreq": [ "THRESH_SPECIES_ELF" ], "flags": [ "SAFECRACK_NO_TOOL" ], - "enchantments": [ { "values": [ { "value": "HEARING_MULT", "multiply": 5.1 } ] } ] + "enchantments": [ { "values": [ { "value": "HEARING_MULT", "multiply": 2 } ] } ] }, { "type": "mutation", @@ -414,12 +425,6 @@ "copy-from": "DEFT", "extend": { "category": [ "SPECIES_ELF" ] } }, - { - "type": "mutation", - "id": "ELFA_NV", - "copy-from": "ELFA_NV", - "extend": { "category": [ "SPECIES_ELF" ], "threshreq": [ "THRESH_SPECIES_ELF" ] } - }, { "type": "mutation", "id": "ANIMALEMPATH", diff --git a/data/mods/Magiclysm/professions.json b/data/mods/Magiclysm/professions.json index d41fcdbe820c0..c14de0d3145b5 100644 --- a/data/mods/Magiclysm/professions.json +++ b/data/mods/Magiclysm/professions.json @@ -1305,7 +1305,7 @@ "THRESH_SPECIES_ELF", "ANIMALEMPATH2", "ELVEN_BUILD", - "ELFA_NV", + "ELVEN_SIGHT", "ELVEN_BEAUTY", "ELVEN_SLEEP", "ELFA_EARS", diff --git a/data/mods/Magiclysm/traits/fantasy_species.json b/data/mods/Magiclysm/traits/fantasy_species.json index dcf8a184ed4d3..e291257554791 100644 --- a/data/mods/Magiclysm/traits/fantasy_species.json +++ b/data/mods/Magiclysm/traits/fantasy_species.json @@ -11,7 +11,7 @@ "THRESH_SPECIES_ELF", "ANIMALEMPATH2", "ELVEN_BUILD", - "ELFA_NV", + "ELVEN_SIGHT", "ELVEN_BEAUTY", "ELVEN_SLEEP", "ELFA_EARS", From 6b139accf7f7593bb1dfce341ee26f4bb677a75f Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 11:21:08 -0600 Subject: [PATCH 099/158] Type [ EYES ] --- data/mods/Magiclysm/mutations/fantasy_species.json | 1 + 1 file changed, 1 insertion(+) diff --git a/data/mods/Magiclysm/mutations/fantasy_species.json b/data/mods/Magiclysm/mutations/fantasy_species.json index a2cffd9cb806b..13501ae6ad9a5 100644 --- a/data/mods/Magiclysm/mutations/fantasy_species.json +++ b/data/mods/Magiclysm/mutations/fantasy_species.json @@ -564,6 +564,7 @@ "points": 2, "visibility": 2, "ugliness": 1, + "types": [ "EYES" ], "description": "While your reddish eyes have been known to give other people a start, they help you see in the dark. You have much better night vision than a human, even being able to craft in the dark.", "category": [ "SPECIES_GOBLIN" ], "enchantments": [ "ench_goblin_eyes" ], From d8b81004267b0d594ff641bf704182c90be355ce Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:26:22 +0100 Subject: [PATCH 100/158] Pruning the old ``to-hit`` syntax - Part 12 (#78496) * ranged folder * wood and tailoring * stone and misc * glass, metal, and home improvement * get started on tools * clean up the comments in this one or I'll go insane * deployables * the booms * Update throwing.json * please the tests --- data/json/items/ranged/slings.json | 4 +- data/json/items/ranged/throwing.json | 19 ++-- data/json/items/resources/glass.json | 8 +- .../items/resources/home_improvement.json | 6 +- data/json/items/resources/metal.json | 6 +- data/json/items/resources/misc.json | 19 ++-- data/json/items/resources/stone.json | 16 +-- data/json/items/resources/tailoring.json | 6 +- data/json/items/resources/wood.json | 14 +-- data/json/items/tool/cables.json | 8 +- data/json/items/tool/cooking.json | 6 +- data/json/items/tool/deployable.json | 82 ++++++-------- data/json/items/tool/electronics.json | 28 ++--- data/json/items/tool/explosives.json | 105 ++++++++---------- .../TEST_DATA/expected_dps_data/junk_dps.json | 8 +- .../expected_dps_data/knives_dps.json | 1 - .../expected_dps_data/staves_dps.json | 2 +- data/mods/TEST_DATA/legacy_to_hit.json | 92 --------------- 18 files changed, 149 insertions(+), 281 deletions(-) diff --git a/data/json/items/ranged/slings.json b/data/json/items/ranged/slings.json index d2131d67bfe03..ea4ed092c9099 100644 --- a/data/json/items/ranged/slings.json +++ b/data/json/items/ranged/slings.json @@ -81,7 +81,7 @@ "volume": "1375 ml", "longest_side": "150 cm", "price_postapoc": "2 USD 50 cent", - "to_hit": 1, + "to_hit": { "grip": "solid", "length": "long", "surface": "any", "balance": "uneven" }, "ranged_damage": { "damage_type": "bullet", "amount": 10 }, "range": 10, "dispersion": 200, @@ -90,7 +90,7 @@ "valid_mod_locations": [ [ "bore", 1 ] ], "reload": 50, "pocket_data": [ { "pocket_type": "MAGAZINE", "ammo_restriction": { "rock": 1 }, "open_container": true } ], - "melee_damage": { "bash": 16 } + "melee_damage": { "bash": 14 } }, { "id": "wristrocket", diff --git a/data/json/items/ranged/throwing.json b/data/json/items/ranged/throwing.json index 396c87db996b6..15a69bc9255fc 100644 --- a/data/json/items/ranged/throwing.json +++ b/data/json/items/ranged/throwing.json @@ -12,7 +12,6 @@ "material": [ "cotton", "stone" ], "symbol": ";", "color": "blue", - "to_hit": -1, "ammo_type": "thrown", "flags": [ "NOGIB", "TANGLE", "PRIMITIVE_RANGED_WEAPON" ] }, @@ -44,9 +43,7 @@ "description": "A plastic frisbee made for outdoor games.", "material": [ "plastic" ], "volume": "500 ml", - "weight": "175 g", - "thrown_damage": [ { "damage_type": "bash", "amount": 1 } ], - "melee_damage": { "bash": 1 } + "weight": "175 g" }, { "id": "net", @@ -78,9 +75,9 @@ "volume": "500 ml", "weight": "175 g", "longest_side": "30 cm", - "to_hit": -1, - "thrown_damage": [ { "damage_type": "stab", "amount": 16 } ], - "melee_damage": { "cut": 8 } + "to_hit": { "grip": "weapon", "length": "short", "surface": "point", "balance": "neutral" }, + "thrown_damage": [ { "damage_type": "stab", "amount": 12 } ], + "melee_damage": { "cut": 4 } }, { "type": "GENERIC", @@ -97,7 +94,7 @@ "volume": "500 ml", "weight": "300 g", "longest_side": "30 cm", - "to_hit": -1, + "to_hit": { "grip": "weapon", "length": "short", "surface": "point", "balance": "neutral" }, "thrown_damage": [ { "damage_type": "stab", "amount": 18 }, { "damage_type": "bash", "amount": 4 } ], "melee_damage": { "cut": 8 } }, @@ -115,7 +112,7 @@ "volume": "3058 ml", "weight": "1000 g", "longest_side": "43 cm", - "to_hit": -1, + "to_hit": { "grip": "weapon", "length": "short", "surface": "line", "balance": "uneven" }, "weapon_category": [ "HAND_AXES" ], "thrown_damage": [ { "damage_type": "bash", "amount": 6 }, { "damage_type": "cut", "amount": 16 } ], "melee_damage": { "bash": 10, "cut": 17 } @@ -126,7 +123,7 @@ "category": "weapons", "price": "52 USD", "price_postapoc": "5 USD", - "to_hit": { "grip": "none", "length": "hand", "surface": "line", "balance": "neutral" }, + "to_hit": { "grip": "none", "length": "hand", "surface": "point", "balance": "neutral" }, "name": { "str": "throwing knife", "str_pl": "throwing knives" }, "symbol": ";", "color": "light_gray", @@ -138,7 +135,7 @@ "flags": [ "SHEATH_KNIFE", "ALLOWS_BODY_BLOCK" ], "weapon_category": [ "KNIVES" ], "thrown_damage": [ { "damage_type": "stab", "amount": 14 } ], - "melee_damage": { "bash": 1, "stab": 10 } + "melee_damage": { "stab": 10 } }, { "id": "throwing_stick", diff --git a/data/json/items/resources/glass.json b/data/json/items/resources/glass.json index 45f3138c5d0aa..52a43a4809014 100644 --- a/data/json/items/resources/glass.json +++ b/data/json/items/resources/glass.json @@ -18,7 +18,7 @@ "done_message": "You carefully place the shards on the ground, ready to be cracked by something passing by." }, "flags": [ "HURT_WHEN_WIELDED", "TRADER_AVOID", "SINGLE_USE", "FRAGILE_MELEE", "ALLOWS_BODY_BLOCK" ], - "to_hit": -1, + "to_hit": { "grip": "bad", "length": "hand", "surface": "point", "balance": "neutral" }, "melee_damage": { "cut": 6 }, "weapon_category": [ "SHIVS" ] }, @@ -36,7 +36,7 @@ "weight": "6577 g", "volume": "2655 ml", "longest_side": "122 cm", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "use_action": { "type": "place_trap", "trap": "tr_glass", @@ -61,7 +61,7 @@ "weight": "45900 g", "volume": "21200 ml", "longest_side": "122 cm", - "to_hit": -6, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "melee_damage": { "bash": 6 } }, { @@ -94,7 +94,7 @@ "weight": "17514 g", "volume": "7070 ml", "longest_side": "122 cm", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "melee_damage": { "bash": 6 } } ] diff --git a/data/json/items/resources/home_improvement.json b/data/json/items/resources/home_improvement.json index 47dc35d2ee5ca..b76c029c0a965 100644 --- a/data/json/items/resources/home_improvement.json +++ b/data/json/items/resources/home_improvement.json @@ -182,8 +182,7 @@ "price_postapoc": "50 cent", "material": [ "brass", "glass" ], "weight": "5 g", - "volume": "250 ml", - "to_hit": -3 + "volume": "250 ml" }, { "type": "GENERIC", @@ -198,7 +197,6 @@ "price_postapoc": "50 cent", "material": [ "plastic" ], "weight": "25 g", - "volume": "1000 ml", - "to_hit": -3 + "volume": "1000 ml" } ] diff --git a/data/json/items/resources/metal.json b/data/json/items/resources/metal.json index 3df25870fa9be..0bd4b7f74a270 100644 --- a/data/json/items/resources/metal.json +++ b/data/json/items/resources/metal.json @@ -65,7 +65,7 @@ "category": "spare_parts", "weight": "345 g", "longest_side": "60 cm", - "to_hit": -1, + "to_hit": { "grip": "solid", "length": "short", "surface": "any", "balance": "neutral" }, "color": "light_red", "symbol": "/", "material": [ "copper" ], @@ -248,7 +248,7 @@ "//": "Roughly in the 15cm×15cm to 20cm×20cm range. Compact and stacks well, so equally dense as a solid block.", "price": "20 USD", "price_postapoc": "10 cent", - "to_hit": -3, + "to_hit": { "grip": "bad", "length": "hand", "surface": "any", "balance": "clumsy" }, "stack_size": 8, "material": [ "lc_steel" ], "symbol": "]", @@ -288,7 +288,7 @@ "//1": "250ml × 8.0 = 2kg -> 1000g/unit @ stack 2; formed as a solid ingot so weight is 100% of this", "price": "20 USD", "price_postapoc": "50 cent", - "to_hit": -4, + "to_hit": { "grip": "bad", "length": "hand", "surface": "any", "balance": "clumsy" }, "stack_size": 2, "material": [ "steel" ], "symbol": ",", diff --git a/data/json/items/resources/misc.json b/data/json/items/resources/misc.json index 04634ba11313a..b34d570a3ce6e 100644 --- a/data/json/items/resources/misc.json +++ b/data/json/items/resources/misc.json @@ -3,9 +3,9 @@ "type": "GENERIC", "id": "bee_sting", "name": { "str": "bee stinger" }, - "description": "A six-inch stinger from a giant bee. Makes a mediocre melee weapon.", + "description": "A six-inch stinger from a giant bee. Makes a poor melee weapon.", "weight": "540 g", - "to_hit": -1, + "to_hit": { "grip": "bad", "length": "hand", "surface": "point", "balance": "neutral" }, "color": "white", "symbol": ",", "material": [ "flesh" ], @@ -14,7 +14,7 @@ "weapon_category": [ "SHIVS" ], "price": "30 USD", "price_postapoc": "0 cent", - "melee_damage": { "stab": 10 } + "melee_damage": { "stab": 8 } }, { "type": "GENERIC", @@ -23,7 +23,7 @@ "description": "A long-handled broom. Makes a terrible weapon unless you're chasing cats.", "weight": "929 g", "longest_side": "140 cm", - "to_hit": 1, + "to_hit": { "grip": "solid", "length": "long", "surface": "any", "balance": "neutral" }, "color": "yellow", "symbol": "/", "material": [ "wood" ], @@ -57,7 +57,7 @@ "name": { "str": "fungal fighter stinger" }, "description": "A short dart from a fungal fighter. Makes a poor melee weapon.", "weight": "270 g", - "to_hit": -1, + "to_hit": { "grip": "bad", "length": "hand", "surface": "point", "balance": "neutral" }, "color": "green", "symbol": ",", "material": [ "veggy" ], @@ -165,7 +165,7 @@ "weight": "500 g", "volume": "250 ml", "longest_side": "8 cm", - "to_hit": -3, + "to_hit": { "grip": "none", "length": "hand", "surface": "line", "balance": "neutral" }, "qualities": [ [ "CUT", 1 ], [ "BUTCHER", -50 ] ], "flags": [ "ALLOWS_BODY_BLOCK" ], "melee_damage": { "bash": 5, "cut": 3 }, @@ -228,8 +228,7 @@ "price_postapoc": "2 USD 50 cent", "material": [ "plastic", "steel" ], "weight": "600 g", - "volume": "250 ml", - "to_hit": 1 + "volume": "250 ml" }, { "type": "GENERIC", @@ -237,7 +236,7 @@ "name": { "str": "wasp stinger" }, "description": "A six-inch stinger from a giant wasp. Makes a poor melee weapon.", "weight": "540 g", - "to_hit": -1, + "to_hit": { "grip": "bad", "length": "hand", "surface": "point", "balance": "neutral" }, "color": "dark_gray", "symbol": ",", "material": [ "flesh" ], @@ -258,7 +257,7 @@ "material": [ "steel" ], "weight": "1814 g", "volume": "200 ml", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "hand", "surface": "any", "balance": "clumsy" }, "flags": [ "TRADER_AVOID" ], "melee_damage": { "bash": 15 } }, diff --git a/data/json/items/resources/stone.json b/data/json/items/resources/stone.json index b1aa6ad350aef..0941b4f560bba 100644 --- a/data/json/items/resources/stone.json +++ b/data/json/items/resources/stone.json @@ -17,7 +17,7 @@ "range": 10, "dispersion": 14, "loudness": 0, - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "neutral" }, "recovery_chance": 98, "effects": [ "NEVER_MISFIRES", "NON_FOULING" ], "melee_damage": { "bash": 7 } @@ -85,7 +85,7 @@ "material": [ "stone" ], "volume": "250 ml", "longest_side": "40 cm", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "uneven" }, "melee_damage": { "bash": 7 } }, { @@ -101,8 +101,8 @@ "price_postapoc": "20 cent", "material": [ "stone" ], "volume": "36 L", - "longest_side": "2000 cm", - "to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" }, + "longest_side": "200 cm", + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "melee_damage": { "bash": 28 } }, { @@ -119,8 +119,8 @@ "material": [ "stone" ], "volume": "250 ml", "longest_side": "40 cm", - "to_hit": -1, - "melee_damage": { "bash": 7 } + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "uneven" }, + "melee_damage": { "bash": 5 } }, { "type": "GENERIC", @@ -135,8 +135,8 @@ "price_postapoc": "20 cent", "material": [ "stone" ], "volume": "36 L", - "longest_side": "2000 cm", - "to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" }, + "longest_side": "200 cm", + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "melee_damage": { "bash": 28 } } ] diff --git a/data/json/items/resources/tailoring.json b/data/json/items/resources/tailoring.json index 65c1166d00842..581fceccb09d9 100644 --- a/data/json/items/resources/tailoring.json +++ b/data/json/items/resources/tailoring.json @@ -259,8 +259,7 @@ "flags": [ "NO_SALVAGE" ], "weight": "40 g", "volume": "125 ml", - "category": "spare_parts", - "to_hit": -1 + "category": "spare_parts" }, { "type": "GENERIC", @@ -310,8 +309,7 @@ "flags": [ "NO_SALVAGE" ], "weight": "372 g", "volume": "465 ml", - "category": "spare_parts", - "to_hit": -1 + "category": "spare_parts" }, { "type": "GENERIC", diff --git a/data/json/items/resources/wood.json b/data/json/items/resources/wood.json index fb72dc08658d2..d7c4bd79e45c4 100644 --- a/data/json/items/resources/wood.json +++ b/data/json/items/resources/wood.json @@ -13,7 +13,7 @@ "weight": "30 kg", "volume": "50 L", "longest_side": "140 cm", - "to_hit": -10, + "to_hit": { "grip": "none", "length": "long", "surface": "any", "balance": "clumsy" }, "flags": [ "FIREWOOD" ], "melee_damage": { "bash": 10 } }, @@ -29,11 +29,11 @@ "weight": "150 g", "volume": "250 ml", "longest_side": "30 cm", - "to_hit": 1, + "to_hit": { "grip": "bad", "length": "hand", "surface": "any", "balance": "neutral" }, "qualities": [ [ "COOK", 1 ] ], "use_action": [ "HEAT_SOLID_ITEMS" ], "flags": [ "NO_SALVAGE", "TRADER_AVOID", "FIREWOOD" ], - "melee_damage": { "bash": 4 } + "melee_damage": { "bash": 2 } }, { "type": "GENERIC", @@ -363,7 +363,7 @@ "category": "spare_parts", "weight": "12 kg", "longest_side": "122 cm", - "to_hit": 1, + "to_hit": { "grip": "none", "length": "long", "surface": "any", "balance": "clumsy" }, "color": "brown", "looks_like": "2x4", "symbol": "H", @@ -383,7 +383,7 @@ "//": "Weight and volume assumes 32 square feet of 1/2 inch plywood. Due to its enormously bulky shape, volume is higher than actual displacement volume", "category": "spare_parts", "weight": "24 kg", - "to_hit": 1, + "to_hit": { "grip": "none", "length": "long", "surface": "any", "balance": "clumsy" }, "color": "brown", "symbol": "H", "material": [ "wood" ], @@ -402,8 +402,8 @@ "description": "A giant screw carved out of solid wood, a simple component used to convert rotational energy into a downward movement of greater force.", "category": "spare_parts", "//": "weight for a bit less than 3x3x4 wooden beam at 0.60 g/cm3 density, substracted from wood beam stats above", - "weight": "15000 g", - "volume": "25000 ml", + "weight": "15 kg", + "volume": "25 L", "longest_side": "120 cm", "color": "brown", "symbol": "§", diff --git a/data/json/items/tool/cables.json b/data/json/items/tool/cables.json index 9435841dbc0de..282cc00264141 100644 --- a/data/json/items/tool/cables.json +++ b/data/json/items/tool/cables.json @@ -5,7 +5,6 @@ "name": { "str": "power cord" }, "description": "A power cord, like you've seen many times before: it's a short multi-stranded copper cord with a power outlet at the end.", "//": "This cable is automatically handled by vehicles/appliances and is used for connecting them to each other. See vehicle part in furniture_and_terrain > appliances.json", - "to_hit": 1, "color": "dark_gray", "symbol": "&", "material": [ "copper", "plastic" ], @@ -17,8 +16,7 @@ "max_charges": 2, "initial_charges": 2, "use_action": { "type": "link_up", "menu_text": "Plug in / Manage connections", "targets": [ "vehicle_port" ] }, - "flags": [ "CABLE_SPOOL", "NO_DROP", "SINGLE_USE" ], - "melee_damage": { "bash": 2 } + "flags": [ "CABLE_SPOOL", "NO_DROP", "SINGLE_USE" ] }, { "type": "TOOL", @@ -62,7 +60,7 @@ "id": "extension_cable", "name": { "str": "extension cord" }, "description": "A long 30-foot (or about 10 m) orange extension cord for extending cables or connecting appliances. Could be used on any appliance or other household electrical system.", - "to_hit": 1, + "to_hit": { "grip": "bad", "length": "long", "surface": "line", "balance": "good" }, "color": "light_blue", "symbol": "&", "material": [ "copper", "plastic" ], @@ -99,7 +97,7 @@ "id": "hd_tow_cable", "name": { "str": "heavy-duty tow cable" }, "description": "An extremely heavy-duty 30-foot (or about 9 m) tow cable made from thick steel wire coated in plastic. If attached to a vehicle, it could be used to pull another vehicle of any weight.", - "to_hit": -1, + "to_hit": { "grip": "bad", "length": "long", "surface": "line", "balance": "good" }, "color": "light_blue", "symbol": "&", "material": [ "steel", "plastic" ], diff --git a/data/json/items/tool/cooking.json b/data/json/items/tool/cooking.json index 84cf1f7a93903..2cf2fba4c235e 100644 --- a/data/json/items/tool/cooking.json +++ b/data/json/items/tool/cooking.json @@ -71,7 +71,7 @@ "type": "TOOL", "name": { "str": "electric carver (off)", "str_pl": "electric carvers (off)" }, "description": "An electric meat carver powered by cord. It has two serrated blades that vibrate together to slice just about anything from turkey to ham… even zombies!", - "//": "https://www.amazon.com/dp/B07CDR4KFM", + "//": "Based on https://www.amazon.com/dp/B07CDR4KFM", "to_hit": { "grip": "solid", "length": "short", "surface": "line", "balance": "good" }, "weight": "680 g", "volume": "1500 ml", @@ -854,7 +854,7 @@ "weight": "1360 g", "volume": "12585 ml", "longest_side": "30 cm", - "//": "size, weight, pricing, power, etc. was based on https://www.amazon.com/Hawaiian-Shaved-Ice-S900A-Machine/dp/B004UBMRKG/ref=asc_df_B004UBMRKG", + "//": "size, weight, pricing, power, etc. was based on https://www.amazon.com/dp/B004UBMRKG", "price": "50 USD", "price_postapoc": "1 USD 50 cent", "to_hit": { "grip": "bad", "length": "hand", "surface": "any", "balance": "clumsy" }, @@ -1013,7 +1013,7 @@ "color": "dark_gray", "qualities": [ [ "COOK", 1 ] ], "use_action": [ "HEAT_SOLID_ITEMS" ], - "//": "Based on: https://www.amazon.com/Noxious-Additives-Material-Sandwich-Breakfast/dp/B07WWW1S84/ref=sr_1_1?crid=QSRJMOJRQ89G&keywords=manual+waffle+iron&qid=1680812963&sprefix=manualwaffle+iron%2Caps%2C183&sr=8-1", + "//": "Based on https://www.amazon.com/dp/B07WWW1S84", "melee_damage": { "bash": 10 } }, { diff --git a/data/json/items/tool/deployable.json b/data/json/items/tool/deployable.json index 04a701542c8e4..503fb38c957ce 100644 --- a/data/json/items/tool/deployable.json +++ b/data/json/items/tool/deployable.json @@ -76,7 +76,7 @@ "type": "TOOL", "name": { "str": "fire barrel (200 L)", "str_pl": "fire barrels (200 L)" }, "description": "A large metal barrel used to contain a fire. It has multiple holes punched in its walls for air supply. Fires set in a fire barrel will not spread to surrounding flammable objects.", - "weight": "20000 g", + "weight": "20 kg", "volume": "200 L", "longest_side": "100 cm", "//": "values based on real world 55 gallon metal barrel", @@ -95,7 +95,7 @@ "type": "TOOL", "name": { "str": "fire barrel (100 L)", "str_pl": "fire barrels (100 L)" }, "description": "A large metal barrel used to contain a fire. It has multiple holes punched in its walls for air supply. Fires set in a fire barrel will not spread to surrounding flammable objects.", - "weight": "15000 g", + "weight": "15 kg", "volume": "100 L", "longest_side": "85 cm", "//": "values based on real world 30 gal metal barrel", @@ -120,13 +120,14 @@ "//": "values based on basic real world folding camp chair", "price": "50 USD", "price_postapoc": "1 USD", - "to_hit": -4, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "looks_like": "rollmat", - "material": [ { "type": "steel", "portion": 975 }, { "type": "cotton", "portion": 25 } ], + "material": [ { "type": "steel", "portion": 39 }, { "type": "cotton", "portion": 1 } ], "symbol": "#", "color": "light_gray", "use_action": { "type": "deploy_furn", "furn_type": "f_camp_chair" }, - "flags": [ "FRAGILE_MELEE" ] + "flags": [ "FRAGILE_MELEE" ], + "melee_damage": { "bash": 3 } }, { "id": "deck_chair", @@ -138,12 +139,13 @@ "longest_side": "120 cm", "price": "70 USD", "price_postapoc": "1 USD", - "to_hit": -4, - "material": [ { "type": "wood", "portion": 90 }, { "type": "cotton", "portion": 10 } ], + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, + "material": [ { "type": "wood", "portion": 9 }, { "type": "cotton", "portion": 1 } ], "symbol": "#", "color": "brown", "use_action": { "type": "deploy_furn", "furn_type": "f_deckchair" }, - "flags": [ "FRAGILE_MELEE" ] + "flags": [ "FRAGILE_MELEE" ], + "melee_damage": { "bash": 3 } }, { "id": "chair_folding", @@ -155,12 +157,13 @@ "longest_side": "88 cm", "price": "23 USD 50 cent", "price_postapoc": "1 USD", - "to_hit": -4, - "material": [ { "type": "plastic", "portion": 60 }, { "type": "steel" } ], + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, + "material": [ { "type": "plastic", "portion": 6 }, { "type": "steel", "portion": 4 } ], "symbol": "#", "color": "light_gray", "use_action": { "type": "deploy_furn", "furn_type": "f_chair_folding" }, - "flags": [ "FRAGILE_MELEE" ] + "flags": [ "FRAGILE_MELEE" ], + "melee_damage": { "bash": 3 } }, { "id": "xedra_antenna", @@ -172,7 +175,7 @@ "longest_side": "90 cm", "price": "50 USD", "price_postapoc": "1 USD", - "to_hit": -3, + "to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" }, "looks_like": "directional_antenna", "material": [ "steel" ], "symbol": "i", @@ -190,7 +193,7 @@ "longest_side": "100 cm", "price": "75 USD", "price_postapoc": "5 USD", - "to_hit": -1, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ "aluminum", "cotton" ], "symbol": ";", "color": "green", @@ -210,12 +213,12 @@ "type": "TOOL", "name": { "str": "metal butchering rack" }, "description": "A metal butchering rack designed to hang a carcass in the air. It is folded for easy transportation.", - "weight": "5000 g", + "weight": "5 kg", "volume": "10 L", "longest_side": "60 cm", "price": "50 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -4, + "to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "=", "color": "light_gray", @@ -227,12 +230,12 @@ "type": "TOOL", "name": { "str": "metal smoking rack" }, "description": "A metal rack designed to smoke food for better preservation and taste. It is folded for easy transportation.", - "weight": "5000 g", + "weight": "5 kg", "volume": "25 L", "longest_side": "90 cm", "price": "50 USD", "price_postapoc": "7 USD 50 cent", - "to_hit": -4, + "to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "=", "color": "light_gray", @@ -250,7 +253,7 @@ "//": "values based on real world collapsible camping table", "price": "50 USD", "price_postapoc": "1 USD", - "to_hit": -3, + "to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "=", "color": "light_gray", @@ -262,34 +265,30 @@ "type": "TOOL", "name": { "str": "leather tarp" }, "description": "A large sheet of leather. You could use it as a picnic blanket, but it's more valuable as a surface for butchering as it does not soak up blood. It's rolled and ready for carrying.", - "weight": "2000 g", + "weight": "2 kg", "volume": "2500 ml", "price": "50 USD", "price_postapoc": "5 USD", - "to_hit": -3, "material": [ "leather" ], "qualities": [ [ "SURFACE", 3 ] ], "symbol": "*", "color": "brown", - "use_action": { "type": "deploy_furn", "furn_type": "f_leather_tarp" }, - "melee_damage": { "bash": 2 } + "use_action": { "type": "deploy_furn", "furn_type": "f_leather_tarp" } }, { "id": "fiber_mat", "type": "TOOL", "name": { "str": "fiber mat" }, "description": "A large mat woven from fibrous material. You could use it as a picnic blanket, but it's more valuable as a surface for butchering. Too thin to be used as a comfortable sleeping mat. It's rolled and ready for carrying.", - "weight": "1000 g", + "weight": "1 kg", "volume": "2500 ml", "price": "10 USD", "price_postapoc": "1 USD", - "to_hit": -3, "material": [ "veggy" ], "qualities": [ [ "SURFACE", 3 ] ], "symbol": "*", "color": "yellow", - "use_action": { "type": "deploy_furn", "furn_type": "f_fiber_mat" }, - "melee_damage": { "bash": 1 } + "use_action": { "type": "deploy_furn", "furn_type": "f_fiber_mat" } }, { "id": "churn", @@ -300,7 +299,7 @@ "volume": "11356 ml", "price": "50 USD", "price_postapoc": "10 USD", - "to_hit": -4, + "to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "wood" ], "looks_like": "f_wood_keg", "symbol": "u", @@ -313,51 +312,42 @@ "type": "TOOL", "name": { "str": "water mill" }, "description": "A small water-powered mill that can convert starchy products into flour. Needs to be placed via the construction menu.", - "weight": "120000 g", + "weight": "120 kg", "volume": "22500 ml", "longest_side": "150 cm", "price": "1 kUSD", "price_postapoc": "15 USD", - "to_hit": -5, "material": [ "wood" ], "symbol": "*", - "color": "red", - "flags": [ "DURABLE_MELEE" ], - "melee_damage": { "bash": 40 } + "color": "red" }, { "id": "wind_mill", "type": "TOOL", "name": { "str": "wind mill" }, "description": "A small wind-powered mill that can convert starchy products into flour. Needs to be placed via the construction menu.", - "weight": "120000 g", + "weight": "120 kg", "volume": "22500 ml", "longest_side": "150 cm", "price": "1 kUSD", "price_postapoc": "15 USD", - "to_hit": -5, "material": [ "steel" ], "symbol": "T", - "color": "red", - "flags": [ "DURABLE_MELEE" ], - "melee_damage": { "bash": 40 } + "color": "red" }, { "id": "screw_press_tool", "type": "TOOL", "name": { "str": "screw press", "str_pl": "screw presses" }, "description": "A large screw press for manually pressing oil out of fruit or seed paste. Needs to be placed via the construction menu.", - "weight": "70000 g", + "weight": "70 kg", "volume": "100 L", "longest_side": "250 cm", "price": "1 kUSD", "price_postapoc": "15 USD", - "to_hit": -5, "material": [ "wood" ], "symbol": "T", - "color": "red", - "flags": [ "DURABLE_MELEE" ], - "melee_damage": { "bash": 40 } + "color": "red" }, { "id": "beverly_shear", @@ -370,7 +360,7 @@ "longest_side": "100 cm", "price": "100 USD", "price_postapoc": "15 USD", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "7", "color": "yellow_red", @@ -383,16 +373,14 @@ "name": { "str": "manual tire changer" }, "description": "A floor-mounted machine containing all the levers, clamps, and mounts required to remove or fit a tire, plus an integrated foot pump to inflate it.", "//": "Based on the Redline TC500M Manual Tire Changer", - "weight": "162000 g", + "weight": "162 kg", "volume": "100 L", "longest_side": "110 cm", "price": "100 USD", "price_postapoc": "15 USD", - "to_hit": -10, "material": [ "steel" ], "symbol": "7", "color": "yellow_red", - "use_action": { "type": "deploy_furn", "furn_type": "f_manual_tire_changer" }, - "melee_damage": { "bash": 8 } + "use_action": { "type": "deploy_furn", "furn_type": "f_manual_tire_changer" } } ] diff --git a/data/json/items/tool/electronics.json b/data/json/items/tool/electronics.json index 7664484088f3d..16932cece5cdd 100644 --- a/data/json/items/tool/electronics.json +++ b/data/json/items/tool/electronics.json @@ -94,7 +94,6 @@ "longest_side": "60 cm", "price": "8 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": 1, "material": [ "copper", "wood" ], "symbol": ",", "color": "light_gray", @@ -109,7 +108,6 @@ "volume": "500 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -8, "material": [ "plastic", "steel" ], "symbol": ";", "color": "white", @@ -118,8 +116,7 @@ "use_action": [ "EHANDCUFFS" ], "tick_action": [ "EHANDCUFFS_TICK" ], "//": "Don't add ELECTRONIC flag here, since these handcuffs have their own behavior when affected by EMP blast", - "flags": [ "ALWAYS_TWOHAND", "TRADER_AVOID", "WATER_BREAK" ], - "melee_damage": { "cut": 1 } + "flags": [ "ALWAYS_TWOHAND", "TRADER_AVOID", "WATER_BREAK" ] }, { "id": "eink_tablet_pc", @@ -132,8 +129,7 @@ "longest_side": "158 mm", "price": "85 USD", "price_postapoc": "10 cent", - "to_hit": { "grip": "bad", "length": "hand", "surface": "line", "balance": "neutral" }, - "material": [ { "type": "aluminum", "portion": 75 }, { "type": "plastic", "portion": 25 } ], + "material": [ { "type": "aluminum", "portion": 3 }, { "type": "plastic", "portion": 1 } ], "symbol": ";", "color": "blue", "ammo": [ "battery" ], @@ -200,7 +196,6 @@ "volume": "478 ml", "price": "340 USD", "price_postapoc": "2 USD", - "to_hit": { "grip": "bad", "length": "hand", "surface": "line", "balance": "uneven" }, "material": [ "plastic", "aluminum" ], "ascii_picture": "electrohack", "symbol": ",", @@ -215,7 +210,6 @@ "default_magazine": "medium_battery_cell" } ], - "melee_damage": { "bash": 5 }, "charges_per_use": 1, "qualities": [ [ "HACK", 2 ] ] }, @@ -465,7 +459,7 @@ "volume": "1 L", "price": "0 cent", "price_postapoc": "50 cent", - "to_hit": -1, + "to_hit": { "grip": "solid", "length": "hand", "surface": "any", "balance": "neutral" }, "material": [ "plastic", "aluminum" ], "symbol": ";", "color": "yellow", @@ -487,7 +481,7 @@ "default_magazine": "light_battery_cell" } ], - "melee_damage": { "bash": 6 } + "melee_damage": { "bash": 2 } }, { "id": "noise_emitter_on", @@ -518,7 +512,7 @@ "volume": "355 ml", "price": "0 cent", "price_postapoc": "50 cent", - "to_hit": { "grip": "solid", "length": "hand", "surface": "point", "balance": "neutral" }, + "to_hit": { "grip": "solid", "length": "hand", "surface": "any", "balance": "neutral" }, "material": [ "plastic", "aluminum" ], "symbol": ";", "color": "yellow", @@ -540,7 +534,7 @@ "default_magazine": "medium_battery_cell" } ], - "melee_damage": { "bash": 6 } + "melee_damage": { "bash": 2 } }, { "id": "emf_detector_on", @@ -693,7 +687,7 @@ "volume": "2500 ml", "price": "2 kUSD 800 USD", "price_postapoc": "15 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "uneven" }, "material": [ "aluminum", "plastic" ], "symbol": ";", "color": "light_gray", @@ -718,7 +712,7 @@ "volume": "2500 ml", "price": "2 kUSD 800 USD", "price_postapoc": "15 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "uneven" }, "material": [ "aluminum", "plastic" ], "symbol": ";", "color": "light_gray", @@ -751,7 +745,7 @@ "volume": "2500 ml", "price": "2 kUSD 800 USD", "price_postapoc": "15 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "uneven" }, "material": [ "aluminum", "plastic" ], "symbol": ";", "color": "light_gray", @@ -820,7 +814,7 @@ "volume": "2500 ml", "price": "2 kUSD 800 USD", "price_postapoc": "15 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "uneven" }, "material": [ "aluminum", "plastic" ], "symbol": ";", "color": "light_gray", @@ -868,7 +862,7 @@ "name": { "str": "super noise emitter (off)", "str_pl": "super noise emitters (off)" }, "description": "This is a noisemaker that has been further enhanced with a series of amplifiers. It's about as loud something can get without making you vomit from sound-induced nausea, and it's as sure to attract every zombie in town as it is to give you permanent hearing damage.", "//": "I estimate this thing is about 130 decibels. Commercial amps can hit similar noise levels at a 100-200w of power input, the survivor's is less efficient.", - "weight": "6000 g", + "weight": "6 kg", "volume": "4 L", "longest_side": "30 cm", "price": "0 cent", diff --git a/data/json/items/tool/explosives.json b/data/json/items/tool/explosives.json index ace22dfcff91d..7a426aabb6233 100644 --- a/data/json/items/tool/explosives.json +++ b/data/json/items/tool/explosives.json @@ -9,7 +9,7 @@ "volume": "1 L", "price": "90 USD", "price_postapoc": "20 USD", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "rdx" ], "symbol": ";", "color": "light_gray", @@ -25,7 +25,7 @@ "weight": "1570 g", "volume": "1 L", "price": "0 cent", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "rdx" ], "symbol": ";", "color": "light_gray", @@ -44,7 +44,7 @@ "volume": "750 ml", "price": "60 USD", "price_postapoc": "10 USD", - "to_hit": -3, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ { "type": "tnt", "portion": 95 }, { "type": "paper", "portion": 5 } ], "symbol": "*", "color": "red", @@ -85,7 +85,7 @@ "volume": "2430 ml", "price": "60 USD", "price_postapoc": "15 USD", - "to_hit": -3, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ { "type": "tnt", "portion": 95 }, { "type": "steel", "portion": 40 }, { "type": "paper", "portion": 5 } ], "symbol": "*", "color": "red", @@ -125,7 +125,7 @@ "volume": "15500 ml", "price": "600 USD", "price_postapoc": "30 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "*", "explode_in_fire": true, @@ -152,7 +152,7 @@ "volume": "15500 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "*", "explode_in_fire": true, @@ -178,12 +178,10 @@ "volume": "25 ml", "price": "4 cent", "price_postapoc": "10 cent", - "to_hit": -3, "material": [ "paper" ], "symbol": ";", "color": "red", - "use_action": [ "FIRECRACKER" ], - "melee_damage": { "bash": 1 } + "use_action": [ "FIRECRACKER" ] }, { "id": "firecracker_act", @@ -194,14 +192,12 @@ "volume": "10 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -3, "material": [ "paper" ], "symbol": ";", "color": "red", "tick_action": [ { "type": "sound", "sound_message": "ssss…", "sound_volume": 0, "sound_id": "misc", "sound_variant": "lit_fuse" } ], "countdown_action": { "type": "sound", "sound_message": "Bang!", "sound_volume": 20, "sound_id": "explosion", "sound_variant": "small" }, - "flags": [ "TRADER_AVOID" ], - "melee_damage": { "bash": 1 } + "flags": [ "TRADER_AVOID" ] }, { "id": "firecracker_pack", @@ -212,12 +208,10 @@ "volume": "50 ml", "price": "1 USD", "price_postapoc": "1 USD", - "to_hit": -3, "material": [ "paper" ], "symbol": "*", "color": "red", - "use_action": [ "FIRECRACKER_PACK" ], - "melee_damage": { "bash": 1 } + "use_action": [ "FIRECRACKER_PACK" ] }, { "id": "firecracker_pack_act", @@ -228,7 +222,6 @@ "volume": "250 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -3, "material": [ "paper" ], "symbol": "*", "color": "red", @@ -245,7 +238,7 @@ "volume": "270 ml", "price": "20 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": "*", "color": "dark_gray", @@ -258,7 +251,7 @@ "type": "transform" }, "flags": [ "RADIO_MODABLE", "RADIO_INVOKE_PROC", "BOMB", "GRENADE" ], - "melee_damage": { "bash": 5 } + "melee_damage": { "bash": 1 } }, { "id": "flashbang_act", @@ -352,7 +345,7 @@ "volume": "270 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "*", "color": "dark_gray", @@ -378,7 +371,7 @@ "volume": "540 ml", "price": "15 USD", "price_postapoc": "10 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": "*", "color": "green", @@ -391,7 +384,7 @@ "type": "transform" }, "flags": [ "RADIO_MODABLE", "RADIO_INVOKE_PROC", "BOMB", "GRENADE" ], - "melee_damage": { "bash": 6 } + "melee_damage": { "bash": 2 } }, { "id": "grenade_act", @@ -403,7 +396,7 @@ "volume": "270 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": "*", "color": "green", @@ -411,7 +404,7 @@ "countdown_action": { "type": "explosion", "explosion": { "power": 240, "shrapnel": { "casing_mass": 217, "fragment_mass": 0.02 } } }, "countdown_interval": "5 seconds", "flags": [ "BOMB", "TRADER_AVOID", "DANGEROUS" ], - "melee_damage": { "bash": 6 } + "melee_damage": { "bash": 2 } }, { "id": "grenade_emp", @@ -424,7 +417,7 @@ "price": "60 USD", "//": "Something this useful doesn't come cheap after the apocalypse", "price_postapoc": "40 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": "*", "looks_like": "EMPbomb", @@ -438,7 +431,7 @@ "type": "transform" }, "flags": [ "RADIO_MODABLE", "RADIO_INVOKE_PROC", "BOMB", "GRENADE", "WATER_BREAK" ], - "melee_damage": { "bash": 5 } + "melee_damage": { "bash": 2 } }, { "id": "grenade_emp_act", @@ -450,7 +443,7 @@ "volume": "270 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": "*", "color": "cyan", @@ -464,7 +457,7 @@ "emp_blast_radius": 4 }, "flags": [ "TRADER_AVOID", "WATER_BREAK" ], - "melee_damage": { "bash": 5 } + "melee_damage": { "bash": 2 } }, { "id": "grenade_inc", @@ -476,7 +469,7 @@ "volume": "270 ml", "price": "20 USD", "price_postapoc": "15 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel" ], "symbol": "*", "color": "light_red", @@ -489,7 +482,7 @@ "type": "transform" }, "flags": [ "RADIO_MODABLE", "RADIO_INVOKE_PROC", "BOMB", "ACT_IN_FIRE", "GRENADE" ], - "melee_damage": { "bash": 6 } + "melee_damage": { "bash": 1 } }, { "id": "grenade_inc_act", @@ -501,14 +494,14 @@ "volume": "270 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel" ], "symbol": "*", "color": "light_red", "revert_to": "canister_empty", "countdown_action": "GRENADE_INC_ACT", "flags": [ "ACT_IN_FIRE", "BOMB", "TRADER_AVOID", "DANGEROUS" ], - "melee_damage": { "bash": 6 } + "melee_damage": { "bash": 1 } }, { "id": "gasbomb", @@ -641,7 +634,7 @@ "longest_side": "46 cm", "price": "1 kUSD 800 USD", "price_postapoc": "100 USD", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "aluminum", "nylon" ], "symbol": "*", "color": "light_green", @@ -688,7 +681,7 @@ "longest_side": "276 mm", "price": "5 USD", "price_postapoc": "5 USD", - "to_hit": 1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "glass", "cotton" ], "symbol": "*", "color": "light_gray", @@ -716,7 +709,7 @@ "longest_side": "276 mm", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": 1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "glass", "cotton" ], "symbol": "*", "color": "light_gray", @@ -735,7 +728,7 @@ "price": "60 USD", "//": "Something this useful doesn't come cheap after the apocalypse", "price_postapoc": "50 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": "*", "color": "yellow", @@ -748,7 +741,7 @@ "type": "transform" }, "flags": [ "RADIO_MODABLE", "RADIO_INVOKE_PROC", "BOMB", "GRENADE" ], - "melee_damage": { "bash": 5 } + "melee_damage": { "bash": 2 } }, { "id": "scrambler_act", @@ -760,14 +753,14 @@ "volume": "270 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": "*", "color": "yellow", "use_action": { "type": "message", "message": "You've already pulled the %s's pin, try throwing it instead.", "name": "Pull pin" }, "countdown_action": { "type": "explosion", "draw_explosion_radius": 4, "draw_explosion_color": "cyan", "scrambler_blast_radius": 4 }, "flags": [ "TRADER_AVOID" ], - "melee_damage": { "bash": 5 } + "melee_damage": { "bash": 2 } }, { "id": "smokebomb", @@ -926,7 +919,7 @@ "longest_side": "229 mm", "price": "30 USD", "price_postapoc": "30 USD", - "to_hit": 1, + "to_hit": { "grip": "solid", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel" ], "symbol": "*", "color": "light_gray", @@ -939,7 +932,7 @@ "type": "transform" }, "flags": [ "RADIO_MODABLE", "RADIO_INVOKE_PROC", "BOMB", "NPC_ACTIVATE" ], - "melee_damage": { "bash": 5 } + "melee_damage": { "bash": 4 } }, { "id": "military_explosive_pipebomb_act", @@ -1003,7 +996,7 @@ "weight": "92600 g", "volume": "52500 ml", "price": "450 USD", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "(", "color": "red", @@ -1029,7 +1022,7 @@ "weight": "92600 g", "volume": "52500 ml", "price": "0 cent", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "(", "color": "light_red", @@ -1046,10 +1039,10 @@ "category": "weapons", "name": { "str": "military explosive 100 L barrel bomb" }, "description": "A 100 L metal barrel filled with military explosives. Once it has been activated it will explode after 100 seconds, raining fire and steel on everything in sight.", - "weight": "172000 g", + "weight": "172 kg", "volume": "105 L", "price": "900 USD", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "(", "color": "red", @@ -1071,10 +1064,10 @@ "category": "weapons", "name": { "str": "active military explosive 100 L barrel bomb" }, "description": "A 100 L metal barrel filled with military explosives. It has been activated and will soon explode, delivering its entire destructive power to everything in sight.", - "weight": "172000 g", + "weight": "172 kg", "volume": "105 L", "price": "0 cent", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "(", "color": "light_red", @@ -1169,7 +1162,7 @@ "volume": "280 ml", "price": "15 USD", "longest_side": "229 mm", - "to_hit": 1, + "to_hit": { "grip": "solid", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel" ], "symbol": "*", "color": "light_gray", @@ -1185,7 +1178,7 @@ "type": "transform" }, "flags": [ "RADIO_MODABLE", "RADIO_INVOKE_PROC", "BOMB", "NPC_ACTIVATE" ], - "melee_damage": { "bash": 5 } + "melee_damage": { "bash": 3 } }, { "id": "pipebomb_act", @@ -1198,7 +1191,7 @@ "volume": "280 ml", "longest_side": "229 mm", "price": "0 cent", - "to_hit": 1, + "to_hit": { "grip": "solid", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel" ], "symbol": "*", "color": "light_gray", @@ -1207,7 +1200,7 @@ "explosion": { "power": 300, "shrapnel": { "casing_mass": 410, "fragment_mass": 0.5 } }, "countdown_action": { "type": "explosion", "explosion": { "power": 300, "shrapnel": { "casing_mass": 410, "fragment_mass": 0.5 } } }, "flags": [ "BOMB", "TRADER_AVOID", "DANGEROUS" ], - "melee_damage": { "bash": 5 } + "melee_damage": { "bash": 3 } }, { "id": "homemade_bomb", @@ -1263,7 +1256,7 @@ "weight": "3875 g", "volume": "3900 ml", "price": "0 cent", - "to_hit": -3, + "to_hit": { "grip": "bad", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "plastic", "powder" ], "symbol": "*", "color": "red", @@ -1290,7 +1283,7 @@ "volume": "3900 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -3, + "to_hit": { "grip": "bad", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "plastic", "powder" ], "symbol": "*", "color": "red", @@ -1310,7 +1303,7 @@ "weight": "61620 g", "volume": "52500 ml", "price": "1 kUSD", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "(", "color": "red", @@ -1335,7 +1328,7 @@ "weight": "61620 g", "volume": "52500 ml", "price": "0 cent", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "(", "color": "light_red", @@ -1359,7 +1352,7 @@ "weight": "110610 g", "volume": "105 L", "price": "900 USD", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "(", "color": "red", @@ -1384,7 +1377,7 @@ "weight": "110610 g", "volume": "105 L", "price": "0 cent", - "to_hit": -5, + "to_hit": { "grip": "bad", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "(", "color": "light_red", diff --git a/data/mods/TEST_DATA/expected_dps_data/junk_dps.json b/data/mods/TEST_DATA/expected_dps_data/junk_dps.json index 80c1f644f7988..3523ac98c0349 100644 --- a/data/mods/TEST_DATA/expected_dps_data/junk_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/junk_dps.json @@ -22,19 +22,15 @@ "2x4": 5.66, "tazer": 5.69, "violin": 5.71, - "fighter_sting": 5.72, "fishing_rod_2pc_packed": 5.77, - "flint": 5.78, - "rock_flaking": 5.78, + "flint": 5.25, + "rock_flaking": 5.25, "nailboard": 5.83, - "bone_plaster": 5.98, - "bone_fossil": 5.98, "grinder_blade": 6.01, "circsaw_blade": 6.01, "recoil_stock": 6.22, "guitar_electric": 6.3, "fishing_rod_tele_packed": 6.47, - "bee_sting": 6.52, "qt_steel_chunk": 6.59, "budget_steel_chunk": 6.59, "hc_steel_chunk": 6.59, diff --git a/data/mods/TEST_DATA/expected_dps_data/knives_dps.json b/data/mods/TEST_DATA/expected_dps_data/knives_dps.json index 484a92c614e1c..2ed093b177e9a 100644 --- a/data/mods/TEST_DATA/expected_dps_data/knives_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/knives_dps.json @@ -9,7 +9,6 @@ "pockknife": 4.5, "knife_small": 5.86, "tanto_fake": 6.93, - "throwing_knife": 6.02, "bone_knife": 7.11, "karambit": 7.62, "inter_bayonet": 7.77, diff --git a/data/mods/TEST_DATA/expected_dps_data/staves_dps.json b/data/mods/TEST_DATA/expected_dps_data/staves_dps.json index f87c1bdf23f0b..bd6fab0d8c0f8 100644 --- a/data/mods/TEST_DATA/expected_dps_data/staves_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/staves_dps.json @@ -6,7 +6,7 @@ "broom": 3.25, "pool_cue": 7.76, "staff_pipe": 11.09, - "staff_sling": 11.56, + "staff_sling": 8.77, "spear_shaft": 11.9, "soaking_spear_shaft": 6, "hockey_stick": 13.75, diff --git a/data/mods/TEST_DATA/legacy_to_hit.json b/data/mods/TEST_DATA/legacy_to_hit.json index 33fcecd33d8bd..3d38fbf35342e 100644 --- a/data/mods/TEST_DATA/legacy_to_hit.json +++ b/data/mods/TEST_DATA/legacy_to_hit.json @@ -5,13 +5,8 @@ "legacy_to_hit": [ "1895sbl", "2_shot_special", - "EMPbomb", - "EMPbomb_act", "LAW", "M24", - "UPS_OFF", - "UPS_ON", - "UPS_off", "acidbomb", "adjustable_stock", "ak308", @@ -51,10 +46,8 @@ "basket", "battery_charger", "bbgun", - "bee_sting", "beeper", "benelli_sa", - "beverly_shear", "bfg50", "billet_bone", "billet_wood", @@ -68,10 +61,7 @@ "blunderbuss", "board_trap", "boat_board", - "bolas", "bond_410", - "bone_fossil", - "bone_plaster", "boobytrap", "boxcutter", "bren2_556", @@ -80,34 +70,27 @@ "brogyeki", "bronze_hoe", "bronze_shears", - "broom", "browning_blr", "brush", "burette", "butane_tank", - "c4", - "c4armed", "caltrops", "caltrops_glass", "caltrops_teeth", "camera_control", - "camp_chair", "canister_goo", "cannon_3in_ordnance", - "cannonball_4lb", "carbonfiber_boat_hull", "cargo_rack", "catalytic_cracking_reactor", "chainsaw_off", "chainsaw_on", - "chair_folding", "cheek_pad", "chemical_thrower", "chemistry_set", "chemistry_set_basic", "chisel", "chitin_plate", - "churn", "circsaw_off", "circsaw_on", "clarinet", @@ -124,32 +107,23 @@ "compcrossbow", "compositecrossbow", "copper_knife", - "cot", "counterweight", "crafted_suppressor", "crater_bomb", - "cu_pipe", - "cured_hide", - "cured_pelt", "cuvettes", "cz600", "damaged_shelter_kit", "debug_gun_no_mag_well", - "deck_chair", "deflated_wheel", "deflated_wheel_bicycle", "deflated_wheel_motorbike", "deflated_wheel_slick", "deflated_wheel_wide", "digging_stick", - "directional_antenna", "diveknife", "draw_plate", "drift", "drill_rock_primitive", - "dynamite", - "dynamite_bomb", - "e_handcuffs", "elec_chainsaw_off", "elec_chainsaw_on", "elec_hairtrimmer", @@ -163,19 +137,11 @@ "engineering_engine_kit", "engineering_makerspace_kit", "engineering_robotics_kit", - "extension_cable", "extinguisher", "fake_dynamite_50lbs", "feral_human_thrown_rock", - "fiber_mat", - "fighter_sting", "filter_suppressor", - "firecracker", - "firecracker_act", - "firecracker_pack", - "firecracker_pack_act", "firework_cannon", - "flashbang", "flint_steel", "floodlight", "fn_fal_semi", @@ -186,47 +152,30 @@ "frame_wood_deck", "frame_wood_light", "fs2000", - "full_barrel_bomb", - "full_barrel_bomb_act", "funnel_separation", "g_shovel", "garand", - "gas_charger", "gas_forge", - "gasbomb_makeshift_act", "gatling_mech_laser", "gelbox", "glass_prism", - "glass_shard", - "glass_sheet", "glass_thermometer", "glass_tube_small", "glowstick", "glowstick_dead", "glowstick_lit", - "grenade", - "grenade_act", - "grenade_emp", - "grenade_emp_act", - "grenade_inc", - "grenade_inc_act", "grinder_blade", - "half_barrel_bomb", - "half_barrel_bomb_act", "hammer_pocket_test", "hand_axe", "hand_controls", "hand_rims", "hard_plate", - "hd_tow_cable", "hdframe", "henry_big_boy", "hk417_13", "hk_g3", "hk_g80", "hoe", - "homemade_demolition_charge", - "homemade_demolition_charge_act", "honey_scraper", "horse_tack", "hotcut", @@ -255,13 +204,10 @@ "large_shelter_kit", "large_tent_kit", "laser_rifle", - "lawn_dart", "leather_funnel", - "leather_tarp", "light_detector", "light_emergency_red", "livestock_scale", - "log", "lux_meter", "m107a1", "m110a1", @@ -282,35 +228,24 @@ "m79", "magnifying_glass", "makeshift_funnel", - "manual_tire_changer", "mark19", "marlin_9a", "masonrysaw_off", "masonrysaw_on", "mdrx", "melting_point", - "metal_butcher_rack", "metal_funnel", - "metal_smoking_rack", "metal_tank_test", "mgl", "microcentrifuge", "microscope", "microscope_dissecting", "mil_plate", - "military_explosive_full_barrel_bomb", - "military_explosive_full_barrel_bomb_act", - "military_explosive_half_barrel_bomb", - "military_explosive_half_barrel_bomb_act", - "military_explosive_pipebomb", - "mininuke", "minireactor", "modern_handguard", "modular_ar15", "modular_m27_assault_rifle", "modular_m4_carbine", - "molotov", - "molotov_lit", "mop", "mosin44", "mosin91_30", @@ -324,7 +259,6 @@ "multimeter", "nitrogen_generator", "nitrogen_tank", - "noise_emitter", "number4_mki", "ny_hook", "office_letter_opener", @@ -342,12 +276,9 @@ "pedal_extenders", "pedal_extenders_makeshift", "pedal_grindstone", - "peephole", "ph_meter", "pike_pole", "pipe_shotgun", - "pipebomb", - "pipebomb_act", "pistol_bayonet", "pistol_flintlock", "plasma_rifle", @@ -355,7 +286,6 @@ "platinum_grille", "pockknife", "portal", - "power_cord", "pressure_tank", "primitive_knife", "pseudo_m203", @@ -370,7 +300,6 @@ "recharge_station", "recoil_stock", "recovery_pump", - "reinforced_glass_sheet", "remington700_270", "remington_700", "remington_870", @@ -389,7 +318,6 @@ "rm88_battle_rifle", "robofac_gun", "rock", - "rock_flaking", "rotovap", "rubik_farthing", "ruger_1022", @@ -408,19 +336,13 @@ "scar_l", "scissors_child", "scout_stock", - "scrambler", - "scrambler_act", "scraper_steel", - "screen_mesh", - "screw_press_tool", "seat", "seat_bench", "sextant", - "sharp_rock", "sharps", "shavingkit", "shears", - "sheet_metal_small", "shelter_kit", "shot_suppressor", "shotgun_s", @@ -435,12 +357,9 @@ "solar_panel", "spectrophotometer", "spiked_plate", - "splinter", "spring_plate", - "staff_sling", "stand_ring_clamps", "steel_grille", - "steel_lump", "steel_plate", "steyr_aug", "still_lab", @@ -457,7 +376,6 @@ "tearer", "telepad", "teleporter", - "tempered_glass_sheet", "tent_kit", "tent_pole", "test_2x4", @@ -488,7 +406,6 @@ "testflames", "throw_extinguisher", "throw_extinguisher_act", - "throwing_axe", "tire_bicycle", "tire_medium", "tire_medium_slick", @@ -497,14 +414,12 @@ "toolset", "torch", "torch_lit", - "tourist_table", "towel_hanger", "trimmer_off", "tripwire", "trumpet", "tuba", "type99", - "ugl_buttstock", "v_table", "vac_oven_small", "vac_pump", @@ -515,15 +430,12 @@ "walther_p22", "walther_ppk", "washboard", - "wasp_sting", "water_faucet", - "water_mill", "water_wheel", "watercannon", "weather_glass", "weather_reader", "weatherby_5", - "weighted_dart", "wheel", "wheel_10", "wheel_armor", @@ -545,13 +457,9 @@ "wheel_wood", "win70", "winchester_1887", - "wind_mill", "wind_turbine", - "wood_panel", "wood_plate", - "wood_sheet", "xd_10", - "xedra_antenna", "xedra_gun", "xedra_seismograph", "xl_wind_turbine", From 4cab314ae907dd870f17bae4bde56782d8d278b1 Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:43:44 +0100 Subject: [PATCH 101/158] vehicle garbage --- data/json/items/vehicle/solar.json | 2 +- data/json/items/vehicle/tables.json | 2 +- data/json/items/vehicle/utilities.json | 25 ++++---- data/json/items/vehicle/wheel.json | 86 +++++++++++--------------- data/mods/TEST_DATA/legacy_to_hit.json | 39 ------------ 5 files changed, 50 insertions(+), 104 deletions(-) diff --git a/data/json/items/vehicle/solar.json b/data/json/items/vehicle/solar.json index bb83497e9ce45..b125e019f6f22 100644 --- a/data/json/items/vehicle/solar.json +++ b/data/json/items/vehicle/solar.json @@ -12,7 +12,7 @@ ], "weight": "2630 g", "longest_side": "50 cm", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "color": "yellow", "symbol": "]", "material": [ "glass" ], diff --git a/data/json/items/vehicle/tables.json b/data/json/items/vehicle/tables.json index 73db394d394f0..88d5a7cca23f3 100644 --- a/data/json/items/vehicle/tables.json +++ b/data/json/items/vehicle/tables.json @@ -5,7 +5,7 @@ "name": { "str": "fancy table" }, "description": "A very fancy table for those with fancy lives. If times were better, it might be useful for something other than firewood.", "weight": "9071 g", - "to_hit": -8, + "to_hit": { "grip": "none", "length": "long", "surface": "any", "balance": "clumsy" }, "color": "red", "symbol": "0", "material": [ "wood" ], diff --git a/data/json/items/vehicle/utilities.json b/data/json/items/vehicle/utilities.json index e1a996a6c8ade..f1d15dfc71132 100644 --- a/data/json/items/vehicle/utilities.json +++ b/data/json/items/vehicle/utilities.json @@ -9,7 +9,7 @@ "volume": "2 L", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel" ], "symbol": ";", "color": "light_gray", @@ -21,7 +21,7 @@ "name": { "str": "vehicle cooler" }, "description": "A vehicle-mounted area cooler. Install a muffler in another part of the vehicle to direct the exhaust heat to that location.", "weight": "12500 g", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "color": "light_cyan", "symbol": "C", "material": [ "steel" ], @@ -29,7 +29,7 @@ "category": "veh_parts", "price": "200 USD", "price_postapoc": "15 USD", - "melee_damage": { "bash": 12 } + "melee_damage": { "bash": 8 } }, { "type": "GENERIC", @@ -49,7 +49,7 @@ "name": { "str": "vehicle heater" }, "description": "A vehicle-mounted area heater.", "weight": "12500 g", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "color": "red", "symbol": ";", "material": [ "steel" ], @@ -57,7 +57,7 @@ "category": "veh_parts", "price": "200 USD", "price_postapoc": "15 USD", - "melee_damage": { "bash": 12 } + "melee_damage": { "bash": 8 } }, { "type": "GENERIC", @@ -76,8 +76,8 @@ "id": "towel_hanger", "name": { "str": "towel hanger" }, "description": "A towel hanger with towels.", - "weight": "2000 g", - "to_hit": -1, + "weight": "2 kg", + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "color": "brown", "symbol": "-", "material": [ "wood" ], @@ -92,8 +92,8 @@ "id": "recharge_station", "name": { "str": "recharging station" }, "description": "A universal recharging station designed to operate on vehicle power. While on, it will steadily charge all rechargeable batteries (battery cells, lead-acid batteries, etc) placed directly within its storage space. The system can only be installed onto existing storage compartments, and is controlled from a dashboard or electronics control unit.", - "weight": "10000 g", - "to_hit": 1, + "weight": "10 kg", + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "color": "light_blue", "symbol": "-", "material": [ "steel", "plastic" ], @@ -110,12 +110,10 @@ "description": "A small device for recharging batteries, given a source of electricity. It could easily be wired into a vehicle with power. It will slowly charge all rechargeable batteries (battery cells, lead-acid batteries, etc) placed directly within its storage space. It can only be installed onto existing storage compartments.", "weight": "100 g", "volume": "250 ml", - "to_hit": -1, "price": "15 USD", "price_postapoc": "1 USD", "looks_like": "cable", - "copy-from": "recharge_station", - "melee_damage": { "bash": 4 } + "copy-from": "recharge_station" }, { "type": "GENERIC", @@ -220,7 +218,7 @@ "name": { "str": "water faucet" }, "description": "A metal faucet that can be attached to a water tank for easy access.", "weight": "900 g", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "color": "light_gray", "symbol": ";", "material": [ "steel" ], @@ -239,7 +237,6 @@ "weight": "140 kg", "volume": "370 L", "longest_side": "88 cm", - "to_hit": -6, "material": [ "steel" ], "category": "veh_parts", "color": "green", diff --git a/data/json/items/vehicle/wheel.json b/data/json/items/vehicle/wheel.json index 42b8fb71d4963..81d6879106c77 100644 --- a/data/json/items/vehicle/wheel.json +++ b/data/json/items/vehicle/wheel.json @@ -85,7 +85,7 @@ "description": "A medium-size steel rim for a car tire.", "weight": "5245 g", "volume": "28 L", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "longest_side": "432 mm", "price": "50 USD", "price_postapoc": "5 USD", @@ -102,14 +102,14 @@ "description": "A steel rim for a motorbike tire.", "weight": "3000 g", "volume": "12 L", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "longest_side": "508 mm", "price": "50 USD", "price_postapoc": "5 USD", "material": [ "steel" ], "symbol": "]", "color": "dark_gray", - "melee_damage": { "bash": 8 } + "melee_damage": { "bash": 6 } }, { "id": "wheel_rim_wide", @@ -119,7 +119,7 @@ "description": "A wide steel rim for a larger tire.", "weight": "7600 g", "volume": "70 L", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "longest_side": "610 mm", "price": "50 USD", "price_postapoc": "5 USD", @@ -156,12 +156,10 @@ "longest_side": "432 mm", "price": "50 USD", "price_postapoc": "5 USD", - "to_hit": -1, "material": [ "rubber" ], "flags": [ "NONCONDUCTIVE" ], "symbol": "]", - "color": "dark_gray", - "melee_damage": { "bash": 6 } + "color": "dark_gray" }, { "id": "tire_medium_slick", @@ -175,12 +173,10 @@ "longest_side": "407 mm", "price": "200 USD", "price_postapoc": "5 USD", - "to_hit": -1, "material": [ "rubber" ], "flags": [ "NONCONDUCTIVE" ], "symbol": "]", - "color": "dark_gray", - "melee_damage": { "bash": 6 } + "color": "dark_gray" }, { "id": "tire_motorbike", @@ -194,12 +190,10 @@ "longest_side": "407 mm", "price": "100 USD", "price_postapoc": "3 USD", - "to_hit": -1, "material": [ "rubber" ], "flags": [ "NONCONDUCTIVE" ], "symbol": "]", - "color": "dark_gray", - "melee_damage": { "bash": 9 } + "color": "dark_gray" }, { "id": "tire_motorbike_or", @@ -221,12 +215,10 @@ "longest_side": "610 mm", "price": "270 USD", "price_postapoc": "5 USD 50 cent", - "to_hit": -1, "material": [ "rubber" ], "flags": [ "NONCONDUCTIVE" ], "symbol": "]", - "color": "dark_gray", - "melee_damage": { "bash": 15 } + "color": "dark_gray" }, { "id": "tire_wide_or", @@ -247,12 +239,10 @@ "longest_side": "686 mm", "price": "20 USD", "price_postapoc": "1 USD 25 cent", - "to_hit": -1, "material": [ "rubber" ], "flags": [ "NONCONDUCTIVE" ], "symbol": "]", - "color": "dark_gray", - "melee_damage": { "bash": 8 } + "color": "dark_gray" }, { "id": "tire_bicycle_or", @@ -273,7 +263,7 @@ "longest_side": "432 mm", "price": "100 USD", "price_postapoc": "7 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "rubber" ], "symbol": "]", "color": "dark_gray", @@ -291,7 +281,7 @@ "longest_side": "407 mm", "price": "240 USD", "price_postapoc": "5 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "rubber" ], "symbol": "]", "color": "dark_gray", @@ -308,11 +298,11 @@ "longest_side": "407 mm", "price": "140 USD", "price_postapoc": "5 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "rubber" ], "symbol": "]", "color": "dark_gray", - "melee_damage": { "bash": 10 } + "melee_damage": { "bash": 5 } }, { "id": "deflated_wheel_motorbike_or", @@ -333,7 +323,7 @@ "longest_side": "610 mm", "price": "340 USD", "price_postapoc": "7 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "rubber" ], "symbol": "]", "color": "dark_gray", @@ -357,11 +347,11 @@ "longest_side": "686 mm", "price": "40 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "aluminum", "rubber" ], "symbol": "]", "color": "dark_gray", - "melee_damage": { "bash": 8 } + "melee_damage": { "bash": 3 } }, { "id": "deflated_wheel_bicycle_or", @@ -381,7 +371,7 @@ "longest_side": "432 mm", "price": "100 USD", "price_postapoc": "7 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "rubber" ], "symbol": "]", "color": "dark_gray", @@ -400,7 +390,7 @@ "longest_side": "407 mm", "price": "240 USD", "price_postapoc": "5 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "rubber" ], "symbol": "]", "color": "dark_gray", @@ -419,7 +409,7 @@ "longest_side": "813 mm", "price": "340 USD", "price_postapoc": "7 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "qt_steel", "ceramic" ], "symbol": "]", "color": "green", @@ -438,13 +428,13 @@ "longest_side": "204 mm", "price": "20 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "rubber" ], "symbol": "]", "color": "dark_gray", "diameter": 8, "width": 3, - "melee_damage": { "bash": 10 } + "melee_damage": { "bash": 5 } }, { "id": "wheel_bicycle", @@ -457,13 +447,13 @@ "longest_side": "686 mm", "price": "40 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "aluminum", "rubber" ], "symbol": "]", "color": "dark_gray", "diameter": 27, "width": 3, - "melee_damage": { "bash": 8 } + "melee_damage": { "bash": 3 } }, { "id": "wheel_bicycle_or", @@ -483,13 +473,13 @@ "longest_side": "102 mm", "price": "24 USD", "price_postapoc": "1 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "]", "color": "dark_gray", "diameter": 2, "width": 1, - "melee_damage": { "bash": 5 } + "melee_damage": { "bash": 3 } }, { "id": "wheel_caster_large", @@ -502,7 +492,7 @@ "longest_side": "190 mm", "price": "45 USD", "price_postapoc": "2 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "]", "color": "dark_gray", @@ -521,7 +511,7 @@ "longest_side": "254 mm", "price": "140 USD", "price_postapoc": "5 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "rubber", "steel" ], "symbol": "]", "color": "dark_gray", @@ -540,7 +530,7 @@ "longest_side": "508 mm", "price": "12 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -4, + "to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "]", "color": "light_gray", @@ -559,7 +549,7 @@ "longest_side": "508 mm", "price": "12 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": "]", "color": "light_gray", @@ -592,13 +582,13 @@ "longest_side": "407 mm", "price": "140 USD", "price_postapoc": "5 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "rubber" ], "symbol": "]", "color": "dark_gray", "diameter": 16, "width": 4, - "melee_damage": { "bash": 10 } + "melee_damage": { "bash": 5 } }, { "id": "wheel_motorbike_or", @@ -638,13 +628,13 @@ "longest_side": "254 mm", "price": "140 USD", "price_postapoc": "1 USD", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "]", "color": "dark_gray", "diameter": 10, "width": 3, - "melee_damage": { "bash": 10 } + "melee_damage": { "bash": 3 } }, { "id": "wheel_skate", @@ -675,13 +665,11 @@ "longest_side": "60 mm", "price": "80 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -1, "material": [ "steel", "plastic" ], "symbol": "]", "color": "dark_gray", "diameter": 2, - "width": 2, - "melee_damage": { "bash": 1 } + "width": 2 }, { "id": "wheel_tricycle", @@ -712,7 +700,7 @@ "longest_side": "508 mm", "price": "80 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "rubber" ], "symbol": "]", "color": "dark_gray", @@ -731,7 +719,7 @@ "longest_side": "610 mm", "price": "340 USD", "price_postapoc": "7 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel", "rubber" ], "symbol": "]", "color": "dark_gray", @@ -756,7 +744,7 @@ "volume": "8750 ml", "longest_side": "508 mm", "price": "12 USD", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "wood" ], "symbol": "]", "color": "brown", diff --git a/data/mods/TEST_DATA/legacy_to_hit.json b/data/mods/TEST_DATA/legacy_to_hit.json index 3d38fbf35342e..7b4a59fb743d7 100644 --- a/data/mods/TEST_DATA/legacy_to_hit.json +++ b/data/mods/TEST_DATA/legacy_to_hit.json @@ -44,7 +44,6 @@ "barb_launcher", "barometer", "basket", - "battery_charger", "bbgun", "beeper", "benelli_sa", @@ -55,7 +54,6 @@ "bipod", "bipod_handguard", "birchbark_funnel", - "black_box", "black_glass_shard", "blade_trap", "blunderbuss", @@ -114,11 +112,6 @@ "cz600", "damaged_shelter_kit", "debug_gun_no_mag_well", - "deflated_wheel", - "deflated_wheel_bicycle", - "deflated_wheel_motorbike", - "deflated_wheel_slick", - "deflated_wheel_wide", "digging_stick", "diveknife", "draw_plate", @@ -252,8 +245,6 @@ "mossberg_500", "mossberg_930", "motor_large", - "mountable_cooler", - "mountable_heater", "mrad_smr", "muffler", "multimeter", @@ -263,7 +254,6 @@ "ny_hook", "office_letter_opener", "oil_extractor_crude", - "oil_press_electric", "omnicamera", "omnicamera_reinforced", "oxygen_cylinder", @@ -297,7 +287,6 @@ "radio", "raft_board", "rebar_plate", - "recharge_station", "recoil_stock", "recovery_pump", "remington700_270", @@ -354,7 +343,6 @@ "smg_45", "smg_9mm", "smle_mk3", - "solar_panel", "spectrophotometer", "spiked_plate", "spring_plate", @@ -406,21 +394,14 @@ "testflames", "throw_extinguisher", "throw_extinguisher_act", - "tire_bicycle", - "tire_medium", - "tire_medium_slick", - "tire_motorbike", - "tire_wide", "toolset", "torch", "torch_lit", - "towel_hanger", "trimmer_off", "tripwire", "trumpet", "tuba", "type99", - "v_table", "vac_oven_small", "vac_pump", "varmint_airgun", @@ -430,31 +411,11 @@ "walther_p22", "walther_ppk", "washboard", - "water_faucet", "water_wheel", "watercannon", "weather_glass", "weather_reader", "weatherby_5", - "wheel", - "wheel_10", - "wheel_armor", - "wheel_barrow", - "wheel_bicycle", - "wheel_caster", - "wheel_caster_large", - "wheel_metal", - "wheel_motorbike", - "wheel_rail", - "wheel_rim_medium", - "wheel_rim_motorbike", - "wheel_rim_wide", - "wheel_skateboard", - "wheel_slick", - "wheel_small", - "wheel_wheelchair", - "wheel_wide", - "wheel_wood", "win70", "winchester_1887", "wind_turbine", From 79d70e943754ecb30d4996b6f083fd8c92adc6e1 Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:47:32 +0100 Subject: [PATCH 102/158] ice and fire --- data/json/items/tool/fire.json | 2 -- data/json/items/tool/firefighting.json | 18 +++++++++--------- data/mods/TEST_DATA/legacy_to_hit.json | 8 -------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/data/json/items/tool/fire.json b/data/json/items/tool/fire.json index edbb0c82313f7..77fa06565bb11 100644 --- a/data/json/items/tool/fire.json +++ b/data/json/items/tool/fire.json @@ -72,7 +72,6 @@ "volume": "250 ml", "price": "3 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -1, "material": [ "stone", "hc_steel" ], "symbol": ",", "color": "dark_gray", @@ -116,7 +115,6 @@ "volume": "250 ml", "price": "6 USD", "price_postapoc": "50 cent", - "to_hit": -1, "material": [ "glass", "plastic" ], "symbol": "o", "color": "green", diff --git a/data/json/items/tool/firefighting.json b/data/json/items/tool/firefighting.json index 73d711e189c31..f95b62967705c 100644 --- a/data/json/items/tool/firefighting.json +++ b/data/json/items/tool/firefighting.json @@ -28,11 +28,11 @@ "name": { "str": "large fire extinguisher" }, "description": "An emergency fire extinguisher containing five gallons of fire-retardant foam. Useful for putting out adjacent fires.", "weight": "7030 g", - "volume": "20000 ml", + "volume": "20 L", "longest_side": "50 cm", "price": "50 USD", "price_postapoc": "1 USD", - "to_hit": -4, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "clumsy" }, "material": [ "steel" ], "symbol": ";", "color": "red", @@ -112,7 +112,7 @@ "longest_side": "40 cm", "price": "40 USD", "price_postapoc": "50 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "short", "surface": "any", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": ";", "color": "red", @@ -141,7 +141,7 @@ "volume": "250 ml", "price": "30 USD", "price_postapoc": "50 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel" ], "symbol": "*", "color": "blue", @@ -154,7 +154,7 @@ "type": "transform" }, "flags": [ "ACT_IN_FIRE", "BOMB", "GRENADE" ], - "melee_damage": { "bash": 3 } + "melee_damage": { "bash": 2 } }, { "id": "throw_extinguisher_act", @@ -166,14 +166,14 @@ "volume": "250 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -1, + "to_hit": { "grip": "none", "length": "hand", "surface": "any", "balance": "uneven" }, "material": [ "steel" ], "symbol": "*", "color": "light_red", "emits": [ "emit_extinguisher_burst" ], "revert_to": "canister_empty", "flags": [ "TRADER_AVOID" ], - "melee_damage": { "bash": 6 } + "melee_damage": { "bash": 2 } }, { "id": "pike_pole", @@ -191,7 +191,7 @@ "//": " If the pole itself has a diameter of around 3 cm which is thick, to be frank, then we half it for the radius -> 1,5 cm, square it -> 2,25, mulitplicate with pi -> ~7,07 cm² multiplicate with 160 cm length -> 1130 cm³ which is 1,13 liters. We add the hook which is around 100 ml of volume.", "volume": "1250 ml", "longest_side": "160 cm", - "to_hit": -1, + "to_hit": { "grip": "weapon", "length": "long", "surface": "point", "balance": "neutral" }, "qualities": [ [ "COOK", 1 ] ], "use_action": [ "HEAT_SOLID_ITEMS" ], "melee_damage": { "bash": 20, "cut": 6 } @@ -220,7 +220,7 @@ "weight": "2900 g", "volume": "400 ml", "longest_side": "90 cm", - "to_hit": -1, + "to_hit": { "grip": "weapon", "length": "short", "surface": "point", "balance": "neutral" }, "qualities": [ [ "PRY", 3 ], [ "HAMMER", 1 ], [ "DIG", 1 ] ], "use_action": [ "CROWBAR" ], "melee_damage": { "bash": 15, "stab": 13 } diff --git a/data/mods/TEST_DATA/legacy_to_hit.json b/data/mods/TEST_DATA/legacy_to_hit.json index 7b4a59fb743d7..71002c4fd1f8b 100644 --- a/data/mods/TEST_DATA/legacy_to_hit.json +++ b/data/mods/TEST_DATA/legacy_to_hit.json @@ -130,12 +130,10 @@ "engineering_engine_kit", "engineering_makerspace_kit", "engineering_robotics_kit", - "extinguisher", "fake_dynamite_50lbs", "feral_human_thrown_rock", "filter_suppressor", "firework_cannon", - "flint_steel", "floodlight", "fn_fal_semi", "foldframe", @@ -219,7 +217,6 @@ "m3_carlgustav", "m60", "m79", - "magnifying_glass", "makeshift_funnel", "mark19", "marlin_9a", @@ -251,7 +248,6 @@ "nitrogen_generator", "nitrogen_tank", "number4_mki", - "ny_hook", "office_letter_opener", "oil_extractor_crude", "omnicamera", @@ -267,7 +263,6 @@ "pedal_extenders_makeshift", "pedal_grindstone", "ph_meter", - "pike_pole", "pipe_shotgun", "pistol_bayonet", "pistol_flintlock", @@ -338,7 +333,6 @@ "shovel", "sig_assault_rifle", "sks", - "sm_extinguisher", "smg_40", "smg_45", "smg_9mm", @@ -392,8 +386,6 @@ "test_umbrella", "test_waist_apron_long", "testflames", - "throw_extinguisher", - "throw_extinguisher_act", "toolset", "torch", "torch_lit", From 75545642d6dda5ab78cf62a1298fe4cc8db4da79 Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:54:51 +0100 Subject: [PATCH 103/158] more more more --- data/json/items/tool/integrated.json | 7 +------ data/json/items/tool/knives.json | 14 +++++++------- data/json/items/tool/lighting.json | 7 ++----- data/mods/TEST_DATA/legacy_to_hit.json | 16 ---------------- 4 files changed, 10 insertions(+), 34 deletions(-) diff --git a/data/json/items/tool/integrated.json b/data/json/items/tool/integrated.json index 692de54e272d6..cd5b04ef8bf30 100644 --- a/data/json/items/tool/integrated.json +++ b/data/json/items/tool/integrated.json @@ -122,7 +122,6 @@ "material": [ "superalloy", "copper" ], "name": { "str_sp": "integrated multitool" }, "description": "Integrated bionic tools implanted in your fingers.", - "to_hit": -1, "armor": [ { "material": [ @@ -178,7 +177,6 @@ "material": [ "superalloy", "copper" ], "name": { "str_sp": "integrated welder" }, "description": "Integrated bionic miniature welding tool implanted in your fingers.", - "to_hit": -1, "use_action": [ { "type": "repair_item", @@ -216,8 +214,7 @@ ], "ammo": [ "battery" ], "charges_per_use": 20, - "charged_qualities": [ [ "WELD", 2 ] ], - "melee_damage": { "bash": 2, "cut": -1 } + "charged_qualities": [ [ "WELD", 2 ] ] }, { "id": "integrated_multimeter", @@ -246,7 +243,6 @@ "material": [ "superalloy", "copper" ], "name": { "str_sp": "integrated multimeter" }, "description": "Integrated bionic multimeter implanted in your fingers.", - "to_hit": -1, "use_action": [ { "type": "VOLTMETER" } ] }, { @@ -276,7 +272,6 @@ "material": [ "superalloy", "copper" ], "name": { "str_sp": "integrated soldering iron" }, "description": "Integrated soldering iron and screwdriver set.", - "to_hit": -1, "use_action": [ { "type": "repair_item", diff --git a/data/json/items/tool/knives.json b/data/json/items/tool/knives.json index 72cc0badfa057..c1d9db9d32378 100644 --- a/data/json/items/tool/knives.json +++ b/data/json/items/tool/knives.json @@ -138,7 +138,7 @@ "longest_side": "25 cm", "price": "30 USD", "price_postapoc": "10 cent", - "to_hit": -1, + "to_hit": { "grip": "weapon", "length": "hand", "surface": "point", "balance": "neutral" }, "material": [ "copper" ], "symbol": ";", "color": "brown", @@ -179,7 +179,7 @@ "volume": "250 ml", "price": "140 USD", "price_postapoc": "3 USD", - "to_hit": -1, + "to_hit": { "grip": "weapon", "length": "hand", "surface": "line", "balance": "neutral" }, "material": [ "steel", "plastic" ], "symbol": ";", "color": "yellow", @@ -199,7 +199,7 @@ "longest_side": "46 cm", "price": "10 USD", "price_postapoc": "1 USD", - "to_hit": -1, + "to_hit": { "grip": "weapon", "length": "hand", "surface": "point", "balance": "neutral" }, "material": [ "steel" ], "symbol": ",", "color": "dark_gray", @@ -217,7 +217,7 @@ "volume": "10 ml", "price": "10 USD", "price_postapoc": "50 cent", - "to_hit": -3, + "to_hit": { "grip": "weapon", "length": "hand", "surface": "point", "balance": "neutral" }, "material": [ "steel", "plastic" ], "symbol": ";", "color": "brown", @@ -236,7 +236,7 @@ "longest_side": "25 cm", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -3, + "to_hit": { "grip": "solid", "length": "hand", "surface": "point", "balance": "neutral" }, "material": [ "wood", "stone" ], "symbol": ";", "color": "light_gray", @@ -255,7 +255,7 @@ "longest_side": "12 cm", "price": "4 USD", "price_postapoc": "50 cent", - "to_hit": -3, + "to_hit": { "grip": "solid", "length": "hand", "surface": "point", "balance": "neutral" }, "material": [ "steel", "plastic" ], "symbol": ";", "color": "light_gray", @@ -277,7 +277,7 @@ "longest_side": "8 cm", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -3, + "to_hit": { "grip": "none", "length": "hand", "surface": "line", "balance": "neutral" }, "qualities": [ [ "CUT", 2 ], [ "BUTCHER", -18 ] ], "melee_damage": { "bash": 5, "cut": 3 } } diff --git a/data/json/items/tool/lighting.json b/data/json/items/tool/lighting.json index 3ed0300afbe96..a48795d41a515 100644 --- a/data/json/items/tool/lighting.json +++ b/data/json/items/tool/lighting.json @@ -535,7 +535,6 @@ "volume": "25 ml", "price": "1 USD", "price_postapoc": "10 cent", - "to_hit": -1, "material": [ "plastic" ], "symbol": ";", "color": "light_blue", @@ -560,7 +559,6 @@ "volume": "25 ml", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -1, "material": [ "plastic" ], "symbol": ";", "color": "light_gray", @@ -574,7 +572,6 @@ "description": "An active glowstick, currently producing light. It will last for a few hours before burning out.", "weight": "29 g", "volume": "25 ml", - "to_hit": -1, "material": [ "plastic" ], "symbol": ";", "color": "light_blue", @@ -992,7 +989,7 @@ "//": "dimensions from pool_cue as least heavy ingredient from all", "price": "0 cent", "price_postapoc": "50 cent", - "to_hit": 1, + "to_hit": { "grip": "solid", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ { "type": "wood", "portion": 14 }, { "type": "cotton", "portion": 1 }, { "type": "gasoline", "portion": 1 } ], "symbol": "/", "color": "brown", @@ -1020,7 +1017,7 @@ "longest_side": "122 cm", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": 1, + "to_hit": { "grip": "solid", "length": "long", "surface": "any", "balance": "clumsy" }, "material": [ { "type": "wood", "portion": 14 }, { "type": "cotton", "portion": 1 }, { "type": "gasoline", "portion": 1 } ], "symbol": "/", "color": "brown", diff --git a/data/mods/TEST_DATA/legacy_to_hit.json b/data/mods/TEST_DATA/legacy_to_hit.json index 71002c4fd1f8b..2c202c892745b 100644 --- a/data/mods/TEST_DATA/legacy_to_hit.json +++ b/data/mods/TEST_DATA/legacy_to_hit.json @@ -61,7 +61,6 @@ "boat_board", "bond_410", "boobytrap", - "boxcutter", "bren2_556", "bren2_762", "brogyaga", @@ -104,7 +103,6 @@ "compbow", "compcrossbow", "compositecrossbow", - "copper_knife", "counterweight", "crafted_suppressor", "crater_bomb", @@ -113,7 +111,6 @@ "damaged_shelter_kit", "debug_gun_no_mag_well", "digging_stick", - "diveknife", "draw_plate", "drift", "drill_rock_primitive", @@ -152,9 +149,6 @@ "glass_prism", "glass_thermometer", "glass_tube_small", - "glowstick", - "glowstick_dead", - "glowstick_lit", "grinder_blade", "hammer_pocket_test", "hand_axe", @@ -167,7 +161,6 @@ "hk_g3", "hk_g80", "hoe", - "honey_scraper", "horse_tack", "hotcut", "hpt3895", @@ -177,9 +170,6 @@ "hygroscope", "inflatable_airbag", "inflatable_section", - "integrated_electrokit", - "integrated_multimeter", - "integrated_welder", "inter_bayonet", "it_battery_mount", "iwi_tavor_x95_300blk", @@ -269,10 +259,8 @@ "plasma_rifle", "plastic_boat_hull", "platinum_grille", - "pockknife", "portal", "pressure_tank", - "primitive_knife", "pseudo_m203", "psl", "punch_bone", @@ -345,7 +333,6 @@ "steel_plate", "steyr_aug", "still_lab", - "stone_chopper", "stopcock", "suppressor", "surv_rocket_launcher", @@ -386,9 +373,6 @@ "test_umbrella", "test_waist_apron_long", "testflames", - "toolset", - "torch", - "torch_lit", "trimmer_off", "tripwire", "trumpet", From 37c0bad1ffb1339ad6aa23c0eafc696577baf740 Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:59:58 +0100 Subject: [PATCH 104/158] landscaping --- data/json/items/tool/landscaping.json | 19 +++++++------------ data/mods/TEST_DATA/legacy_to_hit.json | 6 ------ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/data/json/items/tool/landscaping.json b/data/json/items/tool/landscaping.json index 2b6c7672a04d2..923f8c0ad3dd8 100644 --- a/data/json/items/tool/landscaping.json +++ b/data/json/items/tool/landscaping.json @@ -10,7 +10,7 @@ "longest_side": "90 cm", "price": "0 cent", "price_postapoc": "0 cent", - "to_hit": -1, + "to_hit": { "grip": "solid", "length": "long", "surface": "any", "balance": "uneven" }, "material": [ "wood" ], "symbol": "/", "color": "brown", @@ -28,7 +28,7 @@ "longest_side": "25 cm", "price": "20 cent", "price_postapoc": "50 cent", - "to_hit": 1, + "to_hit": { "grip": "solid", "length": "hand", "surface": "line", "balance": "neutral" }, "material": [ "steel" ], "symbol": "/", "color": "dark_gray", @@ -47,7 +47,7 @@ "longest_side": "140 cm", "price": "20 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": 1, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, "material": [ "steel", "wood" ], "symbol": "/", "color": "brown", @@ -68,7 +68,7 @@ "longest_side": "140 cm", "price": "20 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": 1, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, "material": [ "bronze", "wood" ], "symbol": "/", "color": "yellow", @@ -174,12 +174,7 @@ "volume": "3550 ml", "longest_side": "150 cm", "price": "30 USD", - "price_postapoc": "5 cent", - "to_hit": { "grip": "solid", "length": "long", "surface": "any", "balance": "uneven" }, - "material": [ "plastic" ], - "flags": [ "NONCONDUCTIVE", "FRAGILE_MELEE", "POLEARM", "SHEATH_SPEAR", "REACH_ATTACK" ], - "weapon_category": [ "HOOKING_WEAPONRY", "POLEARMS" ], - "melee_damage": { "bash": 2 } + "price_postapoc": "5 cent" }, { "id": "shovel", @@ -191,7 +186,7 @@ "longest_side": "140 cm", "price": "20 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": 3, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, "material": [ "steel", "wood" ], "symbol": "/", "color": "brown", @@ -349,7 +344,7 @@ "longest_side": "100 cm", "price": "40 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -1, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": "/", "color": "green", diff --git a/data/mods/TEST_DATA/legacy_to_hit.json b/data/mods/TEST_DATA/legacy_to_hit.json index 2c202c892745b..6e0562d17cdf6 100644 --- a/data/mods/TEST_DATA/legacy_to_hit.json +++ b/data/mods/TEST_DATA/legacy_to_hit.json @@ -65,7 +65,6 @@ "bren2_762", "brogyaga", "brogyeki", - "bronze_hoe", "bronze_shears", "browning_blr", "brush", @@ -110,7 +109,6 @@ "cz600", "damaged_shelter_kit", "debug_gun_no_mag_well", - "digging_stick", "draw_plate", "drift", "drill_rock_primitive", @@ -141,7 +139,6 @@ "frame_wood_light", "fs2000", "funnel_separation", - "g_shovel", "garand", "gas_forge", "gatling_mech_laser", @@ -160,7 +157,6 @@ "hk417_13", "hk_g3", "hk_g80", - "hoe", "horse_tack", "hotcut", "hpt3895", @@ -318,7 +314,6 @@ "shelter_kit", "shot_suppressor", "shotgun_s", - "shovel", "sig_assault_rifle", "sks", "smg_40", @@ -373,7 +368,6 @@ "test_umbrella", "test_waist_apron_long", "testflames", - "trimmer_off", "tripwire", "trumpet", "tuba", From d40d69a7145ca5c1200b945a8dd60e30602a815a Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Thu, 12 Dec 2024 19:01:51 +0100 Subject: [PATCH 105/158] masonry --- data/json/items/tool/masonry.json | 10 +++++----- data/mods/TEST_DATA/legacy_to_hit.json | 5 ----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/data/json/items/tool/masonry.json b/data/json/items/tool/masonry.json index bc3c5c6445835..fd8fde10fdec9 100644 --- a/data/json/items/tool/masonry.json +++ b/data/json/items/tool/masonry.json @@ -9,7 +9,7 @@ "longest_side": "25 cm", "price": "80 USD", "price_postapoc": "5 USD", - "to_hit": -3, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": "/", "color": "blue", @@ -47,7 +47,7 @@ "type": "TOOL", "name": { "str": "masonry saw (on)", "str_pl": "masonry saws (on)" }, "description": "This masonry saw is on and making a lot of noise. Use it to turn it off.", - "to_hit": -4, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, "turns_per_charge": 4, "charges_per_use": 0, "revert_to": "masonrysaw_off", @@ -94,7 +94,7 @@ "longest_side": "25 cm", "price": "80 USD", "price_postapoc": "5 USD", - "to_hit": -3, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, "material": [ "steel", "plastic" ], "symbol": "/", "color": "blue", @@ -121,7 +121,7 @@ "type": "TOOL", "name": { "str": "electric masonry saw (on)", "str_pl": "electric masonry saws (on)" }, "description": "This electric masonry saw is on and making a lot of noise. Use it to turn it off.", - "to_hit": -4, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, "//1": "I don't know whether we are allowed to have less than 1 turn per charge. Based on 13.2 to 1 conversion rate between", "//2": "epower and gasoline (according to jackhammer tools) it would be 0.3 turns per charge.", "turns_per_charge": 1, @@ -194,7 +194,7 @@ "weight": "349 g", "volume": "250 ml", "flags": [ "HURT_WHEN_WIELDED" ], - "to_hit": -4, + "to_hit": { "grip": "bad", "length": "hand", "surface": "line", "balance": "neutral" }, "melee_damage": { "cut": 14 } } ] diff --git a/data/mods/TEST_DATA/legacy_to_hit.json b/data/mods/TEST_DATA/legacy_to_hit.json index 6e0562d17cdf6..7a2709d1963b9 100644 --- a/data/mods/TEST_DATA/legacy_to_hit.json +++ b/data/mods/TEST_DATA/legacy_to_hit.json @@ -116,8 +116,6 @@ "elec_chainsaw_on", "elec_hairtrimmer", "elec_shears", - "electric_masonrysaw_off", - "electric_masonrysaw_on", "electrolyzer_makeshift", "electronics_controls", "emp_frond", @@ -146,7 +144,6 @@ "glass_prism", "glass_thermometer", "glass_tube_small", - "grinder_blade", "hammer_pocket_test", "hand_axe", "hand_controls", @@ -206,8 +203,6 @@ "makeshift_funnel", "mark19", "marlin_9a", - "masonrysaw_off", - "masonrysaw_on", "mdrx", "melting_point", "metal_funnel", From 5a7d116e56f3cc045273d5cd20e3f7bf0014480e Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Thu, 12 Dec 2024 19:06:03 +0100 Subject: [PATCH 106/158] woodworking --- data/json/items/tool/landscaping.json | 2 +- data/json/items/tool/masonry.json | 8 ++++---- data/json/items/tool/woodworking.json | 18 +++++++++--------- data/mods/TEST_DATA/legacy_to_hit.json | 7 ------- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/data/json/items/tool/landscaping.json b/data/json/items/tool/landscaping.json index 923f8c0ad3dd8..c9960e56202c5 100644 --- a/data/json/items/tool/landscaping.json +++ b/data/json/items/tool/landscaping.json @@ -344,7 +344,7 @@ "longest_side": "100 cm", "price": "40 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "/", "color": "green", diff --git a/data/json/items/tool/masonry.json b/data/json/items/tool/masonry.json index fd8fde10fdec9..17364dae24620 100644 --- a/data/json/items/tool/masonry.json +++ b/data/json/items/tool/masonry.json @@ -9,7 +9,7 @@ "longest_side": "25 cm", "price": "80 USD", "price_postapoc": "5 USD", - "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "/", "color": "blue", @@ -47,7 +47,7 @@ "type": "TOOL", "name": { "str": "masonry saw (on)", "str_pl": "masonry saws (on)" }, "description": "This masonry saw is on and making a lot of noise. Use it to turn it off.", - "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "turns_per_charge": 4, "charges_per_use": 0, "revert_to": "masonrysaw_off", @@ -94,7 +94,7 @@ "longest_side": "25 cm", "price": "80 USD", "price_postapoc": "5 USD", - "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "/", "color": "blue", @@ -121,7 +121,7 @@ "type": "TOOL", "name": { "str": "electric masonry saw (on)", "str_pl": "electric masonry saws (on)" }, "description": "This electric masonry saw is on and making a lot of noise. Use it to turn it off.", - "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "uneven" }, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "//1": "I don't know whether we are allowed to have less than 1 turn per charge. Based on 13.2 to 1 conversion rate between", "//2": "epower and gasoline (according to jackhammer tools) it would be 0.3 turns per charge.", "turns_per_charge": 1, diff --git a/data/json/items/tool/woodworking.json b/data/json/items/tool/woodworking.json index 36b8db54d1d69..18716f4003c89 100644 --- a/data/json/items/tool/woodworking.json +++ b/data/json/items/tool/woodworking.json @@ -46,7 +46,7 @@ "longest_side": "82 cm", "price": "80 USD", "price_postapoc": "5 USD", - "to_hit": -3, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "/", "color": "red", @@ -82,7 +82,7 @@ "type": "TOOL", "name": { "str": "chainsaw (on)", "str_pl": "chainsaws (on)" }, "description": "This chainsaw is on and making a lot of noise. Use it to turn it off.", - "to_hit": -4, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "turns_per_charge": 4, "charges_per_use": 0, "revert_to": "chainsaw_off", @@ -216,7 +216,7 @@ "longest_side": "44 cm", "price": "50 USD", "price_postapoc": "2 USD 50 cent", - "to_hit": -3, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "/", "color": "yellow", @@ -254,7 +254,7 @@ "name": { "str": "circular saw (on)", "str_pl": "circular saws (on)" }, "//": "Circular saw would be very fast but imprecise butchering tool - alas the qualities are not separate and so speed is sacrificed.", "description": "A lightweight, handheld cordless circular saw. It is currently on and the blade is spinning; use this item to turn it off.", - "to_hit": -4, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "power_draw": "1200 W", "revert_to": "circsaw_off", "qualities": [ [ "CUT", 1 ], [ "SAW_W", 2 ], [ "BUTCHER", -40 ] ], @@ -378,7 +378,7 @@ "longest_side": "82 cm", "price": "80 USD", "price_postapoc": "5 USD", - "to_hit": -3, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "material": [ "steel", "plastic" ], "symbol": "/", "color": "red", @@ -418,7 +418,7 @@ "type": "TOOL", "name": { "str": "electric chainsaw (on)", "str_pl": "electric chainsaws (on)" }, "description": "This electric chainsaw is on and making a lot of noise. Use it to turn it off.", - "to_hit": -4, + "to_hit": { "grip": "solid", "length": "long", "surface": "line", "balance": "clumsy" }, "power_draw": "2 kW", "charges_per_use": 0, "revert_to": "elec_chainsaw_off", @@ -540,13 +540,13 @@ "volume": "230 ml", "price": "0 cent", "price_postapoc": "50 cent", - "to_hit": -3, + "to_hit": { "grip": "none", "length": "hand", "surface": "line", "balance": "neutral" }, "material": [ "stone" ], "symbol": ";", "color": "light_gray", "qualities": [ [ "CUT", 1 ], [ "BUTCHER", -50 ], [ "AXE", 1 ], [ "HAMMER", 1 ] ], "flags": [ "SHEATH_AXE" ], - "melee_damage": { "bash": 7, "cut": 11 } + "melee_damage": { "bash": 3, "cut": 11 } }, { "id": "makeshift_axe", @@ -556,7 +556,7 @@ "description": "A chunk of steel with one edge hammered down to something resembling a cutting edge. It works passably well, but really can't compare to a proper axe.", "material": [ "steel" ], "flags": [ "SHEATH_AXE" ], - "melee_damage": { "bash": 8, "cut": 12 } + "melee_damage": { "bash": 5, "cut": 12 } }, { "id": "primitive_adze", diff --git a/data/mods/TEST_DATA/legacy_to_hit.json b/data/mods/TEST_DATA/legacy_to_hit.json index 7a2709d1963b9..65728bb738e63 100644 --- a/data/mods/TEST_DATA/legacy_to_hit.json +++ b/data/mods/TEST_DATA/legacy_to_hit.json @@ -79,16 +79,12 @@ "carbonfiber_boat_hull", "cargo_rack", "catalytic_cracking_reactor", - "chainsaw_off", - "chainsaw_on", "cheek_pad", "chemical_thrower", "chemistry_set", "chemistry_set_basic", "chisel", "chitin_plate", - "circsaw_off", - "circsaw_on", "clarinet", "closed_loop_extractor_large", "closed_loop_extractor_small", @@ -112,8 +108,6 @@ "draw_plate", "drift", "drill_rock_primitive", - "elec_chainsaw_off", - "elec_chainsaw_on", "elec_hairtrimmer", "elec_shears", "electrolyzer_makeshift", @@ -145,7 +139,6 @@ "glass_thermometer", "glass_tube_small", "hammer_pocket_test", - "hand_axe", "hand_controls", "hand_rims", "hard_plate", From 1398e7f46c8866b2e985f17067369db473553639 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:10:14 +0000 Subject: [PATCH 107/158] Make the option fully hide when not relevant rather than just grayed out --- src/veh_appliance.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/veh_appliance.cpp b/src/veh_appliance.cpp index c79d83fcfd24d..91aab9ac0a4ca 100644 --- a/src/veh_appliance.cpp +++ b/src/veh_appliance.cpp @@ -1,3 +1,4 @@ +#include "cached_options.h" #include "game.h" #include "handle_liquid.h" #include "imgui/imgui.h" @@ -594,11 +595,12 @@ void veh_app_interact::populate_app_actions() veh->is_powergrid() ? _( " / merge power grid" ) : "" ) ); #if defined(TILES) // Hide - app_actions.emplace_back( [this]() { - hide(); - } ); - imenu.addentry( -1, use_tiles && vp->info().has_flag( flag_WIRING ), - ctxt.keys_bound_to( "HIDE" ).front(), ctxt.get_action_name( "HIDE" ) ); + if( use_tiles && vp->info().has_flag( flag_WIRING ) ) { + app_actions.emplace_back( [this]() { + hide(); + } ); + imenu.addentry( -1, true, ctxt.keys_bound_to( "HIDE" ).front(), ctxt.get_action_name( "HIDE" ) ); + } #endif if( veh->is_powergrid() && veh->part_count() > 1 && !vp->info().has_flag( VPFLAG_WALL_MOUNTED ) ) { From 00e103067fe2ad34bae7c1ade8e702df2928c967 Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Thu, 12 Dec 2024 19:11:07 +0100 Subject: [PATCH 108/158] ahem --- data/json/items/tool/landscaping.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/json/items/tool/landscaping.json b/data/json/items/tool/landscaping.json index c9960e56202c5..980f664e292d2 100644 --- a/data/json/items/tool/landscaping.json +++ b/data/json/items/tool/landscaping.json @@ -174,7 +174,8 @@ "volume": "3550 ml", "longest_side": "150 cm", "price": "30 USD", - "price_postapoc": "5 cent" + "price_postapoc": "5 cent", + "material": [ "plastic" ] }, { "id": "shovel", From efad346699e71dbf7a7bf235f92d887c9fadd447 Mon Sep 17 00:00:00 2001 From: Brambor Date: Thu, 12 Dec 2024 19:13:06 +0100 Subject: [PATCH 109/158] refactor filters in crafting GUI to use a template --- src/recipe_dictionary.cpp | 83 ++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 50 deletions(-) diff --git a/src/recipe_dictionary.cpp b/src/recipe_dictionary.cpp index 550edc6568868..07c39caca347f 100644 --- a/src/recipe_dictionary.cpp +++ b/src/recipe_dictionary.cpp @@ -29,7 +29,6 @@ #include "units.h" #include "value_ptr.h" -static const itype_id itype_debug_item_search( "debug_item_search" ); static const requirement_id requirement_data_uncraft_book( "uncraft_book" ); recipe_dictionary recipe_dict; @@ -195,6 +194,27 @@ static std::unordered_set filtered_bodyparts; static std::unordered_set filtered_sub_bodyparts; static std::unordered_set filtered_layers; +template +static Unit can_contain_filter( std::string_view hint, std::string_view txt, Unit max, + std::vector> units ) +{ + auto const error = [hint, txt]( char const *, size_t /* offset */ ) { + throw math::runtime_error( _( string_format( hint, txt ) ) ); + }; + // Start at max. On convert failure: results are empty and user knows it is unusable. + Unit uni = max; + try { + uni = detail::read_from_json_string_common( txt, units, error ); + } catch( math::runtime_error &err ) { + popup( err.what() ); + } + // copy the debug item template (itype) + filtered_fake_itype = itype( *( item_controller->find( []( const itype & i ) { + return i.get_id() == STATIC( itype_id( "debug_item_search" ) ); + } )[0] ) ); + return uni; +} + std::vector recipe_subset::search( const std::string_view txt, const search_type key, const std::function &progress_callback ) const @@ -339,23 +359,10 @@ std::vector recipe_subset::search( // prepare search switch( key ) { case search_type::length: { - auto const error = [txt]( char const *, size_t /* offset */ ) { - // Showcase in the examples that the spacing doesn't matter. - throw math::runtime_error( _( string_format( - "Failed to convert '%s' to length.\nValid examples:\n122 cm\n1101mm\n2 meter", - txt ) ) ); - }; - // Start at max. On convert failure: results are empty and user knows it is unusable. - units::length len = units::length_max; - try { - len = detail::read_from_json_string_common( txt, units::length_units, error ); - } catch( math::runtime_error &err ) { - popup( err.what() ); - } - // copy the debug item template (itype) - filtered_fake_itype = itype( *( item_controller->find( []( const itype & i ) { - return i.get_id() == itype_debug_item_search; - } )[0] ) ); + units::length len = can_contain_filter( + "Failed to convert '%s' to length.\nValid examples:\n122 cm\n1101mm\n2 meter", + txt, units::length_max, units::length_units ); + filtered_fake_itype.longest_side = len; filtered_fake_item = item( &filtered_fake_itype ); // make the item hard, otherwise longest_side is ignored @@ -363,43 +370,19 @@ std::vector recipe_subset::search( break; } case search_type::volume: { - auto const error = [txt]( char const *, size_t /* offset */ ) { - throw math::runtime_error( _( string_format( - "Failed to convert '%s' to volume.\nValid examples:\n750 ml\n4L", - txt ) ) ); - }; - // Start at max. On convert failure: results are empty and user knows it is unusable. - units::volume vol = units::volume_max; - try { - vol = detail::read_from_json_string_common( txt, units::volume_units, error ); - } catch( math::runtime_error &err ) { - popup( err.what() ); - } - // copy the debug item template (itype) - filtered_fake_itype = itype( *( item_controller->find( []( const itype & i ) { - return i.get_id() == itype_debug_item_search; - } )[0] ) ); + units::volume vol = can_contain_filter( + "Failed to convert '%s' to volume.\nValid examples:\n750 ml\n4L", + txt, units::volume_max, units::volume_units ); + filtered_fake_itype.volume = vol; filtered_fake_item = item( &filtered_fake_itype ); break; } case search_type::mass: { - auto const error = [txt]( char const *, size_t /* offset */ ) { - throw math::runtime_error( _( string_format( - "Failed to convert '%s' to mass.\nValid examples:\n12 mg\n400g\n25 kg", - txt ) ) ); - }; - // Start at max. On convert failure: results are empty and user knows it is unusable. - units::mass mas = units::mass_max; - try { - mas = detail::read_from_json_string_common( txt, units::mass_units, error ); - } catch( math::runtime_error &err ) { - popup( err.what() ); - } - // copy the debug item template (itype) - filtered_fake_itype = itype( *( item_controller->find( []( const itype & i ) { - return i.get_id() == itype_debug_item_search; - } )[0] ) ); + units::mass mas = can_contain_filter( + "Failed to convert '%s' to mass.\nValid examples:\n12 mg\n400g\n25 kg", + txt, units::mass_max, units::mass_units ); + filtered_fake_itype.weight = mas; filtered_fake_item = item( &filtered_fake_itype ); break; From 9ddff829b2752ee5d273bedb9a2c16f0abbb63b4 Mon Sep 17 00:00:00 2001 From: George Kightly Date: Thu, 12 Dec 2024 18:37:42 +0000 Subject: [PATCH 110/158] Hopefully actually appease clang this time --- src/advanced_inv.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/advanced_inv.cpp b/src/advanced_inv.cpp index dd5f4476e08e1..646bf444ee08b 100644 --- a/src/advanced_inv.cpp +++ b/src/advanced_inv.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -667,9 +668,9 @@ struct advanced_inv_sorter { } case SORTBY_PRICEPERWEIGHT: { const double price_density1 = static_cast( d1.items.front()->price( true ) ) / - static_cast( std::max( 1L, d1.items.front()->weight().value() ) ); + static_cast( std::max( 1, d1.items.front()->weight().value() ) ); const double price_density2 = static_cast( d2.items.front()->price( true ) ) / - static_cast( std::max( 1L, d2.items.front()->weight().value() ) ); + static_cast( std::max( 1, d2.items.front()->weight().value() ) ); if( price_density1 != price_density2 ) { return price_density1 > price_density2; } From 7934af913505a439c89d9cfc0a8d360addf362c9 Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:03:22 -0600 Subject: [PATCH 111/158] 3 spaces -> 2 spaces --- data/mods/MindOverMatter/monsters/feral_psychics.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/MindOverMatter/monsters/feral_psychics.json b/data/mods/MindOverMatter/monsters/feral_psychics.json index b22abbe78ee78..73b03f7d16d4e 100644 --- a/data/mods/MindOverMatter/monsters/feral_psychics.json +++ b/data/mods/MindOverMatter/monsters/feral_psychics.json @@ -1376,7 +1376,7 @@ "id": "mon_feral_human_vita2", "type": "MONSTER", "name": "feral regenerator", - "description": "This feral human doesn't even have bloodshot eyes. Their skin shines, their eyes are clear, and they move with a relaxed confidence among the apocalypse. Only the indifference of the nearby zombies indicates something is deeply wrong.", + "description": "This feral human doesn't even have bloodshot eyes. Their skin shines, their eyes are clear, and they move with a relaxed confidence among the apocalypse. Only the indifference of the nearby zombies indicates something is deeply wrong.", "copy-from": "mon_feral_psion_default", "proportional": { "hp": 1.45 }, "color": "green", From 97a6aff84eca1368ba12c6c1cf97adb7c373ebf3 Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:46:34 +0100 Subject: [PATCH 112/158] DPS tests galore --- .../mods/TEST_DATA/expected_dps_data/axes_dps.json | 4 ++-- .../TEST_DATA/expected_dps_data/clubs_dps.json | 2 +- .../mods/TEST_DATA/expected_dps_data/junk_dps.json | 4 ++-- .../TEST_DATA/expected_dps_data/knives_dps.json | 2 +- .../TEST_DATA/expected_dps_data/polearms_dps.json | 2 +- .../TEST_DATA/expected_dps_data/spears_dps.json | 2 +- .../TEST_DATA/expected_dps_data/tools_dps.json | 14 +++++++------- .../expected_dps_data/two_handed_axes_dps.json | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/data/mods/TEST_DATA/expected_dps_data/axes_dps.json b/data/mods/TEST_DATA/expected_dps_data/axes_dps.json index 70fa343bf92cd..ef49fdaed6a5d 100644 --- a/data/mods/TEST_DATA/expected_dps_data/axes_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/axes_dps.json @@ -7,10 +7,10 @@ "//4": "hand_axe: chunk of sharp rock", "expected_dps": { "bowling_axe": 8.45, - "hand_axe": 8.5, + "hand_axe": 6.61, "primitive_adze": 10.0, "primitive_axe": 10.0, - "makeshift_axe": 10.0, + "makeshift_axe": 8.25, "pickaxe": 9.46, "iceaxe": 12.5, "throwing_axe": 10.1, diff --git a/data/mods/TEST_DATA/expected_dps_data/clubs_dps.json b/data/mods/TEST_DATA/expected_dps_data/clubs_dps.json index f408ceaa576dc..7f98b0b7bf3e2 100644 --- a/data/mods/TEST_DATA/expected_dps_data/clubs_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/clubs_dps.json @@ -19,7 +19,7 @@ "sword_nail": 9.06, "primitive_hammer": 10.0, "bokken_inferior": 10.0, - "shovel": 10.25, + "shovel": 6.04, "cane": 10.5, "morningstar_fake": 10.74, "cudgel": 10.9, diff --git a/data/mods/TEST_DATA/expected_dps_data/junk_dps.json b/data/mods/TEST_DATA/expected_dps_data/junk_dps.json index 3523ac98c0349..be67f8f2273dd 100644 --- a/data/mods/TEST_DATA/expected_dps_data/junk_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/junk_dps.json @@ -52,8 +52,8 @@ "landough_calrisean": 5.49, "flask_yeast": 5.49, "fishing_rod_basic": 7.52, - "torch": 7.54, - "torch_lit": 7.54, + "torch": 5.40, + "torch_lit": 5.40, "pipe_quiver_large": 5.83, "bipod_handguard": 7.69, "bipod_mod": 7.69, diff --git a/data/mods/TEST_DATA/expected_dps_data/knives_dps.json b/data/mods/TEST_DATA/expected_dps_data/knives_dps.json index 2ed093b177e9a..7e5367b2e7203 100644 --- a/data/mods/TEST_DATA/expected_dps_data/knives_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/knives_dps.json @@ -6,7 +6,7 @@ "expected_dps": { "primitive_knife": 2.5, "kirpan_cheap": 2.809, - "pockknife": 4.5, + "pockknife": 5.51, "knife_small": 5.86, "tanto_fake": 6.93, "bone_knife": 7.11, diff --git a/data/mods/TEST_DATA/expected_dps_data/polearms_dps.json b/data/mods/TEST_DATA/expected_dps_data/polearms_dps.json index 084906b7d123f..6bccf09150e8e 100644 --- a/data/mods/TEST_DATA/expected_dps_data/polearms_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/polearms_dps.json @@ -7,7 +7,7 @@ "pike_fake": 7.55, "lucern_hammerfake": 10.0, "pike_wood": 10.08, - "pike_pole": 12.51, + "pike_pole": 14.66, "halberd_fake": 12.77, "long_pole": 13.0, "soaking_long_pole": 6.51, diff --git a/data/mods/TEST_DATA/expected_dps_data/spears_dps.json b/data/mods/TEST_DATA/expected_dps_data/spears_dps.json index b5979f838b790..8d076d8f3aa0f 100644 --- a/data/mods/TEST_DATA/expected_dps_data/spears_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/spears_dps.json @@ -18,7 +18,7 @@ "javelin_iron": 12.3, "pitchfork": 12.48, "art_trident": 25.5, - "EOD_hotstick": 12.51, + "EOD_hotstick": 14.66, "simple_spear_pipe": 12.59, "javelin_fletched": 13.23, "spear_forked": 13.8, diff --git a/data/mods/TEST_DATA/expected_dps_data/tools_dps.json b/data/mods/TEST_DATA/expected_dps_data/tools_dps.json index 92050b4f739ff..112077684e6fe 100644 --- a/data/mods/TEST_DATA/expected_dps_data/tools_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/tools_dps.json @@ -4,7 +4,6 @@ "//": "Conventional tools", "expected_dps": { "makeshift_crutches": 5.59, - "bronze_hoe": 5.6, "grapnel": 5.64, "honey_scraper": 5.58, "heavy_flashlight": 5.66, @@ -19,7 +18,7 @@ "sickle_stone": 5.33, "atlatl": 7.13, "big_pliers": 5.49, - "hoe": 7.38, + "hoe": 5.28, "kevlar_shears": 7.62, "drift": 8.5, "awl_steel": 8.53, @@ -28,7 +27,8 @@ "shovel_snow": 5.49, "hotcut_bronze": 9.61, "hotcut": 9.61, - "crutches": 13.49 + "crutches": 13.49, + "digging_stick": 5.58 } }, { @@ -36,10 +36,10 @@ "//": "Powered tools", "expected_dps": { "polesaw_on": 9.4, - "trimmer_on": 14.71, - "elec_chainsaw_on": 16.18, - "masonrysaw_on": 19.29, - "electric_masonrysaw_on": 19.29 + "trimmer_on": 13.38, + "elec_chainsaw_on": 22.0, + "masonrysaw_on": 26.22, + "electric_masonrysaw_on": 26.22 } } ] diff --git a/data/mods/TEST_DATA/expected_dps_data/two_handed_axes_dps.json b/data/mods/TEST_DATA/expected_dps_data/two_handed_axes_dps.json index 59a9fbf85f5f6..d1d439cebd4dc 100644 --- a/data/mods/TEST_DATA/expected_dps_data/two_handed_axes_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/two_handed_axes_dps.json @@ -11,8 +11,8 @@ "copper_ax": 13.75, "e_combatsaw_on": 29, "combatsaw_on": 29, - "chainsaw_on": 16.0, - "circsaw_on": 18.4, + "chainsaw_on": 22.00, + "circsaw_on": 25.32, "e_combatsaw_off": 3.0, "combatsaw_off": 3.0, "chainsaw_off": 2.0, From 6ca0bee93a7eed73a6929310a2626c76efc1dbf9 Mon Sep 17 00:00:00 2001 From: Brambor Date: Wed, 11 Dec 2024 21:14:29 +0100 Subject: [PATCH 113/158] Filter items by can_contain L, V, M (longest_side, volume, mass) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - affects AIM, inventory… --- src/item_search.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++++ src/output.cpp | 3 +++ 2 files changed, 60 insertions(+) diff --git a/src/item_search.cpp b/src/item_search.cpp index 9c65bbfc26a5c..1b4e7593c76e3 100644 --- a/src/item_search.cpp +++ b/src/item_search.cpp @@ -5,15 +5,46 @@ #include "avatar.h" #include "cata_utility.h" +#include "flag.h" #include "item.h" #include "item_category.h" +#include "item_factory.h" #include "itype.h" +#include "make_static.h" #include "material.h" #include "requirements.h" #include "type_id.h" static std::pair get_both( std::string_view a ); +template +static std::function< bool( const item & )> can_contain_filter( std::string_view hint, + std::string_view filter, Unit max, std::vector> units, + std::function set_function ) +{ + auto const error = [hint, filter]( char const *, size_t /* offset */ ) { + throw math::runtime_error( _( string_format( hint, filter ) ) ); + }; + // Start at max. On convert failure: results are empty and user knows it is unusable. + Unit uni = max; + try { + uni = detail::read_from_json_string_common( filter, units, error ); + } catch( math::runtime_error &err ) { + // TODO notify the user: popup( err.what() ); + } + // copy the debug item template (itype), put it on heap so the itype pointer doesn't move + // TODO unique_ptr + std::shared_ptr filtered_fake_itype = std::make_shared( *( item_controller->find( []( + const itype & i ) { + return i.get_id() == STATIC( itype_id( "debug_item_search" ) ); + } )[0] ) ); + item filtered_fake_item = set_function( filtered_fake_itype.get(), uni ); + // pass to keep filtered_fake_itype valid until lambda capture is destroyed (while item is needed) + return [filtered_fake_itype, filtered_fake_item]( const item & i ) { + return i.can_contain( filtered_fake_item ).success(); + }; +} + std::function basic_item_filter( std::string filter ) { size_t colon; @@ -87,6 +118,32 @@ std::function basic_item_filter( std::string filter ) } return false; }; + // by can contain length + case 'L': { + return can_contain_filter( "Failed to convert '%s' to length.\nValid examples:\n122 cm\n1101mm\n2 meter", + filter, units::length_max, units::length_units, []( itype * typ, units::length len ) { + typ->longest_side = len; + item itm( typ ); + itm.set_flag( flag_HARD ); + return itm; + } ); + } + // by can contain volume + case 'V': { + return can_contain_filter( "Failed to convert '%s' to volume.\nValid examples:\n750 ml\n4L", + filter, units::volume_max, units::volume_units, []( itype * typ, units::volume vol ) { + typ->volume = vol; + return item( typ ); + } ); + } + // by can contain mass + case 'M': { + return can_contain_filter( "Failed to convert '%s' to mass.\nValid examples:\n12 mg\n400g\n25 kg", + filter, units::mass_max, units::mass_units, []( itype * typ, units::mass mas ) { + typ->weight = mas; + return item( typ ); + } ); + } // covers bodypart case 'v': { std::unordered_set filtered_bodyparts; diff --git a/src/output.cpp b/src/output.cpp index ab62899d31507..fed3ddc345241 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -1081,6 +1081,9 @@ static const std::vector item_filter_prefixes = { { 'f', to_translation( "freezerburn" ), to_translation( "hidden flags of an item" ) }, { 's', to_translation( "devices" ), to_translation( "skill taught by books" ) }, { 'd', to_translation( "pipe" ), to_translation( "disassembled components" ) }, + { 'L', to_translation( "122 cm" ), to_translation( "can contain item of length" ) }, + { 'V', to_translation( "450 ml" ), to_translation( "can contain item of volume" ) }, + { 'M', to_translation( "250 kg" ), to_translation( "can contain item of mass" ) }, { 'v', to_translation( "hand" ), to_translation( "covers body part" ) }, { 'e', to_translation( "close to skin" ), to_translation( "covers layer" ) }, { 'b', to_translation( "mre;sealed" ), to_translation( "items satisfying both conditions" ) } From 3a03335db0ca620ee81d0d980593dd12439d4ce0 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:32:06 +0000 Subject: [PATCH 114/158] Remove the keybind to avoid accidental keypresses --- data/raw/keybindings.json | 7 ------- src/veh_appliance.cpp | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/data/raw/keybindings.json b/data/raw/keybindings.json index 389735123a80e..4d005f545b637 100644 --- a/data/raw/keybindings.json +++ b/data/raw/keybindings.json @@ -1799,13 +1799,6 @@ "name": "Plug in appliance", "bindings": [ { "input_method": "keyboard_any", "key": "g" } ] }, - { - "type": "keybinding", - "id": "HIDE", - "category": "APP_INTERACT", - "name": "Hide/Unhide wiring", - "bindings": [ { "input_method": "keyboard_any", "key": "h" } ] - }, { "type": "keybinding", "id": "DISCONNECT_GRID", diff --git a/src/veh_appliance.cpp b/src/veh_appliance.cpp index 91aab9ac0a4ca..672ba57e6e570 100644 --- a/src/veh_appliance.cpp +++ b/src/veh_appliance.cpp @@ -599,7 +599,7 @@ void veh_app_interact::populate_app_actions() app_actions.emplace_back( [this]() { hide(); } ); - imenu.addentry( -1, true, ctxt.keys_bound_to( "HIDE" ).front(), ctxt.get_action_name( "HIDE" ) ); + imenu.addentry( -1, true, 0, "Hide/Unhide wiring" ); } #endif From 5101836e69b18990565133fe0a1cb9d5d621c96e Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Thu, 12 Dec 2024 21:33:37 +0100 Subject: [PATCH 115/158] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/mods/TEST_DATA/expected_dps_data/junk_dps.json | 4 ++-- .../mods/TEST_DATA/expected_dps_data/two_handed_axes_dps.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/mods/TEST_DATA/expected_dps_data/junk_dps.json b/data/mods/TEST_DATA/expected_dps_data/junk_dps.json index be67f8f2273dd..245604f16e4ad 100644 --- a/data/mods/TEST_DATA/expected_dps_data/junk_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/junk_dps.json @@ -52,8 +52,8 @@ "landough_calrisean": 5.49, "flask_yeast": 5.49, "fishing_rod_basic": 7.52, - "torch": 5.40, - "torch_lit": 5.40, + "torch": 5.4, + "torch_lit": 5.4, "pipe_quiver_large": 5.83, "bipod_handguard": 7.69, "bipod_mod": 7.69, diff --git a/data/mods/TEST_DATA/expected_dps_data/two_handed_axes_dps.json b/data/mods/TEST_DATA/expected_dps_data/two_handed_axes_dps.json index d1d439cebd4dc..0fbd68a2789e9 100644 --- a/data/mods/TEST_DATA/expected_dps_data/two_handed_axes_dps.json +++ b/data/mods/TEST_DATA/expected_dps_data/two_handed_axes_dps.json @@ -11,7 +11,7 @@ "copper_ax": 13.75, "e_combatsaw_on": 29, "combatsaw_on": 29, - "chainsaw_on": 22.00, + "chainsaw_on": 22.0, "circsaw_on": 25.32, "e_combatsaw_off": 3.0, "combatsaw_off": 3.0, From 07a51483e45da10892d1a41bdb9508d9331f3002 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 15:20:54 -0600 Subject: [PATCH 116/158] Initial commit --- data/mods/Magiclysm/Spells/magus.json | 23 +++++++++++++++++++ .../furniture_pure_magic.json | 15 ++++++++++++ .../mods/Magiclysm/itemgroups/itemgroups.json | 3 ++- .../mods/Magiclysm/itemgroups/spellbooks.json | 1 + data/mods/Magiclysm/items/spell_scrolls.json | 9 ++++++++ .../requirements/spell_components.json | 6 +++++ .../ter_fur_transform/ter_fur_transform.json | 7 ++++++ 7 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json diff --git a/data/mods/Magiclysm/Spells/magus.json b/data/mods/Magiclysm/Spells/magus.json index a82a26ec29ef8..d77a4f76a61f8 100644 --- a/data/mods/Magiclysm/Spells/magus.json +++ b/data/mods/Magiclysm/Spells/magus.json @@ -781,5 +781,28 @@ "energy_source": "MANA", "base_casting_time": 100, "base_energy_cost": 75 + }, + { + "id": "magus_permanent_light", + "type": "SPELL", + "name": "Imperishable Light", + "description": "Enchant the air in a location to glow, producing a orb of soft light. While not particularly bright, the light will last years if you're unlucky and millennia if you are.", + "valid_targets": [ "ground" ], + "effect": "ter_transform", + "effect_str": "ter_magus_permanent_light", + "shape": "blast", + "flags": [ "CONJURATION_SPELL", "SOMATIC", "VERBAL" ], + "components": "spell_components_magus_permanent_light", + "max_level": 15, + "spell_class": "MAGUS", + "energy_source": "MANA", + "difficulty": 8, + "min_range": 1, + "max_range": 1, + "base_casting_time": 180000, + "base_energy_cost": 2500, + "final_energy_cost": 1500, + "energy_increment": -75, + "extra_effects": [ { "id": "eoc_summon_setup", "hit_self": true } ] } ] diff --git a/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json b/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json new file mode 100644 index 0000000000000..2ea38b2085cfd --- /dev/null +++ b/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json @@ -0,0 +1,15 @@ +[ + { + "type": "furniture", + "id": "f_magus_permanent_light", + "name": "imperishable light", + "description": "A glowing orb of light floats here, emitting a soft radiance.", + "symbol": "*", + "color": "white", + "move_cost_mod": 0, + "light_emitted": 35, + "required_str": -1, + "flags": [ "TRANSPARENT", "PERMEABLE", "TINY", "THIN_OBSTACLE" ], + "bash": { "str_min": 9999, "str_max": 9999 } + } +] diff --git a/data/mods/Magiclysm/itemgroups/itemgroups.json b/data/mods/Magiclysm/itemgroups/itemgroups.json index 389c8fd52cf89..c207d564e6ee8 100644 --- a/data/mods/Magiclysm/itemgroups/itemgroups.json +++ b/data/mods/Magiclysm/itemgroups/itemgroups.json @@ -1237,7 +1237,8 @@ { "item": "spell_scroll_magus_mana_blast", "prob": 50 }, { "item": "spell_scroll_magus_haste", "prob": 50 }, { "item": "spell_scroll_magus_diamond_imbuement", "prob": 30 }, - { "item": "spell_scroll_magus_slow", "prob": 50 } + { "item": "spell_scroll_magus_slow", "prob": 50 }, + { "item": "spell_scroll_magus_permanent_light", "prob": 30 } ], "prob": 10 }, diff --git a/data/mods/Magiclysm/itemgroups/spellbooks.json b/data/mods/Magiclysm/itemgroups/spellbooks.json index 92c41fbcabcb3..ed318dfdaf2f2 100644 --- a/data/mods/Magiclysm/itemgroups/spellbooks.json +++ b/data/mods/Magiclysm/itemgroups/spellbooks.json @@ -239,6 +239,7 @@ [ "spell_scroll_summon_magic_motorcycle", 5 ], [ "spell_scroll_animist_spirit_walking", 10 ], [ "spell_scroll_magus_haste", 50 ], + [ "spell_scroll_magus_permanent_light", 30 ], [ "bio_sneeze_beam", 50 ], [ "spell_scroll_druid_beguile_savage_beast", 10 ], [ "spell_scroll_druid_thornskin", 20 ], diff --git a/data/mods/Magiclysm/items/spell_scrolls.json b/data/mods/Magiclysm/items/spell_scrolls.json index 48d16c7d2055b..3567e2ea56411 100644 --- a/data/mods/Magiclysm/items/spell_scrolls.json +++ b/data/mods/Magiclysm/items/spell_scrolls.json @@ -2121,5 +2121,14 @@ "name": { "str": "Scroll of Mind Crush", "str_pl": "Scrolls of Mind Crush" }, "description": "Use your own spirit to attack the target's spirit.", "use_action": { "type": "learn_spell", "spells": [ "animist_do_psionic_damage_to_head" ] } + }, + { + "type": "BOOK", + "copy-from": "spell_scroll", + "id": "spell_scroll_magus_permanent_light", + "//": "Magus spell", + "name": { "str": "Scroll of Imperishable Light", "str_pl": "Scrolls of Imperishable Light" }, + "description": "Create a permanent glowing orb of light in the air. Well, it will take a few years to see if it's really permanent; hopefully you'll live to know the answer.", + "use_action": { "type": "learn_spell", "spells": [ "magus_permanent_light" ] } } ] diff --git a/data/mods/Magiclysm/requirements/spell_components.json b/data/mods/Magiclysm/requirements/spell_components.json index d0a65e789e6c4..3b57713e125d6 100644 --- a/data/mods/Magiclysm/requirements/spell_components.json +++ b/data/mods/Magiclysm/requirements/spell_components.json @@ -318,5 +318,11 @@ [ "wintergreen_berry", 1 ] ] ] + }, + { + "id": "spell_components_magus_permanent_light", + "type": "requirement", + "//": "Precious metals for the Imperishable Light spell", + "components": [ [ [ "gold_small", 5 ] ], [ [ "silver_small", 5 ] ], [ [ "copper", 5 ] ] ] } ] diff --git a/data/mods/Magiclysm/ter_fur_transform/ter_fur_transform.json b/data/mods/Magiclysm/ter_fur_transform/ter_fur_transform.json index 21784afc0a8a4..3358c548e3aed 100644 --- a/data/mods/Magiclysm/ter_fur_transform/ter_fur_transform.json +++ b/data/mods/Magiclysm/ter_fur_transform/ter_fur_transform.json @@ -616,5 +616,12 @@ "message": "" } ] + }, + { + "type": "ter_furn_transform", + "id": "ter_magus_permanent_light", + "furniture": [ + { "result": "f_magus_permanent_light", "valid_furniture": [ "f_null" ], "message": "The air begins glowing softly." } + ] } ] From 25d201daaa4b72fc0835e95b6f66dae724435bc6 Mon Sep 17 00:00:00 2001 From: Maarifrah Date: Thu, 12 Dec 2024 11:54:57 -0800 Subject: [PATCH 117/158] carcrash-new-houses-bungalows --- data/json/mapgen/house/bungalow06.json | 5 ++++- data/json/mapgen/house/bungalow08.json | 5 ++++- data/json/mapgen/house/bungalow09.json | 16 +++++++++++++++- data/json/mapgen/house/bungalow11.json | 5 ++++- data/json/mapgen/house/bungalow15.json | 5 ++++- data/json/mapgen/house/bungalow16.json | 5 ++++- data/json/mapgen/house/bungalow24.json | 4 ++++ 7 files changed, 39 insertions(+), 6 deletions(-) diff --git a/data/json/mapgen/house/bungalow06.json b/data/json/mapgen/house/bungalow06.json index df0007a575496..4c02fb4ab934d 100644 --- a/data/json/mapgen/house/bungalow06.json +++ b/data/json/mapgen/house/bungalow06.json @@ -53,7 +53,10 @@ }, "furniture": { "$": "f_exercise", "&": "f_table" }, "items": { "&": { "item": "table_foyer", "chance": 50 } }, - "place_nested": [ { "chunks": [ "rolling_trash_can_1x1" ], "x": 5, "y": 1 } ], + "place_nested": [ + { "chunks": [ "rolling_trash_can_1x1" ], "x": 20, "y": 0 }, + { "chunks": [ [ "null", 95 ], [ "carcrash_10x10_rand", 5 ] ], "x": [ 2, 3 ], "y": 0 } + ], "place_loot": [ { "item": "television", "x": 6, "y": 17 } ] } }, diff --git a/data/json/mapgen/house/bungalow08.json b/data/json/mapgen/house/bungalow08.json index 21a9f58434f8a..f552c1d2cb330 100644 --- a/data/json/mapgen/house/bungalow08.json +++ b/data/json/mapgen/house/bungalow08.json @@ -52,7 +52,10 @@ }, "furniture": { "(": "f_table", "$": "f_piano", "&": "f_chair", "=": "f_rack" }, "items": { "(": { "item": "table_foyer", "chance": 50 }, "=": { "item": "clothing_outdoor_shoes", "chance": 50 } }, - "place_nested": [ { "chunks": [ "rolling_trash_can_1x1" ], "x": 4, "y": 1 } ], + "place_nested": [ + { "chunks": [ "rolling_trash_can_1x1" ], "x": 4, "y": 1 }, + { "chunks": [ [ "null", 95 ], [ "carcrash_8x8_straight", 5 ] ], "x": [ 13, 14 ], "y": 0 } + ], "place_loot": [ { "item": "laptop", "x": 14, "y": 6 } ] } }, diff --git a/data/json/mapgen/house/bungalow09.json b/data/json/mapgen/house/bungalow09.json index 90c138af22eea..df1ca3a1d55a6 100644 --- a/data/json/mapgen/house/bungalow09.json +++ b/data/json/mapgen/house/bungalow09.json @@ -50,7 +50,21 @@ "l": { "param": "carpet_color_type", "fallback": "t_carpet_yellow" }, "s": { "param": "carpet_color_type", "fallback": "t_carpet_yellow" } }, - "place_nested": [ { "chunks": [ "rolling_trash_can_1x1" ], "x": 9, "y": 0 } ], + "place_nested": [ + { + "chunks": [ "rolling_trash_can_1x1" ], + "x": 9, + "y": 0 + }, + { + "chunks": [ + [ "null", 10 ], + [ "carcrash_8x8_straight", 90 ] + ], + "x": [ 14, 15 ], + "y": 0 + } + ], "place_loot": [ { "item": "laptop", "x": 17, "y": 5, "chance": 100 }, { "item": "television", "x": 9, "y": 7, "chance": 100 } ] } }, diff --git a/data/json/mapgen/house/bungalow11.json b/data/json/mapgen/house/bungalow11.json index b53f5f45725e6..83f6845b033c8 100644 --- a/data/json/mapgen/house/bungalow11.json +++ b/data/json/mapgen/house/bungalow11.json @@ -56,7 +56,10 @@ "/": { "item": "clothing_outdoor_shoes", "chance": 40, "repeat": [ 1, 2 ] }, "&": { "item": "table_foyer", "chance": 40 } }, - "place_nested": [ { "chunks": [ "rolling_trash_can_1x1" ], "x": 7, "y": 1 } ], + "place_nested": [ + { "chunks": [ "rolling_trash_can_1x1" ], "x": 7, "y": 1 }, + { "chunks": [ [ "null", 95 ], [ "carcrash_10x10_rand", 5 ] ], "x": 10, "y": 0 } + ], "place_loot": [ { "item": "television", "x": 18, "y": 5 }, { "group": "child_items", "x": [ 2, 6 ], "y": [ 7, 8 ], "chance": 60, "repeat": [ 3, 4 ] } diff --git a/data/json/mapgen/house/bungalow15.json b/data/json/mapgen/house/bungalow15.json index 37ae25f164317..de33cbf8553e3 100644 --- a/data/json/mapgen/house/bungalow15.json +++ b/data/json/mapgen/house/bungalow15.json @@ -66,7 +66,10 @@ }, "place_loot": [ { "item": "lawnmower", "x": 3, "y": 21, "chance": 25 }, { "item": "television", "x": 10, "y": 9, "chance": 100 } ], "place_vehicles": [ { "vehicle": "car", "x": 3, "y": 4, "chance": 30, "fuel": 80, "rotation": 90 } ], - "place_nested": [ { "chunks": [ "rolling_trash_can_1x1" ], "x": 17, "y": 1 } ] + "place_nested": [ + { "chunks": [ "rolling_trash_can_1x1" ], "x": 23, "y": 1 }, + { "chunks": [ [ "null", 95 ], [ "carcrash_10x10_rand", 5 ] ], "x": [ 7, 12 ], "y": 0 } + ] } }, { diff --git a/data/json/mapgen/house/bungalow16.json b/data/json/mapgen/house/bungalow16.json index e9940ffede81e..58a607a93fbc7 100644 --- a/data/json/mapgen/house/bungalow16.json +++ b/data/json/mapgen/house/bungalow16.json @@ -87,7 +87,10 @@ "c": { "item": "guns_pistol_common", "chance": 50 }, "(": { "item": "table_foyer", "chance": 50, "repeat": [ 1, 2 ] } }, - "place_nested": [ { "chunks": [ "rolling_trash_can_1x1" ], "x": 5, "y": 1 } ], + "place_nested": [ + { "chunks": [ "rolling_trash_can_1x1" ], "x": 0, "y": 1 }, + { "chunks": [ [ "null", 95 ], [ "carcrash_10x10_rand", 5 ] ], "x": [ 2, 12 ], "y": 0 } + ], "place_loot": [ { "item": "television", "x": 4, "y": 6, "chance": 100 } ] } }, diff --git a/data/json/mapgen/house/bungalow24.json b/data/json/mapgen/house/bungalow24.json index e6f317e375316..8c81c1d4f7a8c 100644 --- a/data/json/mapgen/house/bungalow24.json +++ b/data/json/mapgen/house/bungalow24.json @@ -58,6 +58,10 @@ }, "furniture": { "!": "f_chair", "$": "f_table" }, "items": { "$": { "item": "table_foyer", "chance": 50, "repeat": [ 1, 2 ] } }, + "place_nested": [ + { "chunks": [ "rolling_trash_can_1x1" ], "x": 0, "y": 1 }, + { "chunks": [ [ "null", 95 ], [ "carcrash_10x10_rand", 5 ] ], "x": [ 10, 13 ], "y": 0 } + ], "place_loot": [ { "item": "television", "x": 15, "y": 9 }, { "item": "laptop", "x": 21, "y": 12 } ] } }, From a7442892f31cded00a1fb45d7b7dd546c3137d5d Mon Sep 17 00:00:00 2001 From: Maarifrah Date: Thu, 12 Dec 2024 13:50:33 -0800 Subject: [PATCH 118/158] forgot to lint one --- data/json/mapgen/house/bungalow09.json | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/data/json/mapgen/house/bungalow09.json b/data/json/mapgen/house/bungalow09.json index df1ca3a1d55a6..04ebf76e95094 100644 --- a/data/json/mapgen/house/bungalow09.json +++ b/data/json/mapgen/house/bungalow09.json @@ -51,19 +51,8 @@ "s": { "param": "carpet_color_type", "fallback": "t_carpet_yellow" } }, "place_nested": [ - { - "chunks": [ "rolling_trash_can_1x1" ], - "x": 9, - "y": 0 - }, - { - "chunks": [ - [ "null", 10 ], - [ "carcrash_8x8_straight", 90 ] - ], - "x": [ 14, 15 ], - "y": 0 - } + { "chunks": [ "rolling_trash_can_1x1" ], "x": 9, "y": 0 }, + { "chunks": [ [ "null", 10 ], [ "carcrash_8x8_straight", 90 ] ], "x": [ 14, 15 ], "y": 0 } ], "place_loot": [ { "item": "laptop", "x": 17, "y": 5, "chance": 100 }, { "item": "television", "x": 9, "y": 7, "chance": 100 } ] } From 585643b13ada7aa8d445fefdbe0a084555ad140c Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:03:39 -0600 Subject: [PATCH 119/158] [Magiclysm] The Forge of Wonders puts no value on food or drink, minimal value on guns and ammo (except the pirates) (#78513) * Initial commit * Guns/ammo too * Artifact values --- data/mods/Magiclysm/npc/TALK_FORGE_HELEN_TAVREL.json | 1 + data/mods/Magiclysm/npc/factions.json | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/data/mods/Magiclysm/npc/TALK_FORGE_HELEN_TAVREL.json b/data/mods/Magiclysm/npc/TALK_FORGE_HELEN_TAVREL.json index 22146fd0fca64..d3198dfe56009 100644 --- a/data/mods/Magiclysm/npc/TALK_FORGE_HELEN_TAVREL.json +++ b/data/mods/Magiclysm/npc/TALK_FORGE_HELEN_TAVREL.json @@ -23,6 +23,7 @@ "bonus_int": { "one_in": 4 }, "bonus_per": { "one_in": 4 }, "shopkeeper_item_group": [ { "group": "NC_FORGE_LORD_STORE_REAGENT_SHOP", "rigid": true } ], + "shopkeeper_price_rules": [ { "category": "guns", "premium": 1 }, { "category": "ammo", "premium": 1 } ], "worn_override": "NC_FORGE_REAGENT_clothes", "weapon_override": "NC_FORGE_REAGENT_wield", "skills": [ diff --git a/data/mods/Magiclysm/npc/factions.json b/data/mods/Magiclysm/npc/factions.json index f5d916501ffce..67d9b92a49c03 100644 --- a/data/mods/Magiclysm/npc/factions.json +++ b/data/mods/Magiclysm/npc/factions.json @@ -138,6 +138,13 @@ "fac_food_supply": { "calories": 2700000000, "vitamins": { "iron": 86400, "calcium": 86400, "vitC": 86400 } }, "wealth": 75000000, "currency": "denarius", + "price_rules": [ + { "category": "drink", "price": 0 }, + { "category": "food", "price": 0 }, + { "category": "guns", "premium": 0.1 }, + { "category": "ammo", "premium": 0.1 }, + { "category": "artifacts", "premium": 1000 } + ], "relations": { "lobby_beggars": { "kill on sight": false, From 6a513aceebae8cd5f134c2bed2f8db159960727a Mon Sep 17 00:00:00 2001 From: terribleperson Date: Thu, 12 Dec 2024 17:09:06 -0500 Subject: [PATCH 120/158] Update gloves.json to change gloves_plate from iron to steel Armored gauntlets are crafted from steel. They should not be made of cast iron. --- data/json/items/armor/gloves.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/json/items/armor/gloves.json b/data/json/items/armor/gloves.json index 3d47fb0bfe1af..a5bd826fa33fd 100644 --- a/data/json/items/armor/gloves.json +++ b/data/json/items/armor/gloves.json @@ -839,7 +839,7 @@ "volume": "1500 ml", "price": "400 USD", "price_postapoc": "30 USD", - "material": [ "iron", "leather" ], + "material": [ "steel", "leather" ], "symbol": "[", "looks_like": "fire_gauntlets", "color": "light_gray", @@ -855,7 +855,7 @@ "specifically_covers": [ "hand_back_l", "hand_back_r" ], "material": [ { "type": "leather", "covered_by_mat": 100, "thickness": 2.0 }, - { "type": "iron", "covered_by_mat": 100, "thickness": 2.0 } + { "type": "steel", "covered_by_mat": 100, "thickness": 2.0 } ] }, { @@ -864,7 +864,7 @@ "specifically_covers": [ "hand_wrist_l", "hand_wrist_r" ], "material": [ { "type": "leather", "covered_by_mat": 100, "thickness": 2.0 }, - { "type": "iron", "covered_by_mat": 100, "thickness": 2.0 } + { "type": "steel", "covered_by_mat": 100, "thickness": 2.0 } ] }, { @@ -879,7 +879,7 @@ "specifically_covers": [ "hand_fingers_l", "hand_fingers_r" ], "material": [ { "type": "leather", "covered_by_mat": 100, "thickness": 2.0 }, - { "type": "iron", "covered_by_mat": 80, "thickness": 2.0 } + { "type": "steel", "covered_by_mat": 80, "thickness": 2.0 } ] } ], From 17abb587b2470bb4fe1855932c94453e13a97e3c Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 16:11:25 -0600 Subject: [PATCH 121/158] Add light dismissal --- .../furniture_pure_magic.json | 26 ++++++++++++++++++- .../ter_fur_transform/ter_fur_transform.json | 7 ++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json b/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json index 2ea38b2085cfd..0b009fbc33ce0 100644 --- a/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json +++ b/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json @@ -10,6 +10,30 @@ "light_emitted": 35, "required_str": -1, "flags": [ "TRANSPARENT", "PERMEABLE", "TINY", "THIN_OBSTACLE" ], - "bash": { "str_min": 9999, "str_max": 9999 } + "bash": { "str_min": 9999, "str_max": 9999 }, + "examine_action": { + "type": "effect_on_condition", + "effect_on_conditions": [ + { + "id": "EOC_REMOVE_MAGUS_LIGHT", + "condition": { "u_query": "Dimiss the imperishable light?", "default": false }, + "effect": [ + { + "u_map_run_eocs": [ + { + "id": "EOC_REMOVE_MAGUS_LIGHT_2", + "effect": [ { "u_cast_spell": { "id": "magus_permanent_light" }, "loc": { "context_val": "loc" } } ], + "false_effect": { "u_message": "There is no nearby light to dismiss.", "type": "bad" } + } + ], + "range": 1, + "store_coordinates_in": { "context_val": "loc" }, + "stop_at_first": true, + "condition": { "map_furniture_id": "f_magus_permanent_light", "loc": { "context_val": "loc" } } + } + ] + } + ] + } } ] diff --git a/data/mods/Magiclysm/ter_fur_transform/ter_fur_transform.json b/data/mods/Magiclysm/ter_fur_transform/ter_fur_transform.json index 3358c548e3aed..ae71a1a4dadb0 100644 --- a/data/mods/Magiclysm/ter_fur_transform/ter_fur_transform.json +++ b/data/mods/Magiclysm/ter_fur_transform/ter_fur_transform.json @@ -621,7 +621,12 @@ "type": "ter_furn_transform", "id": "ter_magus_permanent_light", "furniture": [ - { "result": "f_magus_permanent_light", "valid_furniture": [ "f_null" ], "message": "The air begins glowing softly." } + { "result": "f_magus_permanent_light", "valid_furniture": [ "f_null" ], "message": "The air begins glowing softly." }, + { + "result": "f_null", + "valid_furniture": [ "f_magus_permanent_light" ], + "message": "The imperishable light winks out." + } ] } ] From 9433ff2ea363692221345c6211a01855b71353e9 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 16:15:49 -0600 Subject: [PATCH 122/158] wording --- data/mods/Magiclysm/Spells/magus.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/Magiclysm/Spells/magus.json b/data/mods/Magiclysm/Spells/magus.json index d77a4f76a61f8..9a45efd2b4957 100644 --- a/data/mods/Magiclysm/Spells/magus.json +++ b/data/mods/Magiclysm/Spells/magus.json @@ -786,7 +786,7 @@ "id": "magus_permanent_light", "type": "SPELL", "name": "Imperishable Light", - "description": "Enchant the air in a location to glow, producing a orb of soft light. While not particularly bright, the light will last years if you're unlucky and millennia if you are.", + "description": "Enchant the air in a location to glow, producing a orb of soft light. While not particularly bright, the light will last years if you're not lucky and millennia if you are.", "valid_targets": [ "ground" ], "effect": "ter_transform", "effect_str": "ter_magus_permanent_light", From a8af00280e1867dc43ddd74e38d0db5150e24659 Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:17:18 -0600 Subject: [PATCH 123/158] [Magiclysm/Innawood] Allow troll caves to spawn innawood (#78509) * Initial commit * Fix id --- .../mod_interactions/innawood/deathdrops.json | 43 ++++++++++++ .../innawood/mapgen/caves.json | 68 +++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 data/mods/Magiclysm/mod_interactions/innawood/deathdrops.json create mode 100644 data/mods/Magiclysm/mod_interactions/innawood/mapgen/caves.json diff --git a/data/mods/Magiclysm/mod_interactions/innawood/deathdrops.json b/data/mods/Magiclysm/mod_interactions/innawood/deathdrops.json new file mode 100644 index 0000000000000..de26a80319d79 --- /dev/null +++ b/data/mods/Magiclysm/mod_interactions/innawood/deathdrops.json @@ -0,0 +1,43 @@ +[ + { + "type": "item_group", + "subtype": "collection", + "id": "default_zombie_death_drops", + "entries": [ + { + "distribution": [ + { "group": "default_innawood_zombie_clothes_male", "prob": 50 }, + { "group": "default_innawood_zombie_clothes_female", "prob": 50 } + ], + "prob": 100 + }, + { "group": "coats_unisex", "prob": 20 }, + { "group": "common_gloves", "prob": 20 }, + { "group": "hatstore_hats", "prob": 20 }, + { "group": "scarfs_unisex", "prob": 20 }, + { "group": "shoes_unisex", "prob": 20 } + ] + }, + { + "type": "item_group", + "subtype": "collection", + "id": "default_innawood_zombie_clothes_male", + "entries": [ + { "group": "male_underwear_bottom", "prob": 95 }, + { "group": "male_underwear_top", "prob": 50 }, + { "group": "pants_male", "prob": 95 }, + { "group": "shirts", "prob": 40 } + ] + }, + { + "type": "item_group", + "subtype": "collection", + "id": "default_innawood_zombie_clothes_female", + "entries": [ + { "group": "female_underwear_bottom", "prob": 95 }, + { "group": "female_underwear_top", "prob": 95 }, + { "group": "pants_female", "prob": 95 }, + { "group": "shirts", "prob": 40 } + ] + } +] diff --git a/data/mods/Magiclysm/mod_interactions/innawood/mapgen/caves.json b/data/mods/Magiclysm/mod_interactions/innawood/mapgen/caves.json new file mode 100644 index 0000000000000..2f16edc868982 --- /dev/null +++ b/data/mods/Magiclysm/mod_interactions/innawood/mapgen/caves.json @@ -0,0 +1,68 @@ +[ + { + "type": "mapgen", + "method": "json", + "om_terrain": [ "cave_underground_innawood" ], + "weight": 300, + "object": { + "fill_ter": "t_dirt_underground", + "rotation": [ 0, 3 ], + "rows": [ + "..................~~~~..", + "..... ........ ~~~.", + "... BB....... ~~~", + ".. BB BB ...... ..", + ".. BB BB........ ...", + ".. BB........ ...", + "...BB ..... ..", + "....B BB .XXXX .", + "..... BB.. XXXX ", + "..... ........ XXXXX ", + "..... ........... XXXX ", + ".. ........... XX.", + ". ....... ...", + ". ...... ...", + ". .. .... ..... ...", + ". ..YY.... ..... ...", + ". .YY.... ... ...", + "... ..... ... ...", + "...___... .....", + ".._____.. .....", + "._______.. ........", + "._______... .........", + ".._____..... ...........", + "....__......>..........." + ], + "terrain": { + ".": "t_soil", + " ": "t_dirt_underground", + "_": "t_dirt_underground", + "X": "t_dirt_underground", + "Y": "t_dirt_underground", + "B": "t_dirt_underground", + ">": "t_slope_up", + "~": "t_water_sh_underground" + }, + "furniture": { "B": "f_straw_bed" }, + "items": { + "_": { "item": "midden_heap", "chance": 40, "repeat": [ 1, 2 ] }, + " ": { "item": "midden_heap", "chance": 2 }, + "X": [ + { "item": "corpses", "chance": 5, "repeat": 1 }, + { "item": "stone_troll_lair_treasure", "chance": 2 }, + { "item": "default_zombie_death_drops", "chance": 15 } + ], + "Y": [ + { "item": "corpses", "chance": 100, "repeat": [ 1, 2 ] }, + { "item": "default_zombie_death_drops", "chance": 100, "repeat": [ 1, 3 ] }, + { "item": "stone_troll_lair_treasure", "chance": 20, "repeat": [ 1, 2 ] } + ] + }, + "place_fields": [ + { "field": "fd_blood", "x": [ 17, 21 ], "y": [ 7, 11 ], "repeat": [ 4, 6 ] }, + { "field": "fd_blood", "x": [ 6, 7 ], "y": [ 14, 16 ], "repeat": [ 4, 6 ] } + ], + "place_monster": [ { "monster": "mon_troll_stone", "x": [ 1, 21 ], "y": [ 1, 21 ], "chance": 60, "repeat": [ 3, 6 ] } ] + } + } +] From d7b4df70ccf9b6658d5a40e908f0eae337b88d04 Mon Sep 17 00:00:00 2001 From: Standing-Storm <120433252+Standing-Storm@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:18:04 -0600 Subject: [PATCH 124/158] [Magiclysm] Rock trolls actually turn to stone (#78510) * Initial commit * Add rock troll stone statue --- .../effect_on_conditions/death_effects.json | 7 ++++++ .../furniture_stone.json | 22 +++++++++++++++++++ data/mods/Magiclysm/monsters/monsters.json | 2 +- .../ter_fur_transform/death_effects.json | 7 ++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 data/mods/Magiclysm/effect_on_conditions/death_effects.json create mode 100644 data/mods/Magiclysm/furniture_and_terrain/furniture_stone.json create mode 100644 data/mods/Magiclysm/ter_fur_transform/death_effects.json diff --git a/data/mods/Magiclysm/effect_on_conditions/death_effects.json b/data/mods/Magiclysm/effect_on_conditions/death_effects.json new file mode 100644 index 0000000000000..8eeccbe4d9679 --- /dev/null +++ b/data/mods/Magiclysm/effect_on_conditions/death_effects.json @@ -0,0 +1,7 @@ +[ + { + "type": "effect_on_condition", + "id": "EOC_ROCK_TROLL_TURN_TO_STONE", + "effect": [ { "npc_transform_radius": 0, "ter_furn_transform": "ter_rock_troll_death" } ] + } +] diff --git a/data/mods/Magiclysm/furniture_and_terrain/furniture_stone.json b/data/mods/Magiclysm/furniture_and_terrain/furniture_stone.json new file mode 100644 index 0000000000000..52b4718f6fec7 --- /dev/null +++ b/data/mods/Magiclysm/furniture_and_terrain/furniture_stone.json @@ -0,0 +1,22 @@ +[ + { + "type": "furniture", + "id": "f_rock_troll_statue", + "name": "rock troll statue", + "description": "A massive block of stone in the shape of a rock troll, because it used to be a rock troll.", + "looks_like": "f_statue", + "symbol": "T", + "color": "dark_gray", + "move_cost_mod": -1, + "coverage": 50, + "required_str": 10, + "flags": [ "PLACE_ITEM", "BLOCKSDOOR", "MINEABLE", "SIGN" ], + "bash": { + "str_min": 16, + "str_max": 40, + "sound": "smash!", + "sound_fail": "thump.", + "items": [ { "item": "rock", "count": [ 2, 12 ] } ] + } + } +] diff --git a/data/mods/Magiclysm/monsters/monsters.json b/data/mods/Magiclysm/monsters/monsters.json index 1d717c5bfcd58..ee39325a4a1a5 100644 --- a/data/mods/Magiclysm/monsters/monsters.json +++ b/data/mods/Magiclysm/monsters/monsters.json @@ -366,7 +366,7 @@ "melee_damage": [ { "damage_type": "bash", "amount": 18 } ], "armor": { "bash": 15, "stab": 40, "cut": 35, "bullet": 13, "heat": -30, "acid": -30 }, "extend": { "flags": [ "SUNDEATH" ] }, - "death_function": { "corpse_type": "NO_CORPSE", "message": "The %s turns to stone." } + "death_function": { "eoc": "EOC_ROCK_TROLL_TURN_TO_STONE", "corpse_type": "NO_CORPSE", "message": "The %s turns to stone." } }, { "id": "mon_troll_water", diff --git a/data/mods/Magiclysm/ter_fur_transform/death_effects.json b/data/mods/Magiclysm/ter_fur_transform/death_effects.json new file mode 100644 index 0000000000000..49347521690d1 --- /dev/null +++ b/data/mods/Magiclysm/ter_fur_transform/death_effects.json @@ -0,0 +1,7 @@ +[ + { + "type": "ter_furn_transform", + "id": "ter_rock_troll_death", + "furniture": [ { "result": "f_rock_troll_statue", "valid_furniture": [ "f_null", "f_straw_bed" ] } ] + } +] From ae5467420e9ee8de954d3ded08f746d773f1da3b Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 16:42:26 -0600 Subject: [PATCH 125/158] Initial commit --- data/mods/Magiclysm/Spells/druid.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/Magiclysm/Spells/druid.json b/data/mods/Magiclysm/Spells/druid.json index 14a2dc18f3e5e..f2c63b5f19a9b 100644 --- a/data/mods/Magiclysm/Spells/druid.json +++ b/data/mods/Magiclysm/Spells/druid.json @@ -381,7 +381,7 @@ "effect": "ter_transform", "effect_str": "druidic_renewal", "shape": "blast", - "flags": [ "RESTORATION_SPELL", "CONCENTRATE", "VERBAL", "SOMATIC", "NO_LEGS", "NO_HANDS", "NO_PROJECTILE" ], + "flags": [ "RESTORATION_SPELL", "CONCENTRATE", "IGNORE_WALLS", "VERBAL", "SOMATIC", "NO_LEGS", "NO_HANDS", "NO_PROJECTILE" ], "spell_class": "DRUID", "energy_source": "HP", "difficulty": 6, From 76cc32ff3c99ce1527e6a92e7cd9d42e02ee83c2 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 17:41:24 -0600 Subject: [PATCH 126/158] Dimiss -> Dismiss --- .../Magiclysm/furniture_and_terrain/furniture_pure_magic.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json b/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json index 0b009fbc33ce0..c3fb17aadd552 100644 --- a/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json +++ b/data/mods/Magiclysm/furniture_and_terrain/furniture_pure_magic.json @@ -16,7 +16,7 @@ "effect_on_conditions": [ { "id": "EOC_REMOVE_MAGUS_LIGHT", - "condition": { "u_query": "Dimiss the imperishable light?", "default": false }, + "condition": { "u_query": "Dismiss the imperishable light?", "default": false }, "effect": [ { "u_map_run_eocs": [ From 772a4b9cb6f1cbececf705f5144ca82281208a4a Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 13 Dec 2024 01:09:14 +0000 Subject: [PATCH 127/158] Add serialisation + deserialisation to hidden --- src/savegame_json.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/savegame_json.cpp b/src/savegame_json.cpp index f87d635107bc3..2228f254b7282 100644 --- a/src/savegame_json.cpp +++ b/src/savegame_json.cpp @@ -3234,6 +3234,7 @@ void vehicle_part::deserialize( const JsonObject &data ) data.read( "locked", locked ); data.read( "last_disconnected", last_disconnected ); data.read( "last_charged", last_charged ); + data.read( "hidden", hidden ); if( migration != nullptr ) { for( const itype_id &it : migration->add_veh_tools ) { @@ -3289,6 +3290,7 @@ void vehicle_part::serialize( JsonOut &json ) const json.member( "locked", locked ); json.member( "last_disconnected", last_disconnected ); json.member( "last_charged", last_charged ); + json.member( "hidden", hidden ); json.end_object(); } From 1bdf9319e311da2e52113aab4a2f629c04a111f6 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 20:43:01 -0600 Subject: [PATCH 128/158] Initial commit --- data/mods/Magiclysm/Spells/druid.json | 37 ++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/data/mods/Magiclysm/Spells/druid.json b/data/mods/Magiclysm/Spells/druid.json index 14a2dc18f3e5e..59dfda1815d67 100644 --- a/data/mods/Magiclysm/Spells/druid.json +++ b/data/mods/Magiclysm/Spells/druid.json @@ -387,6 +387,8 @@ "difficulty": 6, "base_casting_time": 600, "base_energy_cost": 25, + "final_energy_cost": 10, + "energy_increment": -1, "extra_effects": [ { "id": "eoc_restoration_setup", "hit_self": true } ], "max_level": 20, "min_aoe": 1, @@ -1052,7 +1054,7 @@ "id": "druid_renew_forest_spell", "type": "SPELL", "name": "Renewing the Forest", - "description": "While outdoors and not underground, the druid can create a profusion of life around themselves, causing grass to grow through pavement, bushes and flowers to sprout, and trees to grow to full height in moments.", + "description": "While outdoors and not underground, the druid can create a profusion of life around themselves, causing grass to grow through pavement, bushes and flowers to sprout, and trees to grow to full height in moments.\n\nIn addition to mana, this spell also requires hit points to cast and will fail if you are too injured.", "flags": [ "CHANNELING_SPELL", "SOMATIC", "VERBAL" ], "valid_targets": [ "self" ], "max_level": 25, @@ -1062,7 +1064,7 @@ "effect": "effect_on_condition", "effect_str": "EOC_DRUID_RENEW_FOREST_SPELL", "energy_source": "MANA", - "base_energy_cost": 1500, + "base_energy_cost": 150, "base_casting_time": 6000, "extra_effects": [ { "id": "eoc_channeling_setup", "hit_self": true } ] }, @@ -1075,7 +1077,36 @@ { "id": "EOC_DRUID_RENEW_FOREST_SPELL_2", "condition": { "math": [ "u_val('pos_z') == 0" ] }, - "effect": [ { "u_cast_spell": { "id": "druid_renew_forest_spell_real" } } ], + "effect": [ + { "math": [ "u_renew_forest_hp_cost = max( (25 - (u_spell_level('druid_renew_forest_spell') / 2 ) ), 15 )" ] }, + { + "if": { + "and": [ + { "math": [ "u_hp('arm_l') > u_renew_forest_hp_cost" ] }, + { "math": [ "u_hp('arm_r') > u_renew_forest_hp_cost" ] }, + { "math": [ "u_hp('leg_l') > u_renew_forest_hp_cost" ] }, + { "math": [ "u_hp('leg_r') > u_renew_forest_hp_cost" ] }, + { "math": [ "u_hp('torso') > u_renew_forest_hp_cost" ] }, + { "math": [ "u_hp('head') > u_renew_forest_hp_cost" ] } + ] + }, + "then": [ + { + "u_transform_radius": { + "math": [ "( (u_spell_level('druid_renew_forest_spell') * rng(0.8,1.2) ) + rng(1.5,4)) * channeling_proficiency_modifier()" ] + }, + "ter_furn_transform": "ter_druid_renew_forest" + }, + { "math": [ "u_hp('arm_l') -= u_renew_forest_hp_cost" ] }, + { "math": [ "u_hp('arm_r') -= u_renew_forest_hp_cost" ] }, + { "math": [ "u_hp('leg_l') -= u_renew_forest_hp_cost" ] }, + { "math": [ "u_hp('leg_r') -= u_renew_forest_hp_cost" ] }, + { "math": [ "u_hp('torso') -= u_renew_forest_hp_cost" ] }, + { "math": [ "u_hp('head') -= u_renew_forest_hp_cost" ] } + ], + "else": [ { "u_message": "You do not have enough life force to donate it to renew the forest!", "type": "bad" } ] + } + ], "false_effect": { "u_message": "You must be on the surface and not on a building's upper stories to cast Renewing the Forest!", "type": "bad" From e0440ee18b9183090d310f0389689033cbf566d0 Mon Sep 17 00:00:00 2001 From: Alex Mooney Date: Thu, 12 Dec 2024 19:01:12 -0800 Subject: [PATCH 129/158] Allow tests to run torch without prompting --- src/activity_actor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/activity_actor.cpp b/src/activity_actor.cpp index 1130d04eaec3a..23bea93aa962a 100644 --- a/src/activity_actor.cpp +++ b/src/activity_actor.cpp @@ -5424,7 +5424,8 @@ void oxytorch_activity_actor::start( player_activity &act, Character &who ) if( tool->ammo_sufficient( &who, act.moves_total / 100 ) || query_yn( _( "Your %1$s doesn't have enough charges to complete the job. Continue anyway?" ), tool->tname() - ) + ) || + test_mode ) { add_msg_debug( debugmode::DF_ACTIVITY, "%s moves_total: %d", act.id().str(), act.moves_total ); act.moves_left = act.moves_total; From e9fd1c4bd327d79b456d83ad15877e4b4ff179ef Mon Sep 17 00:00:00 2001 From: Alex Mooney Date: Thu, 12 Dec 2024 20:10:49 -0800 Subject: [PATCH 130/158] Tidy up the new string and add a comment --- src/activity_actor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/activity_actor.cpp b/src/activity_actor.cpp index 23bea93aa962a..167802a92e286 100644 --- a/src/activity_actor.cpp +++ b/src/activity_actor.cpp @@ -5423,9 +5423,9 @@ void oxytorch_activity_actor::start( player_activity &act, Character &who ) } if( tool->ammo_sufficient( &who, act.moves_total / 100 ) || query_yn( - _( "Your %1$s doesn't have enough charges to complete the job. Continue anyway?" ), tool->tname() + _( "Your %1$s doesn't have enough charges to complete the job. Continue anyway?" ), tool->tname() ) || - test_mode + test_mode // In the tests, we want to check that the activity can be resumed. ) { add_msg_debug( debugmode::DF_ACTIVITY, "%s moves_total: %d", act.id().str(), act.moves_total ); act.moves_left = act.moves_total; From 385e27fb27f3875c6c23510e95bfa4c1f479c0b6 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Thu, 12 Dec 2024 22:30:31 -0600 Subject: [PATCH 131/158] Kick tests From 510c2cc7bae8a0fb2ca10be6eb5c63807b2c4ba7 Mon Sep 17 00:00:00 2001 From: marilynias Date: Fri, 13 Dec 2024 09:49:54 +0100 Subject: [PATCH 132/158] initial --- data/json/recipes/armor/pets_cow.json | 2 ++ data/json/recipes/armor/pets_dog.json | 1 + data/json/recipes/armor/pets_horse.json | 2 ++ .../Aftershock/recipes/robot_recipes.json | 6 ++-- data/mods/DinoMod/recipes/pets_bear.json | 5 +++ data/mods/DinoMod/recipes/pets_elephant.json | 3 ++ data/mods/DinoMod/recipes/pets_ostrich.json | 3 ++ data/mods/Magiclysm/recipes/armor.json | 36 +++++++++++++++++++ 8 files changed, 56 insertions(+), 2 deletions(-) diff --git a/data/json/recipes/armor/pets_cow.json b/data/json/recipes/armor/pets_cow.json index ca174969a0152..ad2a4c427da96 100644 --- a/data/json/recipes/armor/pets_cow.json +++ b/data/json/recipes/armor/pets_cow.json @@ -6,6 +6,7 @@ "copy-from": "armor_acidchitin", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_BOVINE ARMOR", + "qualities": [ { "id": "CUT_FINE", "level": 1 }, { "id": "SEW", "level": 1 }, { "id": "LEATHER_AWL", "level": 1 } ], "skills_required": [ [ "survival", 4 ], [ "firstaid", 2 ], [ "fabrication", 4 ] ], "time": "10 h 15 m", "using": [ [ "cordage", 7 ] ], @@ -236,6 +237,7 @@ "copy-from": "armor_plarmor", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_BOVINE ARMOR", + "qualities": [ { "id": "HAMMER", "level": 3 } ], "skills_required": [ "tailor", 3 ], "time": "28 h 45 m", "book_learn": [ [ "textbook_tailor", 5 ], [ "tailor_portfolio", 5 ], [ "textbook_armwest", 4 ], [ "textbook_armschina", 4 ] ], diff --git a/data/json/recipes/armor/pets_dog.json b/data/json/recipes/armor/pets_dog.json index 8668b72aec767..cadf748003e9e 100644 --- a/data/json/recipes/armor/pets_dog.json +++ b/data/json/recipes/armor/pets_dog.json @@ -6,6 +6,7 @@ "copy-from": "armor_acidchitin", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_CANINE ARMOR", + "qualities": [ { "id": "CUT_FINE", "level": 1 }, { "id": "SEW", "level": 1 }, { "id": "LEATHER_AWL", "level": 1 } ], "skills_required": [ [ "survival", 4 ], [ "firstaid", 2 ], [ "fabrication", 2 ] ], "time": "3 h 30 m", "using": [ [ "cordage", 1 ], [ "clasps", 3 ] ], diff --git a/data/json/recipes/armor/pets_horse.json b/data/json/recipes/armor/pets_horse.json index c47d2ddb8e1a3..9eefd0e6dbd4c 100644 --- a/data/json/recipes/armor/pets_horse.json +++ b/data/json/recipes/armor/pets_horse.json @@ -6,6 +6,7 @@ "copy-from": "armor_acidchitin", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_EQUINE ARMOR", + "qualities": [ { "id": "CUT_FINE", "level": 1 }, { "id": "SEW", "level": 1 }, { "id": "LEATHER_AWL", "level": 1 } ], "skills_required": [ [ "survival", 4 ], [ "firstaid", 2 ], [ "fabrication", 4 ] ], "time": "8 h 30 m", "using": [ [ "cordage", 7 ] ], @@ -236,6 +237,7 @@ "copy-from": "armor_plarmor", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_EQUINE ARMOR", + "qualities": [ { "id": "HAMMER", "level": 3 } ], "skills_required": [ "tailor", 3 ], "time": "24 h", "book_learn": [ [ "textbook_tailor", 5 ], [ "tailor_portfolio", 5 ], [ "textbook_armwest", 4 ], [ "textbook_armschina", 4 ] ], diff --git a/data/mods/Aftershock/recipes/robot_recipes.json b/data/mods/Aftershock/recipes/robot_recipes.json index d5f6ac353d734..dbdc9f595ea7d 100644 --- a/data/mods/Aftershock/recipes/robot_recipes.json +++ b/data/mods/Aftershock/recipes/robot_recipes.json @@ -66,7 +66,8 @@ [ [ "afs_circuitry_1", 4 ] ], [ [ "afs_energy_storage_3", 1 ] ], [ [ "afs_material_1", 7 ] ] - ] + ], + "qualities": [ { "id": "SCREW", "level": 1 }, { "id": "WRENCH", "level": 1 } ] }, { "result": "bot_utilibot_beehive", @@ -79,7 +80,8 @@ [ [ "afs_energy_storage_3", 1 ] ], [ [ "afs_material_1", 8 ] ], [ [ "robot_controls", 1 ] ] - ] + ], + "qualities": [ { "id": "SCREW", "level": 1 }, { "id": "WRENCH", "level": 1 } ] }, { "type": "recipe", diff --git a/data/mods/DinoMod/recipes/pets_bear.json b/data/mods/DinoMod/recipes/pets_bear.json index 7580190c43835..cd372d665296a 100644 --- a/data/mods/DinoMod/recipes/pets_bear.json +++ b/data/mods/DinoMod/recipes/pets_bear.json @@ -6,6 +6,7 @@ "copy-from": "armor_acidchitin", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_BEAR ARMOR", + "qualities": [ { "id": "CUT_FINE", "level": 1 }, { "id": "SEW", "level": 1 }, { "id": "LEATHER_AWL", "level": 1 } ], "skills_required": [ [ "survival", 4 ], [ "firstaid", 2 ], [ "fabrication", 4 ] ], "time": "8 h 30 m", "using": [ [ "cordage", 7 ] ], @@ -23,6 +24,7 @@ "copy-from": "armor_chitin", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_BEAR ARMOR", + "qualities": [ { "id": "CUT_FINE", "level": 1 }, { "id": "SEW", "level": 1 }, { "id": "LEATHER_AWL", "level": 1 } ], "time": "8 h 30 m", "book_learn": [ [ "textbook_tailor", 5 ], [ "tailor_portfolio", 5 ] ], "skills_required": [ [ "fabrication", 4 ] ], @@ -97,6 +99,7 @@ "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_BEAR ARMOR", "activity_level": "LIGHT_EXERCISE", + "qualities": [ { "id": "COOK", "level": 3 }, { "id": "LEATHER_AWL", "level": 1 } ], "skills_required": [ "tailor", 6 ], "time": "10 h 30 m", "autolearn": true, @@ -131,6 +134,7 @@ "activity_level": "LIGHT_EXERCISE", "difficulty": 4, "time": "6 h 30 m", + "qualities": [ { "id": "COOK", "level": 3 }, { "id": "LEATHER_AWL", "level": 1 } ], "using": [ [ "sewing_standard", 75 ], [ "clasps", 4 ] ], "components": [ [ [ "bone", 39 ], [ "bone_human", 39 ], [ "bone_demihuman", 39 ] ], [ [ "armor_blarmor", 3 ] ] ], "extend": { "proficiencies": [ { "proficiency": "prof_closures" }, { "proficiency": "prof_carving" } ] } @@ -246,6 +250,7 @@ "copy-from": "armor_plarmor", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_BEAR ARMOR", + "qualities": [ { "id": "HAMMER", "level": 3 } ], "skills_required": [ "tailor", 3 ], "time": "24 h", "book_learn": [ [ "textbook_tailor", 5 ], [ "tailor_portfolio", 5 ], [ "textbook_armwest", 4 ], [ "textbook_armschina", 4 ] ], diff --git a/data/mods/DinoMod/recipes/pets_elephant.json b/data/mods/DinoMod/recipes/pets_elephant.json index 346115125bbbb..6c41e3af806c4 100644 --- a/data/mods/DinoMod/recipes/pets_elephant.json +++ b/data/mods/DinoMod/recipes/pets_elephant.json @@ -23,6 +23,7 @@ "copy-from": "armor_chitin", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_ELEPHANT ARMOR", + "qualities": [ { "id": "CUT_FINE", "level": 1 }, { "id": "SEW", "level": 1 }, { "id": "LEATHER_AWL", "level": 1 } ], "time": "8 h 30 m", "book_learn": [ [ "textbook_tailor", 5 ], [ "tailor_portfolio", 5 ] ], "skills_required": [ [ "fabrication", 4 ] ], @@ -97,6 +98,7 @@ "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_ELEPHANT ARMOR", "activity_level": "LIGHT_EXERCISE", + "qualities": [ { "id": "COOK", "level": 3 }, { "id": "LEATHER_AWL", "level": 1 } ], "skills_required": [ "tailor", 6 ], "time": "10 h 30 m", "autolearn": true, @@ -246,6 +248,7 @@ "copy-from": "armor_plarmor", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_ELEPHANT ARMOR", + "qualities": [ { "id": "HAMMER", "level": 3 } ], "skills_required": [ "tailor", 3 ], "time": "24 h", "book_learn": [ [ "textbook_tailor", 5 ], [ "tailor_portfolio", 5 ], [ "textbook_armwest", 4 ], [ "textbook_armschina", 4 ] ], diff --git a/data/mods/DinoMod/recipes/pets_ostrich.json b/data/mods/DinoMod/recipes/pets_ostrich.json index 8af936dd69321..3bbce31d69427 100644 --- a/data/mods/DinoMod/recipes/pets_ostrich.json +++ b/data/mods/DinoMod/recipes/pets_ostrich.json @@ -23,6 +23,7 @@ "copy-from": "armor_chitin", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_OSTRICH ARMOR", + "qualities": [ { "id": "CUT_FINE", "level": 1 }, { "id": "SEW", "level": 1 }, { "id": "LEATHER_AWL", "level": 1 } ], "time": "8 h 30 m", "book_learn": [ [ "textbook_tailor", 5 ], [ "tailor_portfolio", 5 ] ], "skills_required": [ [ "fabrication", 4 ] ], @@ -97,6 +98,7 @@ "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_OSTRICH ARMOR", "activity_level": "LIGHT_EXERCISE", + "qualities": [ { "id": "COOK", "level": 3 }, { "id": "LEATHER_AWL", "level": 1 } ], "skills_required": [ "tailor", 6 ], "time": "10 h 30 m", "autolearn": true, @@ -246,6 +248,7 @@ "copy-from": "armor_plarmor", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_OSTRICH ARMOR", + "qualities": [ { "id": "HAMMER", "level": 3 } ], "skills_required": [ "tailor", 3 ], "time": "24 h", "book_learn": [ [ "textbook_tailor", 5 ], [ "tailor_portfolio", 5 ], [ "textbook_armwest", 4 ], [ "textbook_armschina", 4 ] ], diff --git a/data/mods/Magiclysm/recipes/armor.json b/data/mods/Magiclysm/recipes/armor.json index 83441d90642a2..2d7595584f5b7 100644 --- a/data/mods/Magiclysm/recipes/armor.json +++ b/data/mods/Magiclysm/recipes/armor.json @@ -56,6 +56,12 @@ "result": "xl_armguard_demonchitin", "type": "recipe", "copy-from": "armguard_demonchitin", + "qualities": [ + { "id": "CHISEL", "level": 1 }, + { "id": "SEW", "level": 3 }, + { "id": "LEATHER_AWL", "level": 1 }, + { "id": "MANA_INFUSE", "level": 2 } + ], "time": "3 h", "components": [ [ [ "cordage_superior", 1, "LIST" ] ], [ [ "demon_chitin_plate", 1 ] ], [ [ "demon_chitin_piece", 3 ] ] ] }, @@ -87,6 +93,12 @@ "result": "xl_armor_demonchitin", "type": "recipe", "copy-from": "armor_demonchitin", + "qualities": [ + { "id": "CHISEL", "level": 1 }, + { "id": "SEW", "level": 3 }, + { "id": "LEATHER_AWL", "level": 1 }, + { "id": "MANA_INFUSE", "level": 2 } + ], "time": "5 h", "components": [ [ [ "cordage_superior", 1, "LIST" ] ], [ [ "demon_chitin_plate", 1 ] ], [ [ "demon_chitin_piece", 10 ] ] ] }, @@ -118,6 +130,12 @@ "result": "xl_boots_demonchitin", "type": "recipe", "copy-from": "boots_demonchitin", + "qualities": [ + { "id": "CHISEL", "level": 1 }, + { "id": "SEW", "level": 3 }, + { "id": "LEATHER_AWL", "level": 1 }, + { "id": "MANA_INFUSE", "level": 2 } + ], "time": "4 h", "components": [ [ [ "cordage_superior", 1, "LIST" ] ], [ [ "demon_chitin_plate", 1 ] ], [ [ "demon_chitin_piece", 5 ] ] ] }, @@ -149,6 +167,12 @@ "result": "xl_gauntlets_demonchitin", "type": "recipe", "copy-from": "gauntlets_demonchitin", + "qualities": [ + { "id": "CHISEL", "level": 1 }, + { "id": "SEW", "level": 3 }, + { "id": "LEATHER_AWL", "level": 1 }, + { "id": "MANA_INFUSE", "level": 2 } + ], "time": "3 h", "components": [ [ [ "cordage_superior", 1, "LIST" ] ], [ [ "demon_chitin_piece", 14 ] ] ] }, @@ -157,6 +181,12 @@ "type": "recipe", "activity_level": "BRISK_EXERCISE", "copy-from": "armor_demonchitin", + "qualities": [ + { "id": "CHISEL", "level": 1 }, + { "id": "SEW", "level": 3 }, + { "id": "LEATHER_AWL", "level": 1 }, + { "id": "MANA_INFUSE", "level": 2 } + ], "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_EQUINE ARMOR", "time": "17 h 30 m", @@ -175,6 +205,12 @@ "type": "recipe", "activity_level": "BRISK_EXERCISE", "copy-from": "armor_demonchitin", + "qualities": [ + { "id": "CHISEL", "level": 1 }, + { "id": "SEW", "level": 3 }, + { "id": "LEATHER_AWL", "level": 1 }, + { "id": "MANA_INFUSE", "level": 2 } + ], "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_CANINE ARMOR", "skills_required": [ [ "spellcraft", 6 ], [ "fabrication", 4 ], [ "survival", 4 ] ], From 711dff8861a7a0f41238ea814f762200a0db1b32 Mon Sep 17 00:00:00 2001 From: marilynias Date: Fri, 13 Dec 2024 10:22:01 +0100 Subject: [PATCH 133/158] finish dinomods/magiclysm --- data/mods/DinoMod/recipes/pets_elephant.json | 1 + data/mods/Magiclysm/recipes/tailoring.json | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/data/mods/DinoMod/recipes/pets_elephant.json b/data/mods/DinoMod/recipes/pets_elephant.json index 6c41e3af806c4..e5e6678f32d44 100644 --- a/data/mods/DinoMod/recipes/pets_elephant.json +++ b/data/mods/DinoMod/recipes/pets_elephant.json @@ -133,6 +133,7 @@ "activity_level": "LIGHT_EXERCISE", "difficulty": 4, "time": "6 h 30 m", + "qualities": [ { "id": "COOK", "level": 3 }, { "id": "LEATHER_AWL", "level": 1 } ], "using": [ [ "sewing_standard", 75 ], [ "clasps", 4 ] ], "components": [ [ [ "bone", 39 ], [ "bone_human", 39 ], [ "bone_demihuman", 39 ] ], [ [ "armor_blarmor", 3 ] ] ], "extend": { "proficiencies": [ { "proficiency": "prof_closures" }, { "proficiency": "prof_carving" } ] } diff --git a/data/mods/Magiclysm/recipes/tailoring.json b/data/mods/Magiclysm/recipes/tailoring.json index 444ba574be4f1..f6621c463d2fa 100644 --- a/data/mods/Magiclysm/recipes/tailoring.json +++ b/data/mods/Magiclysm/recipes/tailoring.json @@ -82,6 +82,7 @@ "copy-from": "gambeson_parabolan", "time": "97 h", "using": [ [ "fastener_large", 2 ], [ "fastener_small", 15 ] ], + "qualities": [ { "id": "SEW", "level": 2 }, { "id": "FABRIC_CUT", "level": 1 } ], "components": [ [ [ "leather_belt", 1 ], [ "webbing_belt", 1 ], [ "santa_belt", 1 ] ], [ [ "parabolan_felt_patch", 3555 ] ], @@ -94,6 +95,7 @@ "copy-from": "gambeson_parabolan", "time": "49 h", "using": [ [ "fastener_large", 2 ], [ "fastener_small", 8 ] ], + "qualities": [ { "id": "SEW", "level": 2 }, { "id": "FABRIC_CUT", "level": 1 } ], "components": [ [ [ "leather_belt", 1 ], [ "webbing_belt", 1 ], [ "santa_belt", 1 ] ], [ [ "parabolan_felt_patch", 1777 ] ], @@ -125,6 +127,7 @@ "copy-from": "gambeson_parabolan_thinsleeved", "time": "87 h", "using": [ [ "fastener_large", 2 ], [ "fastener_small", 15 ] ], + "qualities": [ { "id": "SEW", "level": 2 }, { "id": "FABRIC_CUT", "level": 1 } ], "components": [ [ [ "leather_belt", 1 ], [ "webbing_belt", 1 ], [ "santa_belt", 1 ] ], [ [ "parabolan_felt_patch", 3114 ] ], @@ -137,6 +140,7 @@ "copy-from": "gambeson_parabolan_thinsleeved", "time": "44 h", "using": [ [ "fastener_large", 2 ], [ "fastener_small", 8 ] ], + "qualities": [ { "id": "SEW", "level": 2 }, { "id": "FABRIC_CUT", "level": 1 } ], "components": [ [ [ "leather_belt", 1 ], [ "webbing_belt", 1 ], [ "santa_belt", 1 ] ], [ [ "parabolan_felt_patch", 1572 ] ], @@ -168,6 +172,7 @@ "copy-from": "gambeson_parabolan_vest", "time": "54 h", "using": [ [ "fastener_large", 2 ] ], + "qualities": [ { "id": "SEW", "level": 2 }, { "id": "FABRIC_CUT", "level": 1 } ], "components": [ [ [ "leather_belt", 1 ], [ "webbing_belt", 1 ], [ "santa_belt", 1 ] ], [ [ "parabolan_felt_patch", 2736 ] ], @@ -180,6 +185,7 @@ "copy-from": "gambeson_parabolan_vest", "time": "27 h", "using": [ [ "fastener_large", 2 ] ], + "qualities": [ { "id": "SEW", "level": 2 }, { "id": "FABRIC_CUT", "level": 1 } ], "components": [ [ [ "leather_belt", 1 ], [ "webbing_belt", 1 ], [ "santa_belt", 1 ] ], [ [ "parabolan_felt_patch", 1368 ] ], @@ -207,6 +213,7 @@ "copy-from": "gambeson_pants_parabolan", "time": "60 h", "using": [ [ "fastener_small", 7 ] ], + "qualities": [ { "id": "SEW", "level": 2 }, { "id": "FABRIC_CUT", "level": 1 } ], "components": [ [ [ "parabolan_felt_patch", 820 ] ], [ [ "parabolan_yarn", 600 ] ] ] }, { @@ -215,6 +222,7 @@ "copy-from": "gambeson_pants_parabolan", "time": "30 h", "using": [ [ "fastener_small", 5 ] ], + "qualities": [ { "id": "SEW", "level": 2 }, { "id": "FABRIC_CUT", "level": 1 } ], "components": [ [ [ "parabolan_felt_patch", 410 ] ], [ [ "parabolan_yarn", 300 ] ] ] }, { @@ -238,6 +246,7 @@ "copy-from": "gambeson_gloves_parabolan", "time": "12 h", "using": [ [ "fastener_small", 3 ] ], + "qualities": [ { "id": "SEW", "level": 2 }, { "id": "FABRIC_CUT", "level": 1 } ], "components": [ [ [ "parabolan_felt_patch", 174 ] ], [ [ "parabolan_yarn", 135 ] ] ] }, { @@ -246,6 +255,7 @@ "copy-from": "gambeson_gloves_parabolan", "time": "6 h", "using": [ [ "fastener_small", 2 ] ], + "qualities": [ { "id": "SEW", "level": 2 }, { "id": "FABRIC_CUT", "level": 1 } ], "components": [ [ [ "parabolan_felt_patch", 87 ] ], [ [ "parabolan_yarn", 67 ] ] ] } ] From 6935f6a749a3ecf7b7a734b29030e699ddebe516 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Fri, 13 Dec 2024 11:49:35 +0100 Subject: [PATCH 134/158] fix cellphone --- data/json/items/tool/electronics.json | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/data/json/items/tool/electronics.json b/data/json/items/tool/electronics.json index 16932cece5cdd..66b9c04a1a7d2 100644 --- a/data/json/items/tool/electronics.json +++ b/data/json/items/tool/electronics.json @@ -75,13 +75,16 @@ "name": { "str": "cellphone - Flashlight", "str_pl": "cellphones - Flashlight" }, "power_draw": "500 mW", "revert_to": "cell_phone", - "use_action": { - "ammo_scale": 0, - "target": "cell_phone", - "msg": "You turn off the screen.", - "menu_text": "Turn off", - "type": "transform" - }, + "use_action": [ + { + "ammo_scale": 0, + "target": "cell_phone", + "msg": "You turn off the screen.", + "menu_text": "Turn off", + "type": "transform" + }, + { "type": "link_up", "cable_length": 3, "charge_rate": "20 W" } + ], "flags": [ "NO_UNLOAD", "NO_RELOAD", "WATCH", "LIGHT_8", "CHARGEDIM", "TRADER_AVOID", "WATER_BREAK", "ELECTRONIC" ] }, { From b799d5dba2bb184b606de0885800923a00dd7e55 Mon Sep 17 00:00:00 2001 From: Procyonae <45432782+Procyonae@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:11:20 +0000 Subject: [PATCH 135/158] Update obsolete_overmap_terrain.json --- .../obsolete_overmap_terrain.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/json/obsoletion_and_migration_0.I/obsolete_overmap_terrain.json b/data/json/obsoletion_and_migration_0.I/obsolete_overmap_terrain.json index da15138785f56..cbfa052d959f2 100644 --- a/data/json/obsoletion_and_migration_0.I/obsolete_overmap_terrain.json +++ b/data/json/obsoletion_and_migration_0.I/obsolete_overmap_terrain.json @@ -39,7 +39,10 @@ "bunker_shop_b_south": "solid_earth", "bunker_shop_b_east": "solid_earth", "bunker_shop_b_west": "solid_earth", - "megastore_parking": "omt_obsolete" + "megastore_parking_north": "s_lot_no_sidewalk_north", + "megastore_parking_east": "s_lot_no_sidewalk_east", + "megastore_parking_south": "s_lot_no_sidewalk_south", + "megastore_parking_west": "s_lot_no_sidewalk_west" } }, { From 83c17274ae1c9f8c10ee4210fd28fae114f94d40 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Fri, 13 Dec 2024 14:38:13 +0100 Subject: [PATCH 136/158] attempt to identify randomly failed vehicle_turret_test cause --- tests/vehicle_turrets_test.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/vehicle_turrets_test.cpp b/tests/vehicle_turrets_test.cpp index d9133efe8cf87..9f4a18ab958fa 100644 --- a/tests/vehicle_turrets_test.cpp +++ b/tests/vehicle_turrets_test.cpp @@ -45,10 +45,18 @@ TEST_CASE( "vehicle_turret", "[vehicle][gun][magazine]" ) clear_avatar(); map &here = get_map(); Character &player_character = get_player_character(); + static const vproto_id vehicle_prototype_test_turret_rig( "test_turret_rig" ); + const tripoint_bub_ms veh_pos( 65, 65, here.get_abs_sub().z() ); + // TODO: Get rid of this set of tests when the cause of this test randomly failing has been elimined. + REQUIRE( veh_pos.z() == 0 ); + REQUIRE( vehicle_prototype_test_turret_rig.is_valid() ); + REQUIRE( here.inbounds( veh_pos ) ); + // TODO: End + for( const vpart_info *turret_vpi : all_turret_types() ) { SECTION( turret_vpi->name() ) { - vehicle *veh = here.add_vehicle( STATIC( vproto_id( "test_turret_rig" ) ), - tripoint_bub_ms( 65, 65, here.get_abs_sub().z() ), 270_degrees, 0, 0, false ); + vehicle *veh = here.add_vehicle( vehicle_prototype_test_turret_rig, veh_pos, 270_degrees, 0, 0, + false ); REQUIRE( veh ); veh->unlock(); From 5643ae50cca95671282e3e98bd837da5ba655085 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Fri, 13 Dec 2024 14:56:19 +0100 Subject: [PATCH 137/158] demanded change --- tests/vehicle_turrets_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/vehicle_turrets_test.cpp b/tests/vehicle_turrets_test.cpp index 9f4a18ab958fa..7a8a0f51e949d 100644 --- a/tests/vehicle_turrets_test.cpp +++ b/tests/vehicle_turrets_test.cpp @@ -39,13 +39,14 @@ static std::vector all_turret_types() } // Install, reload and fire every possible vehicle turret. +static const vproto_id vehicle_prototype_test_turret_rig( "test_turret_rig" ); + TEST_CASE( "vehicle_turret", "[vehicle][gun][magazine]" ) { clear_map(); clear_avatar(); map &here = get_map(); Character &player_character = get_player_character(); - static const vproto_id vehicle_prototype_test_turret_rig( "test_turret_rig" ); const tripoint_bub_ms veh_pos( 65, 65, here.get_abs_sub().z() ); // TODO: Get rid of this set of tests when the cause of this test randomly failing has been elimined. REQUIRE( veh_pos.z() == 0 ); From 515375312b835442ba83f32d9ed505659b2ad9cb Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Fri, 13 Dec 2024 15:05:17 +0100 Subject: [PATCH 138/158] demanded change --- tests/vehicle_turrets_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vehicle_turrets_test.cpp b/tests/vehicle_turrets_test.cpp index 7a8a0f51e949d..ba28ad0cc195a 100644 --- a/tests/vehicle_turrets_test.cpp +++ b/tests/vehicle_turrets_test.cpp @@ -25,6 +25,8 @@ static const ammo_effect_str_id ammo_effect_RECYCLED( "RECYCLED" ); +static const vproto_id vehicle_prototype_test_turret_rig("test_turret_rig"); + static std::vector all_turret_types() { std::vector res; @@ -39,8 +41,6 @@ static std::vector all_turret_types() } // Install, reload and fire every possible vehicle turret. -static const vproto_id vehicle_prototype_test_turret_rig( "test_turret_rig" ); - TEST_CASE( "vehicle_turret", "[vehicle][gun][magazine]" ) { clear_map(); From a76d2f304d11e50e575cf2063ea7b0afebeb4d1f Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Fri, 13 Dec 2024 15:05:37 +0100 Subject: [PATCH 139/158] demanded change --- tests/vehicle_turrets_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/vehicle_turrets_test.cpp b/tests/vehicle_turrets_test.cpp index ba28ad0cc195a..1718a8353abf2 100644 --- a/tests/vehicle_turrets_test.cpp +++ b/tests/vehicle_turrets_test.cpp @@ -25,7 +25,7 @@ static const ammo_effect_str_id ammo_effect_RECYCLED( "RECYCLED" ); -static const vproto_id vehicle_prototype_test_turret_rig("test_turret_rig"); +static const vproto_id vehicle_prototype_test_turret_rig( "test_turret_rig" ); static std::vector all_turret_types() { From f53abcec184e4f8868e136642e7ba1a64e9b5be5 Mon Sep 17 00:00:00 2001 From: marilynias Date: Fri, 13 Dec 2024 15:14:05 +0100 Subject: [PATCH 140/158] retest From b7cbd1629dfc45a0ed5829bc269cceb9a5384f9b Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Fri, 13 Dec 2024 15:36:03 +0100 Subject: [PATCH 141/158] Update tests/vehicle_turrets_test.cpp Co-authored-by: Anton Burmistrov --- tests/vehicle_turrets_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/vehicle_turrets_test.cpp b/tests/vehicle_turrets_test.cpp index 1718a8353abf2..3339b25d944f3 100644 --- a/tests/vehicle_turrets_test.cpp +++ b/tests/vehicle_turrets_test.cpp @@ -48,7 +48,7 @@ TEST_CASE( "vehicle_turret", "[vehicle][gun][magazine]" ) map &here = get_map(); Character &player_character = get_player_character(); const tripoint_bub_ms veh_pos( 65, 65, here.get_abs_sub().z() ); - // TODO: Get rid of this set of tests when the cause of this test randomly failing has been elimined. + // TODO: Get rid of this set of tests when the cause of this test randomly failing has been eliminated. REQUIRE( veh_pos.z() == 0 ); REQUIRE( vehicle_prototype_test_turret_rig.is_valid() ); REQUIRE( here.inbounds( veh_pos ) ); From d08bd489b10addd7bcde9b9ba7e236f5dc2d26c2 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Fri, 13 Dec 2024 09:23:09 -0600 Subject: [PATCH 142/158] Initial commit --- data/mods/Magiclysm/Spells/animist.json | 11 ++++++++++- data/mods/Magiclysm/mutations/temporary.json | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/data/mods/Magiclysm/Spells/animist.json b/data/mods/Magiclysm/Spells/animist.json index e358212e51a72..e7607189fcbb2 100644 --- a/data/mods/Magiclysm/Spells/animist.json +++ b/data/mods/Magiclysm/Spells/animist.json @@ -1025,9 +1025,18 @@ { "u_add_effect": "incorporeal", "duration": { "math": [ "( 30 + (u_spell_level('animist_spirit_walking') * 3) ) * (enhancement_proficiency_modifier() )" ] } - } + }, + { "u_add_trait": "ANIMIST_BODY_OF_SPIRIT_APPEARANCE" } ] }, + { + "type": "effect_on_condition", + "id": "EOC_ANIMIST_SPIRIT_WALKING_LOSE_APPEARANCE", + "eoc_type": "EVENT", + "required_event": "character_loses_effect", + "condition": { "and": [ { "compare_string": [ "effect_spirit_walking", { "context_val": "effect" } ] } ] }, + "effect": [ { "u_lose_trait": "ANIMIST_BODY_OF_SPIRIT_APPEARANCE" } ] + }, { "id": "animist_add_evasion_spell", "type": "SPELL", diff --git a/data/mods/Magiclysm/mutations/temporary.json b/data/mods/Magiclysm/mutations/temporary.json index 30b221f302ba1..851f2f7385065 100644 --- a/data/mods/Magiclysm/mutations/temporary.json +++ b/data/mods/Magiclysm/mutations/temporary.json @@ -62,5 +62,15 @@ ] } ] + }, + { + "type": "mutation", + "id": "ANIMIST_BODY_OF_SPIRIT_APPEARANCE", + "name": { "str": "Body of Spirit", "//~": "NO_I18N" }, + "description": { "str": "You're a disembodied spirit so you're all glowy and blue. Spooky!", "//~": "NO_I18N" }, + "points": 0, + "valid": false, + "player_display": false, + "override_look": { "id": "mon_hologram", "tile_category": "monster" } } ] From 4b141ad20da744ea4dfcb2690d1d288bdc1714d3 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Fri, 13 Dec 2024 09:27:05 -0600 Subject: [PATCH 143/158] Add Phase Distance --- data/mods/Magiclysm/effects/effects.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/data/mods/Magiclysm/effects/effects.json b/data/mods/Magiclysm/effects/effects.json index 1e0e9bf3bde98..f0d6cf77b8f99 100644 --- a/data/mods/Magiclysm/effects/effects.json +++ b/data/mods/Magiclysm/effects/effects.json @@ -1359,7 +1359,15 @@ "desc": [ "You have shed your physical form." ], "rating": "good", "show_in_info": true, - "enchantments": [ { "values": [ { "value": "SPEED", "multiply": 3 }, { "value": "MOVE_COST", "multiply": -0.66 } ] } ], + "enchantments": [ + { + "values": [ + { "value": "SPEED", "multiply": 3 }, + { "value": "MOVE_COST", "multiply": -0.66 }, + { "value": "PHASE_DISTANCE", "add": 1 } + ] + } + ], "flags": [ "ETHEREAL", "FEATHER_FALL", From 32d6f3a9daa4de756f80e1cbf2d604827af1a387 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Fri, 13 Dec 2024 09:36:36 -0600 Subject: [PATCH 144/158] Initial commit --- data/mods/Magiclysm/effects/effects.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/mods/Magiclysm/effects/effects.json b/data/mods/Magiclysm/effects/effects.json index 1e0e9bf3bde98..3a312cbc01fb2 100644 --- a/data/mods/Magiclysm/effects/effects.json +++ b/data/mods/Magiclysm/effects/effects.json @@ -1405,6 +1405,10 @@ "values": [ { "value": "MOVE_COST", "multiply": { "math": [ "((u_spell_level('druid_traverse_the_wilds') * -0.015) - 0.05)" ] } } ] + }, + { + "condition": { "math": [ "u_spell_level('druid_traverse_the_wilds') > 7" ] }, + "values": [ { "value": "PHASE_DISTANCE", "add": 2 } ] } ] }, From 685e76c7c8d8ea72daf25c2dea24e142cc193b8e Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Fri, 13 Dec 2024 09:58:17 -0600 Subject: [PATCH 145/158] Initial commit --- .../PowerDescriptionSpoilers.md | 2 +- .../powers/teleportation_eoc.json | 23 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/data/mods/MindOverMatter/PowerDescriptionSpoilers.md b/data/mods/MindOverMatter/PowerDescriptionSpoilers.md index 68791f299ea8b..b10dd1427a2a2 100644 --- a/data/mods/MindOverMatter/PowerDescriptionSpoilers.md +++ b/data/mods/MindOverMatter/PowerDescriptionSpoilers.md @@ -1141,7 +1141,7 @@ Powers causing telepathic damage have a 5% chance to down the target, a 33% chan *Target*: One attuned location
*Duration*: Instant
*Stamina Cost*: 10000, minus 200 per level to a minimum of 6000
-*Channeling Time*: 200 moves, minus 5.5 moves per level to a minimum of 75. Attunement takes 8 hours, minus 30 minutes per power level of Gateway to a minimum of 30 minutes
+*Channeling Time*: 200 moves, minus 5.5 moves per level to a minimum of 75. Attunement takes 8 hours, minus 20 minutes per power level of Gateway to a minimum of 30 minutes
*Effects*: Transport yourself through the Nether to an attuned location. This power works at any distance. You may have a number of destinations simultaneously equal to 1 + 1 per 3 levels of Gateway (2.5 levels if you have the Good Memory trait, 4 levels if you have the Forgetful trait).
*Prerequisites*: Farstep 10, Extended Stride 10
diff --git a/data/mods/MindOverMatter/powers/teleportation_eoc.json b/data/mods/MindOverMatter/powers/teleportation_eoc.json index 044198941fb41..b8ae07411e850 100644 --- a/data/mods/MindOverMatter/powers/teleportation_eoc.json +++ b/data/mods/MindOverMatter/powers/teleportation_eoc.json @@ -124,7 +124,8 @@ { "u_message": "You have successfully memorized the local area, and may now return to it with your powers.", "type": "good" - } + }, + "u_cancel_activity" ] }, { @@ -216,7 +217,7 @@ { "u_assign_activity": "ACT_PSI_TELEPORTER_ATTUNING", "duration": "8 hours" }, { "run_eocs": "EOC_TELEPORT_GATEWAY_ATTUNE_01_SUCCESS", - "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1080), 0, 27000)" ] } + "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1200), 0, 27000)" ] } } ] }, @@ -275,7 +276,7 @@ { "u_assign_activity": "ACT_PSI_TELEPORTER_ATTUNING", "duration": "8 hours" }, { "run_eocs": "EOC_TELEPORT_GATEWAY_ATTUNE_02_SUCCESS", - "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1080), 0, 27000)" ] } + "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1200), 0, 27000)" ] } } ] }, @@ -334,7 +335,7 @@ { "u_assign_activity": "ACT_PSI_TELEPORTER_ATTUNING", "duration": "8 hours" }, { "run_eocs": "EOC_TELEPORT_GATEWAY_ATTUNE_03_SUCCESS", - "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1080), 0, 27000)" ] } + "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1200), 0, 27000)" ] } } ] }, @@ -393,7 +394,7 @@ { "u_assign_activity": "ACT_PSI_TELEPORTER_ATTUNING", "duration": "8 hours" }, { "run_eocs": "EOC_TELEPORT_GATEWAY_ATTUNE_04_SUCCESS", - "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1080), 0, 27000)" ] } + "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1200), 0, 27000)" ] } } ] }, @@ -452,7 +453,7 @@ { "u_assign_activity": "ACT_PSI_TELEPORTER_ATTUNING", "duration": "8 hours" }, { "run_eocs": "EOC_TELEPORT_GATEWAY_ATTUNE_05_SUCCESS", - "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1080), 0, 27000)" ] } + "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1200), 0, 27000)" ] } } ] }, @@ -511,7 +512,7 @@ { "u_assign_activity": "ACT_PSI_TELEPORTER_ATTUNING", "duration": "8 hours" }, { "run_eocs": "EOC_TELEPORT_GATEWAY_ATTUNE_06_SUCCESS", - "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1080), 0, 27000)" ] } + "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1200), 0, 27000)" ] } } ] }, @@ -570,7 +571,7 @@ { "u_assign_activity": "ACT_PSI_TELEPORTER_ATTUNING", "duration": "8 hours" }, { "run_eocs": "EOC_TELEPORT_GATEWAY_ATTUNE_07_SUCCESS", - "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1080), 0, 27000)" ] } + "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1200), 0, 27000)" ] } } ] }, @@ -629,7 +630,7 @@ { "u_assign_activity": "ACT_PSI_TELEPORTER_ATTUNING", "duration": "8 hours" }, { "run_eocs": "EOC_TELEPORT_GATEWAY_ATTUNE_08_SUCCESS", - "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1080), 0, 27000)" ] } + "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1200), 0, 27000)" ] } } ] }, @@ -688,7 +689,7 @@ { "u_assign_activity": "ACT_PSI_TELEPORTER_ATTUNING", "duration": "8 hours" }, { "run_eocs": "EOC_TELEPORT_GATEWAY_ATTUNE_09_SUCCESS", - "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1080), 0, 27000)" ] } + "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1200), 0, 27000)" ] } } ] }, @@ -747,7 +748,7 @@ { "u_assign_activity": "ACT_PSI_TELEPORTER_ATTUNING", "duration": "8 hours" }, { "run_eocs": "EOC_TELEPORT_GATEWAY_ATTUNE_10_SUCCESS", - "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1080), 0, 27000)" ] } + "time_in_future": { "math": [ "28800 - clamp(( u_spell_level('teleport_gateway') * 1200), 0, 27000)" ] } } ] }, From f9de4464b7bfaec762b7d39d6ae6e44ef065a31f Mon Sep 17 00:00:00 2001 From: marilynias Date: Fri, 13 Dec 2024 17:10:30 +0100 Subject: [PATCH 146/158] missed some pet armor --- data/mods/DinoMod/recipes/pets_elephant.json | 1 + data/mods/DinoMod/recipes/pets_ostrich.json | 1 + 2 files changed, 2 insertions(+) diff --git a/data/mods/DinoMod/recipes/pets_elephant.json b/data/mods/DinoMod/recipes/pets_elephant.json index e5e6678f32d44..746f7e0c3a0bd 100644 --- a/data/mods/DinoMod/recipes/pets_elephant.json +++ b/data/mods/DinoMod/recipes/pets_elephant.json @@ -6,6 +6,7 @@ "copy-from": "armor_acidchitin", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_ELEPHANT ARMOR", + "qualities": [ { "id": "CUT_FINE", "level": 1 }, { "id": "SEW", "level": 1 }, { "id": "LEATHER_AWL", "level": 1 } ], "skills_required": [ [ "survival", 4 ], [ "firstaid", 2 ], [ "fabrication", 4 ] ], "time": "8 h 30 m", "using": [ [ "cordage", 7 ] ], diff --git a/data/mods/DinoMod/recipes/pets_ostrich.json b/data/mods/DinoMod/recipes/pets_ostrich.json index 3bbce31d69427..dc3b132821b59 100644 --- a/data/mods/DinoMod/recipes/pets_ostrich.json +++ b/data/mods/DinoMod/recipes/pets_ostrich.json @@ -6,6 +6,7 @@ "copy-from": "armor_acidchitin", "category": "CC_ANIMALS", "subcategory": "CSC_ANIMALS_OSTRICH ARMOR", + "qualities": [ { "id": "CUT_FINE", "level": 1 }, { "id": "SEW", "level": 1 }, { "id": "LEATHER_AWL", "level": 1 } ], "skills_required": [ [ "survival", 4 ], [ "firstaid", 2 ], [ "fabrication", 4 ] ], "time": "8 h 30 m", "using": [ [ "cordage", 7 ] ], From d177a12be79e3317c6f1373fd94198752632961d Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Fri, 13 Dec 2024 10:28:45 -0600 Subject: [PATCH 147/158] Initial commit --- .../MindOverMatter/effects/effects_items.json | 8 ++++++ .../mods/MindOverMatter/items/armor/belt.json | 25 ++++++++++--------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/data/mods/MindOverMatter/effects/effects_items.json b/data/mods/MindOverMatter/effects/effects_items.json index b6e3ac3e77fca..1024f68e0e4e9 100644 --- a/data/mods/MindOverMatter/effects/effects_items.json +++ b/data/mods/MindOverMatter/effects/effects_items.json @@ -56,6 +56,14 @@ "desc": [ "" ], "flags": [ "TELEKIN_SHIELD" ] }, + { + "id": "effect_suppression_belt_fire_protection", + "type": "effect_type", + "//": "Blank to hide effect", + "name": [ "" ], + "desc": [ "" ], + "flags": [ "HEAT_IMMUNE" ] + }, { "type": "effect_type", "id": "effect_black_nether_water_disease", diff --git a/data/mods/MindOverMatter/items/armor/belt.json b/data/mods/MindOverMatter/items/armor/belt.json index 90b0bb7112501..27873e9da0010 100644 --- a/data/mods/MindOverMatter/items/armor/belt.json +++ b/data/mods/MindOverMatter/items/armor/belt.json @@ -126,7 +126,18 @@ "volume_encumber_modifier": 0.35 } ], - "relic_data": { "charge_info": { "recharge_type": "periodic", "time": "30 s", "regenerate_ammo": true } }, + "relic_data": { + "passive_effects": [ + { + "has": "WORN", + "condition": "ACTIVE", + "incoming_damage_mod": [ { "type": "heat", "multiply": -1 } ], + "values": [ { "value": "CLIMATE_CONTROL_CHILL", "add": 1000 } ], + "ench_effects": [ { "effect": "effect_suppression_belt_fire_protection", "intensity": 1 } ] + } + ], + "charge_info": { "recharge_type": "periodic", "time": "30 s", "regenerate_ammo": true } + }, "//": "Recharge time is 30 seconds due to bug #48019, making it actually 15 seconds. Reduce to 15 seconds if that ever gets fixed." }, { @@ -145,17 +156,7 @@ "type": "transform" } ], - "extend": { "flags": [ "NO_TAKEOFF" ] }, - "relic_data": { - "passive_effects": [ - { - "has": "WORN", - "condition": "ALWAYS", - "incoming_damage_mod": [ { "type": "heat", "multiply": -1 } ], - "values": [ { "value": "CLIMATE_CONTROL_CHILL", "add": 1000 } ] - } - ] - } + "extend": { "flags": [ "NO_TAKEOFF" ] } }, { "id": "psionic_fire_shield_belt_broken", From de22cfac3192d2bd3d065739f7f7e64612c93597 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Fri, 13 Dec 2024 12:01:19 -0600 Subject: [PATCH 148/158] Initial commit --- data/mods/Magiclysm/Spells/biomancer.json | 33 +++++++++++++++++++ .../mods/Magiclysm/itemgroups/itemgroups.json | 3 +- .../mods/Magiclysm/itemgroups/spellbooks.json | 1 + data/mods/Magiclysm/items/spell_scrolls.json | 9 +++++ .../requirements/spell_components.json | 6 ++++ 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/data/mods/Magiclysm/Spells/biomancer.json b/data/mods/Magiclysm/Spells/biomancer.json index aece58476da58..9eb9d22885121 100644 --- a/data/mods/Magiclysm/Spells/biomancer.json +++ b/data/mods/Magiclysm/Spells/biomancer.json @@ -796,5 +796,38 @@ "base_energy_cost": 200, "extra_effects": [ { "id": "eoc_enhancement_setup", "hit_self": true } ], "base_casting_time": 1500 + }, + { + "id": "biomancer_get_more_blood", + "type": "SPELL", + "name": "Carmine Infusion", + "description": "Using water as a catalyst, restore some of your lost blood. This spell has no effect if you're healthy and uninjured.", + "valid_targets": [ "self" ], + "spell_class": "BIOMANCER", + "flags": [ "RESTORATION_SPELL", "CONCENTRATE", "VERBAL", "SOMATIC" ], + "effect": "effect_on_condition", + "effect_str": "EOC_BIO_GET_MORE_BLOOD", + "components": "spell_components_biomancer_get_more_blood", + "shape": "blast", + "difficulty": 5, + "max_level": 15, + "energy_source": "MANA", + "base_energy_cost": 350, + "extra_effects": [ { "id": "eoc_restoration_setup", "hit_self": true } ], + "base_casting_time": 1500 + }, + { + "type": "effect_on_condition", + "id": "EOC_BIO_GET_MORE_BLOOD", + "effect": [ + { + "if": { "math": [ "u_vitamin('blood') < 0" ] }, + "then": { "math": [ "u_vitamin('blood')", "+=", "300 + (u_spell_level('biomancer_get_more_blood') * 150)" ] } + }, + { + "if": { "math": [ "u_vitamin('redcells') < 0" ] }, + "then": { "math": [ "u_vitamin('redcells')", "+=", "300 + (u_spell_level('biomancer_get_more_blood') * 150)" ] } + } + ] } ] diff --git a/data/mods/Magiclysm/itemgroups/itemgroups.json b/data/mods/Magiclysm/itemgroups/itemgroups.json index c207d564e6ee8..30c1e8592ce73 100644 --- a/data/mods/Magiclysm/itemgroups/itemgroups.json +++ b/data/mods/Magiclysm/itemgroups/itemgroups.json @@ -1478,7 +1478,8 @@ { "item": "spell_scroll_bio_fleshpouch", "prob": 50 }, { "item": "spell_scroll_biomancer_lashing_tentacles", "prob": 30 }, { "item": "spell_scroll_biomancer_carrion_feast", "prob": 25 }, - { "item": "spell_scroll_biomancer_caustic_blood", "prob": 20 } + { "item": "spell_scroll_biomancer_caustic_blood", "prob": 20 }, + { "item": "spell_scroll_biomancer_get_more_blood", "prob": 25 } ], "prob": 35 }, diff --git a/data/mods/Magiclysm/itemgroups/spellbooks.json b/data/mods/Magiclysm/itemgroups/spellbooks.json index ed318dfdaf2f2..0248ee2ece3ae 100644 --- a/data/mods/Magiclysm/itemgroups/spellbooks.json +++ b/data/mods/Magiclysm/itemgroups/spellbooks.json @@ -129,6 +129,7 @@ [ "spell_scroll_earthshaper_harden_earth", 40 ], [ "spell_scroll_druid_breathing_underwater", 30 ], [ "spell_scroll_biomancer_coagulant_weave", 30 ], + [ "spell_scroll_biomancer_get_more_blood", 20 ], [ "spell_scroll_repelling_arc", 30 ], [ "spell_scroll_knock", 35 ], [ "spell_scroll_caustic_aura", 30 ], diff --git a/data/mods/Magiclysm/items/spell_scrolls.json b/data/mods/Magiclysm/items/spell_scrolls.json index 3567e2ea56411..d0739d769ef90 100644 --- a/data/mods/Magiclysm/items/spell_scrolls.json +++ b/data/mods/Magiclysm/items/spell_scrolls.json @@ -2130,5 +2130,14 @@ "name": { "str": "Scroll of Imperishable Light", "str_pl": "Scrolls of Imperishable Light" }, "description": "Create a permanent glowing orb of light in the air. Well, it will take a few years to see if it's really permanent; hopefully you'll live to know the answer.", "use_action": { "type": "learn_spell", "spells": [ "magus_permanent_light" ] } + }, + { + "type": "BOOK", + "copy-from": "spell_scroll", + "id": "spell_scroll_biomancer_get_more_blood", + "//": "Biomancer spell", + "name": { "str": "Scroll of Carmine Infusion", "str_pl": "Scrolls of Carmine Infusion" }, + "description": "Using water as a medium, restore some of your lost blood. Be more careful where you put that blood next time.", + "use_action": { "type": "learn_spell", "spells": [ "biomancer_get_more_blood" ] } } ] diff --git a/data/mods/Magiclysm/requirements/spell_components.json b/data/mods/Magiclysm/requirements/spell_components.json index 3b57713e125d6..b1f955c59089d 100644 --- a/data/mods/Magiclysm/requirements/spell_components.json +++ b/data/mods/Magiclysm/requirements/spell_components.json @@ -324,5 +324,11 @@ "type": "requirement", "//": "Precious metals for the Imperishable Light spell", "components": [ [ [ "gold_small", 5 ] ], [ [ "silver_small", 5 ] ], [ [ "copper", 5 ] ] ] + }, + { + "id": "spell_components_biomancer_get_more_blood", + "type": "requirement", + "//": "Water for the Carmine Infusion spell", + "components": [ [ [ "salt_water", 1 ], [ "water_clean", 1 ] ] ] } ] From 30e31b2d0b2229f4a41e9fef19aabc5aba4cfb27 Mon Sep 17 00:00:00 2001 From: akrieger Date: Fri, 13 Dec 2024 10:01:29 -0800 Subject: [PATCH 149/158] Update vcpkg to new mainline commit and instructions --- .github/vcpkg_ports/sdl2/deps.patch | 13 --- .github/vcpkg_ports/sdl2/portfile.cmake | 130 ---------------------- .github/vcpkg_ports/sdl2/usage | 8 -- .github/vcpkg_ports/sdl2/vcpkg.json | 25 ----- .github/workflows/msvc-full-features.yml | 2 +- .github/workflows/release.yml | 2 +- doc/COMPILING/COMPILING-VS-VCPKG.md | 6 +- msvc-full-features/Cataclysm-common.props | 10 +- msvc-full-features/vcpkg.json | 7 +- 9 files changed, 12 insertions(+), 191 deletions(-) delete mode 100644 .github/vcpkg_ports/sdl2/deps.patch delete mode 100644 .github/vcpkg_ports/sdl2/portfile.cmake delete mode 100644 .github/vcpkg_ports/sdl2/usage delete mode 100644 .github/vcpkg_ports/sdl2/vcpkg.json diff --git a/.github/vcpkg_ports/sdl2/deps.patch b/.github/vcpkg_ports/sdl2/deps.patch deleted file mode 100644 index a8637d8c801b7..0000000000000 --- a/.github/vcpkg_ports/sdl2/deps.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake -index 65a98efbe..2f99f28f1 100644 ---- a/cmake/sdlchecks.cmake -+++ b/cmake/sdlchecks.cmake -@@ -352,7 +352,7 @@ endmacro() - # - HAVE_SDL_LOADSO opt - macro(CheckLibSampleRate) - if(SDL_LIBSAMPLERATE) -- find_package(SampleRate QUIET) -+ find_package(SampleRate CONFIG REQUIRED) - if(SampleRate_FOUND AND TARGET SampleRate::samplerate) - set(HAVE_LIBSAMPLERATE TRUE) - set(HAVE_LIBSAMPLERATE_H TRUE) diff --git a/.github/vcpkg_ports/sdl2/portfile.cmake b/.github/vcpkg_ports/sdl2/portfile.cmake deleted file mode 100644 index 68298f8a26181..0000000000000 --- a/.github/vcpkg_ports/sdl2/portfile.cmake +++ /dev/null @@ -1,130 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO akrieger/SDL - REF release-2.26.4_qrox_math - SHA512 aa8c0552ac92bbf85dd3f9339088ebd41e0d09b1d46492462b47b632bab5d850c62b7938950accbfb51798b9f5664c1896fc75bdb8dd42b2c1cee84eebd59e13 - HEAD_REF main - PATCHES - deps.patch -) - -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SDL_SHARED) -string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" FORCE_STATIC_VCRT) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - vulkan SDL_VULKAN - x11 SDL_X11 - wayland SDL_WAYLAND - samplerate SDL_LIBSAMPLERATE - ibus SDL_IBUS -) - -if ("x11" IN_LIST FEATURES) - message(WARNING "You will need to install Xorg dependencies to use feature x11:\nsudo apt install libx11-dev libxft-dev libxext-dev\n") -endif() -if ("wayland" IN_LIST FEATURES) - message(WARNING "You will need to install Wayland dependencies to use feature wayland:\nsudo apt install libwayland-dev libxkbcommon-dev libegl1-mesa-dev\n") -endif() -if ("ibus" IN_LIST FEATURES) - message(WARNING "You will need to install ibus dependencies to use feature ibus:\nsudo apt install libibus-1.0-dev\n") -endif() - -if(VCPKG_TARGET_IS_UWP) - set(configure_opts WINDOWS_USE_MSBUILD) -endif() - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - ${configure_opts} - OPTIONS ${FEATURE_OPTIONS} - -DSDL_STATIC=${SDL_STATIC} - -DSDL_SHARED=${SDL_SHARED} - -DSDL_FORCE_STATIC_VCRT=${FORCE_STATIC_VCRT} - -DSDL_LIBC=ON - -DSDL_TEST=OFF - -DSDL_INSTALL_CMAKEDIR="cmake" - -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON - -DSDL_LIBSAMPLERATE_SHARED=OFF - MAYBE_UNUSED_VARIABLES - SDL_FORCE_STATIC_VCRT -) - -vcpkg_cmake_install() -vcpkg_cmake_config_fixup(CONFIG_PATH cmake) - -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/debug/include" - "${CURRENT_PACKAGES_DIR}/debug/share" - "${CURRENT_PACKAGES_DIR}/bin/sdl2-config" - "${CURRENT_PACKAGES_DIR}/debug/bin/sdl2-config" - "${CURRENT_PACKAGES_DIR}/SDL2.framework" - "${CURRENT_PACKAGES_DIR}/debug/SDL2.framework" - "${CURRENT_PACKAGES_DIR}/share/licenses" - "${CURRENT_PACKAGES_DIR}/share/aclocal" -) - -file(GLOB BINS "${CURRENT_PACKAGES_DIR}/debug/bin/*" "${CURRENT_PACKAGES_DIR}/bin/*") -if(NOT BINS) - file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/bin" - "${CURRENT_PACKAGES_DIR}/debug/bin" - ) -endif() - -if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP AND NOT VCPKG_TARGET_IS_MINGW) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link") - file(RENAME "${CURRENT_PACKAGES_DIR}/lib/SDL2main.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/SDL2main.lib") - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link") - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/SDL2maind.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/SDL2maind.lib") - endif() - - file(GLOB SHARE_FILES "${CURRENT_PACKAGES_DIR}/share/sdl2/*.cmake") - foreach(SHARE_FILE ${SHARE_FILES}) - vcpkg_replace_string("${SHARE_FILE}" "lib/SDL2main" "lib/manual-link/SDL2main") - endforeach() -endif() - -vcpkg_copy_pdbs() - -set(DYLIB_COMPATIBILITY_VERSION_REGEX "set\\(DYLIB_COMPATIBILITY_VERSION (.+)\\)") -set(DYLIB_CURRENT_VERSION_REGEX "set\\(DYLIB_CURRENT_VERSION (.+)\\)") -file(STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_COMPATIBILITY_VERSION REGEX ${DYLIB_COMPATIBILITY_VERSION_REGEX}) -file(STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_CURRENT_VERSION REGEX ${DYLIB_CURRENT_VERSION_REGEX}) -string(REGEX REPLACE ${DYLIB_COMPATIBILITY_VERSION_REGEX} "\\1" DYLIB_COMPATIBILITY_VERSION "${DYLIB_COMPATIBILITY_VERSION}") -string(REGEX REPLACE ${DYLIB_CURRENT_VERSION_REGEX} "\\1" DYLIB_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}") - -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2main" "-lSDL2maind") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2 " "-lSDL2d ") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2-static " "-lSDL2-staticd ") -endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "-lSDL2-static " " ") - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2-staticd " " ") - endif() -endif() - -if(VCPKG_TARGET_IS_UWP) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "$<$:d>.lib" "") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "-l-nodefaultlib:" "-nodefaultlib:") - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "$<$:d>.lib" "d") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-l-nodefaultlib:" "-nodefaultlib:") - endif() -endif() - -vcpkg_fixup_pkgconfig() - -file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") diff --git a/.github/vcpkg_ports/sdl2/usage b/.github/vcpkg_ports/sdl2/usage deleted file mode 100644 index 1cddcd46ffcf4..0000000000000 --- a/.github/vcpkg_ports/sdl2/usage +++ /dev/null @@ -1,8 +0,0 @@ -sdl2 provides CMake targets: - - find_package(SDL2 CONFIG REQUIRED) - target_link_libraries(main - PRIVATE - $ - $,SDL2::SDL2,SDL2::SDL2-static> - ) diff --git a/.github/vcpkg_ports/sdl2/vcpkg.json b/.github/vcpkg_ports/sdl2/vcpkg.json deleted file mode 100644 index a6ed2f9c923c2..0000000000000 --- a/.github/vcpkg_ports/sdl2/vcpkg.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "sdl2", - "version": "2.26.4", - "description": "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.", - "homepage": "https://www.libsdl.org/download-2.0.php", - "license": "Zlib", - "dependencies": [ - { "name": "vcpkg-cmake", "host": true }, - { "name": "vcpkg-cmake-config", "host": true } - ], - "default-features": [ - "base" - ], - "features": { - "base": { - "description": "Base functionality for SDL", - "dependencies": [ { "name": "sdl2", "default-features": false, "features": [ "ibus", "wayland", "x11" ], "platform": "linux" } ] - }, - "ibus": { "description": "Build with ibus IME support", "supports": "linux" }, - "samplerate": { "description": "Use libsamplerate for audio rate conversion", "dependencies": [ "libsamplerate" ] }, - "vulkan": { "description": "Vulkan functionality for SDL" }, - "wayland": { "description": "Build with Wayland support", "supports": "linux" }, - "x11": { "description": "Build with X11 support", "supports": "!windows" } - } -} diff --git a/.github/workflows/msvc-full-features.yml b/.github/workflows/msvc-full-features.yml index 28c3081390744..32e7905271653 100644 --- a/.github/workflows/msvc-full-features.yml +++ b/.github/workflows/msvc-full-features.yml @@ -86,7 +86,7 @@ jobs: id: runvcpkg with: vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg' - vcpkgGitCommitId: '66444e13a86da7087ee24c342f91801cc6eb9877' + vcpkgGitCommitId: '3b57fb2e1ff55613db14d2aaf0a30529289c7050' - name: Integrate vcpkg run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36b3c96d99085..810f98bc43cdd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -172,7 +172,7 @@ jobs: id: runvcpkg with: vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg' - vcpkgGitCommitId: '66444e13a86da7087ee24c342f91801cc6eb9877' + vcpkgGitCommitId: '3b57fb2e1ff55613db14d2aaf0a30529289c7050' - name: Install dependencies (windows msvc) (3/4) if: runner.os == 'Windows' run: | diff --git a/doc/COMPILING/COMPILING-VS-VCPKG.md b/doc/COMPILING/COMPILING-VS-VCPKG.md index 18429345c39b1..b39ec8355f7b2 100644 --- a/doc/COMPILING/COMPILING-VS-VCPKG.md +++ b/doc/COMPILING/COMPILING-VS-VCPKG.md @@ -22,7 +22,7 @@ Steps from current guide were tested on Windows 10 (64 bit), Visual Studio 2019 2. Install `Git for Windows` (installer can be downloaded from [Git homepage](https://git-scm.com/)). -3. Install and configure `vcpkg`. If you already have `vcpkg` installed, you should update it to at least commit `66444e13a86da7087ee24c342f91801cc6eb9877` (the most recent tested good revision) and rerun `.\bootstrap-vcpkg.bat` as described: +3. Install and configure `vcpkg`. If you already have `vcpkg` installed, you should update it to at least commit `3b57fb2e1ff55613db14d2aaf0a30529289c7050` (the most recent tested good revision) and rerun `.\bootstrap-vcpkg.bat` as described: ***WARNING: It is important that, wherever you decide to clone this repo, the path does not include whitespace. That is, `C:/dev/vcpkg` is acceptable, but `C:/dev test/vcpkg` is not.*** @@ -31,18 +31,18 @@ In a `cmd.exe` shell: REM cd to the appropriate folder first git clone https://github.com/Microsoft/vcpkg.git cd vcpkg +git checkout 3b57fb2e1ff55613db14d2aaf0a30529289c7050 .\bootstrap-vcpkg.bat -disableMetrics .\vcpkg integrate install -git checkout 66444e13a86da7087ee24c342f91801cc6eb9877 ``` In a Git Bash shell, the commands are almost the same except the filesystem path separator is `/` instead of `\`. ```cmd # cd to the appropriate folder first git clone https://github.com/Microsoft/vcpkg.git cd vcpkg +git checkout 3b57fb2e1ff55613db14d2aaf0a30529289c7050 ./bootstrap-vcpkg.bat -disableMetrics ./vcpkg.exe integrate install -git checkout 66444e13a86da7087ee24c342f91801cc6eb9877 ``` ## Cloning and compilation: diff --git a/msvc-full-features/Cataclysm-common.props b/msvc-full-features/Cataclysm-common.props index 57ae5c83d7626..424957c60994f 100644 --- a/msvc-full-features/Cataclysm-common.props +++ b/msvc-full-features/Cataclysm-common.props @@ -104,15 +104,17 @@ $(ProjectDir)vcpkg_installed\$(VcpkgTripet)\$(VcpkgTriplet)\lib;%(AdditionalLibraryDirectories) - brotlicommon-static.lib; - brotlidec-static.lib; - brotlienc-static.lib; + brotlicommon.lib; + brotlidec.lib; + brotlienc.lib; bz2$(VcpkgLibSuffix).lib; FLAC.lib; FLAC++.lib; freetype$(VcpkgLibSuffix).lib; jpeg.lib; libpng16$(VcpkgLibSuffix).lib; + libwavpack.lib; + libxmp-static.lib; modplug.lib; mpg123.lib; ogg.lib; @@ -120,7 +122,7 @@ pdcurses.lib; SDL2_image-static$(VcpkgLibSuffix).lib; SDL2_mixer-static$(VcpkgLibSuffix).lib; - SDL2_ttf.lib; + SDL2_ttf$(VcpkgLibSuffix).lib; SDL2-static$(VcpkgLibSuffix).lib; syn123.lib; turbojpeg.lib; diff --git a/msvc-full-features/vcpkg.json b/msvc-full-features/vcpkg.json index cf624c2d75a2d..3da3ddb9ab313 100644 --- a/msvc-full-features/vcpkg.json +++ b/msvc-full-features/vcpkg.json @@ -13,10 +13,5 @@ }, "sdl2-ttf", "pdcurses" - ], - "vcpkg-configuration": { - "overlay-ports": [ - "../.github/vcpkg_ports" - ] - } + ] } From 64632df0ab989786c460b65afe6783cb318b32c0 Mon Sep 17 00:00:00 2001 From: Juny Tse Date: Sat, 14 Dec 2024 02:47:23 +0800 Subject: [PATCH 150/158] use wide chars in remove_punctuations --- src/output.cpp | 13 +++++++------ src/output.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/output.cpp b/src/output.cpp index fed3ddc345241..1926e6f156f53 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -1516,14 +1516,15 @@ std::string trim_trailing_punctuations( const std::string_view s ) } ); } -std::string remove_punctuations( const std::string_view s ) +std::string remove_punctuations( const std::string &s ) { - std::string result; - std::remove_copy_if( s.begin(), s.end(), std::back_inserter( result ), - []( unsigned char ch ) { - return std::ispunct( ch ) && ch != '_'; + std::wstring ws = utf8_to_wstr( s ); + std::wstring result; + std::remove_copy_if( ws.begin(), ws.end(), std::back_inserter( result ), + []( wchar_t ch ) { + return std::iswpunct( ch ) && ch != '_'; } ); - return result; + return wstr_to_utf8( result ); } using char_t = std::string::value_type; diff --git a/src/output.h b/src/output.h index 26cd92fbddc33..c2226daca7e4b 100644 --- a/src/output.h +++ b/src/output.h @@ -626,7 +626,7 @@ std::string trim( std::string_view s ); // Removes trailing periods and exclamation marks. std::string trim_trailing_punctuations( std::string_view s ); // Removes all punctuation except underscore. -std::string remove_punctuations( std::string_view s ); +std::string remove_punctuations( const std::string &s ); // Converts the string to upper case. std::string to_upper_case( const std::string &s ); From 7e5de3ace81b2420bb0a37a2b230ccef4ea99c15 Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Fri, 13 Dec 2024 13:21:19 -0600 Subject: [PATCH 151/158] Kick tests From 98b515d47d5cb42a1626d29a88a4dcf426fd3fad Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Fri, 13 Dec 2024 14:36:18 -0600 Subject: [PATCH 152/158] Kick tests From 80563a21b2029877b5454474102e3366341ae82b Mon Sep 17 00:00:00 2001 From: "Standing-StormStanding-Storm git config --global user.name Standing-Storm git config --global user.name Standing-Storm" Date: Fri, 13 Dec 2024 15:47:35 -0600 Subject: [PATCH 153/158] Hurricane Kick From dea3076088766d24f1a1be4e55d97ff21722b58a Mon Sep 17 00:00:00 2001 From: moxian Date: Fri, 13 Dec 2024 17:34:44 -0800 Subject: [PATCH 154/158] Ensure that linkable transforming items keep their links after transform --- src/iuse_actor.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index 67b64fa01336c..f2f3301fa796e 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -433,7 +433,7 @@ std::string iuse_transform::get_name() const return iuse_actor::get_name(); } -void iuse_transform::finalize( const itype_id & ) +void iuse_transform::finalize( const itype_id &source ) { if( !item::type_is_defined( target ) && target_group.is_empty() ) { debugmsg( "Invalid transform target: %s", target.c_str() ); @@ -447,6 +447,19 @@ void iuse_transform::finalize( const itype_id & ) // todo: check contents fit container? // transform uses migration pocket if not } + + if( source.obj().can_use( "link_up" ) ) { + // The linkage logic currently assumes that the links persist + // through transformation, and fails pretty badly (segfaults) + // if that happens to not be the case. + // It is not unreasonable to want items that violate this assumption (one example is + // the infamous Apple mouse which cannot be operated while charging), + // but we don't have any of those implemented right now, so the check stays. + if( !target.obj().can_use( "link_up" ) ) { + debugmsg( "Item %s has link_up action, yet transforms into %s which doesn't.", + source.c_str(), target.c_str() ); + } + } } void iuse_transform::info( const item &it, std::vector &dump ) const From 9962573aa9fefd360f4fe1da6c035272c73f1da4 Mon Sep 17 00:00:00 2001 From: Karol1223 <68503002+Karol1223@users.noreply.github.com> Date: Sat, 14 Dec 2024 03:23:22 +0100 Subject: [PATCH 155/158] A bunch of random density fixes (#78501) * a bunch of density * Update drink.json * Update alcohol.json --- data/json/items/armor/integrated.json | 2 +- data/json/items/comestibles/alcohol.json | 2 +- data/json/items/comestibles/drink.json | 8 ++++---- data/json/items/comestibles/other.json | 3 +-- data/json/items/comestibles/spice.json | 4 +++- data/json/items/tool/med.json | 3 ++- data/mods/TEST_DATA/known_bad_density.json | 8 -------- 7 files changed, 12 insertions(+), 18 deletions(-) diff --git a/data/json/items/armor/integrated.json b/data/json/items/armor/integrated.json index c20987f31d3fb..e85b0307c93d4 100644 --- a/data/json/items/armor/integrated.json +++ b/data/json/items/armor/integrated.json @@ -526,7 +526,7 @@ "name": { "str": "patchwork skin" }, "description": "Beauty is only skin deep, but with this skin, a knife might find itself broken in the beauty layer.", "weight": "2 kg", - "volume": "500 ml", + "volume": "2 L", "price": "0 cent", "price_postapoc": "0 cent", "material": [ "leather", "bone", "mut_fur", "acidchitin", "leather_arthropod", "wool", "flesh" ], diff --git a/data/json/items/comestibles/alcohol.json b/data/json/items/comestibles/alcohol.json index 499ad2f526c8e..40d3962fa73c4 100644 --- a/data/json/items/comestibles/alcohol.json +++ b/data/json/items/comestibles/alcohol.json @@ -969,7 +969,7 @@ "id": "beer", "looks_like": "water", "name": { "str_sp": "beer" }, - "weight": "251 g", + "weight": "250 g", "color": "brown", "addiction_type": "alcohol", "use_action": [ "ALCOHOL_WEAK" ], diff --git a/data/json/items/comestibles/drink.json b/data/json/items/comestibles/drink.json index 2a83d1d9f689f..d9d107a681cea 100644 --- a/data/json/items/comestibles/drink.json +++ b/data/json/items/comestibles/drink.json @@ -476,7 +476,7 @@ "price_postapoc": "25 cent", "volume": "250 ml", "charges": 1, - "material": [ "water" ], + "material": [ "veggy", "water" ], "phase": "liquid", "flags": [ "EATEN_HOT", "NUTRIENT_OVERRIDE" ], "fun": 2 @@ -497,7 +497,7 @@ "price_postapoc": "25 cent", "volume": "250 ml", "charges": 1, - "material": [ "water" ], + "material": [ "veggy", "water" ], "phase": "liquid", "flags": [ "EATEN_HOT" ], "fun": 3 @@ -1141,7 +1141,7 @@ "id": "pine_tea", "looks_like": "tea", "name": { "str_sp": "pine needle tea" }, - "weight": "268 g", + "weight": "262 g", "color": "light_green", "comestible_type": "DRINK", "symbol": "~", @@ -1152,7 +1152,7 @@ "volume": "250 ml", "charges": 1, "calories": 1, - "material": [ "water" ], + "material": [ "veggy", "water" ], "phase": "liquid", "flags": [ "EATEN_HOT", "NUTRIENT_OVERRIDE" ], "fun": 1, diff --git a/data/json/items/comestibles/other.json b/data/json/items/comestibles/other.json index 3919a9ba0b941..846dc0088e0ee 100644 --- a/data/json/items/comestibles/other.json +++ b/data/json/items/comestibles/other.json @@ -947,8 +947,7 @@ "name": { "str_sp": "Kentucky coffee grounds" }, "container": "bag_plastic_small", "description": "Coffee grounds created through washing, cleaning, and roasting the pods from a Kentucky coffeetree. They can be used to create coffee.", - "flags": [ "EDIBLE_FROZEN", "NUTRIENT_OVERRIDE" ], - "volume": "12 ml" + "flags": [ "EDIBLE_FROZEN", "NUTRIENT_OVERRIDE" ] }, { "id": "honey_glassed", diff --git a/data/json/items/comestibles/spice.json b/data/json/items/comestibles/spice.json index 455c716173c90..8b361a09eec52 100644 --- a/data/json/items/comestibles/spice.json +++ b/data/json/items/comestibles/spice.json @@ -23,9 +23,10 @@ "comestible_type": "DRINK", "name": { "str_sp": "hot sauce" }, "description": "Flamin' hot sauce. It'd be a bad idea to drink it on its own. You should probably wash your hands after handling it, too.", - "weight": "6 g", + "weight": "5 g", "charges": 50, "volume": "250 ml", + "material": [ "veggy", "water" ], "//": "hot sauces are very salty, hence the negative quench", "quench": -2, "calories": 5, @@ -164,6 +165,7 @@ "price_postapoc": "25 cent", "weight": "24 g", "volume": "250 ml", + "material": [ "water" ], "calories": 17, "comestible_type": "DRINK", "container": "bottle_glass", diff --git a/data/json/items/tool/med.json b/data/json/items/tool/med.json index 408a668b27fbb..059acd3230367 100644 --- a/data/json/items/tool/med.json +++ b/data/json/items/tool/med.json @@ -9,7 +9,7 @@ "volume": "2 ml", "price": "5 cent", "price_postapoc": "2 cent", - "material": "cotton", + "material": [ "cotton" ], "symbol": "!", "color": "white", "flags": [ "SINGLE_USE" ], @@ -25,6 +25,7 @@ "volume": "3 ml", "price": "10 cent", "price_postapoc": "6 cent", + "material": [ "cotton" ], "symbol": ",", "color": "white", "flags": [ "SINGLE_USE", "IRREPLACEABLE_CONSUMABLE" ], diff --git a/data/mods/TEST_DATA/known_bad_density.json b/data/mods/TEST_DATA/known_bad_density.json index 14696cf01656c..1d359ebc2cb46 100644 --- a/data/mods/TEST_DATA/known_bad_density.json +++ b/data/mods/TEST_DATA/known_bad_density.json @@ -9,8 +9,6 @@ "bot_lab_security_drone_YM", "extinguishing_agent", "dayquil", - "pine_tea", - "soysauce", "johnnycake", "bot_gasbomb_hack", "tailoring_pattern_set", @@ -20,12 +18,10 @@ "venom_wasp", "cooked_marrow", "broken_mech_combat", - "beer", "ruined_chunks", "soaking_dandelion", "meat_smoked", "mycus_juice", - "hot_sauce", "liquid_soap", "chem_aluminium_sulphate", "bot_lab_security_drone_GR", @@ -58,13 +54,11 @@ "plastic_straw", "k_gambeson_pants", "corpse_stabbed", - "integrated_patchskin2", "bone_marrow", "conc_venom", "hoboreel", "dog_whistle_wood", "tailor_japanese", - "dandelionburdock_tea", "craft", "frozen_lemonade", "glowstick_dead", @@ -135,7 +129,6 @@ "dried_salad", "lung_provence", "portal", - "dandelion_tea", "scots_cookbook", "primitive_hammer", "throwing_stick", @@ -436,7 +429,6 @@ "robofac_armor_rig", "sweet_milk_fortified", "purifier_smart_shot", - "alcohol_wipes", "colander_steel", "porkbelly", "airhorn", From b7ece925ffe7fd0d33bab81767b1f8da24412ffe Mon Sep 17 00:00:00 2001 From: moxian Date: Fri, 13 Dec 2024 19:20:06 -0800 Subject: [PATCH 156/158] clang-tidy fix made with github web editor --- src/iuse_actor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index f2f3301fa796e..a5752e069f507 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -433,7 +433,7 @@ std::string iuse_transform::get_name() const return iuse_actor::get_name(); } -void iuse_transform::finalize( const itype_id &source ) +void iuse_transform::finalize( const itype_id &my_item_type ) { if( !item::type_is_defined( target ) && target_group.is_empty() ) { debugmsg( "Invalid transform target: %s", target.c_str() ); @@ -448,7 +448,7 @@ void iuse_transform::finalize( const itype_id &source ) // transform uses migration pocket if not } - if( source.obj().can_use( "link_up" ) ) { + if( my_item_type.obj().can_use( "link_up" ) ) { // The linkage logic currently assumes that the links persist // through transformation, and fails pretty badly (segfaults) // if that happens to not be the case. @@ -457,7 +457,7 @@ void iuse_transform::finalize( const itype_id &source ) // but we don't have any of those implemented right now, so the check stays. if( !target.obj().can_use( "link_up" ) ) { debugmsg( "Item %s has link_up action, yet transforms into %s which doesn't.", - source.c_str(), target.c_str() ); + my_item_type.c_str(), target.c_str() ); } } } From 82176f040ea1d8aed3e84127852add6f1ed4e2a7 Mon Sep 17 00:00:00 2001 From: akrieger Date: Fri, 13 Dec 2024 20:50:01 -0800 Subject: [PATCH 157/158] Add missing header --- src/output.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output.cpp b/src/output.cpp index 1926e6f156f53..d8a686d245e2f 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include From e542004afeeb2dcea3fd55a4125271a914a9c9d1 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Fri, 13 Dec 2024 22:46:20 -0800 Subject: [PATCH 158/158] cataimgui::TextColoredParagraph can now handle a < followed by a tag This crops up in help.json a few times where it represents a building rather than the start of a tag. --- src/text.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/text.cpp b/src/text.cpp index 8f6ee1e3d496a..4693146c66489 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -296,13 +296,19 @@ void TextColoredParagraph( nc_color default_color, const std::string_view str, std::vector colors = std::vector( 1, u32_from_color( default_color ) ); while( std::string::npos != ( e = str.find( '<', s ) ) ) { TextEx( str.substr( s, e - s ), wrap_width, colors.back() ); - size_t ce = str.find( '>', e ); + size_t ce = str.find_first_of( "<>", e + 1 ); if( std::string::npos != ce ) { - std::string_view tagname = str.substr( e, ce - e + 1 ); + // back up by one if we find the start of another tag instead of the end of this one + // an annoying example from help.json: "^>v<" + if( str[ ce ] == '<' ) { + ce -= 1; + } + size_t len = ce - e + 1; + std::string_view tagname = str.substr( e, len ); if( "" == tagname && value.has_value() ) { TextSegmentEx( value.value(), wrap_width, true ); } else { - color_tag_parse_result tag = get_color_from_tag( str.substr( e, ce - e + 1 ) ); + color_tag_parse_result tag = get_color_from_tag( tagname ); switch( tag.type ) { case color_tag_parse_result::open_color_tag: colors.push_back( u32_from_color( tag.color ) );