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

Added Exosister Executor #41

Open
wants to merge 7 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
7 changes: 6 additions & 1 deletion BotWrapper/bot.conf
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,16 @@ Name=我太帅了 Deck=Brave Dialog=smart.zh-CN
水机百头龙凤凰人勇者卡组。
AI_LV3 SUPPORT_MASTER_RULE_2020

!玻璃女巫
!玻璃女巫-魔女术
Name=玻璃女巫 Deck=Witchcraft Dialog=verre.zh-CN
魔女术卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020

!玻璃女巫-救祓少女
Name=玻璃女巫 Deck=Exosister Dialog=verre.zh-CN
救祓少女卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020

!神数不神-刹帝利
Name=神数不神 Deck=Kashtira Dialog=Zefra.zh-CN
俱舍怒威族卡组。
Expand Down
60 changes: 60 additions & 0 deletions Decks/AI_Exosister.ydk
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#created by ...
#main
37343995
37343995
37343995
16889337
16889337
16889337
16474916
16474916
16474916
67972302
67972302
67972302
79858629
79858629
43863925
43863925
43863925
5352328
5352328
14558127
14558127
14558127
23434538
23434538
23434538
84211599
84211599
4408198
24224830
24224830
77913594
77913594
77913594
197042
197042
10045474
10045474
77891946
77891946
77891946
#extra
90448279
59242457
59242457
9272381
42741437
42741437
42741437
78135071
78135071
41524885
41524885
46772449
5530780
58858807
8728498
!side
74689476
277 changes: 267 additions & 10 deletions ExecutorBase/Game/AI/DefaultExecutor.cs

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions ExecutorBase/Game/AI/Enums/FusionSpell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,36 @@ public enum FusionSpell
FragmentFusion = 72029628,
NecroFusion = 81223446,
PredaplantVerteAnaconda = 70369116,

DreamMirrorofChaos = 98570539,
PlunderPatrollShipshapeShipsShipping = 44227727,
FireFormationIngen = 29143457,
ParametalfoesFusion = 58549532,
ReadyFusion = 63854005,
BrandedinWhite = 34995106,
BrandedinRed = 82738008,
FaceCardFusion = 29062925,
MyutantFusion = 42577802,
MyutantCry = 31855260,
FallenOfAlbaz = 68468459,
GreaterPolymerization = 7614732,
UltimateFusion = 71143015,
BrandedFusion = 44362883,
GhostFusion = 35705817,
WitchcrafterConfusionConfession = 35098357,
BrandedBanishment = 6763530,
DinomorphiaDomain = 26631975,
DinomorphiaFrenzy = 78420796,
SouloftheSupremeKing = 92428405,
InstantContact = 16169772,
ScatterFusion = 40597694,
FavoriteContact = 75047173,
AmazonessSecretArts = 86758746,
DarkWorldAccession = 65956182,
BeetrooperLanding = 13234975,
FusionReproduction = 43331750,
ChimeraFusion = 63136489,
HarmonicSynchroFusion = 7473735,
SouloftheSupremeCelestialKing = 76840111
}
}
37 changes: 36 additions & 1 deletion ExecutorBase/Game/AI/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public abstract class Executor
protected ExecutorType Type { get; private set; }
protected ClientCard Card { get; private set; }
protected long ActivateDescription { get; private set; }
protected int CurrentTiming { get; private set; }

protected ClientField Bot { get; private set; }
protected ClientField Enemy { get; private set; }
Expand Down Expand Up @@ -97,10 +98,21 @@ public virtual void OnChaining(int player, ClientCard card)
// For overriding
}

public virtual void OnChainSolved(int chainIndex)
{
// For overriding
}

public virtual void OnChainEnd()
{
// For overriding
}

public virtual void OnReceivingAnnouce(int player, long data)
{
// For overriding
}

public virtual void OnNewPhase()
{
// Some AI need do something on new phase
Expand All @@ -115,6 +127,11 @@ public virtual void OnDraw(int player)
// Some AI need do something on draw
}

public virtual void OnMove(ClientCard card, int previousControler, int previousLocation, int currentControler, int currentLocation)
{
// Some AI need do something on card's moving
}

public virtual IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, long hint, bool cancelable)
{
// For overriding
Expand Down Expand Up @@ -174,6 +191,23 @@ public virtual void OnSelectChain(IList<ClientCard> cards)
return;
}

public virtual bool OnSelectYesNo(int desc)
{
return true;
}

public virtual int OnSelectOption(IList<int> options)
{
return -1;
}

public virtual int OnSelectPlace(int cardId, int player, CardLocation location, int available)
{
// For overriding
return 0;
}


public virtual bool OnSelectYesNo(long desc)
{
return true;
Expand Down Expand Up @@ -236,11 +270,12 @@ public void SetBattle(BattlePhase battle)
/// <summary>
/// Set global variables Type, Card, ActivateDescription for Executor
/// </summary>
public void SetCard(ExecutorType type, ClientCard card, long description)
public void SetCard(ExecutorType type, ClientCard card, long description, int timing = -1)
{
Type = type;
Card = card;
ActivateDescription = description;
CurrentTiming = timing;
}

/// <summary>
Expand Down
9 changes: 8 additions & 1 deletion ExecutorBase/Game/AI/HintMsg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ public static class HintMsg
DisableZone = 570,
ToZone = 571,
Counter = 572,
Negate = 575;
Disable = 573,
OperateCard = 574,
Negate = 575,
RITUAL = 1057,
FUSION = 1056,
SYNCHRO = 1063,
XYZ = 1073,
PENDULUM = 1074;
}
}
17 changes: 17 additions & 0 deletions ExecutorBase/Game/Duel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,29 @@ public class Duel
public BattlePhase BattlePhase { get; set; }

public int LastChainPlayer { get; set; }
public CardLocation LastChainLocation { get; set; }
public IList<ClientCard> CurrentChain { get; set; }
public IList<ClientCard> ChainTargets { get; set; }
public IList<ClientCard> LastChainTargets { get; set; }
public IList<ClientCard> ChainTargetOnly { get; set; }
public int LastSummonPlayer { get; set; }
public IList<ClientCard> SummoningCards { get; set; }
public IList<ClientCard> LastSummonedCards { get; set; }
public bool MainPhaseEnd { get; set; }
public int SolvingChainIndex { get; set; }
public IList<int> NegatedChainIndexList { get; set; }

public Duel()
{
Fields = new ClientField[2];
Fields[0] = new ClientField();
Fields[1] = new ClientField();
LastChainPlayer = -1;
LastChainLocation = 0;
MainPhaseEnd = false;
CurrentChain = new List<ClientCard>();
ChainTargets = new List<ClientCard>();
LastChainTargets = new List<ClientCard>();
ChainTargetOnly = new List<ClientCard>();
LastSummonPlayer = -1;
SummoningCards = new List<ClientCard>();
Expand Down Expand Up @@ -203,5 +209,16 @@ public int GetLocalPlayer(int player)
{
return IsFirst ? player : 1 - player;
}

public ClientCard GetCurrentSolvingChainCard()
{
if (SolvingChainIndex == 0 || SolvingChainIndex > CurrentChain.Count) return null;
return CurrentChain[SolvingChainIndex - 1];
}

public bool IsCurrentSolvingChainNegated()
{
return SolvingChainIndex > 0 && NegatedChainIndexList.Contains(SolvingChainIndex);
}
}
}
15 changes: 15 additions & 0 deletions ExecutorBase/Game/GameAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ public void OnNewPhase()
Executor.OnNewPhase();
}

public void OnMove(ClientCard card, int previousControler, int previousLocation, int currentControler, int currentLocation)
{
Executor.OnMove(card, previousControler, previousLocation, currentControler, currentLocation);
}

/// <summary>
/// Called when the AI got attack directly.
/// </summary>
Expand Down Expand Up @@ -148,6 +153,16 @@ public void OnChainEnd()
Executor.OnChainEnd();
}

/// <summary>
/// Called when receiving annouce
/// </summary>
/// <param name="player">Player who announce.</param>
/// <param name="data">Annouced info.</param>
public void OnReceivingAnnouce(int player, long data)
{
Executor.OnReceivingAnnouce(player, data);
}

/// <summary>
/// Called when the AI has to do something during the battle phase.
/// </summary>
Expand Down
Loading
Loading