forked from FireEmblemUniverse/SkillSystem_FE8
-
Notifications
You must be signed in to change notification settings - Fork 10
/
CustomDefinitions.event
542 lines (415 loc) · 15.5 KB
/
CustomDefinitions.event
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
//PROTECT $14B7A70
//PROTECT $144F944
// 7BCA8 // ~5 extra frames than needed? nvm
// gProc_PopR_AnimsOnWrapper ~3 frames?
// post action events? 1-2 frames?
// 7BBB8 MapAnim_EndBattle
//#define FreeSpace 0x012a49a8 // after music, some gfx, and fonts
#define FreeSpace 0x01300000 // after music, some gfx, and fonts
#define FreeSpace_Low 0xb2a610
#define POKEMBLEM
//#define SkillSys_HookAiTryDoOffensiveAction
// Shade+ (in AiSkills), Steal+, and Barricade hook this function so I've disabled them
//#define FreeSpace2_End 0xFFFFFF
#define FreeSpace_Low_End 0xC00000
//#define FreeSpaceBLRange 0x1c1ec0
// Comment out for public releases
//#define DEBUG_MODE
#define TESTING_RANGES
// Config options
#define INSTALL_FMU
#define ENABLE_FMU
#define ENABLE_RANDOMIZER
#define ENABLE_DAMAGE_REDUCTION
//#define INSTALL_OTHER_LANGUAGES
//#define INSTALL_SPANISH
#define USE_HGSS_SPRITES
//#define USE_PMD_SPRITES
PUSH; ORG $D74D0 //{U}
String("V1.14.03 Apr 2024") ; BYTE 0; POP // this overflows into the date but I don't use the date so whatever
//String("V1.14.07 DEBUG BUILD Mar 2024") ; BYTE 0; POP // this overflows into the date but I don't use the date so whatever
#define ProtagID 0x45
#define NumberOfUnitsBeforeStoring 35
#define MaxStoredUnits 110
#define MaxPartyUnits 50
#define LVFACELEFT 2
#define LVFACERIGHT 1
#define LVFACEDOWN 0
#define LVFACEUP 3
//#define ALT_TITLESCREEN
//#define MagikarpOnly // Replace map sprites and mugs with Magikarp. Give all classes "ScaledBack" skill and "Splash" command.
// add [N] to a text dump
//([^#0-9\n]+)([^X]{3})\n
//$1$2[NL]\n
//PROTECT $37744 $377C4
// 968 / $3C8 bytes used? - free range
//PROTECT $1ACBC $1B084
#define GymDifficultyBonusDef_Hard 12
#define GymDifficultyBonusDef_Lunatic 18
#define TrainerDifficultyBonusDef_Hard 12
#define TrainerDifficultyBonusDef_Lunatic 18
#define DoubleSlap Doubleslap
#define TrainerMov 7
#define BaseMov 5
#define PortraitTable NewPortraitTable // Portrait table is an EA def, so no need to #undef it
//#define FreeSpace 0xb2a610
//#define FreeSpaceEnd 0xC00000
#define FreeSpaceBLRange 0x1c1ec0
#define ChapterTileset(chapter, object, palette, config) "PUSH; ORG 0x8b0890 + (148* chapter) + 4; SHORT object; BYTE palette config; POP"
#define ChapterTileAnims(chapter, anim1, anim2) "PUSH; ORG 0x8b0890 + (148* chapter) + 9; BYTE anim1 anim2; POP"
#include "Enumerate/ItemListPokemon.enu.event"
#include "Events/DefinitionsUnitAndClass.event"
#include "Enumerate/ClassIDList.enu.event"
#include "Enumerate/ClassSpriteList.enu.event"
#include "Enumerate/ItemIcons.event"
#include "EngineHacks/ExternalHacks/AccessoriesAndForging/AccessoryEffectDefinitions.event"
// title screen area
//PROTECT $C5724 $C579F
// PROTECT $2af00 $2afff // doubling area
//PROTECT $193A4 $193C8
//PROTECT $3E320 // ai danger map
//PROTECT
#define SkillAccShop(SkillID) "SkillAccOne + (SkillID >> 6) (SkillID & 0x3F)"
#define Ves_SkillBlockOne_ItemID 0xFC
#define Ves_SkillBlockTwo_ItemID 0xFD
#define Ves_SkillBlockThree_ItemID 0xFE
#define Ves_SkillBlockFour_ItemID 0xFF
#ifndef ClassAnimTable
#define ClassAnimTable (0xc00008-0x20)
#endif
#define MuscleBand_BoostIndex 1
#define WiseGlasses_BoostIndex 2
#define LuckyBracer_BoostIndex 3
#define LeatherShield_BoostIndex 4
#define BronzeShield_BoostIndex 5
#define OldWard_BoostIndex 6
#define WornBoots_BoostIndex 7
#define OldScope_BoostIndex 8
#define EnergyBand_BoostIndex 9
#define MuscleBandT2_BoostIndex 10
#define WiseGlassesT2_BoostIndex 11
#define EnergyBandT2_BoostIndex 12
#define PaddedShield_BoostIndex 13
#define IronShield_BoostIndex 14
#define MagicWard_BoostIndex 15
#define QuickBoots_BoostIndex 16
#define SightScope_BoostIndex 17
#define MuscleBandT3_BoostIndex 18
#define WiseGlassesT3_BoostIndex 19
#define EnergyBandT3_BoostIndex 20
#define StuddedShield_BoostIndex 21
#define SteelShield_BoostIndex 22
#define EnhancedWard_BoostIndex 23
#define VintageBoots_BoostIndex 24
#define SilphScope_BoostIndex 25
#define LuckyBracerT3_BoostIndex 26
#define EnergyBandT4_BoostIndex 27
#define ItemTable NewItemTable
#undef ClassTable
#define ClassTable NewClassTable
#ifdef _FE8_
#define ChapterDataTable 0x8B0890
#undef ChapterDataTable
#define ChapterDataTable NewChapterDataTable
#define ChapterDataTableEntSize 148
#endif
#define StandingMapSpriteTable NewStandingMapSpriteTable
#define MovingMapSpriteTable NewMovingMapSpriteTable
//#ifndef ItemTable
//#define ItemTable 0x809B10
//#endif
//#define MoveListTable 1
// Proc skill that replaces misses with half damage.
#define ReplaceMissWithHalfDamage
#define RareCandy ExoticCandy
#define UnitLoadBufferAddr 0x203EFB8 // until 0x2040000
#define Test235 0x203F0D9
#ifndef DebuffTableRam
#define DebuffTableRam 0x0203F100
#define DebuffTableSize 0x000003B0 // 0x438? 0x440? 0x448? default with 62 player units & 20 NPCs
#endif
#define ConvoyExpansionRAMAddr $0203B200
#define ConvoyRamSize $190
#define PokemblemRamLocation 0x203F548
#define PokemblemRamSize $27F
#define CoinsFlagOffset 0x0
#define SignAreaFlagOffset 0x20
#define ObtainSpellFlagOffset 0x40
#define ObtainSkillFlagOffset 0x60
#define ObtainItemFlagOffset 0x80
#define TrainerDefeatedFlagOffset 0xA0 // should use about 0x100 bytes? 128 chapters max * 2 bytes each
#define ObtainAccessoryFlagOffset 0x1A0 // should use 0x20 bytes (128 * (1/4))
#define PokedexCaughtFlagOffset 0x1C0 // RegisterPokemon in trap rework because most pokemblem ram usage is there i guess
#define PokedexSeenFlagOffset 0x1E0
#define HelpMsgFlagOffset 0x200 // until 0x220
#define BuffDepletePerTurnAmount 2 // -2 from buffs per turn
#define BuffTable 0x0203F7C8 // end of pokemblem ram - 0x203F99F // [203F7C7..203F9A0]!
#define BuffTableSize 0x1D8 // Pokemblem - 50 players/enemies, 15 NPCs - regular would be $21C i think
#define BuffTableEntrySize 4
#define FreeRamByte1 0x30017A0 // - 0x30017A6
#define FreeMoveRamByte 0x30017A7
#define TempRamWhileExpShare 0x2026E30 // used in pc boxes too
#define TempRamWhileExpShare2 0x2026E34 // used in pc boxes too
#define TempRamWhileExpShare3 0x2026E38 // used in pc boxes too
#define ExpShareUnitID 0x30017A8
#define ExpShareAmount 0x30017A9
#define XCoordTeleport 0x30017AA
#define YCoordTeleport 0x30017AB
#define XCoordNewArea 0x30017ac
#define YCoordNewArea 0x30017ad
#define CurrentChapter 0x30017ae
#define TeleportChapter 0x30017af
//#define RetreatChapter 0x30017b0
#define PlayerAvatarClass 0x30017b0
//#define DigChapter 0x30017b1
#define CurrentLanguage 0x30017b1
#define GaryStarterClass 0x30017b2 //we can set this at the beginning and then add 1 a couple times to evolve, maybe?
#define PostTrainerBattleRamLocat 0x30017b3
#define DisableMenuOptionsRam 0x30017b4 // byte bitflags: gaiden, capture, submenu, (guard & call use definitions)
#define DigChapterRam 0x30017B5
#define XCoordDig 0x30017B6
#define YCoordDig 0x30017B7
#define CurrentPartySizeRam 0x30017b8 // used to check whether to autosave
#define BerryDurabilityToggleRam 0x30017b9
#define ReturnTMRam 0x30017ba // Also used for enemy AI
#define DRSingleRam 0x30017bb
#define UnitPointerRam 0x30017BC // - BF // used in ReplaceMoveMenu
#define CapturedPkmnDeploymentID 0x30017C0
#define SpeedupRam 0x30017C1 // bit1 is used in Speedup.asm for light runes if you're holding A
#define RepelStepsRam 0x30017C2 // SHORT (& 0x30017C3)
#define StartTimeSeedRam 0x203F7C4 // end of pokemblem ram
//#define StartTimeSeedRam 0x30017C4 // - c7 used in RandomizeClass
//this ram is not good to use!
#define TrainerLowerRange 0xE0
#define TrainerUpperRange 0xEF // unit IDs reserved for trainers
#define LunarBrace 0x98
#define SolarBrace 0x99
// Attribute for defining items with passive skills
#define PASSIVE_ITEM_SKILL_ATTR 0x00800000
// this is for if you use the legacy way of define item attributes in your table (this is for byte 3)
#define PassiveBoosts 0x80
#define StatBonus(HPB,StrB,MagB,SklB,SpdB,DefB,ResB,LckB,MovB,ConB) "BYTE HPB StrB SklB SpdB DefB ResB LckB MovB ConB MagB 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0"
#define GrowthBonus(HPB,StrB,MagB,SklB,SpdB,DefB,ResB,LckB) "BYTE 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 HPB StrB SklB SpdB DefB ResB LckB MagB 0x0 0x0"
//item ID for skill scroll
#define SkillScroll 0xF7
#define SpellScroll 0xF8
#define GaryHouseBG 56
#define ViridianForestBG 57
#define WorldMapBG 58
#define ChampionsRoomBG 59
#include "EngineHacks/SkillSystem/Definitions/skill_definitions.enu.event"
// #define __DEBUG__ // Uncomment to get the Debug startup menu :p
// Vanilla Flag Definitions
#define AltBGMFlag 0x4
#define GameOverEID 0x65
#define HideObjectiveFlag 0x66
#define CreatureCampaignUnitFlag 0x67 // - 0x70
#define TriangleAttackBattleQuoteFlag 0x7F //0x80 0x81
#define DKMusicFlag 0x82
#define HideUnitIconsFlag 0x84
#define WorldMapSomethingFlag 0x88
#define WordMapInitialized 0x89
#define FreliaFlag 0x8A
#define BracketedGrowthsFlag 0xAE
#define CasualModeFlag 0xB0
#define CasualModeFlag_2 0xE0
//Added
#define HiredPokemonFlag 0xA // Temp flag
#define SkipIntroFlag 0x86
// 85 - program code FE8J ?
#define GaryRoute2SDefeatedFlag 0x8B
#define BoulderbadgeObtained 0x8C
#define RocketMagikarpFlag 0x8D
#define CascadebadgeObtained 0x8E
#define PlayableCutsceneFlag 0x8F
#define TrainerBattleActiveFlag 0x90
#define RefreshActiveUnitFlag 0x91
#define CallCountdownFlag 0x8
#define CallCountdownFlag_2 0x9
#define AttackedThisTurnFlag 0x1
#define SSAnneTicketFlag 0x92
#define ObtainedCutFlag 0x93
#define CutHmFlag 0x93
#define ThunderbadgeObtained 0x94
#define Route1Tutorial_A 0x95
#define QuicksaveToggleFlag 0x96
#define DangerRadiusToggleFlag 0x97
#define PurchasedPsyduckFlag 0x98
#define PokefluteFlag 0x99
#define BossPokemonWarningFlag 0x9A
#define SoulbadgeObtained 0x9D
#define RockSmashFlag 0x9E
#define FlyFlag 0x9F
#define RainbowbadgeObtained 0xA0
#define ObtainedEeveeFlag 0xA1
#define DomeFossilFlag 0xA2
#define HelixFossilFlag 0xA3
#define OldAmberFlag 0xA4
#define ObtainedKabutoFlag 0xA5
#define ObtainedOmanyteFlag 0xA6
#define ObtainedAerodactylFlag 0xA7
#define ViridianTopHouseLategame 0xA8
#define SaffronArrived 0xA9
#define ToyBoxOnFlag 0xAA
#define ToyBoxDisplayFlag 0xAB
#define SilphCoDefeated 0xAC
//#define RandomizeClassesFlag 0xAD
//#define BracketedGrowthsFlag 0xAE
#define BonusUnitObtainedFlag 0xAF
#define CasualModeFlagOn 0xB0
#define TrainerMovementDebuffFlag 0xB1 // when active, trainers have halved movement
#define DojoDefeated 0xB2
#define PsychicObtained 0xB3
#define MarshbadgeObtained 0xB4
#define B1_BoulderAFlag 0xB5
#define B1_BoulderBFlag 0xB6
#define B2_BoulderAFlag 0xB7
#define B2_BoulderBFlag 0xB8
#define B3_BoulderAFlag 0xB9
#define B3_BoulderBFlag 0xBA
#define B4_BoulderAFlag 0xBB
#define B4_BoulderBFlag 0xBC
#define DisableTutMsgsFlag 0xBD
#define DisableTutFlag_A 0xBE
#define DisableTutFlag_B 0xBF
#define CinnabarArrived 0xC9
#define VolcanobadgeObtained 0xCA
#define SecretKeyObtained 0xCB
#define ToggleMansionFlag 0xCC
#define VR_BoulderInHoleFlag 0xCD
#define IndigoPlateauArrived 0xCE
#define EarthbadgeObtained 0xD0
#define StrengthBoulderFlag 0xD1
#define MoltresFledFlag 0xD2
#define ArticunoFledFlag 0xD3
#define ZapdosFledFlag 0xD4
#define MewFledFlag 0xD5
#define LoreleiDefeatedTemp 0xD6
#define BrunoDefeatedTemp 0xD7
#define AgathaDefeatedTemp 0xD8
#define LanceDefeatedTemp 0xD9
#define ChampionDefeatedPhaseOne 0xDA
#define ChampionDefeatedTemp 0xDB
#define CompletedPokemonLeague 0xDC
//#define PurchasedPsyduckFlag 0x98
//#define ObtainedEeveeFlag 0xA1
#define PurchasedOddishFlag 0xDD
#define PurchasedGrowlitheFlag 0xDE
#define PurchasedFarfetchdFlag 0xDF
//#define CasualModeFlag_2 0xE0
#define PurchasedMagmarFlag 0xE1
#define PurchasedJynxFlag 0xE2
#define PurchasedHitmonchanFlag 0xE3
#define PurchasedHitmonleeFlag 0xE4
#define PurchasedLaprasFlag 0xE5
#define GirlProtagFlag 0xE6
#define PurchasedElectabuzzFlag 0xE7
#define CannotCaptureFlag 0xE8
#define RefreshEvenInTrainerBattleFlag 0xE9
#define SpeedupFlag 0xEA
#define InitSramFlag 0xEB
#define CardKeyFlag 0xEC
// 0xED BracketedGrowths
// 0xEF fixed growths
// Pewter City: visit gym with flag 0x12C
#define PewterGymClosedFlag 0x12C // final flag
#define CeruleanGymClosedFlag 0x12B
#define VermilionGymClosedFlag 0x12A
#define FuschiaGymClosedFlag 0x129
#define CeladonGymClosedFlag 0x128
#define SaffronGymClosedFlag 0x127
#define CinnabarGymClosedFlag 0x126
#define ViridianGymClosedFlag 0x125
#define PewterGymRematchedFlag 0x124
#define CeruleanGymRematchedFlag 0x123
#define VermilionGymRematchedFlag 0x122
#define FuschiaGymRematchedFlag 0x121
#define CeladonGymRematchedFlag 0x120
#define SaffronGymRematchedFlag 0x11F
#define CinnabarGymRematchedFlag 0x11E
#define ViridianGymRematchedFlag 0x11D
#define RematchNotify1 0x11C
#define RematchNotify2 0x11B
#define ArticunoDefeatedFlag 0x11A
#define ZapdosDefeatedFlag 0x119
#define MoltresDefeatedFlag 0x118
#define MewDefeatedFlag 0x117
#define MewtwoDefeatedFlag 0x116
#define MissingnoFlag 0x115
#define RandomizeWeaponStatsFlag 0x114
#define RandomizeClassesFlag 0xAD // wild pkmn
// if both on, randomize all 0xA0+
//if only bosses, 0xA0+ in "boss chapters"
//if only trainers, 0xA0+ in non-boss chapters
#define RandomizeTrainerClassesFlag 0x113 // unit IDs 0xA0+
#define RandomizeBossClassesFlag 0x112
#define RandomizeGrowthsFlag 0x111
#define RandomizeFoundItemsFlag 0x110
#define RandomizeBaseStatsFlag 0x10F
#define RandomizeSkillsFlag 0x10E
//#define CannotCaptureFlag 0xE8
#define CannotEvolveFlag 0x10D
// Unit IDs
#define OaksAide 0xEA
#define OaksAide2 0xEC // used in Saffron for Hitmons
#define OaksAidePkmn 0xEB
#define OaksAidePkmn2 0xED
#define OaksAideClass gentlemanID
// Flags
#define DebugPlaceUnitsFlag 0xAA
#define DebugPlaceUnitsFlagMenu 0xAB
#define HiredPokemonUnitID 0x41
#define OaksPikachuUnitID 0x4F
// Terrain
#define Ground 0x01 // Plains
#define Grass 0x0C // Forest +5 avo to encourage units to stand on grass sometimes
#define Sea 0x15 // Sea // +10 avo to encourage units to stand on it where possible
#define Shallow 0x16 // River
#define Lake 0x16
#define HealingGround 0x18 // +10 avo to encourage units to stand on it
//typings (effectiveness rework)
#define FireType 0x01
#define WaterType 0x02
#define ElectricType 0x04
#define FightingType 0x08
#define PoisonType 0x10
#define GroundType 0x20
#define FlyingType 0x40
#define RockType 0x80
#define GhostType 0x100
#define NormalType 0x200
#define DragonType 0x400
#define GrassType 0x800
#define IceType 0x1000
#define SteelType 0x2000
#define PsychicType 0x4000
#define BugType 0x8000
//unused
#define DarkType 0x100000
#define FairyType 0x200000
#define NormalTypeWep 0x00
#define FightingTypeWep 0x20
#define ElectricTypeWep 0x01
#define SteelTypeWep 0x21
#define WaterTypeWep 0x02
#define IceTypeWep 0x22
#define FireTypeWep 0x03
#define FlyingTypeWep 0x13
#define DragonTypeWep 0x23
#define StaffTypeWep 0x04
#define FairyTypeWep 0x14
#define GrassTypeWep 0x05
#define PoisonTypeWep 0x15
#define BugTypeWep 0x25
#define GroundTypeWep 0x06
#define RockTypeWep 0x16
#define PsychicTypeWep 0x07
#define GhostTypeWep 0x17
#define DarkTypeWep 0x27
#define ItemTypeWep 0x09
#define SpiritDust Calcium
#define jumpToHack_r0(offset) "SHORT 0x4800 0x4700 ; POIN (offset|1)"
#define jumpToHack_r1(offset) "SHORT 0x4900 0x4708 ; POIN (offset|1)"
#define jumpToHack_r2(offset) "SHORT 0x4A00 0x4710 ; POIN (offset|1)"
#define jumpToHack_r3(offset) "SHORT 0x4B00 0x4718 ; POIN (offset|1)"
// #define __DEBUG__ // Uncomment to get the Debug startup menu :p