Skip to content

Commit b966b4b

Browse files
Add SUPPRESS_INVISIBILITY flag, add an item in XE that uses it (#82603)
* Initial commit * Fix field * Update recipe * Update src/creature.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 3f1030d commit b966b4b

File tree

10 files changed

+115
-3
lines changed

10 files changed

+115
-3
lines changed

data/json/flags.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,6 +2584,11 @@
25842584
"type": "json_flag",
25852585
"info": "The character can see through CAMOUFLAGE, NIGHT_INVISIBILITY, or the invisibility effect."
25862586
},
2587+
{
2588+
"id": "SUPPRESS_INVISIBILITY",
2589+
"type": "json_flag",
2590+
"info": "If you're invisible, now you're not"
2591+
},
25872592
{
25882593
"id": "ANIMALEMPATH2",
25892594
"type": "json_flag",

data/mods/Xedra_Evolved/effects/effects.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3589,6 +3589,15 @@
35893589
"desc": [ "" ],
35903590
"show_in_info": false
35913591
},
3592+
{
3593+
"type": "effect_type",
3594+
"//": "Hidden, reveals invisible monsters",
3595+
"id": "effect_xe_reveal_invisibility",
3596+
"name": [ "" ],
3597+
"desc": [ "" ],
3598+
"show_in_info": false,
3599+
"flags": [ "SUPPRESS_INVISIBILITY" ]
3600+
},
35923601
{
35933602
"type": "effect_type",
35943603
"//": "Checks if you have every single vampiric power when trying to learn new ones.",

data/mods/Xedra_Evolved/emitters.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,12 @@
1919
"field": "fd_hot_air4",
2020
"intensity": 3,
2121
"qty": 100
22+
},
23+
{
24+
"id": "emit_powder_of_revelation",
25+
"type": "emit",
26+
"field": "fd_powder_of_revelation",
27+
"intensity": 1,
28+
"qty": 50
2229
}
2330
]

data/mods/Xedra_Evolved/field_type.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,5 +444,34 @@
444444
"percent_spread": 20,
445445
"phase": "gas",
446446
"looks_like": "fd_dust"
447+
},
448+
{
449+
"id": "fd_powder_of_revelation",
450+
"type": "field_type",
451+
"intensity_levels": [
452+
{
453+
"name": "floating powder",
454+
"sym": "%",
455+
"translucency": 1,
456+
"concentration": 1,
457+
"effects": [
458+
{
459+
"effect_id": "effect_xe_reveal_invisibility",
460+
"min_duration": "2 minutes",
461+
"max_duration": "2 minutes",
462+
"immune_inside_vehicle": true,
463+
"message": "The powder coats you.",
464+
"message_type": "bad"
465+
}
466+
]
467+
}
468+
],
469+
"percent_spread": 30,
470+
"priority": 8,
471+
"half_life": "30 seconds",
472+
"phase": "gas",
473+
"display_items": true,
474+
"display_field": true,
475+
"looks_like": "fd_dust"
447476
}
448477
]

data/mods/Xedra_Evolved/itemgroups/nests_itemgroups.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@
179179
{ "item": "alchemy_recipe_scorpion_periapta", "prob": 1 },
180180
{ "item": "alchemy_recipe_butterfly_periapta", "prob": 1 },
181181
{ "item": "alchemy_recipe_spider_periapta", "prob": 1 },
182-
{ "item": "alchemy_recipe_cold_iron_ingot", "prob": 1 }
182+
{ "item": "alchemy_recipe_cold_iron_ingot", "prob": 1 },
183+
{ "item": "alchemy_recipe_powder_of_revelation", "prob": 1 }
183184
]
184185
},
185186
{

data/mods/Xedra_Evolved/items/alchemy.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,20 @@
165165
"material": [ "powder" ],
166166
"price": "25 USD"
167167
},
168+
{
169+
"id": "xe_alchemy_powder_of_revelation",
170+
"name": { "str": "powder of revelation", "str_pl": "handfuls of powder of revelation" },
171+
"description": "A dull grayish powder with a slight shimmering opalescence. When thrown it will fill the air and reveal the true form and existence of any creature whose form it coats.",
172+
"type": "ITEM",
173+
"weight": "265 g",
174+
"volume": "250 ml",
175+
"symbol": ":",
176+
"container": "flask_glass",
177+
"color": "light_gray",
178+
"material": [ "powder" ],
179+
"price": "2 USD",
180+
"drop_action": { "type": "emit_actor", "emits": [ "emit_powder_of_revelation" ], "scale_qty": false }
181+
},
168182
{
169183
"id": "charm_of_marzanna",
170184
"copy-from": "garnet_silver_pendant_necklace",

data/mods/Xedra_Evolved/items/alchemy_recipes.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,23 @@
275275
"read_skill": "fabrication"
276276
},
277277
{
278+
"type": "ITEM",
279+
"subtypes": [ "BOOK" ],
280+
"id": "alchemy_recipe_powder_of_revelation",
281+
"copy-from": "schematics_generic",
282+
"looks_like": "spell_scroll",
283+
"name": { "str_sp": "scribbled notes (powder of revelation)" },
284+
"description": "An handwritten set of notes detailing an alchemical recipe for creating some sort of powder that it claims will \"Reveal that which is hidden\".",
285+
"required_level": 3,
286+
"max_level": 3,
287+
"intelligence": 10,
288+
"time": "45 m",
289+
"symbol": "ç",
290+
"color": "light_green",
291+
"read_skill": "fabrication"
292+
},
293+
{
294+
"//": "Tier 4 begins here",
278295
"type": "ITEM",
279296
"subtypes": [ "BOOK" ],
280297
"id": "alchemy_recipe_life_extension_potion",
@@ -355,6 +372,7 @@
355372
"read_skill": "fabrication"
356373
},
357374
{
375+
"//": "Tier 5 begins here",
358376
"type": "ITEM",
359377
"subtypes": [ "BOOK" ],
360378
"id": "alchemy_recipe_plant_imbuement",

data/mods/Xedra_Evolved/recipes/alchemy.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,32 @@
365365
"tools": [ [ [ "surface_heat", 25, "LIST" ] ] ],
366366
"components": [ [ [ "chem_sulphur", 1 ] ], [ [ "chem_manganese_dioxide", 1 ] ], [ [ "xe_elder_ginseng", 1 ] ], [ [ "water", 2 ] ] ]
367367
},
368+
{
369+
"type": "recipe",
370+
"activity_level": "LIGHT_EXERCISE",
371+
"result": "xe_alchemy_powder_of_revelation",
372+
"category": "CC_XEDRA",
373+
"subcategory": "CSC_XEDRA_ALCHEMY",
374+
"skill_used": "chemistry",
375+
"skills_required": [ "deduction", 4 ],
376+
"difficulty": 4,
377+
"time": "1 h 30 m",
378+
"proficiencies": [
379+
{ "proficiency": "prof_intro_chemistry" },
380+
{ "proficiency": "prof_inorganic_chemistry" },
381+
{ "proficiency": "prof_intro_chem_synth" }
382+
],
383+
"book_learn": [ [ "alchemy_recipe_powder_of_revelation", 5 ] ],
384+
"qualities": [ { "id": "BOIL", "level": 1 } ],
385+
"tools": [ [ [ "water_boiling_heat", 120, "LIST" ] ] ],
386+
"components": [
387+
[ [ "clay_lump", 1 ] ],
388+
[ [ "edible_blood", 6, "LIST" ], [ "blank_blood", 1 ] ],
389+
[ [ "water_clean", 5 ] ],
390+
[ [ "corpse_ash", 25 ] ]
391+
],
392+
"flags": [ "SECRET" ]
393+
},
368394
{
369395
"type": "recipe",
370396
"activity_level": "LIGHT_EXERCISE",

doc/JSON/JSON_FLAGS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ Character flags can be `trait_id`, `json_flag_id` or `flag_id`. Some of these a
446446
- ```SUNBURN``` TBD, probably related to `ALBINO`.
447447
- ```SUPER_CLAIRVOYANCE``` Gives a super clairvoyance effect (works with multiple z-levels), used for debug purposes.
448448
- ```SAFECRACK_NO_TOOL``` Allows to open safes without stethoscope.
449+
- ```SUPPRESS_INVISIBILITY``` Any invisibility effects on the creature, including the `PERMANENT_INVISIBILITY` flag, are ignored for the duration of the effect with this flag
449450
- ```TELEPORT_LOCK``` You cannot teleport. This has none of the protective effects of `DIMENSIONAL_ANCHOR`.
450451
- ```TEMPORARY_SHAPESHIFT``` You are in another shape due to some supernatural effect.
451452
- ```TEMPORARY_SHAPESHIFT_NO_HANDS``` You do not have hands in your new shapeshifted form, and so cannot pick up or manipulate objects.

src/creature.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ static const json_character_flag json_flag_IGNORE_TEMP( "IGNORE_TEMP" );
138138
static const json_character_flag json_flag_INVISIBLE( "INVISIBLE" );
139139
static const json_character_flag json_flag_LIMB_LOWER( "LIMB_LOWER" );
140140
static const json_character_flag json_flag_LIMB_UPPER( "LIMB_UPPER" );
141+
static const json_character_flag json_flag_SUPPRESS_INVISIBILITY( "SUPPRESS_INVISIBILITY" );
141142
static const json_character_flag json_flag_TEEPSHIELD( "TEEPSHIELD" );
142143
static const json_character_flag json_flag_TRUE_SEEING( "TRUE_SEEING" );
143144

@@ -557,8 +558,9 @@ bool Creature::sees( const map &here, const Creature &critter ) const
557558
}
558559

559560
// Invisibility checked after stumbling and after invisibility detection methods
560-
if( critter.has_effect_with_flag( json_flag_INVISIBLE ) ||
561-
critter.has_flag( mon_flag_PERMANENT_INVISIBILITY ) ) {
561+
if( ( critter.has_effect_with_flag( json_flag_INVISIBLE ) ||
562+
critter.has_flag( mon_flag_PERMANENT_INVISIBILITY ) ) &&
563+
!critter.has_effect_with_flag( json_flag_SUPPRESS_INVISIBILITY ) ) {
562564
return false;
563565
}
564566

0 commit comments

Comments
 (0)