Commit ec4143e5 authored by wind2009's avatar wind2009

Merge branch 'master' of https://github.com/IceYGO/windbot

parents 16f8a4e8 68276aa0
...@@ -1713,39 +1713,42 @@ namespace WindBot.Game.AI.Decks ...@@ -1713,39 +1713,42 @@ namespace WindBot.Game.AI.Decks
enemySetThisTurn.Add(card); enemySetThisTurn.Add(card);
} }
} }
if (previousControler == 0) if (card != null)
{
if (previousLocation == (int)CardLocation.MonsterZone && currentLocation != (int)CardLocation.MonsterZone)
{
if (summonThisTurn.Contains(card)) summonThisTurn.Remove(card);
if (summonInChainList.Contains(card)) summonInChainList.Remove(card);
}
if (previousLocation == (int)CardLocation.SpellZone && currentLocation != (int)CardLocation.SpellZone)
{
if (setTrapThisTurn.Contains(card)) setTrapThisTurn.Remove(card);
}
}
if (currentControler == 0)
{ {
ClientCard currentSolvingChain = Duel.GetCurrentSolvingChainCard(); if (previousControler == 0)
if (currentLocation == (int)CardLocation.SpellZone && (currentSolvingChain == null || !currentSolvingChain.IsCode(CardId.AriasTheLabrynthButler))
&& card != null && (card.HasType(CardType.Trap) || card.IsCode(CardId.WelcomeLabrynth, CardId.BigWelcomeLabrynth))
)
{
Logger.DebugWriteLine("[setTrapThisTurn]set " + card.Name ?? "UnknowCard");
setTrapThisTurn.Add(card);
}
if (currentLocation == (int)CardLocation.MonsterZone)
{ {
summonThisTurn.Add(card); if (previousLocation == (int)CardLocation.MonsterZone && currentLocation != (int)CardLocation.MonsterZone)
if (currentSolvingChain != null) summonInChainList.Add(card); {
if (summonThisTurn.Contains(card)) summonThisTurn.Remove(card);
if (summonInChainList.Contains(card)) summonInChainList.Remove(card);
}
if (previousLocation == (int)CardLocation.SpellZone && currentLocation != (int)CardLocation.SpellZone)
{
if (setTrapThisTurn.Contains(card)) setTrapThisTurn.Remove(card);
}
} }
if (previousLocation == (int)CardLocation.Grave && currentLocation == (int)CardLocation.Removed) if (currentControler == 0)
{ {
if (currentSolvingChain != null && currentSolvingChain.Controller == 1 && currentSolvingChain.IsCode(_CardId.CalledByTheGrave)) ClientCard currentSolvingChain = Duel.GetCurrentSolvingChainCard();
if (currentLocation == (int)CardLocation.SpellZone && (currentSolvingChain == null || !currentSolvingChain.IsCode(CardId.AriasTheLabrynthButler))
&& (card.HasType(CardType.Trap) || card.IsCode(CardId.WelcomeLabrynth, CardId.BigWelcomeLabrynth))
)
{
Logger.DebugWriteLine("[setTrapThisTurn]set " + card.Name ?? "UnknowCard");
setTrapThisTurn.Add(card);
}
if (currentLocation == (int)CardLocation.MonsterZone)
{ {
Logger.DebugWriteLine("*** " + (card.Name ?? "UnknowCard") + " is banished by CallByTheGrave"); summonThisTurn.Add(card);
calledbytheGraveCount[card.Id] = 2; if (currentSolvingChain != null) summonInChainList.Add(card);
}
if (previousLocation == (int)CardLocation.Grave && currentLocation == (int)CardLocation.Removed)
{
if (currentSolvingChain != null && currentSolvingChain.Controller == 1 && currentSolvingChain.IsCode(_CardId.CalledByTheGrave))
{
Logger.DebugWriteLine("*** " + (card.Name ?? "UnknowCard") + " is banished by CallByTheGrave");
calledbytheGraveCount[card.Id] = 2;
}
} }
} }
} }
...@@ -3444,10 +3447,11 @@ namespace WindBot.Game.AI.Decks ...@@ -3444,10 +3447,11 @@ namespace WindBot.Game.AI.Decks
level2MonsterList.Sort(CompareUsableAttack); level2MonsterList.Sort(CompareUsableAttack);
level4MonsterList.Sort(CompareUsableAttack); level4MonsterList.Sort(CompareUsableAttack);
bool checkFlag = GetProblematicEnemyCardList(true, selfType: CardType.Monster).Count() > 0 && !CheckWhetherNegated(true, true, CardType.Monster); bool checkFlag = GetProblematicEnemyCardList(true, selfType: CardType.Monster).Count() > 0 && !CheckWhetherNegated(true, true, CardType.Monster);
if (Util.GetBestPower(Bot, true) <= Util.GetBestPower(Enemy)) ClientCard BestEnemyMonster = Util.GetBestEnemyMonster();
if (BestEnemyMonster != null && Util.GetBestPower(Bot, true) <= Util.GetBestPower(Enemy))
{ {
checkFlag |= Util.GetBestPower(Enemy) <= 3500; checkFlag |= Util.GetBestPower(Enemy) <= 3500;
checkFlag |= !Util.GetBestEnemyMonster().IsShouldNotBeTarget() && !Util.GetBestEnemyMonster().IsShouldNotBeMonsterTarget(); checkFlag |= !BestEnemyMonster.IsShouldNotBeTarget() && !BestEnemyMonster.IsShouldNotBeMonsterTarget();
} }
// 2+4+4 // 2+4+4
if (level2MonsterList.Count() >= 1 && level4MonsterList.Count() >= 2) if (level2MonsterList.Count() >= 1 && level4MonsterList.Count() >= 2)
......
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