Skip to content

Commit

Permalink
Merge pull request #9 from IceYGO/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
Wind2009-Louse authored Aug 23, 2018
2 parents 4e16524 + 4f1c689 commit d99aefc
Show file tree
Hide file tree
Showing 21 changed files with 1,788 additions and 71 deletions.
73 changes: 73 additions & 0 deletions Decks/AI_BlueEyesMaxDragon.ydk
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#created by ...
#main
89631139
55410871
89631139
80701178
31036355
38517737
80701178
80701178
95492061
95492061
95492061
53303460
53303460
53303460
14558127
14558127
23434538
55410871
55410871
31036355
31036355
48800175
48800175
48800175
70368879
70368879
70368879
21082832
46052429
46052429
46052429
24224830
24224830
24224830
73915051
10045474
10045474
37576645
37576645
37576645
#extra
31833038
85289965
74997493
5043010
65330383
38342335
2857636
28776350
75452921
3987233
3987233
99111753
98978921
41999284
41999284
!side
75732622
15397015
15397015
73642296
23434538
5821478
77058170
3679218
25774450
43898403
23002292
23002292
84749824
84749824
65 changes: 65 additions & 0 deletions Decks/AI_Phantasm.ydk
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#created by ...
#main
81823360
81823360
81823360
14558127
14558127
63845230
18144506
35261759
35261759
47325505
47325505
59750328
59750328
59750328
73628505
98645731
98645731
98645731
73915051
73915051
2819435
2819435
2819435
10045474
34302287
34302287
34302287
47475363
58120309
61397885
61397885
89208725
89208725
19089195
19089195
19089195
53334471
53334471
82732705
99188141
#extra
44508094
5821478
31833038
85289965
65330383
72529749
61665245
38342335
2857636
75452921
50588353
3987233
98978921
41999284
41999284
!side
24094258
47475363
61397885
30241314
30241314
82732705
13 changes: 13 additions & 0 deletions Game/AI/AIFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ public static int CompareDefensePower(ClientCard cardA, ClientCard cardB)
return 1;
}

/// <summary>
/// Get the total ATK Monster of the player.
/// </summary>
public int GetTotalAttackingMonsterAttack(int player)
{
int atk = 0;
foreach (ClientCard m in Duel.Fields[player].GetMonsters())
{
if (m.IsAttack())
atk += m.Attack;
}
return atk;
}
/// <summary>
/// Get the best ATK or DEF power of the field.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions Game/AI/CardSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public IList<ClientCard> Select(IList<ClientCard> cards, int min, int max)
break;
case SelectType.Cards:
foreach (ClientCard card in _cards)
if (cards.Contains(card))
if (cards.Contains(card) && !result.Contains(card))
result.Add(card);
break;
case SelectType.Id:
Expand All @@ -74,7 +74,7 @@ public IList<ClientCard> Select(IList<ClientCard> cards, int min, int max)
case SelectType.Ids:
foreach (int id in _ids)
foreach (ClientCard card in cards)
if (card.Id == id)
if (card.Id == id && !result.Contains(card))
result.Add(card);
break;
case SelectType.Location:
Expand Down
7 changes: 4 additions & 3 deletions Game/AI/Decks/AltergeistExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ public bool Marionetter_eff()
}
if (!AI.Utils.IsTurn1OrMain2())
{
ClientCard self_best = AI.Utils.GetBestBotMonster(true);
ClientCard self_best = AI.Utils.GetBestBotMonster();
ClientCard enemy_best = AI.Utils.GetProblematicEnemyCard(self_best.Attack + 1, true);
ClientCard enemy_target = GetProblematicEnemyCard_Alter(true,false);

Expand Down Expand Up @@ -1548,7 +1548,7 @@ public bool Silquitous_eff()
ClientCard enemy_card = GetBestEnemyCard_random();
if (enemy_card != null)
{
Logger.DebugWriteLine("Silquitousdecide:" + bounce_self.Name);
Logger.DebugWriteLine("Silquitousdecide:" + bounce_self?.Name);
AI.SelectCard(bounce_self);
AI.SelectNextCard(enemy_card);
return true;
Expand Down Expand Up @@ -1805,6 +1805,7 @@ public void Spoofing_select(IList<int> list)
}
}
}
AI.SelectCard((ClientCard)null);
}

public bool Spoofing_eff()
Expand Down Expand Up @@ -1983,7 +1984,7 @@ public bool Spoofing_eff()
if ( (AI.Utils.IsChainTarget(card) || AI.Utils.ChainContainsCard(CardId.DarkHole) || (!Protocol_activing() && card.IsDisabled()))
&& card.IsFaceup() && Duel.LastChainPlayer != 0 && isAltergeist(card.Id))
{
Logger.DebugWriteLine("Spoofing target:" + card.Name);
Logger.DebugWriteLine("Spoofing target:" + card?.Name);
AI.SelectCard(card);
go = true;
break;
Expand Down
Loading

0 comments on commit d99aefc

Please sign in to comment.