Skip to content

Commit

Permalink
feat(content,port): AGGRO_CHARACTER flag for enemies (#5846)
Browse files Browse the repository at this point in the history
* aggro_character variable added to monster

Co-Authored-By: Venera3 <[email protected]>

* add weakness trigger, fix matt_ignore and m_debug messages

* used formatter. change location of aggro ignore check

* first pass of aggro_character variables on mons

* add documentation

* style(autofix.ci): automated formatting

* npcs should no longer aggro from a non-player fight & save/load aggro_character tracking

Co-Authored-By: Eric <[email protected]>
Co-Authored-By: Venera3 <[email protected]>

* oops debug message

* cleanup cleanup

---------

Co-authored-by: Venera3 <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric <[email protected]>
  • Loading branch information
4 people authored Jan 5, 2025
1 parent c4bb054 commit 96fff1b
Show file tree
Hide file tree
Showing 17 changed files with 159 additions and 6 deletions.
5 changes: 5 additions & 0 deletions data/json/monsters/bird.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,16 @@
"type": "MONSTER",
"copy-from": "mon_duck",
"name": { "str": "goose", "str_pl": "geese" },
"aggression": 0,
"morale": 15,
"aggro_character": false,
"description": "A Canadian goose, a common waterfowl that regrets leaving Canada.",
"volume": "5 L",
"weight": "3750 g",
"hp": 15,
"dodge": 3,
"anger_triggers": [ "PLAYER_CLOSE", "FRIEND_ATTACKED" ],
"fear_triggers": [ "FRIEND_DIED", "FIRE" ],
"reproduction": { "baby_egg": "egg_goose_canadian", "baby_count": 3, "baby_timer": 10 },
"baby_flags": [ "SPRING" ]
},
Expand Down
2 changes: 2 additions & 0 deletions data/json/monsters/fish.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"material": [ "flesh" ],
"symbol": "Y",
"color": "red",
"aggro_character": false,
"aggression": 15,
"morale": 100,
"melee_skill": 6,
Expand Down Expand Up @@ -645,6 +646,7 @@
"material": [ "flesh" ],
"symbol": "Y",
"color": "magenta",
"aggro_character": false,
"aggression": 4,
"morale": 100,
"melee_skill": 6,
Expand Down
18 changes: 18 additions & 0 deletions data/json/monsters/insect_spider.json
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@
"material": [ "iflesh" ],
"symbol": "a",
"color": "yellow",
"aggro_character": false,
"aggression": -10,
"morale": 20,
"melee_skill": 4,
Expand Down Expand Up @@ -367,6 +368,7 @@
"hp": 15,
"speed": 115,
"attack_cost": 115,
"aggro_character": false,
"aggression": 0,
"morale": 0,
"melee_skill": 5,
Expand Down Expand Up @@ -406,6 +408,7 @@
"hp": 35,
"speed": 110,
"attack_cost": 110,
"aggro_character": false,
"aggression": 9,
"morale": 20,
"melee_skill": 6,
Expand Down Expand Up @@ -451,6 +454,7 @@
"volume": "300 L",
"weight": "400 kg",
"speed": 60,
"aggro_character": false,
"aggression": 0,
"morale": 10,
"melee_skill": 3,
Expand Down Expand Up @@ -499,6 +503,7 @@
"hp": 125,
"speed": 110,
"attack_cost": 110,
"aggro_character": false,
"aggression": 100,
"regen_morale": true,
"melee_skill": 6,
Expand Down Expand Up @@ -746,6 +751,7 @@
"material": [ "iflesh" ],
"symbol": "s",
"color": "brown",
"aggro_character": false,
"aggression": -10,
"morale": 100,
"melee_skill": 6,
Expand Down Expand Up @@ -815,6 +821,7 @@
"material": [ "iflesh" ],
"symbol": "s",
"color": "white",
"aggro_character": false,
"aggression": -20,
"morale": 80,
"melee_skill": 5,
Expand Down Expand Up @@ -882,6 +889,7 @@
"material": [ "iflesh" ],
"symbol": "s",
"color": "yellow",
"aggro_character": false,
"aggression": 20,
"morale": 100,
"melee_skill": 4,
Expand Down Expand Up @@ -914,6 +922,7 @@
"material": [ "iflesh" ],
"symbol": "c",
"color": "yellow",
"aggro_character": false,
"aggression": 20,
"morale": 100,
"melee_skill": 1,
Expand Down Expand Up @@ -946,6 +955,7 @@
"material": [ "iflesh" ],
"symbol": "s",
"color": "dark_gray",
"aggro_character": false,
"aggression": -10,
"morale": 100,
"melee_skill": 6,
Expand Down Expand Up @@ -980,6 +990,7 @@
"material": [ "iflesh" ],
"symbol": "c",
"color": "dark_gray",
"aggro_character": false,
"aggression": -10,
"morale": 100,
"melee_skill": 4,
Expand Down Expand Up @@ -1013,6 +1024,7 @@
"material": [ "iflesh" ],
"symbol": "s",
"color": "brown",
"aggro_character": false,
"aggression": 20,
"morale": 100,
"melee_skill": 5,
Expand Down Expand Up @@ -1086,6 +1098,7 @@
"material": [ "iflesh" ],
"symbol": "a",
"color": "dark_gray",
"aggro_character": false,
"aggression": -10,
"melee_skill": 5,
"melee_dice": 2,
Expand Down Expand Up @@ -1171,6 +1184,7 @@
"material": [ "iflesh" ],
"symbol": "a",
"color": "dark_gray",
"aggro_character": false,
"aggression": -5,
"morale": 15,
"melee_skill": 7,
Expand Down Expand Up @@ -1421,6 +1435,7 @@
"material": [ "iflesh" ],
"symbol": "a",
"color": "brown",
"aggro_character": false,
"morale": 60,
"melee_skill": 5,
"melee_dice": 1,
Expand Down Expand Up @@ -1456,6 +1471,7 @@
"material": [ "iflesh" ],
"symbol": "a",
"color": "green",
"aggro_character": false,
"morale": 60,
"melee_skill": 5,
"melee_dice": 1,
Expand Down Expand Up @@ -1548,6 +1564,7 @@
"material": [ "iflesh" ],
"symbol": "a",
"color": "brown",
"aggro_character": false,
"aggression": 40,
"morale": 100,
"melee_skill": 7,
Expand Down Expand Up @@ -1638,6 +1655,7 @@
"material": [ "iflesh" ],
"symbol": "a",
"color": "red",
"aggro_character": false,
"aggression": 30,
"morale": 100,
"melee_skill": 7,
Expand Down
16 changes: 16 additions & 0 deletions data/json/monsters/mammal.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"material": [ "flesh" ],
"symbol": "B",
"color": "dark_gray",
"aggro_character": false,
"aggression": -10,
"morale": 60,
"melee_skill": 6,
Expand Down Expand Up @@ -107,6 +108,7 @@
"material": [ "flesh" ],
"symbol": "r",
"color": "brown",
"aggro_character": false,
"aggression": -35,
"morale": 15,
"melee_dice": 1,
Expand Down Expand Up @@ -135,6 +137,7 @@
"material": [ "flesh" ],
"symbol": "r",
"color": "dark_gray",
"aggro_character": false,
"aggression": 5,
"morale": 5,
"melee_skill": 5,
Expand Down Expand Up @@ -169,6 +172,7 @@
"symbol": "b",
"color": "brown",
"looks_like": "mon_pig_piglet",
"aggro_character": false,
"aggression": -10,
"morale": 10,
"melee_skill": 1,
Expand Down Expand Up @@ -202,6 +206,7 @@
"material": [ "flesh" ],
"symbol": "b",
"color": "brown",
"aggro_character": false,
"aggression": 20,
"morale": 40,
"melee_skill": 5,
Expand Down Expand Up @@ -239,6 +244,7 @@
"material": [ "flesh" ],
"symbol": "c",
"color": "brown",
"aggro_character": false,
"aggression": -25,
"morale": 1,
"melee_skill": 6,
Expand Down Expand Up @@ -661,6 +667,7 @@
"material": [ "flesh" ],
"symbol": "C",
"color": "light_gray",
"aggro_character": false,
"aggression": -50,
"morale": 60,
"melee_skill": 6,
Expand Down Expand Up @@ -835,6 +842,7 @@
"material": [ "flesh" ],
"symbol": "d",
"color": "light_gray",
"aggro_character": false,
"aggression": -10,
"morale": 15,
"melee_skill": 6,
Expand Down Expand Up @@ -881,6 +889,7 @@
"weight": "1 kg",
"hp": 8,
"speed": 98,
"aggro_character": false,
"aggression": -13,
"morale": 8,
"melee_skill": 2,
Expand Down Expand Up @@ -1699,6 +1708,7 @@
"material": [ "flesh" ],
"symbol": "d",
"color": "light_gray",
"aggro_character": false,
"aggression": -5,
"morale": 30,
"melee_skill": 3,
Expand Down Expand Up @@ -1730,6 +1740,7 @@
"material": [ "flesh" ],
"symbol": "d",
"color": "red",
"aggro_character": false,
"aggression": -5,
"morale": 60,
"melee_skill": 4,
Expand Down Expand Up @@ -1848,6 +1859,7 @@
"material": [ "flesh" ],
"symbol": "H",
"color": "brown",
"aggro_character": false,
"melee_skill": 6,
"melee_dice": 2,
"melee_dice_sides": 12,
Expand Down Expand Up @@ -1937,6 +1949,7 @@
"material": [ "flesh" ],
"symbol": "M",
"color": "brown",
"aggro_character": false,
"aggression": 5,
"morale": 80,
"melee_skill": 6,
Expand Down Expand Up @@ -2131,6 +2144,7 @@
"material": [ "flesh" ],
"symbol": "p",
"color": "pink",
"aggro_character": false,
"aggression": 10,
"morale": 30,
"melee_skill": 4,
Expand Down Expand Up @@ -2248,6 +2262,7 @@
"material": [ "flesh" ],
"symbol": "r",
"color": "light_gray",
"aggro_character": false,
"aggression": 20,
"morale": 40,
"melee_skill": 5,
Expand Down Expand Up @@ -2425,6 +2440,7 @@
"material": [ "flesh" ],
"symbol": "w",
"color": "light_gray",
"aggro_character": false,
"morale": 20,
"melee_skill": 7,
"melee_dice": 2,
Expand Down
5 changes: 5 additions & 0 deletions data/json/monsters/mutant_animal.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"description": "As it moves, this cat's colors shift unnaturally in the light. You can't make out the breed, but its fur pattern seems to change with every step.",
"copy-from": "mon_cat",
"luminance": 5,
"aggro_character": false,
"//": "Higher dodge due to the constantly changing fur pattern",
"dodge": 9,
"reproduction": { "baby_monster": "mon_cat_mutant_kitten_prism", "baby_count": 2, "baby_timer": 80 },
Expand Down Expand Up @@ -109,6 +110,7 @@
"symbol": "B",
"color": "dark_gray",
"looks_like": "mon_bear",
"aggro_character": false,
"morale": 60,
"melee_skill": 6,
"melee_dice": 4,
Expand Down Expand Up @@ -151,6 +153,7 @@
"symbol": "r",
"color": "brown",
"looks_like": "mon_beaver",
"aggro_character": false,
"aggression": -10,
"morale": 20,
"melee_dice": 2,
Expand Down Expand Up @@ -181,6 +184,7 @@
"symbol": "r",
"color": "brown",
"looks_like": "mon_beaver",
"aggro_character": false,
"aggression": -50,
"morale": 5,
"melee_dice": 1,
Expand Down Expand Up @@ -407,6 +411,7 @@
"symbol": "d",
"color": "light_gray",
"looks_like": "mon_dog",
"aggro_character": false,
"aggression": -15,
"morale": 15,
"melee_skill": 6,
Expand Down
1 change: 1 addition & 0 deletions data/json/monsters/mutant_human.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"symbol": "M",
"color": "brown",
"morale": 50,
"aggro_character": false,
"melee_skill": 6,
"melee_dice": 3,
"melee_dice_sides": 6,
Expand Down
3 changes: 3 additions & 0 deletions data/json/monsters/reptile_amphibian.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"material": [ "flesh" ],
"symbol": "M",
"color": "light_green",
"aggro_character": false,
"aggression": 10,
"morale": 100,
"melee_skill": 5,
Expand Down Expand Up @@ -95,6 +96,7 @@
"material": [ "flesh" ],
"symbol": "s",
"color": "brown",
"aggro_character": false,
"aggression": -50,
"morale": 60,
"melee_skill": 5,
Expand Down Expand Up @@ -129,6 +131,7 @@
"material": [ "flesh" ],
"symbol": "s",
"color": "brown",
"aggro_character": false,
"aggression": -10,
"morale": 60,
"melee_skill": 6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ hostility on detection)
Monster morale. Defines how low monster HP can get before it retreats. This number is treated as %
of their max HP.

## "aggro_character"

(bool, optional, default true)

If the monster will differentiate between monsters and characters (NPC, Player) when deciding on
targets - if false the monster will ignore characters regardless of current anger/morale until a
character trips and anger trigger. Resets randomly when the monster is at its base anger level.

## "speed"

(integer)
Expand Down
Loading

0 comments on commit 96fff1b

Please sign in to comment.