From c3ba2dad7f647eacade5c39bcd863dbac84ad989 Mon Sep 17 00:00:00 2001 From: Chaosvolt Date: Tue, 7 Jun 2022 14:09:49 -0500 Subject: [PATCH] JSONize size mutations, remove barefeet penalty, Ceph Gills fix (#1486) * Move behavior of more mutations to flags * Whoops, forgot a flag * astylin' * Reversions per feedback * Fix couple things I forgot earlier * Suggestions per feedback * Mod and doc update * Update enchantment_test.cpp * Start work on defining resize enum * Update mutation.h * Update mutation.h * And finally get the enum actually compiling Still unsure how to actually use it. * Commit current WIP for now * And commit current WIP * Commit latest changes for feedback Currently trying to load game will print the "Invalid m_size" error after a successful compile test. * And now it all actually works * Stylin' and other updoots * Further fixes * Update character.cpp * Update monster.cpp * Begone, lack of defaults Fucking switch/cases * I said begone * Further fixes per feedback * Suggestions per feedback * Fix from Coolthulhu's findings --- data/json/mutations/mutation_type.json | 4 + data/json/mutations/mutations.json | 51 ++-- data/json/npcs/starting_traits.json | 1 - data/json/obsoletion/mutations.json | 8 + data/mods/Aftershock/mutations/mutations.json | 6 - .../mutations/crt_vamp_mutations.json | 219 ++++-------------- .../mutations/crt_wendigo_mutations.json | 44 +--- data/mods/DinoMod/NPC/trait_groups.json | 1 - data/mods/DinoMod/mutations/mutations.json | 6 - .../My_Sweet_Cataclysm/sweet_mutations.json | 2 +- doc/JSON_FLAGS.md | 5 +- doc/JSON_INFO.md | 1 + src/activity_handlers.cpp | 3 + src/character.cpp | 16 +- src/creature.cpp | 4 + src/creature.h | 12 +- src/iuse.cpp | 2 + src/melee.cpp | 5 +- src/mondeath.cpp | 3 + src/monmove.cpp | 3 + src/monster.cpp | 10 +- src/mutation.cpp | 26 +-- src/mutation.h | 4 + src/mutation_data.cpp | 27 +++ src/player.cpp | 2 +- src/ranged.cpp | 4 + src/trapfunc.cpp | 4 + src/vehicle.cpp | 2 +- tests/enchantment_test.cpp | 4 +- 29 files changed, 179 insertions(+), 300 deletions(-) diff --git a/data/json/mutations/mutation_type.json b/data/json/mutations/mutation_type.json index bf69d1fa9571..a45236a28c32 100644 --- a/data/json/mutations/mutation_type.json +++ b/data/json/mutations/mutation_type.json @@ -63,6 +63,10 @@ "type": "mutation_type", "id": "WINGS" }, + { + "type": "mutation_type", + "id": "SIZE" + }, { "type": "mutation_type", "id": "skin_tone" diff --git a/data/json/mutations/mutations.json b/data/json/mutations/mutations.json index 3689852a7bcb..abe96cc36d8c 100644 --- a/data/json/mutations/mutations.json +++ b/data/json/mutations/mutations.json @@ -238,16 +238,6 @@ "valid": false, "cancels": [ "ILLITERATE", "SLOWREADER" ] }, - { - "type": "mutation", - "id": "TOUGH_FEET", - "name": { "str": "Tough Feet" }, - "points": 1, - "description": "The bottoms of your feet are tough, and you are accustomed to going barefoot. You receive no movement penalty for not wearing shoes, and your feet are more resistant to damage.", - "armor": [ { "parts": [ "foot_l", "foot_r" ], "physical": 2, "acid": 2 } ], - "starting_trait": true, - "valid": false - }, { "type": "mutation", "id": "BOVINE_BULK", @@ -2680,7 +2670,7 @@ "name": { "str": "Padded Feet" }, "points": 1, "visibility": 1, - "description": "The bottoms of your feet are strongly padded. You receive no movement penalty for not wearing shoes, and even receive a 10% bonus when moving barefoot.", + "description": "The bottoms of your feet are strongly padded. If you're not wearing footwear, you'll receive a 10% bonus to movement speed.", "types": [ "LEGS" ], "category": [ "BEAST", "URSINE", "FELINE", "LUPINE" ] }, @@ -2724,7 +2714,7 @@ "visibility": 2, "ugliness": 2, "mixed_effect": true, - "description": "Your feet have fused into hooves. This allows kicking attacks to do much more damage, provides natural armor, and removes the need to wear shoes; however, you cannot wear shoes of any kind. Reduces wet effects.", + "description": "Your feet have fused into hooves. This allows kicking attacks to do much more damage and provides natural armor; however, you cannot wear shoes of any kind. Reduces wet effects.", "types": [ "LEGS" ], "category": [ "CATTLE", "CHIMERA" ], "wet_protection": [ { "part": "foot_l", "neutral": 10 }, { "part": "foot_r", "neutral": 10 } ], @@ -3730,12 +3720,13 @@ "mixed_effect": true, "encumbrance_always": [ [ "torso", 10 ], [ "arm_l", 10 ], [ "arm_r", 10 ] ], "description": "You have grown noticeably taller and broader. Much of it is useful muscle mass (Strength +2), but you find it throws off your balance and you get in your own way (+10 torso and arm encumbrance).", + "types": [ "SIZE" ], "prereqs": [ "STR_UP", "STR_UP_2", "STR_UP_3", "STR_UP_4" ], - "cancels": [ "SMALL", "SMALL2" ], "changes_to": [ "LARGE_OK", "HUGE" ], "category": [ "URSINE", "CATTLE", "LIZARD", "CHIMERA" ], "passive_mods": { "str_mod": 2 }, - "weight_capacity_modifier": 1.05 + "weight_capacity_modifier": 1.05, + "body_size": "LARGE" }, { "type": "mutation", @@ -3744,15 +3735,16 @@ "points": 2, "visibility": 1, "description": "You carry your rugged body with the dignity you deserve. Strength +2.", + "types": [ "SIZE" ], "prereqs": [ "LARGE" ], "prereqs2": [ "STR_UP", "STR_UP_2", "STR_UP_3", "STR_UP_4" ], - "cancels": [ "SMALL", "SMALL2" ], "threshreq": [ "THRESH_URSINE", "THRESH_CATTLE", "THRESH_LIZARD", "THRESH_CHIMERA" ], "changes_to": [ "HUGE" ], "leads_to": [ "MUT_TOUGH" ], "category": [ "URSINE", "CATTLE", "LIZARD", "CHIMERA" ], "passive_mods": { "str_mod": 2 }, - "weight_capacity_modifier": 1.05 + "weight_capacity_modifier": 1.05, + "body_size": "LARGE" }, { "type": "mutation", @@ -3763,16 +3755,17 @@ "ugliness": 4, "mixed_effect": true, "description": "You have grown even more massive, to the point where you cannot usefully fit into human-sized clothing or vehicles. Much of it is powerful muscle mass (Strength +4), but it's a real pain to haul around.", + "types": [ "SIZE" ], "prereqs": [ "LARGE", "LARGE_OK" ], "prereqs2": [ "STR_UP_3", "STR_UP_4" ], - "cancels": [ "SMALL", "SMALL2" ], "changes_to": [ "HUGE_OK" ], "category": [ "URSINE", "CATTLE" ], "passive_mods": { "str_mod": 4 }, "hp_adjustment": -6, "fatigue_modifier": 0.15, "restricts_gear": [ "torso", "leg_l", "leg_r", "arm_l", "arm_r", "hand_l", "hand_r", "head", "foot_l", "foot_r" ], - "weight_capacity_modifier": 1.1 + "weight_capacity_modifier": 1.1, + "body_size": "HUGE" }, { "type": "mutation", @@ -3783,15 +3776,16 @@ "ugliness": 3, "mixed_effect": true, "description": "Your cardiovascular system has caught up with your muscular physique, so who needs pathetic human cars? Strength +4.", + "types": [ "SIZE" ], "prereqs": [ "HUGE" ], "prereqs2": [ "STR_UP_3", "STR_UP_4" ], - "cancels": [ "SMALL", "SMALL2" ], "threshreq": [ "THRESH_URSINE", "THRESH_CATTLE" ], "leads_to": [ "MUT_TOUGH" ], "category": [ "URSINE", "CATTLE" ], "passive_mods": { "str_mod": 4 }, "restricts_gear": [ "torso", "leg_l", "leg_r", "arm_l", "arm_r", "hand_l", "hand_r", "head", "foot_l", "foot_r" ], - "weight_capacity_modifier": 1.1 + "weight_capacity_modifier": 1.1, + "body_size": "HUGE" }, { "type": "mutation", @@ -4080,12 +4074,13 @@ "visibility": 5, "mixed_effect": true, "description": "You've noticeably shrunk in size. You're able to move with increased litheness, but your smaller stature prevents you from carrying as much.", - "cancels": [ "LARGE", "LARGE_OK", "HUGE", "HUGE_OK" ], + "types": [ "SIZE" ], "changes_to": [ "SMALL2" ], "category": [ "MOUSE" ], "hp_modifier": -0.05, "dodge_modifier": 1, - "weight_capacity_modifier": 0.8 + "weight_capacity_modifier": 0.8, + "body_size": "SMALL" }, { "type": "mutation", @@ -4095,14 +4090,16 @@ "visibility": 8, "mixed_effect": true, "description": "You're only half as tall as you used to be! The weight of things you once found easy to carry is now unbearable, clothes are now twice as encumbering for you unless you refit them (since you're half their size), and your hit points are heavily reduced. However, your movement is silent, and your dodge skill is a little higher.", + "types": [ "SIZE" ], "prereqs": [ "SMALL" ], - "cancels": [ "LARGE", "LARGE_OK", "HUGE", "HUGE_OK", "LIGHTSTEP", "CLUMSY" ], + "cancels": [ "LIGHTSTEP", "CLUMSY" ], "changes_to": [ "SMALL_OK" ], "category": [ "MOUSE" ], "hp_modifier": -0.3, "dodge_modifier": 2, "weight_capacity_modifier": 0.5, - "noise_modifier": 0.0 + "noise_modifier": 0.0, + "body_size": "TINY" }, { "type": "mutation", @@ -4111,8 +4108,9 @@ "points": 3, "mixed_effect": true, "description": "You've mastered your tiny form! Item encumbrance and carry weight penalties are reduced, and you've learned to use your increased nimbleness to offset your reduced capacity to absorb damage.", + "types": [ "SIZE" ], "prereqs": [ "SMALL2" ], - "cancels": [ "LARGE", "LARGE_OK", "HUGE", "HUGE_OK", "LIGHTSTEP", "CLUMSY" ], + "cancels": [ "LIGHTSTEP", "CLUMSY" ], "valid": false, "purifiable": false, "threshreq": [ "THRESH_MOUSE" ], @@ -4120,7 +4118,8 @@ "hp_modifier": -0.25, "dodge_modifier": 2, "weight_capacity_modifier": 0.7, - "noise_modifier": 0.0 + "noise_modifier": 0.0, + "body_size": "TINY" }, { "type": "mutation", diff --git a/data/json/npcs/starting_traits.json b/data/json/npcs/starting_traits.json index cf79cdeb0d02..71f501e9428b 100644 --- a/data/json/npcs/starting_traits.json +++ b/data/json/npcs/starting_traits.json @@ -46,7 +46,6 @@ { "trait": "SPIRITUAL", "prob": 10 }, { "trait": "STYLISH", "prob": 10 }, { "trait": "TERRIFYING", "prob": 10 }, - { "trait": "TOUGH_FEET", "prob": 10 }, { "trait": "ALBINO", "prob": 1 }, { "trait": "ASTHMA", "prob": 10 }, { "trait": "CHEMIMBALANCE", "prob": 10 }, diff --git a/data/json/obsoletion/mutations.json b/data/json/obsoletion/mutations.json index c8040c4dd148..83fca2c6b39a 100644 --- a/data/json/obsoletion/mutations.json +++ b/data/json/obsoletion/mutations.json @@ -245,5 +245,13 @@ "active": true, "starts_active": true, "night_vision_range": 4.5 + }, + { + "type": "mutation", + "id": "TOUGH_FEET", + "name": { "str": "Tough Feet" }, + "points": 1, + "description": "This mutation has been obsoleted due to the hidden movement speed penalty being removed. If you see this on a profession or mutate this trait, this is a bug.", + "valid": false } ] diff --git a/data/mods/Aftershock/mutations/mutations.json b/data/mods/Aftershock/mutations/mutations.json index 9f5b821ee347..3079e6117513 100644 --- a/data/mods/Aftershock/mutations/mutations.json +++ b/data/mods/Aftershock/mutations/mutations.json @@ -327,12 +327,6 @@ { "part": "torso", "neutral": 14 } ] }, - { - "type": "mutation", - "id": "TOUGH_FEET", - "copy-from": "TOUGH_FEET", - "extend": { "category": [ "MASTODON" ] } - }, { "type": "mutation", "id": "THICKSKIN", diff --git a/data/mods/CRT_EXPANSION/mutations/crt_vamp_mutations.json b/data/mods/CRT_EXPANSION/mutations/crt_vamp_mutations.json index c158a6feef2c..69e76b63bab6 100644 --- a/data/mods/CRT_EXPANSION/mutations/crt_vamp_mutations.json +++ b/data/mods/CRT_EXPANSION/mutations/crt_vamp_mutations.json @@ -13,62 +13,32 @@ { "type": "mutation", "id": "FLEET", - "name": "Fleet-Footed", - "points": 2, - "description": "You can move more quickly than most, resulting in a 15% speed bonus on sure footing.", - "starting_trait": true, - "changes_to": [ "FLEET2" ], - "category": [ "SPIDER", "MOUSE", "VAMP" ], - "types": [ "RUNNING" ], - "movecost_flatground_modifier": 0.85 + "copy-from": "FLEET", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "GOODHEARING", - "name": "Good Hearing", - "points": 1, - "description": "Your hearing is better than average, and you can hear distant sounds more easily.", - "starting_trait": true, - "category": [ "ALPHA", "MOUSE", "ELFA" ], - "cancels": [ "BADHEARING" ], - "hearing_modifier": 1.25 + "copy-from": "GOODHEARING", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "GOODCARDIO", - "name": "Indefatigable", - "points": 2, - "description": "Whether due to exercise and good diet, or due to a natural propensity to physical endurance, you tire due to physical exertion much less readily than others. Your maximum stamina is 25% higher than usual.", - "starting_trait": true, - "valid": false, - "cancels": [ "BADCARDIO" ], - "changes_to": [ "GOODCARDIO2" ], - "category": [ "FISH", "LUPINE", "MOUSE", "INSECT", "VAMP" ], - "max_stamina_modifier": 1.25 + "copy-from": "GOODCARDIO", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "FASTHEALER", - "name": "Fast Healer", - "points": 2, - "description": "You heal faster when sleeping and will even recover a small amount of HP when not sleeping.", - "starting_trait": true, - "types": [ "HEALING" ], - "changes_to": [ "FASTHEALER2", "REGEN_LIZ" ], - "category": [ "MEDICAL", "VAMP" ], - "healing_awake": 0.2, - "healing_resting": 0.5 + "copy-from": "FASTHEALER", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "PAINRESIST", - "name": "Pain Resistant", - "points": 2, - "description": "You have a high tolerance for pain.", - "starting_trait": true, - "valid": false, - "cancels": [ "MORE_PAIN", "MORE_PAIN2", "MORE_PAIN3" ], - "category": [ "MEDICAL", "VAMP" ] + "copy-from": "PAINRESIST", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", @@ -79,123 +49,68 @@ { "type": "mutation", "id": "DEFT", - "name": "Deft", - "points": 1, - "description": "While you're not any better at melee combat, you are better at recovering from a miss, and will be able to attempt another strike faster.", - "starting_trait": true, - "category": [ "BIRD", "BEAST", "RAPTOR", "MOUSE", "VAMP" ] + "copy-from": "DEFT", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "TERRIFYING", - "name": "Terrifying", - "points": 1, - "description": "There's something about you that creatures find frightening, and they are more likely to try to flee.", - "starting_trait": true, - "category": [ "BEAST", "INSECT", "CHIMERA", "VAMP" ], - "social_modifiers": { "intimidate": 15 } + "copy-from": "TERRIFYING", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "LIGHTSTEP", - "name": "Light Step", - "points": 1, - "description": "You make less noise while walking. You're also less likely to set off traps.", - "starting_trait": true, - "category": [ "BIRD", "ELFA", "FELINE", "VAMP" ], - "cancels": [ "CLUMSY" ], - "noise_modifier": 0.4 + "copy-from": "LIGHTSTEP", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "CANNIBAL", - "name": "Cannibal", - "points": 1, - "description": "For your whole life you've been forbidden from indulging in your peculiar tastes. Now the world's ended, and you'll be damned if anyone is going to tell you that you can't eat people.", - "starting_trait": true, - "valid": false, - "cancels": [ "VEGETARIAN" ], - "category": [ "VAMP" ], - "flags": [ "CANNIBAL" ] + "copy-from": "CANNIBAL", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "WEAKSCENT", - "name": "Weak Scent", - "points": 1, - "description": "Your scent is quite weak. Animals that track your scent will do so with more difficulty.", - "starting_trait": true, - "category": [ "ALPHA", "VAMP" ], - "types": [ "SCENT" ] + "copy-from": "WEAKSCENT", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "PRETTY", - "name": "Pretty", - "points": 1, - "ugliness": -2, - "description": "You are a sight to behold. NPCs who care about such things will react more kindly to you.", - "starting_trait": true, - "category": [ "ALPHA", "FELINE", "LUPINE", "VAMP" ], - "cancels": [ "UGLY", "DEFORMED", "DEFORMED2", "DEFORMED3" ], - "changes_to": [ "BEAUTIFUL" ] + "copy-from": "PRETTY", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "INSOMNIA", - "name": "Insomniac", - "points": -2, - "description": "You have a hard time falling asleep, even under the best circumstances!", - "starting_trait": true, - "valid": false, - "category": [ "MEDICAL", "VAMP" ], - "cancels": [ "EASYSLEEPER" ] + "copy-from": "INSOMNIA", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "THINSKIN", - "name": "Thin-Skinned", - "points": -1, - "description": "Your skin is fragile. Cutting damage is slightly increased for you.", - "starting_trait": true, - "cancels": [ "THICKSKIN" ], - "category": [ "VAMP" ], - "armor": [ { "parts": "ALL", "cut": -1 } ] + "copy-from": "THINSKIN", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "WEAKSTOMACH", - "name": "Weak Stomach", - "points": -1, - "description": "You are more likely to throw up from food poisoning, alcohol, etc.", - "starting_trait": true, - "changes_to": [ "NAUSEA" ], - "category": [ "VAMP" ], - "cancels": [ "STRONGSTOMACH" ] + "copy-from": "WEAKSTOMACH", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "ALBINO", - "name": "Albino", - "points": -1, - "description": "You lack skin pigmentation due to a genetic problem. You sunburn extremely easily, and typically use an umbrella and sunglasses when going out in the sun.", - "starting_trait": true, - "changes_to": [ "SUNBURN" ], - "category": [ "TROGLOBITE", "MOUSE", "VAMP" ] + "copy-from": "ALBINO", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "FLIMSY", - "name": "Flimsy", - "points": -4, - "description": "Your body can't take much abuse. Its maximum HP is 25% lower than usual and you heal slightly slower. Stacks with Glass Jaw.", - "starting_trait": true, - "valid": false, - "social_modifiers": { "intimidate": -2 }, - "cancels": [ "TOUGH", "TOUGH2", "TOUGH3" ], - "category": [ "MOUSE", "ELFA", "VAMP" ], - "changes_to": [ "FLIMSY2" ], - "hp_modifier": -0.25 + "copy-from": "FLIMSY", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", @@ -212,79 +127,25 @@ { "type": "mutation", "id": "FANGS", - "name": "Fangs", - "points": 2, - "visibility": 2, - "ugliness": 2, - "description": "Your teeth have grown into two-inch-long fangs, allowing you to make an extra attack when conditions favor it.", - "types": [ "TEETH" ], - "changes_to": [ "SABER_TEETH", "SHARKTEETH" ], - "category": [ "LIZARD", "FISH", "LUPINE", "FELINE", "CHIMERA" ], - "attacks": [ - { - "attack_text_u": "You sink your fangs into %s", - "attack_text_npc": "%1$s sinks their fangs into %2$s", - "blocker_mutations": [ "MUZZLE", "MUZZLE_LONG", "MUZZLE_RAT" ], - "body_part": "mouth", - "chance": 20, - "base_damage": { "damage_type": "stab", "amount": 20 } - }, - { - "attack_text_u": "You sink your fangs into %s", - "attack_text_npc": "%1$s sinks their fangs into %2$s", - "required_mutations": [ "MUZZLE" ], - "body_part": "mouth", - "chance": 18, - "base_damage": { "damage_type": "stab", "amount": 20 } - }, - { - "attack_text_u": "You sink your fangs into %s", - "attack_text_npc": "%1$s sinks their fangs into %2$s", - "required_mutations": [ "MUZZLE_LONG" ], - "body_part": "mouth", - "chance": 15, - "base_damage": { "damage_type": "stab", "amount": 20 } - }, - { - "attack_text_u": "You sink your fangs into %s", - "attack_text_npc": "%1$s sinks their fangs into %2$s", - "required_mutations": [ "MUZZLE_RAT" ], - "body_part": "mouth", - "chance": 19, - "base_damage": { "damage_type": "stab", "amount": 20 } - } - ] + "copy-from": "FANGS", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "NAILS", - "name": "Long Fingernails", - "points": 1, - "visibility": 1, - "description": "Your fingernails are long and sharp. If you aren't wearing gloves, your unarmed attacks deal a minor amount of cutting damage.", - "types": [ "CLAWS" ], - "changes_to": [ "CLAWS", "TALONS" ], - "cancels": [ "ARM_TENTACLES", "ARM_TENTACLES_4", "ARM_TENTACLES_8" ], - "category": [ "RAPTOR" ] + "copy-from": "NAILS", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "POISONOUS", - "name": "Venomous", - "points": 1, - "description": "Your body produces a potent venom. Cutting or stabbing attacks from mutations have a chance to poison your target.", - "prereqs": [ "POISRESIST" ], - "changes_to": [ "POISONOUS2" ], - "category": [ "SLIME", "TROGLOBITE", "SPIDER", "VAMP" ] + "copy-from": "POISONOUS", + "extend": { "category": [ "VAMP" ] } }, { "type": "mutation", "id": "SUNBURN", - "name": "Solar Sensitivity", - "points": -3, - "description": "Your skin simply cannot handle ultraviolet radiation, such as sunlight. It will seriously burn you.", - "prereqs": [ "ALBINO" ], - "prereqs2": [ "TROGLO2", "TROGLO3" ], - "category": [ "TROGLOBITE", "VAMP" ] + "copy-from": "SUNBURN", + "extend": { "category": [ "VAMP" ] } } ] diff --git a/data/mods/CRT_EXPANSION/mutations/crt_wendigo_mutations.json b/data/mods/CRT_EXPANSION/mutations/crt_wendigo_mutations.json index 8fb9dcddea86..0d25bf27d816 100644 --- a/data/mods/CRT_EXPANSION/mutations/crt_wendigo_mutations.json +++ b/data/mods/CRT_EXPANSION/mutations/crt_wendigo_mutations.json @@ -25,56 +25,32 @@ { "type": "mutation", "id": "ANIMALEMPATH", - "name": "Animal Empathy", - "points": 1, - "description": "Peaceful animals will not run away from you, and even aggressive animals are less likely to attack. This only applies to natural animals such as woodland creatures.", - "starting_trait": true, - "category": [ "BEAST", "ELFA", "VAMP", "WENDIGO" ], - "changes_to": [ "ANIMALEMPATH2" ], - "cancels": [ "ANIMALDISCORD" ] + "copy-from": "ANIMALEMPATH", + "extend": { "category": [ "VAMP", "WENDIGO" ] } }, { "type": "mutation", "id": "ANIMALEMPATH2", - "name": "Animal Kinship", - "points": 2, - "description": "Something about your presence is calming to animals, and they will treat you with innate trust. This only applies to natural animals such as woodland creatures.", - "category": [ "ELFA", "VAMP", "WENDIGO" ], - "prereqs": [ "ANIMALEMPATH" ], - "cancels": [ "ANIMALDISCORD" ] + "copy-from": "ANIMALEMPATH2", + "extend": { "category": [ "VAMP", "WENDIGO" ] } }, { "type": "mutation", "id": "SMELLY", - "name": "Strong Scent", - "points": -1, - "description": "Your scent is particularly strong. It's not offensive to humans, but animals that track your scent will do so more easily.", - "starting_trait": true, - "changes_to": [ "SMELLY2" ], - "types": [ "SCENT" ], - "category": [ "FELINE", "LUPINE", "MOUSE", "WENDIGO" ] + "copy-from": "SMELLY", + "extend": { "category": [ "WENDIGO" ] } }, { "type": "mutation", "id": "PHEROMONE_MAMMAL", - "name": "Mammal Pheromones", - "points": 2, - "description": "Your body produces low-level pheromones which put mammals at ease. They will be less likely to attack or flee from you.", - "prereqs": [ "SMELLY2" ], - "types": [ "SCENT" ], - "category": [ "BEAST", "CATTLE", "WENDIGO" ] + "copy-from": "PHEROMONE_MAMMAL", + "extend": { "category": [ "WENDIGO" ] } }, { "type": "mutation", "id": "REGEN", - "name": "Regeneration", - "points": 6, - "description": "Your flesh regenerates from wounds incredibly quickly.", - "types": [ "HEALING" ], - "prereqs": [ "FASTHEALER2" ], - "category": [ "SLIME", "TROGLOBITE", "WENDIGO" ], - "healing_awake": 2.0, - "healing_resting": 1.5 + "copy-from": "REGEN", + "extend": { "category": [ "WENDIGO" ] } }, { "type": "mutation", diff --git a/data/mods/DinoMod/NPC/trait_groups.json b/data/mods/DinoMod/NPC/trait_groups.json index b9f8881b142e..456b7ae228d2 100644 --- a/data/mods/DinoMod/NPC/trait_groups.json +++ b/data/mods/DinoMod/NPC/trait_groups.json @@ -4,7 +4,6 @@ "id": "trait_group_dino", "subtype": "collection", "traits": [ - { "trait": "TOUGH_FEET", "prob": 50 }, { "trait": "THICKSKIN", "prob": 50 }, { "trait": "PAINRESIST", "prob": 50 }, { "trait": "ANTIJUNK", "prob": 50 }, diff --git a/data/mods/DinoMod/mutations/mutations.json b/data/mods/DinoMod/mutations/mutations.json index 3dd7f1bed9c7..3caeea7bed2d 100644 --- a/data/mods/DinoMod/mutations/mutations.json +++ b/data/mods/DinoMod/mutations/mutations.json @@ -63,12 +63,6 @@ "copy-from": "PAINRESIST", "extend": { "category": [ "STEGO", "TYRANT" ] } }, - { - "type": "mutation", - "id": "TOUGH_FEET", - "copy-from": "TOUGH_FEET", - "extend": { "category": [ "STEGO", "TYRANT" ] } - }, { "type": "mutation", "id": "TOUGH", diff --git a/data/mods/My_Sweet_Cataclysm/sweet_mutations.json b/data/mods/My_Sweet_Cataclysm/sweet_mutations.json index 271c2606ad6e..8c2cb3dbc9f8 100644 --- a/data/mods/My_Sweet_Cataclysm/sweet_mutations.json +++ b/data/mods/My_Sweet_Cataclysm/sweet_mutations.json @@ -42,6 +42,6 @@ "allowed_category": [ "SUGAR" ], "no_cbm_on_bp": [ "torso", "head", "eyes", "mouth", "arm_l", "arm_r", "hand_l", "hand_r", "leg_l", "leg_r", "foot_l", "foot_r" ], "armor": [ { "parts": "ALL", "cut": 10, "bash": 5 } ], - "flags": [ "NO_THIRST", "NO_DISEASE", "NO_RADIATION" ] + "flags": [ "NO_THIRST", "NO_RADIATION" ] } ] diff --git a/doc/JSON_FLAGS.md b/doc/JSON_FLAGS.md index d61a11956164..9d607eb3d105 100644 --- a/doc/JSON_FLAGS.md +++ b/doc/JSON_FLAGS.md @@ -1106,10 +1106,9 @@ Also see `monster_attacks.json` for more special attacks, for example, impale an #### Flags -- ```UNARMED_BONUS``` You get a bonus to unarmed bash and cut damage equal to unarmed_skill/2 up to 4. -- ```NO_DISEASE``` This mutation grants immunity to diseases. -- ```NO_THIRST``` Your thirst is not modified by food or drinks. - ```NO_RADIATION``` This mutation grants immunity to radiations. +- ```NO_THIRST``` Your thirst is not modified by food or drinks. +- ```UNARMED_BONUS``` You get a bonus to unarmed bash and cut damage equal to unarmed_skill/2 up to 4. ### Categories diff --git a/doc/JSON_INFO.md b/doc/JSON_INFO.md index cce11f93878b..380f664ac0cf 100644 --- a/doc/JSON_INFO.md +++ b/doc/JSON_INFO.md @@ -1442,6 +1442,7 @@ completed when you wake up for the first time after 24 hours into the game. "can_heal_with": [ "caramel_ointement" ], // List of med that will work for you but not for anyone. See `CANT_HEAL_EVERYONE` flag for items. (default: empty) "allowed_category": [ "ALPHA" ], // List of category you can mutate into. (default: empty) "no_cbm_on_bp": [ "TORSO", "HEAD", "EYES", "MOUTH", "ARM_L" ], // List of body parts that can't receive cbms. (default: empty) +"body_size": "LARGE", // Increase or decrease size, only one size mutation at a time will be valid. Allowed values are: `TINY`, `SMALL`, `LARGE`, `HUGE`. `MEDIUM` can be specified but has no effect, as this is the default size for players and NPCs. "lumination": [ [ "HEAD", 20 ], [ "ARM_L", 10 ] ], // List of glowing bodypart and the intensity of the glow as a float. (default: empty) "metabolism_modifier": 0.333, // Extra metabolism rate multiplier. 1.0 doubles usage, -0.5 halves. "fatigue_modifier": 0.5, // Extra fatigue rate multiplier. 1.0 doubles usage, -0.5 halves. diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 0815067e7c68..3c9006fea0d9 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -749,6 +749,9 @@ static int size_factor_in_time_to_cut( m_size size ) return 600; case MS_HUGE: return 1800; + default: + debugmsg( "Invalid m_size value for butchering corpse: %d", static_cast( size ) ); + break; } return 0; } diff --git a/src/character.cpp b/src/character.cpp index ce378f18ed9d..9867876a8ce4 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -261,11 +261,9 @@ static const trait_id trait_HEAVYSLEEPER2( "HEAVYSLEEPER2" ); static const trait_id trait_HIBERNATE( "HIBERNATE" ); static const trait_id trait_HOARDER( "HOARDER" ); static const trait_id trait_HOLLOW_BONES( "HOLLOW_BONES" ); -static const trait_id trait_HOOVES( "HOOVES" ); static const trait_id trait_HORNS_POINTED( "HORNS_POINTED" ); static const trait_id trait_INFRARED( "INFRARED" ); static const trait_id trait_LEG_TENT_BRACE( "LEG_TENT_BRACE" ); -static const trait_id trait_LEG_TENTACLES( "LEG_TENTACLES" ); static const trait_id trait_LIGHT_BONES( "LIGHT_BONES" ); static const trait_id trait_LIZ_IR( "LIZ_IR" ); static const trait_id trait_M_DEPENDENT( "M_DEPENDENT" ); @@ -304,7 +302,6 @@ static const trait_id trait_THRESH_CEPHALOPOD( "THRESH_CEPHALOPOD" ); static const trait_id trait_THRESH_INSECT( "THRESH_INSECT" ); static const trait_id trait_THRESH_PLANT( "THRESH_PLANT" ); static const trait_id trait_THRESH_SPIDER( "THRESH_SPIDER" ); -static const trait_id trait_TOUGH_FEET( "TOUGH_FEET" ); static const trait_id trait_TRANSPIRATION( "TRANSPIRATION" ); static const trait_id trait_URSINE_EYE( "URSINE_EYE" ); static const trait_id trait_VISCOUS( "VISCOUS" ); @@ -878,7 +875,7 @@ int Character::swim_speed() const // No monsters are currently mountable and can swim, though mods may allow this. if( mon->swims() ) { ret = 25; - ret += get_weight() / 120_gram - 50 * ( mon->get_size() - 1 ); + ret += get_weight() / 120_gram - 50 * mon->get_size(); return ret; } } @@ -6829,6 +6826,8 @@ int Character::height() const return init_height + 50; case MS_HUGE: return init_height + 100; + default: + break; } debugmsg( "Invalid size class" ); @@ -9861,15 +9860,6 @@ int Character::run_cost( int base_cost, bool diag ) const // ROOTS3 does slow you down as your roots are probing around for nutrients, // whether you want them to or not. ROOTS1 is just too squiggly without shoes // to give you some stability. Plants are a bit of a slow-mover. Deal. - const bool mutfeet = has_trait( trait_LEG_TENTACLES ) || has_trait( trait_PADDED_FEET ) || - has_trait( trait_HOOVES ) || has_trait( trait_TOUGH_FEET ) || has_trait( trait_ROOTS2 ); - if( !is_wearing_shoes( side::LEFT ) && !mutfeet ) { - movecost += 8; - } - if( !is_wearing_shoes( side::RIGHT ) && !mutfeet ) { - movecost += 8; - } - if( has_trait( trait_ROOTS3 ) && g->m.has_flag( "DIGGABLE", pos() ) ) { movecost += 10 * footwear_factor(); } diff --git a/src/creature.cpp b/src/creature.cpp index cd0c2fd937d7..0960fa320608 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -258,6 +258,8 @@ bool Creature::sees( const Creature &critter ) const case MS_HUGE: size_modifier = 0.15; break; + default: + break; } const int vision_modifier = 30 - 0.5 * coverage * size_modifier; if( vision_modifier > 1 ) { @@ -483,6 +485,8 @@ int Creature::size_melee_penalty() const return -10; case MS_HUGE: return -20; + default: + break; } debugmsg( "Invalid target size %d", get_size() ); diff --git a/src/creature.h b/src/creature.h index faf9354e6749..5b82cc81bc9c 100644 --- a/src/creature.h +++ b/src/creature.h @@ -52,12 +52,20 @@ struct dealt_projectile_attack; struct pathfinding_settings; struct trap; +template struct enum_traits; + enum m_size : int { - MS_TINY = 1, // Squirrel + MS_TINY = 0, // Squirrel MS_SMALL, // Dog MS_MEDIUM, // Human MS_LARGE, // Cow - MS_HUGE // TAAAANK + MS_HUGE, // TAAAANK + num_m_size // last +}; + +template<> +struct enum_traits { + static constexpr m_size last = m_size::num_m_size; }; enum FacingDirection { diff --git a/src/iuse.cpp b/src/iuse.cpp index 004660a354c8..b7743637d9f7 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -299,6 +299,7 @@ static const trait_id trait_ALCMET( "ALCMET" ); static const trait_id trait_CHLOROMORPH( "CHLOROMORPH" ); static const trait_id trait_EATDEAD( "EATDEAD" ); static const trait_id trait_GILLS( "GILLS" ); +static const trait_id trait_GILLS_CEPH( "GILLS_CEPH" ); static const trait_id trait_HYPEROPIC( "HYPEROPIC" ); static const trait_id trait_ILLITERATE( "ILLITERATE" ); static const trait_id trait_LIGHTWEIGHT( "LIGHTWEIGHT" ); @@ -4506,6 +4507,7 @@ int iuse::vibe( player *p, item *it, bool, const tripoint & ) return 0; } if( ( p->is_underwater() ) && ( !( ( p->has_trait( trait_GILLS ) ) || + ( p->has_trait( trait_GILLS_CEPH ) ) || ( p->is_wearing( itype_rebreather_on ) ) || ( p->is_wearing( itype_rebreather_xl_on ) ) || ( p->is_wearing( itype_mask_h20survivor_on ) ) ) ) ) { diff --git a/src/melee.cpp b/src/melee.cpp index 451e68b47ec0..ae3aa2a24b92 100644 --- a/src/melee.cpp +++ b/src/melee.cpp @@ -629,7 +629,7 @@ void player::reach_attack( const tripoint &p ) Creature *critter = g->critter_at( p ); // Original target size, used when there are monsters in front of our target - int target_size = critter != nullptr ? critter->get_size() : 2; + int target_size = critter != nullptr ? ( critter->get_size() + 1 ) : 2; // Reset last target pos last_target_pos = cata::nullopt; // Max out recoil @@ -643,10 +643,11 @@ void player::reach_attack( const tripoint &p ) for( const tripoint &path_point : path ) { // Possibly hit some unintended target instead Creature *inter = g->critter_at( path_point ); + int inter_block_size = inter->get_size() + 1; /** @EFFECT_STABBING decreases chance of hitting intervening target on reach attack */ if( inter != nullptr && !x_in_y( ( target_size * target_size + 1 ) * skill, - ( inter->get_size() * inter->get_size() + 1 ) * 10 ) ) { + ( inter_block_size * inter_block_size + 1 ) * 10 ) ) { // Even if we miss here, low roll means weapon is pushed away or something like that critter = inter; break; diff --git a/src/mondeath.cpp b/src/mondeath.cpp index d51842c3107a..45073e5b616b 100644 --- a/src/mondeath.cpp +++ b/src/mondeath.cpp @@ -576,6 +576,9 @@ void mdeath::explode( monster &z ) case MS_HUGE: size = 26; break; + default: + size = 15; + break; } explosion_handler::explosion( z.pos(), size ); } diff --git a/src/monmove.cpp b/src/monmove.cpp index d0f7fa9ae2d3..757e02fa9b9f 100644 --- a/src/monmove.cpp +++ b/src/monmove.cpp @@ -1644,6 +1644,9 @@ bool monster::move_to( const tripoint &p, bool force, bool step_on_critter, case MS_HUGE: factor = 1; break; + default: + factor = 6; + break; } // TODO: make this take terrain type into account so diggers traveling under sand will create mounds of sand etc. if( one_in( factor ) ) { diff --git a/src/monster.cpp b/src/monster.cpp index 32edfb8ac10e..8c3549e5f4c3 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1939,7 +1939,7 @@ float monster::stability_roll() const case MS_HUGE: size_bonus += 10; break; - case MS_MEDIUM: + default: break; // keep default } @@ -2001,6 +2001,8 @@ float monster::fall_damage_mod() const return 1.4f; case MS_HUGE: return 2.0f; + default: + return 1.0f; } return 0.0f; @@ -2654,7 +2656,7 @@ m_size monster::get_size() const units::mass monster::get_weight() const { - return units::operator*( type->weight, get_size() / type->size ); + return units::operator*( type->weight, ( get_size() + 1 ) / ( type->size + 1 ) ); } units::mass monster::weight_capacity() const @@ -2664,7 +2666,7 @@ units::mass monster::weight_capacity() const units::volume monster::get_volume() const { - return units::operator*( type->volume, get_size() / type->size ); + return units::operator*( type->volume, ( get_size() + 1 ) / ( type->size + 1 ) ); } void monster::add_msg_if_npc( const std::string &msg ) const @@ -2781,7 +2783,7 @@ item monster::to_item() const float monster::power_rating() const { - float ret = get_size() - 2; // Zed gets 1, cat -1, hulk 3 + float ret = get_size() - 1; // Zed gets 1, cat -1, hulk 3 ret += has_flag( MF_ELECTRONIC ) ? 2 : 0; // Robots tend to have guns // Hostile stuff gets a big boost // Neutral moose will still get burned if it comes close diff --git a/src/mutation.cpp b/src/mutation.cpp index 1799fddd2f34..472de7b7d4d8 100644 --- a/src/mutation.cpp +++ b/src/mutation.cpp @@ -54,12 +54,8 @@ static const trait_id trait_DEBUG_BIONIC_POWER( "DEBUG_BIONIC_POWER" ); static const trait_id trait_DEBUG_BIONIC_POWERGEN( "DEBUG_BIONIC_POWERGEN" ); static const trait_id trait_DEX_ALPHA( "DEX_ALPHA" ); static const trait_id trait_GLASSJAW( "GLASSJAW" ); -static const trait_id trait_HUGE( "HUGE" ); -static const trait_id trait_HUGE_OK( "HUGE_OK" ); static const trait_id trait_INT_ALPHA( "INT_ALPHA" ); static const trait_id trait_INT_SLIME( "INT_SLIME" ); -static const trait_id trait_LARGE( "LARGE" ); -static const trait_id trait_LARGE_OK( "LARGE_OK" ); static const trait_id trait_M_BLOOM( "M_BLOOM" ); static const trait_id trait_M_BLOSSOMS( "M_BLOSSOMS" ); static const trait_id trait_M_FERTILE( "M_FERTILE" ); @@ -74,9 +70,6 @@ static const trait_id trait_ROOTS2( "ROOTS2" ); static const trait_id trait_ROOTS3( "ROOTS3" ); static const trait_id trait_SELFAWARE( "SELFAWARE" ); static const trait_id trait_SLIMESPAWNER( "SLIMESPAWNER" ); -static const trait_id trait_SMALL( "SMALL" ); -static const trait_id trait_SMALL2( "SMALL2" ); -static const trait_id trait_SMALL_OK( "SMALL_OK" ); static const trait_id trait_STR_ALPHA( "STR_ALPHA" ); static const trait_id trait_THRESH_MARLOSS( "THRESH_MARLOSS" ); static const trait_id trait_THRESH_MYCUS( "THRESH_MYCUS" ); @@ -181,8 +174,8 @@ void Character::unset_mutation( const trait_id &trait_ ) if( iter == my_mutations.end() ) { return; } - rebuild_mutation_cache(); my_mutations.erase( iter ); + rebuild_mutation_cache(); mutation_loss_effect( trait ); recalc_sight_limits(); reset_encumbrance(); @@ -252,16 +245,13 @@ const resistances &mutation_branch::damage_resistance( body_part bp ) const void Character::recalculate_size() { - if( has_trait( trait_SMALL2 ) || has_trait( trait_SMALL_OK ) ) { - size_class = MS_TINY; - } else if( has_trait( trait_SMALL ) ) { - size_class = MS_SMALL; - } else if( has_trait( trait_LARGE ) || has_trait( trait_LARGE_OK ) ) { - size_class = MS_LARGE; - } else if( has_trait( trait_HUGE ) || has_trait( trait_HUGE_OK ) ) { - size_class = MS_HUGE; - } else { - size_class = MS_MEDIUM; + size_class = MS_MEDIUM; + // Only one size-changing mutation is expected, so it will only use the first one it finds. + for( const mutation_branch *mut : cached_mutations ) { + if( mut->body_size ) { + size_class = *mut->body_size; + break; + } } } diff --git a/src/mutation.h b/src/mutation.h index ca8c7945444c..8e9f13209cc5 100644 --- a/src/mutation.h +++ b/src/mutation.h @@ -12,6 +12,7 @@ #include "bodypart.h" #include "calendar.h" +#include "creature.h" #include "damage.h" #include "hash_utils.h" #include "memory_fast.h" @@ -239,6 +240,9 @@ struct mutation_branch { /**List of body parts locked out of bionics*/ std::set no_cbm_on_bp; + // Body size from mutations, e.g. large, small, etc. + cata::optional body_size; + // amount of mana added or subtracted from max float mana_modifier = 0.0f; float mana_multiplier = 1.0f; diff --git a/src/mutation_data.cpp b/src/mutation_data.cpp index 50d7e7bc3852..f107479c7701 100644 --- a/src/mutation_data.cpp +++ b/src/mutation_data.cpp @@ -28,6 +28,31 @@ using trait_reader = auto_flags_reader; TraitSet trait_blacklist; TraitGroupMap trait_groups; +namespace io +{ +template<> +std::string enum_to_string( m_size data ) +{ + switch( data ) { + case m_size::MS_TINY: + return "TINY"; + case m_size::MS_SMALL: + return "SMALL"; + case m_size::MS_MEDIUM: + return "MEDIUM"; + case m_size::MS_LARGE: + return "LARGE"; + case m_size::MS_HUGE: + return "HUGE"; + case m_size::num_m_size: + return "num_m_size"; + break; + } + debugmsg( "Invalid body_size value for mutation: %d", static_cast( data ) ); + abort(); +} +} // namespace io + namespace { generic_factory trait_factory( "trait" ); @@ -435,6 +460,8 @@ void mutation_branch::load( const JsonObject &jo, const std::string & ) no_cbm_on_bp.emplace( bodypart_str_id( s ) ); } + optional( jo, was_loaded, "body_size", body_size ); + optional( jo, was_loaded, "category", category, string_reader{} ); for( JsonArray ja : jo.get_array( "spells_learned" ) ) { diff --git a/src/player.cpp b/src/player.cpp index 039a22de4933..f88ffc1efade 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -1331,7 +1331,7 @@ void player::knock_back_to( const tripoint &to ) } if( npc *const np = g->critter_at( to ) ) { - deal_damage( np, bodypart_id( "torso" ), damage_instance( DT_BASH, np->get_size() ) ); + deal_damage( np, bodypart_id( "torso" ), damage_instance( DT_BASH, np->get_size() + 1 ) ); add_effect( effect_stunned, 1_turns ); np->deal_damage( this, bodypart_id( "torso" ), damage_instance( DT_BASH, 3 ) ); add_msg_player_or_npc( _( "You bounce off %s!" ), _( " bounces off %s!" ), diff --git a/src/ranged.cpp b/src/ranged.cpp index 7c31560e105b..b6dace35e982 100644 --- a/src/ranged.cpp +++ b/src/ranged.cpp @@ -531,6 +531,8 @@ static double occupied_tile_fraction( m_size target_size ) return 0.75; case MS_HUGE: return 1.0; + default: + break; } return 0.5; @@ -549,6 +551,8 @@ double Creature::ranged_target_size() const return occupied_tile_fraction( MS_MEDIUM ); case MS_HUGE: return occupied_tile_fraction( MS_LARGE ); + default: + break; } } return occupied_tile_fraction( get_size() ); diff --git a/src/trapfunc.cpp b/src/trapfunc.cpp index d960d564d80c..6b707ca98857 100644 --- a/src/trapfunc.cpp +++ b/src/trapfunc.cpp @@ -387,6 +387,8 @@ bool trapfunc::crossbow( const tripoint &p, Creature *c, item * ) case MS_HUGE: chance = 1; break; + default: + break; } if( one_in( chance ) ) { if( seen ) { @@ -485,6 +487,8 @@ bool trapfunc::shotgun( const tripoint &p, Creature *c, item * ) case MS_HUGE: chance = 2; break; + default: + break; } shots = ( one_in( 8 ) || one_in( chance ) ? 2 : 1 ); if( g->m.tr_at( p ).loadid != tr_shotgun_2 ) { diff --git a/src/vehicle.cpp b/src/vehicle.cpp index f8fb1e399abf..b4f32af34973 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1157,7 +1157,7 @@ int vehicle::part_vpower_w( const int index, const bool at_full_hp ) const monster *mon = get_pet( index ); if( mon != nullptr && mon->has_effect( effect_harnessed ) ) { // An animal that can carry twice as much weight, can pull a cart twice as hard. - pwr = mon->get_speed() * ( mon->get_size() - 1 ) * 3 + pwr = mon->get_speed() * mon->get_size() * 3 * ( mon->get_mountable_weight_ratio() * 5 ); } else { pwr = 0; diff --git a/tests/enchantment_test.cpp b/tests/enchantment_test.cpp index 49b3056db073..1e8d715699d1 100644 --- a/tests/enchantment_test.cpp +++ b/tests/enchantment_test.cpp @@ -393,10 +393,10 @@ TEST_CASE( "Enchantments modify move cost", "[magic][enchantment][move]" ) SECTION( "Naked character" ) { SECTION( "tile move cost = 100" ) { - tests_move_cost( guy, 100, 116, 104 ); + tests_move_cost( guy, 100, 100, 90 ); } SECTION( "tile move cost = 120" ) { - tests_move_cost( guy, 120, 136, 122 ); + tests_move_cost( guy, 120, 120, 108 ); } } SECTION( "Naked character with PADDED_FEET" ) {