Skip to content

Commit c2b1e40

Browse files
Add NO_BODY_HEAT flag for characters who don't show up on infrared (CleverRaven#83336)
* Initial commit * Update src/character_health.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Kick tests * Add to vampire weakness and Boreal Mage cold aura --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent bd368b4 commit c2b1e40

File tree

8 files changed

+24
-11
lines changed

8 files changed

+24
-11
lines changed

data/json/flags.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,6 +2246,11 @@
22462246
"type": "json_flag",
22472247
"info": "Allows movement in open air."
22482248
},
2249+
{
2250+
"id": "NO_BODY_HEAT",
2251+
"type": "json_flag",
2252+
"info": "The character produces no body heat and is not visible on infrared (for characters only, for monsters use the WARM flag to enable infrared visibility)."
2253+
},
22492254
{
22502255
"id": "ALL_TERRAIN_NAVIGATION",
22512256
"type": "json_flag",

data/mods/Magiclysm/mutations/spell_triggering_mutations.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"intermittent_activation": { "effects": [ { "frequency": "5 seconds", "spell_effects": [ { "id": "boreal_mage_cold_damage" } ] } ] }
2727
}
2828
],
29-
"transform": { "target": "COLD_AURA_OFF", "msg_transform": "You suppress your frozen powers.", "active": false, "moves": 10 }
29+
"transform": { "target": "COLD_AURA_OFF", "msg_transform": "You suppress your frozen powers.", "active": false, "moves": 10 },
30+
"flags": [ "NO_BODY_HEAT" ]
3031
},
3132
{
3233
"type": "mutation",

data/mods/Xedra_Evolved/effects/effects.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@
968968
"remove_message": "You end your imitation of death.",
969969
"rating": "mixed",
970970
"enchantments": [ { "mutations": [ "WINTER_FEIGN_DEATH_TRAITS" ], "ench_effects": [ { "effect": "downed", "intensity": 1 } ] } ],
971-
"flags": [ "CANNOT_ATTACK", "CANNOT_MOVE" ]
971+
"flags": [ "CANNOT_ATTACK", "CANNOT_MOVE", "NO_BODY_HEAT" ]
972972
},
973973
{
974974
"type": "effect_type",

data/mods/Xedra_Evolved/mutations/mutation_thresh.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": { "str": "Ierde" },
66
"points": 1,
77
"description": "You have ascended into your fae nature.",
8-
"flags": [ "FAEBLOOD" ],
8+
"flags": [ "FAEBLOOD", "NO_BODY_HEAT" ],
99
"valid": false,
1010
"purifiable": false,
1111
"threshold": true
@@ -16,7 +16,7 @@
1616
"name": { "str": "Arvore" },
1717
"points": 1,
1818
"description": "You have ascended into your fae nature.",
19-
"flags": [ "FAEBLOOD" ],
19+
"flags": [ "FAEBLOOD", "NO_BODY_HEAT" ],
2020
"valid": false,
2121
"purifiable": false,
2222
"threshold": true
@@ -27,7 +27,7 @@
2727
"name": { "str": "Undine" },
2828
"points": 1,
2929
"description": "You have ascended into your fae nature.",
30-
"flags": [ "FAEBLOOD" ],
30+
"flags": [ "FAEBLOOD", "NO_BODY_HEAT" ],
3131
"valid": false,
3232
"purifiable": false,
3333
"threshold": true
@@ -49,7 +49,7 @@
4949
"name": { "str": "Sylph" },
5050
"points": 1,
5151
"description": "You have ascended into your fae nature.",
52-
"flags": [ "FAEBLOOD" ],
52+
"flags": [ "FAEBLOOD", "NO_BODY_HEAT" ],
5353
"valid": false,
5454
"purifiable": false,
5555
"threshold": true

data/mods/Xedra_Evolved/mutations/mutations.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@
14551455
"purifiable": false,
14561456
"valid": false,
14571457
"can_only_eat": [ "blood", "hblood", "fae_blood", "vampire_blood" ],
1458-
"flags": [ "CANNIBAL", "DAYFEAR", "NO_THIRST" ],
1458+
"flags": [ "CANNIBAL", "DAYFEAR", "NO_THIRST", "NO_BODY_HEAT" ],
14591459
"vitamin_rates": [ [ "vitC", -500 ], [ "iron", -500 ], [ "calcium", -500 ] ],
14601460
"//": "When weariness can be modified through Json, this mutation should make the player immune to it.",
14611461
"enchantments": [
@@ -1729,7 +1729,8 @@
17291729
{ "value": "SPEED", "add": { "math": [ "temperature_speed_mod(65, 0.5)" ] } }
17301730
]
17311731
}
1732-
]
1732+
],
1733+
"flags": [ "NO_BODY_HEAT" ]
17331734
},
17341735
{
17351736
"type": "mutation",

data/mods/Xedra_Evolved/mutations/temporary.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@
531531
"SALAMANDER",
532532
"SYLPH",
533533
"UNDINE"
534-
]
534+
],
535+
"flags": [ "NO_BODY_HEAT" ]
535536
},
536537
{
537538
"type": "mutation",

doc/JSON/JSON_FLAGS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ Character flags can be `trait_id`, `json_flag_id` or `flag_id`. Some of these a
409409
- ```MYOPIC_SUPERNATURAL``` You are nearsighted in such a way that glasses cannot fix it, such as by magic.
410410
- ```MYOPIC_IN_LIGHT_SUPERNATURAL``` You are nearsighted in light in such a way that glasses cannot fix it, such as by magic.
411411
- ```NIGHT_VISION``` You can see in the dark.
412+
- ```NO_BODY_HEAT``` Your temperature is indistinguishable from the surrounding environmental temperature, making you not show up on infrared.
412413
- ```NO_CBM_INSTALLATION``` You are unable to install any CBMs.
413414
- ```NO_DISEASE``` This mutation grants immunity to diseases.
414415
- ```NO_RADIATION``` This mutation grants immunity to radiations.

src/character_health.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static const json_character_flag json_flag_CANNOT_TAKE_DAMAGE( "CANNOT_TAKE_DAMA
166166
static const json_character_flag json_flag_DEAF( "DEAF" );
167167
static const json_character_flag json_flag_GRAB( "GRAB" );
168168
static const json_character_flag json_flag_HEAL_OVERRIDE( "HEAL_OVERRIDE" );
169+
static const json_character_flag json_flag_NO_BODY_HEAT( "NO_BODY_HEAT" );
169170
static const json_character_flag json_flag_NO_RADIATION( "NO_RADIATION" );
170171
static const json_character_flag json_flag_NO_THIRST( "NO_THIRST" );
171172
static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );
@@ -248,8 +249,11 @@ bool Character::can_recover_oxygen() const
248249

249250
bool Character::is_warm() const
250251
{
251-
// TODO: is there a mutation (plant?) that makes a npc not warm blooded?
252-
return true;
252+
if( has_flag( json_flag_NO_BODY_HEAT ) ) {
253+
return false;
254+
} else {
255+
return true;
256+
}
253257
}
254258

255259
int Character::get_fat_to_hp() const

0 commit comments

Comments
 (0)