diff --git a/data/mods/Aftershock/mobs/PrepPhyle_mobs.json b/data/mods/Aftershock/mobs/PrepPhyle_mobs.json index 52874785a4393..90094ddccfa07 100644 --- a/data/mods/Aftershock/mobs/PrepPhyle_mobs.json +++ b/data/mods/Aftershock/mobs/PrepPhyle_mobs.json @@ -13,6 +13,7 @@ "speed": 100, "aggression": 0, "morale": 10, + "aggro_character": false, "melee_dice": 1, "melee_dice_sides": 2, "melee_damage": [ { "damage_type": "cut", "amount": 7 } ], @@ -49,6 +50,7 @@ "color": "light_gray", "aggression": -12, "morale": 5, + "aggro_character": false, "melee_skill": 2, "melee_dice": 1, "melee_dice_sides": 1, diff --git a/data/mods/Aftershock/mobs/robots.json b/data/mods/Aftershock/mobs/robots.json index 262e1a6ad156f..fc40a0f535811 100644 --- a/data/mods/Aftershock/mobs/robots.json +++ b/data/mods/Aftershock/mobs/robots.json @@ -137,6 +137,7 @@ "color": "white", "aggression": 0, "morale": 100, + "aggro_character": false, "melee_skill": 10, "melee_dice": 3, "melee_dice_sides": 12, diff --git a/data/mods/Magiclysm/monsters/forgedwellers.json b/data/mods/Magiclysm/monsters/forgedwellers.json index 16df8dd7d6d2d..c9388e5399e80 100644 --- a/data/mods/Magiclysm/monsters/forgedwellers.json +++ b/data/mods/Magiclysm/monsters/forgedwellers.json @@ -17,6 +17,7 @@ "color": "dark_gray", "aggression": 0, "morale": 100, + "aggro_character": false, "melee_skill": 6, "melee_dice": 3, "melee_dice_sides": 10, @@ -30,7 +31,7 @@ "vision_night": 40, "path_settings": { "avoid_traps": true, "avoid_sharp": true }, "special_attacks": [ { "type": "spell", "spell_data": { "id": "manatouched_seeker_bolts", "min_level": 5 }, "cooldown": 60 } ], - "anger_triggers": [ "FRIEND_ATTACKED", "HURT" ], + "anger_triggers": [ "FRIEND_ATTACKED", "FRIEND_DIED", "HURT" ], "death_function": { "corpse_type": "BROKEN" }, "flags": [ "SEES", "NO_BREATHE", "PATH_AVOID_DANGER_1", "LOUDMOVES" ] }, @@ -41,6 +42,7 @@ "name": { "str": "goblin forgemaster" }, "default_faction": "wonder_forge", "aggression": 0, + "aggro_character": false, "armor_fire": 40, "anger_triggers": [ "FRIEND_ATTACKED", "HURT" ], "description": "A goblin like none you've ever seen before. He directs workers and automatons with confidence and style.", @@ -54,8 +56,9 @@ "copy-from": "mon_lizardfolk_shaman", "default_faction": "wonder_forge", "aggression": 0, + "aggro_character": false, "armor_fire": 40, - "anger_triggers": [ "FRIEND_ATTACKED", "HURT" ], + "anger_triggers": [ "FRIEND_ATTACKED", "FRIEND_DIED", "HURT" ], "special_attacks": [ { "type": "spell", "spell_data": { "id": "laze" }, "cooldown": 10 }, [ "scratch", 5 ] ], "death_drops": { "subtype": "collection", "groups": [ [ "forge_life", 40 ], [ "bedroom", 1 ], [ "dresser", 5 ], [ "ammo", 18 ] ] } }, @@ -66,9 +69,10 @@ "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. This one politely asks you to mind your step as this is a working environment.", "default_faction": "wonder_forge", "copy-from": "mon_gracke", + "aggro_character": false, "special_attacks": [ { "type": "spell", "spell_data": { "id": "eshaper_shardspray", "min_level": 5 }, "cooldown": 10 } ], "armor_fire": 40, - "anger_triggers": [ "FRIEND_ATTACKED", "HURT" ], + "anger_triggers": [ "FRIEND_ATTACKED", "FRIEND_DIED", "HURT" ], "death_drops": { "subtype": "collection", "groups": [ [ "forge_life", 40 ], [ "bedroom", 1 ], [ "dresser", 5 ], [ "ammo", 18 ] ] } }, { @@ -161,6 +165,7 @@ "color": "light_red", "aggression": 3, "morale": 40, + "aggro_character": false, "melee_skill": 5, "melee_dice": 2, "melee_dice_sides": 5, @@ -171,7 +176,7 @@ "armor_bullet": 26, "armor_fire": 35, "harvest": "demihuman", - "anger_triggers": [ "FRIEND_ATTACKED", "HURT" ], + "anger_triggers": [ "FRIEND_ATTACKED", "FRIEND_DIED", "HURT" ], "path_settings": { "avoid_traps": true, "avoid_sharp": true }, "death_drops": { "subtype": "collection", "groups": [ [ "forge_life", 40 ], [ "bedroom", 1 ], [ "dresser", 5 ], [ "ammo", 18 ] ] }, "flags": [ "SEES", "HEARS", "WARM", "BASHES", "GROUP_BASH", "HUMAN", "PATH_AVOID_DANGER_1" ] diff --git a/src/monster.cpp b/src/monster.cpp index 9408e03a55a9b..b69c1c7f5c5f7 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -1911,7 +1911,7 @@ void monster::apply_damage( Creature *source, bodypart_id /*bp*/, int dam, } else if( dam > 0 ) { process_trigger( mon_trigger::HURT, 1 + static_cast( dam / 3 ) ); // Get angry at characters if hurt by one - if( !aggro_character && !source->is_monster() ) { + if( source != nullptr && !aggro_character && !source->is_monster() ) { aggro_character = true; } }