From 375fbb5968377d6b0975547679614f31f1e692c1 Mon Sep 17 00:00:00 2001 From: Darkyhard Date: Tue, 1 Dec 2015 06:40:31 +0800 Subject: [PATCH 01/61] Make zombies drop tainted leather. --- data/json/items/comestibles.json | 65 +++++++++++++++- data/json/monsters.json | 86 +++++++++++----------- data/json/recipes/recipe_others.json | 4 +- data/mods/More_Survival_Tools/recipes.json | 4 +- src/activity_handlers.cpp | 24 +++++- 5 files changed, 132 insertions(+), 51 deletions(-) diff --git a/data/json/items/comestibles.json b/data/json/items/comestibles.json index 791d76be93ab2..074f8e7d1dbe4 100644 --- a/data/json/items/comestibles.json +++ b/data/json/items/comestibles.json @@ -5210,7 +5210,8 @@ "type" : "COMESTIBLE", "id" : "meat_tainted", "category": "other", - "name" : "tainted meat", + "name" : "chunk of tainted meat", + "name_plural" : "chunks of tainted meat", "weight" : 238, "color" : "red", "addiction_type" : "none", @@ -19244,6 +19245,36 @@ "stack_size" : 1, "bashing" : 0, "fun" : -12 + },{ + "type" : "COMESTIBLE", + "id" : "raw_tainted_leather", + "category" : "spare_parts", + "name" : "tainted hide", + "weight" : 748, + "color" : "pink", + "addiction_type" : "none", + "spoils_in" : 6, + "use_action" : "POISON", + "stim" : 0, + "container" : "null", + "to_hit" : 0, + "comestible_type" : "FOOD", + "symbol" : ",", + "quench" : -2, + "healthy" : -1, + "addiction_potential" : 0, + "nutrition" : 6, + "description" : "A carefully folded poisonous raw skin harvested from an unnatural creature. You can cure it for storage and tanning.", + "price" : 0, + "material" : "flesh", + "tool" : "null", + "volume" : 5, + "cutting" : 0, + "phase" : "solid", + "charges" : 1, + "stack_size" : 1, + "bashing" : 0, + "fun" : -12 }, { "type" : "COMESTIBLE", @@ -19307,6 +19338,38 @@ "stack_size" : 1, "bashing" : 0, "fun" : -24 + }, + { + "type" : "COMESTIBLE", + "id" : "raw_tainted_fur", + "category" : "spare_parts", + "name" : "tainted pelt", + "weight" : 832, + "color" : "brown", + "addiction_type" : "none", + "spoils_in" : 6, + "use_action" : "POISON", + "stim" : 0, + "container" : "null", + "to_hit" : 0, + "comestible_type" : "FOOD", + "symbol" : ",", + "quench" : -20, + "healthy" : -5, + "addiction_potential" : 0, + "nutrition" : 6, + "description" : "A carefully folded raw skin harvested from a fur-bearing unnatural creature. It still has the fur attached and is poisonous. You can cure it for storage and tanning.", + "price" : 0, + "material" : ["fur", "flesh"], + "flags": ["NO_SALVAGE"], + "tool" : "null", + "volume" : 5, + "cutting" : 0, + "phase" : "solid", + "charges" : 1, + "stack_size" : 1, + "bashing" : 0, + "fun" : -24 },{ "type" : "COMESTIBLE", "id" : "can_tomato", diff --git a/data/json/monsters.json b/data/json/monsters.json index 18cba0db70212..58ab59c54ca79 100644 --- a/data/json/monsters.json +++ b/data/json/monsters.json @@ -1538,7 +1538,7 @@ "death_function":"NORMAL", "special_attacks":[["BITE", 5], ["GRAB", 7]], "description":"A human body, swaying as it moves, an unstoppable rage is visible in its oily black eyes.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1572,7 +1572,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5]], "description":"Stumbling as it moves, this corpse of an overweight human regards its surroundings with an empty black gaze.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "FAT", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "FAT", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1602,7 +1602,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5], ["GRAB", 7]], "description":"Once an athletic human, now a brutal monster. Its facial features are twisted into an expression of pure rage.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1632,7 +1632,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5]], "description":"This human corpse drags itself along slowly with its arms. Its legs are damaged beyond repair.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GRABS", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GRABS", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1662,7 +1662,7 @@ "death_function":["NORMAL"], "special_attacks":[["GRAB", 7]], "description":"This zombie's face and body is completely covered by a protective suit. It wanders around, unsteadily.", - "flags":["SEES", "HEARS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], + "flags":["SEES", "HEARS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1692,7 +1692,7 @@ "death_function":["NORMAL"], "special_attacks":[["GRAB", 7]], "description":"A decaying human body clad in tattered firefighting gear. It staggers aimlessly, reeking of smoke and decay.", - "flags":["SEES", "HEARS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], + "flags":["SEES", "HEARS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1722,7 +1722,7 @@ "death_function":["NORMAL"], "special_attacks":[["SHRIEK", 20], ["BITE", 5], ["GRAB", 7]], "description":"Still wearing the tattered remnants of improvised armor and weaponry, it is plain to see that this zombie was once a survivor like you.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_rot", @@ -1751,7 +1751,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 2], ["GRAB", 7]], "description":"A once-dead human corpse. Its discolored swollen flesh is riddled with festering wounds and open sores.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1781,7 +1781,7 @@ "death_function":["NORMAL"], "special_attacks":[["GRAB", 7]], "description":"A human body covered by a weather-beaten and badly damaged set of riot gear.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1815,7 +1815,7 @@ "death_function":["NORMAL"], "special_attacks":[["SHRIEK", 10], ["GRAB", 7]], "description":"An elongated human body with a swollen chest and a gaping hole where its jaw used to be.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_screecher", @@ -1844,7 +1844,7 @@ "death_function":["NORMAL"], "special_attacks":[["SHRIEK_ALERT", 20], ["SHRIEK_STUN", 1]], "description":"A thin corpse, its chest is swollen in what appears to be preparation. A thick black ooze drips from its open mouth.", - "flags":["SEES", "DEAF", "KEENNOSE", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PARROT"] + "flags":["SEES", "DEAF", "KEENNOSE", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PARROT"] },{ "type" : "MONSTER", "id" : "mon_zombie_acidic", @@ -1910,7 +1910,7 @@ "death_function":["ACID", "NORMAL"], "special_attacks":[["ACID", 20]], "description":"A hunched human body with its eyes pushed up into its forehead and drooping cheeks, most of its face is occupied by a puckered mouth. Its stomach is swollen and nearly translucent, with a sickly yellow tint.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ACIDPROOF", "ACID_BLOOD", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ACIDPROOF", "ACID_BLOOD", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_corrosive", @@ -1972,7 +1972,7 @@ "special_attacks":[["SHOCKSTORM", 25], ["BITE", 5]], "special_when_hit":["ZAPBACK", 100], "description":"A human body with pale blue flesh, crackling with electrical energy.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ELECTRIC", "CBM_CIV", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ELECTRIC", "CBM_CIV", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_smoker", @@ -2000,7 +2000,7 @@ "death_function":"SMOKEBURST", "special_attacks":[["SMOKECLOUD", 1], ["BITE", 5]], "description":"A blackened and twisted naked human body, strips of flesh hang from its body, and it emits a constant haze of thick black smoke.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "HARDTOSHOOT", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "HARDTOSHOOT", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_swimmer", @@ -2029,7 +2029,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5], ["GRAB", 7]], "description":"A slick and glistening human body. Its hands and feet are webbed, and it is clad in swimwear.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BLEED", "SWIMS", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BLEED", "SWIMS", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_dog", @@ -2178,7 +2178,7 @@ "death_function":["NORMAL"], "special_attacks":[["SMASH", 30], ["GRAB", 7]], "description":"Its entire body bulges with distended muscles and swollen, festering wounds.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_hulk", @@ -2207,7 +2207,7 @@ "death_function":["NORMAL"], "special_attacks":[["SMASH", 20]], "description":"A human body now swollen to the size of six men, with arms as wide as a trash can.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "DESTROYS", "POISON", "ATTACKMON", "LEATHER", "NO_BREATHE", "REVIVES", "BONES", "FAT", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "DESTROYS", "POISON", "ATTACKMON", "LEATHER", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "FAT", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_fungus", @@ -2236,7 +2236,7 @@ "death_function":["NORMAL"], "special_attacks":[["FUNGUS", 200], ["BITE", 5]], "description":"Once human, fungal tendrils now sprout from its mouth, eyes, and other orifices, holding together a shambling mass of mold-covered flesh.", - "flags":["SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BONES", "PUSH_MON"] + "flags":["SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_boomer", @@ -2269,7 +2269,7 @@ "death_function":["BOOMER"], "special_attacks":[["BOOMER", 20]], "description":"A rotund human body, bloated beyond belief and layered in rolls of fat. It emits a horrible odor, and a putrid pink sludge dribbles from its mouth.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BILE_BLOOD", "BONES", "FAT", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BILE_BLOOD", "BONES", "FAT", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_boomer_huge", @@ -2298,7 +2298,7 @@ "death_function":["BOOMER_GLOW"], "special_attacks":[["BOOMER_GLOW", 20]], "description":"This boomer, normally swollen and ready to burst, has strengthened and solidified. The bile dribbling from its mouth also appears to have changed...", - "flags":["SEES", "GOODHEARING", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BILE_BLOOD", "BONES", "FAT", "PUSH_MON"] + "flags":["SEES", "GOODHEARING", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BILE_BLOOD", "BONES", "LEATHER", "FAT", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_boomer_fungus", @@ -2327,7 +2327,7 @@ "death_function":["FUNGUS", "NORMAL"], "special_attacks":[["FUNGUS", 100], ["BOOMER", 20]], "description":"A rotund and bloated human body with pasty, fungus-ridden flesh. Its mouth drips with a frothing gray sludge.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BONES", "FAT", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BONES", "LEATHER", "FAT", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_gasbag", @@ -2414,7 +2414,7 @@ "death_function":["NORMAL"], "special_attacks":[["RESURRECT", 0]], "description":"A twisted mockery of the human form, emaciated, with jet black skin and glowing red eyes. It is somehow painful to look at, awakening fears deep within your psyche, and even the air around it seems more sinister, somehow darker and more dangerous.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "LEATHER", "BONES"], "anger_triggers":["HURT", "PLAYER_CLOSE", "PLAYER_WEAK"] },{ "type" : "MONSTER", @@ -2445,7 +2445,7 @@ "special_attacks":[["SCIENCE", 20]], "starting_ammo" : { "bot_manhack": 3 }, "description":"Apart from the jet black eyes it would be easy to believe this scientist was still alive. Clad in a tattered lab coat, it looks to have some measure of situational awareness and resourcefulness.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "POISON", "BLEED", "CBM_SCI", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "POISON", "BLEED", "CBM_SCI", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_soldier", @@ -2474,7 +2474,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5]], "description":"Once a soldier, it is dressed head to toe in combat gear and carries itself rather steadily for a zombie.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -2511,7 +2511,7 @@ "death_function":["DETONATE"], "special_attacks":[["GRENADIER", 6]], "description":"Once a soldier, it is dressed head to toe in combat gear. Its hands constantly fumble at its many pouches.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_grenadier_elite", @@ -2547,7 +2547,7 @@ "death_function":["DETONATE"], "special_attacks":[["GRENADIER_ELITE", 3]], "description":"Once a soldier, it is dressed head to toe in combat gear and wearing a MOLLE pack. Its hands quickly open and close its many pouches.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_grabber", @@ -2580,7 +2580,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5]], "description":"A deformed human body, once living. Its arms dangle from its sides like the limbs of some skinless ape, mindlessly groping at their surroundings.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "GRABS", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "GRABS", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_grappler", @@ -2610,7 +2610,7 @@ "death_function":["NORMAL"], "special_attacks":[["RANGED_PULL", 20], ["GRAB_DRAG", 3], ["BITE", 5]], "description":"An undead humanoid, its elongated arms drag along the ground as it moves. It looks to almost have a hunch from the swollen back and shoulder muscles tearing though its skin.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_biter", @@ -2639,7 +2639,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 2], ["GRAB", 4]], "description":"A distorted and swollen human body. Its jaws have elongated into a crocodile like snout, dripping with foul smelling saliva.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "GRABS", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "GRABS", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_master", @@ -2668,7 +2668,7 @@ "death_function":["NORMAL"], "special_attacks":[["UPGRADE", 10]], "description":"Once human, its features have tightened, its lips pulled back into an unnatural grin, revealing rows of blackened teeth beneath its large, piercing eyes. It stands tall and its movements are fluid and tightly controlled. A feeling of danger permeates the air around it, and the light that falls on it seems somehow harsher and more glaring.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES"], + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES" "LEATHER"], "anger_triggers":["HURT", "PLAYER_CLOSE", "PLAYER_WEAK"] },{ "type" : "MONSTER", @@ -2703,7 +2703,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5]], "description":"A deformed human body, its skin has been transformed into one thick, calloused envelope of scar tissue.", - "flags":["HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_runner", @@ -2737,7 +2737,7 @@ "death_function":["NORMAL"], "special_attacks":[ ["BITE", 5]], "description":"This recently-risen body moves quickly, darting its head back and forth and gnawing at its hands.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_hunter", @@ -2770,7 +2770,7 @@ "death_function":["NORMAL"], "special_attacks":[["LEAP", 5], ["BITE", 5]], "description":"This once-human body is barely recognizable, scrambling about on all fours, its nails and teeth both sharpened into dangerous looking spikes.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "CLIMBS", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "CLIMBS", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_predator", @@ -2800,7 +2800,7 @@ "death_function":["NORMAL"], "special_attacks":[["LEAP", 5], ["BITE", 5], ["IMPALE", 25]], "description":"With its joints in odd places and angles, this humanoid creature prowls across the landscape with suprising speed. Its teeth and arms are sharpened into fine points, and black ooze seeps out from cuts between its muscles.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_hollow", @@ -2828,7 +2828,7 @@ "death_function":"BLOBSPLIT", "special_attacks":[["STRETCH_BITE", 10], ["STRETCH_ATTACK", 5]], "description":"Black hollow eyes survey the surroundings as the zombie stretches and bends in ways that whoever the original body belonged to never could. The only thing that seems solid, on this flexible black-veined body, is the rows of sharp black teeth. You get the feeling that the only human thing remaining is the skin, worn as one would wear clothes.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "LEATHER", "NO_BREATHE"] },{ "type" : "MONSTER", "id" : "mon_zombie_child", @@ -2864,7 +2864,7 @@ "hp":40, "death_function":["NORMAL"], "description":"It was only a child, and little is different about it now aside from the hungry look in its eyes. You'd be hard pressed to not feel like you were killing an actual child by putting it down.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "BLEED", "POISON", "GUILT", "NO_BREATHE", "REVIVES", "BONES"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "BLEED", "POISON", "GUILT", "NO_BREATHE", "REVIVES", "BONES" "LEATHER"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -6267,7 +6267,7 @@ "death_function":"NORMAL", "special_attacks":[["BRANDISH", 10]], "description":"Living in the woods, \nkilling for sport, \neating all the bodies, \nactual cannibal Shia LaBeouf.", - "flags":["SEES", "HEARS", "WARM", "BASHES", "POISON", "BLEED", "NO_BREATHE"], + "flags":["SEES", "HEARS", "WARM", "BASHES", "POISON", "LEATHER", "BONES", "BLEED", "NO_BREATHE"], "anger_triggers":["STALK", "PLAYER_WEAK", "HURT", "PLAYER_CLOSE", "BONES"], "fear_triggers":["FIRE"] },{ @@ -6416,7 +6416,7 @@ "special_attacks":[["BIO_OP_TAKEDOWN", 20]], "special_when_hit":["ZAPBACK", 75], "description":"This armored and augmented soldier's bionics crackle with energy. Worse, it appears to remember its training.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "CBM_OP", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "CBM_OP", "ACIDPROOF", "NO_BREATHE", "REVIVES", "LEATHER", "BONES"] },{ "type" : "MONSTER", "id" : "mon_zombie_armored", @@ -6444,7 +6444,7 @@ "hp":120, "death_function":["NORMAL"], "description":"Despite being encased in a what was once a nigh-impenetrable suit of power armor, something still managed to kill this soldier.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES"], + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "LEATHER", "BONES"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -6473,7 +6473,7 @@ "death_function":"NORMAL", "special_attacks":[["BITE", 2]], "description":"A zombified omnivore descended from the wild boar. Now it's got black goo all over it, instead of mud.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "KEENNOSE", "BLEED", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "FAT"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "KEENNOSE", "BLEED", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "FAT"], "anger_triggers":["PLAYER_WEAK", "PLAYER_CLOSE"], "fear_triggers":["FIRE"] }, @@ -6531,7 +6531,7 @@ "death_function":"JACKSON", "special_attacks":[["JACKSON", 0]], "description":"And though you fight to stay alive, \nYour body starts to shiver. \nFor no mere mortal can resist, \nThe evil of the thriller.", - "flags":["SEES", "SMELLS", "WARM", "BASHES", "BLEED", "NO_BREATHE", "BONES", "POISON"] + "flags":["SEES", "SMELLS", "WARM", "BASHES", "BLEED", "NO_BREATHE", "BONES", "LEATHER", "POISON"] },{ "type" : "MONSTER", "id" : "mon_zombie_dancer", @@ -6560,7 +6560,7 @@ "death_function":"NORMAL", "special_attacks":[["DANCE", 30]], "description":"The foulest stench is in the air, \nThe funk of forty thousand years, \nAnd grisly ghouls from every tomb, \nAre closing in to seal your doom!\n\nThe dancer doesn't even notice you, it seems like something nearby is controlling it.", - "flags":["WARM", "BASHES", "DESTROYS", "LEATHER", "NO_BREATHE", "REGENERATES_50", "BONES", "POISON", "FAT"] + "flags":["WARM", "BASHES", "DESTROYS", "LEATHER", "NO_BREATHE", "REGENERATES_50", "BONES", "LEATHER", "POISON", "FAT"] }, { "type" : "MONSTER", "id" : "mon_riotbot", @@ -6654,7 +6654,7 @@ "special_attacks":[["SHOCKSTORM", 15], ["SMASH", 30]], "special_when_hit":["ZAPBACK", 75], "description":"A huge beast covered in visible scarring from what you can only guess was 'research'. Being near it, you can hear a slight humming, like that of an electrical transformer.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ELECTRIC", "CBM_SUBS", "NO_BREATHE", "REVIVES", "BONES"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ELECTRIC", "CBM_SUBS", "NO_BREATHE", "REVIVES", "BONES" "LEATHER"] },{ "type" : "MONSTER", "id" : "mon_giant_cockroach", diff --git a/data/json/recipes/recipe_others.json b/data/json/recipes/recipe_others.json index 16147406a799c..31a01b6f58f88 100644 --- a/data/json/recipes/recipe_others.json +++ b/data/json/recipes/recipe_others.json @@ -6937,6 +6937,7 @@ ], [ [ "raw_leather", 1 ], + [ "raw_tainted_leather", 1 ], [ "raw_hleather", 1 ] ] ] @@ -7031,7 +7032,8 @@ [ "salt", 1 ] ], [ - [ "raw_fur", 1 ] + [ "raw_fur", 1 ], + [ "tainted_raw_fur", 1 ] ] ] },{ diff --git a/data/mods/More_Survival_Tools/recipes.json b/data/mods/More_Survival_Tools/recipes.json index 3f8da66136dce..207319b90e493 100644 --- a/data/mods/More_Survival_Tools/recipes.json +++ b/data/mods/More_Survival_Tools/recipes.json @@ -157,7 +157,7 @@ [ "toolset", 10 ], [ "fire", -1 ] ]], - "components": [[[ "raw_leather", 1 ], [ "raw_hleather", 1 ]]] + "components": [[[ "raw_leather", 1 ], [ "raw_tainted_leather", 1 ], [ "raw_hleather", 1 ]]] }, { "type" : "recipe", @@ -179,7 +179,7 @@ [ "toolset", 10 ], [ "fire", -1 ] ]], - "components": [[[ "raw_fur", 1 ]]] + "components": [[[ "raw_fur", 1 ], [ "raw_tainted_fur", 1 ]]] },{ "type" : "recipe", "result": "resin_cord", diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 479bb1b0504fd..288c9504855bd 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -275,7 +275,9 @@ void activity_handlers::butcher_finish( player_activity *act, player *p ) corpse->has_flag(MF_CHITIN)) && skins > 0 ) { add_msg(m_good, _("You manage to skin the %s!"), corpse->nname().c_str()); int fur = 0; + int tainted_fur = 0; int leather = 0; + int tainted_leather = 0; int human_leather = 0; int chitin = 0; @@ -286,12 +288,20 @@ void activity_handlers::butcher_finish( player_activity *act, player *p ) skins = std::max(skins, 0); } if( corpse->has_flag(MF_FUR) ) { - fur = rng(0, skins); - skins -= fur; + if( corpse->has_flag(MF_POISON) ) { + tainted_fur = rng(0, skins); + skins -= tainted_fur; + } else { + fur = rng(0, skins); + skins -= fur; + } skins = std::max(skins, 0); } if( corpse->has_flag(MF_LEATHER) ) { - if( corpse->has_flag(MF_HUMAN) ) { + if( corpse->has_flag(MF_POISON) ) { + tainted_leather = rng(0, skins); + skins -= tainted_leather; + } else if( corpse->has_flag(MF_HUMAN) ) { human_leather = rng(0, skins); skins -= human_leather; } else { @@ -308,12 +318,18 @@ void activity_handlers::butcher_finish( player_activity *act, player *p ) if( fur > 0 ) { g->m.spawn_item(p->pos(), "raw_fur", fur, 0, age); } + if( tainted_fur > 0 ) { + g->m.spawn_item(p->pos(), "raw_tainted_fur", fur, 0, age); + } if( leather > 0 ) { g->m.spawn_item(p->pos(), "raw_leather", leather, 0, age); } - if( human_leather ) { + if( human_leather > 0 ) { g->m.spawn_item(p->pos(), "raw_hleather", leather, 0, age); } + if( tainted_leather > 0 ) { + g->m.spawn_item(p->pos(), "raw_tainted_leather", leather, 0, age); + } } if( feathers > 0 ) { From f265483d6cd4c12c682f9c6d5a31390dea5de7d3 Mon Sep 17 00:00:00 2001 From: Darkyhard Date: Tue, 1 Dec 2015 07:21:17 +0800 Subject: [PATCH 02/61] Fix typos. --- data/json/monsters.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/json/monsters.json b/data/json/monsters.json index 58ab59c54ca79..a0ec84ccc8522 100644 --- a/data/json/monsters.json +++ b/data/json/monsters.json @@ -2668,7 +2668,7 @@ "death_function":["NORMAL"], "special_attacks":[["UPGRADE", 10]], "description":"Once human, its features have tightened, its lips pulled back into an unnatural grin, revealing rows of blackened teeth beneath its large, piercing eyes. It stands tall and its movements are fluid and tightly controlled. A feeling of danger permeates the air around it, and the light that falls on it seems somehow harsher and more glaring.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES" "LEATHER"], + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER"], "anger_triggers":["HURT", "PLAYER_CLOSE", "PLAYER_WEAK"] },{ "type" : "MONSTER", @@ -2864,7 +2864,7 @@ "hp":40, "death_function":["NORMAL"], "description":"It was only a child, and little is different about it now aside from the hungry look in its eyes. You'd be hard pressed to not feel like you were killing an actual child by putting it down.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "BLEED", "POISON", "GUILT", "NO_BREATHE", "REVIVES", "BONES" "LEATHER"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "BLEED", "POISON", "GUILT", "NO_BREATHE", "REVIVES", "BONES", "LEATHER"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -6654,7 +6654,7 @@ "special_attacks":[["SHOCKSTORM", 15], ["SMASH", 30]], "special_when_hit":["ZAPBACK", 75], "description":"A huge beast covered in visible scarring from what you can only guess was 'research'. Being near it, you can hear a slight humming, like that of an electrical transformer.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ELECTRIC", "CBM_SUBS", "NO_BREATHE", "REVIVES", "BONES" "LEATHER"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ELECTRIC", "CBM_SUBS", "NO_BREATHE", "REVIVES", "BONES", "LEATHER"] },{ "type" : "MONSTER", "id" : "mon_giant_cockroach", From 38e34fc29b7f3dfaeb7b241812364a109c1f8689 Mon Sep 17 00:00:00 2001 From: Darkyhard Date: Tue, 1 Dec 2015 14:20:39 +0800 Subject: [PATCH 03/61] Remove leather tag from most zombies --- data/json/monsters.json | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/data/json/monsters.json b/data/json/monsters.json index a0ec84ccc8522..09bed98d48499 100644 --- a/data/json/monsters.json +++ b/data/json/monsters.json @@ -1538,7 +1538,7 @@ "death_function":"NORMAL", "special_attacks":[["BITE", 5], ["GRAB", 7]], "description":"A human body, swaying as it moves, an unstoppable rage is visible in its oily black eyes.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1632,7 +1632,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5]], "description":"This human corpse drags itself along slowly with its arms. Its legs are damaged beyond repair.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GRABS", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GRABS", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1662,7 +1662,7 @@ "death_function":["NORMAL"], "special_attacks":[["GRAB", 7]], "description":"This zombie's face and body is completely covered by a protective suit. It wanders around, unsteadily.", - "flags":["SEES", "HEARS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], + "flags":["SEES", "HEARS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1692,7 +1692,7 @@ "death_function":["NORMAL"], "special_attacks":[["GRAB", 7]], "description":"A decaying human body clad in tattered firefighting gear. It staggers aimlessly, reeking of smoke and decay.", - "flags":["SEES", "HEARS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], + "flags":["SEES", "HEARS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1722,7 +1722,7 @@ "death_function":["NORMAL"], "special_attacks":[["SHRIEK", 20], ["BITE", 5], ["GRAB", 7]], "description":"Still wearing the tattered remnants of improvised armor and weaponry, it is plain to see that this zombie was once a survivor like you.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_rot", @@ -1751,7 +1751,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 2], ["GRAB", 7]], "description":"A once-dead human corpse. Its discolored swollen flesh is riddled with festering wounds and open sores.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1781,7 +1781,7 @@ "death_function":["NORMAL"], "special_attacks":[["GRAB", 7]], "description":"A human body covered by a weather-beaten and badly damaged set of riot gear.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1815,7 +1815,7 @@ "death_function":["NORMAL"], "special_attacks":[["SHRIEK", 10], ["GRAB", 7]], "description":"An elongated human body with a swollen chest and a gaping hole where its jaw used to be.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_screecher", @@ -1844,7 +1844,7 @@ "death_function":["NORMAL"], "special_attacks":[["SHRIEK_ALERT", 20], ["SHRIEK_STUN", 1]], "description":"A thin corpse, its chest is swollen in what appears to be preparation. A thick black ooze drips from its open mouth.", - "flags":["SEES", "DEAF", "KEENNOSE", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PARROT"] + "flags":["SEES", "DEAF", "KEENNOSE", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PARROT"] },{ "type" : "MONSTER", "id" : "mon_zombie_acidic", @@ -1910,7 +1910,7 @@ "death_function":["ACID", "NORMAL"], "special_attacks":[["ACID", 20]], "description":"A hunched human body with its eyes pushed up into its forehead and drooping cheeks, most of its face is occupied by a puckered mouth. Its stomach is swollen and nearly translucent, with a sickly yellow tint.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ACIDPROOF", "ACID_BLOOD", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ACIDPROOF", "ACID_BLOOD", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_corrosive", @@ -1972,7 +1972,7 @@ "special_attacks":[["SHOCKSTORM", 25], ["BITE", 5]], "special_when_hit":["ZAPBACK", 100], "description":"A human body with pale blue flesh, crackling with electrical energy.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ELECTRIC", "CBM_CIV", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ELECTRIC", "CBM_CIV", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_smoker", @@ -2000,7 +2000,7 @@ "death_function":"SMOKEBURST", "special_attacks":[["SMOKECLOUD", 1], ["BITE", 5]], "description":"A blackened and twisted naked human body, strips of flesh hang from its body, and it emits a constant haze of thick black smoke.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "HARDTOSHOOT", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "HARDTOSHOOT", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_swimmer", @@ -2236,7 +2236,7 @@ "death_function":["NORMAL"], "special_attacks":[["FUNGUS", 200], ["BITE", 5]], "description":"Once human, fungal tendrils now sprout from its mouth, eyes, and other orifices, holding together a shambling mass of mold-covered flesh.", - "flags":["SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_boomer", @@ -2327,7 +2327,7 @@ "death_function":["FUNGUS", "NORMAL"], "special_attacks":[["FUNGUS", 100], ["BOOMER", 20]], "description":"A rotund and bloated human body with pasty, fungus-ridden flesh. Its mouth drips with a frothing gray sludge.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BONES", "LEATHER", "FAT", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BONES", "FAT", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_gasbag", @@ -2474,7 +2474,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5]], "description":"Once a soldier, it is dressed head to toe in combat gear and carries itself rather steadily for a zombie.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -2511,7 +2511,7 @@ "death_function":["DETONATE"], "special_attacks":[["GRENADIER", 6]], "description":"Once a soldier, it is dressed head to toe in combat gear. Its hands constantly fumble at its many pouches.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_grenadier_elite", @@ -2547,7 +2547,7 @@ "death_function":["DETONATE"], "special_attacks":[["GRENADIER_ELITE", 3]], "description":"Once a soldier, it is dressed head to toe in combat gear and wearing a MOLLE pack. Its hands quickly open and close its many pouches.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_grabber", @@ -2580,7 +2580,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5]], "description":"A deformed human body, once living. Its arms dangle from its sides like the limbs of some skinless ape, mindlessly groping at their surroundings.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "GRABS", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "GRABS", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_grappler", @@ -2737,7 +2737,7 @@ "death_function":["NORMAL"], "special_attacks":[ ["BITE", 5]], "description":"This recently-risen body moves quickly, darting its head back and forth and gnawing at its hands.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_hunter", @@ -2770,7 +2770,7 @@ "death_function":["NORMAL"], "special_attacks":[["LEAP", 5], ["BITE", 5]], "description":"This once-human body is barely recognizable, scrambling about on all fours, its nails and teeth both sharpened into dangerous looking spikes.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "CLIMBS", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "CLIMBS", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_predator", @@ -2864,7 +2864,7 @@ "hp":40, "death_function":["NORMAL"], "description":"It was only a child, and little is different about it now aside from the hungry look in its eyes. You'd be hard pressed to not feel like you were killing an actual child by putting it down.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "BLEED", "POISON", "GUILT", "NO_BREATHE", "REVIVES", "BONES", "LEATHER"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "BLEED", "POISON", "GUILT", "NO_BREATHE", "REVIVES", "BONES"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -6416,7 +6416,7 @@ "special_attacks":[["BIO_OP_TAKEDOWN", 20]], "special_when_hit":["ZAPBACK", 75], "description":"This armored and augmented soldier's bionics crackle with energy. Worse, it appears to remember its training.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "CBM_OP", "ACIDPROOF", "NO_BREATHE", "REVIVES", "LEATHER", "BONES"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "CBM_OP", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES"] },{ "type" : "MONSTER", "id" : "mon_zombie_armored", @@ -6444,7 +6444,7 @@ "hp":120, "death_function":["NORMAL"], "description":"Despite being encased in a what was once a nigh-impenetrable suit of power armor, something still managed to kill this soldier.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "LEATHER", "BONES"], + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES"], "categories":["CLASSIC"] },{ "type" : "MONSTER", From 6646b4fac5575f98ea68d9d2c23bff2b4f65810a Mon Sep 17 00:00:00 2001 From: Darkyhard Date: Thu, 17 Dec 2015 06:25:55 +0800 Subject: [PATCH 04/61] Remove LEATHER tag from zombies --- data/json/monsters.json | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/data/json/monsters.json b/data/json/monsters.json index 09bed98d48499..bb5a7f3b81e7c 100644 --- a/data/json/monsters.json +++ b/data/json/monsters.json @@ -1572,7 +1572,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5]], "description":"Stumbling as it moves, this corpse of an overweight human regards its surroundings with an empty black gaze.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "FAT", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "FAT", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -1602,7 +1602,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5], ["GRAB", 7]], "description":"Once an athletic human, now a brutal monster. Its facial features are twisted into an expression of pure rage.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"], "categories":["CLASSIC"] },{ "type" : "MONSTER", @@ -2029,7 +2029,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5], ["GRAB", 7]], "description":"A slick and glistening human body. Its hands and feet are webbed, and it is clad in swimwear.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BLEED", "SWIMS", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "BLEED", "SWIMS", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_dog", @@ -2178,7 +2178,7 @@ "death_function":["NORMAL"], "special_attacks":[["SMASH", 30], ["GRAB", 7]], "description":"Its entire body bulges with distended muscles and swollen, festering wounds.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_hulk", @@ -2207,7 +2207,7 @@ "death_function":["NORMAL"], "special_attacks":[["SMASH", 20]], "description":"A human body now swollen to the size of six men, with arms as wide as a trash can.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "DESTROYS", "POISON", "ATTACKMON", "LEATHER", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "FAT", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "DESTROYS", "POISON", "ATTACKMON", "LEATHER", "NO_BREATHE", "REVIVES", "BONES", "FAT", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_fungus", @@ -2269,7 +2269,7 @@ "death_function":["BOOMER"], "special_attacks":[["BOOMER", 20]], "description":"A rotund human body, bloated beyond belief and layered in rolls of fat. It emits a horrible odor, and a putrid pink sludge dribbles from its mouth.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BILE_BLOOD", "BONES", "FAT", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BILE_BLOOD", "BONES", "FAT", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_boomer_huge", @@ -2298,7 +2298,7 @@ "death_function":["BOOMER_GLOW"], "special_attacks":[["BOOMER_GLOW", 20]], "description":"This boomer, normally swollen and ready to burst, has strengthened and solidified. The bile dribbling from its mouth also appears to have changed...", - "flags":["SEES", "GOODHEARING", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BILE_BLOOD", "BONES", "LEATHER", "FAT", "PUSH_MON"] + "flags":["SEES", "GOODHEARING", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BILE_BLOOD", "BONES", "FAT", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_boomer_fungus", @@ -2414,7 +2414,7 @@ "death_function":["NORMAL"], "special_attacks":[["RESURRECT", 0]], "description":"A twisted mockery of the human form, emaciated, with jet black skin and glowing red eyes. It is somehow painful to look at, awakening fears deep within your psyche, and even the air around it seems more sinister, somehow darker and more dangerous.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "LEATHER", "BONES"], + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES"], "anger_triggers":["HURT", "PLAYER_CLOSE", "PLAYER_WEAK"] },{ "type" : "MONSTER", @@ -2445,7 +2445,7 @@ "special_attacks":[["SCIENCE", 20]], "starting_ammo" : { "bot_manhack": 3 }, "description":"Apart from the jet black eyes it would be easy to believe this scientist was still alive. Clad in a tattered lab coat, it looks to have some measure of situational awareness and resourcefulness.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "POISON", "BLEED", "CBM_SCI", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "POISON", "BLEED", "CBM_SCI", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_soldier", @@ -2610,7 +2610,7 @@ "death_function":["NORMAL"], "special_attacks":[["RANGED_PULL", 20], ["GRAB_DRAG", 3], ["BITE", 5]], "description":"An undead humanoid, its elongated arms drag along the ground as it moves. It looks to almost have a hunch from the swollen back and shoulder muscles tearing though its skin.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_biter", @@ -2639,7 +2639,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 2], ["GRAB", 4]], "description":"A distorted and swollen human body. Its jaws have elongated into a crocodile like snout, dripping with foul smelling saliva.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "GRABS", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "GRABS", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_master", @@ -2668,7 +2668,7 @@ "death_function":["NORMAL"], "special_attacks":[["UPGRADE", 10]], "description":"Once human, its features have tightened, its lips pulled back into an unnatural grin, revealing rows of blackened teeth beneath its large, piercing eyes. It stands tall and its movements are fluid and tightly controlled. A feeling of danger permeates the air around it, and the light that falls on it seems somehow harsher and more glaring.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER"], + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES"], "anger_triggers":["HURT", "PLAYER_CLOSE", "PLAYER_WEAK"] },{ "type" : "MONSTER", @@ -2703,7 +2703,7 @@ "death_function":["NORMAL"], "special_attacks":[["BITE", 5]], "description":"A deformed human body, its skin has been transformed into one thick, calloused envelope of scar tissue.", - "flags":["HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_runner", @@ -2800,7 +2800,7 @@ "death_function":["NORMAL"], "special_attacks":[["LEAP", 5], ["BITE", 5], ["IMPALE", 25]], "description":"With its joints in odd places and angles, this humanoid creature prowls across the landscape with suprising speed. Its teeth and arms are sharpened into fine points, and black ooze seeps out from cuts between its muscles.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "LEATHER", "PUSH_MON"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "POISON", "NO_BREATHE", "REVIVES", "BONES", "PUSH_MON"] },{ "type" : "MONSTER", "id" : "mon_zombie_hollow", @@ -2828,7 +2828,7 @@ "death_function":"BLOBSPLIT", "special_attacks":[["STRETCH_BITE", 10], ["STRETCH_ATTACK", 5]], "description":"Black hollow eyes survey the surroundings as the zombie stretches and bends in ways that whoever the original body belonged to never could. The only thing that seems solid, on this flexible black-veined body, is the rows of sharp black teeth. You get the feeling that the only human thing remaining is the skin, worn as one would wear clothes.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "LEATHER", "NO_BREATHE"] + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "NO_BREATHE"] },{ "type" : "MONSTER", "id" : "mon_zombie_child", @@ -6531,7 +6531,7 @@ "death_function":"JACKSON", "special_attacks":[["JACKSON", 0]], "description":"And though you fight to stay alive, \nYour body starts to shiver. \nFor no mere mortal can resist, \nThe evil of the thriller.", - "flags":["SEES", "SMELLS", "WARM", "BASHES", "BLEED", "NO_BREATHE", "BONES", "LEATHER", "POISON"] + "flags":["SEES", "SMELLS", "WARM", "BASHES", "BLEED", "NO_BREATHE", "BONES", "POISON"] },{ "type" : "MONSTER", "id" : "mon_zombie_dancer", @@ -6654,7 +6654,7 @@ "special_attacks":[["SHOCKSTORM", 15], ["SMASH", 30]], "special_when_hit":["ZAPBACK", 75], "description":"A huge beast covered in visible scarring from what you can only guess was 'research'. Being near it, you can hear a slight humming, like that of an electrical transformer.", - "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ELECTRIC", "CBM_SUBS", "NO_BREATHE", "REVIVES", "BONES", "LEATHER"] + "flags":["SEES", "HEARS", "SMELLS", "STUMBLES", "WARM", "BASHES", "GROUP_BASH", "POISON", "ELECTRIC", "CBM_SUBS", "NO_BREATHE", "REVIVES", "BONES"] },{ "type" : "MONSTER", "id" : "mon_giant_cockroach", From 9dc71000849e6f0df68633f00d281064b28d36f9 Mon Sep 17 00:00:00 2001 From: Darkyhard Date: Thu, 17 Dec 2015 19:17:09 +0800 Subject: [PATCH 05/61] Remove duplicated flag --- data/json/monsters.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/monsters.json b/data/json/monsters.json index bb5a7f3b81e7c..cc03251f9d709 100644 --- a/data/json/monsters.json +++ b/data/json/monsters.json @@ -6560,7 +6560,7 @@ "death_function":"NORMAL", "special_attacks":[["DANCE", 30]], "description":"The foulest stench is in the air, \nThe funk of forty thousand years, \nAnd grisly ghouls from every tomb, \nAre closing in to seal your doom!\n\nThe dancer doesn't even notice you, it seems like something nearby is controlling it.", - "flags":["WARM", "BASHES", "DESTROYS", "LEATHER", "NO_BREATHE", "REGENERATES_50", "BONES", "LEATHER", "POISON", "FAT"] + "flags":["WARM", "BASHES", "DESTROYS", "LEATHER", "NO_BREATHE", "REGENERATES_50", "BONES", "POISON", "FAT"] }, { "type" : "MONSTER", "id" : "mon_riotbot", From 155b99f972fde593b249e5a02abff41e0d070901 Mon Sep 17 00:00:00 2001 From: Darkyhard Date: Sun, 20 Dec 2015 10:08:16 +0800 Subject: [PATCH 06/61] Remove LEATHER flag from Shia --- data/json/monsters.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/monsters.json b/data/json/monsters.json index cc03251f9d709..c1077f02200af 100644 --- a/data/json/monsters.json +++ b/data/json/monsters.json @@ -6267,7 +6267,7 @@ "death_function":"NORMAL", "special_attacks":[["BRANDISH", 10]], "description":"Living in the woods, \nkilling for sport, \neating all the bodies, \nactual cannibal Shia LaBeouf.", - "flags":["SEES", "HEARS", "WARM", "BASHES", "POISON", "LEATHER", "BONES", "BLEED", "NO_BREATHE"], + "flags":["SEES", "HEARS", "WARM", "BASHES", "POISON", "BONES", "BLEED", "NO_BREATHE"], "anger_triggers":["STALK", "PLAYER_WEAK", "HURT", "PLAYER_CLOSE", "BONES"], "fear_triggers":["FIRE"] },{ From f72c74276b0d1859be9d1339f7374e998fbe0991 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Tue, 22 Dec 2015 16:16:32 -0800 Subject: [PATCH 07/61] Add recipe for chocpretzels and choco_coffee_beans Adds recipe for chocpretzels and choco_coffee_beans --- data/json/recipes/recipe_food.json | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/data/json/recipes/recipe_food.json b/data/json/recipes/recipe_food.json index e71aa7f0c9d23..808840ff4a47a 100644 --- a/data/json/recipes/recipe_food.json +++ b/data/json/recipes/recipe_food.json @@ -5650,6 +5650,64 @@ ["watermelon", 1] ] ] +},{ + "type" : "recipe", + "result": "choco_coffee_beans", + "category": "CC_FOOD", + "subcategory": "CSC_FOOD_OTHER", + "skill_used": "cooking", + "difficulty": 1, + "result_mult": 5, + "time": 6000, + "reversible": false, + "autolearn": true, + "qualities":[ + {"id":"COOK","level":2,"amount":1} + ], "tools": [ + [ + [ "hotplate", 2 ], + [ "char_smoker", 1 ], + [ "toolset", 2 ], + [ "fire", -1 ] + ] + ], + "components": [ + [ + [ "roasted_coffee_bean", 5 ] + ], + [ + [ "chocolate", 1 ] + ] + ] +},{ + "type" : "recipe", + "result": "chocpretzels", + "category": "CC_FOOD", + "subcategory": "CSC_FOOD_OTHER", + "skill_used": "cooking", + "difficulty": 1, + "result_mult": 3, + "time": 6000, + "reversible": false, + "autolearn": true, + "qualities":[ + {"id":"COOK","level":2,"amount":1} + ], "tools": [ + [ + [ "hotplate", 2 ], + [ "char_smoker", 1 ], + [ "toolset", 2 ], + [ "fire", -1 ] + ] + ], + "components": [ + [ + [ "pretzels", 3 ] + ], + [ + [ "chocolate", 1 ] + ] + ] },{ "type" : "recipe", "result": "seasoning_salt", From ab377bb784644452fa9346530d1de02a8354ba5c Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Wed, 23 Dec 2015 21:59:34 +0100 Subject: [PATCH 08/61] Add fire resistance stat to items, monsters and player --- data/json/effects.json | 3 +- src/creature.h | 2 + src/damage.cpp | 23 +++--- src/damage.h | 5 +- src/field.cpp | 113 ++++++++++++++++-------------- src/item.cpp | 69 +++++++++++++++++- src/item.h | 16 ++++- src/monster.cpp | 34 ++++++++- src/monster.h | 1 + src/monstergenerator.cpp | 9 +++ src/mtype.cpp | 3 + src/mtype.h | 3 + src/player.cpp | 146 +++++++++++++++++++++++++++------------ src/player.h | 6 ++ 14 files changed, 321 insertions(+), 112 deletions(-) diff --git a/data/json/effects.json b/data/json/effects.json index 5ff5e171ef9da..885b0647eb6ea 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -230,7 +230,8 @@ "remove_memorial_log": "Put out the fire.", "apply_message": "You're on fire!", "apply_memorial_log": "Caught on fire.", - "rating": "bad" + "rating": "bad", + "max_duration": 10 }, { "type": "effect_type", diff --git a/src/creature.h b/src/creature.h index 8802d65f786b2..04f7553720ab6 100644 --- a/src/creature.h +++ b/src/creature.h @@ -345,6 +345,8 @@ class Creature virtual int get_armor_bash_bonus() const; virtual int get_armor_cut_bonus() const; + virtual int get_armor_type( damage_type dt, body_part bp ) const = 0; + virtual int get_speed() const; virtual int get_dodge() const; virtual int get_melee() const; diff --git a/src/damage.cpp b/src/damage.cpp index bf7785e7d967c..2a4b4808fa59d 100644 --- a/src/damage.cpp +++ b/src/damage.cpp @@ -99,21 +99,23 @@ int dealt_damage_instance::total_damage() const resistances::resistances() : resist_vals( NUM_DT, 0 ) { } -resistances::resistances( item &armor ) : resist_vals( NUM_DT, 0 ) +resistances::resistances( item &armor, bool to_self ) : resist_vals( NUM_DT, 0 ) { if( armor.is_armor() ) { - set_resist( DT_BASH, armor.bash_resist() ); - set_resist( DT_CUT, armor.cut_resist() ); - set_resist( DT_STAB, 0.8 * armor.cut_resist() ); // stab dam cares less bout armor - set_resist( DT_ACID, armor.acid_resist() ); + set_resist( DT_BASH, armor.bash_resist( to_self ) ); + set_resist( DT_CUT, armor.cut_resist( to_self ) ); + set_resist( DT_STAB, armor.stab_resist( to_self ) ); + set_resist( DT_ACID, armor.acid_resist( to_self ) ); + set_resist( DT_HEAT, armor.fire_resist( to_self ) ); } } resistances::resistances( monster &monster ) : resist_vals( NUM_DT, 0 ) { set_resist( DT_BASH, monster.type->armor_bash ); - set_resist( DT_CUT, monster.type->armor_cut ); - set_resist( DT_STAB, 0.8 * monster.type->armor_cut ); // stab dam cares less bout armor - set_resist( DT_ACID, monster.type->armor_cut / 2 ); // No acid resist stat yet + set_resist( DT_CUT, monster.type->armor_cut ); + set_resist( DT_STAB, monster.type->armor_stab ); + set_resist( DT_ACID, monster.type->armor_acid ); + set_resist( DT_HEAT, monster.type->armor_fire ); } void resistances::set_resist( damage_type dt, int amount ) { @@ -139,7 +141,10 @@ float resistances::get_effective_resist( const damage_unit &du ) const case DT_ACID: effective_resist = std::max( type_resist( DT_ACID ) - du.res_pen, 0 ) * du.res_mult; break; - default: // TODO: DT_HEAT vs env protection, DT_COLD vs warmth + case DT_HEAT: + effective_resist = std::max( type_resist( DT_HEAT ) - du.res_pen, 0 ) * du.res_mult; + break; + default: // TODO: Other types effective_resist = 0; } return effective_resist; diff --git a/src/damage.h b/src/damage.h index 476dfeaa01c14..aeb9bb6779102 100644 --- a/src/damage.h +++ b/src/damage.h @@ -17,7 +17,7 @@ class item; class monster; class Creature; -enum damage_type { +enum damage_type : int { DT_NULL = 0, // null damage, doesn't exist DT_TRUE, // typeless damage, should always go through DT_BIOLOGICAL, // internal damage, like from smoke or poison @@ -75,7 +75,8 @@ struct resistances { resistances(); - resistances(item &armor); + // If to_self is true, we want armor's own resistance, not one it provides to wearer + resistances( item &armor, bool to_self = false ); resistances(monster &monster); void set_resist(damage_type dt, int amount); int type_resist(damage_type dt) const; diff --git a/src/field.cpp b/src/field.cpp index 8fe559cc27f58..2b057ba2304b5 100644 --- a/src/field.cpp +++ b/src/field.cpp @@ -1836,58 +1836,71 @@ void map::player_in_field( player &u ) } } { + // Burn message by intensity + static const std::array player_burn_msg = {{ + _("You burn your legs and feet!"), + _("You're burning up!"), + _("You're set ablaze!"), + _("Your whole body is burning!") + }}; + static const std::array npc_burn_msg = {{ + _(" burns their legs and feet!"), + _(" is burning up!"), + _(" is set ablaze!"), + _("s whole body is burning!") + }}; + static const std::array player_warn_msg = {{ + _("There's fire under your feet!"), + _("There's fire reaching your torso!"), + _("You're surrounded by raging fire!"), + _("You're lying in fire!") + }}; + + int burn_min = adjusted_intensity; + int burn_max = 3 * adjusted_intensity + 3; std::list parts_burned; - int burn_min = 0; - int burn_max = 0; - // first is for the player, second for the npc - std::string burn_message[2]; - switch( adjusted_intensity ) { - case 3: - burn_message[0] = _("You're set ablaze!"); - burn_message[1] = _(" is set ablaze!"); - burn_min = 4; - burn_max = 12; - parts_burned.push_back( bp_hand_l ); - parts_burned.push_back( bp_hand_r ); - parts_burned.push_back( bp_arm_l ); - parts_burned.push_back( bp_arm_r ); - // Only blazing fires set you ablaze. - u.add_effect("onfire", 5); - // Fallthrough intentional. - case 2: - if( burn_message[0].empty() ) { - burn_message[0] = _("You're burning up!"); - burn_message[1] = _(" is burning up!"); - burn_min = 2; - burn_max = 9; + int msg_num = adjusted_intensity - 1; + if( !u.is_on_ground() ) { + switch( adjusted_intensity ) { + case 3: + parts_burned.push_back( bp_hand_l ); + parts_burned.push_back( bp_hand_r ); + parts_burned.push_back( bp_arm_l ); + parts_burned.push_back( bp_arm_r ); + // Fallthrough intentional. + case 2: + parts_burned.push_back( bp_torso ); + // Fallthrough intentional. + case 1: + parts_burned.push_back( bp_foot_l ); + parts_burned.push_back( bp_foot_r ); + parts_burned.push_back( bp_leg_l ); + parts_burned.push_back( bp_leg_r ); } - parts_burned.push_back( bp_torso ); - // Fallthrough intentional. - case 1: - if( burn_message[0].empty() ) { - burn_message[0] = _("You burn your legs and feet!"); - burn_message[1] = _(" burns their legs and feet!"); - burn_min = 1; - burn_max = 6; - } - parts_burned.push_back( bp_foot_l ); - parts_burned.push_back( bp_foot_r ); - parts_burned.push_back( bp_leg_l ); - parts_burned.push_back( bp_leg_r ); - } - if( u.is_on_ground() ) { + } else { // Lying in the fire is BAAAD news, hits every body part. - burn_message[0] = _("Your whole body is burning!"); - burn_message[1] = _("s whole body is burning!"); - parts_burned.clear(); + msg_num = 3; for( int i = 0; i < num_bp; ++i ) { parts_burned.push_back( i ); } } - u.add_msg_player_or_npc( m_bad, burn_message[0].c_str(), burn_message[1].c_str() ); + + int total_damage = 0; for( auto part_burned : parts_burned ) { - u.deal_damage( nullptr, (enum body_part)part_burned, - damage_instance( DT_HEAT, rng( burn_min, burn_max ) ) ); + const auto dealt = u.deal_damage( nullptr, (body_part)part_burned, + damage_instance( DT_HEAT, rng( burn_min, burn_max ) ) ); + total_damage += dealt.type_damage( DT_HEAT ); + } + if( total_damage > 10 ) { + u.add_effect( "onfire", 2 + adjusted_intensity ); + } + if( total_damage > 0 ) { + u.add_msg_player_or_npc( m_bad, + player_burn_msg[msg_num].c_str(), + npc_burn_msg[msg_num].c_str() ); + } else { + u.add_msg_if_player( m_warning, + player_warn_msg[msg_num].c_str() ); } u.check_dead_state(); } @@ -2196,6 +2209,7 @@ void map::monster_in_field( monster &z ) if (z.has_flag(MF_FIREPROOF)){ return; } + // TODO: Replace the section below with proper json values if ( z.made_of("flesh") || z.made_of("hflesh") || z.made_of("iflesh") ) { dam += 3; } @@ -2212,6 +2226,7 @@ void map::monster_in_field( monster &z ) if (z.has_flag(MF_FLIES)) { dam -= 15; } + dam -= z.get_armor_type( DT_HEAT, bp_torso ); if (cur->getFieldDensity() == 1) { dam += rng(2, 6); @@ -2219,18 +2234,16 @@ void map::monster_in_field( monster &z ) dam += rng(6, 12); if (!z.has_flag(MF_FLIES)) { z.moves -= 20; - if (!z.made_of(LIQUID) && !z.made_of("stone") && !z.made_of("kevlar") && - !z.made_of("steel") && !z.has_flag(MF_FIREY)) { - z.add_effect("onfire", rng(3, 8)); + if( dam > 0 ) { + z.add_effect("onfire", rng(dam / 2, dam * 2)); } } } else if (cur->getFieldDensity() == 3) { dam += rng(10, 20); if (!z.has_flag(MF_FLIES) || one_in(3)) { z.moves -= 40; - if (!z.made_of(LIQUID) && !z.made_of("stone") && !z.made_of("kevlar") && - !z.made_of("steel") && !z.has_flag(MF_FIREY)) { - z.add_effect("onfire", rng(8, 12)); + if( dam > 0 ) { + z.add_effect("onfire", rng(dam / 2, dam * 2)); } } } diff --git a/src/item.cpp b/src/item.cpp index 91a6a4e43ddc9..aa2f06f0c5e70 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -1033,6 +1033,7 @@ std::string item::info( bool showtext, std::vector &info ) const false ) ); info.push_back( iteminfo( "ARMOR", space + _( "Cut: " ), "", cut_resist(), true, "", false ) ); info.push_back( iteminfo( "ARMOR", space + _( "Acid: " ), "", acid_resist(), true, "", true ) ); + info.push_back( iteminfo( "ARMOR", space + _( "Fire: " ), "", fire_resist(), true, "", true ) ); info.push_back( iteminfo( "ARMOR", _( "Environmental protection: " ), "", get_env_resist() ) ); } @@ -2848,7 +2849,7 @@ long item::num_charges() return 0; } -int item::bash_resist() const +int item::bash_resist(bool /*to_self*/) const { float resist = 0; float l_padding = 0; @@ -2889,7 +2890,7 @@ int item::bash_resist() const return lround((resist * eff_thickness * adjustment) + l_padding + k_padding); } -int item::cut_resist() const +int item::cut_resist(bool /*to_self*/) const { float resist = 0; float l_padding = 0; @@ -2931,7 +2932,13 @@ int item::cut_resist() const return lround((resist * eff_thickness * adjustment) + l_padding + k_padding); } -int item::acid_resist() const +int item::stab_resist(bool to_self) const +{ + // Better than hardcoding it in multiple places + return (int)(0.8f * cut_resist( to_self )); +} + +int item::acid_resist( bool to_self ) const { float resist = 0.0; if( is_null() ) { @@ -2947,6 +2954,34 @@ int item::acid_resist() const } // Average based on number of materials. resist /= mat_types.size(); + const int env = get_env_resist(); + if( !to_self && env < 10 ) { + // Low env protection means it doesn't prevent acid seeping in. + resist *= env / 10.0f; + } + + return lround(resist); +} + +int item::fire_resist( bool to_self ) const +{ + float resist = 0.0; + if( is_null() ) { + return 0.0; + } + + std::vector mat_types = made_of_types(); + + for( auto mat : mat_types ) { + resist += mat->fire_resist(); + } + // Average based on number of materials. + resist /= mat_types.size(); + const int env = get_env_resist(); + if( !to_self && env < 10 ) { + // Iron resists immersion in magma, iron-clad knight won't. + resist *= env / 10.0f; + } return lround(resist); } @@ -2978,6 +3013,34 @@ int item::chip_resistance( bool worst ) const return res; } +int item::damage_resist( damage_type dt, bool to_self ) const +{ + switch( dt ) { + case DT_TRUE: + case DT_BIOLOGICAL: + case DT_ELECTRIC: + case DT_COLD: + // Currently hardcoded: + // Items can never be damaged by those types + // But they provide 0 protection from them + return to_self ? INT_MAX : 0; + case DT_BASH: + return bash_resist( to_self ); + case DT_CUT: + return cut_resist ( to_self ); + case DT_ACID: + return acid_resist( to_self ); + case DT_STAB: + return stab_resist( to_self ); + case DT_HEAT: + return fire_resist( to_self ); + default: + debugmsg( "Invalid damage type: %d", dt ); + } + + return 0; +} + bool item::is_two_handed( const player &u ) const { if( has_flag("ALWAYS_TWOHAND") ) { diff --git a/src/item.h b/src/item.h index 0e10c0c68a429..66d5c3dc5cb85 100644 --- a/src/item.h +++ b/src/item.h @@ -33,6 +33,8 @@ using matec_id = string_id; class Skill; using skill_id = string_id; +enum damage_type : int; + std::string const& rad_badge_color(int rad); struct light_emission { @@ -532,13 +534,21 @@ class item : public JsonSerializer, public JsonDeserializer * Larger values means more resistance are thereby better, but there is no absolute value to * compare them to. The values can be interpreted as chance (@ref one_in) of damaging the item * when exposed to the type of damage. + * @param to_self If this is true, it returns item's own resistance, not one it gives to wearer. */ /*@{*/ - int bash_resist() const; - int cut_resist() const; - int acid_resist() const; + int bash_resist( bool to_self = false ) const; + int cut_resist ( bool to_self = false ) const; + int stab_resist( bool to_self = false ) const; + int acid_resist( bool to_self = false ) const; + int fire_resist( bool to_self = false ) const; /*@}*/ + /** + * Resistance provided by this item against damage type given by an enum. + */ + int damage_resist( damage_type dt, bool to_self = false ) const; + /** * Returns resistance to being damaged by attack against the item itself. * Calculated from item's materials. diff --git a/src/monster.cpp b/src/monster.cpp index f013c5cd482df..378b441f872cf 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -824,7 +824,11 @@ bool monster::is_elec_immune() const bool monster::is_immune_effect( const efftype_id &effect ) const { if( effect == "onfire" ) { - return is_immune_damage( DT_HEAT ); + return is_immune_damage( DT_HEAT ) || + made_of(LIQUID) || + made_of("stone") || + made_of("steel") || + has_flag(MF_FIREY); } return false; @@ -1300,6 +1304,34 @@ int monster::get_armor_bash(body_part bp) const return int(type->armor_bash) + armor_bash_bonus; } +int monster::get_armor_type( damage_type dt, body_part bp ) const +{ + switch( dt ) { + case DT_TRUE: + return 0; + case DT_BIOLOGICAL: + return 0; + case DT_BASH: + return get_armor_bash( bp ); + case DT_CUT: + return get_armor_cut( bp ); + case DT_ACID: + return int(type->armor_acid); + case DT_STAB: + return int(type->armor_stab) + armor_cut_bonus * 0.8f; + case DT_HEAT: + return int(type->armor_fire); + case DT_COLD: + return 0; + case DT_ELECTRIC: + return 0; + default: + debugmsg( "Invalid damage type: %d", dt ); + } + + return 0; +} + int monster::hit_roll() const { //Unstable ground chance of failure if (has_effect("bouldering")) { diff --git a/src/monster.h b/src/monster.h index a03eb3a376633..875d0b81b33e6 100644 --- a/src/monster.h +++ b/src/monster.h @@ -277,6 +277,7 @@ class monster : public Creature, public JsonSerializer, public JsonDeserializer int get_armor_cut(body_part bp) const override; // Natural armor, plus any worn armor int get_armor_bash(body_part bp) const override; // Natural armor, plus any worn armor + int get_armor_type( damage_type dt, body_part bp ) const override; int get_dodge() const override; // Natural dodge, or 0 if we're occupied int get_melee() const override; // For determining attack skill when awarding dodge practice. int hit_roll() const override; // For the purposes of comparing to player::dodge_roll() diff --git a/src/monstergenerator.cpp b/src/monstergenerator.cpp index 8b9ec9b352b35..1453340c8cd9e 100644 --- a/src/monstergenerator.cpp +++ b/src/monstergenerator.cpp @@ -446,6 +446,8 @@ void MonsterGenerator::load_monster(JsonObject &jo) newmon->sk_dodge = jo.get_int("dodge", 0); newmon->armor_bash = jo.get_int("armor_bash", 0); newmon->armor_cut = jo.get_int("armor_cut", 0); + newmon->armor_acid = jo.get_int("armor_acid", 0); + newmon->armor_fire = jo.get_int("armor_fire", 0); newmon->hp = jo.get_int("hp", 0); jo.read("starting_ammo", newmon->starting_ammo); newmon->luminance = jo.get_float("luminance", 0); @@ -453,6 +455,13 @@ void MonsterGenerator::load_monster(JsonObject &jo) newmon->vision_day = jo.get_int("vision_day", 40); newmon->vision_night = jo.get_int("vision_night", 1); + // Stab armor is optional, use 80% cut armor if it isn't set + if( jo.has_int("armor_stab") ) { + newmon->armor_stab = jo.get_int("armor_stab", 0); + } else { + newmon->armor_stab = 0.8f * newmon->armor_cut; + } + if (jo.has_array("attack_effs")) { JsonArray jsarr = jo.get_array("attack_effs"); while (jsarr.has_more()) { diff --git a/src/mtype.cpp b/src/mtype.cpp index afa754b86c60d..1243764ffcaa1 100644 --- a/src/mtype.cpp +++ b/src/mtype.cpp @@ -32,6 +32,9 @@ mtype::mtype () sk_dodge = 0; armor_bash = 0; armor_cut = 0; + armor_stab = 0; + armor_acid = 0; + armor_fire = 0; hp = 0; def_chance = 0; upgrades = false; diff --git a/src/mtype.h b/src/mtype.h index bb75ea9c9bed4..0b5055d7af5f0 100644 --- a/src/mtype.h +++ b/src/mtype.h @@ -209,6 +209,9 @@ struct mtype { unsigned char sk_dodge; // Dodge skill; should be 0 to 5 unsigned char armor_bash; // Natural armor vs. bash unsigned char armor_cut; // Natural armor vs. cut + unsigned char armor_stab; // Natural armor vs. stabbing + unsigned char armor_acid; // Natural armor vs. acid + unsigned char armor_fire; // Natural armor vs. fire std::map starting_ammo; // Amount of ammo the monster spawns with. // Name of item group that is used to create item dropped upon death, or empty. std::string death_drops; diff --git a/src/player.cpp b/src/player.cpp index 2e3d3cfdc3697..9d23dc6802f1d 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -12792,6 +12792,34 @@ int player::get_armor_cut(body_part bp) const return get_armor_cut_base(bp) + armor_cut_bonus; } +int player::get_armor_type( damage_type dt, body_part bp ) const +{ + switch( dt ) { + case DT_TRUE: + return 0; + case DT_BIOLOGICAL: + return 0; + case DT_BASH: + return get_armor_bash( bp ); + case DT_CUT: + return get_armor_cut( bp ); + case DT_ACID: + return get_armor_acid( bp ); + case DT_STAB: + return get_armor_cut( bp ) * 0.8f; + case DT_HEAT: + return get_armor_fire( bp ); + case DT_COLD: + return 0; + case DT_ELECTRIC: + return 0; + default: + debugmsg( "Invalid damage type: %d", dt ); + } + + return 0; +} + int player::get_armor_bash_base(body_part bp) const { int ret = 0; @@ -12914,6 +12942,30 @@ int player::get_armor_cut_base(body_part bp) const return ret; } +int player::get_armor_acid(body_part bp) const +{ + int ret = 0; + for( auto &i : worn ) { + if( i.covers( bp ) ) { + ret += i.acid_resist(); + } + } + + return ret; +} + +int player::get_armor_fire(body_part bp) const +{ + int ret = 0; + for( auto &i : worn ) { + if( i.covers( bp ) ) { + ret += i.fire_resist(); + } + } + + return ret; +} + bool player::armor_absorb(damage_unit& du, item& armor) { if( rng( 1, 100 ) > armor.get_coverage() ) { return false; @@ -12927,10 +12979,10 @@ bool player::armor_absorb(damage_unit& du, item& armor) { const float mitigation = std::min(effective_resist, du.amount); du.amount -= mitigation; // mitigate the damage first - if( mitigation <= 0 ) { - // If it doesn't protect from it at all, it's some weird type, - // like electricity (which should not damage clothing) - // or fire (for which resistance isn't implemented yet so it would slice power armor) + // We want armor's own resistance to this type, not the resistance it grants + const int armors_own_resist = resistances( armor, true ).type_resist( du.type ); + if( armors_own_resist > 1000 ) { + // This is some weird type that doesn't damage armors return false; } @@ -12945,48 +12997,56 @@ bool player::armor_absorb(damage_unit& du, item& armor) { // Don't damage armor as much when bypassed by armor piercing // Most armor piercing damage comes from bypassing armor, not forcing through const int raw_dmg = du.amount; - const int raw_armor = res.type_resist( du.type ); - if( (raw_dmg > raw_armor && !one_in(du.amount) && one_in(2)) || - // or if it isn't, but 1/50 chance - (raw_dmg <= raw_armor && !armor.has_flag("STURDY") && - !armor.is_power_armor() && one_in(200)) ) { - - auto &material = armor.get_random_material(); - std::string damage_verb = ( du.type == DT_BASH ) ? - material.bash_dmg_verb() : material.cut_dmg_verb(); - - const std::string pre_damage_name = armor.tname(); - const std::string pre_damage_adj = armor.get_base_material(). - dmg_adj(armor.damage); - - // add "further" if the damage adjective and verb are the same - std::string format_string = ( pre_damage_adj == damage_verb ) ? - _("Your %1$s is %2$s further!") : _("Your %1$s is %2$s!"); - add_msg_if_player( m_bad, format_string.c_str(), pre_damage_name.c_str(), - damage_verb.c_str()); - //item is damaged - if( is_player() ) { - SCT.add(posx(), posy(), NORTH, remove_color_tags( pre_damage_name ), - m_neutral, damage_verb, m_info); - } - - if (armor.has_flag("FRAGILE")) { - armor.damage += rng(2,3); - } else { - armor.damage++; + if( raw_dmg > armors_own_resist ) { + // If damage is above armor value, the chance to avoid armor damage is + // 50% + 50% * 1/dmg + if( one_in( raw_dmg ) || one_in( 2 ) ) { + return false; } - - if( armor.damage >= 5 ) { - //~ %s is armor name - add_memorial_log( pgettext("memorial_male", "Worn %s was completely destroyed."), - pgettext("memorial_female", "Worn %s was completely destroyed."), - pre_damage_name.c_str() ); - add_msg_player_or_npc( m_bad, _("Your %s is completely destroyed!"), - _("'s %s is completely destroyed!"), - pre_damage_name.c_str() ); - return true; + } else { + // Sturdy items and power armors never take chip damage. + // Other armors have 0.5% of getting damaged from hits below their armor value. + if( armor.has_flag("STURDY") || armor.is_power_armor() || !one_in( 200 ) ) { + return false; } } + + auto &material = armor.get_random_material(); + std::string damage_verb = ( du.type == DT_BASH ) ? + material.bash_dmg_verb() : material.cut_dmg_verb(); + + const std::string pre_damage_name = armor.tname(); + const std::string pre_damage_adj = armor.get_base_material(). + dmg_adj(armor.damage); + + // add "further" if the damage adjective and verb are the same + std::string format_string = ( pre_damage_adj == damage_verb ) ? + _("Your %1$s is %2$s further!") : _("Your %1$s is %2$s!"); + add_msg_if_player( m_bad, format_string.c_str(), pre_damage_name.c_str(), + damage_verb.c_str()); + //item is damaged + if( is_player() ) { + SCT.add(posx(), posy(), NORTH, remove_color_tags( pre_damage_name ), + m_neutral, damage_verb, m_info); + } + + if (armor.has_flag("FRAGILE")) { + armor.damage += rng(2,3); + } else { + armor.damage++; + } + + if( armor.damage >= 5 ) { + //~ %s is armor name + add_memorial_log( pgettext("memorial_male", "Worn %s was completely destroyed."), + pgettext("memorial_female", "Worn %s was completely destroyed."), + pre_damage_name.c_str() ); + add_msg_player_or_npc( m_bad, _("Your %s is completely destroyed!"), + _("'s %s is completely destroyed!"), + pre_damage_name.c_str() ); + return true; + } + return false; } diff --git a/src/player.h b/src/player.h index 4e11609cb0159..304615a1b05b7 100644 --- a/src/player.h +++ b/src/player.h @@ -798,6 +798,12 @@ class player : public Character, public JsonSerializer, public JsonDeserializer int get_armor_cut_base(body_part bp) const override; /** Returns overall env_resist on a body_part */ int get_env_resist(body_part bp) const override; + /** Returns overall acid resistance for the body part */ + int get_armor_acid(body_part bp) const; + /** Returns overall fire resistance for the body part */ + int get_armor_fire(body_part bp) const; + /** Returns overall resistance to given type on the bod part */ + int get_armor_type( damage_type dt, body_part bp ) const; /** Returns true if the player is wearing something on the entered body_part */ bool wearing_something_on(body_part bp) const; /** Returns true if the player is wearing something on the entered body_part, ignoring items with the ALLOWS_NATURAL_ATTACKS flag */ From 849e293b4fa623590c0176b4671af2e3165bf757 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Wed, 23 Dec 2015 22:17:29 +0100 Subject: [PATCH 09/61] Change messages a bit --- src/field.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/field.cpp b/src/field.cpp index 2b057ba2304b5..3ea1de29a61f3 100644 --- a/src/field.cpp +++ b/src/field.cpp @@ -1850,8 +1850,8 @@ void map::player_in_field( player &u ) _("s whole body is burning!") }}; static const std::array player_warn_msg = {{ - _("There's fire under your feet!"), - _("There's fire reaching your torso!"), + _("You're standing in a fire!"), + _("You're waist-deep in a fire!"), _("You're surrounded by raging fire!"), _("You're lying in fire!") }}; From 1cafbe549fff2a3d0521369753c01826a89d48db Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Wed, 23 Dec 2015 23:00:51 +0100 Subject: [PATCH 10/61] Add some sample values to monster resistances --- data/json/monsters.json | 32 ++++++++++++++++++++++++-------- src/monstergenerator.cpp | 2 +- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/data/json/monsters.json b/data/json/monsters.json index 513fd0d88452e..440e517c70eb3 100755 --- a/data/json/monsters.json +++ b/data/json/monsters.json @@ -1685,6 +1685,8 @@ "dodge":0, "armor_bash":6, "armor_cut":6, + "armor_acid":3, + "armor_fire":10, "vision_day":40, "vision_night":3, "death_drops": "mon_zombie_fireman_death_drops", @@ -1715,6 +1717,7 @@ "dodge":3, "armor_bash":7, "armor_cut":7, + "armor_acid":4, "vision_day":50, "vision_night":3, "death_drops": "mon_zombie_survivor_death_drops", @@ -1774,6 +1777,7 @@ "dodge":0, "armor_bash":6, "armor_cut":6, + "armor_stab":6, "vision_day":30, "vision_night":3, "death_drops": "mon_zombie_cop_death_drops", @@ -1931,7 +1935,8 @@ "melee_cut":0, "dodge":0, "armor_bash":10, - "armor_cut":10, + "armor_cut":2, + "armor_stab":12, "vision_day":40, "vision_night":3, "death_drops": "default_zombie_death_drops", @@ -1994,6 +1999,7 @@ "dodge":4, "armor_bash":0, "armor_cut":0, + "armor_fire":5, "vision_day":50, "vision_night":3, "hp":75, @@ -2407,7 +2413,8 @@ "melee_cut":4, "dodge":2, "armor_bash":0, - "armor_cut":16, + "armor_cut":10, + "armor_stab":20, "vision_day":30, "vision_night":3, "death_drops": "default_zombie_clothes", @@ -2851,7 +2858,8 @@ "melee_cut":4, "dodge":4, "armor_bash":8, - "armor_cut":8, + "armor_cut":4, + "armor_stab":10, "vision_day":30, "vision_night":3, "hp":100, @@ -3669,7 +3677,9 @@ "dodge":0, "armor_bash":14, "armor_cut":4, - "hp":160, + "armor_stab":20, + "armor_acid":20, + "hp":160, "death_function":"BLOBSPLIT", "special_attacks":[["FORMBLOB", 20]], "description":"A large black blob of viscous goo, oozing across the ground like a glob of living oil.", @@ -3696,7 +3706,9 @@ "dodge":0, "armor_bash":12, "armor_cut":0, - "hp":80, + "armor_stab":14, + "armor_acid":15, + "hp":80, "death_function":"BLOBSPLIT", "special_attacks":[["FORMBLOB", 30]], "description":"A black blob of viscous goo, oozing across the ground like a glob of living oil.", @@ -3723,7 +3735,9 @@ "dodge":0, "armor_bash":6, "armor_cut":0, - "hp":40, + "armor_stab":10, + "armor_acid":10, + "hp":40, "death_function":"BLOBSPLIT", "description":"A small black blob of viscous goo, oozing across the ground like a glob of living oil.", "flags":["HEARS", "GOODHEARING", "NOHEAD", "POISON", "NO_BREATHE", "ACIDPROOF"], @@ -6456,7 +6470,7 @@ "symbol":"Z", "color":"dkgray_red", "size":"MEDIUM", - "material":"steel", + "material":"flesh", "diff":25, "aggression":100, "morale":100, @@ -6468,13 +6482,15 @@ "dodge":0, "armor_bash":64, "armor_cut":64, + "armor_acid":20, + "armor_fire":20, "vision_day":30, "vision_night":3, "death_drops": "mon_zombie_armored_death_drops", "hp":120, "death_function":["NORMAL"], "description":"Despite being encased in a what was once a nigh-impenetrable suit of power armor, something still managed to kill this soldier.", - "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "ACIDPROOF", "NO_BREATHE", "REVIVES", "BONES"], + "flags":["SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "BLEED", "NO_BREATHE", "REVIVES", "BONES"], "categories":["CLASSIC"] },{ "type" : "MONSTER", diff --git a/src/monstergenerator.cpp b/src/monstergenerator.cpp index 1453340c8cd9e..1310a7a807aaa 100644 --- a/src/monstergenerator.cpp +++ b/src/monstergenerator.cpp @@ -446,7 +446,7 @@ void MonsterGenerator::load_monster(JsonObject &jo) newmon->sk_dodge = jo.get_int("dodge", 0); newmon->armor_bash = jo.get_int("armor_bash", 0); newmon->armor_cut = jo.get_int("armor_cut", 0); - newmon->armor_acid = jo.get_int("armor_acid", 0); + newmon->armor_acid = jo.get_int("armor_acid", newmon->armor_cut / 2); newmon->armor_fire = jo.get_int("armor_fire", 0); newmon->hp = jo.get_int("hp", 0); jo.read("starting_ammo", newmon->starting_ammo); From 99d92f78e651f445dfe658be6dd7fa84a504296a Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Wed, 23 Dec 2015 23:19:06 +0100 Subject: [PATCH 11/61] Some more mon resistances --- data/json/monsters.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/json/monsters.json b/data/json/monsters.json index 440e517c70eb3..dcfbac7c35ae6 100755 --- a/data/json/monsters.json +++ b/data/json/monsters.json @@ -2114,7 +2114,9 @@ "melee_cut":6, "dodge":3, "armor_bash":0, - "armor_cut":16, + "armor_cut":10, + "armor_stab":20, + "armor_acid":3, "vision_day":40, "vision_night":3, "hp":12, @@ -2415,6 +2417,7 @@ "armor_bash":0, "armor_cut":10, "armor_stab":20, + "armor_acid":3, "vision_day":30, "vision_night":3, "death_drops": "default_zombie_clothes", From 783b550469c7bb5adb2d0a7b8de52e00c5a98152 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Wed, 23 Dec 2015 23:24:54 +0100 Subject: [PATCH 12/61] Simplify acid damage --- src/field.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/field.cpp b/src/field.cpp index 3ea1de29a61f3..60c5a272e7104 100644 --- a/src/field.cpp +++ b/src/field.cpp @@ -1757,14 +1757,8 @@ void map::player_in_field( player &u ) int total_damage = 0; // Use a helper for a bit less boilerplate const auto burn_part = [&]( body_part bp, const int scale ) { - const int corr = u.get_effect_int( "corroding", bp ); - // Acid resistance itself protects the items, - // environmental protection is needed to prevent it from getting inside. - // Also rescale arpen for different body parts - they get damaged less, but aren't - // protected any better. - const int arpen = std::max( 0, corr - u.get_env_resist( bp ) + (5 - scale) ); const int damage = std::max( density, rng( 1, scale ) ); - auto ddi = u.deal_damage( nullptr, bp, damage_instance( DT_ACID, damage, arpen ) ); + auto ddi = u.deal_damage( nullptr, bp, damage_instance( DT_ACID, damage ) ); total_damage += ddi.total_damage(); // Represents acid seeping in rather than being splashed on u.add_env_effect( "corroding", bp, 3, rng( 1, density ), bp, false, 0 ); From 30c697d99c14cf418603840588cea071b75a2e0b Mon Sep 17 00:00:00 2001 From: Angela Graves Date: Thu, 24 Dec 2015 02:08:04 -0600 Subject: [PATCH 13/61] Nightvision fix for RM13 armor. It's supposed to use low-light enhancement, not full range green nightvision. --- src/character.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/character.cpp b/src/character.cpp index 120d12bcad60c..e62380d76810e 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -341,10 +341,10 @@ void Character::recalc_sight_limits() if( has_trait("DEBUG_NIGHTVISION") ) { vision_mode_cache.set( DEBUG_NIGHTVISION ); } - if( has_nv() || is_wearing("rm13_armor_on") ) { + if( has_nv() ) { vision_mode_cache.set( NV_GOGGLES ); } - if( has_active_mutation("NIGHTVISION3") ) { + if( has_active_mutation("NIGHTVISION3") || is_wearing("rm13_armor_on") ) { vision_mode_cache.set( NIGHTVISION_3 ); } if( has_active_mutation("ELFA_FNV") ) { From 6052cdb4e0a7da3cbb06bed2d7e37dcfa8bd516d Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Fri, 25 Dec 2015 05:11:00 +0100 Subject: [PATCH 14/61] Prevent blobs from multiplicating indefinitely --- src/monattack.cpp | 159 ++++++++++++++++++++++++++++++---------------- 1 file changed, 104 insertions(+), 55 deletions(-) diff --git a/src/monattack.cpp b/src/monattack.cpp index fcbe34e069b6c..eb037f700dfb9 100644 --- a/src/monattack.cpp +++ b/src/monattack.cpp @@ -2124,75 +2124,124 @@ bool mattack::disappear(monster *z) return true; } +static void poly_keep_speed( monster &mon, const mtype_id& id ) +{ + // Retain old speed after polymorph + // This prevents blobs regenerating speed through polymorphs + // and thus replicating indefinitely, covering entire map + const int old_speed = mon.get_speed_base(); + mon.poly( id ); + mon.set_speed_base( old_speed ); +} + +static bool blobify( monster &blob, monster &target ) +{ + switch( target.get_size() ) { + case MS_TINY: + // Just consume it + target.set_hp( 0 ); + blob.set_speed_base( blob.get_speed_base() + 5 ); + return false; + case MS_SMALL: + target.poly( mon_blob_small ); + break; + case MS_MEDIUM: + target.poly( mon_blob ); + break; + case MS_LARGE: + target.poly( mon_blob_large ); + break; + case MS_HUGE: + // No polymorphing huge stuff + break; + default: + debugmsg("Tried to blobify %s with invalid size: %d", + target.disp_name().c_str(), (int)target.get_size() ); + return false; + } + + target.make_ally( &blob ); + return true; +} + bool mattack::formblob(monster *z) { if( z->friendly ) { return false; // TODO: handle friendly monsters } + bool didit = false; - int thatmon = -1; - for (int i = -1; i <= 1; i++) { - for (int j = -1; j <= 1; j++) { - tripoint dest( z->posx() + i, z->posy() + j, z->posz() ); - thatmon = g->mon_at(dest); - if( g->u.pos() == dest ) { - // If we hit the player, cover them with slime - didit = true; - g->u.add_effect("slimed", rng(0, z->get_hp())); - } else if (thatmon != -1) { - monster &othermon = g->zombie(thatmon); - // Hit a monster. If it's a blob, give it our speed. Otherwise, blobify it? - if( z->get_speed_base() > 40 && othermon.type->in_species( BLOB ) ) { - if( othermon.type->id == mon_blob_brain ) { - // Brain blobs don't get sped up, they heal at the cost of the other blob. - // But only if they are hurt badly. - if( othermon.get_hp() < othermon.get_hp_max() / 2 ) { - didit = true; - othermon.heal( z->get_speed_base(), true ); - z->set_hp( 0 ); - return true; - } - continue; - } - didit = true; - othermon.set_speed_base( othermon.get_speed_base() + 5 ); - z->set_speed_base( z->get_speed_base() - 5 ); - if (othermon.type->id == mon_blob_small && othermon.get_speed_base() >= 60) { - othermon.poly( mon_blob ); - } else if ( othermon.type->id == mon_blob && othermon.get_speed_base() >= 80) { - othermon.poly( mon_blob_large ); - } - } else if( (othermon.made_of("flesh") || - othermon.made_of("veggy") || - othermon.made_of("iflesh") ) && - rng(0, z->get_hp()) > rng(0, othermon.get_hp())) { // Blobify! - didit = true; - othermon.poly( mon_blob ); - othermon.set_speed_base( othermon.get_speed_base() - rng(5, 25) ); - othermon.set_hp( othermon.get_speed_base() ); - } - } else if (z->get_speed_base() >= 85 && rng(0, 250) < z->get_speed_base()) { + auto pts = closest_tripoints_first( 1, z->pos() ); + // Don't check own tile + pts.erase( pts.begin() ); + for( const tripoint &dest : pts ) { + Creature *critter = g->critter_at( dest ); + if( critter == nullptr ) { + if( z->get_speed_base() > 85 && rng(0, 250) < z->get_speed_base() ) { // If we're big enough, spawn a baby blob. didit = true; - z->mod_speed_bonus( -15 ); - if (g->summon_mon(mon_blob_small, tripoint(z->posx() + i, z->posy() + j, z->posz()))) { - monster *blob = g->monster_at(tripoint(z->posx() + i, z->posy() + j, z->posz())); - blob->make_ally(z); - blob->set_speed_base( blob->get_speed_base() - rng(30, 60) ); - blob->set_hp( blob->get_speed_base() ); + z->set_speed_base( z->get_speed_base() - 15 ); + if( g->summon_mon( mon_blob_small, dest ) ) { + monster *blob = g->monster_at( dest ); + blob->make_ally( z ); } + + break; } + + continue; } - if (didit) { // We did SOMEthing. - if (z->type->id == mon_blob && z->get_speed_base() <= 50) { // We shrank! - z->poly( mon_blob_small ); - } else if (z->type->id == mon_blob_large && z->get_speed_base() <= 70) { // We shrank! - z->poly( mon_blob ); + + monster *mon = dynamic_cast( critter ); + if( mon == nullptr ) { + // If we hit the player or some NPC, cover them with slime + didit = true; + // TODO: Add some sort of a resistance/dodge roll + g->u.add_effect( "slimed", rng( 0, z->get_hp() ) ); + break; + } + + monster &othermon = *mon; + // Hit a monster. If it's a blob, give it our speed. Otherwise, blobify it? + if( z->get_speed_base() > 40 && othermon.type->in_species( BLOB ) ) { + if( othermon.type->id == mon_blob_brain ) { + // Brain blobs don't get sped up, they heal at the cost of the other blob. + // But only if they are hurt badly. + if( othermon.get_hp() < othermon.get_hp_max() / 2 ) { + didit = true; + othermon.heal( z->get_speed_base(), true ); + z->set_hp( 0 ); + return true; + } + continue; + } + didit = true; + othermon.set_speed_base( othermon.get_speed_base() + 5 ); + z->set_speed_base( z->get_speed_base() - 5 ); + if( othermon.type->id == mon_blob_small && othermon.get_speed_base() >= 60 ) { + poly_keep_speed( othermon, mon_blob ); + } else if( othermon.type->id == mon_blob && othermon.get_speed_base() >= 80 ) { + poly_keep_speed( othermon, mon_blob_large ); } + } else if( (othermon.made_of("flesh") || + othermon.made_of("veggy") || + othermon.made_of("iflesh") ) && + rng(0, z->get_hp()) > othermon.get_hp() ) { + didit = blobify( *z, othermon ); + } + } - z->moves = 0; - return true; + if( didit ) { // We did SOMEthing. + if( z->type->id == mon_blob && z->get_speed_base() <= 50 ) { + // We shrank! + poly_keep_speed( *z, mon_blob_small ); + } else if( z->type->id == mon_blob_large && z->get_speed_base() <= 70 ) { + // We shrank! + poly_keep_speed( *z, mon_blob ); } + + z->moves = 0; + return true; } return true; // consider returning false to try again immediately if nothing happened? From 50f1db9b5c375f3fd50abe8f9f58e4ac395720ce Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Fri, 25 Dec 2015 05:20:51 +0100 Subject: [PATCH 15/61] Print msgs on blobification --- src/monattack.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/monattack.cpp b/src/monattack.cpp index eb037f700dfb9..0dcae482e3809 100644 --- a/src/monattack.cpp +++ b/src/monattack.cpp @@ -2136,6 +2136,11 @@ static void poly_keep_speed( monster &mon, const mtype_id& id ) static bool blobify( monster &blob, monster &target ) { + if( g->u.sees( target ) ) { + add_msg( m_warning, _("%s is engulfed by %s!"), + target.disp_name().c_str(), blob.disp_name().c_str() ); + } + switch( target.get_size() ) { case MS_TINY: // Just consume it @@ -2153,6 +2158,7 @@ static bool blobify( monster &blob, monster &target ) break; case MS_HUGE: // No polymorphing huge stuff + target.add_effect( "slimed", rng( 2, 10 ) ); break; default: debugmsg("Tried to blobify %s with invalid size: %d", @@ -2226,7 +2232,7 @@ bool mattack::formblob(monster *z) } else if( (othermon.made_of("flesh") || othermon.made_of("veggy") || othermon.made_of("iflesh") ) && - rng(0, z->get_hp()) > othermon.get_hp() ) { + rng( 0, z->get_hp() ) > rng( othermon.get_hp() / 2, othermon.get_hp() ) ) { didit = blobify( *z, othermon ); } } From 6ce0c6067ba052b8afc8cb9e1d61434820be50c7 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Fri, 25 Dec 2015 03:22:54 -0800 Subject: [PATCH 16/61] Wearable binoculars V2.1 --- data/json/items/melee.json | 22 --------------------- data/json/items/mods.json | 1 + data/json/items/tool_armor.json | 34 +++++++++++++++++++++++++++++++++ data/json/items/tools.json | 9 +++++++-- doc/JSON_FLAGS.md | 1 + src/player.cpp | 9 +++------ 6 files changed, 46 insertions(+), 30 deletions(-) diff --git a/data/json/items/melee.json b/data/json/items/melee.json index 47fd69b04023e..d89786549fefe 100644 --- a/data/json/items/melee.json +++ b/data/json/items/melee.json @@ -697,28 +697,6 @@ "cutting": 0, "to_hit": -1 }, - { - "type":"GENERIC", - "id": "binoculars", - "category" : "tools", - "symbol": ";", - "color": "dark_gray", - "name": "pair of binoculars", - "name_plural": "pairs of binoculars", - "description": "A tool useful for seeing long distances. Simply carrying this item in your inventory will double the distance that is mapped around you during your travels. You could also use them to focus the sunlight.", - "price": 30000, - "material": ["plastic", "glass"], - "flags": [ "LENS" ], - "weight": 708, - "volume": 2, - "bashing": 4, - "cutting": 0, - "to_hit": -1, - "use_action": { - "type": "extended_firestarter", - "need_sunlight": true - } - }, { "type":"GENERIC", "id": "usb_drive", diff --git a/data/json/items/mods.json b/data/json/items/mods.json index d89753e6a3686..de02a87330b0f 100644 --- a/data/json/items/mods.json +++ b/data/json/items/mods.json @@ -1077,6 +1077,7 @@ "mod_targets" : ["rifle", "crossbow", "launcher"], "volume" : 2, "bashing" : 0, + "flags" : ["ZOOM"], "price" : 68000, "skill_required": 5 }, diff --git a/data/json/items/tool_armor.json b/data/json/items/tool_armor.json index 6f31e3c5f9394..893faf3bfe5cd 100644 --- a/data/json/items/tool_armor.json +++ b/data/json/items/tool_armor.json @@ -425,6 +425,40 @@ "coverage" : 100, "material_thickness" : 1 }, + { + "id": "binoculars", + "type": "TOOL_ARMOR", + "category" : "clothing", + "symbol": ";", + "color": "dark_gray", + "name" : "pair of binoculars", + "name_plural": "pairs of binoculars", + "description": "A pair of optics with a neck strap attached. Useful for seeing long distances. Simply carrying or wearing this item in your inventory will double the distance that is mapped around you during your travels. You could also use them to focus the sunlight.", + "price": 30000, + "material": ["plastic", "glass"], + "flags" : [ "LENS", "ZOOM", "OVERSIZE", "BELTED", "ALLOWS_NATURAL_ATTACKS"], + "weight" : 708, + "volume": 2, + "bashing": 4, + "cutting": 0, + "to_hit" : -1, + "max_charges": 0, + "initial_charges": 0, + "charges_per_use": 0, + "turns_per_charge": 0, + "ammo": "NULL", + "revert_to": "null", + "use_action": { + "type": "extended_firestarter", + "need_sunlight": true + }, + "covers" : ["TORSO"], + "warmth" : 0, + "environmental_protection" : 0, + "encumbrance" : 2, + "coverage" : 10, + "material_thickness" : 2 + }, { "id": "wearable_light", "type": "TOOL_ARMOR", diff --git a/data/json/items/tools.json b/data/json/items/tools.json index 0aaf4101ed11a..dab979b89fa71 100644 --- a/data/json/items/tools.json +++ b/data/json/items/tools.json @@ -276,9 +276,10 @@ "color": "dark_green", "name": "survivor telescope", "name_plural": "survivor telescopes", - "description": "A homemade collapsible telescope. Too large and inaccurate to use as a weapon scope, but carrying this item in your inventory will double the distance that is mapped around you during your travels.", + "description": "A homemade collapsible telescope. Too large and inaccurate to use as a weapon scope, but carrying this item in your inventory will double the distance that is mapped around you during your travels.", "price": 600, "material": ["glass", "plastic"], + "flags": [ "LENS", "ZOOM" ], "weight": 500, "volume": 1, "bashing": 0, @@ -289,7 +290,11 @@ "max_charges": 0, "initial_charges": 0, "charges_per_use": 0, - "turns_per_charge": 0 + "turns_per_charge": 0, + "use_action": { + "type": "extended_firestarter", + "need_sunlight": true + } }, { "id": "rock_quern", diff --git a/doc/JSON_FLAGS.md b/doc/JSON_FLAGS.md index 5fedfad5e4b7e..b0e4bd275b183 100755 --- a/doc/JSON_FLAGS.md +++ b/doc/JSON_FLAGS.md @@ -739,6 +739,7 @@ Some armor flags, such as `WATCH` and `ALARMCLOCK` are compatible with other ite - ```USE_EAT_VERB``` "You drink your %s." or "You eat your %s." - ```FERTILIZER``` Works as fertilizer for farming. - ```LENS``` Lens items can make fires via focusing light rays. +- ```ZOOM``` Zoom items can increase your sight range. - ```FIRE_DRILL``` Item will start fires in the primitive way. - ```MUTAGEN_STRONG``` Chance of mutating several times. - ```MUTAGEN_WEAK``` Causes generic mutation (with less chance to mutate than `MUTAGEN_STRONG`). diff --git a/src/player.cpp b/src/player.cpp index ad2787a531633..60aa4cf81215e 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -4168,24 +4168,21 @@ int player::overmap_sight_range(int light_level) const if( sight <= SEEX * 4) { return (sight / (SEEX / 2) ); } - if ((has_amount("binoculars", 1) || has_amount("rifle_scope", 1) || - has_amount("survivor_scope", 1) || -1 != weapon.has_gunmod("rifle_scope") ) && + if ((has_item_with_flag("ZOOM")) && !has_trait("EAGLEEYED")) { if (has_trait("BIRD_EYE")) { return 25; } return 20; } - else if (!(has_amount("binoculars", 1) || has_amount("rifle_scope", 1) || - has_amount("survivor_scope", 1) || -1 != weapon.has_gunmod("rifle_scope") ) && + else if ((has_item_with_flag("ZOOM")) && has_trait("EAGLEEYED")) { if (has_trait("BIRD_EYE")) { return 25; } return 20; } - else if ((has_amount("binoculars", 1) || has_amount("rifle_scope", 1) || - has_amount("survivor_scope", 1) || -1 != weapon.has_gunmod("rifle_scope") ) && + else if ((has_item_with_flag("ZOOM")) && has_trait("EAGLEEYED")) { if (has_trait("BIRD_EYE")) { return 30; From abd9427f5ce56d35b24d36816f1b8bdc7ff45903 Mon Sep 17 00:00:00 2001 From: DanmakuDan Date: Fri, 25 Dec 2015 14:05:28 -0600 Subject: [PATCH 17/61] Fix AIM losing items on move all (finally?) --- src/advanced_inv.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/advanced_inv.cpp b/src/advanced_inv.cpp index 97a95b505d4a2..f73984a30feed 100644 --- a/src/advanced_inv.cpp +++ b/src/advanced_inv.cpp @@ -1174,10 +1174,9 @@ bool advanced_inventory::move_all_items(bool nested_call) // Make sure source and destination are different, otherwise items will disappear // Need to check actual position to account for dragged vehicles - if( sarea.pos == darea.pos && - spane.in_vehicle() == dpane.in_vehicle() && - spane.on_ground() == dpane.on_ground() && - ( spane.in_vehicle() || spane.on_ground() || spane.get_area() == dpane.get_area() ) ) { + if( dpane.get_area() == AIM_DRAGGED && sarea.pos == darea.pos && spane.in_vehicle() == dpane.in_vehicle() ) { + return false; + } else if ( spane.get_area() == dpane.get_area() && spane.in_vehicle() == dpane.in_vehicle() ) { return false; } From e1287e5dcf37f161b11f5252f276791a1a2b3d4c Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sat, 26 Dec 2015 02:44:59 +0100 Subject: [PATCH 18/61] Move bandage/rag/disinfectant/firstaid iuses to actor --- src/activity_handlers.cpp | 27 ++- src/character.cpp | 2 +- src/character.h | 2 +- src/item_factory.cpp | 6 +- src/iuse.cpp | 334 +------------------------------------- src/iuse.h | 3 - src/iuse_actor.cpp | 300 +++++++++++++++++++++++++++++++++- src/iuse_actor.h | 53 +++++- 8 files changed, 376 insertions(+), 351 deletions(-) diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index 78ade22794dbc..252196460fe89 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -441,10 +441,29 @@ void activity_handlers::pickup_finish(player_activity *act, player *p) void activity_handlers::firstaid_finish( player_activity *act, player *p ) { - item &it = p->i_at(act->position); - iuse tmp; - tmp.completefirstaid( p, &it, false, p->pos() ); - p->reduce_charges(act->position, 1); + static const std::string iuse_name_string( "heal" ); + + item &it = p->i_at( act->position ); + item *used_tool = it.get_usable_item( iuse_name_string ); + if( used_tool == nullptr ) { + debugmsg( "Lost tool used for healing" ); + act->type = ACT_NULL; + return; + } + + const auto use_fun = used_tool->get_use( iuse_name_string ); + const auto *actor = dynamic_cast( use_fun->get_actor_ptr() ); + if( actor == nullptr ) { + debugmsg( "iuse_actor type descriptor and actual type mismatch" ); + act->type = ACT_NULL; + return; + } + + // TODO: Store the patient somehow, retrieve here + player &patient = *p; + hp_part healed = (hp_part)act->values[0]; + long charges_consumed = actor->finish_using( *p, patient, *used_tool, healed ); + p->reduce_charges( act->position, charges_consumed ); // Erase activity and values. act->type = ACT_NULL; act->values.clear(); diff --git a/src/character.cpp b/src/character.cpp index 120d12bcad60c..026c0544fb300 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -1215,7 +1215,7 @@ hp_part Character::body_window( bool precise ) const hp_part Character::body_window( const std::string &menu_header, bool show_all, bool precise, int normal_bonus, int head_bonus, int torso_bonus, - int bleed, int bite, int infect ) const + bool bleed, bool bite, bool infect ) const { WINDOW *hp_window = newwin(10, 31, (TERMY - 10) / 2, (TERMX - 31) / 2); draw_border(hp_window); diff --git a/src/character.h b/src/character.h index 99c2ee8788e5b..c352a5dd5124c 100644 --- a/src/character.h +++ b/src/character.h @@ -188,7 +188,7 @@ class Character : public Creature hp_part body_window( const std::string &menu_header, bool show_all, bool precise, int normal_bonus, int head_bonus, int torso_bonus, - int bleed, int bite, int infect ) const; + bool bleed, bool bite, bool infect ) const; // Returns color which this limb would have in healing menus nc_color limb_color( body_part bp, bool bleed, bool bite, bool infect ) const; diff --git a/src/item_factory.cpp b/src/item_factory.cpp index 772f076720a7a..06ccb50d5554d 100644 --- a/src/item_factory.cpp +++ b/src/item_factory.cpp @@ -133,9 +133,6 @@ void Item_factory::init() iuse_function_list["SEWAGE"] = &iuse::sewage; iuse_function_list["HONEYCOMB"] = &iuse::honeycomb; iuse_function_list["ROYAL_JELLY"] = &iuse::royal_jelly; - iuse_function_list["BANDAGE"] = &iuse::bandage; - iuse_function_list["FIRSTAID"] = &iuse::firstaid; - iuse_function_list["DISINFECTANT"] = &iuse::disinfectant; iuse_function_list["CAFF"] = &iuse::caff; iuse_function_list["ATOMIC_CAFF"] = &iuse::atomic_caff; iuse_function_list["ALCOHOL"] = &iuse::alcohol_medium; @@ -258,7 +255,6 @@ void Item_factory::init() iuse_function_list["BOLTCUTTERS"] = &iuse::boltcutters; iuse_function_list["MOP"] = &iuse::mop; iuse_function_list["SPRAY_CAN"] = &iuse::spray_can; - iuse_function_list["RAG"] = &iuse::rag; iuse_function_list["LAW"] = &iuse::LAW; iuse_function_list["HEATPACK"] = &iuse::heatpack; iuse_function_list["QUIVER"] = &iuse::quiver; @@ -1484,6 +1480,8 @@ void Item_factory::set_uses_from_object(JsonObject obj, std::vector( obj ); } else if( type == "repair_item" ) { newfun = load_actor( obj ); + } else if( type == "heal" ) { + newfun = load_actor( obj ); } else if( type == "knife" ) { use_methods.push_back( load_actor( obj, "salvage" ) ); use_methods.push_back( load_actor( obj, "inscribe" ) ); diff --git a/src/iuse.cpp b/src/iuse.cpp index c4e782885e0d2..caa287df28492 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -311,297 +311,6 @@ int iuse::royal_jelly(player *p, item *it, bool, const tripoint& ) return it->type->charges_to_use(); } -static hp_part pick_part_to_heal( const player &healer, const player &patient, - const std::string &menu_header, - int normal_bonus, int head_bonus, int torso_bonus, - int bleed, int bite, int infect, bool force ) -{ - const bool precise = &healer == &patient ? - patient.has_trait( "SELFAWARE" ) : - ///\EFFECT_PER slightly increases precision when using first aid on someone else - - ///\EFFECT_FIRSTAID increases precision when using first aid on someone else - (healer.get_skill_level( skill_firstaid ) * 4 + healer.per_cur >= 20); - while( true ) { - hp_part healed_part = patient.body_window( menu_header, force, precise, - normal_bonus, head_bonus, torso_bonus, - bleed, bite, infect ); - if( healed_part == num_hp_parts ) { - return num_hp_parts; - } - - body_part bp = player::hp_to_bp( healed_part ); - if( ( infect > 0 && patient.has_effect( "infected", bp ) ) || - ( bite > 0 && patient.has_effect( "bite", bp ) ) || - ( bleed > 0 && patient.has_effect( "bleed", bp ) ) ) { - return healed_part; - } - - if( patient.hp_cur[healed_part] == 0 ) { - if( healed_part == hp_arm_l || healed_part == hp_arm_r ) { - add_msg( m_info, _("That arm is broken. It needs surgical attention or a splint.") ); - } else if( healed_part == hp_leg_l || healed_part == hp_leg_r ) { - add_msg( m_info, _("That leg is broken. It needs surgical attention or a splint.") ); - } else { - add_msg( m_info, "That body part is bugged. It needs developer's attention." ); - } - - continue; - } - - if( force || patient.hp_cur[healed_part] < patient.hp_max[healed_part] ) { - return healed_part; - } - } - - // Won't happen? - return num_hp_parts; -} - -player &get_patient( player &healer, const tripoint &pos ) -{ - if( healer.pos() == pos ) { - return healer; - } - - if( g->u.pos() == pos ) { - return g->u; - } - - const int npc_index = g->npc_at( pos ); - if( npc_index == -1 ) { - // Default to heal self on failure not to break old functionality - add_msg( m_debug, "No heal target at position %d,%d,%d", pos.x, pos.y, pos.z ); - return healer; - } - - return *g->active_npc[npc_index]; -} - -hp_part use_healing_item( player &healer, player &patient, item *it, - int normal_power, int head_power, - int torso_power, int bleed, - int bite, int infect, bool force ) -{ - hp_part healed = num_hp_parts; - ///\EFFECT_FIRSTAID increases healing item effects - int bonus = healer.get_skill_level( skill_firstaid ); - int head_bonus = 0; - int normal_bonus = 0; - int torso_bonus = 0; - if (head_power > 0) { - head_bonus = bonus * .8 + head_power; - } else { - head_bonus = head_power; - } - if (normal_power > 0) { - normal_bonus = bonus + normal_power; - } else { - normal_bonus = normal_power; - } - if (torso_power > 0) { - torso_bonus = bonus * 1.5 + torso_power; - } else { - torso_bonus = torso_power; - } - - if( healer.is_npc() ) { - // NPCs heal whichever has sustained the most damage - int highest_damage = 0; - for (int i = 0; i < num_hp_parts; i++) { - int damage = patient.hp_max[i] - patient.hp_cur[i]; - if (i == hp_head) { - damage *= 1.5; - } - if (i == hp_torso) { - damage *= 1.2; - } - // Consider states too - // Weights are arbitrary, may need balancing - const body_part i_bp = player::hp_to_bp( hp_part( i ) ); - damage += bleed * patient.get_effect_dur( "bleed", i_bp ) / 100 / 50; - damage += bite * patient.get_effect_dur( "bite", i_bp ) / 100 / 100; - damage += infect * patient.get_effect_dur( "infected", i_bp ) / 100 / 100; - if (damage > highest_damage) { - highest_damage = damage; - healed = hp_part(i); - } - } - } else if( patient.is_player() ) { - // Player healing self - let player select - if( healer.activity.type != ACT_FIRSTAID ) { - const std::string menu_header = it->tname(); - healed = pick_part_to_heal( healer, patient, menu_header, - normal_bonus, head_bonus, torso_bonus, - bleed, bite, infect, force ); - if( healed == num_hp_parts ) { - return num_hp_parts; // canceled - } - } - // Brick healing if using a first aid kit for the first time. - // TODO: Base check on something other than the name. - if( it->type->id == "1st_aid" && healer.activity.type != ACT_FIRSTAID ) { - // Cancel and wait for activity completion. - return healed; - } else if( healer.activity.type == ACT_FIRSTAID ) { - // Completed activity, extract body part from it. - healed = (hp_part)healer.activity.values[0]; - } - } else { - // Player healing NPC - // TODO: Remove this hack, allow using activities on NPCs - const std::string menu_header = it->tname(); - healed = pick_part_to_heal( healer, patient, menu_header, - normal_bonus, head_bonus, torso_bonus, - bleed, bite, infect, force ); - if( healed == num_hp_parts ) { - return num_hp_parts; // canceled - } - } - - healer.practice( skill_firstaid, 8 ); - int dam = 0; - if (healed == hp_head) { - dam = head_bonus; - } else if (healed == hp_torso) { - dam = torso_bonus; - } else { - dam = normal_bonus; - } - if( (patient.hp_cur[healed] >= 1) && (dam > 0)) { // Prevent first-aid from mending limbs - patient.heal(healed, dam); - } else if ((patient.hp_cur[healed] >= 1) && (dam < 0)) { - const body_part bp = player::hp_to_bp( healed ); - patient.apply_damage( nullptr, bp, -dam ); //hurt takes + damage - } - - const body_part bp_healed = player::hp_to_bp( healed ); - - const bool u_see = healer.is_player() || patient.is_player() || - g->u.sees( healer ) || g->u.sees( patient ); - const bool player_healing_player = healer.is_player() && patient.is_player(); - // Need a helper here - messages are from healer's point of view - // but it would be cool if NPCs could use this function too - const auto heal_msg = [&]( game_message_type msg_type, - const char *player_player_msg, const char *other_msg ) { - if( !u_see ) { - return; - } - - if( player_healing_player ) { - add_msg( msg_type, player_player_msg ); - } else { - add_msg( msg_type, other_msg ); - } - }; - - if (patient.has_effect("bleed", bp_healed)) { - if (x_in_y(bleed, 100)) { - patient.remove_effect("bleed", bp_healed); - heal_msg( m_good, _("You stop the bleeding."), _("The bleeding is stopped.") ); - } else { - heal_msg( m_warning, _("You fail to stop the bleeding."), _("The wound still bleeds.") ); - } - } - if (patient.has_effect("bite", bp_healed)) { - if (x_in_y(bite, 100)) { - patient.remove_effect("bite", bp_healed); - heal_msg( m_good, _("You clean the wound."), _("The wound is cleaned.") ); - } else { - heal_msg( m_warning, _("Your wound still aches."), _("The wound still looks bad.") ); - } - } - if (patient.has_effect("infected", bp_healed)) { - if (x_in_y(infect, 100)) { - int infected_dur = patient.get_effect_dur("infected", bp_healed); - patient.remove_effect("infected", bp_healed); - patient.add_effect("recover", infected_dur); - heal_msg( m_good, _("You disinfect the wound."), _("The wound is disinfected.") ); - } else { - heal_msg( m_warning, _("Your wound still hurts."), _("The wound still looks nasty.") ); - } - } - - return healed; -} - -hp_part use_healing_item( player *healer, item *it, - int normal_power, int head_power, - int torso_power, int bleed, - int bite, int infect, bool force ) -{ - return use_healing_item( *healer, *healer, it, - normal_power, head_power, torso_power, - bleed, bite, infect, force ); -} - -int iuse::bandage(player *p, item *it, bool, const tripoint &pos ) -{ - if (p->is_underwater()) { - p->add_msg_if_player(m_info, _("You can't do that while underwater.")); - return false; - } - player &patient = get_patient( *p, pos ); - if (num_hp_parts != use_healing_item( *p, patient, it, 3, 1, 4, 90, 0, 0, false)) { - if (it->type->id != "quikclot" || it->type->id != "bfipowder") { - // Make bandages and rags take arbitrarily longer than hemostatic/antiseptic powders. - p->moves -= 100; - } - p->add_msg_if_player(m_good, _("You use your %s."), it->tname().c_str()); - return it->type->charges_to_use(); - } - return 0; -} - -int iuse::firstaid(player *p, item *it, bool, const tripoint &pos ) -{ - if (p->is_underwater()) { - p->add_msg_if_player(m_info, _("You can't do that while underwater.")); - return false; - } - - player &patient = get_patient( *p, pos ); - hp_part healed = use_healing_item( *p, patient, it, 14, 10, 18, 95, 99, 95, false); - if( healed == num_hp_parts ) { - return 0; - } - - if( &patient != p ) { - return 1; - } - - // Assign first aid long action. - ///\EFFECT_FIRSTAID speeds up firstaid activity - p->assign_activity(ACT_FIRSTAID, 6000 / (p->skillLevel( skill_firstaid ) + 1), 0, - p->get_item_position(it), it->tname()); - p->activity.values.push_back(healed); - p->moves = 0; - return 0; -} - -// Used when finishing the first aid long action. -int iuse::completefirstaid(player *p, item *it, bool, const tripoint& ) -{ - if (num_hp_parts != use_healing_item(p, it, 14, 10, 18, 95, 99, 95, false)) { - p->add_msg_if_player(_("You finish using the %s."), it->tname().c_str()); - p->add_effect("pkill1", 120); - } - return 0; -} - -int iuse::disinfectant(player *p, item *it, bool, const tripoint &pos ) -{ - if (p->is_underwater()) { - p->add_msg_if_player(m_info, _("You can't do that while underwater.")); - return false; - } - player &patient = get_patient( *p, pos ); - if (num_hp_parts != use_healing_item( *p, patient, it, 6, 5, 9, 0, 95, 0, false)) { - return it->type->charges_to_use(); - } - return 0; -} - int iuse::xanax(player *p, item *it, bool, const tripoint& ) { p->add_msg_if_player(_("You take some %s."), it->tname().c_str()); @@ -3075,26 +2784,6 @@ int iuse::pack_item(player *p, item *it, bool t, const tripoint& ) return 0; } -static bool cauterize_effect(player *p, item *it, bool force = true) -{ - hp_part hpart = use_healing_item(p, it, -2, -2, -2, 100, 50, 0, force); - if (hpart != num_hp_parts) { - p->add_msg_if_player(m_neutral, _("You cauterize yourself.")); - if (!(p->has_trait("NOPAIN"))) { - p->mod_pain(15); - p->add_msg_if_player(m_bad, _("It hurts like hell!")); - } else { - p->add_msg_if_player(m_neutral, _("It itches a little.")); - } - const body_part bp = player::hp_to_bp( hpart ); - if (p->has_effect("bite", bp)) { - p->add_effect("bite", 2600, bp, true); - } - return true; - } - return 0; -} - static int cauterize_elec(player *p, item *it) { if (it->charges == 0) { @@ -3103,14 +2792,14 @@ static int cauterize_elec(player *p, item *it) } else if (!p->has_effect("bite") && !p->has_effect("bleed") && !p->is_underwater()) { if ((p->has_trait("MASOCHIST") || p->has_trait("MASOCHIST_MED") || p->has_trait("CENOBITE")) && query_yn(_("Cauterize yourself for fun?"))) { - return cauterize_effect(p, it, true) ? it->type->charges_to_use() : 0; + return cauterize_actor::cauterize_effect(p, it, true) ? it->type->charges_to_use() : 0; } else { p->add_msg_if_player(m_info, _("You are not bleeding or bitten, there is no need to cauterize yourself.")); return 0; } } else if (p->is_npc() || query_yn(_("Cauterize any open wounds?"))) { - return cauterize_effect(p, it, true) ? it->type->charges_to_use() : 0; + return cauterize_actor::cauterize_effect(p, it, true) ? it->type->charges_to_use() : 0; } return 0; } @@ -5660,25 +5349,6 @@ int iuse::mop(player *p, item *it, bool, const tripoint& ) return it->type->charges_to_use(); } -int iuse::rag(player *p, item *it, bool, const tripoint& ) -{ - if (p->is_underwater()) { - p->add_msg_if_player(m_info, _("You can't do that while underwater.")); - return 0; - } - if (p->has_effect("bleed")) { - if (use_healing_item(p, it, 0, 0, 0, 50, 0, 0, false) != num_hp_parts) { - p->use_charges("rag", 1); - it->make("rag_bloody"); - } - return 0; - } else { - p->add_msg_if_player(m_info, _("You're not bleeding enough to need your %s."), - it->tname().c_str()); - return 0; - } -} - int iuse::LAW(player *p, item *it, bool, const tripoint& ) { p->add_msg_if_player(_("You pull the activating lever, readying the LAW to fire.")); diff --git a/src/iuse.h b/src/iuse.h index 31a7420f0335b..a708cb1118f54 100644 --- a/src/iuse.h +++ b/src/iuse.h @@ -24,8 +24,6 @@ class iuse int sewage ( player*, item*, bool, const tripoint& ); int honeycomb ( player*, item*, bool, const tripoint& ); int royal_jelly ( player*, item*, bool, const tripoint& ); - int bandage ( player*, item*, bool, const tripoint& ); - int firstaid ( player*, item*, bool, const tripoint& ); int completefirstaid ( player*, item*, bool, const tripoint& ); int disinfectant ( player*, item*, bool, const tripoint& ); int caff ( player*, item*, bool, const tripoint& ); @@ -161,7 +159,6 @@ class iuse int boltcutters ( player*, item*, bool, const tripoint& ); int mop ( player*, item*, bool, const tripoint& ); int spray_can ( player*, item*, bool, const tripoint& ); - int rag ( player*, item*, bool, const tripoint& ); int LAW ( player*, item*, bool, const tripoint& ); int heatpack ( player*, item*, bool, const tripoint& ); int hotplate ( player*, item*, bool, const tripoint& ); diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index b46c41c40dcb4..8bf9103d81472 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -20,6 +20,7 @@ #include "mapdata.h" #include "field.h" #include "weather.h" +#include "pldata.h" #include #include @@ -1308,13 +1309,23 @@ iuse_actor *cauterize_actor::clone() const return new cauterize_actor( *this ); } -extern hp_part use_healing_item(player *p, item *it, int normal_power, - int head_power, int torso_power, int bleed, - int bite, int infect, bool force); +static heal_actor prepare_dummy() +{ + heal_actor dummy; + dummy.limb_power = -2; + dummy.head_power = -2; + dummy.torso_power = -2; + dummy.bleed = 1.0f; + dummy.bite = 0.5f; + dummy.move_cost = 100; + return dummy; +} -bool cauterize_actor::cauterize_effect( player *p, item *it, bool force ) const +bool cauterize_actor::cauterize_effect( player *p, item *it, bool force ) { - hp_part hpart = use_healing_item( p, it, -2, -2, -2, 100, 50, 0, force ); + // TODO: Make this less hacky + static const heal_actor dummy = prepare_dummy(); + hp_part hpart = dummy.use_healing_item( *p, *p, *it, force ); if( hpart != num_hp_parts ) { p->add_msg_if_player(m_neutral, _("You cauterize yourself.")); if (!(p->has_trait("NOPAIN"))) { @@ -2197,3 +2208,282 @@ repair_item_actor::attempt_hint repair_item_actor::repair( player &pl, item &too pl.add_msg_if_player(m_info, _("Your %s is already enhanced."), fix.tname().c_str()); return AS_CANT; } + +void heal_actor::load( JsonObject &obj ) +{ + // Mandatory + limb_power = obj.get_int( "limb_power" ); + move_cost = obj.get_int( "move_cost" ); + + // Optional + head_power = obj.get_int( "head_power", 0.8f * limb_power ); + torso_power = obj.get_int( "torso_power", 1.5f * limb_power ); + + bleed = obj.get_float( "cure_bleed_chance", 0.0f ); + bite = obj.get_float( "cure_bite_chance", 0.0f ); + infect = obj.get_float( "cure_infection_chance", 0.0f ); + + long_action = obj.get_bool( "long_action", false ); +} + +player &get_patient( player &healer, const tripoint &pos ) +{ + if( healer.pos() == pos ) { + return healer; + } + + if( g->u.pos() == pos ) { + return g->u; + } + + const int npc_index = g->npc_at( pos ); + if( npc_index == -1 ) { + // Default to heal self on failure not to break old functionality + add_msg( m_debug, "No heal target at position %d,%d,%d", pos.x, pos.y, pos.z ); + return healer; + } + + return (player&)(*g->active_npc[npc_index]); +} + +long heal_actor::use( player *p, item *it, bool, const tripoint &pos ) const +{ + if( p->is_underwater() ) { + p->add_msg_if_player( m_info, _("You can't do that while underwater.") ); + return 0; + } + + player &patient = get_patient( *p, pos ); + const hp_part hpp = use_healing_item( *p, patient, *it, false ); + if( hpp == num_hp_parts ) { + return 0; + } + + // For now make "long healing" instant when used on somebody else + if( long_action && &patient == p ) { + // Assign first aid long action. + ///\EFFECT_FIRSTAID speeds up firstaid activity + const int action_moves = move_cost / (p->skillLevel( skill_firstaid ) + 1); + p->assign_activity( ACT_FIRSTAID, action_moves, 0, p->get_item_position( it ), it->tname() ); + p->activity.values.push_back( hpp ); + p->moves = 0; + return 0; + } + + p->moves -= move_cost; + p->add_msg_if_player(m_good, _("You use your %s."), it->tname().c_str()); + return it->type->charges_to_use(); +} + +iuse_actor *heal_actor::clone() const +{ + return new heal_actor( *this ); +} + +int heal_actor::get_heal_value( const player &healer, hp_part healed ) const +{ + int heal_base; + float bonus_mult; + if (healed == hp_head) { + heal_base = head_power; + bonus_mult = 0.8f; + } else if (healed == hp_torso) { + heal_base = torso_power; + bonus_mult = 1.5f; + } else { + heal_base = limb_power; + bonus_mult = 1.0f; + } + + if( heal_base > 0 ) { + ///\EFFECT_FIRSTAID increases healing item effects + float bonus = healer.get_skill_level( skill_firstaid ) * bonus_scaling; + return heal_base + bonus_mult * bonus; + } + + return heal_base; +} + +long heal_actor::finish_using( player &healer, player &patient, const item &it, hp_part healed ) const +{ + healer.practice( skill_firstaid, 8 ); + const int dam = get_heal_value( healer, healed ); + + if( (patient.hp_cur[healed] >= 1) && (dam > 0)) { // Prevent first-aid from mending limbs + patient.heal(healed, dam); + } else if ((patient.hp_cur[healed] >= 1) && (dam < 0)) { + const body_part bp = player::hp_to_bp( healed ); + patient.apply_damage( nullptr, bp, -dam ); //hurt takes + damage + } + + const body_part bp_healed = player::hp_to_bp( healed ); + + const bool u_see = healer.is_player() || patient.is_player() || + g->u.sees( healer ) || g->u.sees( patient ); + const bool player_healing_player = healer.is_player() && patient.is_player(); + // Need a helper here - messages are from healer's point of view + // but it would be cool if NPCs could use this function too + const auto heal_msg = [&]( game_message_type msg_type, + const char *player_player_msg, const char *other_msg ) { + if( !u_see ) { + return; + } + + if( player_healing_player ) { + add_msg( msg_type, player_player_msg ); + } else { + add_msg( msg_type, other_msg ); + } + }; + + if( patient.has_effect( "bleed", bp_healed ) ) { + if( x_in_y( bleed, 1.0f ) ) { + patient.remove_effect("bleed", bp_healed); + heal_msg( m_good, _("You stop the bleeding."), _("The bleeding is stopped.") ); + } else { + heal_msg( m_warning, _("You fail to stop the bleeding."), _("The wound still bleeds.") ); + } + } + if( patient.has_effect( "bite", bp_healed ) ) { + if( x_in_y( bite, 1.0f ) ) { + patient.remove_effect("bite", bp_healed); + heal_msg( m_good, _("You clean the wound."), _("The wound is cleaned.") ); + } else { + heal_msg( m_warning, _("Your wound still aches."), _("The wound still looks bad.") ); + } + } + if( patient.has_effect( "infected", bp_healed ) ) { + if( x_in_y( infect, 1.0f ) ) { + int infected_dur = patient.get_effect_dur("infected", bp_healed); + patient.remove_effect("infected", bp_healed); + patient.add_effect("recover", infected_dur); + heal_msg( m_good, _("You disinfect the wound."), _("The wound is disinfected.") ); + } else { + heal_msg( m_warning, _("Your wound still hurts."), _("The wound still looks nasty.") ); + } + } + + if( long_action ) { + healer.add_msg_if_player( _("You finish using the %s."), it.tname().c_str() ); + // TODO: jsonize this effect + patient.add_effect( "pkill1", 120 ); + } + + return it.type->charges_to_use(); +} + +hp_part pick_part_to_heal( + const player &healer, const player &patient, + const std::string &menu_header, + int limb_power, int head_bonus, int torso_bonus, + float bleed_chance, float bite_chance, float infect_chance, + bool force ) +{ + const bool bleed = bleed_chance > 0.0f; + const bool bite = bite_chance > 0.0f; + const bool infect = infect_chance > 0.0f; + const bool precise = &healer == &patient ? + patient.has_trait( "SELFAWARE" ) : + ///\EFFECT_PER slightly increases precision when using first aid on someone else + + ///\EFFECT_FIRSTAID increases precision when using first aid on someone else + (healer.get_skill_level( skill_firstaid ) * 4 + healer.per_cur >= 20); + while( true ) { + hp_part healed_part = patient.body_window( menu_header, force, precise, + limb_power, head_bonus, torso_bonus, + bleed, bite, infect ); + if( healed_part == num_hp_parts ) { + return num_hp_parts; + } + + body_part bp = player::hp_to_bp( healed_part ); + if( ( infect && patient.has_effect( "infected", bp ) ) || + ( bite && patient.has_effect( "bite", bp ) ) || + ( bleed && patient.has_effect( "bleed", bp ) ) ) { + return healed_part; + } + + if( patient.hp_cur[healed_part] == 0 ) { + if( healed_part == hp_arm_l || healed_part == hp_arm_r ) { + add_msg( m_info, _("That arm is broken. It needs surgical attention or a splint.") ); + } else if( healed_part == hp_leg_l || healed_part == hp_leg_r ) { + add_msg( m_info, _("That leg is broken. It needs surgical attention or a splint.") ); + } else { + add_msg( m_info, "That body part is bugged. It needs developer's attention." ); + } + + continue; + } + + if( force || patient.hp_cur[healed_part] < patient.hp_max[healed_part] ) { + return healed_part; + } + } + + // Won't happen? + return num_hp_parts; +} + +hp_part heal_actor::use_healing_item( player &healer, player &patient, const item &it, bool force ) const +{ + hp_part healed = num_hp_parts; + const int head_bonus = get_heal_value( healer, hp_head ); + const int limb_power = get_heal_value( healer, hp_arm_l ); + const int torso_bonus = get_heal_value( healer, hp_torso ); + + if( healer.is_npc() ) { + // NPCs heal whichever has sustained the most damage + int highest_damage = 0; + for (int i = 0; i < num_hp_parts; i++) { + int damage = patient.hp_max[i] - patient.hp_cur[i]; + if (i == hp_head) { + damage *= 1.5; + } + if (i == hp_torso) { + damage *= 1.2; + } + // Consider states too + // Weights are arbitrary, may need balancing + const body_part i_bp = player::hp_to_bp( hp_part( i ) ); + damage += bleed * patient.get_effect_dur( "bleed", i_bp ) / 50; + damage += bite * patient.get_effect_dur( "bite", i_bp ) / 100; + damage += infect * patient.get_effect_dur( "infected", i_bp ) / 100; + if (damage > highest_damage) { + highest_damage = damage; + healed = hp_part(i); + } + } + } else if( patient.is_player() ) { + // Player healing self - let player select + if( healer.activity.type != ACT_FIRSTAID ) { + const std::string menu_header = it.tname(); + healed = pick_part_to_heal( healer, patient, menu_header, + limb_power, head_bonus, torso_bonus, + bleed, bite, infect, force ); + if( healed == num_hp_parts ) { + return num_hp_parts; // canceled + } + } + // Brick healing if using a first aid kit for the first time. + if( long_action && healer.activity.type != ACT_FIRSTAID ) { + // Cancel and wait for activity completion. + return healed; + } else if( healer.activity.type == ACT_FIRSTAID ) { + // Completed activity, extract body part from it. + healed = (hp_part)healer.activity.values[0]; + } + } else { + // Player healing NPC + // TODO: Remove this hack, allow using activities on NPCs + const std::string menu_header = it.tname(); + healed = pick_part_to_heal( healer, patient, menu_header, + limb_power, head_bonus, torso_bonus, + bleed, bite, infect, force ); + } + + if( healed != num_hp_parts ) { + finish_using( healer, patient, it, healed ); + } + + return healed; +} diff --git a/src/iuse_actor.h b/src/iuse_actor.h index 4ce5c75c14e88..9806ea74dd7ce 100644 --- a/src/iuse_actor.h +++ b/src/iuse_actor.h @@ -11,6 +11,7 @@ struct vehicle_prototype; using vproto_id = string_id; enum field_id : int; +enum hp_part : int; struct mtype; using mtype_id = string_id; class JsonObject; @@ -467,7 +468,7 @@ class cauterize_actor : public iuse_actor // Use flame. If false, uses item charges instead. bool flame; - bool cauterize_effect( player *p, item *it, bool force ) const; + static bool cauterize_effect( player *p, item *it, bool force ); cauterize_actor() : iuse_actor(), flame( true ) { } virtual ~cauterize_actor() { } @@ -673,4 +674,54 @@ class repair_item_actor : public iuse_actor virtual iuse_actor *clone() const override; }; +class heal_actor : public iuse_actor +{ + public: + /** How much hp to restore when healing limbs? */ + int limb_power; + /** How much hp to restore when healing head? */ + int head_power; + /** How much hp to restore when healing torso? */ + int torso_power; + /** Chance to remove bleed effect. */ + float bleed; + /** Chance to remove bite effect. */ + float bite; + /** Chance to remove infected effect. */ + float infect; + /** Cost in moves to use the item. */ + int move_cost; + /** Is using this item a long action. */ + bool long_action; + /** Scales extra healed hp gained from first aid skill. */ + float bonus_scaling; + + /** How much hp would `healer` heal using this actor on `healed` body part. */ + int get_heal_value( const player &healer, hp_part healed ) const; + + /** Does the actual healing. Used by both long and short actions. Returns charges used. */ + long finish_using( player &healer, player &patient, const item &it, hp_part part ) const; + + hp_part use_healing_item( + player &healer, player &patient, + const item &it, bool force ) const; + + heal_actor() + : iuse_actor() + , limb_power( 0 ) + , head_power( 0 ) + , torso_power( 0 ) + , bleed( 0.0f ) + , bite( 0.0f ) + , infect( 0.0f ) + , move_cost( 100 ) + , long_action( false ) + , bonus_scaling( 1.0f ) + { } + virtual ~heal_actor() { } + virtual void load( JsonObject &jo ); + virtual long use( player *, item *, bool, const tripoint & ) const override; + virtual iuse_actor *clone() const override; +}; + #endif From a79b36031d31248b6a3e55425486ef9b56dfcd2f Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sat, 26 Dec 2015 03:24:11 +0100 Subject: [PATCH 19/61] Update items --- data/json/items/comestibles.json | 91 ++++++++++++++++++++++++++------ data/json/items/tools.json | 16 ++++-- src/iuse_actor.cpp | 10 ++-- 3 files changed, 93 insertions(+), 24 deletions(-) diff --git a/data/json/items/comestibles.json b/data/json/items/comestibles.json index e0574af6c68f7..484b9941a15a5 100644 --- a/data/json/items/comestibles.json +++ b/data/json/items/comestibles.json @@ -8777,7 +8777,6 @@ "color" : "white", "addiction_type" : "none", "spoils_in" : 0, - "use_action" : "BANDAGE", "stim" : 0, "container" : "bag_plastic", "to_hit" : 0, @@ -8797,7 +8796,15 @@ "charges" : 2, "bashing" : 0, "flags" : ["USE_ON_NPC"], - "fun" : 0 + "fun" : 0, + "use_action" : { + "type" : "heal", + "limb_power" : 3, + "head_power" : 1, + "torso_power" : 4, + "bleed" : 0.9, + "move_cost" : 300 + } }, { "type" : "COMESTIBLE", @@ -13449,7 +13456,6 @@ "color" : "white", "addiction_type" : "none", "spoils_in" : 0, - "use_action" : "BANDAGE", "stim" : 0, "container" : "null", "to_hit" : 0, @@ -13470,7 +13476,15 @@ "stack_size": 9, "bashing" : 0, "flags" : ["USE_ON_NPC"], - "fun" : 0 + "fun" : 0, + "use_action" : { + "type" : "heal", + "limb_power" : 3, + "head_power" : 1, + "torso_power" : 4, + "bleed" : 0.9, + "move_cost" : 300 + } }, { "type" : "COMESTIBLE", @@ -13480,7 +13494,6 @@ "color" : "red", "addiction_type" : "none", "spoils_in" : 0, - "use_action" : "FIRSTAID", "stim" : 0, "container" : "null", "to_hit" : 0, @@ -13501,7 +13514,18 @@ "stack_size" : 6, "bashing" : 0, "flags" : ["USE_ON_NPC"], - "fun" : 0 + "fun" : 0, + "use_action" : { + "type" : "heal", + "limb_power" : 14, + "head_power" : 10, + "torso_power" : 18, + "bleed" : 0.95, + "bite" : 0.99, + "infect" : 0.95, + "move_cost" : 6000, + "long_action" : true + } }, { "type" : "COMESTIBLE", @@ -14862,7 +14886,6 @@ "color" : "light_cyan", "addiction_type" : "none", "spoils_in" : 0, - "use_action" : "DISINFECTANT", "stim" : 0, "container" : "bottle_plastic", "to_hit" : 0, @@ -14882,7 +14905,15 @@ "charges" : 2, "bashing" : 0, "flags" : ["USE_ON_NPC"], - "fun" : 0 + "fun" : 0, + "use_action" : { + "type" : "heal", + "limb_power" : 6, + "head_power" : 5, + "torso_power" : 9, + "bite" : 0.95, + "move_cost" : 100 + } }, { "type" : "COMESTIBLE", @@ -14893,7 +14924,6 @@ "color" : "white", "addiction_type" : "none", "spoils_in" : 0, - "use_action" : "DISINFECTANT", "stim" : 0, "container" : "bottle_glass", "to_hit" : 0, @@ -14912,7 +14942,15 @@ "phase" : "liquid", "charges" : 1, "bashing" : 0, - "fun" : 0 + "fun" : 0, + "use_action" : { + "type" : "heal", + "limb_power" : 6, + "head_power" : 5, + "torso_power" : 9, + "bite" : 0.95, + "move_cost" : 100 + } }, { "id": "mayonnaise", @@ -16250,7 +16288,6 @@ "color" : "light_gray", "addiction_type" : "none", "spoils_in" : 0, - "use_action" : "BANDAGE", "stim" : 0, "container" : "bag_plastic", "to_hit" : 0, @@ -16271,7 +16308,15 @@ "stack_size" : 60, "bashing" : 0, "flags" : ["USE_ON_NPC"], - "fun" : 0 + "fun" : 0, + "use_action" : { + "type" : "heal", + "limb_power" : 3, + "head_power" : 1, + "torso_power" : 4, + "bleed" : 90, + "move_cost" : 100 + } }, { "type" : "COMESTIBLE", @@ -16282,7 +16327,6 @@ "color" : "white", "addiction_type" : "none", "spoils_in" : 0, - "use_action" : "DISINFECTANT", "stim" : 0, "container" : "bottle_plastic_small", "to_hit" : 0, @@ -16303,7 +16347,15 @@ "stack_size" : 40, "bashing" : 0, "flags" : ["USE_ON_NPC"], - "fun" : 0 + "fun" : 0, + "use_action" : { + "type" : "heal", + "limb_power" : 6, + "head_power" : 5, + "torso_power" : 9, + "bite" : 0.95, + "move_cost" : 100 + } }, { "type" : "AMMO", "id" : "fungal_seeds", @@ -19994,7 +20046,6 @@ "description" : "Some essential oil made from thyme, which can act as a mildly irritating disinfectant.", "material" : "null", "comestible_type" : "MED", - "use_action" : "DISINFECTANT", "container" : "null", "addiction_type" : "none", "spoils_in" : 672, @@ -20012,7 +20063,15 @@ "bashing" : -8, "cutting" : 0, "charges" : 1, - "price" : 0 + "price" : 0, + "use_action" : { + "type" : "heal", + "limb_power" : 6, + "head_power" : 5, + "torso_power" : 9, + "bite" : 0.95, + "move_cost" : 100 + } },{ "type" : "COMESTIBLE", "id" : "seed_canola", diff --git a/data/json/items/tools.json b/data/json/items/tools.json index fc19327e90566..5688b545d7325 100644 --- a/data/json/items/tools.json +++ b/data/json/items/tools.json @@ -6740,8 +6740,13 @@ "ammo": "NULL", "revert_to": "null", "category" : "spare_parts", - "use_action": "RAG", - "flags": ["NO_SALVAGE"] + "flags": ["NO_SALVAGE"], + "use_action" : { + "type" : "heal", + "limb_power" : 0, + "bleed" : 0.5, + "move_cost" : 200 + } }, { @@ -8076,7 +8081,12 @@ "ammo": "NULL", "revert_to": "null", "category" : "drugs", - "use_action": "RAG" + "use_action" : { + "type" : "heal", + "limb_power" : 0, + "bleed" : 0.5, + "move_cost" : 200 + } }, { diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index 8bf9103d81472..400467eec7ae0 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -2219,9 +2219,9 @@ void heal_actor::load( JsonObject &obj ) head_power = obj.get_int( "head_power", 0.8f * limb_power ); torso_power = obj.get_int( "torso_power", 1.5f * limb_power ); - bleed = obj.get_float( "cure_bleed_chance", 0.0f ); - bite = obj.get_float( "cure_bite_chance", 0.0f ); - infect = obj.get_float( "cure_infection_chance", 0.0f ); + bleed = obj.get_float( "bleed", 0.0f ); + bite = obj.get_float( "bite", 0.0f ); + infect = obj.get_float( "infect", 0.0f ); long_action = obj.get_bool( "long_action", false ); } @@ -2284,10 +2284,10 @@ int heal_actor::get_heal_value( const player &healer, hp_part healed ) const { int heal_base; float bonus_mult; - if (healed == hp_head) { + if( healed == hp_head ) { heal_base = head_power; bonus_mult = 0.8f; - } else if (healed == hp_torso) { + } else if( healed == hp_torso ) { heal_base = torso_power; bonus_mult = 1.5f; } else { From 6d3852bab5355f6b34b471bf44f45ecd19359fe5 Mon Sep 17 00:00:00 2001 From: illi-kun Date: Sat, 26 Dec 2015 05:31:52 +0300 Subject: [PATCH 20/61] clean up blazemod --- data/mods/blazemod/blaze_ammo.json | 20 --------------- data/mods/blazemod/blaze_autoweapons.json | 30 ----------------------- data/mods/blazemod/blaze_blob.json | 25 ------------------- data/mods/blazemod/blaze_dummy_parts.json | 9 ------- data/mods/blazemod/blaze_other.json | 14 ----------- data/mods/blazemod/blaze_test.json | 4 --- data/mods/blazemod/blaze_weapons.json | 17 ------------- 7 files changed, 119 deletions(-) diff --git a/data/mods/blazemod/blaze_ammo.json b/data/mods/blazemod/blaze_ammo.json index 824d4ea42d48b..3f628d2c176f4 100644 --- a/data/mods/blazemod/blaze_ammo.json +++ b/data/mods/blazemod/blaze_ammo.json @@ -12,7 +12,6 @@ "volume" : 1, "weight" : 3816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "h_projectile", "damage" : 14, @@ -36,7 +35,6 @@ "volume" : 5, "weight" : 15160, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "h_projectile", "damage" : 14, @@ -60,7 +58,6 @@ "volume" : 1, "weight" : 4816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "h_projectile", "damage" : 14, @@ -84,7 +81,6 @@ "volume" : 1, "weight" : 3816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "h_projectile", "damage" : 14, @@ -108,7 +104,6 @@ "volume" : 1, "weight" : 6816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "h_projectile", "damage" : 14, @@ -131,7 +126,6 @@ "volume" : 5, "weight" : 1555, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "hbolt", "damage" : 20, @@ -154,7 +148,6 @@ "volume" : 5, "weight" : 2055, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "hbolt", "damage" : 35, @@ -177,7 +170,6 @@ "volume" : 1, "weight" : 57, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "BB", "damage" : 1, @@ -199,7 +191,6 @@ "volume" : 12, "weight" : 1455, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "ripdisk", "damage" : 40, @@ -222,7 +213,6 @@ "volume" : 12, "weight" : 555, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "ripdisk", "damage" : 30, @@ -245,7 +235,6 @@ "weight": 657, "volume": 1, "bashing": 7, - "cutting": 0, "to_hit": -2, "ammo_type" : "h_projectile", "damage" : 15, @@ -268,7 +257,6 @@ "weight": 170, "volume": 1, "bashing": 8, - "cutting": 0, "to_hit": -3, "ammo_type" : "h_projectile", "damage" : 23, @@ -291,7 +279,6 @@ "volume" : 1, "weight" : 3816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "h_projectile", "damage" : 14, @@ -314,7 +301,6 @@ "weight": 400, "volume": 1, "bashing": 8, - "cutting": 0, "to_hit": -3, "ammo_type" : "h_projectile", "damage" : 50, @@ -337,7 +323,6 @@ "volume" : 1, "weight" : 3816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "hbolt", "damage" : 14, @@ -361,7 +346,6 @@ "volume" : 1, "weight" : 3816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "hbolt", "damage" : 14, @@ -385,7 +369,6 @@ "volume" : 1, "weight" : 3816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "hbolt", "damage" : 14, @@ -409,7 +392,6 @@ "volume" : 1, "weight" : 4816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "hbolt", "damage" : 14, @@ -433,7 +415,6 @@ "volume" : 1, "weight" : 3816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "hbolt", "damage" : 14, @@ -457,7 +438,6 @@ "volume" : 1, "weight" : 6816, "bashing" : 8, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "hbolt", "damage" : 14, diff --git a/data/mods/blazemod/blaze_autoweapons.json b/data/mods/blazemod/blaze_autoweapons.json index 8ec092e053a57..aaee5cfb02dcf 100644 --- a/data/mods/blazemod/blaze_autoweapons.json +++ b/data/mods/blazemod/blaze_autoweapons.json @@ -17,7 +17,6 @@ "weight": 11194, "volume": 18, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 20, "pierce": 10, @@ -49,7 +48,6 @@ "weight": 11141, "volume": 18, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 35, "pierce": 5, @@ -81,7 +79,6 @@ "weight": 10650, "volume": 14, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 50, "pierce": 30, @@ -113,7 +110,6 @@ "weight": 13502, "volume": 22, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 50, "pierce": 30, @@ -145,7 +141,6 @@ "weight": 8825, "volume": 16, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 10, "pierce": 20, @@ -176,7 +171,6 @@ "weight": 11186, "volume": 19, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 10, "pierce": 10, @@ -207,7 +201,6 @@ "weight": 6520, "volume": 8, "bashing": 18, - "cutting": 0, "to_hit": -1, "ranged_damage": 20, "pierce": 15, @@ -238,7 +231,6 @@ "weight": 6520, "volume": 8, "bashing": 18, - "cutting": 0, "to_hit": -1, "ranged_damage": 25, "pierce": 15, @@ -269,7 +261,6 @@ "weight": 6520, "volume": 8, "bashing": 18, - "cutting": 0, "to_hit": -1, "ranged_damage": 15, "pierce": 15, @@ -300,7 +291,6 @@ "weight": 7620, "volume": 13, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 15, "pierce": 20, @@ -332,7 +322,6 @@ "weight": 18320, "volume": 20, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 20, "pierce": 20, @@ -363,7 +352,6 @@ "weight": 25608, "volume": 28, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 75, "range": 50, @@ -392,7 +380,6 @@ "weight": 17308, "volume": 22, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 30, "range": 15, @@ -422,7 +409,6 @@ "weight": 20459, "volume": 24, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 60, "range": 50, @@ -452,7 +438,6 @@ "weight": 12311, "volume": 19, "bashing": 6, - "cutting": 0, "to_hit": -3, "ranged_damage": 15, "range": 8, @@ -481,7 +466,6 @@ "weight": 18516, "volume": 19, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 20, "range": 15, @@ -511,7 +495,6 @@ "weight": 52516, "volume": 30, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 50, "range": 1, @@ -541,7 +524,6 @@ "weight": 18516, "volume": 19, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 25, "range": 8, @@ -570,7 +552,6 @@ "weight": 12700, "volume": 18, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 25, "range": 25, @@ -598,7 +579,6 @@ "weight": 38000, "volume": 20, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 25, "range": 45, @@ -627,7 +607,6 @@ "weight": 24500, "volume": 26, "bashing": 18, - "cutting": 0, "to_hit": -4, "ranged_damage": 10, "range": -6, @@ -657,7 +636,6 @@ "weight": 7530, "volume": 8, "bashing": 6, - "cutting": 0, "to_hit": -3, "ranged_damage": 10, "range": 50, @@ -686,7 +664,6 @@ "weight": 12632, "volume": 18, "bashing": 6, - "cutting": 0, "to_hit": -3, "ranged_damage": 10, "pierce": 10, @@ -717,7 +694,6 @@ "weight": 10852, "volume": 18, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 10, "range": 8, @@ -748,7 +724,6 @@ "weight": 11052, "volume": 12, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 15, "pierce": 30, @@ -779,7 +754,6 @@ "weight": 15213, "volume": 20, "bashing": 10, - "cutting": 0, "to_hit": -3, "ranged_damage": 50, "pierce": 20, @@ -808,7 +782,6 @@ "weight": 5907, "volume": 24, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 15, "range": 5, @@ -836,7 +809,6 @@ "weight": 6587, "volume": 19, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": 15, "range": 10, @@ -864,7 +836,6 @@ "weight": 6320, "volume": 19, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": 15, "range": 15, @@ -893,7 +864,6 @@ "weight": 24952, "volume": 19, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 40, "range": 12, diff --git a/data/mods/blazemod/blaze_blob.json b/data/mods/blazemod/blaze_blob.json index 777ee93aca869..f179733cc99e8 100644 --- a/data/mods/blazemod/blaze_blob.json +++ b/data/mods/blazemod/blaze_blob.json @@ -14,7 +14,6 @@ "weight": 12142, "volume": 12, "bashing": 10, - "cutting": 0, "to_hit": -5, "ranged_damage": 5, "range": 10, @@ -43,7 +42,6 @@ "weight": 15103, "volume": 12, "bashing": 10, - "cutting": 0, "to_hit": -5, "ranged_damage": 1, "range": 18, @@ -72,7 +70,6 @@ "weight": 16501, "volume": 15, "bashing": 10, - "cutting": 0, "to_hit": -5, "ranged_damage": 1, "range": 15, @@ -100,7 +97,6 @@ "weight": 24142, "volume": 22, "bashing": 10, - "cutting": 0, "to_hit": -5, "ranged_damage": 25, "range": 20, @@ -129,7 +125,6 @@ "weight": 22121, "volume": 18, "bashing": 10, - "cutting": 0, "to_hit": -5, "ranged_damage": 30, "pierce": 30, @@ -676,7 +671,6 @@ "weight": 17100, "volume": 50, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -708,7 +702,6 @@ "weight": 24100, "volume": 50, "bashing": 0, - "cutting": 0, "to_hit": -2, "contains": 10, "ammo": "bfeed", @@ -728,7 +721,6 @@ "weight": 13115, "volume": 14, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -758,7 +750,6 @@ "weight": 14613, "volume": 16, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -788,7 +779,6 @@ "weight": 15662, "volume": 20, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -818,7 +808,6 @@ "weight": 20662, "volume": 28, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -848,7 +837,6 @@ "weight": 8662, "volume": 24, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -878,7 +866,6 @@ "weight": 6662, "volume": 40, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -908,7 +895,6 @@ "material" : ["bone", "flesh"], "volume" : 40, "bashing" : 9, - "cutting" : 0, "category" : "veh_parts", "price" : 500 }, @@ -924,7 +910,6 @@ "weight": 9162, "volume": 10, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -954,7 +939,6 @@ "material" : ["bone", "cotton"], "volume" : 40, "bashing" : 9, - "cutting" : 0, "category" : "veh_parts", "price" : 500 }, @@ -970,7 +954,6 @@ "weight": 5162, "volume": 20, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -1000,7 +983,6 @@ "material" : ["bone", "cotton"], "volume" : 30, "bashing" : 9, - "cutting" : 0, "category" : "veh_parts", "price" : 500 }, @@ -1016,7 +998,6 @@ "weight": 1762, "volume": 10, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -1046,7 +1027,6 @@ "material" : ["bone", "cotton"], "volume" : 40, "bashing" : 9, - "cutting" : 0, "category" : "veh_parts", "price" : 500 }, @@ -1062,7 +1042,6 @@ "weight": 63900, "volume": 100, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -1092,7 +1071,6 @@ "material" : ["stone", "flesh"], "volume" : 100, "bashing" : 9, - "cutting" : 0, "price" : 500, "min-bigness": 300, "max-bigness": 500, @@ -1111,7 +1089,6 @@ "weight": 16410, "volume": 20, "bashing": 0, - "cutting": 0, "to_hit": -2, "max_charges": 0, "initial_charges": 0, @@ -1141,7 +1118,6 @@ "material" : ["bone", "cotton"], "volume" : 20, "bashing" : 9, - "cutting" : 0, "price" : 500, "min-bigness": 25, "max-bigness": 25, @@ -1321,7 +1297,6 @@ "weight": 1, "volume": 1, "bashing": 8, - "cutting": 0, "to_hit": -3, "phase" : "liquid", "ammo_type" : "bfeed", diff --git a/data/mods/blazemod/blaze_dummy_parts.json b/data/mods/blazemod/blaze_dummy_parts.json index bb12117b0a1cc..41494a83626fe 100644 --- a/data/mods/blazemod/blaze_dummy_parts.json +++ b/data/mods/blazemod/blaze_dummy_parts.json @@ -257,7 +257,6 @@ "material" : ["powder"], "volume" : 0, "bashing" : 0, - "cutting" : 0, "category" : "veh_parts", "price" : 0 }, @@ -273,7 +272,6 @@ "material" : ["powder"], "volume" : 0, "bashing" : 0, - "cutting" : 0, "category" : "veh_parts", "price" : 0 }, @@ -289,7 +287,6 @@ "material" : ["powder"], "volume" : 0, "bashing" : 0, - "cutting" : 0, "category" : "veh_parts", "price" : 0 }, @@ -305,7 +302,6 @@ "material" : ["powder"], "volume" : 0, "bashing" : 0, - "cutting" : 0, "category" : "veh_parts", "price" : 0 }, @@ -321,7 +317,6 @@ "material" : ["powder"], "volume" : 0, "bashing" : 0, - "cutting" : 0, "category" : "veh_parts", "price" : 0 }, @@ -337,7 +332,6 @@ "material" : ["powder"], "volume" : 0, "bashing" : 0, - "cutting" : 0, "category" : "veh_parts", "price" : 0 }, @@ -353,7 +347,6 @@ "material" : ["powder"], "volume" : 0, "bashing" : 0, - "cutting" : 0, "category" : "veh_parts", "price" : 0 }, @@ -369,7 +362,6 @@ "material" : ["powder"], "volume" : 0, "bashing" : 0, - "cutting" : 0, "category" : "veh_parts", "price" : 0 }, @@ -385,7 +377,6 @@ "material" : ["powder"], "volume" : 0, "bashing" : 0, - "cutting" : 0, "category" : "veh_parts", "price" : 0 }, diff --git a/data/mods/blazemod/blaze_other.json b/data/mods/blazemod/blaze_other.json index 689744e753fe7..01ecda3208223 100644 --- a/data/mods/blazemod/blaze_other.json +++ b/data/mods/blazemod/blaze_other.json @@ -12,7 +12,6 @@ "techniques" : ["DEF_DISARM"], "volume" : 3, "bashing" : 15, - "cutting" : 0, "category" : "veh_parts", "price" : 22500 }, @@ -29,7 +28,6 @@ "techniques" : ["DEF_DISARM"], "volume" : 5, "bashing" : 15, - "cutting" : 0, "category" : "veh_parts", "price" : 22500 }, @@ -46,7 +44,6 @@ "techniques" : ["DEF_DISARM"], "volume" : 8, "bashing" : 15, - "cutting" : 0, "category" : "veh_parts", "price" : 22500 }, @@ -63,7 +60,6 @@ "techniques" : ["DEF_DISARM"], "volume" : 25, "bashing" : 15, - "cutting" : 0, "category" : "veh_parts", "price" : 8000 }, @@ -79,7 +75,6 @@ "material" : ["steel", "null"], "volume" : 12, "bashing" : 6, - "cutting" : 0, "category" : "veh_parts", "price" : 750 }, @@ -95,7 +90,6 @@ "material" : ["steel", "null"], "volume" : 12, "bashing" : 6, - "cutting" : 0, "category" : "veh_parts", "price" : 1300 }, @@ -111,7 +105,6 @@ "material" : ["steel"], "volume" : 30, "bashing" : 6, - "cutting" : 0, "category" : "veh_parts", "price" : 10500 }, @@ -127,7 +120,6 @@ "material" : ["plastic", "steel"], "volume" : 250, "bashing" : 30, - "cutting" : 0, "price" : 25500, "min-bigness": 40, "max-bigness": 40, @@ -146,7 +138,6 @@ "material" : ["steel"], "volume" : 350, "bashing" : 30, - "cutting" : 0, "price" : 45500, "min-bigness": 50, "max-bigness": 50, @@ -165,7 +156,6 @@ "material" : ["hardsteel", "steel"], "volume" : 400, "bashing" : 30, - "cutting" : 0, "price" : 75500, "min-bigness": 60, "max-bigness": 60, @@ -183,7 +173,6 @@ "weight": 20000, "volume": 6, "bashing": 4, - "cutting": 0, "to_hit": -1, "min-bigness": 55, "max-bigness": 85, @@ -201,7 +190,6 @@ "weight": 10000, "volume": 3, "bashing": 2, - "cutting": 0, "to_hit": -1, "min-bigness": 45, "max-bigness": 65, @@ -224,7 +212,6 @@ "weight": 1003, "volume": 4, "bashing": 2, - "cutting": 0, "to_hit": -1, "ranged_damage": 0, "range": 15, @@ -253,7 +240,6 @@ "weight": 11260, "volume": 11, "bashing": 12, - "cutting": 0, "to_hit": -1, "range": 24, "dispersion": 600, diff --git a/data/mods/blazemod/blaze_test.json b/data/mods/blazemod/blaze_test.json index 9f7214b6d0a7a..527c807e4b173 100644 --- a/data/mods/blazemod/blaze_test.json +++ b/data/mods/blazemod/blaze_test.json @@ -224,7 +224,6 @@ "material" : ["steel", "plastic"], "volume" : 200, "bashing" : 2, - "cutting" : 0, "category" : "veh_parts", "price" : 1500000 }, @@ -240,7 +239,6 @@ "material" : ["steel", "null"], "volume" : 225, "bashing" : 4, - "cutting" : 0, "category" : "veh_parts", "price" : 1500000, "rigid": true, @@ -260,7 +258,6 @@ "material" : ["steel", "null"], "volume" : 200, "bashing" : 4, - "cutting" : 0, "category" : "veh_parts", "price" : 1500000, "rigid": true, @@ -288,7 +285,6 @@ "weight" : 0, "phase" : "solid", "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "vpower", "damage" : 0, diff --git a/data/mods/blazemod/blaze_weapons.json b/data/mods/blazemod/blaze_weapons.json index 229b1de9a27e0..fa785ec4de91f 100644 --- a/data/mods/blazemod/blaze_weapons.json +++ b/data/mods/blazemod/blaze_weapons.json @@ -17,7 +17,6 @@ "weight": 5194, "volume": 15, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 20, "pierce": 10, @@ -49,7 +48,6 @@ "weight": 5141, "volume": 15, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 30, "pierce": 10, @@ -81,7 +79,6 @@ "weight": 6650, "volume": 10, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 50, "pierce": 30, @@ -113,7 +110,6 @@ "weight": 9500, "volume": 18, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 50, "pierce": 30, @@ -145,7 +141,6 @@ "weight": 4825, "volume": 12, "bashing": 8, - "cutting": 0, "to_hit": -1, "ranged_damage": 10, "pierce": 20, @@ -176,7 +171,6 @@ "weight": 7827, "volume": 15, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 10, "pierce": 10, @@ -207,7 +201,6 @@ "weight": 18308, "volume": 24, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 75, "range": 50, @@ -236,7 +229,6 @@ "weight": 10500, "volume": 20, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 60, "pierce": 30, @@ -267,7 +259,6 @@ "weight": 12359, "volume": 25, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 60, "range": 50, @@ -297,7 +288,6 @@ "weight": 7311, "volume": 15, "bashing": 6, - "cutting": 0, "to_hit": -3, "ranged_damage": 15, "range": 8, @@ -325,7 +315,6 @@ "weight": 13713, "volume": 15, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 20, "range": 15, @@ -355,7 +344,6 @@ "weight": 40516, "volume": 26, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 50, "range": 1, @@ -385,7 +373,6 @@ "weight": 7110, "volume": 15, "bashing": 6, - "cutting": 0, "to_hit": -3, "ranged_damage": 10, "pierce": 10, @@ -416,7 +403,6 @@ "weight": 5852, "volume": 14, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 10, "range": 8, @@ -447,7 +433,6 @@ "weight": 6152, "volume": 12, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 15, "pierce": 30, @@ -478,7 +463,6 @@ "weight": 10135, "volume": 16, "bashing": 10, - "cutting": 0, "to_hit": -3, "ranged_damage": 50, "pierce": 20, @@ -508,7 +492,6 @@ "weight": 19952, "volume": 15, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 60, "range": 16, From ae543729d8abddb57b7f4f8081986c0c49fef903 Mon Sep 17 00:00:00 2001 From: illi-kun Date: Sat, 26 Dec 2015 05:32:13 +0300 Subject: [PATCH 21/61] clean up More Survival Tools mod --- data/mods/More_Survival_Tools/ammo.json | 5 ----- data/mods/More_Survival_Tools/armor.json | 4 ---- data/mods/More_Survival_Tools/items.json | 21 --------------------- 3 files changed, 30 deletions(-) diff --git a/data/mods/More_Survival_Tools/ammo.json b/data/mods/More_Survival_Tools/ammo.json index 11b704c12c9a3..d170386fa54a9 100644 --- a/data/mods/More_Survival_Tools/ammo.json +++ b/data/mods/More_Survival_Tools/ammo.json @@ -13,7 +13,6 @@ "volume" : 1, "weight" : 10, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "tinder", "damage" : 0, @@ -34,7 +33,6 @@ "volume" : 1, "weight" : 3, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "pebble", "damage" : 2, @@ -55,7 +53,6 @@ "volume" : 1, "weight" : 12, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "pebble", "damage" : 7, @@ -80,7 +77,6 @@ "volume" : 2, "weight" : 16.625, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "esbit", "damage" : 0, @@ -101,7 +97,6 @@ "volume" : 1, "weight" : 54, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "bolt", "damage" : 12, diff --git a/data/mods/More_Survival_Tools/armor.json b/data/mods/More_Survival_Tools/armor.json index 1926d37a02fd5..67d2a792fb6d9 100644 --- a/data/mods/More_Survival_Tools/armor.json +++ b/data/mods/More_Survival_Tools/armor.json @@ -12,7 +12,6 @@ "price" : 1200, "material" : ["cotton", "null"], "volume" : 2, - "cutting" : 0, "warmth" : 10, "phase" : "solid", "environmental_protection" : 2, @@ -36,7 +35,6 @@ "price" : 1500, "material" : ["fur", "null"], "volume" : 2, - "cutting" : 0, "warmth" : 40, "phase" : "solid", "encumbrance" : 3, @@ -58,7 +56,6 @@ "price" : 5000, "material" : ["plastic", "null"], "volume" : 8, - "cutting" : 0, "warmth" : 10, "phase" : "solid", "environmental_protection" : 1, @@ -82,7 +79,6 @@ "price" : 4500, "material" : ["bone", "null"], "volume" : 1, - "cutting" : 0, "warmth" : 5, "phase" : "solid", "encumbrance" : 9, diff --git a/data/mods/More_Survival_Tools/items.json b/data/mods/More_Survival_Tools/items.json index 02193f560aada..67ea41a74586b 100644 --- a/data/mods/More_Survival_Tools/items.json +++ b/data/mods/More_Survival_Tools/items.json @@ -12,7 +12,6 @@ "weight": 1366, "volume": 6, "bashing": 2, - "cutting": 0, "to_hit": -1, "max_charges": 50, "initial_charges": 0, @@ -35,7 +34,6 @@ "weight": 1366, "volume": 6, "bashing": 2, - "cutting": 0, "to_hit": -1, "max_charges": 50, "initial_charges": 0, @@ -91,7 +89,6 @@ "weight": 500, "volume": 2, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 100, "initial_charges": 0, @@ -120,7 +117,6 @@ "weight": 500, "volume": 2, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 100, "initial_charges": 0, @@ -154,7 +150,6 @@ "weight": 200, "volume": 3, "bashing": 4, - "cutting": 0, "to_hit": 1, "material": "steel", "contains": 3, @@ -186,7 +181,6 @@ "material" : "cotton", "tool" : "null", "volume" : 1, - "cutting" : 0, "phase" : "solid", "charges" : 2, "stack_size": 9, @@ -206,7 +200,6 @@ "volume" : 2, "weight" : 574, "bashing" : 14, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "thrown", "damage" : 0, @@ -255,7 +248,6 @@ "weight": 116, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -1, "ranged_damage": 0, "range" : 15, @@ -400,7 +392,6 @@ "weight": 1870, "volume": 7, "bashing": 1, - "cutting": 0, "to_hit": -1, "max_charges": 0, "initial_charges": 0, @@ -432,7 +423,6 @@ "weight": 3617, "volume": 14, "bashing": 2, - "cutting": 0, "to_hit": -1, "max_charges": 0, "initial_charges": 0, @@ -464,7 +454,6 @@ "weight": 5241, "volume": 21, "bashing": 3, - "cutting": 0, "to_hit": -1, "max_charges": 0, "initial_charges": 0, @@ -495,7 +484,6 @@ "weight": 5, "volume": 0, "bashing": -8, - "cutting": 0, "to_hit": -2, "contains": 10, "material": "aluminum", @@ -522,7 +510,6 @@ "material" : ["flesh", "junk"], "tool" : "null", "volume" : 1, - "cutting" : 0, "phase" : "solid", "charges" : 1, "stack_size": 4, @@ -542,7 +529,6 @@ "weight": 180, "volume": 3, "bashing": 2, - "cutting": 0, "to_hit": -1, "max_charges": 50, "initial_charges": 50, @@ -563,7 +549,6 @@ "weight": 13, "volume": 0, "bashing": -2, - "cutting": 0, "to_hit": 1, "material": "plastic", "contains": 2, @@ -581,7 +566,6 @@ "weight": 450, "volume": 3, "bashing": 10, - "cutting": 0, "category" : "tools", "to_hit": 2, "qualities": [["COOK", 2], ["BOIL", 1], ["CONTAIN", 1]] @@ -597,7 +581,6 @@ "weight": 450, "volume": 4, "bashing": 10, - "cutting": 0, "category" : "tools", "to_hit": 1, "qualities": [["COOK", 2], ["BOIL", 1], ["CONTAIN", 1]] @@ -613,7 +596,6 @@ "weight": 884, "volume": 4, "bashing": 10, - "cutting": 0, "category" : "tools", "to_hit": 1, "qualities": [["COOK", 2], ["BOIL", 1], ["CONTAIN", 1]] @@ -629,7 +611,6 @@ "weight": 232, "volume": 7, "bashing": 0, - "cutting": 0, "to_hit": 1, "material": "wood", "contains": 6, @@ -701,7 +682,6 @@ "weight": 1, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": -3, "ammo": "NULL", "revert_to": "null", @@ -739,7 +719,6 @@ "weight": 1632, "volume": 4, "bashing": 3, - "cutting": 0, "to_hit": -4, "max_charges": 0, "initial_charges": 0, From 6a90f55dc8dbca6482d29c16730fb1938ddfc47a Mon Sep 17 00:00:00 2001 From: illi-kun Date: Sat, 26 Dec 2015 05:42:47 +0300 Subject: [PATCH 22/61] clean up Arcana mod --- data/mods/Arcana/ammo.json | 3 --- data/mods/Arcana/books.json | 7 ------- data/mods/Arcana/comestibles.json | 4 ---- data/mods/Arcana/melee.json | 2 -- data/mods/Arcana/ranged.json | 3 --- data/mods/Arcana/tool_armor.json | 9 --------- data/mods/Arcana/tools.json | 25 ------------------------- 7 files changed, 53 deletions(-) diff --git a/data/mods/Arcana/ammo.json b/data/mods/Arcana/ammo.json index 19341e31cb78f..356b02d74142d 100644 --- a/data/mods/Arcana/ammo.json +++ b/data/mods/Arcana/ammo.json @@ -13,7 +13,6 @@ "volume" : 0, "weight" : 0, "bashing" : 0, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "essence_type", "casing" : "NULL", @@ -38,7 +37,6 @@ "volume" : 0, "weight" : 0, "bashing" : 0, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "essence_blood_type", "casing" : "NULL", @@ -63,7 +61,6 @@ "volume" : 0, "weight" : 0, "bashing" : 0, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "essence_dull_type", "casing" : "NULL", diff --git a/data/mods/Arcana/books.json b/data/mods/Arcana/books.json index 417885b127be6..c053ac0cea08a 100644 --- a/data/mods/Arcana/books.json +++ b/data/mods/Arcana/books.json @@ -14,7 +14,6 @@ "material" : ["paper", "null"], "volume" : 2, "bashing" : -2, - "cutting" : 0, "time" : 10, "fun" : -1, "skill" : "magic", @@ -36,7 +35,6 @@ "material" : ["paper", "null"], "volume" : 4, "bashing" : -2, - "cutting" : 0, "time" : 10, "fun" : 0, "skill" : "magic", @@ -59,7 +57,6 @@ "material" : ["paper", "null"], "volume" : 4, "bashing" : -2, - "cutting" : 0, "time" : 40, "fun" : -2, "skill" : "magic", @@ -81,7 +78,6 @@ "material" : ["paper", "null"], "volume" : 4, "bashing" : -2, - "cutting" : 0, "time" : 20, "fun" : -1, "skill" : "magic", @@ -104,7 +100,6 @@ "material" : ["paper", "null"], "volume" : 4, "bashing" : -2, - "cutting" : 0, "time" : 30, "fun" : -3, "skill" : "magic", @@ -127,7 +122,6 @@ "material" : ["paper", "null"], "volume" : 4, "bashing" : -2, - "cutting" : 0, "time" : 20, "fun" : -4, "skill" : "magic", @@ -149,7 +143,6 @@ "material" : ["paper", "null"], "volume" : 4, "bashing" : -2, - "cutting" : 0, "time" : 45, "fun" : -3, "skill" : "magic", diff --git a/data/mods/Arcana/comestibles.json b/data/mods/Arcana/comestibles.json index c402c01ec99de..d1161687c4c7d 100644 --- a/data/mods/Arcana/comestibles.json +++ b/data/mods/Arcana/comestibles.json @@ -12,7 +12,6 @@ "weight": 300, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "comestible_type": "DRINK", "tool": "null", @@ -53,7 +52,6 @@ "weight": 300, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "comestible_type": "DRINK", "tool": "null", @@ -94,7 +92,6 @@ "weight": 300, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "comestible_type": "DRINK", "tool": "null", @@ -135,7 +132,6 @@ "weight": 300, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "comestible_type": "DRINK", "tool": "null", diff --git a/data/mods/Arcana/melee.json b/data/mods/Arcana/melee.json index d59ac0675f1de..c1b8e8df927e6 100644 --- a/data/mods/Arcana/melee.json +++ b/data/mods/Arcana/melee.json @@ -12,7 +12,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3 },{ "type":"GENERIC", @@ -27,7 +26,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0 } ] diff --git a/data/mods/Arcana/ranged.json b/data/mods/Arcana/ranged.json index a45a2c9409ce9..68a736caed149 100644 --- a/data/mods/Arcana/ranged.json +++ b/data/mods/Arcana/ranged.json @@ -50,7 +50,6 @@ "weight": 2800, "volume": 12, "bashing": 19, - "cutting": 0, "to_hit": 3, "ranged_damage": 25, "pierce": 3, @@ -80,7 +79,6 @@ "weight" : 2928, "volume" : 6, "bashing" : 11, - "cutting" : 0, "to_hit" : 1, "ranged_damage" : 25, "pierce" : 50, @@ -144,7 +142,6 @@ "weight": 2800, "volume": 12, "bashing": 19, - "cutting": 0, "to_hit": 3, "ranged_damage": 20, "pierce": 10, diff --git a/data/mods/Arcana/tool_armor.json b/data/mods/Arcana/tool_armor.json index a278cd270f301..970a0eb45c8af 100644 --- a/data/mods/Arcana/tool_armor.json +++ b/data/mods/Arcana/tool_armor.json @@ -13,7 +13,6 @@ "weight": 4120, "volume": 14, "bashing": 0, - "cutting": 0, "to_hit" : -1, "max_charges": 30, "initial_charges": 0, @@ -47,7 +46,6 @@ "weight" : 210, "volume": 4, "bashing": 0, - "cutting": 0, "to_hit" : 0, "max_charges": 12, "initial_charges": 0, @@ -84,7 +82,6 @@ "weight" : 210, "volume": 4, "bashing": 0, - "cutting": 0, "to_hit" : 0, "max_charges": 12, "initial_charges": 0, @@ -122,7 +119,6 @@ "weight": 1954, "volume": 36, "bashing": 2, - "cutting": 0, "to_hit" : -5, "max_charges": 16, "initial_charges": 0, @@ -154,7 +150,6 @@ "weight": 650, "volume": 14, "bashing": 0, - "cutting": 0, "to_hit" : -1, "max_charges": 6, "initial_charges": 0, @@ -198,7 +193,6 @@ "weight": 1616, "volume": 19, "bashing": 0, - "cutting": 0, "to_hit" : -5, "max_charges": 20, "initial_charges": 0, @@ -235,7 +229,6 @@ "weight": 1616, "volume": 19, "bashing": 0, - "cutting": 0, "to_hit" : -5, "max_charges": 20, "initial_charges": 0, @@ -272,7 +265,6 @@ "weight": 1190, "volume": 6, "bashing": 7, - "cutting": 0, "to_hit" : -2, "max_charges": 4, "initial_charges": 0, @@ -325,7 +317,6 @@ "coverage" : 0, "symbol" : "[", "bashing" : 0, - "cutting" : 0, "warmth" : 0, "phase" : "solid", "flags" : ["FANCY"] diff --git a/data/mods/Arcana/tools.json b/data/mods/Arcana/tools.json index 3f917e91a657e..05d1be71d66f0 100644 --- a/data/mods/Arcana/tools.json +++ b/data/mods/Arcana/tools.json @@ -11,7 +11,6 @@ "weight": 2500, "volume": 4, "bashing": 6, - "cutting": 0, "to_hit": -1, "max_charges": 0, "initial_charges": 0, @@ -41,7 +40,6 @@ "weight": 2500, "volume": 4, "bashing": 6, - "cutting": 0, "to_hit": -1, "max_charges": 0, "initial_charges": 0, @@ -71,7 +69,6 @@ "weight": 2500, "volume": 4, "bashing": 6, - "cutting": 0, "to_hit": -1, "max_charges": 0, "initial_charges": 0, @@ -335,7 +332,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3, "max_charges": 0, "initial_charges": 0, @@ -367,7 +363,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3, "max_charges": 0, "initial_charges": 0, @@ -399,7 +394,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3, "max_charges": 0, "initial_charges": 0, @@ -431,7 +425,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3, "max_charges": 0, "initial_charges": 0, @@ -463,7 +456,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3, "max_charges": 0, "initial_charges": 0, @@ -495,7 +487,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3, "max_charges": 0, "initial_charges": 0, @@ -527,7 +518,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3, "max_charges": 0, "initial_charges": 0, @@ -559,7 +549,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3, "max_charges": 0, "initial_charges": 0, @@ -591,7 +580,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3, "max_charges": 0, "initial_charges": 0, @@ -623,7 +611,6 @@ "weight": 285, "volume": 1, "bashing": 1, - "cutting": 0, "to_hit": -3, "max_charges": 0, "initial_charges": 0, @@ -723,7 +710,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -751,7 +737,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -777,7 +762,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -805,7 +789,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -831,7 +814,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -859,7 +841,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -885,7 +866,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -913,7 +893,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -939,7 +918,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -967,7 +945,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -993,7 +970,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, @@ -1021,7 +997,6 @@ "weight": 415, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "max_charges": 0, "initial_charges": 0, From 07b8f83917d044e7d7db684b806d17f592ee2d0b Mon Sep 17 00:00:00 2001 From: illi-kun Date: Sat, 26 Dec 2015 05:48:05 +0300 Subject: [PATCH 23/61] clean up Boats mod --- data/mods/Boats/b_items.json | 1 - data/mods/Boats/b_var_veh_parts.json | 3 --- data/mods/Boats/b_var_wood_veh_parts.json | 1 - 3 files changed, 5 deletions(-) diff --git a/data/mods/Boats/b_items.json b/data/mods/Boats/b_items.json index 777b7f84fb933..fe52d09c54c4d 100644 --- a/data/mods/Boats/b_items.json +++ b/data/mods/Boats/b_items.json @@ -11,7 +11,6 @@ "weight": 9071, "volume": 86, "bashing": 10, - "cutting": 0, "to_hit": -5, "max_charges": 0, "initial_charges": 0, diff --git a/data/mods/Boats/b_var_veh_parts.json b/data/mods/Boats/b_var_veh_parts.json index dd7fbf1be6f64..0fa9a46c591e7 100644 --- a/data/mods/Boats/b_var_veh_parts.json +++ b/data/mods/Boats/b_var_veh_parts.json @@ -12,7 +12,6 @@ "weight": 3000, "volume": 50, "bashing": 8, - "cutting": 0, "to_hit": -1, "min-bigness": 30, "max-bigness": 30, @@ -31,7 +30,6 @@ "material" : ["wood", "null"], "volume" : 2, "bashing" : 10, - "cutting" : 0, "category" : "veh_parts", "price" : 9000 },{ @@ -47,7 +45,6 @@ "weight": 3000, "volume": 50, "bashing": 8, - "cutting": 0, "to_hit": -1, "min-bigness": 30, "max-bigness": 30, diff --git a/data/mods/Boats/b_var_wood_veh_parts.json b/data/mods/Boats/b_var_wood_veh_parts.json index 721ff038347cb..9c0766e6d0ce5 100644 --- a/data/mods/Boats/b_var_wood_veh_parts.json +++ b/data/mods/Boats/b_var_wood_veh_parts.json @@ -12,7 +12,6 @@ "weight": 3000, "volume": 50, "bashing": 8, - "cutting": 0, "to_hit": -1, "min-bigness": 30, "max-bigness": 30, From 86a19123b9779d40d8083713f7a207f18bb8339d Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sat, 26 Dec 2015 04:07:08 +0100 Subject: [PATCH 24/61] Allow adding effects and used up items --- data/json/items/comestibles.json | 53 +++++++++++++++++++++++++++-- data/json/items/tools.json | 3 +- src/iuse_actor.cpp | 58 ++++++++++++++++++++++++++------ src/iuse_actor.h | 14 +++++--- 4 files changed, 109 insertions(+), 19 deletions(-) diff --git a/data/json/items/comestibles.json b/data/json/items/comestibles.json index 484b9941a15a5..c6ae91d0b4529 100644 --- a/data/json/items/comestibles.json +++ b/data/json/items/comestibles.json @@ -13524,7 +13524,13 @@ "bite" : 0.99, "infect" : 0.95, "move_cost" : 6000, - "long_action" : true + "long_action" : true, + "effects" : [ + { + "id": "pkill1", + "duration": 120 + } + ] } }, { @@ -20560,7 +20566,7 @@ "fruit": "mushroom_magic", "grow" : 91 } -},{ + },{ "type" : "COMESTIBLE", "id" : "seed_mushroom_poison", "category": "other", @@ -20588,5 +20594,46 @@ "fruit": "mushroom_poison", "grow" : 91 } -} + },{ + "type" : "COMESTIBLE", + "id" : "chloroform_rag", + "name" : "chloroform soaked rag", + "weight" : 240, + "color" : "red", + "addiction_type" : "none", + "spoils_in" : 0, + "stim" : 0, + "container" : "null", + "to_hit" : 0, + "comestible_type" : "MED", + "symbol" : "!", + "quench" : 0, + "healthy" : 0, + "addiction_potential" : 0, + "nutrition" : 0, + "description" : "A debug item that lets you put NPCs (or yourself) to sleep.", + "price" : 3000, + "material" : "cotton", + "tool" : "null", + "volume" : 1, + "cutting" : 0, + "phase" : "solid", + "charges" : 1, + "stack_size" : 1, + "bashing" : 0, + "flags" : ["USE_ON_NPC"], + "fun" : 0, + "use_action" : { + "type" : "heal", + "limb_power" : 1, + "move_cost" : 100, + "effects" : [ + { + "id": "sleep", + "duration": 1000 + } + ], + "used_up_item" : "rag" + } + } ] diff --git a/data/json/items/tools.json b/data/json/items/tools.json index 5688b545d7325..fbe3429a2126a 100644 --- a/data/json/items/tools.json +++ b/data/json/items/tools.json @@ -6745,7 +6745,8 @@ "type" : "heal", "limb_power" : 0, "bleed" : 0.5, - "move_cost" : 200 + "move_cost" : 200, + "used_up_item" : "rag_bloody" } }, diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index 400467eec7ae0..0e2e11c418159 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -347,6 +347,12 @@ iuse_actor *consume_drug_iuse::clone() const return new consume_drug_iuse(*this); } +static effect_data load_effect_data( JsonObject &e ) +{ + return effect_data( e.get_string( "id", "null" ), e.get_int( "duration", 0 ), + get_body_part_token( e.get_string( "bp", "NUM_BP" ) ), e.get_bool( "permanent", false ) ); +} + void consume_drug_iuse::load( JsonObject &obj ) { obj.read( "activation_message", activation_message ); @@ -357,9 +363,7 @@ void consume_drug_iuse::load( JsonObject &obj ) JsonArray jsarr = obj.get_array( "effects" ); while( jsarr.has_more() ) { JsonObject e = jsarr.next_object(); - effect_data new_eff( e.get_string( "id", "null" ), e.get_int( "duration", 0 ), - get_body_part_token( e.get_string( "bp", "NUM_BP" ) ), e.get_bool( "permanent", false ) ); - effects.push_back( new_eff ); + effects.push_back( load_effect_data( e ) ); } } obj.read( "stat_adjustments", stat_adjustments ); @@ -2224,6 +2228,16 @@ void heal_actor::load( JsonObject &obj ) infect = obj.get_float( "infect", 0.0f ); long_action = obj.get_bool( "long_action", false ); + + if( obj.has_array( "effects" ) ) { + JsonArray jsarr = obj.get_array( "effects" ); + while( jsarr.has_more() ) { + JsonObject e = jsarr.next_object(); + effects.push_back( load_effect_data( e ) ); + } + } + + used_up_item = obj.get_string( "used_up_item", used_up_item ); } player &get_patient( player &healer, const tripoint &pos ) @@ -2259,18 +2273,23 @@ long heal_actor::use( player *p, item *it, bool, const tripoint &pos ) const return 0; } - // For now make "long healing" instant when used on somebody else + int cost = move_cost; + if( long_action ) { + // A hack: long action healing on NPCs isn't done yet. + // So just heal at start and paralyze the player for 5 minutes. + cost /= (p->skillLevel( skill_firstaid ) + 1); + } + if( long_action && &patient == p ) { // Assign first aid long action. ///\EFFECT_FIRSTAID speeds up firstaid activity - const int action_moves = move_cost / (p->skillLevel( skill_firstaid ) + 1); - p->assign_activity( ACT_FIRSTAID, action_moves, 0, p->get_item_position( it ), it->tname() ); + p->assign_activity( ACT_FIRSTAID, cost, 0, p->get_item_position( it ), it->tname() ); p->activity.values.push_back( hpp ); p->moves = 0; return 0; } - p->moves -= move_cost; + p->moves -= cost; p->add_msg_if_player(m_good, _("You use your %s."), it->tname().c_str()); return it->type->charges_to_use(); } @@ -2304,7 +2323,7 @@ int heal_actor::get_heal_value( const player &healer, hp_part healed ) const return heal_base; } -long heal_actor::finish_using( player &healer, player &patient, const item &it, hp_part healed ) const +long heal_actor::finish_using( player &healer, player &patient, item &it, hp_part healed ) const { healer.practice( skill_firstaid, 8 ); const int dam = get_heal_value( healer, healed ); @@ -2365,8 +2384,25 @@ long heal_actor::finish_using( player &healer, player &patient, const item &it, if( long_action ) { healer.add_msg_if_player( _("You finish using the %s."), it.tname().c_str() ); - // TODO: jsonize this effect - patient.add_effect( "pkill1", 120 ); + } + + for( auto eff : effects ) { + if( eff.id == "null" ) { + continue; + } + + patient.add_effect( eff.id, eff.duration, eff.bp, eff.permanent ); + } + + if( !used_up_item.empty() ) { + // If the item is a tool, `make` it the new form + // Otherwise it probably was consumed, so create a new one + if( it.is_tool() ) { + it.make( used_up_item ); + } else { + item used_up( used_up_item, it.bday ); + healer.i_add_or_drop( used_up ); + } } return it.type->charges_to_use(); @@ -2424,7 +2460,7 @@ hp_part pick_part_to_heal( return num_hp_parts; } -hp_part heal_actor::use_healing_item( player &healer, player &patient, const item &it, bool force ) const +hp_part heal_actor::use_healing_item( player &healer, player &patient, item &it, bool force ) const { hp_part healed = num_hp_parts; const int head_bonus = get_heal_value( healer, hp_head ); diff --git a/src/iuse_actor.h b/src/iuse_actor.h index 9806ea74dd7ce..7c47e43bd3dbb 100644 --- a/src/iuse_actor.h +++ b/src/iuse_actor.h @@ -695,16 +695,22 @@ class heal_actor : public iuse_actor bool long_action; /** Scales extra healed hp gained from first aid skill. */ float bonus_scaling; + /** Effects to apply to patient on finished healing. */ + std::vector effects; + /** + * Item produced on finished healing. For example, bloody rag. + * If the used item is a tool it, it will be turned into the used up item. + * If it is not a tool a new item with this id will be created. + */ + std::string used_up_item; /** How much hp would `healer` heal using this actor on `healed` body part. */ int get_heal_value( const player &healer, hp_part healed ) const; /** Does the actual healing. Used by both long and short actions. Returns charges used. */ - long finish_using( player &healer, player &patient, const item &it, hp_part part ) const; + long finish_using( player &healer, player &patient, item &it, hp_part part ) const; - hp_part use_healing_item( - player &healer, player &patient, - const item &it, bool force ) const; + hp_part use_healing_item( player &healer, player &patient, item &it, bool force ) const; heal_actor() : iuse_actor() From 306f992708ed50da4ab83097450b510311c94f77 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Fri, 25 Dec 2015 22:12:42 -0800 Subject: [PATCH 25/61] fixed --- data/json/recipes/recipe_food.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/data/json/recipes/recipe_food.json b/data/json/recipes/recipe_food.json index 808840ff4a47a..d6457249c924a 100644 --- a/data/json/recipes/recipe_food.json +++ b/data/json/recipes/recipe_food.json @@ -5654,10 +5654,9 @@ "type" : "recipe", "result": "choco_coffee_beans", "category": "CC_FOOD", - "subcategory": "CSC_FOOD_OTHER", + "subcategory": "CSC_FOOD_SNACK", "skill_used": "cooking", "difficulty": 1, - "result_mult": 5, "time": 6000, "reversible": false, "autolearn": true, @@ -5673,7 +5672,7 @@ ], "components": [ [ - [ "roasted_coffee_bean", 5 ] + [ "roasted_coffee_bean", 1 ] ], [ [ "chocolate", 1 ] @@ -5683,10 +5682,9 @@ "type" : "recipe", "result": "chocpretzels", "category": "CC_FOOD", - "subcategory": "CSC_FOOD_OTHER", + "subcategory": "CSC_FOOD_SNACK", "skill_used": "cooking", "difficulty": 1, - "result_mult": 3, "time": 6000, "reversible": false, "autolearn": true, From 6d0313ae0fc1771e08979ccba3379339e38c2222 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Fri, 25 Dec 2015 23:08:40 -0800 Subject: [PATCH 26/61] tweak --- data/json/recipes/recipe_food.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/json/recipes/recipe_food.json b/data/json/recipes/recipe_food.json index d6457249c924a..f8b777f0453f1 100644 --- a/data/json/recipes/recipe_food.json +++ b/data/json/recipes/recipe_food.json @@ -5657,6 +5657,7 @@ "subcategory": "CSC_FOOD_SNACK", "skill_used": "cooking", "difficulty": 1, + "result_mult": 2, "time": 6000, "reversible": false, "autolearn": true, @@ -5685,6 +5686,7 @@ "subcategory": "CSC_FOOD_SNACK", "skill_used": "cooking", "difficulty": 1, + "result_mult": 2, "time": 6000, "reversible": false, "autolearn": true, @@ -5700,7 +5702,7 @@ ], "components": [ [ - [ "pretzels", 3 ] + [ "pretzels", 6 ] ], [ [ "chocolate", 1 ] From 93d6169c1de1765f8d95286f9b70fa5fa9306d89 Mon Sep 17 00:00:00 2001 From: illi-kun Date: Sat, 26 Dec 2015 13:30:51 +0300 Subject: [PATCH 27/61] Clean up more mods --- data/mods/Craft_Gunpowder/cgp_ranged.json | 9 --------- data/mods/NW_Pack/nw_books.json | 1 - data/mods/NW_Pack/nw_melee.json | 1 - data/mods/Tanks/items.json | 24 ----------------------- data/mods/necromancy/necronimicron.json | 5 ----- 5 files changed, 40 deletions(-) diff --git a/data/mods/Craft_Gunpowder/cgp_ranged.json b/data/mods/Craft_Gunpowder/cgp_ranged.json index 92449a2d4c077..a0a4cc211a21a 100644 --- a/data/mods/Craft_Gunpowder/cgp_ranged.json +++ b/data/mods/Craft_Gunpowder/cgp_ranged.json @@ -15,7 +15,6 @@ "weight": 2114, "volume": 8, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": -2, "dispersion": 105, @@ -44,7 +43,6 @@ "weight": 2114, "volume": 8, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": -2, "dispersion": 105, @@ -73,7 +71,6 @@ "weight": 2114, "volume": 8, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": -2, "dispersion": 105, @@ -102,7 +99,6 @@ "weight": 2114, "volume": 8, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": -2, "dispersion": 105, @@ -130,7 +126,6 @@ "weight": 3274, "volume": 7, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": -2, "dispersion": 210, @@ -159,7 +154,6 @@ "weight": 3274, "volume": 7, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": -3, "dispersion": 210, @@ -188,7 +182,6 @@ "weight": 3274, "volume": 7, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": -3, "dispersion": 210, @@ -217,7 +210,6 @@ "weight": 3274, "volume": 7, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": -4, "dispersion": 210, @@ -246,7 +238,6 @@ "weight": 3274, "volume": 7, "bashing": 10, - "cutting": 0, "to_hit": -1, "ranged_damage": -4, "dispersion": 210, diff --git a/data/mods/NW_Pack/nw_books.json b/data/mods/NW_Pack/nw_books.json index cd9b42ec32866..05b5a226687c5 100644 --- a/data/mods/NW_Pack/nw_books.json +++ b/data/mods/NW_Pack/nw_books.json @@ -14,7 +14,6 @@ "material" : ["paper", "null"], "volume" : 5, "bashing" : -2, - "cutting" : 0, "time" : 60, "fun" : 0, "skill" : "fabrication", diff --git a/data/mods/NW_Pack/nw_melee.json b/data/mods/NW_Pack/nw_melee.json index 80f4b1f72dcb3..5cecad01058dc 100644 --- a/data/mods/NW_Pack/nw_melee.json +++ b/data/mods/NW_Pack/nw_melee.json @@ -13,7 +13,6 @@ "flags" : ["DURABLE_MELEE"], "volume" : 5, "bashing" : 37, - "cutting" : 0, "price" : 160000, "qualities": [["HAMMER", 1]] }, diff --git a/data/mods/Tanks/items.json b/data/mods/Tanks/items.json index f6a43fe01917a..26bb161cea95b 100644 --- a/data/mods/Tanks/items.json +++ b/data/mods/Tanks/items.json @@ -12,7 +12,6 @@ "volume" : 5, "weight" : 220, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "30mm", "casing" : "30mm_casing", @@ -36,7 +35,6 @@ "volume" : 5, "weight" : 220, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "30mm", "casing" : "30mm_casing", @@ -60,7 +58,6 @@ "volume" : 5, "weight" : 240, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "30mm", "casing" : "30mm_casing", @@ -83,7 +80,6 @@ "volume" : 10, "weight" : 3000, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "120mm_usable", "casing" : "120mm_casing", @@ -106,7 +102,6 @@ "volume" : 10, "weight" : 3600, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "120mm_usable", "casing" : "120mm_casing", @@ -129,7 +124,6 @@ "volume" : 10, "weight" : 3200, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "120mm_usable", "casing" : "120mm_casing", @@ -152,7 +146,6 @@ "volume" : 10, "weight" : 3200, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "120mm_usable", "casing" : "120mm_casing", @@ -175,7 +168,6 @@ "volume" : 15, "weight" : 4000, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "155mm", "casing" : "155mm_casing", @@ -198,7 +190,6 @@ "volume" : 15, "weight" : 4200, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "155mm", "casing" : "155mm_casing", @@ -221,7 +212,6 @@ "volume" : 15, "weight" : 4300, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "155mm", "casing" : "155mm_casing", @@ -244,7 +234,6 @@ "volume" : 5, "weight" : 3300, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "atgm", "damage" : 800, @@ -267,7 +256,6 @@ "volume" : 5, "weight" : 20, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "components", "damage" : 0, @@ -288,7 +276,6 @@ "volume" : 10, "weight" : 300, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "components", "damage" : 0, @@ -309,7 +296,6 @@ "volume" : 15, "weight" : 400, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "components", "damage" : 0, @@ -330,7 +316,6 @@ "volume" : 1, "weight" : 5, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "components", "damage" : 0, @@ -352,7 +337,6 @@ "volume" : 1, "weight" : 5, "bashing" : 1, - "cutting" : 0, "to_hit" : 0, "ammo_type" : "components", "damage" : 0, @@ -376,7 +360,6 @@ "weight": 55900, "volume": 30, "bashing": 12, - "cutting": 0, "to_hit": -1, "ranged_damage": 0, "dispersion": 0, @@ -403,7 +386,6 @@ "weight": 119000, "volume": 35, "bashing": 12, - "cutting": 0, "to_hit": -6, "range": 45, "dispersion": 0, @@ -428,7 +410,6 @@ "weight": 331700, "volume": 40, "bashing": 12, - "cutting": 0, "to_hit": -6, "range": 30, "dispersion": 20, @@ -453,7 +434,6 @@ "weight": 341700, "volume": 45, "bashing": 12, - "cutting": 0, "to_hit": -6, "range": 15, "dispersion": 25, @@ -479,7 +459,6 @@ "weight": 351700, "volume": 40, "bashing": 13, - "cutting": 0, "to_hit": -6, "range": 45, "dispersion": 10, @@ -505,7 +484,6 @@ "weight": 25844, "volume": 35, "bashing": 12, - "cutting": 0, "to_hit": -6, "range": 15, "dispersion": 100, @@ -530,7 +508,6 @@ "weight": 30844, "volume": 40, "bashing": 12, - "cutting": 0, "to_hit": -6, "dispersion": 0, "sight_dispersion": 20, @@ -555,7 +532,6 @@ "material" : ["paper", "null"], "volume" : 4, "bashing" : 8, - "cutting" : 0, "time" : 30, "fun" : 0, "skill" : "launcher", diff --git a/data/mods/necromancy/necronimicron.json b/data/mods/necromancy/necronimicron.json index fce208814df9b..5481a7f321370 100644 --- a/data/mods/necromancy/necronimicron.json +++ b/data/mods/necromancy/necronimicron.json @@ -11,7 +11,6 @@ "weight": 100, "volume": 0, "bashing": 0, - "cutting": 0, "to_hit": 0, "initial_charges": 0, "charges_per_use": 0, @@ -33,7 +32,6 @@ "weight": 1000, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "initial_charges": 0, "charges_per_use": 0, @@ -64,7 +62,6 @@ "weight": 10000, "volume": 15, "bashing": 0, - "cutting": 0, "to_hit": 0, "initial_charges": 0, "charges_per_use": 0, @@ -107,7 +104,6 @@ "weight": 1, "volume": 1, "bashing": 0, - "cutting": 0, "to_hit": 0, "tool" : "syringe", "category": "drugs" @@ -125,7 +121,6 @@ "material" : ["paper", "null"], "volume" : 5, "bashing" : -2, - "cutting" : 0, "time" : 120, "fun" : -3, "skill" : "firstaid", From 0c574ff19c9f27c5f665d4c7977addefd6212ef1 Mon Sep 17 00:00:00 2001 From: Mugling Date: Sat, 26 Dec 2015 14:52:43 +0000 Subject: [PATCH 28/61] Remove effective no-op in player::fire_gun --- src/ranged.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ranged.cpp b/src/ranged.cpp index 519a87318de87..9ee4fd9023819 100644 --- a/src/ranged.cpp +++ b/src/ranged.cpp @@ -468,10 +468,6 @@ void player::fire_gun( const tripoint &targ_arg, bool burst ) } if (curshot > 0) { - // TODO: or should use the recoil of the whole gun, not just the auxiliary gunmod? - if (recoil_add(*this, *used_weapon) % 2 == 1) { - recoil++; - } recoil += recoil_add(*this, *used_weapon) / (has_effect( "on_roof" ) ? 90 : 2); } else { recoil += recoil_add(*this, *used_weapon) / (has_effect( "on_roof" ) ? 30 : 1); From 628f782dd8f7de403457bb55b80af97d09c30f24 Mon Sep 17 00:00:00 2001 From: Mugling Date: Sat, 26 Dec 2015 14:57:55 +0000 Subject: [PATCH 29/61] Simplify consumption of UPS in player::fire_gun --- src/ranged.cpp | 45 ++++++++++++--------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/src/ranged.cpp b/src/ranged.cpp index 519a87318de87..eacf6a3294bff 100644 --- a/src/ranged.cpp +++ b/src/ranged.cpp @@ -364,32 +364,15 @@ void player::fire_gun( const tripoint &targ_arg, bool burst ) num_shots = std::min( num_shots, used_weapon->ammo_remaining() ); } - int ups_drain = 0; - int adv_ups_drain = 0; - int bio_power_drain = 0; - if( used_weapon->get_gun_ups_drain() > 0 ) { - ups_drain = used_weapon->get_gun_ups_drain(); - adv_ups_drain = std::max( 1, ups_drain * 3 / 5 ); - bio_power_drain = std::max( 1, ups_drain / 5 ); - } - - // Fake UPS - used for vehicle mounted turrets - int fake_ups_drain = 0; - if( ups_drain > 0 && !worn.empty() && worn.back().type->id == "fake_UPS" ) { - num_shots = std::min( num_shots, worn.back().charges / ups_drain ); - fake_ups_drain = ups_drain; - ups_drain = 0; - adv_ups_drain = 0; - bio_power_drain = 0; - } - // cap our maximum burst size by the amount of UPS power left - if( ups_drain > 0 || adv_ups_drain > 0 || bio_power_drain > 0 ) - while( !(has_charges( "UPS_off", ups_drain * num_shots) || - has_charges( "adv_UPS_off", adv_ups_drain * num_shots ) || - (has_bionic( "bio_ups" ) && power_level >= bio_power_drain * num_shots)) ) { - num_shots--; + if( used_weapon->get_gun_ups_drain() > 0 ) { + // @todo refactor handling of vehicle turrets to separate function + if( !worn.empty() && worn.back().type->id == "fake_UPS" ) { + num_shots = std::min(num_shots, worn.back().charges / used_weapon->get_gun_ups_drain() ); + } else { + num_shots = std::min(num_shots, charges_of( "UPS" ) / used_weapon->get_gun_ups_drain() ); } + } // This is expensive, let's cache. todo: figure out if we need weapon.range(&p); const int weaponrange = used_weapon->gun_range( this ); @@ -501,15 +484,11 @@ void player::fire_gun( const tripoint &targ_arg, bool burst ) } } - // Drain UPS power - if( fake_ups_drain > 0 ) { - use_charges( "fake_UPS", fake_ups_drain ); - } else if( has_charges("adv_UPS_off", adv_ups_drain ) ) { - use_charges( "adv_UPS_off", adv_ups_drain ); - } else if( has_charges("UPS_off", ups_drain ) ) { - use_charges( "UPS_off", ups_drain ); - } else if( has_bionic("bio_ups" ) ) { - charge_power( -1 * bio_power_drain ); + // @todo refactor handling of vehicle turrets to separate function + if ( !worn.empty() && worn.back().type->id == "fake_UPS" ) { + use_charges( "fake_UPS", used_weapon->get_gun_ups_drain() ); + } else { + use_charges( "UPS", used_weapon->get_gun_ups_drain() ); } // Experience gain is limited by range and penalised proportional to inaccuracy. From 6325a7b837575fcbaaadd251a2707cdda21243d7 Mon Sep 17 00:00:00 2001 From: Mugling Date: Sat, 26 Dec 2015 15:43:32 +0000 Subject: [PATCH 30/61] Check mods before base item in player::rate_action_reload Fixes #14603 --- src/player.cpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/player.cpp b/src/player.cpp index ad2787a531633..1775604cc9756 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -11270,31 +11270,28 @@ void player::use_wielded() { hint_rating player::rate_action_reload( const item &it ) const { - if( it.ammo_capacity() <= 0 || it.ammo_type() == "NULL" ) { - return HINT_CANT; - } - - if( it.has_flag("NO_RELOAD") || it.has_flag("RELOAD_AND_SHOOT") ) { - return HINT_CANT; - } - - if ( it.ammo_remaining() < it.ammo_capacity() ) { - return HINT_GOOD; - } - + // Guns may contain additional reloadable mods so check these first if( it.is_gun() ) { for( const auto& mod : it.contents ) { // @todo deprecate spare magazine - if( mod.typeId() == "spare_mag" && mod.charges < it.ammo_capacity() ) { - return HINT_GOOD; + if( mod.typeId() == "spare_mag" ) { + return mod.charges < it.ammo_capacity() ? HINT_GOOD : HINT_IFFY; } - if (mod.is_auxiliary_gunmod() && mod.ammo_remaining() < mod.ammo_capacity() ) { - return HINT_GOOD; + if (mod.is_auxiliary_gunmod() ) { + return mod.ammo_remaining() < mod.ammo_capacity() ? HINT_GOOD : HINT_IFFY; } } } - return HINT_IFFY; + // Now check the base item + if( it.ammo_capacity() <= 0 || + it.ammo_type() == "NULL" || + it.has_flag( "NO_RELOAD" ) || + it.has_flag( "RELOAD_AND_SHOOT" ) ) { + return HINT_CANT; + } + + return it.ammo_remaining() < it.ammo_capacity() ? HINT_GOOD : HINT_IFFY; } hint_rating player::rate_action_unload( const item &it ) const From 6eb37baff8391a1a549ea352aefb05e84742e2f3 Mon Sep 17 00:00:00 2001 From: Mugling Date: Sat, 26 Dec 2015 16:15:01 +0000 Subject: [PATCH 31/61] Apply similar relodable checks to gunmods as base item --- src/player.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/player.cpp b/src/player.cpp index 1775604cc9756..2d0fbdc2deabe 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -11273,12 +11273,19 @@ hint_rating player::rate_action_reload( const item &it ) const // Guns may contain additional reloadable mods so check these first if( it.is_gun() ) { for( const auto& mod : it.contents ) { + if( mod.ammo_capacity() <= 0 || + mod.ammo_type() == "NULL" || + mod.has_flag( "NO_RELOAD" ) || + mod.has_flag( "RELOAD_AND_SHOOT" ) ) { + continue; + } + // @todo deprecate spare magazine - if( mod.typeId() == "spare_mag" ) { - return mod.charges < it.ammo_capacity() ? HINT_GOOD : HINT_IFFY; + if( mod.typeId() == "spare_mag" && mod.charges < it.ammo_capacity() ) { + return HINT_GOOD; } - if (mod.is_auxiliary_gunmod() ) { - return mod.ammo_remaining() < mod.ammo_capacity() ? HINT_GOOD : HINT_IFFY; + if (mod.is_auxiliary_gunmod() && mod.ammo_remaining() < mod.ammo_capacity() ) { + return HINT_GOOD; } } } From c9823aba01172d3b5042e544d0bf584a0ab0a874 Mon Sep 17 00:00:00 2001 From: Mugling Date: Sat, 26 Dec 2015 18:49:27 +0000 Subject: [PATCH 32/61] Allow heating of adjacent items --- src/iuse.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/iuse.cpp b/src/iuse.cpp index c4e782885e0d2..68188b4315dbe 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -6100,15 +6100,17 @@ int iuse::handle_ground_graffiti(player *p, item *it, const std::string prefix) */ static bool heat_item(player *p) { - int inventory_index = g->inv_for_filter( _("Heat up what?"), []( const item & itm ) { + auto loc = g->inv_map_splice( []( const item & itm ) { return (itm.is_food() && itm.has_flag("EATEN_HOT")) || (itm.is_food_container() && itm.contents[0].has_flag("EATEN_HOT")); - } ); - item *heat = &( p->i_at(inventory_index ) ); - if (heat->type->id == "null") { + }, _( "Heat up what?" ), 1 ); + + item *heat = loc.get_item(); + if( heat == nullptr ) { add_msg(m_info, _("You do not have that item!")); return false; } + item *target = heat->is_food_container() ? &(heat->contents[0]) : heat; if ((target->is_food()) && (target->has_flag("EATEN_HOT"))) { p->moves -= 300; From bdf306b9e3e2b6d3a681cba0694374fde140d31c Mon Sep 17 00:00:00 2001 From: Mugling Date: Sat, 26 Dec 2015 18:56:50 +0000 Subject: [PATCH 33/61] Allow purifying of adjacent water --- src/iuse.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/iuse.cpp b/src/iuse.cpp index 68188b4315dbe..c2deb64d62a66 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -3117,20 +3117,23 @@ static int cauterize_elec(player *p, item *it) int iuse::water_purifier(player *p, item *it, bool, const tripoint& ) { - int pos = g->inv_for_filter( _("Purify what?"), []( const item & itm ) { + auto loc = g->inv_map_splice( []( const item & itm ) { return !itm.contents.empty() && ( itm.contents[0].type->id == "water" || itm.contents[0].type->id == "salt_water" ); - } ); - if (!p->has_item(pos)) { + }, _( "Purify what?" ), 1 ); + + item *target = loc.get_item(); + if( target == nullptr ) { p->add_msg_if_player(m_info, _("You do not have that item!")); return 0; } - if (p->i_at(pos).contents.empty()) { + if( target->contents.empty() ) { p->add_msg_if_player(m_info, _("You can only purify water.")); return 0; } - item *pure = &(p->i_at(pos).contents[0]); + + item *pure = &target->contents[0]; if (pure->type->id != "water" && pure->type->id != "salt_water") { p->add_msg_if_player(m_info, _("You can only purify water.")); return 0; @@ -3140,6 +3143,7 @@ int iuse::water_purifier(player *p, item *it, bool, const tripoint& ) _("You don't have enough charges in your purifier to purify all of the water.")); return 0; } + p->moves -= 150; pure->make("water_clean"); pure->poison = 0; From 6370101c08e911f1233154589160b944040f2a60 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Sat, 26 Dec 2015 14:53:14 -0800 Subject: [PATCH 34/61] Update JSON_FLAGS.md --- doc/JSON_FLAGS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/JSON_FLAGS.md b/doc/JSON_FLAGS.md index b0e4bd275b183..1e3b024bfcdb2 100755 --- a/doc/JSON_FLAGS.md +++ b/doc/JSON_FLAGS.md @@ -739,7 +739,7 @@ Some armor flags, such as `WATCH` and `ALARMCLOCK` are compatible with other ite - ```USE_EAT_VERB``` "You drink your %s." or "You eat your %s." - ```FERTILIZER``` Works as fertilizer for farming. - ```LENS``` Lens items can make fires via focusing light rays. -- ```ZOOM``` Zoom items can increase your sight range. +- ```ZOOM``` Zoom items can increase your overmap sight range. - ```FIRE_DRILL``` Item will start fires in the primitive way. - ```MUTAGEN_STRONG``` Chance of mutating several times. - ```MUTAGEN_WEAK``` Causes generic mutation (with less chance to mutate than `MUTAGEN_STRONG`). From 196996b191e89cb4ce8e29eb0e2c53eef500e060 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Sat, 26 Dec 2015 15:11:31 -0800 Subject: [PATCH 35/61] Update player.cpp --- src/player.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/player.cpp b/src/player.cpp index 60aa4cf81215e..168dbdcf135e8 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -4168,28 +4168,28 @@ int player::overmap_sight_range(int light_level) const if( sight <= SEEX * 4) { return (sight / (SEEX / 2) ); } - if ((has_item_with_flag("ZOOM")) && - !has_trait("EAGLEEYED")) { - if (has_trait("BIRD_EYE")) { + if (has_item_with_flag("ZOOM") && + !has_trait("EAGLEEYED") ) { + if (has_trait("BIRD_EYE") ) { return 25; } return 20; } - else if ((has_item_with_flag("ZOOM")) && - has_trait("EAGLEEYED")) { - if (has_trait("BIRD_EYE")) { + else if (!has_item_with_flag("ZOOM") && + has_trait("EAGLEEYED") ) { + if (has_trait("BIRD_EYE") ) { return 25; } return 20; } - else if ((has_item_with_flag("ZOOM")) && - has_trait("EAGLEEYED")) { - if (has_trait("BIRD_EYE")) { + else if (has_item_with_flag("ZOOM") && + has_trait("EAGLEEYED") ) { + if (has_trait("BIRD_EYE") ) { return 30; } return 25; } - else if (has_trait("BIRD_EYE")) { + else if (has_trait("BIRD_EYE") ) { return 15; } return 10; From b4bea587c0bf3cf2a9ee4d49fdbd3c90fb591beb Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Sat, 26 Dec 2015 15:17:38 -0800 Subject: [PATCH 36/61] Update player.cpp --- src/player.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/player.cpp b/src/player.cpp index 168dbdcf135e8..c877da52e35dd 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -4168,28 +4168,28 @@ int player::overmap_sight_range(int light_level) const if( sight <= SEEX * 4) { return (sight / (SEEX / 2) ); } - if (has_item_with_flag("ZOOM") && - !has_trait("EAGLEEYED") ) { - if (has_trait("BIRD_EYE") ) { + if ( has_item_with_flag( "ZOOM" ) && + !has_trait( "EAGLEEYED" ) ) { + if ( has_trait( "BIRD_EYE" ) ) { return 25; } return 20; } - else if (!has_item_with_flag("ZOOM") && - has_trait("EAGLEEYED") ) { - if (has_trait("BIRD_EYE") ) { + else if ( !has_item_with_flag( "ZOOM" ) && + has_trait( "EAGLEEYED" ) ) { + if ( has_trait( "BIRD_EYE" ) ) { return 25; } return 20; } - else if (has_item_with_flag("ZOOM") && - has_trait("EAGLEEYED") ) { - if (has_trait("BIRD_EYE") ) { + else if ( has_item_with_flag( "ZOOM" ) && + has_trait( "EAGLEEYED" ) ) { + if ( has_trait( "BIRD_EYE" ) ) { return 30; } return 25; } - else if (has_trait("BIRD_EYE") ) { + else if ( has_trait( "BIRD_EYE" ) ) { return 15; } return 10; From 86f1c4380f7ddb128e70602dc72441ac0df55481 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sun, 27 Dec 2015 07:22:56 +0100 Subject: [PATCH 37/61] Rework disassembly recipe handling --- src/construction.cpp | 4 +- src/craft_command.cpp | 4 +- src/crafting.cpp | 122 +++++++++++++++++++------------------- src/crafting_gui.cpp | 6 +- src/item.cpp | 2 +- src/iuse.cpp | 2 +- src/recipe_dictionary.cpp | 2 +- src/requirements.cpp | 83 ++++++++++++++++++++++++++ src/requirements.h | 14 +++++ 9 files changed, 168 insertions(+), 71 deletions(-) diff --git a/src/construction.cpp b/src/construction.cpp index a34b980757d08..e55abf93f6c3c 100644 --- a/src/construction.cpp +++ b/src/construction.cpp @@ -696,12 +696,12 @@ void complete_construction() } } - for (const auto &it : built.requirements.components) { + for (const auto &it : built.requirements.get_components()) { // Tried issuing rope for WEB_ROPE here. Didn't arrive in time for the // gear check. Ultimately just coded a bypass in crafting.cpp. u.consume_items(it); } - for( const auto &it : built.requirements.tools ) { + for( const auto &it : built.requirements.get_tools() ) { u.consume_tools( it ); } diff --git a/src/craft_command.cpp b/src/craft_command.cpp index 7849a6a44a648..b6f4f4ce7ad4d 100644 --- a/src/craft_command.cpp +++ b/src/craft_command.cpp @@ -56,7 +56,7 @@ void craft_command::execute() if( need_selections ) { item_selections.clear(); - for( const auto &it : rec->requirements.components ) { + for( const auto &it : rec->requirements.get_components() ) { comp_selection is = crafter->select_item_component( it, batch_size, map_inv, true ); if( is.use_from == cancel ) { return; @@ -65,7 +65,7 @@ void craft_command::execute() } tool_selections.clear(); - for( const auto &it : rec->requirements.tools ) { + for( const auto &it : rec->requirements.get_tools() ) { comp_selection ts = crafter->select_tool_component( it, batch_size, map_inv, DEFAULT_HOTKEYS, true ); if( ts.use_from == cancel ) { diff --git a/src/crafting.cpp b/src/crafting.cpp index be9e7452e2262..4e1028adbf383 100644 --- a/src/crafting.cpp +++ b/src/crafting.cpp @@ -698,11 +698,11 @@ void player::complete_craft() if( last_craft.has_cached_selections() ) { last_craft.consume_components(); } else { - for( const auto &it : making->requirements.components ) { + for( const auto &it : making->requirements.get_components() ) { consume_items( it, batch_size ); } - for( const auto &it : making->requirements.tools ) { + for( const auto &it : making->requirements.get_tools() ) { consume_tools( it, batch_size ); } } @@ -724,11 +724,11 @@ void player::complete_craft() if( last_craft.has_cached_selections() ) { used = last_craft.consume_components(); } else { - for( const auto &it : making->requirements.components ) { + for( const auto &it : making->requirements.get_components() ) { std::list tmp = consume_items( it, batch_size ); used.splice(used.end(), tmp); } - for( const auto &it : making->requirements.tools ) { + for( const auto &it : making->requirements.get_tools() ) { consume_tools( it, batch_size ); } } @@ -835,11 +835,11 @@ void set_item_inventory(item &newit) if (!g->u.can_pickVolume(newit.volume())) { //Accounts for result_mult add_msg(_("There's no room in your inventory for the %s, so you drop it."), newit.tname().c_str()); - g->m.add_item_or_charges(g->u.posx(), g->u.posy(), newit); + g->m.add_item_or_charges(g->u.pos(), newit); } else if (!g->u.can_pickWeight(newit.weight(), !OPTIONS["DANGEROUS_PICKUPS"])) { add_msg(_("The %s is too heavy to carry, so you drop it."), newit.tname().c_str()); - g->m.add_item_or_charges(g->u.posx(), g->u.posy(), newit); + g->m.add_item_or_charges(g->u.pos(), newit); } else { newit = g->u.i_add(newit); add_msg(m_info, "%c - %s", newit.invlet == 0 ? ' ' : newit.invlet, newit.tname().c_str()); @@ -1166,64 +1166,60 @@ bool player::can_disassemble( const item &dis_item, const recipe *cur_recipe, return false; } } + + bool have_all_qualities = true; + const auto &dis_requirements = cur_recipe->requirements.disassembly_requirements(); + for( const auto &itq : dis_requirements.get_qualities() ) { + for( const auto &it : itq ) { + if( !it.has( crafting_inv ) ) { + if( print_msg ) { + add_msg( m_info, _("To disassemble this, you need %s"), + it.to_string().c_str() ); + } + + have_all_qualities = false; + } + } + } + // ok, a valid recipe exists for the item, and it is reversible // assign the activity // check tools are available // loop over the tools and see what's required...again bool have_all_tools = true; - for( const auto &it : cur_recipe->requirements.tools ) { + for( const auto &it : dis_requirements.get_tools() ) { bool have_this_tool = false; for( const auto &tool : it ) { itype_id type = tool.type; int req = tool.count; // -1 => 1 - if ((req <= 0 && crafting_inv.has_tools (type, 1)) || - // No welding, no goggles needed. - (req <= 0 && type == "goggles_welding") || - (req <= 0 && type == "crucible" && - cur_recipe->result != "anvil") || - // No mold needed for disassembly. - (req <= 0 && type == "mold_plastic") || - (req > 0 && crafting_inv.has_charges(type, req))) { + if( ( req <= 0 && crafting_inv.has_tools( type, 1 ) ) || + ( req > 0 && crafting_inv.has_charges( type, req ) ) ) { have_this_tool = true; } - // If crafting recipe required a welder, - // disassembly requires a hacksaw or super toolkit. - if (type == "welder") { - have_this_tool = crafting_inv.has_items_with_quality( "SAW_M_FINE", 1, 1 ); - } - - if (type == "sewing_kit") { - have_this_tool = crafting_inv.has_items_with_quality( "CUT", 1, 1 ); - } - if( have_this_tool ) { break; } } - if (!have_this_tool) { + if( !have_this_tool ) { have_all_tools = false; - if (print_msg) { + if( print_msg ) { int req = it[0].count; - if (it[0].type == "welder") { - add_msg(m_info, _("You need an item with %s of 1 or more to disassemble this."), quality::get_name( "SAW_M_FINE" ).c_str() ); + if( req <= 0 ) { + add_msg(m_info, _("You need a %s to disassemble this."), + item::nname(it[0].type).c_str()); } else { - if (req <= 0) { - add_msg(m_info, _("You need a %s to disassemble this."), - item::nname(it[0].type).c_str()); - } else { - add_msg(m_info, ngettext("You need a %s with %d charge to disassemble this.", - "You need a %s with %d charges to disassemble this.", - req), - item::nname(it[0].type).c_str(), req); - } + add_msg(m_info, ngettext("You need a %s with %d charge to disassemble this.", + "You need a %s with %d charges to disassemble this.", + req), + item::nname(it[0].type).c_str(), req); } } } } - // all tools present, so assign the activity - return have_all_tools; + // All tools present, so assign the activity + return have_all_qualities && have_all_tools; } bool query_dissamble(const item &dis_item) @@ -1290,7 +1286,7 @@ void player::disassemble(item &dis_item, int dis_pos, bool ground) } else { //twice the volume then multiplied by 10 (a book with volume 3 will give 60 pages) int num_pages = (dis_item.volume() * 2) * 10; - g->m.spawn_item(posx(), posy(), "paper", 0, num_pages); + g->m.spawn_item(pos(), "paper", 0, num_pages); i_rem(dis_pos); } return; @@ -1319,21 +1315,24 @@ void player::complete_disassemble() // which recipe was it? const int item_pos = activity.values[0]; const bool from_ground = activity.values.size() > 1 && activity.values[1] == 1; - const recipe *dis = recipe_by_index(activity.index); // Which recipe is it? - if( dis == nullptr ) { + const recipe *dis_ptr = recipe_by_index(activity.index); // Which recipe is it? + if( dis_ptr == nullptr ) { debugmsg( "no recipe with id %d found", activity.index ); activity.type = ACT_NULL; return; } + const auto dis = *dis_ptr; + // Get the proper recipe - the one for disassembly, not assembly + const auto dis_requirements = dis.requirements.disassembly_requirements(); item *org_item; - auto items_on_ground = g->m.i_at(posx(), posy()); + auto items_on_ground = g->m.i_at(pos()); if (from_ground) { if (static_cast(item_pos) >= items_on_ground.size()) { add_msg(_("The item has vanished.")); return; } org_item = &items_on_ground[item_pos]; - if (org_item->type->id != dis->result) { + if (org_item->type->id != dis.result) { add_msg(_("The item might be gone, at least it is not at the expected position anymore.")); return; } @@ -1358,44 +1357,45 @@ void player::complete_disassemble() if (dis_item.count_by_charges()) { // remove the charges that one would get from crafting it - org_item->charges -= dis->create_result().charges; + org_item->charges -= dis.create_result().charges; } // remove the item, except when it's counted by charges and still has some if (!org_item->count_by_charges() || org_item->charges <= 0) { if (from_ground) { - g->m.i_rem( posx(), posy(), item_pos ); + g->m.i_rem( pos(), item_pos ); } else { i_rem(item_pos); } } - // consume tool charges - for (const auto &it : dis->requirements.tools) { - consume_tools(it); + // Consume tool charges + for( const auto &it : dis_requirements.get_tools() ) { + consume_tools( it ); } // add the components to the map // Player skills should determine how many components are returned - int skill_dice = 2 + skillLevel(dis->skill_used) * 3; - skill_dice += skillLevel(dis->skill_used); + int skill_dice = 2 + skillLevel(dis.skill_used) * 3; + skill_dice += skillLevel(dis.skill_used); // Sides on dice is 16 plus your current intelligence ///\EFFECT_INT increases success rate for disassembling items int skill_sides = 16 + int_cur; - int diff_dice = dis->difficulty; + int diff_dice = dis.difficulty; int diff_sides = 24; // 16 + 8 (default intelligence) // disassembly only nets a bit of practice - if (dis->skill_used) { - practice( dis->skill_used, (dis->difficulty) * 2, dis->difficulty ); + if( dis.skill_used ) { + practice( dis.skill_used, (dis.difficulty) * 2, dis.difficulty ); } - for (const auto &altercomps : dis->requirements.components) { + for (const auto &altercomps : dis_requirements.get_components()) { const item_comp comp = find_component( altercomps, dis_item ); int compcount = comp.count; item newit( comp.type, calendar::turn ); + // TODO: Move this check to requirement_data::disassembly_requirements() if( !comp.recoverable || newit.has_flag( "UNRECOVERABLE" ) ) { continue; } @@ -1413,7 +1413,7 @@ void player::complete_disassemble() for( ; compcount > 0; compcount--) { const bool comp_success = (dice(skill_dice, skill_sides) > dice(diff_dice, diff_sides)); - if (dis->difficulty != 0 && !comp_success) { + if (dis.difficulty != 0 && !comp_success) { add_msg(m_bad, _("You fail to recover %s."), newit.tname().c_str()); continue; } @@ -1443,15 +1443,15 @@ void player::complete_disassemble() } else if (veh != NULL && veh->add_item(veh_part, act_item)) { // add_item did put the items in the vehicle, nothing further to be done } else { - g->m.add_item_or_charges(posx(), posy(), act_item); + g->m.add_item_or_charges(pos(), act_item); } } } - if (dis->learn_by_disassembly >= 0 && !knows_recipe(dis)) { - if( !dis->skill_used || dis->learn_by_disassembly <= skillLevel(dis->skill_used)) { + if (dis.learn_by_disassembly >= 0 && !knows_recipe(&dis)) { + if( !dis.skill_used || dis.learn_by_disassembly <= skillLevel(dis.skill_used)) { if (one_in(4)) { - learn_recipe((recipe *)dis); + learn_recipe( &dis ); add_msg(m_good, _("You learned a recipe from disassembling it!")); } else { add_msg(m_info, _("You might be able to learn a recipe if you disassemble another.")); diff --git a/src/crafting_gui.cpp b/src/crafting_gui.cpp index 66d6cee02e287..6c08b1c10eecc 100644 --- a/src/crafting_gui.cpp +++ b/src/crafting_gui.cpp @@ -730,8 +730,8 @@ void pick_recipes( const inventory &crafting_inv, } if( filter != "" ) { if( ( search_name && !lcmatch( item::nname( rec->result ), filter ) ) - || ( search_tool && !lcmatch_any( rec->requirements.tools, filter ) ) - || ( search_component && !lcmatch_any( rec->requirements.components, filter ) ) ) { + || ( search_tool && !lcmatch_any( rec->requirements.get_tools(), filter ) ) + || ( search_component && !lcmatch_any( rec->requirements.get_components(), filter ) ) ) { continue; } bool match_found = false; @@ -748,7 +748,7 @@ void pick_recipes( const inventory &crafting_inv, } } if( search_qualities ) { - for( auto quality_reqs : rec->requirements.qualities ) { + for( auto quality_reqs : rec->requirements.get_qualities() ) { for( auto quality : quality_reqs ) { if( lcmatch( quality.to_string(), filter ) ) { match_found = true; diff --git a/src/item.cpp b/src/item.cpp index a76972fba1360..9abf9aa0c4ebc 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -1238,7 +1238,7 @@ std::string item::info( bool showtext, std::vector &info ) const if( dis_recipe != nullptr ) { std::ostringstream buffer; bool first_component = true; - for( const auto &it : dis_recipe->requirements.components ) { + for( const auto &it : dis_recipe->requirements.get_components() ) { if( first_component ) { first_component = false; } else { diff --git a/src/iuse.cpp b/src/iuse.cpp index c2deb64d62a66..8230fa515c4c0 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -8359,7 +8359,7 @@ int iuse::multicooker(player *p, item *it, bool t, const tripoint &pos) return 0; } - for (auto it : meal->requirements.components) { + for( auto it : meal->requirements.get_components() ) { p->consume_items(it); } diff --git a/src/recipe_dictionary.cpp b/src/recipe_dictionary.cpp index 4a82e245da9f5..6d940a0aad82d 100644 --- a/src/recipe_dictionary.cpp +++ b/src/recipe_dictionary.cpp @@ -43,7 +43,7 @@ void recipe_dictionary::delete_if( const std::function &pred ) void recipe_dictionary::add_to_component_lookup( recipe *r ) { std::unordered_set counted; - for( const auto &comp_choices : r->requirements.components ) { + for( const auto &comp_choices : r->requirements.get_components() ) { for( const item_comp &comp : comp_choices ) { if( counted.count( comp.type ) ) { continue; diff --git a/src/requirements.cpp b/src/requirements.cpp index 3d826fac25c1d..bd56e66f5c914 100644 --- a/src/requirements.cpp +++ b/src/requirements.cpp @@ -565,3 +565,86 @@ bool requirement_data::remove_item( const std::string &type ) { return remove_item( type, tools ) || remove_item( type, components ); } + +const requirement_data::alter_tool_comp_vector &requirement_data::get_tools() const +{ + return tools; +} + +const requirement_data::alter_quali_req_vector &requirement_data::get_qualities() const +{ + return qualities; +} + +const requirement_data::alter_item_comp_vector &requirement_data::get_components() const +{ + return components; +} + +const requirement_data requirement_data::disassembly_requirements() const +{ + // TODO: + // Allow jsonizing those tool replacements + + // Make a copy + // Maybe TODO: Cache it somewhere and return a reference instead + requirement_data ret = *this; + auto new_qualities = std::vector(); + for( auto &it : ret.tools ) { + bool replaced = false; + for( const auto &tool : it ) { + const itype_id &type = tool.type; + + // If crafting recipe required a welder, + // disassembly requires a hacksaw or super toolkit. + if( type == "welder" || + type == "welder_crude" || + type == "oxy_torch" ) { + new_qualities.push_back( quality_requirement( "SAW_M_FINE", 1, 1 ) ); + replaced = true; + break; + } else if( type == "sewing_kit" || + type == "mold_plastic" ) { + new_qualities.push_back( quality_requirement( "CUT", 1, 1 ) ); + replaced = true; + break; + } else if( type == "goggles_welding" || + type == "crucible" ) { + replaced = true; + break; + } + } + + if( replaced ) { + // Replace the entire blocks + // This avoids the pesky integrated toolset + it.clear(); + } + } + + // Warning: This depends on the fact that tool qualities + // are all mandatory (don't use variants) + // If this ever changes, this will be wrong! + if( ret.qualities.empty() ) { + ret.qualities.resize( 1 ); + } + + auto qualities = ret.qualities[0]; + qualities.insert( qualities.end(), new_qualities.begin(), new_qualities.end() ); + // Remove duplicate qualities + { + auto itr = std::unique( qualities.begin(), qualities.end(), + []( const quality_requirement &a, const quality_requirement &b ) { + return a.type == b.type; + } ); + qualities.resize( std::distance( qualities.begin(), itr ) ); + } + + // Remove empty variant sections + ret.tools.erase( std::remove_if( ret.tools.begin(), ret.tools.end(), + []( const std::vector &tcv ) { + return tcv.empty(); + } ), ret.tools.end() ); + + return std::move( ret ); +} diff --git a/src/requirements.h b/src/requirements.h index ddef10d31484b..7b9162f67f0cc 100644 --- a/src/requirements.h +++ b/src/requirements.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "color.h" #include "output.h" @@ -131,10 +132,13 @@ struct requirement_data { typedef std::vector< std::vector > alter_item_comp_vector; typedef std::vector< std::vector > alter_quali_req_vector; + private: alter_tool_comp_vector tools; alter_quali_req_vector qualities; alter_item_comp_vector components; + public: + /** * Load @ref tools, @ref qualities and @ref components from * the json object. Assumes them to be in sub-objects. @@ -159,6 +163,10 @@ struct requirement_data { */ bool remove_item(const std::string &type); + const alter_tool_comp_vector &get_tools() const; + const alter_quali_req_vector &get_qualities() const; + const alter_item_comp_vector &get_components() const; + bool can_make_with_inventory(const inventory &crafting_inv, int batch = 1) const; int print_components(WINDOW *w, int ypos, int xpos, int width, nc_color col, @@ -169,6 +177,12 @@ struct requirement_data { const inventory &crafting_inv, int batch = 1) const; std::vector get_folded_tools_list(int width, nc_color col, const inventory &crafting_inv, int batch = 1) const; + /** + * Gets a variant of this recipe with crafting-only tools replaced by their + * disassembly equivalents. + */ + const requirement_data disassembly_requirements() const; + private: bool check_enough_materials(const inventory &crafting_inv, int batch = 1) const; bool check_enough_materials(const item_comp &comp, const inventory &crafting_inv, int batch = 1) const; From c16570f10d2570e4eabfa47f9ab1aeb8b3124c76 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sun, 27 Dec 2015 07:49:42 +0100 Subject: [PATCH 38/61] Better messages about lacking disassembly tools --- src/crafting.cpp | 25 +++++++++++++------------ src/game.cpp | 34 ++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/crafting.cpp b/src/crafting.cpp index 4e1028adbf383..1be6dfcf084cd 100644 --- a/src/crafting.cpp +++ b/src/crafting.cpp @@ -1153,15 +1153,16 @@ bool player::can_disassemble( const item &dis_item, const inventory &crafting_in bool player::can_disassemble( const item &dis_item, const recipe *cur_recipe, const inventory &crafting_inv, bool print_msg ) const { + const std::string dis_name = dis_item.tname().c_str(); if (dis_item.count_by_charges()) { // Create a new item to get the default charges const item tmp = cur_recipe->create_result(); if (dis_item.charges < tmp.charges) { if (print_msg) { - popup(ngettext("You need at least %d charge of that item to disassemble it.", - "You need at least %d charges of that item to disassemble it.", - tmp.charges), - tmp.charges); + popup(ngettext("You need at least %d charge of %s to disassemble it.", + "You need at least %d charges of %s to disassemble it.", + tmp.charges ), + tmp.charges, dis_name.c_str() ); } return false; } @@ -1173,8 +1174,8 @@ bool player::can_disassemble( const item &dis_item, const recipe *cur_recipe, for( const auto &it : itq ) { if( !it.has( crafting_inv ) ) { if( print_msg ) { - add_msg( m_info, _("To disassemble this, you need %s"), - it.to_string().c_str() ); + add_msg( m_info, _("To disassemble %s, you need %s"), + dis_name.c_str(), it.to_string().c_str() ); } have_all_qualities = false; @@ -1207,13 +1208,13 @@ bool player::can_disassemble( const item &dis_item, const recipe *cur_recipe, if( print_msg ) { int req = it[0].count; if( req <= 0 ) { - add_msg(m_info, _("You need a %s to disassemble this."), - item::nname(it[0].type).c_str()); + add_msg(m_info, _("You need a %s to disassemble %s."), + item::nname(it[0].type).c_str(), dis_name.c_str() ); } else { - add_msg(m_info, ngettext("You need a %s with %d charge to disassemble this.", - "You need a %s with %d charges to disassemble this.", - req), - item::nname(it[0].type).c_str(), req); + add_msg(m_info, ngettext("You need a %s with %d charge to disassemble %s.", + "You need a %s with %d charges to disassemble %s.", + req ), + item::nname(it[0].type).c_str(), req, dis_name.c_str() ); } } } diff --git a/src/game.cpp b/src/game.cpp index a96ee03b92ea9..fb0b1665e56d4 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -11003,6 +11003,7 @@ void game::butcher() const int factor = u.butcher_factor(); bool has_corpse = false; bool has_item = false; + const item *first_item_without_tools = nullptr; // indices of corpses / items that can be disassembled std::vector corpses; auto items = m.i_at(u.pos()); @@ -11038,14 +11039,22 @@ void game::butcher() } } } - // then get items to disassemble - for (size_t i = 0; i < items.size(); i++) { - if( !items[i].is_corpse() ) { - const recipe *cur_recipe = get_disassemble_recipe(items[i].type->id); - if (cur_recipe != NULL && u.can_disassemble(items[i], cur_recipe, crafting_inv, false)) { - corpses.push_back(i); - has_item = true; - } + // Then get items to disassemble + for( size_t i = 0; i < items.size(); i++ ) { + if( items[i].is_corpse() ) { + continue; + } + + const recipe *cur_recipe = get_disassemble_recipe(items[i].type->id); + if( cur_recipe == nullptr ) { + continue; + } + + if( u.can_disassemble( items[i], cur_recipe, crafting_inv, false ) ) { + corpses.push_back(i); + has_item = true; + } else if( first_item_without_tools == nullptr ) { + first_item_without_tools = &items[i]; } } // Now salvageable items @@ -11062,9 +11071,14 @@ void game::butcher() if (corpses.empty()) { if( factor > INT_MIN ) { - add_msg(m_info, _("There are no corpses here to butcher.")); + add_msg( m_info, _("There are no corpses here to butcher.") ); + } else if( first_item_without_tools != nullptr ) { + add_msg( m_info, _("You don't have the necessary tools to disassemble any items here.") ); + const recipe *cur_recipe = get_disassemble_recipe( first_item_without_tools->type->id ); + // Just for the "You need x to disassemble y" messages + u.can_disassemble( *first_item_without_tools, cur_recipe, crafting_inv, true ); } else { - add_msg(m_info, _("You don't have a sharp item to butcher with.")); + add_msg( m_info, _("You don't have a sharp item to butcher with.") ); } return; } From 7446fe408c3774192055be898372820ef46cd372 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sun, 27 Dec 2015 08:11:28 +0100 Subject: [PATCH 39/61] Fix missing cutting quality for disassembly --- src/requirements.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/requirements.cpp b/src/requirements.cpp index bd56e66f5c914..797cdfc6c6bd3 100644 --- a/src/requirements.cpp +++ b/src/requirements.cpp @@ -603,12 +603,16 @@ const requirement_data requirement_data::disassembly_requirements() const new_qualities.push_back( quality_requirement( "SAW_M_FINE", 1, 1 ) ); replaced = true; break; - } else if( type == "sewing_kit" || + } + + if( type == "sewing_kit" || type == "mold_plastic" ) { new_qualities.push_back( quality_requirement( "CUT", 1, 1 ) ); replaced = true; break; - } else if( type == "goggles_welding" || + } + + if( type == "goggles_welding" || type == "crucible" ) { replaced = true; break; @@ -616,7 +620,7 @@ const requirement_data requirement_data::disassembly_requirements() const } if( replaced ) { - // Replace the entire blocks + // Replace the entire block of variants // This avoids the pesky integrated toolset it.clear(); } @@ -624,12 +628,12 @@ const requirement_data requirement_data::disassembly_requirements() const // Warning: This depends on the fact that tool qualities // are all mandatory (don't use variants) - // If this ever changes, this will be wrong! + // If that ever changes, this will be wrong! if( ret.qualities.empty() ) { ret.qualities.resize( 1 ); } - auto qualities = ret.qualities[0]; + auto &qualities = ret.qualities[0]; qualities.insert( qualities.end(), new_qualities.begin(), new_qualities.end() ); // Remove duplicate qualities { From 5714efeb4a1b0ef8a7ed833badb155a14f16dc5a Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sun, 27 Dec 2015 08:17:37 +0100 Subject: [PATCH 40/61] Fix disassembly recipes --- data/json/recipes/recipe_armor.json | 4 +- data/json/recipes/recipe_deconstruction.json | 69 +------------------- 2 files changed, 4 insertions(+), 69 deletions(-) diff --git a/data/json/recipes/recipe_armor.json b/data/json/recipes/recipe_armor.json index 307460b2d96f0..ee21f6726562b 100644 --- a/data/json/recipes/recipe_armor.json +++ b/data/json/recipes/recipe_armor.json @@ -4066,7 +4066,7 @@ "skill_used": "survival", "difficulty": 0, "time": 800, - "reversible": false, + "reversible": true, "autolearn": true, "components": [ [ @@ -4105,7 +4105,7 @@ "skill_used": "survival", "difficulty": 0, "time": 800, - "reversible": false, + "reversible": true, "autolearn": true, "components": [ [ diff --git a/data/json/recipes/recipe_deconstruction.json b/data/json/recipes/recipe_deconstruction.json index 0e0694fb056b5..db32ea93c545f 100644 --- a/data/json/recipes/recipe_deconstruction.json +++ b/data/json/recipes/recipe_deconstruction.json @@ -792,38 +792,6 @@ [ "scrap", 1 ] ] ] -},{ - "type" : "recipe", - "result": "tshirt", - "id_suffix": "uncraft", - "category": "CC_NONCRAFT", - "subcategory": "CSC_NONCRAFT", - "skill_used": "tailor", - "difficulty": 0, - "time": 500, - "reversible": true, - "autolearn": false, - "components": [ - [ - [ "rag", 5 ] - ] - ] -},{ - "type" : "recipe", - "result": "tank_top", - "id_suffix": "uncraft", - "category": "CC_NONCRAFT", - "subcategory": "CSC_NONCRAFT", - "skill_used": "tailor", - "difficulty": 0, - "time": 500, - "reversible": true, - "autolearn": false, - "components": [ - [ - [ "rag", 4 ] - ] - ] },{ "type" : "recipe", "result": "boots_steel", @@ -1037,39 +1005,6 @@ [ "burnt_out_bionic", 1 ] ] ] -},{ - "type" : "recipe", - "result": "bindle", - "id_suffix": "uncraft", - "category": "CC_NONCRAFT", - "subcategory": "CSC_NONCRAFT", - "difficulty": 0, - "time": 100, - "reversible": true, - "autolearn": false, - "components": [ - [ - [ "rag", 4 ] - ], - [ - [ "stick", 1 ] - ] - ] -},{ - "type" : "recipe", - "result": "makeshift_sling", - "id_suffix": "uncraft", - "category": "CC_NONCRAFT", - "subcategory": "CSC_NONCRAFT", - "difficulty": 0, - "time": 100, - "reversible": true, - "autolearn": false, - "components": [ - [ - [ "sheet", 1 ] - ] - ] },{ "type" : "recipe", "result": "battletorch_done", @@ -1619,7 +1554,7 @@ "difficulty": 8, "time": 80000, "reversible": true, - "autolearn": true, + "autolearn": false, "qualities":[ {"id":"SAW_M","level":1,"amount":1}, {"id":"SCREW","level":1,"amount":1}, @@ -1660,7 +1595,7 @@ "difficulty": 7, "time": 80000, "reversible": true, - "autolearn": true, + "autolearn": false, "qualities":[ {"id":"SAW_M","level":1,"amount":1}, {"id":"SCREW","level":1,"amount":1}, From d3df3a09725cbf4f0fae38d35d58a688e4f0a7b1 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sun, 27 Dec 2015 11:06:49 +0100 Subject: [PATCH 41/61] Buff blisters greatly --- data/json/effects.json | 3 +++ src/player.cpp | 49 ++++++++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/data/json/effects.json b/data/json/effects.json index 885b0647eb6ea..8dd69b035ee25 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -819,6 +819,8 @@ "pain_min": [1], "pain_chance": [2], "pain_max_val": [-1], + "hurt_min": [1], + "hurt_chance": [-300], "stamina_chance": [2] }, "scaling_mods": { @@ -826,6 +828,7 @@ "thirst_min": [1], "thirst_tick": [-100], "pain_max_val": [10], + "hurt_chance": [200], "stamina_min": [-1] } }, diff --git a/src/player.cpp b/src/player.cpp index 52c530c9cd2bb..6fecd5f14f4af 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -835,6 +835,10 @@ void player::update_bodytemp() // This gets incremented in the for loop and used in the morale calculation int morale_pen = 0; + // Let's cache this not to check it num_bp times + const bool has_bark = has_trait( "BARK" ); + const bool has_sleep = has_effect( "sleep" ); + const bool has_heatsink = has_bionic( "bio_heatsink" ) || is_wearing( "rm13_armor_on" ); // Current temperature and converging temperature calculations for( int i = 0 ; i < num_bp; i++ ) { // This adjusts the temperature scale to match the bodytemp scale, @@ -886,12 +890,12 @@ void player::update_bodytemp() // HUNGER temp_conv[i] -= get_hunger() / 6 + 100; // FATIGUE - if( !has_effect("sleep") ) { + if( !has_sleep ) { temp_conv[i] -= std::max(0.0, 1.5 * fatigue); } // CONVECTION HEAT SOURCES (generates body heat, helps fight frostbite) - // Bark : lowers blister count to -100; harder to get blisters - int blister_count = (has_trait("BARK") ? -100 : 0); // If the counter is high, your skin starts to burn + // Bark : lowers blister count to -10; harder to get blisters + int blister_count = (has_bark ? -10 : 0); // If the counter is high, your skin starts to burn int best_fire = 0; for (int j = -6 ; j <= 6 ; j++) { for (int k = -6 ; k <= 6 ; k++) { @@ -904,31 +908,34 @@ void player::update_bodytemp() } else if (g->m.tr_at( dest ).loadid == tr_lava ) { heat_intensity = 3; } - if( heat_intensity > 0 && - g->m.sees( pos(), dest, -1 ) ) { - // Ensure fire_dist >= 1 to avoid divide-by-zero errors. - int fire_dist = std::max(1, std::max( std::abs( j ), std::abs( k ) ) ); - if (frostbite_timer[i] > 0) { - frostbite_timer[i] -= heat_intensity - fire_dist / 2; - } - temp_conv[i] += 300 * heat_intensity * heat_intensity / (fire_dist); - blister_count += heat_intensity / (fire_dist * fire_dist); - if( fire_dist <= 1 ) { - // Extend limbs/lean over a single adjacent fire to warm up - best_fire = std::max( best_fire, heat_intensity ); - } + if( heat_intensity == 0 || !g->m.sees( pos(), dest, -1 ) ) { + // No heat source here + continue; + } + // Ensure fire_dist >= 1 to avoid divide-by-zero errors. + int fire_dist = std::max( 1, std::max( std::abs( j ), std::abs( k ) ) ); + if( frostbite_timer[i] > 0 ) { + frostbite_timer[i] -= std::max( 0, heat_intensity - fire_dist / 2 ); + } + int heat_here = heat_intensity * heat_intensity / fire_dist; + temp_conv[i] += 300 * heat_here; + blister_count += heat_here; + if( fire_dist <= 1 ) { + // Extend limbs/lean over a single adjacent fire to warm up + best_fire = std::max( best_fire, heat_intensity ); } } } // Bionic "Thermal Dissipation" says it prevents fire damage up to 2000F. - // 500 is picked at random... - if( has_bionic( "bio_heatsink" ) || is_wearing( "rm13_armor_on" ) ) { - blister_count -= 500; + // But it's kinda hard to get the balance right, let's go with 20 blisters + if( has_heatsink ) { + blister_count -= 20; } // BLISTERS : Skin gets blisters from intense heat exposure. - if( blister_count - 10 * get_env_resist( body_part( i ) ) > 20 ) { + if( blister_count - get_env_resist( body_part( i ) ) > 10 ) { add_effect( "blisters", 1, ( body_part )i ); } +if(blister_count > 0 ) add_msg(m_debug, "%d blisters", blister_count); temp_conv[i] += bodytemp_modifier_fire(); // WEATHER @@ -939,7 +946,7 @@ void player::update_bodytemp() temp_conv[i] += 500; } // DISEASES - if( has_effect("flu") && i == bp_head ) { + if( i == bp_head && has_effect("flu") ) { temp_conv[i] += 1500; } if( has_effect("common_cold") ) { From 8b70fc3aaf985c5002c91827fad19db492acf8c5 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sun, 27 Dec 2015 11:24:01 +0100 Subject: [PATCH 42/61] debugmsg... --- src/player.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/player.cpp b/src/player.cpp index 6fecd5f14f4af..586fc4ddb907f 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -935,7 +935,6 @@ void player::update_bodytemp() if( blister_count - get_env_resist( body_part( i ) ) > 10 ) { add_effect( "blisters", 1, ( body_part )i ); } -if(blister_count > 0 ) add_msg(m_debug, "%d blisters", blister_count); temp_conv[i] += bodytemp_modifier_fire(); // WEATHER From bf6926c9c3a59f91c036e7e5433143c9002c4c82 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sun, 27 Dec 2015 12:21:14 +0100 Subject: [PATCH 43/61] Fix radiation dropping way too fast --- src/player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/player.cpp b/src/player.cpp index 301890a585530..79144a695865e 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -5853,7 +5853,7 @@ void player::regen( int rate_multiplier ) } if( radiation > 0 ) { - radiation = std::max( 0, radiation - divide_roll_remainder( rate_multiplier * radiation / 3.0, 1.0f ) ); + radiation = std::max( 0, radiation - divide_roll_remainder( rate_multiplier / 3.0f, 1.0f ) ); } } From e8b2a9136cd8f44def6e150cc523a006aaa20124 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sun, 27 Dec 2015 15:02:04 +0100 Subject: [PATCH 44/61] Remove reference to inexistent item --- data/json/recipes/recipe_others.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/json/recipes/recipe_others.json b/data/json/recipes/recipe_others.json index edcdb76636917..daae9f7967b25 100644 --- a/data/json/recipes/recipe_others.json +++ b/data/json/recipes/recipe_others.json @@ -7033,8 +7033,7 @@ [ "salt", 1 ] ], [ - [ "raw_fur", 1 ], - [ "tainted_raw_fur", 1 ] + [ "raw_fur", 1 ] ] ] },{ From 22cd2c807e1a877a7526a9019147851afefe34b9 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Sun, 27 Dec 2015 17:09:27 +0100 Subject: [PATCH 45/61] Replace with proper id --- data/json/recipes/recipe_others.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/json/recipes/recipe_others.json b/data/json/recipes/recipe_others.json index daae9f7967b25..08121f17e3cbc 100644 --- a/data/json/recipes/recipe_others.json +++ b/data/json/recipes/recipe_others.json @@ -7033,7 +7033,8 @@ [ "salt", 1 ] ], [ - [ "raw_fur", 1 ] + [ "raw_fur", 1 ], + [ "raw_tainted_fur", 1 ] ] ] },{ From d3efd4c967349bfa895b65867f1f270916e66510 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Sun, 27 Dec 2015 11:25:28 -0800 Subject: [PATCH 46/61] juice fixes --- data/json/recipes/recipe_food.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/data/json/recipes/recipe_food.json b/data/json/recipes/recipe_food.json index 8acbc613c360f..3ef6ec4f3e84e 100644 --- a/data/json/recipes/recipe_food.json +++ b/data/json/recipes/recipe_food.json @@ -2749,9 +2749,6 @@ [ [ "irradiated_orange", 2 ], [ "orange", 2 ] - ], - [ - [ "water_clean", 1 ] ] ] },{ @@ -9783,7 +9780,6 @@ },{ "type" : "recipe", "result": "juice", - "result_mult": 2, "byproducts": "juice_pulp", "category": "CC_FOOD", "subcategory": "CSC_FOOD_DRINKS", From 91e19fa7e0a8a1006ee9bcad65cff7983de99aa0 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Sun, 27 Dec 2015 15:48:35 -0800 Subject: [PATCH 47/61] Update recipe_food.json --- data/json/recipes/recipe_food.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/data/json/recipes/recipe_food.json b/data/json/recipes/recipe_food.json index 3ef6ec4f3e84e..6caf68bf00e7c 100644 --- a/data/json/recipes/recipe_food.json +++ b/data/json/recipes/recipe_food.json @@ -9814,10 +9814,8 @@ ["irradiated_grapefruit", 2], ["irradiated_grapes", 4], ["irradiated_kiwi", 2], - ["irradiated_lemon", 2], ["irradiated_mango", 2], ["irradiated_melon", 4], - ["irradiated_orange", 2], ["irradiated_papaya", 2], ["irradiated_peach", 2], ["irradiated_pear", 2], @@ -9828,10 +9826,8 @@ ["irradiated_strawberries", 2], ["irradiated_watermelon", 1], ["kiwi", 2], - ["lemon", 2], ["mango", 2], ["melon", 4], - ["orange", 2], ["papaya", 2], ["peach", 2], ["pear", 2], From 097ff0d8d33d80922161a36aa4a44179c7f5b2e4 Mon Sep 17 00:00:00 2001 From: Dmitry Serov Date: Mon, 28 Dec 2015 15:30:16 +0300 Subject: [PATCH 48/61] set 0 as default value for "bashing" parameter --- doc/JSON_INFO.md | 4 ++-- src/item_factory.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/JSON_INFO.md b/doc/JSON_INFO.md index d6d5621847724..e433eaa6d59a3 100644 --- a/doc/JSON_INFO.md +++ b/doc/JSON_INFO.md @@ -374,8 +374,8 @@ The syntax listed here is still valid. "material" : "plastic", // Material types. See materials.json for possible options "volume" : 2, // Volume, measured in 1/4 liters "weight" : 34, // Weight, measured in grams -"bashing" : 1, // Bashing damage caused by using it as a melee weapon -"cutting" : 0, // Cutting damage caused by using it as a melee weapon (optional parameter, default value is 0). +"bashing" : 1, // (Optional, default = 0) Bashing damage caused by using it as a melee weapon. +"cutting" : 0, // (Optional, default = 0) Cutting damage caused by using it as a melee weapon. "to_hit" : 0, // To-hit bonus if using it as a melee weapon "ammo_type" : "shot", // Determines what it can be loaded in "damage" : 18, // Ranged damage when fired diff --git a/src/item_factory.cpp b/src/item_factory.cpp index 06ccb50d5554d..a897f5130e7b3 100644 --- a/src/item_factory.cpp +++ b/src/item_factory.cpp @@ -957,7 +957,7 @@ void Item_factory::load_basic_info(JsonObject &jo, itype *new_item_template) new_item_template->phase = jo.get_enum_value( "phase", SOLID ); new_item_template->volume = jo.get_int("volume"); new_item_template->weight = jo.get_int("weight"); - new_item_template->melee_dam = jo.get_int("bashing"); + new_item_template->melee_dam = jo.get_int("bashing", 0); new_item_template->melee_cut = jo.get_int("cutting", 0); new_item_template->m_to_hit = jo.get_int("to_hit"); From b98b06ef313f3bf36ba20276d7bea24c842f0ca5 Mon Sep 17 00:00:00 2001 From: Dmitry Serov Date: Mon, 28 Dec 2015 15:37:32 +0300 Subject: [PATCH 49/61] partial astyling and typo fix in one comment --- src/item_factory.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/item_factory.cpp b/src/item_factory.cpp index a897f5130e7b3..6a50d0a8efee6 100644 --- a/src/item_factory.cpp +++ b/src/item_factory.cpp @@ -932,34 +932,34 @@ void Item_factory::load_basic_info(JsonObject &jo, itype *new_item_template) m_templates[new_id] = new_item_template; // And then proceed to assign the correct field - new_item_template->price = jo.get_int("price"); - new_item_template->name = jo.get_string("name").c_str(); - if (jo.has_member("name_plural")) { - new_item_template->name_plural = jo.get_string("name_plural").c_str(); + new_item_template->price = jo.get_int( "price" ); + new_item_template->name = jo.get_string( "name" ).c_str(); + if( jo.has_member( "name_plural" ) ) { + new_item_template->name_plural = jo.get_string( "name_plural" ).c_str(); } else { - // default behaviour: Assume the regular plural form (appending an ā€œsā€) - new_item_template->name_plural = (jo.get_string("name") + "s").c_str(); + // default behavior: Assume the regular plural form (appending an ā€œsā€) + new_item_template->name_plural = ( jo.get_string( "name" ) + "s" ).c_str(); } - new_item_template->sym = jo.get_string("symbol")[0]; - new_item_template->color = color_from_string(jo.get_string("color")); + new_item_template->sym = jo.get_string( "symbol" )[0]; + new_item_template->color = color_from_string( jo.get_string( "color" ) ); std::string temp_desc; - temp_desc = jo.get_string("description"); - if ( !temp_desc.empty() ) { - new_item_template->description = _(jo.get_string("description").c_str()); + temp_desc = jo.get_string( "description" ); + if( !temp_desc.empty() ) { + new_item_template->description = _( jo.get_string( "description" ).c_str() ); } else { new_item_template->description = ""; } - if( jo.has_member("material") ){ + if( jo.has_member( "material" ) ) { set_material_from_json( jo, "material", new_item_template ); } else { - new_item_template->materials.push_back("null"); + new_item_template->materials.push_back( "null" ); } new_item_template->phase = jo.get_enum_value( "phase", SOLID ); - new_item_template->volume = jo.get_int("volume"); - new_item_template->weight = jo.get_int("weight"); - new_item_template->melee_dam = jo.get_int("bashing", 0); - new_item_template->melee_cut = jo.get_int("cutting", 0); - new_item_template->m_to_hit = jo.get_int("to_hit"); + new_item_template->volume = jo.get_int( "volume" ); + new_item_template->weight = jo.get_int( "weight" ); + new_item_template->melee_dam = jo.get_int( "bashing", 0 ); + new_item_template->melee_cut = jo.get_int( "cutting", 0 ); + new_item_template->m_to_hit = jo.get_int( "to_hit" ); new_item_template->min_str = jo.get_int( "min_strength", 0 ); new_item_template->min_dex = jo.get_int( "min_dexterity", 0 ); From 917be9bb008288e95b5a61b007a455075f266e5e Mon Sep 17 00:00:00 2001 From: Dmitry Serov Date: Mon, 28 Dec 2015 15:38:00 +0300 Subject: [PATCH 50/61] remove default "bashing" values from some json files --- data/json/items/archery.json | 1 - data/json/items/chemicals_and_resources.json | 3 -- data/json/items/containers.json | 8 ---- data/json/items/generic.json | 7 ---- data/json/items/mods.json | 39 -------------------- data/json/items/newspaper.json | 9 ----- data/json/items/software.json | 5 --- 7 files changed, 72 deletions(-) diff --git a/data/json/items/archery.json b/data/json/items/archery.json index e8b308037f05d..9dddf7ae231cc 100644 --- a/data/json/items/archery.json +++ b/data/json/items/archery.json @@ -1102,7 +1102,6 @@ "material" : ["plastic", "iron"], "volume" : 2, "weight" : 175, - "bashing" : 0, "cutting" : 16, "to_hit" : -1, "ammo_type" : "thrown", diff --git a/data/json/items/chemicals_and_resources.json b/data/json/items/chemicals_and_resources.json index 107cb9566079f..b4d39e6a44134 100644 --- a/data/json/items/chemicals_and_resources.json +++ b/data/json/items/chemicals_and_resources.json @@ -698,7 +698,6 @@ "volume" : 1, "phase" : "liquid", "charges" : 14, - "bashing" : 0, "category" : "chems", "ammo_type" : "conc_alcohol", "damage" : 0, @@ -719,7 +718,6 @@ "material": "wood", "weight": 500, "volume": 2, - "bashing": 0, "to_hit": -2 }, { @@ -734,7 +732,6 @@ "material": "wood", "weight": 212, "volume": 1, - "bashing": 0, "to_hit": -2 } ] diff --git a/data/json/items/containers.json b/data/json/items/containers.json index 7a30d33e6c4d2..0586ed1863f79 100644 --- a/data/json/items/containers.json +++ b/data/json/items/containers.json @@ -120,7 +120,6 @@ "price": 400, "weight":50, "volume":1, - "bashing":0, "to_hit":-1, "material":"steel", "contains":1, @@ -138,7 +137,6 @@ "price": 0, "weight": 400, "volume": 1, - "bashing": 0, "to_hit": 0, "material": "steel", "contains": 1, @@ -194,7 +192,6 @@ "price": 800, "weight": 155, "volume": 6, - "bashing": 0, "to_hit": 1, "material": "plastic", "contains": 6, @@ -276,7 +273,6 @@ "price": 1250, "weight": 1587, "volume": 40, - "bashing": 0, "to_hit": -2, "material": "plastic", "contains": 40, @@ -295,7 +291,6 @@ "price": 0, "weight": 190, "volume": 15, - "bashing": 0, "to_hit": 1, "material": "plastic", "contains": 15, @@ -610,7 +605,6 @@ "price": 100, "weight":0, "volume":1, - "bashing":0, "to_hit":1, "material":"plastic", "contains":1, @@ -793,7 +787,6 @@ "price": 100, "weight": 60, "volume": 1, - "bashing": 0, "to_hit": -1, "material": "clay", "contains" : 1, @@ -813,7 +806,6 @@ "price": 10000, "weight": 4887, "volume": 150, - "bashing": 0, "to_hit": -2, "material": "clay", "contains": 150, diff --git a/data/json/items/generic.json b/data/json/items/generic.json index 0d9fca52b6afa..d1e419a8b44a1 100644 --- a/data/json/items/generic.json +++ b/data/json/items/generic.json @@ -10,7 +10,6 @@ "price": 0, "weight": 0, "volume": 0, - "bashing": 0, "to_hit": 0, "flags": ["NO_UNLOAD"] }, @@ -26,7 +25,6 @@ "price": 0, "weight": 0, "volume": 0, - "bashing": 0, "to_hit": 0, "flags": ["PSEUDO"] }, @@ -42,7 +40,6 @@ "price" : 0, "weight" : 0, "volume" : 0, - "bashing" : 0, "cutting" : 0, "to_hit" : 0, "flags": ["PSEUDO"] @@ -59,7 +56,6 @@ "price": 0, "weight": 0, "volume": 0, - "bashing": 0, "to_hit": 0, "flags": ["PSEUDO"] }, @@ -74,7 +70,6 @@ "price": 0, "weight": 0, "volume": 0, - "bashing": 0, "to_hit": 0, "flags": ["PSEUDO"] }, @@ -89,7 +84,6 @@ "price": 0, "weight": 0, "volume": 0, - "bashing": 0, "to_hit": 0, "flags": ["PSEUDO", "UNARMED_WEAPON"], "//" : "Fist is internally represented as 'wielding a none as a weapon'" }, @@ -399,7 +393,6 @@ "material": ["paper"], "weight": 20, "volume": 1, - "bashing": 0, "to_hit": -2 }, { diff --git a/data/json/items/mods.json b/data/json/items/mods.json index de02a87330b0f..bf7d48697eb5b 100644 --- a/data/json/items/mods.json +++ b/data/json/items/mods.json @@ -111,7 +111,6 @@ "material" : ["steel", "plastic"], "mod_targets" : ["shotgun", "smg", "rifle", "crossbow", "launcher"], "volume" : 1, - "bashing" : 0, "recoil_modifier" : -30, "price" : 6000, "skill_required": 1 @@ -207,7 +206,6 @@ "material" : ["steel", "plastic"], "mod_targets" : ["shotgun", "smg", "rifle", "pistol"], "volume" : 2, - "bashing" : 0, "price" : 7200 }, { @@ -223,7 +221,6 @@ "material" : ["steel", "plastic"], "mod_targets" : ["pistol", "shotgun", "smg", "rifle"], "volume" : 1, - "bashing" : 0, "price" : 5000 }, { @@ -239,7 +236,6 @@ "material" : ["cotton", "null"], "mod_targets" : ["shotgun", "smg", "rifle", "pistol", "launcher"], "volume" : 1, - "bashing" : 0, "price" : 2000, "skill_required": 1 }, @@ -257,7 +253,6 @@ "material" : ["aluminum", "plastic"], "mod_targets" : ["smg", "rifle", "crossbow"], "volume" : 3, - "bashing" : 0, "recoil_modifier" : -60, "price" : 68000, "skill_required": 7, @@ -277,7 +272,6 @@ "material" : ["steel", "null"], "mod_targets" : ["smg", "rifle"], "volume" : 1, - "bashing" : 0, "burst_modifier" : 6, "price" : 70000, "skill_required": 6, @@ -322,7 +316,6 @@ "volume" : 1, "acceptable_ammo" : ["38", "40", "44", "45"], "mod_targets" : ["pistol", "smg"], - "bashing" : 0, "skill_required": 6, "ammo_modifier" : "9mm" }, @@ -467,7 +460,6 @@ "material" : ["steel", "null"], "mod_targets" : ["rifle"], "volume" : 2, - "bashing" : 0, "burst_modifier" : -99, "price" : 66000, "skill_required": 8, @@ -614,7 +606,6 @@ "flags" : ["NON_STUCK", "SPEAR", "REACH_ATTACK", "BAYONET"], "recoil_modifier" : 45, "mod_targets" : ["shotgun", "smg", "rifle", "crossbow", "launcher"], - "bashing" : 0, "qualities": [["CUT", 1]] }, { @@ -635,7 +626,6 @@ "flags" : ["NON_STUCK", "CHOP", "REACH_ATTACK", "BAYONET"], "recoil_modifier" : 105, "mod_targets" : ["shotgun", "rifle", "crossbow", "launcher"], - "bashing" : 0, "qualities": [["CUT", 1]] }, { @@ -655,7 +645,6 @@ "cutting" : 6, "recoil_modifier" : 45, "mod_targets" : ["pistol", "smg", "crossbow"], - "bashing" : 0, "flags" : ["STAB", "BAYONET"], "qualities": [["CUT", 1]] }, @@ -674,7 +663,6 @@ "material" : ["steel", "null"], "volume" : 0, "mod_targets" : ["pistol"], - "bashing" : 0, "flags" : ["RELOAD_ONE", "IRREMOVABLE"], "gun_data" : { "skill": "shotgun", @@ -799,7 +787,6 @@ "material" : ["steel", "null"], "volume" : 0, "mod_targets" : ["rifle"], - "bashing" : 0, "flags" : ["RELOAD_ONE", "IRREMOVABLE"], "gun_data" : { "skill": "shotgun", @@ -830,7 +817,6 @@ "material" : ["steel", "null"], "volume" : 4, "mod_targets" : ["rifle"], - "bashing" : 0, "flags" : ["RELOAD_ONE", "IRREMOVABLE"], "gun_data" : { "skill": "shotgun", "//" : "Derived from pipe shotgun", @@ -863,7 +849,6 @@ "material" : ["steel", "null"], "volume" : 0, "mod_targets" : ["shotgun"], - "bashing" : 0, "flags" : ["RELOAD_ONE", "IRREMOVABLE"], "gun_data" : { "skill": "shotgun", "//" : "Stats should mirror the main weapon.", @@ -928,7 +913,6 @@ "material" : ["plastic", "steel"], "mod_targets" : ["smg", "rifle", "pistol", "shotgun", "crossbow", "bow", "launcher"], "volume" : 1, - "bashing" : 0, "price" : 68000 }, { @@ -946,7 +930,6 @@ "material" : ["aluminum", "plastic"], "mod_targets" : ["bow"], "volume" : 1, - "bashing" : 0, "price" : 5000 }, { @@ -963,7 +946,6 @@ "material" : ["aluminum", "plastic"], "mod_targets" : ["bow"], "volume" : 2, - "bashing" : 0, "price" : 4000, "skill_required": 1 }, @@ -981,7 +963,6 @@ "material" : ["plastic", "aluminum"], "mod_targets" : ["bow"], "volume" : 0, - "bashing" : 0, "price" : 4000, "skill_required": 1 }, @@ -1000,7 +981,6 @@ "material" : ["plastic", "steel"], "mod_targets" : ["smg", "rifle", "pistol", "shotgun", "crossbow", "launcher"], "volume" : 0, - "bashing" : 0, "price" : 68000 }, { @@ -1019,7 +999,6 @@ "material" : ["plastic", "steel"], "mod_targets" : ["smg", "rifle", "pistol", "shotgun", "crossbow", "launcher"], "volume" : 0, - "bashing" : 0, "price" : 72000, "skill_required": 1 }, @@ -1038,7 +1017,6 @@ "material" : ["plastic", "steel"], "mod_targets" : ["smg", "rifle", "shotgun", "pistol", "crossbow", "launcher"], "volume" : 1, - "bashing" : 0, "price" : 68000, "skill_required": 2 }, @@ -1057,7 +1035,6 @@ "material" : ["plastic", "steel"], "mod_targets" : ["smg", "rifle", "shotgun", "crossbow", "pistol", "launcher"], "volume" : 1, - "bashing" : 0, "price" : 68000, "skill_required": 3 }, @@ -1076,7 +1053,6 @@ "material" : ["aluminum", "glass"], "mod_targets" : ["rifle", "crossbow", "launcher"], "volume" : 2, - "bashing" : 0, "flags" : ["ZOOM"], "price" : 68000, "skill_required": 5 @@ -1096,7 +1072,6 @@ "material" : ["aluminum", "glass"], "mod_targets" : ["pistol", "smg", "crossbow"], "volume" : 1, - "bashing" : 0, "price" : 54000, "skill_required": 3 }, @@ -1114,7 +1089,6 @@ "material" : ["steel", "null"], "mod_targets" : ["smg", "rifle", "pistol", "shotgun"], "volume" : 0, - "bashing" : 0, "recoil_modifier" : -90, "price" : 72000, "skill_required": 6, @@ -1134,7 +1108,6 @@ "material" : ["steel", "null"], "mod_targets" : ["rifle", "shotgun"], "volume" : 1, - "bashing" : 0, "recoil_modifier" : -150, "price" : 84000, "skill_required": 2, @@ -1154,7 +1127,6 @@ "material" : ["steel", "null"], "mod_targets" : ["smg", "rifle", "pistol", "shotgun", "crossbow", "launcher"], "volume" : 0, - "bashing" : 0, "recoil_modifier" : -30, "price" : 38000, "skill_required": 2 @@ -1173,7 +1145,6 @@ "material" : ["plastic", "steel"], "mod_targets" : ["smg", "rifle", "shotgun", "crossbow", "launcher"], "volume" : 0, - "bashing" : 0, "recoil_modifier" : -30, "price" : 38000, "skill_required": 2 @@ -1191,7 +1162,6 @@ "material" : ["plastic", "steel"], "mod_targets" : ["smg", "rifle", "shotgun", "launcher"], "volume" : 1, - "bashing" : 0, "flags" : ["SLOW_WIELD", "COLLAPSIBLE_STOCK"], "price" : 42000, "skill_required": 2 @@ -1209,7 +1179,6 @@ "material" : ["plastic"], "mod_targets" : ["pistol", "smg", "rifle", "shotgun", "crossbow", "launcher"], "volume" : 0, - "bashing" : 0, "flags" : ["REDUCED_WEIGHT", "REDUCED_BASHING"], "price" : 48000, "skill_required": 3 @@ -1227,7 +1196,6 @@ "material" : ["plastic", "steel"], "mod_targets" : ["smg", "rifle", "shotgun", "launcher"], "volume" : 1, - "bashing" : 0, "recoil_modifier" : -90, "price" : 400, "skill_required": 3 @@ -1246,7 +1214,6 @@ "material" : ["plastic", "steel"], "mod_targets" : ["pistol", "crossbow"], "volume" : 2, - "bashing" : 0, "recoil_modifier" : -75, "price" : 38000, "skill_required": 2 @@ -1264,7 +1231,6 @@ "material" : ["plastic", "null"], "mod_targets" : ["smg", "rifle", "pistol", "shotgun", "launcher"], "volume" : 0, - "bashing" : 0, "flags" : ["WATERPROOF_GUN"], "price" : 50000, "skill_required": 6 @@ -1283,7 +1249,6 @@ "material" : ["steel", "superalloy"], "mod_targets" : ["smg", "rifle", "pistol", "shotgun", "launcher"], "volume" : 0, - "bashing" : 0, "recoil_modifier" : -15, "flags" : ["NEVER_JAMS"], "price" : 2500, @@ -1304,7 +1269,6 @@ "material" : ["steel", "superalloy"], "mod_targets" : ["smg", "rifle", "pistol", "shotgun", "launcher"], "volume" : 0, - "bashing" : 0, "price" : 1500, "skill_required": 6 }, @@ -1345,7 +1309,6 @@ "flags" : ["NON_STUCK", "SPEAR", "BAYONET"], "recoil_modifier" : 45, "mod_targets" : ["shotgun", "smg", "rifle", "crossbow", "launcher"], - "bashing" : 0, "qualities": [["CUT", 1]] }, { @@ -1366,7 +1329,6 @@ "flags" : ["NON_STUCK", "CHOP", "BAYONET"], "recoil_modifier" : 105, "mod_targets" : ["shotgun", "rifle", "crossbow", "launcher"], - "bashing" : 0, "qualities": [["CUT", 1]] }, { @@ -1386,7 +1348,6 @@ "cutting" : 22, "recoil_modifier" : 45, "mod_targets" : ["pistol", "smg", "crossbow"], - "bashing" : 0, "flags" : ["STAB", "BAYONET"], "qualities": [["CUT", 1]] }, diff --git a/data/json/items/newspaper.json b/data/json/items/newspaper.json index bd5c831c90134..5c3117ff2943c 100644 --- a/data/json/items/newspaper.json +++ b/data/json/items/newspaper.json @@ -13,7 +13,6 @@ "material": "paper", "weight": 3, "volume": 0, - "bashing": 0, "cutting": 0, "to_hit": 0 }, @@ -31,7 +30,6 @@ "material": "paper", "weight": 3, "volume": 0, - "bashing": 0, "cutting": 0, "to_hit": 0 }, @@ -49,7 +47,6 @@ "material": "paper", "weight": 3, "volume": 0, - "bashing": 0, "cutting": 0, "to_hit": 0 }, @@ -67,7 +64,6 @@ "material": "paper", "weight": 3, "volume": 0, - "bashing": 0, "cutting": 0, "to_hit": 0 }, @@ -85,7 +81,6 @@ "material": "paper", "weight": 3, "volume": 0, - "bashing": 0, "cutting": 0, "to_hit": 0 }, @@ -103,7 +98,6 @@ "material": "paper", "weight": 3, "volume": 0, - "bashing": 0, "cutting": 0, "to_hit": 0 }, @@ -121,7 +115,6 @@ "material": "paper", "weight": 3, "volume": 0, - "bashing": 0, "cutting": 0, "to_hit": 0 }, @@ -139,7 +132,6 @@ "material": "paper", "weight": 3, "volume": 0, - "bashing": 0, "cutting": 0, "to_hit": 0 }, @@ -157,7 +149,6 @@ "material": "paper", "weight": 1, "volume": 0, - "bashing": 0, "cutting": 0, "to_hit": 0 } diff --git a/data/json/items/software.json b/data/json/items/software.json index 92cd6abbb3b8a..0df08c440022f 100644 --- a/data/json/items/software.json +++ b/data/json/items/software.json @@ -10,7 +10,6 @@ "price": 300, "weight": 0, "volume": 0, - "bashing": 0, "to_hit": 0, "software_data": { "power": 0, @@ -31,7 +30,6 @@ "price": 800, "weight": 0, "volume": 0, - "bashing": 0, "to_hit": 0, "software_data": { "power": 2, @@ -52,7 +50,6 @@ "price": 600, "weight": 0, "volume": 0, - "bashing": 0, "to_hit": 0, "software_data": { "power": 2, @@ -73,7 +70,6 @@ "price": 500, "weight": 0, "volume": 0, - "bashing": 0, "to_hit": 0, "software_data": { "power": 3, @@ -94,7 +90,6 @@ "price": 200, "weight": 0, "volume": 0, - "bashing": 0, "to_hit": 0, "software_data": { "power": 5, From abcb8d3c0164e700fde8b264d3cefda2917c54e2 Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Mon, 28 Dec 2015 18:12:13 +0100 Subject: [PATCH 51/61] Clean up a bit --- src/field.cpp | 6 +++--- src/monster.cpp | 7 +++++-- src/player.cpp | 7 +++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/field.cpp b/src/field.cpp index 48a85ecc4a401..961d9403646f0 100644 --- a/src/field.cpp +++ b/src/field.cpp @@ -1852,7 +1852,7 @@ void map::player_in_field( player &u ) int burn_min = adjusted_intensity; int burn_max = 3 * adjusted_intensity + 3; - std::list parts_burned; + std::list parts_burned; int msg_num = adjusted_intensity - 1; if( !u.is_on_ground() ) { switch( adjusted_intensity ) { @@ -1875,13 +1875,13 @@ void map::player_in_field( player &u ) // Lying in the fire is BAAAD news, hits every body part. msg_num = 3; for( int i = 0; i < num_bp; ++i ) { - parts_burned.push_back( i ); + parts_burned.push_back( (body_part)i ); } } int total_damage = 0; for( auto part_burned : parts_burned ) { - const auto dealt = u.deal_damage( nullptr, (body_part)part_burned, + const auto dealt = u.deal_damage( nullptr, part_burned, damage_instance( DT_HEAT, rng( burn_min, burn_max ) ) ); total_damage += dealt.type_damage( DT_HEAT ); } diff --git a/src/monster.cpp b/src/monster.cpp index 1b924086b9fd7..21427b55c099b 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1325,10 +1325,13 @@ int monster::get_armor_type( damage_type dt, body_part bp ) const return 0; case DT_ELECTRIC: return 0; - default: - debugmsg( "Invalid damage type: %d", dt ); + case DT_NULL: + case NUM_DT: + // Let it error below + break; } + debugmsg( "Invalid damage type: %d", dt ); return 0; } diff --git a/src/player.cpp b/src/player.cpp index 586fc4ddb907f..c48fc02de7599 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -12820,10 +12820,13 @@ int player::get_armor_type( damage_type dt, body_part bp ) const return 0; case DT_ELECTRIC: return 0; - default: - debugmsg( "Invalid damage type: %d", dt ); + case DT_NULL: + case NUM_DT: + // Let it error below + break; } + debugmsg( "Invalid damage type: %d", dt ); return 0; } From 4c30add97311c54022e12bf842924f560444ad49 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Mon, 28 Dec 2015 13:57:37 -0800 Subject: [PATCH 52/61] update --- data/json/recipes/recipe_food.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/data/json/recipes/recipe_food.json b/data/json/recipes/recipe_food.json index 6caf68bf00e7c..37c95ceb010ea 100644 --- a/data/json/recipes/recipe_food.json +++ b/data/json/recipes/recipe_food.json @@ -9804,6 +9804,18 @@ ["cranberries", 6], ["grapefruit", 2], ["grapes", 4], + ["kiwi", 2], + ["mango", 2], + ["melon", 4], + ["papaya", 2], + ["peach", 2], + ["pear", 2], + ["pineapple", 2], + ["plums", 2], + ["pomegranate", 2], + ["raspberries", 2], + ["strawberries", 2], + ["watermelon", 1], ["irradiated_apple", 2], ["irradiated_apricot", 2], ["irradiated_banana", 2], @@ -9824,19 +9836,7 @@ ["irradiated_pomegranate", 2], ["irradiated_raspberries", 2], ["irradiated_strawberries", 2], - ["irradiated_watermelon", 1], - ["kiwi", 2], - ["mango", 2], - ["melon", 4], - ["papaya", 2], - ["peach", 2], - ["pear", 2], - ["pineapple", 2], - ["plums", 2], - ["pomegranate", 2], - ["raspberries", 2], - ["strawberries", 2], - ["watermelon", 1] + ["irradiated_watermelon", 1] ], [ [ "water_clean", 1 ] @@ -9868,7 +9868,7 @@ ["cherries", 6], ["cranberries", 12], ["grapefruit", 2], - ["grapes", 4], + ["grapes", 8], ["kiwi", 6], ["mango", 4], ["melon", 6], From 1e5a5b6fe0e46ea44f2a4b56a7c7c410e215486d Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Mon, 28 Dec 2015 14:03:58 -0800 Subject: [PATCH 53/61] update 2 --- data/json/items/comestibles.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/items/comestibles.json b/data/json/items/comestibles.json index 63297024b4e82..d390d7f8a7a41 100644 --- a/data/json/items/comestibles.json +++ b/data/json/items/comestibles.json @@ -8028,7 +8028,7 @@ "volume" : 1, "cutting" : 0, "phase" : "solid", - "charges" : 2, + "charges" : 1, "bashing" : 0, "fun" : 0 }, From f172f9af8f5d81def3a7059393d7e56d71377ac3 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Mon, 28 Dec 2015 14:42:52 -0800 Subject: [PATCH 54/61] Update comestibles.json --- data/json/items/comestibles.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/items/comestibles.json b/data/json/items/comestibles.json index d390d7f8a7a41..63297024b4e82 100644 --- a/data/json/items/comestibles.json +++ b/data/json/items/comestibles.json @@ -8028,7 +8028,7 @@ "volume" : 1, "cutting" : 0, "phase" : "solid", - "charges" : 1, + "charges" : 2, "bashing" : 0, "fun" : 0 }, From 4a734b22b936c4f6065725fc59a756c30211b6d9 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Mon, 28 Dec 2015 14:45:53 -0800 Subject: [PATCH 55/61] Update recipe_food.json --- data/json/recipes/recipe_food.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/json/recipes/recipe_food.json b/data/json/recipes/recipe_food.json index 37c95ceb010ea..1cd22c11ec60a 100644 --- a/data/json/recipes/recipe_food.json +++ b/data/json/recipes/recipe_food.json @@ -9803,7 +9803,7 @@ ["cherries", 2], ["cranberries", 6], ["grapefruit", 2], - ["grapes", 4], + ["grapes", 2], ["kiwi", 2], ["mango", 2], ["melon", 4], @@ -9868,7 +9868,7 @@ ["cherries", 6], ["cranberries", 12], ["grapefruit", 2], - ["grapes", 8], + ["grapes", 4], ["kiwi", 6], ["mango", 4], ["melon", 6], From cc30d7b34fcb39f9ab0076b3c8ef91fba99c19ad Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Mon, 28 Dec 2015 23:33:18 -0800 Subject: [PATCH 56/61] Soylent green --- data/json/items/comestibles.json | 88 +++++++++++++++++++++ data/json/recipes/recipe_food.json | 123 ++++++++++++++++++++++++++++- 2 files changed, 210 insertions(+), 1 deletion(-) diff --git a/data/json/items/comestibles.json b/data/json/items/comestibles.json index b376467e38acf..d036e84f4b806 100644 --- a/data/json/items/comestibles.json +++ b/data/json/items/comestibles.json @@ -17121,6 +17121,35 @@ "bashing" : 0, "fun" : -4 }, + { + "type" : "COMESTIBLE", + "id" : "hflesh_powder", + "name" : "soylent green powder", + "name_plural" : "servings of soylent green powder", + "weight" : 38, + "color" : "white", + "addiction_type" : "none", + "spoils_in" : 0, + "stim" : 0, + "container" : "bottle_plastic_small", + "to_hit" : 0, + "comestible_type" : "FOOD", + "symbol" : "%", + "quench" : -4, + "healthy" : 1, + "addiction_potential" : 0, + "nutrition" : 10, + "description" : "Raw, refined protein made of people! While quite nutritious, it is difficult to enjoy in its pure form.", + "price" : 1100, + "material" : [ "powder", "hflesh" ], + "tool" : "null", + "volume" : 1, + "cutting" : 0, + "phase" : "solid", + "charges" : 4, + "bashing" : 0, + "fun" : -4 + }, { "type" : "COMESTIBLE", "id" : "lemonade_powder", @@ -17179,6 +17208,36 @@ "flags" : ["EATEN_COLD"], "fun" : -1 }, + { + "type" : "COMESTIBLE", + "id" : "hflesh_drink", + "name" : "soylent green", + "name_plural" : "soylent green drinks", + "weight" : 288, + "color" : "light_gray", + "addiction_type" : "none", + "spoils_in" : 0, + "stim" : 0, + "to_hit" : 0, + "comestible_type" : "DRINK", + "container": "bottle_plastic", + "symbol" : "%", + "quench" : 40, + "healthy" : 2, + "addiction_potential" : 0, + "nutrition" : 10, + "description" : "A thin slurry of refined human protein mixed with water. While quite nutritious, it is not particularly tasty.", + "price" : 200, + "material" : "hflesh", + "tool" : "null", + "volume" : 1, + "cutting" : 0, + "phase" : "liquid", + "charges" : 1, + "bashing" : 0, + "flags" : ["EATEN_COLD"], + "fun" : -1 + }, { "type" : "COMESTIBLE", "id" : "protein_shake", @@ -17208,6 +17267,35 @@ "flags" : ["EATEN_COLD"], "fun" : 4 }, + { + "type" : "COMESTIBLE", + "id" : "hflesh_shake", + "name" : "soylent green shake", + "weight" : 322, + "color" : "yellow", + "addiction_type" : "none", + "spoils_in" : 0, + "stim" : 0, + "to_hit" : 0, + "comestible_type" : "DRINK", + "container": "bottle_plastic", + "symbol" : "%", + "quench" : 40, + "healthy" : 4, + "addiction_potential" : 0, + "nutrition" : 30, + "description" : "A thick and tasty beverage made from pure refined human protein and nutritious fruit.", + "price" : 300, + "material" : [ "fruit", "hflesh" ] + "tool" : "null", + "volume" : 1, + "cutting" : 0, + "phase" : "liquid", + "charges" : 1, + "bashing" : 0, + "flags" : ["EATEN_COLD"], + "fun" : 4 + }, { "type" : "COMESTIBLE", "id" : "watermelon", diff --git a/data/json/recipes/recipe_food.json b/data/json/recipes/recipe_food.json index 8acbc613c360f..d72a808d0ea6c 100644 --- a/data/json/recipes/recipe_food.json +++ b/data/json/recipes/recipe_food.json @@ -950,10 +950,36 @@ "components": [ [ [ "dry_meat", 2 ], - [ "dry_hflesh", 2 ], [ "dry_fish", 2 ] ] ] +},{ + "type" : "recipe", + "result": "hflesh_powder", + "category": "CC_FOOD", + "subcategory": "CSC_FOOD_OTHER", + "skill_used": "cooking", + "difficulty": 4, + "time": 12000, + "reversible": false, + "autolearn": false, + "book_learn": [ [ "cookbook_human", 4 ] ], + "batch_time_factors":[83, 3], + "qualities":[ + {"id":"CHEM","level":2,"amount":1} + ], "tools": [ + [ + [ "hotplate", 25 ], + [ "toolset", 25 ], + [ "fire", -1 ], + [ "char_smoker", 3 ] + ] + ], + "components": [ + [ + [ "dry_hflesh", 2 ] + ] + ] },{ "type" : "recipe", "result": "protein_drink", @@ -972,6 +998,25 @@ [ "water_clean", 1 ] ] ] +},{ + "type" : "recipe", + "result": "hflesh_drink", + "category": "CC_FOOD", + "subcategory": "CSC_FOOD_DRINKS", + "skill_used": "cooking", + "difficulty": 0, + "time": 4000, + "reversible": false, + "autolearn": false, + "book_learn": [ [ "cookbook_human", 0 ] ], + "components": [ + [ + [ "hflesh_powder", 1 ] + ], + [ + [ "water_clean", 1 ] + ] + ] },{ "type" : "recipe", "result": "protein_shake", @@ -1047,6 +1092,82 @@ ["watermelon", 1] ] ] +},{ + "type" : "recipe", + "result": "hflesh_shake", + "category": "CC_FOOD", + "subcategory": "CSC_FOOD_DRINKS", + "skill_used": "cooking", + "difficulty": 0, + "time": 4000, + "reversible": false, + "autolearn": false, + "book_learn": [ [ "cookbook_human", 0 ] ], + "qualities" : [ + {"id":"CUT","level":1,"amount":1} + ], + "components": [ + [ + [ "hflesh_powder", 1 ] + ], + [ + [ "water_clean", 1 ] + ], + [ + ["lemonade_powder", 1], + ["apple", 1], + ["apricot", 1], + ["banana", 1], + ["blackberries", 1], + ["blueberries", 1], + ["cherries", 1], + ["coconut", 1], + ["cranberries", 3], + ["dry_fruit", 1], + ["grapefruit", 1], + ["grapes", 2], + ["irradiated_apple", 1], + ["irradiated_apricot", 1], + ["irradiated_banana", 1], + ["irradiated_blackberries", 1], + ["irradiated_blueberries", 1], + ["irradiated_cherries", 1], + ["irradiated_cranberries", 3], + ["irradiated_grapefruit", 1], + ["irradiated_grapes", 2], + ["irradiated_kiwi", 1], + ["irradiated_lemon", 1], + ["irradiated_mango", 1], + ["irradiated_melon", 2], + ["irradiated_orange", 1], + ["irradiated_papaya", 1], + ["irradiated_peach", 1], + ["irradiated_pear", 1], + ["irradiated_pineapple", 1], + ["irradiated_plums", 1], + ["irradiated_pomegranate", 1], + ["irradiated_raspberries", 1], + ["irradiated_strawberries", 1], + ["irradiated_watermelon", 1], + ["juice_pulp", 2], + ["kiwi", 1], + ["lemon", 1], + ["mango", 1], + ["melon", 2], + ["orange", 1], + ["papaya", 1], + ["peach", 1], + ["pear", 1], + ["pineapple", 1], + ["plums", 1], + ["pomegranate", 1], + ["raspberries", 1], + ["rehydrated_fruit", 1], + ["can_peach", 1], + ["strawberries", 1], + ["watermelon", 1] + ] + ] },{ "type" : "recipe", "result": "dry_veggy", From 742df94a547bccd084022c0eed5b169c99cd5e04 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Mon, 28 Dec 2015 23:41:13 -0800 Subject: [PATCH 57/61] Update comestibles.json --- data/json/items/comestibles.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/items/comestibles.json b/data/json/items/comestibles.json index d036e84f4b806..e7f3ee77b11ca 100644 --- a/data/json/items/comestibles.json +++ b/data/json/items/comestibles.json @@ -17286,7 +17286,7 @@ "nutrition" : 30, "description" : "A thick and tasty beverage made from pure refined human protein and nutritious fruit.", "price" : 300, - "material" : [ "fruit", "hflesh" ] + "material" : [ "fruit", "hflesh" ], "tool" : "null", "volume" : 1, "cutting" : 0, From b629cfedb4b0e8b570064e9e7ae21d36350d58de Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Tue, 29 Dec 2015 01:19:50 -0800 Subject: [PATCH 58/61] Update comestibles.json --- data/json/items/comestibles.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/items/comestibles.json b/data/json/items/comestibles.json index e7f3ee77b11ca..6e750e2654d45 100644 --- a/data/json/items/comestibles.json +++ b/data/json/items/comestibles.json @@ -17139,7 +17139,7 @@ "healthy" : 1, "addiction_potential" : 0, "nutrition" : 10, - "description" : "Raw, refined protein made of people! While quite nutritious, it is difficult to enjoy in its pure form.", + "description" : "Raw, refined protein made out of people! While quite nutritious, it is difficult to enjoy in its pure form.", "price" : 1100, "material" : [ "powder", "hflesh" ], "tool" : "null", From 64d43b7e1b4a041b4fe03f233ee90c759ce2093f Mon Sep 17 00:00:00 2001 From: Mugling Date: Wed, 30 Dec 2015 00:41:26 +0000 Subject: [PATCH 59/61] Clearer message when insufficient ammo to reload Fixes #14630 --- src/game.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/game.cpp b/src/game.cpp index fb0b1665e56d4..2e42cb39eda5d 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -11314,7 +11314,13 @@ void game::reload( int pos ) // pick ammo int am_pos = it->pick_reload_ammo( u, true ); if( am_pos == INT_MIN ) { - add_msg( m_info, _( "Out of %s!" ), it->is_gun() ? _("ammo") : ammo_name( it->ammo_type() ).c_str() ); + if( it->is_gun() ) { + add_msg( m_info, _( "Out of ammo!" ) ); + } else if( it->has_curammo() ) { + add_msg( m_info, _( "Out of %s!" ), item::nname( it->get_curammo_id() ).c_str() ); + } else { + add_msg( m_info, _( "Out of %s!" ), ammo_name( it->ammo_type() ).c_str() ); + } } else if( am_pos == INT_MIN + 2 ) { add_msg( m_info, _( "Never mind." ) ); } else { From 991ac5855361081b62764790ea2ff343ea63850e Mon Sep 17 00:00:00 2001 From: Coolthulhu Date: Wed, 30 Dec 2015 06:06:19 +0100 Subject: [PATCH 60/61] Fix zero division in fire_gun --- src/ranged.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ranged.cpp b/src/ranged.cpp index 234c97effaac3..3a9212cf478ae 100644 --- a/src/ranged.cpp +++ b/src/ranged.cpp @@ -489,7 +489,8 @@ void player::fire_gun( const tripoint &targ_arg, bool burst ) // Experience gain is limited by range and penalised proportional to inaccuracy. int exp = std::min( range, 3 * ( skillLevel( skill_used ) + 1 ) ) * 20; - int penalty = sqrt( missed_by * 36 ); + // Make sure the penalty doesn't become 0 + int penalty = sqrt( missed_by * 36 ) + 1; // Even if we are not training we practice the skill to prevent rust. practice( skill_used, train_skill ? exp / penalty : 0 ); From 5bdc29e7e0c5d7c4e1612050ce77d7a64146aa69 Mon Sep 17 00:00:00 2001 From: Cyrano7 Date: Wed, 30 Dec 2015 02:31:20 -0800 Subject: [PATCH 61/61] coffee plural fix --- data/json/items/comestibles.json | 1 + 1 file changed, 1 insertion(+) diff --git a/data/json/items/comestibles.json b/data/json/items/comestibles.json index 6e750e2654d45..1b681e0607432 100644 --- a/data/json/items/comestibles.json +++ b/data/json/items/comestibles.json @@ -4006,6 +4006,7 @@ "type" : "COMESTIBLE", "id" : "coffee", "name" : "coffee", + "name_plural" : "coffee", "weight" : 254, "color" : "brown", "addiction_type" : "caffeine",