Commit 7a48d60f authored by xiaoye's avatar xiaoye

Update DefaultExecutor.cs

parent 8054f07a
Pipeline #39545 failed with stage
in 46 seconds
......@@ -597,25 +597,6 @@ namespace WindBot.Game.AI
base.OnChainEnd();
}
/// <summary>
/// Reset variables for new turn.
/// </summary>
public override void OnNewTurn()
{
if (Duel.Turn <= 1) calledbytheGraveIdCountMap.Clear();
List<int> keyList = calledbytheGraveIdCountMap.Keys.ToList();
foreach (int dic in keyList)
{
if (calledbytheGraveIdCountMap[dic] > 0)
{
calledbytheGraveIdCountMap[dic] -= 1;
}
}
crossoutDesignatorIdList.Clear();
base.OnNewTurn();
}
public override void OnMove(ClientCard card, int previousControler, int previousLocation, int currentControler, int currentLocation)
{
if (card != null)
......@@ -1291,9 +1272,9 @@ namespace WindBot.Game.AI
AI.SelectOption(SYNCHRO);
return true;
}
for (int i=1; i<=12; i++)
for (int i = 1; i <= 12; i++)
{
if (levels[i]>1)
if (levels[i] > 1)
{
AI.SelectOption(XYZ);
return true;
......@@ -1564,7 +1545,8 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultVaylantzWorld_ShinraBansho()
{
if (DefaultSpellWillBeNegated()) {
if (DefaultSpellWillBeNegated())
{
return false;
}
......@@ -1576,12 +1558,14 @@ namespace WindBot.Game.AI
/// </summary>
protected bool DefaultVaylantzWorld_KonigWissen()
{
if (DefaultSpellWillBeNegated()) {
if (DefaultSpellWillBeNegated())
{
return false;
}
List<ClientCard> monsters = Enemy.GetMonsters();
if (monsters.Count == 0) {
if (monsters.Count == 0)
{
return false;
}
......@@ -1619,7 +1603,7 @@ namespace WindBot.Game.AI
|| (calledbytheGraveIdCountMap.ContainsKey(originId) && calledbytheGraveIdCountMap[originId] > 0)
|| (card.IsDisabled() && ((int)card.Location & (int)CardLocation.Onfield) > 0);
}
protected bool DefaultCheckWhetherCardIdIsNegated(int cardId)
{
return crossoutDesignatorIdList.Contains(cardId)
......@@ -1649,13 +1633,6 @@ namespace WindBot.Game.AI
base.OnNewTurn();
}
public override void OnChainEnd()
{
if (!calledbytheGraveIdCountMap.ContainsKey(cardId)) return 0;
return calledbytheGraveIdCountMap[cardId];
}
protected virtual bool DefaultSetForDiabellze()
{
if (Card == null) return false;
......@@ -1679,28 +1656,10 @@ namespace WindBot.Game.AI
}
return false;
}
public override void OnMove(ClientCard card, int previousControler, int previousLocation, int currentControler, int currentLocation)
protected int GetCalledbytheGraveIdCount(int cardId)
{
if (card != null) {
int cardId = card.Id;
if (previousLocation == 0 && currentLocation == (int)CardLocation.MonsterZone)
{
if (!sendEventMsg2 && event2TriggerIdList.Contains(cardId) && currentControler == 1)
{
AI.SendCustomChat((int)CustomMessage.MSG_FOR_EVENT_2);
sendEventMsg2 = true;
}
if (!sendEventMsg5 && event5TriggerIdList.Contains(cardId) && currentControler == 0 && Duel.Phase == DuelPhase.Standby)
{
AI.SendCustomChat((int)CustomMessage.MSG_FOR_EVENT_5);
sendEventMsg5 = true;
}
}
}
base.OnMove(card, previousControler, previousLocation, currentControler, currentLocation);
if (!calledbytheGraveIdCountMap.ContainsKey(cardId)) return 0;
return calledbytheGraveIdCountMap[cardId];
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment