Commit 92ccb1d8 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:moecube/windbot

parents 94d3c132 66d208f0
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
"消失吧,杂鱼" "消失吧,杂鱼"
], ],
"ondirectattack": [ "ondirectattack": [
"爸爸,饶命" "爸爸,饶命",
"恐怖如斯"
], ],
"facedownmonstername": "怪兽", "facedownmonstername": "怪兽",
"activate": [ "activate": [
......
...@@ -49,7 +49,7 @@ namespace WindBot.Game.AI.Decks ...@@ -49,7 +49,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.DupeFrog, DupeFrog); AddExecutor(ExecutorType.Activate, CardId.DupeFrog, DupeFrog);
AddExecutor(ExecutorType.Activate, CardId.FlipFlopFrog, FlipFlopFrog); AddExecutor(ExecutorType.Activate, CardId.FlipFlopFrog, FlipFlopFrog);
AddExecutor(ExecutorType.Activate, CardId.Ronintoadin, Ronintoadin); AddExecutor(ExecutorType.Activate, CardId.Ronintoadin, Ronintoadin);
AddExecutor(ExecutorType.Activate, CardId.TreebornFrog); AddExecutor(ExecutorType.Activate, CardId.TreebornFrog, TreebornFrog);
AddExecutor(ExecutorType.Activate, CardId.Unifrog); AddExecutor(ExecutorType.Activate, CardId.Unifrog);
AddExecutor(ExecutorType.Summon, CardId.CryomancerOfTheIceBarrier, SummonFrog); AddExecutor(ExecutorType.Summon, CardId.CryomancerOfTheIceBarrier, SummonFrog);
...@@ -83,6 +83,19 @@ namespace WindBot.Game.AI.Decks ...@@ -83,6 +83,19 @@ namespace WindBot.Game.AI.Decks
private int m_swapFrogSummoned; private int m_swapFrogSummoned;
private int m_flipFlopFrogSummoned; private int m_flipFlopFrogSummoned;
private int m_treebornFrogCount = 0;
public override void OnNewTurn()
{
m_treebornFrogCount = 0;
base.OnNewTurn();
}
private bool TreebornFrog()
{
m_treebornFrogCount++;
return m_treebornFrogCount <= 5;
}
private bool SwapFrogSummon() private bool SwapFrogSummon()
{ {
......
...@@ -215,6 +215,7 @@ namespace WindBot.Game.AI.Decks ...@@ -215,6 +215,7 @@ namespace WindBot.Game.AI.Decks
private bool Summon_used; private bool Summon_used;
private bool Pilica_eff; private bool Pilica_eff;
private bool plan_A; private bool plan_A;
private int SnowBell_count = 0;
//TODO: reset the flags when they should reset ( public override void OnNewTurn() ) //TODO: reset the flags when they should reset ( public override void OnNewTurn() )
public PureWindsExecutor(GameAI ai, Duel duel) public PureWindsExecutor(GameAI ai, Duel duel)
: base(ai, duel) : base(ai, duel)
...@@ -294,6 +295,16 @@ namespace WindBot.Game.AI.Decks ...@@ -294,6 +295,16 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Repos, MonsterRepos); AddExecutor(ExecutorType.Repos, MonsterRepos);
} }
public override void OnNewTurn()
{
WindwitchGlassBelleff_used = false;
Summon_used = false;
Pilica_eff = false;
plan_A = false;
SnowBell_count = 0;
base.OnNewTurn();
}
private bool windaset() private bool windaset()
{ {
if (Enemy.HasInMonstersZoneOrInGraveyard(CardId.ChaosMax)) if (Enemy.HasInMonstersZoneOrInGraveyard(CardId.ChaosMax))
...@@ -759,6 +770,7 @@ namespace WindBot.Game.AI.Decks ...@@ -759,6 +770,7 @@ namespace WindBot.Game.AI.Decks
private bool WindwitchSnowBellsp() private bool WindwitchSnowBellsp()
{ {
if (SnowBell_count >= 5) return false;
if ((Bot.HasInMonstersZone(CardId.CrystalWingSynchroDragon) || if ((Bot.HasInMonstersZone(CardId.CrystalWingSynchroDragon) ||
Bot.HasInMonstersZone(CardId.DaigustoSphreez) || Bot.HasInMonstersZone(CardId.DaigustoSphreez) ||
Bot.HasInMonstersZone(CardId.MistWurm)) && Bot.HasInMonstersZone(CardId.MistWurm)) &&
...@@ -773,7 +785,8 @@ namespace WindBot.Game.AI.Decks ...@@ -773,7 +785,8 @@ namespace WindBot.Game.AI.Decks
Bot.HasInMonstersZone(CardId.WindwitchSnowBell) && Bot.HasInMonstersZone(CardId.WindwitchSnowBell) &&
(Util.GetBotAvailZonesFromExtraDeck() == 0)) (Util.GetBotAvailZonesFromExtraDeck() == 0))
return false; return false;
AI.SelectPosition(CardPosition.FaceUpDefence); AI.SelectPosition(CardPosition.FaceUpDefence);
SnowBell_count++;
return true; return true;
} }
private bool DaigustoSphreezsp() private bool DaigustoSphreezsp()
......
...@@ -1272,6 +1272,8 @@ namespace WindBot.Game.AI.Decks ...@@ -1272,6 +1272,8 @@ namespace WindBot.Game.AI.Decks
bool lesssummon = false; bool lesssummon = false;
int extra_attack = CheckPlusAttackforMadameVerre(true, false, true); int extra_attack = CheckPlusAttackforMadameVerre(true, false, true);
int best_power = Util.GetBestAttack(Bot); int best_power = Util.GetBestAttack(Bot);
if (CheckRemainInDeck(CardId.Haine) > 0 && best_power < 2400) best_power = 2400;
Logger.DebugWriteLine("less summon check: " + (best_power + extra_attack - 1000).ToString() + " to " + (best_power + extra_attack).ToString());
if (Util.GetOneEnemyBetterThanValue(best_power) != null if (Util.GetOneEnemyBetterThanValue(best_power) != null
&& Util.GetOneEnemyBetterThanValue(best_power + extra_attack) == null && Util.GetOneEnemyBetterThanValue(best_power + extra_attack) == null
&& Util.GetOneEnemyBetterThanValue(best_power + extra_attack - 1000) != null) && Util.GetOneEnemyBetterThanValue(best_power + extra_attack - 1000) != null)
...@@ -1295,6 +1297,11 @@ namespace WindBot.Game.AI.Decks ...@@ -1295,6 +1297,11 @@ namespace WindBot.Game.AI.Decks
} }
} }
// check whether continue to ss
bool should_attack = Util.GetOneEnemyBetterThanValue(Card.Attack) == null;
if ((should_attack ^ Card.IsDefense()) && Duel.Player == 1) return false;
if (CheckRemainInDeck(CardId.Haine, CardId.MadameVerre, CardId.GolemAruru) == 0) return false;
// SS higer level // SS higer level
if (Bot.HasInMonstersZone(CardId.Haine) || (lesssummon && !Bot.HasInMonstersZone(CardId.MadameVerre, true))) if (Bot.HasInMonstersZone(CardId.Haine) || (lesssummon && !Bot.HasInMonstersZone(CardId.MadameVerre, true)))
{ {
...@@ -1759,22 +1766,27 @@ namespace WindBot.Game.AI.Decks ...@@ -1759,22 +1766,27 @@ namespace WindBot.Game.AI.Decks
{ {
if (hand.IsMonster() && hand.Level <= 4 && hand.Attack > bestPower) bestPower = hand.Attack; if (hand.IsMonster() && hand.Level <= 4 && hand.Attack > bestPower) bestPower = hand.Attack;
} }
int opt = -1;
// destroy monster // destroy monster
if (Enemy.MonsterZone.GetFirstMatchingCard(card => card.IsFloodgate() && card.IsAttack()) != null if (Enemy.MonsterZone.GetFirstMatchingCard(card => card.IsFloodgate() && card.IsAttack()) != null
|| Enemy.MonsterZone.GetMatchingCardsCount(card => card.IsAttack() && card.Attack >= bestPower) >= 2) || Enemy.MonsterZone.GetMatchingCardsCount(card => card.IsAttack() && card.Attack >= bestPower) >= 2) opt = 0;
{
AI.SelectOption(Util.GetStringId(CardId.LightningStorm, 0));
SelectSTPlace(null, true);
return true;
}
// destroy spell/trap // destroy spell/trap
if (Enemy.GetSpellCount() >= 2 || Util.GetProblematicEnemySpell() != null) else if (Enemy.GetSpellCount() >= 2 || Util.GetProblematicEnemySpell() != null) opt = 1;
if (opt == -1) return false;
// only one selection
if (Enemy.MonsterZone.GetFirstMatchingCard(card => card.IsAttack()) == null
|| Enemy.GetSpellCount() == 0)
{ {
AI.SelectOption(Util.GetStringId(CardId.LightningStorm, 1)); AI.SelectOption(0);
SelectSTPlace(null, true); SelectSTPlace(null, true);
return true; return true;
} }
return false; AI.SelectOption(opt);
SelectSTPlace(null, true);
return true;
} }
// activate of PotofExtravagance // activate of PotofExtravagance
...@@ -2341,8 +2353,12 @@ namespace WindBot.Game.AI.Decks ...@@ -2341,8 +2353,12 @@ namespace WindBot.Game.AI.Decks
// activate of Patronus // activate of Patronus
public bool PatronusActivate() public bool PatronusActivate()
{ {
// activate immediately
if (ActivateDescription == 94)
{
return true;
}
// search // search
//if (ActivateDescription == Util.GetStringId(CardId.Patronus, 0))
if (Card.Location == CardLocation.SpellZone) if (Card.Location == CardLocation.SpellZone)
{ {
if (NegatedCheck(true) || Duel.LastChainPlayer == 0) return false; if (NegatedCheck(true) || Duel.LastChainPlayer == 0) return false;
......
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