Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambusher shadow #32857

Closed
Closed
8 changes: 8 additions & 0 deletions data/json/effects.json
Expand Up @@ -10,6 +10,14 @@
"name": [ "Hit By Player" ],
"desc": [ "AI tag for when monsters are hit by player. This is a bug if you have it." ]
},
{
"type": "effect_type",
"id": "took_damage",
"name": [ "Took Damage" ],
"desc": [
"AI tag for when a monster has taken damage. Differs from the above by considering any possible source of damage. This is a bug if you have it."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Player still has a chance to get this effect, and Differs from the above part would be totally unclear to him. I suggest rewriting this part to avoid any possible confusion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only monsters can have this effect, since its applied only by monster::apply_damage.

]
},
{
"type": "effect_type",
"id": "ridden",
Expand Down
113 changes: 0 additions & 113 deletions data/json/monsters/monsters.json
Expand Up @@ -840,47 +840,6 @@
"death_function": [ "NORMAL" ],
"flags": [ "SMELLS", "HEARS", "GOODHEARING", "BASHES", "BORES", "POISON", "SUNDEATH", "ACIDPROOF", "ACIDTRAIL" ]
},
{
"id": "mon_darkman",
"type": "MONSTER",
"name": "wraith",
"description": "A gigantic shadow, chaotically changing in shape and volume. Two piercing orbs of light dominate what can only be described as its head.",
"default_faction": "nether",
"species": [ "NETHER" ],
"diff": 2,
"volume": "875000 ml",
"weight": 200000,
"hp": 800,
"speed": 140,
"symbol": "S",
"color": "dark_gray",
"aggression": 2,
"morale": 500,
"melee_skill": 6,
"melee_dice": 3,
"melee_dice_sides": 8,
"melee_cut": 3,
"dodge": 3,
"armor_bash": 12,
"armor_cut": 8,
"vision_day": 50,
"luminance": 6,
"harvest": "exempt",
"special_attacks": [ [ "DARKMAN", 5 ], [ "scratch", 15 ] ],
"death_function": [ "DARKMAN" ],
"flags": [
"NOHEAD",
"HARDTOSHOOT",
"WEBWALK",
"FLIES",
"PLASTIC",
"ELECTRIC",
"ACIDPROOF",
"SUNDEATH",
"REGENERATES_IN_DARK",
"NO_BREATHE"
]
},
{
"id": "mon_dementia",
"type": "MONSTER",
Expand Down Expand Up @@ -2270,78 +2229,6 @@
"death_function": [ "BROKEN" ],
"flags": [ "SEES", "HEARS", "GOODHEARING", "ELECTRONIC", "NO_BREATHE", "PRIORITIZE_TARGETS", "PATH_AVOID_DANGER_1" ]
},
{
"id": "mon_shadow",
"type": "MONSTER",
"name": "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.",
"default_faction": "nether",
"species": [ "NETHER" ],
"diff": 2,
"volume": "750 ml",
"weight": 1000,
"hp": 60,
"speed": 90,
"symbol": "A",
"color": "dark_gray",
"aggression": 100,
"morale": 100,
"melee_skill": 6,
"melee_dice": 1,
"melee_dice_sides": 2,
"melee_cut": 0,
"dodge": 4,
"vision_day": 50,
"harvest": "exempt",
"special_attacks": [ [ "DISAPPEAR", 200 ] ],
"special_when_hit": [ "ZAPBACK", 100 ],
"death_function": [ "MELT" ],
"flags": [
"SEES",
"HEARS",
"GOODHEARING",
"SMELLS",
"NOHEAD",
"HARDTOSHOOT",
"GRABS",
"WEBWALK",
"FLIES",
"PLASTIC",
"SUNDEATH",
"ELECTRIC",
"ACIDPROOF",
"HIT_AND_RUN",
"NO_BREATHE",
"NOGIB"
]
},
{
"id": "mon_shadow_snake",
"type": "MONSTER",
"name": "shadow snake",
"description": "This is an animate shadow in the form of a long and sinuous snake. Translucent and dark, it glides silently across the floor, wriggling and flexing as it moves.",
"default_faction": "nether",
"bodytype": "snake",
"species": [ "NETHER" ],
"volume": "30000 ml",
"weight": 40750,
"hp": 40,
"speed": 90,
"material": [ "flesh" ],
"symbol": "s",
"color": "dark_gray",
"aggression": 100,
"morale": 100,
"melee_skill": 6,
"melee_dice": 1,
"melee_dice_sides": 4,
"melee_cut": 4,
"dodge": 1,
"harvest": "exempt",
"special_attacks": [ [ "DISAPPEAR", 200 ] ],
"death_function": [ "MELT" ],
"flags": [ "SEES", "SMELLS", "WARM", "SWIMS", "PLASTIC", "SUNDEATH", "NOGIB" ]
},
{
"id": "mon_shia",
"type": "MONSTER",
Expand Down
200 changes: 200 additions & 0 deletions data/json/monsters/shadows.json
@@ -0,0 +1,200 @@
[
{
"id": "mon_darkman",
"type": "MONSTER",
"name": "wraith",
"description": "A gigantic shadow, chaotically changing in shape and volume. Two piercing orbs of light dominate what can only be described as its head.",
"default_faction": "nether",
"species": [ "NETHER" ],
"diff": 2,
"volume": "875000 ml",
"weight": 200000,
"hp": 800,
"speed": 140,
"symbol": "S",
"color": "dark_gray",
"aggression": 2,
"morale": 500,
"melee_skill": 6,
"melee_dice": 3,
"melee_dice_sides": 8,
"melee_cut": 3,
"dodge": 3,
"armor_bash": 12,
"armor_cut": 8,
"vision_day": 50,
"luminance": 6,
"harvest": "exempt",
"special_attacks": [ [ "DARKMAN", 5 ], [ "scratch", 15 ] ],
"death_function": [ "DARKMAN" ],
"flags": [
"NOHEAD",
"HARDTOSHOOT",
"WEBWALK",
"FLIES",
"PLASTIC",
"ELECTRIC",
"ACIDPROOF",
"SUNDEATH",
"REGENERATES_IN_DARK",
"NO_BREATHE"
]
},
{
"id": "mon_shadow",
"type": "MONSTER",
"name": "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.",
"default_faction": "nether",
"species": [ "NETHER" ],
"diff": 2,
"volume": "750 ml",
"weight": 1000,
"hp": 60,
"speed": 90,
"symbol": "A",
"color": "dark_gray",
"aggression": 100,
"morale": 100,
"melee_skill": 6,
"melee_dice": 1,
"melee_dice_sides": 2,
"melee_cut": 0,
"dodge": 4,
"vision_day": 50,
"harvest": "exempt",
"special_attacks": [ [ "DISAPPEAR", 200 ] ],
"special_when_hit": [ "ZAPBACK", 100 ],
"death_function": [ "MELT" ],
"flags": [
"SEES",
"HEARS",
"GOODHEARING",
"SMELLS",
"NOHEAD",
"HARDTOSHOOT",
"GRABS",
"WEBWALK",
"FLIES",
"PLASTIC",
"SUNDEATH",
"ELECTRIC",
"ACIDPROOF",
"HIT_AND_RUN",
"NO_BREATHE",
"NOGIB"
]
},
{
"id": "mon_shadow_hunter",
"type": "MONSTER",
"name": "adumbration",
"description": "A fragment of ambient shadow, hiding among the recesses of your vision. It chaotically shifts in and out of reality, as if the universe itself objected it's existence.",
"default_faction": "nether",
"species": [ "NETHER" ],
"diff": 20,
"size": "SMALL",
"hp": 60,
"speed": 90,
"symbol": "A",
"color": "dkgray",
"aggression": 100,
"morale": 100,
"melee_skill": 6,
"melee_dice": 1,
"melee_dice_sides": 12,
"melee_cut": 0,
"dodge": 4,
"vision_day": 50,
"harvest": "exempt",
"special_attacks": [ [ "SHADOW_HUNTER", 1 ] ],
"special_when_hit": [ "ZAPBACK", 100 ],
"death_function": [ "MELT" ],
"flags": [
"SEES",
"HEARS",
"GOODHEARING",
"SMELLS",
"NOHEAD",
"HARDTOSHOOT",
"GRABS",
"WEBWALK",
"FLIES",
"PLASTIC",
"SUNDEATH",
"ELECTRIC",
"ACIDPROOF",
"NO_BREATHE",
"NOGIB"
]
},
{
"id": "mon_shadow_hunter_h",
"type": "MONSTER",
"name": "invisible adumbration",
"description": "DO THE IMPOSSIBLE! \nSEE THE INVISIBLE! \n \n Seeing monster is not intended.",
"default_faction": "nether",
"species": [ "NETHER" ],
"diff": 20,
"size": "SMALL",
"hp": 60,
"speed": 90,
"symbol": "A",
"color": "dkgray",
"aggression": 100,
"morale": 100,
"melee_skill": 6,
"melee_dice": 1,
"melee_dice_sides": 1,
"melee_cut": 0,
"dodge": 1,
"vision_day": 10,
"vision_night": 40,
"harvest": "exempt",
"path_settings": { "max_dist": 6 },
"special_attacks": [ [ "SHADOW_HUNTER_H", 1 ] ],
"special_when_hit": [ "ZAPBACK", 100 ],
"death_function": [ "MELT" ],
"flags": [
"SEES",
"INVISIBLE",
"NOHEAD",
"HARDTOSHOOT",
"WEBWALK",
"FLIES",
"PLASTIC",
"SUNDEATH",
"ELECTRIC",
"ACIDPROOF",
"NO_BREATHE",
"NOGIB"
]
},
{
"id": "mon_shadow_snake",
"type": "MONSTER",
"name": "shadow snake",
"description": "This is an animate shadow in the form of a long and sinuous snake. Translucent and dark, it glides silently across the floor, wriggling and flexing as it moves.",
"default_faction": "nether",
"bodytype": "snake",
"species": [ "NETHER" ],
"volume": "30000 ml",
"weight": 40750,
"hp": 40,
"speed": 90,
"material": [ "flesh" ],
"symbol": "s",
"color": "dark_gray",
"aggression": 100,
"morale": 100,
"melee_skill": 6,
"melee_dice": 1,
"melee_dice_sides": 4,
"melee_cut": 4,
"dodge": 1,
"harvest": "exempt",
"special_attacks": [ [ "DISAPPEAR", 200 ] ],
"death_function": [ "MELT" ],
"flags": [ "SEES", "SMELLS", "WARM", "SWIMS", "PLASTIC", "SUNDEATH", "NOGIB" ]
}
]
1 change: 1 addition & 0 deletions doc/JSON_FLAGS.md
Expand Up @@ -909,6 +909,7 @@ Multiple death functions can be used. Not all combinations make sense.
- ```MILITARY_MECH``` Is a military-grade mech.
- ```MILKABLE``` Produces milk when milked.
- ```NIGHT_INVISIBILITY``` Monster becomes invisible if it's more than one tile away and the lighting on its tile is LL_LOW or less. Visibility is not affected by night vision.
- ```INVISIBLE``` Monster is completely invisible unless adjacent.
- ```NOGIB``` Does not leave gibs / meat chunks when killed with huge damage.
- ```NOHEAD``` Headshots not allowed!
- ```NO_BREATHE``` Creature can't drown and is unharmed by gas, smoke or poison.
Expand Down
2 changes: 1 addition & 1 deletion src/creature.cpp
Expand Up @@ -199,7 +199,7 @@ bool Creature::sees( const Creature &critter ) const
if( wanted_range <= 1 &&
( posz() == critter.posz() || g->m.valid_move( pos(), critter.pos(), false, true ) ) ) {
return visible( p );
} else if( ( wanted_range > 1 && critter.digging() ) ||
} else if( ( wanted_range > 1 && critter.digging() ) || ( critter.has_flag( MF_INVISIBLE ) ) ||
John-Candlebury marked this conversation as resolved.
Show resolved Hide resolved
( critter.has_flag( MF_NIGHT_INVISIBILITY ) && g->m.light_at( critter.pos() ) <= LL_LOW ) ||
( critter.is_underwater() && !is_underwater() && g->m.is_divable( critter.pos() ) ) ||
( g->m.has_flag_ter_or_furn( TFLAG_HIDE_PLACE, critter.pos() ) &&
Expand Down