Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DotNet 8 Port #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions Lotd.Core/AnimationNames.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
[actions]
0 DuelStart
1 "Duel!"
2 TurnChange
8 ShowDialog
10 TurnBegin
12 MainPhase
15 EndPhase
36 Attack
81 PlaceMonster
82 PlaceSpellTrap
87 DrawCard
[animations]
0 Null
1 DuelStart
2 DuelEnd
3 WaitFrame
4 WaitInput
5 PhaseChange
6 TurnChange
7 FieldChange
8 CursorSet
9 BgmUpdate
10 BattleInit
11 BattleSelect
12 BattleAttack
13 BattleRun
14 BattleEnd
15 LifeSet
16 LifeDamage
17 LifeReset
18 HandShuffle
19 HandShow
20 HandOpen
21 DeckShuffle
22 DeckReset
23 DeckFlipTop
24 GraveTop
25 CardLockon
26 CardMove
27 CardSwap
28 CardFlipTurn
29 CardCheat
30 CardSet
31 CardVanish
32 CardBreak
33 CardExplosion
34 CardExclude
35 CardHappen
36 CardDisable
37 CardEquip
38 CardIncTurn
39 CardUpdate
40 ManaSet
41 MonstDeathTurn
42 MonstShuffle
43 TributeSet
44 TributeReset
45 TributeRun
46 MaterialSet
47 MaterialReset
48 MaterialRun
49 TuningSet
50 TuningReset
51 TuningRun
52 ChainSet
53 ChainRun
54 RunSurrender
55 RunDialog
56 RunList
57 RunSummon
58 RunSpSummon
59 RunFusion
60 RunDetail
61 RunCoin
62 RunDice
63 RunYujyo
64 RunSpecialWin
65 RunVija
66 RunExtra
67 RunCommand
68 CutinDraw
69 CutinSummon
70 CutinFusion
71 CutinChain
72 CutinActivate
73 CutinSet
74 CutinReverse
75 CutinTurn
76 CutinFlip
77 CutinTurnEnd
78 CutinDamage
79 CutinBreak
80 CpuThinking
81 HandRundom
82 OverlaySet
83 OverlayReset
84 OverlayRun
85 CutinSuccess
86 ChainEnd
87 LinkSet
88 LinkReset
89 LinkRun
90 RunJanken
91 CutinCoinDice
2 changes: 2 additions & 0 deletions Lotd.Core/BlockedAnimations.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[actions]
[animations]
44 changes: 44 additions & 0 deletions Lotd.Core/CardCollection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lotd
{
public class CardCollection
{
public List<short> CardIds { get; set; }

public CardCollection()
{
CardIds = new List<short>();
}

public void Add(short cardId)
{
CardIds.Add(cardId);
}

public void Remove(short cardId)
{
CardIds.Remove(cardId);
}

public void RemoveAll(short cardId)
{
while (CardIds.Remove(cardId))
{
}
}

public void Clear()
{
CardIds.Clear();
}

public void Sort()
{
CardIds.Sort();
}
}
}
149 changes: 149 additions & 0 deletions Lotd.Core/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lotd
{
public static class Constants
{
public const GameVersion LatestVersion = GameVersion.LinkEvolution2;
public const int AbsoluteMaxNumCards = 20000;// Keep this as a constant

public static int GetNumCards(GameVersion version)
{
switch (version)
{
default:
case GameVersion.Lotd:
return 7581;
case GameVersion.LinkEvolution1:
case GameVersion.LinkEvolution2:
return 10166;
}
}

public static int GetNumCards2(GameVersion version)
{
switch (version)
{
default:
case GameVersion.Lotd:
return GetNumCards(version);
case GameVersion.LinkEvolution1:
case GameVersion.LinkEvolution2:
return 20000;
}
}
public static ushort GetMaxCardId(GameVersion version)
{
switch (version)
{
default:
case GameVersion.Lotd:
return 12432;
case GameVersion.LinkEvolution1:
case GameVersion.LinkEvolution2:
return 14969;
}
}

/// <summary>
/// Number of duel series (YuGiOh, GX, 5D, ZEXAL, ARCV)
/// </summary>
public static int GetNumDuelSeries(GameVersion version)
{
switch (version)
{
default:
case GameVersion.Lotd:
return 5;
case GameVersion.LinkEvolution1:
case GameVersion.LinkEvolution2:
return 6;
}
}

/// <summary>
/// Number of available user deck slots which can be created in in the deck editor
/// </summary>
public const int NumUserDecks = 32;

/// <summary>
/// Number of available battle packs (all sealed packs + all draft packs)
/// </summary>
public const int NumBattlePacks = 5;

/// <summary>
/// Number of deck slots available which map into deckdata_X.bin
/// </summary>
public static int GetNumDeckDataSlots(GameVersion version)
{
switch (version)
{
default:
case GameVersion.Lotd:
return 477;
case GameVersion.LinkEvolution1:
case GameVersion.LinkEvolution2:
return 700;
}
}

/// <summary>
/// The length of a deck name (this is technically 32 with a null terminator)
/// </summary>
public const int DeckNameLen = 33;

/// <summary>
/// Number of usable characters in a deck name (1 less than DeckNameLen as 1 is reversed for null terminator)
/// </summary>
public const int DeckNameUsableLen = 32;

/// <summary>
/// The length of a deck name in bytes
/// </summary>
public const int DeckNameByteLen = DeckNameLen * 2;

/// <summary>
/// Number of slots available in data for main deck cards
/// </summary>
public const int NumMainDeckCards = 60;

/// <summary>
/// Number of slots available in data for side deck cards
/// </summary>
public const int NumSideDeckCards = 15;

/// <summary>
/// Number of slots available in data for extra deck cards
/// </summary>
public const int NumExtraDeckCards = 15;

public const int NumMinMainDeckCards = 40;

public const int NumMinMainDeckCardsSpeedDuel = 20;
public const int NumMainDeckCardsSpeedDuel = 30;
public const int NumExtraDeckCardsSpeedDuel = 5;
public const int NumSideDeckCardsSpeedDuel = 5;

/// <summary>
/// The starting deck index for user deck indexes in memory (32 user decks)
/// </summary>
public const int DeckIndexUserStart = 0;
/// <summary>
/// The starting deck index for data/ydc deck indexes in memory (477 ydc decks) (note that index 0 is an empty entry)
/// </summary>
public const int DeckIndexYdcStart = 32;

/// <summary>
/// Max number of players there can be (4 defined by tag duel)
/// </summary>
public const int MaxNumPlayers = 4;

/// <summary>
/// The default life points for each player (8000)
/// </summary>
public const int DefaultLifePoints = 8000;
}
}
18 changes: 18 additions & 0 deletions Lotd.Core/DuelSeries.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lotd
{
public enum DuelSeries
{
None = -1,
YuGiOh = 0,
YuGiOhGX = 1,
YuGiOh5D = 2,
YuGiOhZEXAL = 3,
YuGiOhARCV = 4,
YuGiOhVRAINS = 5
}
}
Loading