-
Notifications
You must be signed in to change notification settings - Fork 2
/
SeedObject.cs
722 lines (619 loc) · 18.1 KB
/
SeedObject.cs
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
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace YAMS_LIB;
// TODO: There are lots of horrible names in here
public class SeedObject
{
[JsonInclude]
[JsonPropertyName("configuration_identifier")]
public ConfigurationIdentifier Identifier;
[JsonInclude]
[JsonPropertyName("game_patches")]
public GamePatches Patches;
[JsonInclude]
[JsonPropertyName("door_locks")]
public Dictionary<uint, DoorLock> DoorLocks;
[JsonInclude]
[JsonPropertyName("pickups")]
public Dictionary<string, PickupObject> PickupObjects = new Dictionary<string, PickupObject>();
[JsonInclude]
[JsonPropertyName("rooms")]
public Dictionary<string, RoomObject> RoomObjects = new Dictionary<string, RoomObject>();
[JsonInclude]
[JsonPropertyName("pipes")]
public Dictionary<uint, PipeObject> PipeObjects = new Dictionary<uint, PipeObject>();
[JsonInclude]
[JsonPropertyName("entrances")]
public Dictionary<uint, EntranceObject> EntranceObjects = new Dictionary<uint, EntranceObject>();
[JsonInclude]
[JsonPropertyName("starting_items")]
public Dictionary<ItemEnum, int> StartingItems = new Dictionary<ItemEnum, int>();
[JsonInclude]
[JsonPropertyName("starting_location")]
public StartingLocationObject StartingLocation;
[JsonInclude]
[JsonPropertyName("hints")]
public Dictionary<HintLocationEnum, string> Hints = new Dictionary<HintLocationEnum, string>();
[JsonInclude]
[JsonPropertyName("cosmetics")]
public GameCosmetics Cosmetics;
[JsonInclude]
[JsonPropertyName("credits_spoiler")]
public string CreditsSpoiler;
}
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum DoorFacingDirection
{
[EnumMember(Value = "left")]
Left,
[EnumMember(Value = "right")]
Right,
[EnumMember(Value = "invalid")]
Invalid,
}
public class DoorLock
{
[JsonInclude]
[JsonPropertyName("lock")]
public DoorLockType Lock;
// TODO: add these two to the schema.
[JsonInclude]
[JsonPropertyName("is_dock")]
public bool isDock;
[JsonInclude]
[JsonPropertyName("facing_direction")]
public DoorFacingDirection FacingDirection;
}
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum DoorLockType
{
[EnumMember(Value = "Normal Door")]
Normal,
[EnumMember(Value = "Missile Door")]
Missile,
[EnumMember(Value = "Super Missile Door")]
SuperMissile,
[EnumMember(Value = "Power Bomb Door")]
PBomb,
[EnumMember(Value = "Temporarily Locked Door")]
TempLocked,
[EnumMember(Value = "Charge Beam Door")]
Charge,
[EnumMember(Value = "Wave Beam Door")]
Wave,
[EnumMember(Value = "Spazer Beam Door")]
Spazer,
[EnumMember(Value = "Plasma Beam Door")]
Plasma,
[EnumMember(Value = "Ice Beam Door")]
Ice,
[EnumMember(Value = "Bomb Door")]
Bomb,
[EnumMember(Value = "Spider Ball Door")]
Spider,
[EnumMember(Value = "Screw Attack Door")]
Screw,
[EnumMember(Value = "Tower Energy Restored Door")]
TowerEnabled,
[EnumMember(Value = "Tester-Locked Door")]
TesterDead,
[EnumMember(Value = "Guardian-Locked Door")]
GuardianDead,
[EnumMember(Value = "Arachnus-Locked Door")]
ArachnusDead,
[EnumMember(Value = "Torizo-Locked Door")]
TorizoDead,
[EnumMember(Value = "Serris-Locked Door")]
SerrisDead,
[EnumMember(Value = "Genesis-Locked Door")]
GenesisDead,
[EnumMember(Value = "Queen-Locked Door")]
QueenDead,
[EnumMember(Value = "Distribution Center Energy Restored Door")]
EMPActivated,
[EnumMember(Value = "Golden Temple EMP Door")]
EMPA1,
[EnumMember(Value = "Hydro Station EMP Door")]
EMPA2,
[EnumMember(Value = "Industrial Complex EMP Door")]
EMPA3,
[EnumMember(Value = "Distribution Center EMP Ball Introduction EMP Door")]
EMPA5Tutorial,
[EnumMember(Value = "Distribution Center Robot Home EMP Door")]
EMPA5RobotHome,
[EnumMember(Value = "Distribution Center Energy Distribution Tower East EMP Door")]
EMPA5NearZeta,
[EnumMember(Value = "Distribution Center Bullet Hell Room Access EMP Door")]
EMPA5BulletHell,
[EnumMember(Value = "Distribution Center Pipe Hub Access EMP Door")]
EMPA5PipeHub,
[EnumMember(Value = "Distribution Center Exterior East Access EMP Door")]
EMPA5RightExterior,
[EnumMember(Value = "Locked Door")]
Locked,
[EnumMember(Value = "Hydro Station Water Turbine")]
A2WaterTurbine,
[EnumMember(Value = "Research Site Open Hatch")]
ResearchHatch,
}
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum HintLocationEnum
{
[EnumMember(Value = "septogg_a0")]
SeptoggA0,
[EnumMember(Value = "septogg_a1")]
SeptoggA1,
[EnumMember(Value = "septogg_a2")]
SeptoggA2,
[EnumMember(Value = "septogg_a3")]
SeptoggA3,
[EnumMember(Value = "septogg_a4")]
SeptoggA4,
[EnumMember(Value = "septogg_a5")]
SeptoggA5,
[EnumMember(Value = "septogg_a6")]
SeptoggA6,
[EnumMember(Value = "chozo_labs")]
ChozoLabs,
}
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum RoomNameHudEnum
{
[EnumMember(Value = "NEVER")]
Never,
[EnumMember(Value = "WITH_FADE")]
OnEntry,
[EnumMember(Value = "ALWAYS")]
Always,
}
public class GameCosmetics
{
[JsonInclude]
[JsonPropertyName("show_unexplored_map")]
public bool ShowUnexploredMap;
[JsonInclude]
[JsonPropertyName("unveiled_blocks")]
public bool UnveilBlocks;
[JsonInclude]
[JsonPropertyName("health_hud_rotation")]
public int HealthHUDRotation;
[JsonInclude]
[JsonPropertyName("etank_hud_rotation")]
public int EtankHUDRotation;
[JsonInclude]
[JsonPropertyName("dna_hud_rotation")]
public int DNAHUDRotation;
[JsonInclude]
[JsonPropertyName("tileset_rotation")]
public int TilesetRotation;
[JsonInclude]
[JsonPropertyName("background_rotation")]
public int BackgroundRotation;
[JsonInclude]
[JsonPropertyName("room_names_on_hud")]
public RoomNameHudEnum RoomNameHud;
[JsonInclude]
[JsonPropertyName("music_shuffle")]
public Dictionary<string, string> MusicShuffleDict = new Dictionary<string, string>();
}
public class GamePatches
{
[JsonInclude]
[JsonPropertyName("septogg_helpers")]
public bool SeptoggHelpers;
[JsonInclude]
[JsonPropertyName("change_level_design")]
public bool ChangeLevelDesign;
[JsonInclude] [JsonPropertyName("grave_grotto_blocks")]
public bool GraveGrottoBlocks;
[JsonInclude]
[JsonPropertyName("respawn_bomb_blocks")]
public bool RespawnBombBlocks;
[JsonInclude]
[JsonPropertyName("skip_cutscenes")]
public bool SkipCutscenes;
[JsonInclude]
[JsonPropertyName("skip_save_cutscene")]
public bool SkipSaveCutscene;
[JsonInclude]
[JsonPropertyName("skip_item_cutscenes")]
public bool SkipItemFanfares;
[JsonInclude]
[JsonPropertyName("energy_per_tank")]
public int EnergyPerTank;
[JsonInclude]
[JsonPropertyName("require_missile_launcher")]
public bool RequireMissileLauncher;
[JsonInclude]
[JsonPropertyName("require_super_launcher")]
public bool RequireSuperLauncher;
[JsonInclude]
[JsonPropertyName("require_pb_launcher")]
public bool RequirePBLauncher;
[JsonInclude]
[JsonPropertyName("fusion_mode")]
public bool FusionMode;
[JsonInclude]
[JsonPropertyName("supers_on_missile_doors")]
public bool CanUseSupersOnMissileDoors = true;
[JsonInclude]
[JsonPropertyName("nest_pipes")]
public bool NestPipes;
[JsonInclude]
[JsonPropertyName("softlock_prevention_blocks")]
public bool SoftlockPrevention;
[JsonInclude]
[JsonPropertyName("a3_entrance_blocks")]
public bool A3EntranceBlocks;
[JsonInclude]
[JsonPropertyName("screw_blocks")]
public bool ScrewPipeBlocks;
[JsonInclude]
[JsonPropertyName("enforce_screw_for_bg2")]
public bool EnforceScrewForBG2;
[JsonInclude]
[JsonPropertyName("sabre_designed_skippy")]
public bool SabreSkippy;
[JsonInclude]
[JsonPropertyName("locked_missile_text")]
public TextDetails LockedMissileText;
[JsonInclude]
[JsonPropertyName("locked_super_text")]
public TextDetails LockedSuperText;
[JsonInclude]
[JsonPropertyName("locked_pb_text")]
public TextDetails LockedPBombText;
[JsonInclude]
[JsonPropertyName("required_amount_of_dna")]
public int RequiredDNAmount = 46;
[JsonInclude]
[JsonPropertyName("one_suit_damage_multiplier")]
public double OneSuitDamageMultiplier = 0.5;
[JsonInclude]
[JsonPropertyName("two_suits_damage_multiplier")]
public double TwoSuitsDamageMultiplier = 0.25;
[JsonInclude]
[JsonPropertyName("flip_vertically")]
public bool FlipVertically;
[JsonInclude]
[JsonPropertyName("flip_horizontally")]
public bool FlipHorizontally;
}
public class ConfigurationIdentifier
{
[JsonInclude]
[JsonPropertyName("hash")]
public string Hash = "Quack";
[JsonInclude]
[JsonPropertyName("word_hash")]
public string WordHash = "Have fun";
[JsonInclude]
[JsonPropertyName("randovania_version")]
public string RDVVersion = "Randovania";
[JsonInclude]
[JsonPropertyName("patcher_version")]
public string PatcherVersion = "YAMS";
[JsonInclude]
[JsonPropertyName("starting_memo")]
public TextDetails? StartingMemoText;
// TODO: rename this json property
[JsonInclude]
[JsonPropertyName("session_uuid")]
public string WorldUUID = "";
}
public class StartingLocationObject
{
[JsonInclude]
[JsonPropertyName("save_room")]
// TODO: For ease of use, this should be 3 fields: a string for room name, and two int positions for x/y start.
public int SaveRoom;
}
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum ItemEnum
{
[EnumMember(Value = "Metroid DNA 1")]
DNA1,
[EnumMember(Value = "Metroid DNA 2")]
DNA2,
[EnumMember(Value = "Metroid DNA 3")]
DNA3,
[EnumMember(Value = "Metroid DNA 4")]
DNA4,
[EnumMember(Value = "Metroid DNA 5")]
DNA5,
[EnumMember(Value = "Metroid DNA 6")]
DNA6,
[EnumMember(Value = "Metroid DNA 7")]
DNA7,
[EnumMember(Value = "Metroid DNA 8")]
DNA8,
[EnumMember(Value = "Metroid DNA 9")]
DNA9,
[EnumMember(Value = "Metroid DNA 10")]
DNA10,
[EnumMember(Value = "Metroid DNA 11")]
DNA11,
[EnumMember(Value = "Metroid DNA 12")]
DNA12,
[EnumMember(Value = "Metroid DNA 13")]
DNA13,
[EnumMember(Value = "Metroid DNA 14")]
DNA14,
[EnumMember(Value = "Metroid DNA 15")]
DNA15,
[EnumMember(Value = "Metroid DNA 16")]
DNA16,
[EnumMember(Value = "Metroid DNA 17")]
DNA17,
[EnumMember(Value = "Metroid DNA 18")]
DNA18,
[EnumMember(Value = "Metroid DNA 19")]
DNA19,
[EnumMember(Value = "Metroid DNA 20")]
DNA20,
[EnumMember(Value = "Metroid DNA 21")]
DNA21,
[EnumMember(Value = "Metroid DNA 22")]
DNA22,
[EnumMember(Value = "Metroid DNA 23")]
DNA23,
[EnumMember(Value = "Metroid DNA 24")]
DNA24,
[EnumMember(Value = "Metroid DNA 25")]
DNA25,
[EnumMember(Value = "Metroid DNA 26")]
DNA26,
[EnumMember(Value = "Metroid DNA 27")]
DNA27,
[EnumMember(Value = "Metroid DNA 28")]
DNA28,
[EnumMember(Value = "Metroid DNA 29")]
DNA29,
[EnumMember(Value = "Metroid DNA 30")]
DNA30,
[EnumMember(Value = "Metroid DNA 31")]
DNA31,
[EnumMember(Value = "Metroid DNA 32")]
DNA32,
[EnumMember(Value = "Metroid DNA 33")]
DNA33,
[EnumMember(Value = "Metroid DNA 34")]
DNA34,
[EnumMember(Value = "Metroid DNA 35")]
DNA35,
[EnumMember(Value = "Metroid DNA 36")]
DNA36,
[EnumMember(Value = "Metroid DNA 37")]
DNA37,
[EnumMember(Value = "Metroid DNA 38")]
DNA38,
[EnumMember(Value = "Metroid DNA 39")]
DNA39,
[EnumMember(Value = "Metroid DNA 40")]
DNA40,
[EnumMember(Value = "Metroid DNA 41")]
DNA41,
[EnumMember(Value = "Metroid DNA 42")]
DNA42,
[EnumMember(Value = "Metroid DNA 43")]
DNA43,
[EnumMember(Value = "Metroid DNA 44")]
DNA44,
[EnumMember(Value = "Metroid DNA 45")]
DNA45,
[EnumMember(Value = "Metroid DNA 46")]
DNA46,
[EnumMember(Value = "Missile Tank")]
MissileExpansion,
[EnumMember(Value = "Super Missile Tank")]
SuperMissileExpansion,
[EnumMember(Value = "Power Bomb Tank")]
PBombExpansion,
[EnumMember(Value = "Energy Tank")]
EnergyTank,
[EnumMember(Value = "Missiles")]
Missile,
[EnumMember(Value = "Locked Missiles")]
LockedMissile,
[EnumMember(Value = "Super Missiles")]
SuperMissile,
[EnumMember(Value = "Locked Super Missiles")]
LockedSuperMissile,
[EnumMember(Value = "Power Bombs")]
PBomb,
[EnumMember(Value = "Locked Power Bombs")]
LockedPBomb,
[EnumMember(Value = "Missile Launcher")]
MissileLauncher,
[EnumMember(Value = "Super Missile Launcher")]
SuperMissileLauncher,
[EnumMember(Value = "Power Bomb Launcher")]
PBombLauncher,
[EnumMember(Value = "Bombs")]
Bombs,
[EnumMember(Value = "Power Grip")]
Powergrip,
[EnumMember(Value = "Spider Ball")]
Spiderball,
[EnumMember(Value = "Spring Ball")]
Springball,
[EnumMember(Value = "Hi-Jump Boots")]
Hijump,
[EnumMember(Value = "Varia Suit")]
Varia,
[EnumMember(Value = "Space Jump")]
Spacejump,
[EnumMember(Value = "Progressive Jump")]
ProgressiveJump,
[EnumMember(Value = "Speed Booster")]
Speedbooster,
[EnumMember(Value = "Screw Attack")]
Screwattack,
[EnumMember(Value = "Gravity Suit")]
Gravity,
[EnumMember(Value = "Progressive Suit")]
ProgressiveSuit,
[EnumMember(Value = "Power Beam")]
Power,
[EnumMember(Value = "Charge Beam")]
Charge,
[EnumMember(Value = "Ice Beam")]
Ice,
[EnumMember(Value = "Wave Beam")]
Wave,
[EnumMember(Value = "Spazer Beam")]
Spazer,
[EnumMember(Value = "Plasma Beam")]
Plasma,
[EnumMember(Value = "Morph Ball")]
Morphball,
[EnumMember(Value = "Nothing")]
Nothing,
[EnumMember(Value = "Small Health Drop")]
SmallHealthDrop,
[EnumMember(Value = "Big Health Drop")]
BigHealthDrop,
[EnumMember(Value = "Missile Drop")]
MissileDrop,
[EnumMember(Value = "Super Missile Drop")]
SuperMissileDrop,
[EnumMember(Value = "Power Bomb Drop")]
PBombDrop,
[EnumMember(Value = "Flashlight")]
Flashlight,
[EnumMember(Value = "Blindfold")]
Blindfold,
[EnumMember(Value = "Speed Booster Upgrade")]
SpeedBoosterUpgrade,
[EnumMember(Value = "Walljump Boots")]
WalljumpBoots,
[EnumMember(Value = "Infinite Bomb Propulsion")]
InfiniteBombPropulsion,
[EnumMember(Value = "Long Beam")]
LongBeam,
}
public class PickupObject
{
[JsonInclude]
[JsonPropertyName("item_id")]
public string ItemID;
[JsonInclude]
[JsonPropertyName("sprite_details")]
public SpriteDetails SpriteDetails;
[JsonInclude]
[JsonPropertyName("item_effect")]
public ItemEnum ItemEffect;
[JsonInclude]
[JsonPropertyName("quantity")]
public int Quantity;
[JsonInclude]
[JsonPropertyName("text")]
public TextDetails Text;
}
public class SpriteDetails
{
[JsonInclude]
[JsonPropertyName("name")]
public string Name = "sItemUnknown";
[JsonInclude]
[JsonPropertyName("speed")]
public decimal Speed;
}
public class TextDetails
{
[JsonInclude]
[JsonPropertyName("header")]
public string Header = "INVALID TEXT";
[JsonInclude]
[JsonPropertyName("description")]
public string Description = "INVALID DESCRIPTION";
}
public class RoomObject
{
[JsonInclude]
[JsonPropertyName("display_name")]
public string DisplayName = "";
[JsonInclude]
[JsonPropertyName("region_name")]
public string RegionName = "";
[JsonInclude]
[JsonPropertyName("minimap_data")]
public List<Coordinate> MinimapData = new List<Coordinate>();
[JsonInclude]
[JsonPropertyName("light_level")]
public string? LightLevel;
[JsonInclude]
[JsonPropertyName("liquid_info")]
public LiquidInfo? LiquidInfo = new LiquidInfo();
}
public class LiquidInfo
{
public enum LiquidTypeEnum
{
Water = 0,
Laval = 1,
}
[JsonInclude]
[JsonPropertyName("liquid_type")]
public LiquidTypeEnum LiquidType;
[JsonInclude]
[JsonPropertyName("liquid_level")]
public int LiquidLevel;
[JsonInclude]
[JsonPropertyName("should_move_horizontally")]
public bool ShouldMoveHorizontally;
[JsonInclude]
[JsonPropertyName("should_wave")]
public bool ShouldWave;
[JsonInclude]
[JsonPropertyName("wave_speed")]
public double WaveSpeed;
[JsonInclude]
[JsonPropertyName("wave_height")]
public double WaveHeight;
[JsonInclude]
[JsonPropertyName("should_be_at_very_front")]
public bool PutAtVeryFront;
internal string FormatForDSMap()
{
return $"{(int)LiquidType}|{LiquidLevel}|{Convert.ToInt32(ShouldMoveHorizontally)}|{Convert.ToInt32(ShouldWave)}|{WaveSpeed}|{WaveHeight}|{Convert.ToInt32(PutAtVeryFront)}";
}
}
public class PipeObject
{
[JsonInclude]
[JsonPropertyName("dest_x")]
public int XPosition;
[JsonInclude]
[JsonPropertyName("dest_y")]
public int YPosition;
[JsonInclude]
[JsonPropertyName("dest_room")]
public string Room = "";
}
public class EntranceObject
{
[JsonInclude]
[JsonPropertyName("dest_id")]
public uint DestEntranceID;
[JsonInclude]
[JsonPropertyName("force_idle_after_transition")]
public bool ForceIdleAfterTransition;
[JsonInclude]
[JsonPropertyName("dest_direction")]
public DoorFacingDirection Direction;
[JsonInclude]
[JsonPropertyName("dest_room")]
public string Room = "";
}
public struct Coordinate
{
[JsonInclude]
[JsonPropertyName("x")]
public int X;
[JsonInclude]
[JsonPropertyName("y")]
public int Y;
}