Skip to content

Commit

Permalink
update ChainBurn deck, fix DefaultBreakthroughSkill (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
handsomekiwi authored and mercury233 committed Apr 10, 2018
1 parent 5c58550 commit 4b2ffc2
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 37 deletions.
58 changes: 38 additions & 20 deletions Game/AI/Decks/ChainBurnExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,11 @@ public int[] now_List()

};
}
public int[] prevent_list()
public int[] pot_list()
{
return new[]
{
CardId.PotOfDesires,
CardId.SandaionTheTimloard,
CardId.BattleFader,

Expand All @@ -205,25 +206,30 @@ public int GetTotalATK(IList<ClientCard> list)
}
return atk;
}
public bool Has_prevent_list(int id)
public bool Has_prevent_list_0(int id)
{
return (id == CardId.SandaionTheTimloard ||
id == CardId.BattleFader ||
return (
id == CardId.Waboku ||
id == CardId.ThreateningRoar||
id == CardId.MagicCylinder||
id == CardId.BlazingMirrorForce||
id == CardId.RingOfDestruction
);
}
public bool Has_prevent_list_1(int id)
{
return (id == CardId.SandaionTheTimloard ||
id == CardId.BattleFader
);
}
bool no_sp = false;
bool one_turn_kill = false;
bool one_turn_kill_1 = false;
int expected_blood = 0;
bool prevent_used = false;
int preventcount = 0;
bool battleprevent = false;
bool OjamaTrioused = false;
bool OjamaTrioused = false;
bool OjamaTrioused_draw = false;
bool drawfirst = false;
int Waboku_count = 0;
Expand All @@ -243,10 +249,9 @@ public override bool OnSelectHand()
public override void OnNewTurn()
{


no_sp = false;
prevent_used = false;
battleprevent = false;
prevent_used = false;


}
Expand All @@ -260,7 +265,7 @@ public override void OnNewPhase()

foreach (ClientCard card in trap)
{
if (Has_prevent_list(card.Id))
if (Has_prevent_list_0(card.Id))
{
preventcount++;
battleprevent = true;
Expand All @@ -269,7 +274,7 @@ public override void OnNewPhase()
}
foreach (ClientCard card in monster)
{
if (Has_prevent_list(card.Id))
if (Has_prevent_list_1(card.Id))
{
preventcount++;
battleprevent = true;
Expand Down Expand Up @@ -380,8 +385,14 @@ private bool must_chain()
}
return false;
}
private bool OjamaTrioset()
{
if (Bot.HasInSpellZone(CardId.OjamaTrio)) return false;
return true;
}
private bool BrunSpellSet()
{
if (Card.Id == CardId.OjamaTrio && Bot.HasInSpellZone(CardId.OjamaTrio))return false;
return (Card.IsTrap() || Card.HasType(CardType.QuickPlay)) && Bot.GetSpellCountWithoutField() < 5;
}
private bool SandaionTheTimloard_summon()
Expand Down Expand Up @@ -409,7 +420,8 @@ private bool AbouluteKingBackJackeff()
private bool PotOfDualityeff()
{
no_sp = true;
AI.SelectCard(prevent_list());

AI.SelectCard(pot_list());
return true;
}
private bool BlazingMirrorForceeff()
Expand Down Expand Up @@ -479,9 +491,18 @@ public bool Ring_act()
}
private bool RecklessGreedeff()
{
int count=0;
foreach (ClientCard card in Bot.GetSpells())
{
if (card.Id == CardId.RecklessGreed)
count++;

}
bool Demiseused = AI.Utils.ChainContainsCard(CardId.CardOfDemise);
if (drawfirst) return DefaultUniqueTrap();
if (must_chain() && greed_count > 1) return true;
if (greed_count > 1) return true;
if (must_chain() && count > 1) return true;
if (Demiseused) return false;
if (count > 1) return true;
if (Bot.LifePoints <= 2000) return true;
if (Bot.GetHandCount() <1 && Duel.Player==0 && Duel.Phase!=DuelPhase.Standby) return true;
return false;
Expand Down Expand Up @@ -509,18 +530,14 @@ private bool SecretBlasteff()
return false;

}
private bool OjamaTrioset()
{

if (Bot.HasInSpellZone(CardId.OjamaTrio)) return false;
return true;
}

private bool OjamaTrioeff()
{
return OjamaTrioused||OjamaTrioused_draw;
}
private bool JustDessertseff()
{
if (Duel.Player == 0) return false;
if (drawfirst) return DefaultUniqueTrap();
if (one_turn_kill_1) return DefaultUniqueTrap();
if (one_turn_kill) return DefaultUniqueTrap();
Expand All @@ -537,6 +554,7 @@ private bool JustDessertseff()
}
private bool ChainStrikeeff()
{

if (drawfirst) return true;
if (must_chain()) return true;
int chain = Duel.CurrentChain.Count;
Expand Down Expand Up @@ -593,7 +611,7 @@ private bool Ceasefireeff()
}
private bool Linkuriboheff()
{
ClientCard lastchaincard = AI.Utils.GetLastChainCard();
ClientCard lastchaincard = AI.Utils.GetLastChainCard();
if (lastchaincard == null) return true;
if (lastchaincard.Id == CardId.Linkuriboh) return false;
return true;
Expand Down
62 changes: 47 additions & 15 deletions Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ public LightswornShaddoldinosour(GameAI ai, Duel duel)
AddExecutor(ExecutorType.SpellSet, CardId.MonsterReborn, spellset);
AddExecutor(ExecutorType.SpellSet, CardId.PotOfAvarice, spellset);
AddExecutor(ExecutorType.SpellSet, CardId.ThatGrassLooksgreener, spellset);
//trap
//trapset
AddExecutor(ExecutorType.SpellSet, CardId.LostWind, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.SinisterShadowGames, TrapSetWhenZoneFree);
AddExecutor(ExecutorType.SpellSet, CardId.ShaddollCore);
AddExecutor(ExecutorType.SpellSet, CardId.infiniteTransience, SetIsFieldEmpty);
//trap activate
AddExecutor(ExecutorType.Activate, CardId.LostWind, DefaultBreakthroughSkill);
AddExecutor(ExecutorType.Activate, CardId.LostWind, LostWindeff);
AddExecutor(ExecutorType.Activate, CardId.SinisterShadowGames, SinisterShadowGameseff);
AddExecutor(ExecutorType.Activate, CardId.ShaddollCore, ShaddollCoreeff);
AddExecutor(ExecutorType.Repos, MonsterRepos);
Expand Down Expand Up @@ -262,12 +262,12 @@ private bool UltimateConductorTytannoeff()
CardId.GhostOgre,
CardId.MaxxC,
};
if (Bot.HasInHand(targets)|| Bot.HasInMonstersZone(targets))
{
AI.SelectCard(targets);
return true;
if (!Bot.HasInHand(targets) || !Bot.HasInMonstersZone(targets))
{
return false;
}

AI.SelectCard(targets);
return true;
}
if (Duel.Phase == DuelPhase.BattleStart)
{
Expand Down Expand Up @@ -313,6 +313,7 @@ private bool MonsterRepos()
private bool OvertexCoatlseff()
{
if (Card.Location == CardLocation.MonsterZone) return false;
OvertexCoatlseff_used = true;
return true;
}

Expand Down Expand Up @@ -485,10 +486,14 @@ private bool AllureofDarkness()
}
return false;
}


private bool spellset()
{
return Bot.Hand.Count > 6;
}


private bool RebornEffect()
{
if(Bot.HasInGraveyard(CardId.UltimateConductorTytanno)&&Ultimate_ss>0)
Expand All @@ -509,6 +514,8 @@ private bool RebornEffect()
AI.SelectCard(targets);
return true;
}


private bool PotofAvariceeff()
{
return true;
Expand All @@ -518,10 +525,14 @@ private bool MaxxC()
{
return Duel.Player == 1;
}


private bool SetIsFieldEmpty()
{
return !Bot.IsFieldEmpty();
}


private bool TrapSetWhenZoneFree()
{
return Bot.GetSpellCountWithoutField() < 4;
Expand Down Expand Up @@ -553,6 +564,8 @@ private bool ElShaddollConstructeff()
}
return true;
}


private bool ElShaddollShekhinagaeff()
{
if (Card.Location != CardLocation.MonsterZone)
Expand All @@ -576,6 +589,8 @@ private bool ElShaddollShekhinagaeff()
}
return true;
}


private bool ElShaddollGrysraeff()
{
if (Card.Location != CardLocation.MonsterZone)
Expand Down Expand Up @@ -690,6 +705,8 @@ private bool ShaddollFalcoeff()
}
return true;
}


private bool ShaddollHedgehogeff()
{
if (Card.Location != CardLocation.MonsterZone)
Expand All @@ -705,6 +722,8 @@ private bool ShaddollHedgehogeff()
}
return true;
}


private bool ShaddollDragoneff()
{
if (Card.Location == CardLocation.MonsterZone)
Expand All @@ -720,6 +739,8 @@ private bool ShaddollDragoneff()
return true;
}
}


private bool ShaddollSquamataeff()
{
if (Card.Location != CardLocation.MonsterZone)
Expand All @@ -739,6 +760,17 @@ private bool ShaddollSquamataeff()
}
return true;
}

private bool LostWindeff()
{
List<ClientCard> check = Enemy.GetMonsters();
foreach (ClientCard m in check)
{
if (m.Attack>=2000) return DefaultBreakthroughSkill();
}
return false;
}

private bool FoolishBurialEffect()
{
if (Bot.GetRemainingCount(CardId.DoubleEvolutionPill, 3) > 0)
Expand All @@ -752,7 +784,6 @@ private bool FoolishBurialEffect()
return true;
}
return false;

}
else
{
Expand All @@ -761,12 +792,9 @@ private bool FoolishBurialEffect()
CardId.ShaddollSquamata,
CardId.FairyTailSnow,
});

}

return true;
}

}


public bool Hand_act_eff()
Expand Down Expand Up @@ -823,6 +851,8 @@ private bool MinervaTheExaltedEffect()
return true;
}
}


public bool CrystronNeedlefibersp()
{
if (Bot.HasInMonstersZone(CardId.ElShaddollConstruct) ||
Expand Down Expand Up @@ -879,6 +909,7 @@ public bool CrystronNeedlefibereff()
return false;
}


private bool ScarlightRedDragoneff()
{
IList<ClientCard> targets = new List<ClientCard>();
Expand All @@ -891,6 +922,8 @@ private bool ScarlightRedDragoneff()
}
return false;
}


private bool CrystalWingSynchroDragoneff()
{
return Duel.LastChainPlayer != 0;
Expand Down Expand Up @@ -926,7 +959,6 @@ private bool Sdulldeateff()
}*/
return false;
}


private bool BlackRoseMoonlightDragoneff()
{
Expand All @@ -941,6 +973,8 @@ private bool BlackRoseMoonlightDragoneff()
return false;

}


private bool RedWyverneff()
{
IList<ClientCard> check = Enemy.MonsterZone;
Expand All @@ -957,8 +991,6 @@ private bool RedWyverneff()
return false;
}



private bool CoralDragoneff()
{
if (Card.Location != CardLocation.MonsterZone)
Expand Down
5 changes: 3 additions & 2 deletions Game/AI/DefaultExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,10 @@ protected bool DefaultBreakthroughSkill()

if (LastChainCard == null)
return false;

if (LastChainCard.Controller != 1 || LastChainCard.Location != CardLocation.MonsterZone || !DefaultUniqueTrap())
return false;
AI.SelectCard(LastChainCard);
return LastChainCard.Controller == 1 && LastChainCard.Location == CardLocation.MonsterZone && DefaultUniqueTrap();
return true;
}

/// <summary>
Expand Down

0 comments on commit 4b2ffc2

Please sign in to comment.