diff --git a/data/json/external_tileset/External_Tileset_DP_Normal.json b/data/json/external_tileset/External_Tileset_DP_Normal.json index 964a23bbf10b..bc172447203c 100644 --- a/data/json/external_tileset/External_Tileset_DP_Normal.json +++ b/data/json/external_tileset/External_Tileset_DP_Normal.json @@ -57,7 +57,8 @@ { "id": "cacao_pod", "fg": 46 }, { "id": "overlay_wielded_cacao_pod", "fg": 46 }, { "id": "f_sign", "fg": 47 }, - { "id": "tr_can_alarm", "fg": 48 } + { "id": "tr_can_alarm", "fg": 48 }, + { "id": "mon_mothman", "fg": 49 } ], "sprite_width": 32, "sprite_height": 32 diff --git a/data/json/external_tileset/External_Tileset_DP_Normal.png b/data/json/external_tileset/External_Tileset_DP_Normal.png index 2f6da180b964..91096c4e200d 100644 Binary files a/data/json/external_tileset/External_Tileset_DP_Normal.png and b/data/json/external_tileset/External_Tileset_DP_Normal.png differ diff --git a/data/json/monster_factions.json b/data/json/monster_factions.json index 8f25d12b6827..590b77df41b7 100644 --- a/data/json/monster_factions.json +++ b/data/json/monster_factions.json @@ -18,14 +18,14 @@ "type": "MONSTER_FACTION", "name": "zombie", "friendly": [ "blob", "cult", "zombie_aquatic" ], - "neutral": [ "small_animal", "insect", "fish" ], + "neutral": [ "small_animal", "insect", "fish", "nether" ], "by_mood": "bee" }, { "type": "MONSTER_FACTION", "name": "zombie_aquatic", "friendly": [ "blob", "cult", "zombie" ], - "neutral": [ "small_animal", "insect" ], + "neutral": [ "small_animal", "insect", "nether" ], "by_mood": "bee" }, { @@ -36,7 +36,8 @@ { "type": "MONSTER_FACTION", "name": "nether", - "friendly": [ "blob", "cult" ] + "friendly": [ "blob", "cult" ], + "neutral": [ "zombie", "zombie_aquatic", "science" ] }, { "type": "MONSTER_FACTION", @@ -75,7 +76,7 @@ "type": "MONSTER_FACTION", "name": "science", "base_faction": "zombie", - "neutral": [ "bot" ] + "neutral": [ "bot", "nether" ] }, { "type": "MONSTER_FACTION", diff --git a/data/json/monster_special_attacks/spells.json b/data/json/monster_special_attacks/spells.json index da63392d4628..7a8aad44b7b0 100644 --- a/data/json/monster_special_attacks/spells.json +++ b/data/json/monster_special_attacks/spells.json @@ -149,5 +149,39 @@ "max_range": 25, "min_aoe": 4, "max_aoe": 4 + }, + { + "id": "spell_mothman_ninja_vanish", + "type": "SPELL", + "name": { "str": "Creeping Darkness" }, + "description": "This is a monster spell, used by the lepidopterid.", + "message": "", + "effect": "target_attack", + "effect_str": "blind", + "extra_effects": [ { "id": "spell_mothman_ninja_vanish_teleport" } ], + "valid_targets": [ "hostile", "ground" ], + "flags": [ "NO_EXPLOSION_VFX", "SILENT" ], + "min_range": 1, + "max_range": 1, + "min_aoe": 6, + "max_aoe": 6, + "min_duration": 1000, + "max_duration": 2000, + "field_id": "fd_shadow", + "field_chance": 1, + "min_field_intensity": 1, + "max_field_intensity": 1 + }, + { + "type": "SPELL", + "id": "spell_mothman_ninja_vanish_teleport", + "name": { "str": "Creeping Darkness Teleport" }, + "description": "And this teleports the caster, counts as a safe teleport.", + "message": "", + "effect": "teleport_random", + "valid_targets": [ "self" ], + "flags": [ "NO_EXPLOSION_VFX", "SILENT" ], + "min_range": 20, + "max_range": 40 } ] diff --git a/data/json/monsterdrops/misc.json b/data/json/monsterdrops/misc.json index 3dc507967c58..5c048c30dafa 100644 --- a/data/json/monsterdrops/misc.json +++ b/data/json/monsterdrops/misc.json @@ -21,5 +21,25 @@ { "item": "cable", "charges-min": 20, "charges-max": 50 }, { "item": "amplifier", "count": [ 0, 3 ] } ] + }, + { + "type": "item_group", + "id": "mon_gozu_death_drops", + "subtype": "collection", + "entries": [ + { + "distribution": [ + { "group": "male_underwear_bottom", "prob": 50, "damage": [ 1, 4 ] }, + { "group": "loincloth", "prob": 50, "damage": [ 1, 4 ] } + ] + }, + { + "distribution": [ + { "group": "male_underwear_top", "prob": 25, "damage": [ 1, 4 ] }, + { "item": "rag", "prob": 25, "damage": [ 1, 4 ], "count": [ 1, 4 ] } + ], + "prob": 50 + } + ] } ] diff --git a/data/json/monstergroups/nether.json b/data/json/monstergroups/nether.json index 01d41e6bd046..4deff5fe8e0f 100644 --- a/data/json/monstergroups/nether.json +++ b/data/json/monstergroups/nether.json @@ -32,16 +32,17 @@ "name": "GROUP_NETHER_FATIGUE_FIELD", "default": "mon_blank", "monsters": [ - { "monster": "mon_flying_polyp", "freq": 100, "cost_multiplier": 0 }, - { "monster": "mon_hunting_horror", "freq": 100, "cost_multiplier": 0 }, + { "monster": "mon_flying_polyp", "freq": 50, "cost_multiplier": 0 }, + { "monster": "mon_hunting_horror", "freq": 50, "cost_multiplier": 0 }, { "monster": "mon_mi_go", "freq": 100, "cost_multiplier": 0 }, - { "monster": "mon_mi_go_scout", "freq": 100, "cost_multiplier": 0, "starts": 840 }, + { "monster": "mon_mi_go_scout", "freq": 50, "cost_multiplier": 0, "starts": 840 }, { "monster": "mon_yugg", "freq": 100, "cost_multiplier": 0 }, { "monster": "mon_gelatin", "freq": 100, "cost_multiplier": 0 }, { "monster": "mon_flaming_eye", "freq": 100, "cost_multiplier": 0 }, { "monster": "mon_kreck", "freq": 100, "cost_multiplier": 0 }, { "monster": "mon_gracke", "freq": 100, "cost_multiplier": 0 }, - { "monster": "mon_blank", "freq": 100, "cost_multiplier": 0 } + { "monster": "mon_blank", "freq": 100, "cost_multiplier": 0 }, + { "monster": "mon_mothman", "freq": 100, "cost_multiplier": 0 } ] }, { @@ -56,7 +57,8 @@ { "monster": "mon_flaming_eye", "freq": 120, "cost_multiplier": 0 }, { "monster": "mon_kreck", "freq": 210, "cost_multiplier": 0 }, { "monster": "mon_gozu", "freq": 25, "cost_multiplier": 0 }, - { "monster": "mon_shoggoth", "freq": 5, "cost_multiplier": 0 } + { "monster": "mon_shoggoth", "freq": 5, "cost_multiplier": 0 }, + { "monster": "mon_mothman", "freq": 60, "cost_multiplier": 0 } ] }, { @@ -80,7 +82,8 @@ { "monster": "mon_flaming_eye", "freq": 200, "cost_multiplier": 0 }, { "monster": "mon_kreck", "freq": 200, "cost_multiplier": 0 }, { "monster": "mon_gracke", "freq": 200, "cost_multiplier": 0 }, - { "monster": "mon_blank", "freq": 200, "cost_multiplier": 0 } + { "monster": "mon_blank", "freq": 150, "cost_multiplier": 0 }, + { "monster": "mon_mothman", "freq": 50, "cost_multiplier": 0 } ] }, { diff --git a/data/json/monsters/nether.json b/data/json/monsters/nether.json index 260156f9bf84..13f634781e28 100644 --- a/data/json/monsters/nether.json +++ b/data/json/monsters/nether.json @@ -65,7 +65,7 @@ "id": "mon_blank", "type": "MONSTER", "name": { "str": "blank body", "str_pl": "blank bodies" }, - "description": "This is some form of unnatural changeling creature; its appearance is a bland mockery of the human form. Featureless and pale, its repugnant countenance is all the more unsettling due to its lack of eyes and distinguishing features except for a perfectly round mouth. Naked and trembling, it almost seems pitiful but for the way that its unearthly presence makes the hair on the back of your neck stand up in nameless horror.", + "description": "This is some form of unnatural changeling creature; its appearance is a bland mockery of the human form. Featureless and pale, its repugnant countenance is all the more unsettling due to its lack of eyes and distinguishing features except for a perfectly round mouth. Naked and trembling, it almost seems pitiful.", "default_faction": "nether", "bodytype": "human", "species": [ "NETHER" ], @@ -84,9 +84,10 @@ "melee_cut": 0, "dodge": 1, "harvest": "human", - "special_attacks": [ [ "SHRIEK", 10 ] ], + "special_attacks": [ [ "SHRIEK", 10 ], { "type": "bite", "cooldown": 10 } ], + "anger_triggers": [ "NETHER_ATTENTION" ], "death_function": [ "NORMAL" ], - "flags": [ "SMELLS", "HEARS", "WARM", "ANIMAL", "PATH_AVOID_DANGER_1", "SUNDEATH", "NO_BREATHE", "HUMAN" ] + "flags": [ "SMELLS", "HEARS", "WARM", "ANIMAL", "PATH_AVOID_DANGER_1", "SUNDEATH", "NO_BREATHE", "HUMAN", "GRABS" ] }, { "id": "mon_blood_sacrifice", @@ -129,10 +130,13 @@ "symbol": "o", "color": "pink", "melee_cut": 0, + "armor_bash": 6, + "armor_stab": 10, + "armor_acid": 10, "harvest": "exempt", "special_attacks": [ [ "BREATHE", 8 ] ], "death_function": [ "MELT" ], - "flags": [ "IMMOBILE", "NOGIB" ] + "flags": [ "IMMOBILE", "NOGIB", "NOHEAD" ] }, { "id": "mon_breather_hub", @@ -149,10 +153,16 @@ "symbol": "O", "color": "pink", "melee_cut": 0, + "armor_bash": 14, + "armor_cut": 4, + "armor_bullet": 3, + "armor_stab": 20, "harvest": "exempt", + "regenerates": 1, + "emit_fields": [ { "emit_id": "emit_hot_air4_blast", "delay": "8 s" } ], "special_attacks": [ [ "BREATHE", 8 ] ], "death_function": [ "KILL_BREATHERS" ], - "flags": [ "ACIDPROOF", "ACID_BLOOD", "IMMOBILE" ] + "flags": [ "ACIDPROOF", "ACID_BLOOD", "IMMOBILE", "NOGIB", "NOHEAD", "PLASTIC" ] }, { "id": "mon_darkman", @@ -182,6 +192,7 @@ "luminance": 6, "harvest": "exempt", "special_attacks": [ [ "DARKMAN", 5 ], [ "scratch", 15 ] ], + "anger_triggers": [ "NETHER_ATTENTION" ], "death_function": [ "DARKMAN" ], "regenerates_in_dark": true, "flags": [ "NOHEAD", "HARDTOSHOOT", "WEBWALK", "FLIES", "PLASTIC", "COLDPROOF", "ACIDPROOF", "SUNDEATH", "NO_BREATHE" ] @@ -245,7 +256,7 @@ "id": "mon_flaming_eye", "type": "MONSTER", "name": { "str": "flaming eye" }, - "description": "An enormous disembodied eyeball the size of a person, flying through the air through some unknown agency. Wreathed in unnatural flickering blue flame, it possesses a blazing yellow iris with a slitted pupil like that of a cat and trails a set of flailing black tendrils as it slowly drifts about; its unearthly presence filling you with dread at the prospect of falling under its baleful gaze.", + "description": "An enormous disembodied eyeball the size of a person, flying through the air through some unknown agency. Wreathed in unnatural flickering blue flame, it possesses a blazing yellow iris with a slitted pupil like that of a cat and trails a set of flailing black tendrils as it slowly drifts about. A baleful gaze seems to emanate from it.", "default_faction": "nether", "species": [ "NETHER" ], "diff": 20, @@ -301,7 +312,7 @@ "id": "mon_flying_polyp", "type": "MONSTER", "name": { "str": "flying polyp" }, - "description": "A half polypous, utterly alien creature. It's only partly material and has the ability to fly, despite the absence of wings. It produces strange whistling noises which send cold shivers of primal terror down your spine.", + "description": "A half polypous, utterly alien creature. It's only partly material and has the ability to fly, despite the absence of wings. The air swirling around it gives the impression of breathing or whistling, in a tone too high for most humans to hear.", "default_faction": "nether", "bodytype": "blob", "species": [ "NETHER" ], @@ -329,7 +340,7 @@ "id": "mon_gozu", "type": "MONSTER", "name": { "str": "gozu" }, - "description": "This is some sort of unnatural cross between a bull and a man. Quite different from the minotaur of legend, it possesses a shaggy white bull’s head on an otherwise unremarkable human body. Clad in sagging socks and stained jockey shorts, it grunts and snuffles, drooling ropey strands of white slobber down its chest. Its mere presence fills you with an unfathomable dread.", + "description": "This is some sort of unnatural cross between a bull and a man. Quite different from the minotaur of legend, it possesses a shaggy white bull’s head on an otherwise unremarkable human body. Clad in tattered remnants of clothing, it grunts and snuffles, frothing at the mouth like a rabid animal.", "default_faction": "nether", "bodytype": "human", "species": [ "NETHER" ], @@ -351,6 +362,7 @@ "vision_day": 30, "harvest": "gozu", "special_attacks": [ [ "FEAR_PARALYZE", 20 ] ], + "death_drops": "mon_gozu_death_drops", "death_function": [ "NORMAL" ], "flags": [ "SEES", @@ -369,7 +381,7 @@ "id": "mon_gracke", "type": "MONSTER", "name": { "str": "gracken" }, - "description": "This is some form of eldritch monstrosity; an uncouth black being with smooth, oily, skin and unpleasant horns that curve inward toward each other. Tall and thin, the shadows cling unnaturally to its vaguely defined humanoid form as it shuffles along, its hands twitching and spasming so rapidly as to appear a little more than a black blur of claws. Gazing upon its disturbing form fills you with an unspeakable terror.", + "description": "This is some form of eldritch monstrosity; an uncouth black being with smooth, oily, skin and unpleasant horns that curve inward toward each other. Tall and thin, the shadows cling unnaturally to its vaguely defined humanoid form as it shuffles along, its hands twitching and spasming so rapidly as to appear a little more than a black blur of claws.", "default_faction": "nether", "bodytype": "human", "species": [ "NETHER" ], @@ -385,11 +397,14 @@ "melee_skill": 10, "melee_dice": 4, "melee_dice_sides": 4, - "melee_cut": 0, + "melee_cut": 2, "dodge": 4, + "vision_night": 10, "harvest": "human", "death_function": [ "NORMAL" ], - "flags": [ "SMELLS", "HEARS", "WARM", "NO_BREATHE", "GRABS", "HUMAN", "PATH_AVOID_DANGER_2", "PRIORITIZE_TARGETS" ] + "anger_triggers": [ "NETHER_ATTENTION" ], + "special_attacks": [ { "id": "scratch", "damage_max_instance": [ { "damage_type": "cut", "amount": 8, "armor_multiplier": 0.8 } ] } ], + "flags": [ "SEES", "SMELLS", "HEARS", "WARM", "NO_BREATHE", "GRABS", "HUMAN", "PATH_AVOID_DANGER_2", "PRIORITIZE_TARGETS" ] }, { "id": "mon_headless_dog_thing", @@ -571,7 +586,7 @@ "id": "mon_hunting_horror", "type": "MONSTER", "name": { "str": "hunting horror" }, - "description": "This is some sort of great viperine creature, possessed of a curiously distorted head and massive clawed appendages. It partially supports itself with the aid of black rubbery wings of monstrous dimensions. Its form writhes and changes before your eyes, filling you with unnameable horror.", + "description": "This is some sort of great viperine creature, possessed of a curiously distorted head and massive clawed appendages. It partially supports itself with the aid of black rubbery wings of monstrous dimensions.", "default_faction": "nether", "species": [ "NETHER" ], "volume": "62500 ml", @@ -609,7 +624,7 @@ "id": "mon_kreck", "type": "MONSTER", "name": { "str": "kreck" }, - "description": "This is some form of otherworldly hound. Lean and hungry looking, its twisted red flesh is stretched tightly across its misshapen, angular frame. Loping grotesquely along, its unusually long neck stretches forward, its skull-like head near the ground as it sniffs out its prey. Its foulness partially veiled by some arcane force, it seems to almost flicker in and out of your perceptions in a fashion that awakens ancient nameless terrors in the back of your mind", + "description": "This is some form of otherworldly hound. Lean and hungry looking, its twisted red flesh is stretched tightly across its misshapen, angular frame. Loping grotesquely along, its unusually long neck stretches forward, its skull-like head near the ground as it sniffs out its prey.", "default_faction": "nether", "bodytype": "quadruped", "species": [ "NETHER" ], @@ -635,11 +650,68 @@ "death_function": [ "MELT" ], "flags": [ "SEES", "SMELLS", "HEARS", "WARM", "BASHES", "HIT_AND_RUN", "NO_BREATHE", "NOGIB" ] }, + { + "id": "mon_mothman", + "type": "MONSTER", + "name": { "str": "lepidopterid" }, + "description": "A humanoid figure flitting about on what appears to be multiple pairs of insectoid wings. Its outline is obscured by a pitch-black haze surrounding it, a faint glimmer of glowing eyes evident.", + "default_faction": "nether", + "bodytype": "angel", + "species": [ "NETHER" ], + "diff": 10, + "volume": "92500 ml", + "weight": "120 kg", + "hp": 300, + "speed": 200, + "material": [ "iflesh" ], + "symbol": "M", + "color": "dark_gray", + "looks_like": "mon_zombie_necro", + "morale": 100, + "melee_skill": 7, + "melee_dice": 3, + "melee_dice_sides": 4, + "melee_cut": 5, + "dodge": 5, + "armor_bash": 8, + "armor_cut": 16, + "armor_bullet": 20, + "vision_day": 20, + "vision_night": 50, + "path_settings": { "max_dist": 5 }, + "death_function": [ "MELT" ], + "anger_triggers": [ "NETHER_ATTENTION" ], + "harvest": "exempt", + "regenerates_in_dark": true, + "special_attacks": [ + { "type": "leap", "cooldown": 10, "max_range": 5 }, + [ "SHRIEK_ALERT", 10 ], + [ "SHRIEK_STUN", 1 ], + { + "type": "spell", + "spell_data": { "id": "spell_mothman_ninja_vanish" }, + "cooldown": 100, + "monster_message": "Creeping darkness radiates from %s!" + } + ], + "flags": [ + "SEES", + "SMELLS", + "KEENNOSE", + "PATH_AVOID_DANGER_2", + "FLIES", + "HARDTOSHOOT", + "WEBWALK", + "NO_BREATHE", + "COLDPROOF", + "NIGHT_INVISIBILITY" + ] + }, { "id": "mon_shadow", "type": "MONSTER", "name": { "str": "shadow" }, - "description": "This is an animate shadow. Looking like nothing more than an errant patch of normal shadow, it draws your attention by the way it moves subtly and whispers softly in the back of your mind. Strange intrusive thoughts accompany the quiet murmur, awakening your most horrific memories and fears.", + "description": "This is an animate shadow. Looking like nothing more than an errant patch of normal shadow, it draws your attention by the way it moves subtly and whispers softly in the back of your mind. Strange intrusive thoughts accompany its quiet murmurs.", "default_faction": "nether", "species": [ "NETHER" ], "diff": 2, @@ -799,7 +871,7 @@ "id": "mon_yugg", "type": "MONSTER", "name": { "str": "yugg" }, - "description": "This is a huge, slimy worm-like creature. Its pale, flattened head drips an oily mucus as it breaches the ground, searching for prey. Its pinkish mouth opens and closes, revealing long fangs glistening with ropey strands of saliva, which leave smoldering stains wherever they drip. The mere sight of its putrid whitish visage is enough to loose prehistoric terrors within the darkest recesses of your mind.", + "description": "This is a huge, slimy worm-like creature. Its pale, flattened head drips an oily mucus as it breaches the ground, searching for prey. Its pinkish mouth opens and closes, revealing long fangs glistening with ropey strands of saliva, which leave smoldering stains wherever they drip.", "default_faction": "nether", "bodytype": "snake", "species": [ "NETHER" ], @@ -822,7 +894,7 @@ "harvest": "meatslug", "special_attacks": [ [ "GENE_STING", 20 ] ], "death_function": [ "NORMAL" ], - "flags": [ "SEES", "SMELLS", "HEARS", "BASHES", "DESTROYS", "POISON", "VENOM", "NO_BREATHE", "DIGS" ] + "flags": [ "SEES", "SMELLS", "HEARS", "BASHES", "DESTROYS", "POISON", "VENOM", "NO_BREATHE", "CAN_DIG" ] }, { "id": "mon_vortex", diff --git a/data/json/monsters/slimes.json b/data/json/monsters/slimes.json index 511708c02989..0db236175256 100644 --- a/data/json/monsters/slimes.json +++ b/data/json/monsters/slimes.json @@ -138,11 +138,12 @@ "melee_skill": 4, "melee_dice": 2, "melee_dice_sides": 3, - "melee_cut": 0, + "melee_damage": [ { "damage_type": "acid", "amount": 5 } ], "armor_bash": 10, "harvest": "exempt", "special_attacks": [ [ "FORMBLOB", 4 ] ], "death_function": [ "MELT" ], + "anger_triggers": [ "NETHER_ATTENTION" ], "flags": [ "SMELLS", "HEARS", "PLASTIC", "NO_BREATHE", "NOHEAD", "NOGIB" ] }, { diff --git a/doc/src/content/docs/en/mod/json/reference/graphics/external_tileset.md b/doc/src/content/docs/en/mod/json/reference/graphics/external_tileset.md index bcead80800ab..76b6acc8550d 100644 --- a/doc/src/content/docs/en/mod/json/reference/graphics/external_tileset.md +++ b/doc/src/content/docs/en/mod/json/reference/graphics/external_tileset.md @@ -38,6 +38,7 @@ Links to relevant pull requests, for content covered below: - New trees: [#3626](https://github.com/cataclysmbnteam/Cataclysm-BN/pull/3626) - Alternative sign sprite: [#3670](https://github.com/cataclysmbnteam/Cataclysm-BN/pull/3670) - New traps: [#3939](https://github.com/cataclysmbnteam/Cataclysm-BN/pull/3939) +- New monster: [#4182](https://github.com/cataclysmbnteam/Cataclysm-BN/pull/4182) ## Undead People @@ -78,6 +79,7 @@ Ultica are planned for the future. - Cacao pods. Item specific to BN. - Override for sign sprite. Removes lettering on the front specific to DDA. - Makeshift perimeter alarm. Trap specific to BN. +- Lepidopterid. New monster specific to BN. ### External_Tileset_DP_Tall.png diff --git a/src/monattack.cpp b/src/monattack.cpp index 6e3c3466b011..f967e13943d9 100644 --- a/src/monattack.cpp +++ b/src/monattack.cpp @@ -2841,7 +2841,7 @@ bool mattack::gene_sting( monster *z ) bool hit = sting_shoot( z, target, dam, range ); if( hit ) { //Add checks if previous NPC/player conditions are removed - dynamic_cast( target )->mutate(); + dynamic_cast( target )->irradiate( rng( 100, 300 ) ); } return true; diff --git a/src/monster.cpp b/src/monster.cpp index 665d82321e84..c8c7d4d1c2bf 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -63,6 +63,7 @@ static const ammo_effect_str_id ammo_effect_WHIP( "WHIP" ); +static const efftype_id effect_attention( "attention" ); static const efftype_id effect_badpoison( "badpoison" ); static const efftype_id effect_beartrap( "beartrap" ); static const efftype_id effect_bleed( "bleed" ); @@ -1347,6 +1348,11 @@ monster_attitude monster::attitude( const Character *u ) const } } + if( type->has_anger_trigger( mon_trigger::NETHER_ATTENTION ) && + u->has_effect( effect_attention ) ) { + return MATT_ATTACK; + } + if( type->in_species( FUNGUS ) && ( u->has_trait( trait_THRESH_MYCUS ) || u->has_trait( trait_MYCUS_FRIEND ) ) ) { return MATT_FRIEND; @@ -2819,25 +2825,23 @@ void monster::process_effects_internal() regeneration_amount = 0; } const int healed_amount = heal( round( regeneration_amount ) ); - if( healed_amount > 0 && one_in( 2 ) && g->u.sees( *this ) ) { - add_msg( m_debug, ( "Regen: %s" ), healed_amount ); - std::string healing_format_string; - if( healed_amount >= 50 ) { - healing_format_string = _( "The %s is visibly regenerating!" ); - } else if( healed_amount >= 10 ) { - healing_format_string = _( "The %s seems a little healthier." ); - } else { - healing_format_string = _( "The %s is healing slowly." ); - } - add_msg( m_warning, healing_format_string, name() ); + if( healed_amount > 0 && g->u.sees( *this ) ) { + add_msg( m_warning, _( "The %1$s regenerates %2$s damage." ), name(), healed_amount ); } if( type->regenerates_in_dark ) { const float light = g->m.ambient_light_at( pos() ); - // Magic number 10000 was chosen so that a floodlight prevents regeneration in a range of 20 tiles - if( heal( static_cast( 50.0 * std::exp( - light * light / 10000 ) ) > 0 && one_in( 2 ) && - g->u.sees( *this ) ) ) { - add_msg( m_warning, _( "The %s uses the darkness to regenerate." ), name() ); + add_msg( m_debug, _( "%1$s local light level: %2$s" ), name(), light ); + // Requires standing in a properly dark tile, scales as it gets darker + if( light < 11.0f && one_in( 2 ) && hp < type->hp ) { + // Regen will max out at 50 at 6.0 light (barely able to craft), or top off to max HP + int dark_regen_amount = std::min( static_cast( 110.0f - ( light * 10.0f ) ), type->hp - hp ); + dark_regen_amount = std::min( dark_regen_amount, 50 ); + heal( round( dark_regen_amount ) ); + if( dark_regen_amount > 0 && g->u.sees( *this ) ) { + add_msg( m_warning, _( "The %1$s uses the darkness to regenerate %2$s damage." ), name(), + dark_regen_amount ); + } } } diff --git a/src/monstergenerator.cpp b/src/monstergenerator.cpp index 5137ddebdc28..e9a0807a610c 100644 --- a/src/monstergenerator.cpp +++ b/src/monstergenerator.cpp @@ -52,6 +52,7 @@ std::string enum_to_string( mon_trigger data ) case mon_trigger::SOUND: return "SOUND"; case mon_trigger::PLAYER_NEAR_BABY: return "PLAYER_NEAR_BABY"; case mon_trigger::MATING_SEASON: return "MATING_SEASON"; + case mon_trigger::NETHER_ATTENTION: return "NETHER_ATTENTION"; // *INDENT-ON* case mon_trigger::_LAST: break; diff --git a/src/mtype.h b/src/mtype.h index f61acd08cf7e..79a4575e8e6d 100644 --- a/src/mtype.h +++ b/src/mtype.h @@ -50,6 +50,7 @@ enum class mon_trigger : int { SOUND, // Heard a sound PLAYER_NEAR_BABY, // Player/npc is near a baby monster of this type MATING_SEASON, // It's the monster's mating season (defined by baby_flags) + NETHER_ATTENTION, // Player/npc currently has effect_attention _LAST // This item must always remain last. };