Skip to content

Commit 42a6671

Browse files
committed
Add full promotion
1 parent 0969e62 commit 42a6671

3 files changed

Lines changed: 234 additions & 9 deletions

File tree

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mundane-ascension",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "A mod for playing a Mundane-only run",
55
"author": {
66
"name": "Lyeeedar"

src/modContent/index.ts

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { EnemyEntity, GameLocation, Realm } from 'afnm-types';
2+
13
const herbGarden = window.modAPI.gameData.locations['Spirit Herb Garden'];
24
herbGarden.buildings?.forEach((building) => {
35
if (building.kind === 'herbField') {
@@ -11,3 +13,226 @@ mine.buildings?.forEach((building) => {
1113
building.disabled = undefined;
1214
}
1315
});
16+
17+
const liangTiao = window.modAPI.gameData.locations['Liang Tiao Village'];
18+
19+
const getPromotionEnemies = (realm: Realm): EnemyEntity[] => {
20+
const earlyLocations = Object.values(window.modAPI.gameData.locations).filter(
21+
(e) => e.realm === realm && e.realmProgress === 'Early' && e.enemies,
22+
);
23+
const middleLocations = Object.values(
24+
window.modAPI.gameData.locations,
25+
).filter(
26+
(e) => e.realm === realm && e.realmProgress === 'Middle' && e.enemies,
27+
);
28+
const lateLocations = Object.values(window.modAPI.gameData.locations).filter(
29+
(e) => e.realm === realm && e.realmProgress === 'Late' && e.enemies,
30+
);
31+
return [
32+
earlyLocations[0].enemies!![0].enemy,
33+
middleLocations[0].enemies!![0].enemy,
34+
lateLocations[0].enemies!![0].enemy,
35+
];
36+
};
37+
38+
const arena: GameLocation = {
39+
name: 'Arena',
40+
description: 'An arena where you can prove your worth.',
41+
image: liangTiao.image,
42+
icon: liangTiao.icon,
43+
screenEffect: 'rain',
44+
music: 'Liangtiao',
45+
ambience: 'Market',
46+
position: {
47+
x: liangTiao.position.x + 50,
48+
y: liangTiao.position.y + 350,
49+
},
50+
size: 'tiny',
51+
unlocks: [],
52+
buildings: [
53+
{
54+
kind: 'healer',
55+
},
56+
{
57+
kind: 'custom',
58+
condition: '1',
59+
name: 'Arena',
60+
icon: liangTiao.icon,
61+
position: 'middle',
62+
eventSteps: [
63+
{
64+
kind: 'text',
65+
text: 'The arena stands before you, a place where you can prove a worth far beyond your realm.',
66+
},
67+
{
68+
kind: 'choice',
69+
choices: [
70+
{
71+
text: `Attempt a promotion to 'Core Formation'`,
72+
showCondition: 'realm == qiCondensation',
73+
children: [
74+
{
75+
kind: 'text',
76+
text: "As you approach the arena, you see a sign that reads 'Promotion to Core Formation'. Entering it, you find yourself face-to-face with a dangerous collection of beasts. If you overcome them, you can earn yourself a promotion.",
77+
},
78+
{
79+
kind: 'combat',
80+
enemies: getPromotionEnemies('coreFormation'),
81+
victory: [
82+
{
83+
kind: 'text',
84+
text: 'Elation floods through you as the last of the beasts fall.',
85+
},
86+
{
87+
kind: 'overridePlayerRealm',
88+
realm: 'coreFormation',
89+
},
90+
{
91+
kind: 'exit',
92+
},
93+
],
94+
defeat: [
95+
{
96+
kind: 'text',
97+
text: 'You were defeated in the arena. You leave with your head hanging low.',
98+
},
99+
{
100+
kind: 'exit',
101+
},
102+
],
103+
},
104+
],
105+
},
106+
{
107+
text: `Attempt a promotion to 'Qi Condensation'`,
108+
showCondition: 'realm == meridianOpening',
109+
children: [
110+
{
111+
kind: 'text',
112+
text: "As you approach the arena, you see a sign that reads 'Promotion to Qi Condensation'. Entering it, you find yourself face-to-face with a dangerous collection of beasts. If you overcome them, you can earn yourself a promotion.",
113+
},
114+
{
115+
kind: 'combat',
116+
enemies: getPromotionEnemies('qiCondensation'),
117+
victory: [
118+
{
119+
kind: 'text',
120+
text: 'Elation floods through you as the last of the beasts fall.',
121+
},
122+
{
123+
kind: 'overridePlayerRealm',
124+
realm: 'qiCondensation',
125+
},
126+
{
127+
kind: 'exit',
128+
},
129+
],
130+
defeat: [
131+
{
132+
kind: 'text',
133+
text: 'You were defeated in the arena. You leave with your head hanging low.',
134+
},
135+
{
136+
kind: 'exit',
137+
},
138+
],
139+
},
140+
],
141+
},
142+
{
143+
text: `Attempt a promotion to 'Meridian Opening'`,
144+
showCondition: 'realm == bodyForging',
145+
children: [
146+
{
147+
kind: 'text',
148+
text: "As you approach the arena, you see a sign that reads 'Promotion to Meridian Opening'. Entering it, you find yourself face-to-face with a dangerous collection of beasts. If you overcome them, you can earn yourself a promotion.",
149+
},
150+
{
151+
kind: 'combat',
152+
enemies: getPromotionEnemies('meridianOpening'),
153+
victory: [
154+
{
155+
kind: 'text',
156+
text: 'Elation floods through you as the last of the beasts fall.',
157+
},
158+
{
159+
kind: 'overridePlayerRealm',
160+
realm: 'meridianOpening',
161+
},
162+
{
163+
kind: 'exit',
164+
},
165+
],
166+
defeat: [
167+
{
168+
kind: 'text',
169+
text: 'You were defeated in the arena. You leave with your head hanging low.',
170+
},
171+
{
172+
kind: 'exit',
173+
},
174+
],
175+
},
176+
],
177+
},
178+
{
179+
text: `Attempt a promotion to 'Body Forging'`,
180+
showCondition: 'realm == mundane',
181+
children: [
182+
{
183+
kind: 'text',
184+
text: "As you approach the arena, you see a sign that reads 'Promotion to Body Forging'. Entering it, you find yourself face-to-face with a dangerous collection of beasts. If you overcome them, you can earn yourself a promotion.",
185+
},
186+
{
187+
kind: 'combat',
188+
enemies: getPromotionEnemies('bodyForging'),
189+
victory: [
190+
{
191+
kind: 'text',
192+
text: 'Elation floods through you as the last of the beasts fall.',
193+
},
194+
{
195+
kind: 'overridePlayerRealm',
196+
realm: 'bodyForging',
197+
},
198+
{
199+
kind: 'exit',
200+
},
201+
],
202+
defeat: [
203+
{
204+
kind: 'text',
205+
text: 'You were defeated in the arena. You leave with your head hanging low.',
206+
},
207+
{
208+
kind: 'exit',
209+
},
210+
],
211+
},
212+
],
213+
},
214+
{
215+
text: 'Leave',
216+
children: [
217+
{
218+
kind: 'text',
219+
text: 'You decide to leave the arena for now.',
220+
},
221+
{
222+
kind: 'exit',
223+
},
224+
],
225+
},
226+
],
227+
},
228+
],
229+
},
230+
],
231+
};
232+
233+
window.modAPI.actions.addLocation(arena);
234+
window.modAPI.actions.linkLocations(liangTiao.name, {
235+
condition: '1',
236+
distance: 1,
237+
location: arena,
238+
});

0 commit comments

Comments
 (0)