Skip to content

Commit 8d2ad4c

Browse files
[Xedra Evolved] Add the "XEDRA Operative, Department of Extra-Normal Capabilities, SATOR Division" profession (CleverRaven#75718)
* Initial commit * change profession name * Add effect * Add more magic squares * Add To Cause Armed Men * Add research system * Add focus handling * More fixes * Remove effect after research is completed * Allow seeing underwater with To Operate Under the Water * Fix spacing, correct components
1 parent 6f0182c commit 8d2ad4c

File tree

13 files changed

+852
-7
lines changed

13 files changed

+852
-7
lines changed

data/mods/Xedra_Evolved/effects/effects.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,13 @@
16931693
}
16941694
]
16951695
},
1696+
{
1697+
"type": "effect_type",
1698+
"id": "effect_xe_deciphering_hedge_tome",
1699+
"//": "Hidden effect, used to check that you're still researching.",
1700+
"name": [ "" ],
1701+
"desc": [ "" ]
1702+
},
16961703
{
16971704
"type": "effect_type",
16981705
"id": "effect_hedge_nether_eye_paste",
@@ -1779,6 +1786,45 @@
17791786
"desc": [ "Hunt. Kill. Feed. Sleep." ],
17801787
"flags": [ "CANNIBAL", "PRED4", "PSYCHOPATH", "STRICT_HUMANITARIAN" ]
17811788
},
1789+
{
1790+
"type": "effect_type",
1791+
"id": "effect_hedge_walk_on_water_magic_square",
1792+
"name": [ "Water-Walking" ],
1793+
"desc": [ "NAHARIAMA\nA Q\nH E\nA Q\nR\nI\nA Q\nM QA\nA" ],
1794+
"//": "The above description replicates a magic square and should not be translated",
1795+
"remove_message": "Your water-walking charm has faded.",
1796+
"decay_messages": [ [ "Your water-walking charm is about to fade.", "bad" ] ],
1797+
"max_duration": "30 m",
1798+
"max_intensity": 30,
1799+
"int_dur_factor": "1 m",
1800+
"flags": [ "ITEM_WATERPROOFING", "WATERWALKING" ]
1801+
},
1802+
{
1803+
"type": "effect_type",
1804+
"id": "effect_hedge_breathe_water_magic_square",
1805+
"name": [ "Water-Breathing" ],
1806+
"desc": [ "BURNAHEU\nULORIPTE\nROMILAPH\nNRITILIA\nAILITIRN\nHPALIMOR\nETPIROLU\nUEHANRUB" ],
1807+
"//": "The above description replicates a magic square and should not be translated",
1808+
"remove_message": "Your water-breathing charm has faded.",
1809+
"decay_messages": [ [ "Your water-breathing charm is about to fade.", "bad" ] ],
1810+
"max_duration": "2 h",
1811+
"max_intensity": 120,
1812+
"int_dur_factor": "1 m",
1813+
"flags": [ "ITEM_WATERPROOFING", "GILLS", "EYE_MEMBRANE" ]
1814+
},
1815+
{
1816+
"type": "effect_type",
1817+
"id": "effect_invisibility_magic_square",
1818+
"name": [ "Invisibility" ],
1819+
"desc": [ "TALAC\nA A\nL L\nA A\nCALAT" ],
1820+
"//": "The above description replicates a magic square and should not be translated",
1821+
"remove_message": "Your invisibility charm has faded.",
1822+
"decay_messages": [ [ "Your invisibility charm is about to fade.", "bad" ] ],
1823+
"max_duration": "77 m",
1824+
"max_intensity": 77,
1825+
"int_dur_factor": "1 m",
1826+
"flags": [ "INVISIBLE" ]
1827+
},
17821828
{
17831829
"type": "effect_type",
17841830
"id": "mutagen_plantkin",
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
[
2+
{
3+
"//": "Rolls below should be -u_skill('deduction') + rng(-2,8) + rng(-2,8)-. This is an average of 6 + Deduction per research period.",
4+
"id": "ACT_XE_DECIPHERING_HEDGE_TOME",
5+
"type": "activity_type",
6+
"activity_level": "NO_EXERCISE",
7+
"verb": "deciphering the secrets of the occult",
8+
"based_on": "time",
9+
"can_resume": false,
10+
"auto_needs": true,
11+
"do_turn_eoc": "EOC_DECIPHERING_NEW_HEDGE_TOME_TIME_TRACKER",
12+
"completion_eoc": "EOC_DECIPHERING_NEW_HEDGE_TOME_PACE_SELF"
13+
},
14+
{
15+
"type": "effect_on_condition",
16+
"id": "EOC_DECIPHERING_NEW_HEDGE_TOME_TIME_TRACKER",
17+
"condition": { "math": [ "u_most_recent_hedge_research_progress", "<=", "u_most_recent_hedge_research_difficulty" ] },
18+
"effect": [ { "math": [ "u_most_recent_hedge_research_time", "+=", "1" ] } ],
19+
"false_effect": [ { "run_eocs": { "u_val": "latest_completion_eoc" } } ]
20+
},
21+
{
22+
"type": "effect_on_condition",
23+
"id": "EOC_DECIPHERING_NEW_HEDGE_TOME_PACE_SELF",
24+
"effect": [
25+
{ "u_message": "You finish your study session.", "type": "neutral" },
26+
{ "u_lose_effect": "effect_xe_deciphering_hedge_tome" }
27+
]
28+
},
29+
{
30+
"type": "effect_on_condition",
31+
"id": "EOC_HEDGE_MAGIC_CANCELLING_ACTIVITY_CANCELS_RESEARCH",
32+
"eoc_type": "EVENT",
33+
"required_event": "character_finished_activity",
34+
"condition": {
35+
"and": [
36+
{ "compare_string": [ "ACT_XE_DECIPHERING_HEDGE_TOME_NEW_POWER", { "context_val": "activity" } ] },
37+
{ "u_has_effect": "effect_xe_deciphering_hedge_tome" }
38+
]
39+
},
40+
"effect": [ { "u_lose_effect": "effect_xe_deciphering_hedge_tome" } ]
41+
},
42+
{
43+
"type": "effect_on_condition",
44+
"id": "EOC_HEDGE_RESEARCH_FOCUS_DRAIN",
45+
"condition": { "u_has_effect": "effect_xe_deciphering_hedge_tome" },
46+
"effect": [
47+
{ "if": { "math": [ "u_val('focus')", ">", "5" ] }, "then": { "math": [ "u_val('focus')", "-=", "1" ] } },
48+
{ "queue_eocs": "EOC_HEDGE_RESEARCH_FOCUS_DRAIN", "time_in_future": [ "1 minutes", "3 minutes" ] }
49+
]
50+
},
51+
{
52+
"type": "effect_on_condition",
53+
"id": "EOC_HEDGE_RESEARCH_PROGRESS_ABRAMELIN_THE_MAGE",
54+
"condition": { "u_has_effect": "effect_xe_deciphering_hedge_tome" },
55+
"effect": [
56+
{
57+
"run_eocs": [
58+
{
59+
"id": "EOC_HEDGE_RESEARCH_PROGRESS_ABRAMELIN_THE_MAGE_2",
60+
"condition": { "math": [ "u_most_recent_hedge_research_time_upper_limit", "<=", "302400" ] },
61+
"effect": [
62+
{
63+
"run_eocs": [
64+
{
65+
"id": "EOC_HEDGE_RESEARCH_PROGRESS_ABRAMELIN_THE_MAGE_3",
66+
"condition": { "math": [ "u_most_recent_hedge_research_progress", "<=", "u_most_recent_hedge_research_difficulty" ] },
67+
"effect": [
68+
{ "math": [ "u_most_recent_hedge_research_progress", "+=", "u_skill('deduction') + rng(-2,8) + rng(-2,8)" ] },
69+
{
70+
"u_run_inv_eocs": "random",
71+
"search_data": [ { "id": "spellbook_hedge_abramelin_the_mage" } ],
72+
"true_eocs": [
73+
{
74+
"id": "EOC_HEDGE_RESEARCH_ABRAMELIN_THE_MAGE_WRITE_VALUES",
75+
"effect": [
76+
{ "math": [ "n_most_recent_hedge_research_time", "=", "u_most_recent_hedge_research_time" ] },
77+
{
78+
"math": [ "n_most_recent_hedge_research_progress", "=", "u_most_recent_hedge_research_progress" ]
79+
}
80+
]
81+
}
82+
]
83+
},
84+
{
85+
"if": { "math": [ "u_val('focus')", ">", "5" ] },
86+
"then": { "math": [ "u_val('focus')", "-=", "5" ] }
87+
},
88+
{
89+
"queue_eocs": "EOC_HEDGE_RESEARCH_PROGRESS_ABRAMELIN_THE_MAGE",
90+
"time_in_future": [
91+
{ "math": [ "3000 / min( scaling_factor(u_val('intelligence') ),2)" ] },
92+
{ "math": [ "4200 / min( scaling_factor(u_val('intelligence') ),2)" ] }
93+
]
94+
}
95+
],
96+
"false_effect": [
97+
{
98+
"run_eocs": [
99+
{
100+
"id": "EOC_HEDGE_RESEARCH_PROGRESS_ABRAMELIN_THE_MAGE_COMPLETION",
101+
"condition": { "math": [ "u_most_recent_hedge_research_progress", ">", "u_most_recent_hedge_research_difficulty" ] },
102+
"effect": [
103+
{ "u_lose_effect": "effect_xe_deciphering_hedge_tome" },
104+
{
105+
"u_message": "You've done it. All the pieces finally fall into place. You've unlocked the occult secrets of this work, and can now study the rituals within.",
106+
"popup": true
107+
},
108+
{ "math": [ "u_deciphered_spellbook_hedge_abramelin_the_mage", "=", "1" ] }
109+
]
110+
}
111+
]
112+
}
113+
]
114+
}
115+
]
116+
}
117+
],
118+
"false_effect": [
119+
{ "u_message": "You can't make heads of tails of this work. You'll have to start over.", "popup": true },
120+
{ "u_lose_effect": "effect_xe_deciphering_hedge_tome" },
121+
{
122+
"u_run_inv_eocs": "random",
123+
"search_data": [ { "id": "spellbook_hedge_abramelin_the_mage" } ],
124+
"true_eocs": [
125+
{
126+
"id": "EOC_HEDGE_RESEARCH_ABRAMELIN_THE_MAGE_WRITE_VALUES_2",
127+
"effect": [ { "math": [ "n_already_failed_research", "=", "1" ] } ]
128+
}
129+
]
130+
}
131+
]
132+
}
133+
]
134+
}
135+
]
136+
}
137+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"type": "effect_on_condition",
4+
"id": "EOC_XE_XE_OPERATIVE_MAGIC_SQUARES_BOOK_UNDERSTANDING",
5+
"eoc_type": "EVENT",
6+
"required_event": "game_start",
7+
"condition": { "u_profession": "xe_hedge_mage_magic_squares" },
8+
"effect": [ { "math": [ "u_deciphered_spellbook_hedge_abramelin_the_mage", "=", "1" ] } ]
9+
}
10+
]

data/mods/Xedra_Evolved/itemgroups/itemgroups.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,8 @@
403403
{ "item": "spellbook_hedge_blood_book", "prob": 2 },
404404
{ "item": "spellbook_hedge_ward_dreams", "prob": 3 },
405405
{ "item": "spellbook_hedge_snare_changelings", "prob": 1 },
406-
{ "item": "spellbook_hedge_bathhouse_midnight", "prob": 1 }
406+
{ "item": "spellbook_hedge_bathhouse_midnight", "prob": 1 },
407+
{ "item": "spellbook_hedge_abramelin_the_mage", "prob": 1 }
407408
]
408409
},
409410
{

data/mods/Xedra_Evolved/items/hedge_magic_items.json

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
[
2+
{
3+
"abstract": "magic_square_base",
4+
"name": "Magic Square abstract",
5+
"description": "SATOR AREPO TENET OPERA ROTAS.",
6+
"type": "TOOL",
7+
"weight": "3 g",
8+
"color": "white",
9+
"symbol": "`",
10+
"price": "0 cent",
11+
"price_postapoc": "0 cent",
12+
"material": [ "paper" ],
13+
"flags": [ "TINDER", "PAPER_SHAPED", "SINGLE_USE" ],
14+
"volume": "6 ml",
15+
"longest_side": "297 mm"
16+
},
217
{
318
"id": "aura_ward_off_rain",
419
"type": "ARMOR",
@@ -262,5 +277,146 @@
262277
"description": "Activate to remove the mantle and end the magic.",
263278
"effect_on_conditions": [ "EOC_HEDGE_TURN_INTO_BEAR_REMOVE_ITEM" ]
264279
}
280+
},
281+
{
282+
"type": "BOOK",
283+
"id": "item_walk_on_water_magic_square",
284+
"copy-from": "magic_square_base",
285+
"name": { "str": "magic square (To Walk Upon the Water)", "str_pl": "magic squares (To Walk Upon the Water)" },
286+
"description": "A piece of paper. A magic square is carefully written on it.",
287+
"extend": { "flags": [ "HEDGE_ENCHANTED" ] },
288+
"use_action": {
289+
"type": "effect_on_conditions",
290+
"description": "Activate the charm using the magic square.",
291+
"effect_on_conditions": [
292+
{
293+
"id": "EOC_HEDGE_WALK_ON_WATER_MAGIC_SQUARE",
294+
"effect": [
295+
{ "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
296+
{ "u_add_effect": "effect_hedge_walk_on_water_magic_square", "duration": 1800, "intensity": 30 }
297+
]
298+
}
299+
]
300+
}
301+
},
302+
{
303+
"type": "BOOK",
304+
"id": "item_breathe_water_magic_square",
305+
"copy-from": "magic_square_base",
306+
"name": { "str": "magic square (To Operate Under the Water)", "str_pl": "magic squares (To Operate Under the Water)" },
307+
"description": "A piece of paper. A magic square is carefully written on it.",
308+
"extend": { "flags": [ "HEDGE_ENCHANTED" ] },
309+
"use_action": {
310+
"type": "effect_on_conditions",
311+
"description": "Activate the charm using the magic square.",
312+
"effect_on_conditions": [
313+
{
314+
"id": "EOC_HEDGE_BREATHE_WATER_MAGIC_SQUARE",
315+
"effect": [
316+
{ "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
317+
{ "u_add_effect": "effect_hedge_breathe_water_magic_square", "duration": 7200, "intensity": 120 }
318+
]
319+
}
320+
]
321+
}
322+
},
323+
{
324+
"type": "BOOK",
325+
"id": "item_bash_terrain_magic_square",
326+
"copy-from": "magic_square_base",
327+
"name": {
328+
"str": "magic square (To Demolish Buildings and Strongholds)",
329+
"str_pl": "magic squares (To Demolish Buildings and Strongholds)"
330+
},
331+
"description": "A piece of paper. A magic square is carefully written on it.",
332+
"extend": { "flags": [ "HEDGE_ENCHANTED" ] },
333+
"use_action": {
334+
"type": "effect_on_conditions",
335+
"description": "Activate the charm using the magic square.",
336+
"effect_on_conditions": [
337+
{
338+
"id": "EOC_HEDGE_BASH_TERRAIN_MAGIC_SQUARE",
339+
"effect": [
340+
{ "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
341+
{ "u_cast_spell": { "id": "hedge_bash_terrain_magic_square_real" }, "targeted": true }
342+
]
343+
}
344+
]
345+
}
346+
},
347+
{
348+
"type": "BOOK",
349+
"id": "item_armed_men_magic_square",
350+
"copy-from": "magic_square_base",
351+
"name": { "str": "magic square (To Cause Armed Men to Appear)", "str_pl": "magic squares (To Cause Armed Men to Appear)" },
352+
"description": "A piece of paper. A magic square is carefully written on it.",
353+
"extend": { "flags": [ "HEDGE_ENCHANTED" ] },
354+
"use_action": {
355+
"type": "effect_on_conditions",
356+
"description": "Activate the charm using the magic square.",
357+
"effect_on_conditions": [
358+
{
359+
"id": "EOC_HEDGE_ARMED_MEN_MAGIC_SQUARE",
360+
"effect": [
361+
{ "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
362+
{
363+
"u_spawn_monster": "GROUP_HEDGE_TO_CAUSE_ARMED_MEN",
364+
"real_count": { "math": [ "2 + rand(3)" ] },
365+
"group": true,
366+
"min_radius": 1,
367+
"max_radius": 3,
368+
"lifespan": [ "15 minutes", "45 minutes" ],
369+
"spawn_message": "An armed warrior appears.",
370+
"spawn_message_plural": "Several armed warriors appear."
371+
}
372+
]
373+
}
374+
]
375+
}
376+
},
377+
{
378+
"type": "BOOK",
379+
"id": "item_food_or_drink_magic_square",
380+
"copy-from": "magic_square_base",
381+
"name": {
382+
"str": "magic square (To Cause the Spirits to Bring us Anything We May Wish to Eat or to Drink)",
383+
"str_pl": "magic squares (To Cause the Spirits to Bring us Anything We May Wish to Eat or to Drink)"
384+
},
385+
"description": "A piece of paper. A magic square is carefully written on it.",
386+
"extend": { "flags": [ "HEDGE_ENCHANTED" ] },
387+
"use_action": {
388+
"type": "effect_on_conditions",
389+
"description": "Activate the charm using the magic square.",
390+
"effect_on_conditions": [
391+
{
392+
"id": "EOC_HEDGE_FOOR_OR_DRINK_MAGIC_SQUARE",
393+
"effect": [ { "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 }, { "run_eocs": "EOC_HEDGE_FOOD_OR_DRINK_SELECTOR" } ]
394+
}
395+
]
396+
}
397+
},
398+
{
399+
"type": "BOOK",
400+
"id": "item_invisibility_magic_square",
401+
"copy-from": "magic_square_base",
402+
"name": {
403+
"str": "magic square (To Render Oneself Invisible Unto Every Person)",
404+
"str_pl": "magic squares (To Render Oneself Invisible Unto Every Person)"
405+
},
406+
"description": "A piece of paper. A magic square is carefully written on it.",
407+
"extend": { "flags": [ "HEDGE_ENCHANTED" ] },
408+
"use_action": {
409+
"type": "effect_on_conditions",
410+
"description": "Activate the charm using the magic square.",
411+
"effect_on_conditions": [
412+
{
413+
"id": "EOC_HEDGE_INVISIBILITY_MAGIC_SQUARE",
414+
"effect": [
415+
{ "u_assign_activity": "ACT_GENERIC_EOC", "duration": 2.5 },
416+
{ "u_add_effect": "effect_invisibility_magic_square", "duration": 4620, "intensity": 77 }
417+
]
418+
}
419+
]
420+
}
265421
}
266422
]

0 commit comments

Comments
 (0)