Skip to content

Commit

Permalink
Merge branch 'master' of git.mycard.moe:mycard/windbot
Browse files Browse the repository at this point in the history
  • Loading branch information
purerosefallen committed May 13, 2024
2 parents 8656627 + 2ce621d commit 324251d
Show file tree
Hide file tree
Showing 41 changed files with 774 additions and 526 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2

- name: Build!
run: msbuild $env:Solution_Name /t:Build /p:Configuration=Release
Expand All @@ -36,7 +36,7 @@ jobs:
cd ..
- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: dist\WindBot.7z

Expand All @@ -46,7 +46,7 @@ jobs:
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
prerelease: false
title: "Development Build"
files: |
dist/WindBot.7z
33 changes: 23 additions & 10 deletions Game/AI/Decks/AltergeistExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ public bool isAltergeist(int id)

public bool isAltergeist(ClientCard card)
{
return card.IsCode(CardId.Marionetter, CardId.Hexstia, CardId.Protocol, CardId.Multifaker, CardId.Meluseek,
CardId.Kunquery, CardId.Manifestation, CardId.Silquitous);
return card != null && card.HasSetcode(0x103);
}

public int GetSequence(ClientCard card)
Expand Down Expand Up @@ -391,6 +390,7 @@ public int SelectSetPlace(List<int> avoid_list=null)
public bool spell_trap_activate(bool isCounter = false, ClientCard target = null)
{
if (target == null) target = Card;
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (target.Location != CardLocation.SpellZone && target.Location != CardLocation.Hand) return true;
if (Enemy.HasInMonstersZone(CardId.NaturalExterio, true) && !Bot.HasInHandOrHasInMonstersZone(CardId.GO_SR) && !isCounter && !Bot.HasInSpellZone(CardId.SolemnStrike)) return false;
if (target.IsSpell())
Expand Down Expand Up @@ -664,7 +664,7 @@ public bool SecretVillage_activate()

public bool G_activate()
{
return (Duel.Player == 1);
return (Duel.Player == 1) && !DefaultCheckWhetherCardIsNegated(Card);
}

public bool NaturalExterio_eff()
Expand Down Expand Up @@ -821,6 +821,7 @@ public bool Impermanence_activate()

public bool Hand_act_eff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.IsCode(CardId.AB_JS) && Util.GetLastChainCard().HasSetcode(0x11e) && Util.GetLastChainCard().Location == CardLocation.Hand) // Danger! archtype hand effect
return false;
if (Card.IsCode(CardId.GO_SR) && Card.Location == CardLocation.Hand && Bot.HasInMonstersZone(CardId.GO_SR)) return false;
Expand Down Expand Up @@ -901,6 +902,7 @@ public bool WakingtheDragon_eff()

public bool GR_WC_activate()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int warrior_count = 0;
int pendulum_count = 0;
int link_count = 0;
Expand Down Expand Up @@ -1263,7 +1265,7 @@ public bool Hexstia_eff()
if (linked_card != null && linked_card.IsCode(CardId.Hexstia))
{
int next_seq = get_Hexstia_linkzone(this_seq);
if (next_seq != -1 && Bot.MonsterZone[next_seq] != null && isAltergeist(Bot.MonsterZone[next_seq].Id)) return false;
if (next_seq != -1 && Bot.MonsterZone[next_seq] != null && isAltergeist(Bot.MonsterZone[next_seq])) return false;
}
}
return true;
Expand Down Expand Up @@ -1690,7 +1692,7 @@ public bool Protocol_negate()
if (target.IsCode(CardId.Hexstia))
{
int next_index = get_Hexstia_linkzone(i);
if (next_index != -1 && Bot.MonsterZone[next_index] != null && Bot.MonsterZone[next_index].IsFaceup() && isAltergeist(Bot.MonsterZone[next_index].Id)) continue;
if (next_index != -1 && Bot.MonsterZone[next_index] != null && Bot.MonsterZone[next_index].IsFaceup() && isAltergeist(Bot.MonsterZone[next_index])) continue;
}
if (!get_linked_by_Hexstia(i))
{
Expand Down Expand Up @@ -2669,6 +2671,7 @@ public override void OnNewTurn()
ss_other_monster = false;
Impermanence_list.Clear();
attacked_Meluseek.Clear();
base.OnNewTurn();
}

public override void OnChaining(int player, ClientCard card)
Expand Down Expand Up @@ -2890,16 +2893,16 @@ public override int OnSelectPlace(int cardId, int player, CardLocation location,
if (cardId == CardId.Hexstia)
{
// ex zone
if ((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && isAltergeist(Bot.MonsterZone[1].Id)) return Zones.z5;
if ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && isAltergeist(Bot.MonsterZone[3].Id)) return Zones.z6;
if ( ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && !isAltergeist(Bot.MonsterZone[3].Id))
if ((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && isAltergeist(Bot.MonsterZone[1])) return Zones.z5;
if ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && isAltergeist(Bot.MonsterZone[3])) return Zones.z6;
if ( ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] != null && !isAltergeist(Bot.MonsterZone[3]))
|| ((Zones.z5 & available) > 0 && Bot.MonsterZone[1] == null) ) return Zones.z5;
if (((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && !isAltergeist(Bot.MonsterZone[1].Id))
if (((Zones.z5 & available) > 0 && Bot.MonsterZone[1] != null && !isAltergeist(Bot.MonsterZone[1]))
|| ((Zones.z6 & available) > 0 && Bot.MonsterZone[3] == null)) return Zones.z6;
// main zone
for (int i = 1; i < 5; ++i)
{
if (Bot.MonsterZone[i] != null && isAltergeist(Bot.MonsterZone[i].Id))
if (Bot.MonsterZone[i] != null && isAltergeist(Bot.MonsterZone[i]))
{
if ((available & (int)System.Math.Pow(2, i - 1)) > 0) return (int)System.Math.Pow(2, i - 1);
}
Expand All @@ -2913,5 +2916,15 @@ public override int OnSelectPlace(int cardId, int player, CardLocation location,
}
return base.OnSelectPlace(cardId, player, location, available);
}

protected override bool DefaultSetForDiabellze()
{
if (base.DefaultSetForDiabellze())
{
AI.SelectPlace(SelectSTPlace(Card, true));
return true;
}
return false;
}
}
}
1 change: 1 addition & 0 deletions Game/AI/Decks/BlueEyesExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public override void OnNewTurn()
UsedGalaxyEyesCipherDragon = null;
AlternativeWhiteDragonSummoned = false;
SoulChargeUsed = false;
base.OnNewTurn();
}

public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
Expand Down
2 changes: 2 additions & 0 deletions Game/AI/Decks/BlueEyesMaxDragonExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ private void Count_check()

private bool MaxxCeff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player == 1;
}

Expand Down Expand Up @@ -464,6 +465,7 @@ private bool Linkuribohsp()

private bool Linkuriboheff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Duel.LastChainPlayer == 0 && Util.GetLastChainCard().IsCode(CardId.Linkuriboh)) return false;
return true;
}
Expand Down
6 changes: 6 additions & 0 deletions Game/AI/Decks/BraveExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public override void OnNewTurn()
FusionDestinyUsed = false;
PhoenixTarget = null;
PhoenixSelectingTarget = 0;
base.OnNewTurn();
}

public override CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
Expand Down Expand Up @@ -479,6 +480,7 @@ private bool JourneyOfDestinyEffect()

private bool AquamancerOfTheSanctuarySearchEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.Location == CardLocation.Grave)
{
AI.SelectCard(CardLocation.Deck);
Expand Down Expand Up @@ -626,6 +628,7 @@ private bool TGHyperLibrarianSummon()

private bool JetSynchronEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
int[] materials = new[] {
CardId.MechaPhantomBeastToken
};
Expand Down Expand Up @@ -786,6 +789,7 @@ private bool PredaplantVerteAnacondaSummon()

private bool PredaplantVerteAnacondaEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (ActivateDescription == Util.GetStringId(CardId.PredaplantVerteAnaconda, 0))
return false;
FusionDestinyUsed = true;
Expand Down Expand Up @@ -858,6 +862,7 @@ private bool DestinyHeroDasherEffect()

private bool DestinyHeroCelestialEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (!Bot.HasInGraveyard(CardId.DestinyHeroDasher))
return false;
AI.SelectCard(CardId.DestinyHeroDasher);
Expand Down Expand Up @@ -971,6 +976,7 @@ private bool VirtualWorldKyubiShenshenSummon()

private bool VirtualWorldKyubiShenshenEffect()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Card.Location == CardLocation.MonsterZone && Bot.HasInBanished(CardId.AquamancerOfTheSanctuary))
{
AI.SelectCard(CardId.AquamancerOfTheSanctuary);
Expand Down
1 change: 1 addition & 0 deletions Game/AI/Decks/ChainBurnExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ public override void OnNewTurn()
prevent_used = false;
Linkuribohused = true;
Timelord_check = false;
base.OnNewTurn();
}
public override void OnNewPhase()
{
Expand Down
5 changes: 5 additions & 0 deletions Game/AI/Decks/DarkMagicianExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ public override void OnNewTurn()
big_attack = false;
big_attack_used = false;
soul_used = false;
base.OnNewTurn();
}
public int GetTotalATK(IList<ClientCard> list)
{
Expand Down Expand Up @@ -496,11 +497,13 @@ private bool SolemnStrikeeff()
{
if (Bot.LifePoints > 1500 && Duel.LastChainPlayer == 1)
return true;
if (DefaultOnlyHorusSpSummoning()) return false;
return false;
}

private bool ChainEnemy()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Util.GetLastChainCard() != null &&
Util.GetLastChainCard().IsCode(CardId.UpstartGoblin))
return false;
Expand All @@ -519,6 +522,7 @@ private bool CrystalWingSynchroDragoneff()

private bool MaxxCeff()
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
return Duel.Player == 1;
}
/*
Expand Down Expand Up @@ -1417,6 +1421,7 @@ private bool MagiciansRodeff()
}
else
{
if (DefaultCheckWhetherCardIsNegated(Card)) return false;
if (Bot.HasInMonstersZone(CardId.VentriloauistsClaraAndLucika))
{
AI.SelectCard(CardId.VentriloauistsClaraAndLucika);
Expand Down
Loading

0 comments on commit 324251d

Please sign in to comment.