Commit c72a7ef5 authored by nanahira's avatar nanahira

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

parents 969dd333 468b477f
using System; using System;
using WindBot.Game.AI.Enums; using WindBot.Game.AI.Enums;
using YGOSharp.OCGWrapper.Enums;
namespace WindBot.Game.AI namespace WindBot.Game.AI
{ {
...@@ -34,7 +35,7 @@ namespace WindBot.Game.AI ...@@ -34,7 +35,7 @@ namespace WindBot.Game.AI
/// </summary> /// </summary>
public static bool IsShouldNotBeTarget(this ClientCard card) public static bool IsShouldNotBeTarget(this ClientCard card)
{ {
return !card.IsDisabled() && Enum.IsDefined(typeof(ShouldNotBeTarget), card.Id); return !card.IsDisabled() && !card.HasType(CardType.Normal) && Enum.IsDefined(typeof(ShouldNotBeTarget), card.Id);
} }
/// <summary> /// <summary>
......
...@@ -184,7 +184,7 @@ namespace WindBot.Game.AI.Decks ...@@ -184,7 +184,7 @@ namespace WindBot.Game.AI.Decks
private bool RedEyesFusionEffect() private bool RedEyesFusionEffect()
{ {
if (Bot.HasInMonstersZone(CardId.DragunofRedEyes)) if (Bot.HasInMonstersZone(new[] { CardId.DragunofRedEyes, CardId.RedEyesBDragon }))
{ // you don't want to use DragunofRedEyes which is treated as RedEyesBDragon as fusion material { // you don't want to use DragunofRedEyes which is treated as RedEyesBDragon as fusion material
if (Util.GetBotAvailZonesFromExtraDeck() == 0) if (Util.GetBotAvailZonesFromExtraDeck() == 0)
return false; return false;
...@@ -319,7 +319,15 @@ namespace WindBot.Game.AI.Decks ...@@ -319,7 +319,15 @@ namespace WindBot.Game.AI.Decks
} }
else else
{ {
// TODO int[] costs = new[] {
CardId.RedEyesInsight,
CardId.RedEyesFusion
};
if (Bot.HasInHand(costs))
{
AI.SelectCard(costs);
return true;
}
return false; return false;
} }
} }
...@@ -354,7 +362,7 @@ namespace WindBot.Game.AI.Decks ...@@ -354,7 +362,7 @@ namespace WindBot.Game.AI.Decks
private bool MagicalizedFusionEffect() private bool MagicalizedFusionEffect()
{ {
if (Bot.HasInMonstersZone(CardId.DragunofRedEyes)) if (Bot.HasInMonstersZone(new[] { CardId.DragunofRedEyes, CardId.RedEyesBDragon }))
{ // you don't want to use DragunofRedEyes which is treated as RedEyesBDragon as fusion material { // you don't want to use DragunofRedEyes which is treated as RedEyesBDragon as fusion material
if (Util.GetBotAvailZonesFromExtraDeck() == 0) if (Util.GetBotAvailZonesFromExtraDeck() == 0)
return false; return false;
...@@ -367,6 +375,8 @@ namespace WindBot.Game.AI.Decks ...@@ -367,6 +375,8 @@ namespace WindBot.Game.AI.Decks
private bool PredaplantVerteAnacondaEffect() private bool PredaplantVerteAnacondaEffect()
{ {
if (ActivateDescription == Util.GetStringId(CardId.PredaplantVerteAnaconda, 0))
return false;
AI.SelectCard(CardId.RedEyesFusion); AI.SelectCard(CardId.RedEyesFusion);
AI.SelectMaterials(CardLocation.Deck); AI.SelectMaterials(CardLocation.Deck);
return true; return true;
...@@ -450,7 +460,6 @@ namespace WindBot.Game.AI.Decks ...@@ -450,7 +460,6 @@ namespace WindBot.Game.AI.Decks
CardId.AshBlossomJoyousSpring, CardId.AshBlossomJoyousSpring,
CardId.SeaMonsterofTheseus, CardId.SeaMonsterofTheseus,
CardId.MechaPhantomBeastOLionToken, CardId.MechaPhantomBeastOLionToken,
CardId.RedEyesBDragon,
CardId.DarkMagician, CardId.DarkMagician,
CardId.ImdukTheWorldChaliceDragon, CardId.ImdukTheWorldChaliceDragon,
CardId.Sangan, CardId.Sangan,
...@@ -486,7 +495,7 @@ namespace WindBot.Game.AI.Decks ...@@ -486,7 +495,7 @@ namespace WindBot.Game.AI.Decks
private bool TrapSet() private bool TrapSet()
{ {
if (Bot.HasInMonstersZone(CardId.DragunofRedEyes) && Bot.GetHandCount() == 1) if (Bot.HasInMonstersZone(new[] { CardId.DragunofRedEyes, CardId.RedEyesBDragon }) && Bot.GetHandCount() == 1)
return false; return false;
AI.SelectPlace(Zones.z0 + Zones.z1 + Zones.z3 + Zones.z4); AI.SelectPlace(Zones.z0 + Zones.z1 + Zones.z3 + Zones.z4);
return true; return true;
......
...@@ -54,5 +54,6 @@ ...@@ -54,5 +54,6 @@
PyroxeneFusion = 55824220, PyroxeneFusion = 55824220,
FragmentFusion = 72029628, FragmentFusion = 72029628,
NecroFusion = 81223446, NecroFusion = 81223446,
PredaplantVerteAnaconda = 70369116,
} }
} }
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
RaidraptorUltimateFalcon = 86221741, RaidraptorUltimateFalcon = 86221741,
DisdainfulBirdofParadise = 27240101, DisdainfulBirdofParadise = 27240101,
DarkestDiabolosLordOfTheLair = 50383626, DarkestDiabolosLordOfTheLair = 50383626,
Blackwing_FullArmoredWing = 54082269 Blackwing_FullArmoredWing = 54082269,
DragunofRedEyes = 37818794,
RedEyesBDragon = 74677422, // sometimes the name of DragunofRedEyes will be changed to RedEyesBDragon
} }
} }
...@@ -336,6 +336,11 @@ namespace WindBot.Game ...@@ -336,6 +336,11 @@ namespace WindBot.Game
return ids.Contains(Id) || Alias != 0 && ids.Contains(Alias); return ids.Contains(Id) || Alias != 0 && ids.Contains(Alias);
} }
public bool IsOriginalCode(int id)
{
return Id == id || Alias - Id < 10 && Alias == id;
}
public bool HasXyzMaterial() public bool HasXyzMaterial()
{ {
return Overlays.Count > 0; return Overlays.Count > 0;
......
...@@ -306,10 +306,11 @@ namespace WindBot.Game ...@@ -306,10 +306,11 @@ namespace WindBot.Game
public int GetRemainingCount(int cardId, int initialCount) public int GetRemainingCount(int cardId, int initialCount)
{ {
int remaining = initialCount; int remaining = initialCount;
remaining = remaining - Hand.Count(card => card != null && card.IsCode(cardId)); remaining = remaining - Hand.Count(card => card != null && card.IsOriginalCode(cardId));
remaining = remaining - SpellZone.Count(card => card != null && card.IsCode(cardId)); remaining = remaining - SpellZone.Count(card => card != null && card.IsOriginalCode(cardId));
remaining = remaining - Graveyard.Count(card => card != null && card.IsCode(cardId)); remaining = remaining - MonsterZone.Count(card => card != null && card.IsOriginalCode(cardId));
remaining = remaining - Banished.Count(card => card != null && card.IsCode(cardId)); remaining = remaining - Graveyard.Count(card => card != null && card.IsOriginalCode(cardId));
remaining = remaining - Banished.Count(card => card != null && card.IsOriginalCode(cardId));
return (remaining < 0) ? 0 : remaining; return (remaining < 0) ? 0 : remaining;
} }
......
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