Skip to content

Commit

Permalink
update ChainBurn deck (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
handsomekiwi authored and mercury233 committed Apr 11, 2018
1 parent 4b2ffc2 commit 5d17681
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 16 deletions.
50 changes: 34 additions & 16 deletions Game/AI/Decks/ChainBurnExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ public bool Has_prevent_list_1(int id)
bool OjamaTrioused = false;
bool OjamaTrioused_draw = false;
bool drawfirst = false;
bool Linkuribohused = true;
int Waboku_count = 0;
int Roar_count = 0;
int strike_count = 0;
Expand All @@ -251,17 +252,18 @@ public override void OnNewTurn()


no_sp = false;
prevent_used = false;

prevent_used = false;
Linkuribohused = true;

}
public override void OnNewPhase()
{
preventcount = 0;
battleprevent = false;
OjamaTrioused = false;
IList<ClientCard> trap = Bot.SpellZone;
IList<ClientCard> monster = Bot.MonsterZone;

IList<ClientCard> trap = Bot.GetSpells();
IList<ClientCard> monster = Bot.GetMonsters();

foreach (ClientCard card in trap)
{
Expand Down Expand Up @@ -297,7 +299,7 @@ public override void OnNewPhase()
Roar_count = 0;
Ojama_count = 0;

IList<ClientCard> check = Bot.SpellZone;
IList<ClientCard> check = Bot.GetSpells();
foreach (ClientCard card in check)
{
if (card.Id == CardId.AccuulatedFortune)
Expand Down Expand Up @@ -352,7 +354,7 @@ public override void OnNewPhase()
}

expected_blood = (Enemy.GetMonsterCount() * 500 * just_count + Enemy.GetFieldHandCount() * 200 * barrel_count + Enemy.GetFieldCount() * 300 * blast_count);
if (Enemy.LifePoints <= expected_blood) one_turn_kill = true;
//if (Enemy.LifePoints <= expected_blood && Duel.Player == 1) one_turn_kill = true;
if (greed_count >= 2) greed_count = 1;
if (blast_count >= 2) blast_count = 1;
if (just_count >= 2) just_count = 1;
Expand All @@ -365,10 +367,10 @@ public override void OnNewPhase()
currentchain = Duel.CurrentChain.Count + blast_count + just_count + barrel_count + Waboku_count + Waboku_count + Roar_count + greed_count + strike_count + Ojama_count;
else
currentchain = Duel.CurrentChain.Count + blast_count + just_count + barrel_count + Waboku_count + Waboku_count + greed_count + Roar_count + strike_count;
if (currentchain >= 3) drawfirst = true;
//if (currentchain >= 3 && Duel.Player == 1) drawfirst = true;
currentchain = Duel.CurrentChain.Count+ blast_count + just_count+barrel_count;
expected_blood = (Enemy.GetMonsterCount() * 500 * just_count + Enemy.GetFieldHandCount() * 200 * barrel_count + Enemy.GetFieldCount() * 300 * blast_count+(currentchain+1)*400);
if (Enemy.LifePoints <= expected_blood) one_turn_kill_1 = true;
//if (Enemy.LifePoints <= expected_blood && Duel.Player==1) one_turn_kill_1 = true;

}

Expand Down Expand Up @@ -439,7 +441,7 @@ private bool BlazingMirrorForceeff()
private bool ThreateningRoareff()
{
if (drawfirst) return true;
if (must_chain()) return true;
if (must_chain()) return DefaultUniqueTrap();
if (prevent_used || Duel.Phase != DuelPhase.BattleStart) return false;
prevent_used = true;
return DefaultUniqueTrap();
Expand All @@ -452,11 +454,19 @@ private bool SandaionTheTimloardeff()
}
private bool Wabokueff()
{
if (drawfirst) return true;
if (must_chain()) return true;
if (drawfirst) return true;
if (drawfirst)
{
Linkuribohused = false;
return true;
}
if (must_chain())
{
Linkuribohused = false;
return DefaultUniqueTrap();
}
if (prevent_used||Duel.Player == 0||Duel.Phase!=DuelPhase.BattleStart) return false;
prevent_used = true;
Linkuribohused = false;
return DefaultUniqueTrap();
}
private bool BattleFadereff()
Expand Down Expand Up @@ -610,10 +620,18 @@ private bool Ceasefireeff()
return false;
}
private bool Linkuriboheff()
{
ClientCard lastchaincard = AI.Utils.GetLastChainCard();
if (lastchaincard == null) return true;
if (lastchaincard.Id == CardId.Linkuriboh) return false;
{

IList<ClientCard> newlist = new List<ClientCard>();
foreach (ClientCard newmonster in Enemy.GetMonsters())
{
newlist.Add(newmonster);
}
if (!Linkuribohused) return false;
if (Enemy.BattlingMonster.Attack > 1800 && Bot.HasInSpellZone(CardId.MagicCylinder)) return false;
if (GetTotalATK(newlist) >= 3000 && Bot.HasInSpellZone(CardId.BlazingMirrorForce)) return false;
if (AI.Utils.GetLastChainCard() == null) return true;
if (AI.Utils.GetLastChainCard().Id == CardId.Linkuriboh)return false;
return true;
}

Expand Down
6 changes: 6 additions & 0 deletions Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,12 @@ private bool ElShaddollGrysraeff()

private bool ShaddollFusioneff()
{
if (Bot.HasInMonstersZone(CardId.ElShaddollConstruct) ||
Bot.HasInMonstersZone(CardId.ElShaddollGrysra) ||
Bot.HasInMonstersZone(CardId.ElShaddollShekhinaga) ||
Bot.HasInMonstersZone(CardId.ElShaddollWinda ))
return false;

bool deck_check = false;
List<ClientCard> monsters = Enemy.GetMonsters();
foreach (ClientCard monster in monsters)
Expand Down
1 change: 1 addition & 0 deletions Game/GameAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public void OnNewPhase()
{
_dialogs.SendNewTurn();
}
Executor.OnNewPhase();
}

/// <summary>
Expand Down

0 comments on commit 5d17681

Please sign in to comment.