Commit 3efd5c1c authored by mercury233's avatar mercury233

update HasInMonstersZone and HasXyzMaterial

parent 58abefdf
...@@ -72,9 +72,10 @@ namespace MycardBot.Game.AI.Decks ...@@ -72,9 +72,10 @@ namespace MycardBot.Game.AI.Decks
AddExecutor(ExecutorType.SpellSet, (int)CardId.虫惑的落穴); AddExecutor(ExecutorType.SpellSet, (int)CardId.虫惑的落穴);
AddExecutor(ExecutorType.Summon, (int)CardId.救援兔); AddExecutor(ExecutorType.Summon, (int)CardId.救援兔);
AddExecutor(ExecutorType.Activate, (int)CardId.救援兔, 救援兔效果); AddExecutor(ExecutorType.Activate, (int)CardId.救援兔, 救援兔效果);
AddExecutor(ExecutorType.Activate, (int)CardId.强欲而贪欲之壶, 强欲而贪欲之壶效果);
AddExecutor(ExecutorType.Summon, (int)CardId.曼陀罗天使号手, 曼陀罗天使号手通常召唤); AddExecutor(ExecutorType.Summon, (int)CardId.曼陀罗天使号手, 曼陀罗天使号手通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.打喷嚏的河马龙, 打喷嚏的河马龙通常召唤); AddExecutor(ExecutorType.Summon, (int)CardId.打喷嚏的河马龙, 打喷嚏的河马龙通常召唤);
AddExecutor(ExecutorType.Summon, (int)CardId.龙剑士卓辉星灵摆, 龙剑士卓辉星灵摆通常召唤); AddExecutor(ExecutorType.Summon, (int)CardId.龙剑士卓辉星灵摆, 龙剑士卓辉星灵摆通常召唤);
...@@ -104,7 +105,6 @@ namespace MycardBot.Game.AI.Decks ...@@ -104,7 +105,6 @@ namespace MycardBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, (int)CardId.芙莉西亚之虫惑魔); AddExecutor(ExecutorType.Activate, (int)CardId.芙莉西亚之虫惑魔);
AddExecutor(ExecutorType.SpSummon, (int)CardId.No59背反之料理人, No59背反之料理人特殊召唤); AddExecutor(ExecutorType.SpSummon, (int)CardId.No59背反之料理人, No59背反之料理人特殊召唤);
AddExecutor(ExecutorType.Activate, (int)CardId.强欲而贪欲之壶, 强欲而贪欲之壶效果);
AddExecutor(ExecutorType.Activate, (int)CardId.地碎, 地碎效果); AddExecutor(ExecutorType.Activate, (int)CardId.地碎, 地碎效果);
AddExecutor(ExecutorType.SpSummon, (int)CardId.No39希望皇霍普, 电光皇特殊召唤); AddExecutor(ExecutorType.SpSummon, (int)CardId.No39希望皇霍普, 电光皇特殊召唤);
...@@ -144,8 +144,10 @@ namespace MycardBot.Game.AI.Decks ...@@ -144,8 +144,10 @@ namespace MycardBot.Game.AI.Decks
} }
if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇)) if (!(defender.Id == (int)CardId.闪光No39希望皇霍普电光皇))
{ {
if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled()) if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普))
attacker.RealPower = 5000; attacker.RealPower = 5000;
if (Duel.Fields[0].HasInMonstersZone((int)CardId.No37希望织龙蜘蛛鲨, true, true))
attacker.RealPower = attacker.RealPower + 1000;
} }
return attacker.RealPower > defender.GetDefensePower(); return attacker.RealPower > defender.GetDefensePower();
} }
......
...@@ -182,7 +182,7 @@ namespace WindBot.Game.AI.Decks ...@@ -182,7 +182,7 @@ namespace WindBot.Game.AI.Decks
{ {
if (attacker.Attribute == (int)CardAttribute.Wind && Duel.Fields[0].HasInHand((int)CardId.妖仙兽辻斩风)) if (attacker.Attribute == (int)CardAttribute.Wind && Duel.Fields[0].HasInHand((int)CardId.妖仙兽辻斩风))
attacker.RealPower = attacker.RealPower + 1000; attacker.RealPower = attacker.RealPower + 1000;
if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled()) if (attacker.Id == (int)CardId.闪光No39希望皇霍普电光皇 && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.No39希望皇霍普))
attacker.RealPower = 5000; attacker.RealPower = 5000;
} }
return attacker.RealPower > defender.GetDefensePower(); return attacker.RealPower > defender.GetDefensePower();
......
...@@ -136,7 +136,7 @@ namespace DevBot.Game.AI.Decks ...@@ -136,7 +136,7 @@ namespace DevBot.Game.AI.Decks
{ {
if (attacker.Attribute == (int)CardAttribute.Light && Duel.Fields[0].HasInHand((int)CardId.Honest)) if (attacker.Attribute == (int)CardAttribute.Light && Duel.Fields[0].HasInHand((int)CardId.Honest))
attacker.RealPower = attacker.RealPower + defender.Attack; attacker.RealPower = attacker.RealPower + defender.Attack;
if (attacker.Id == (int)CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled()) if (attacker.Id == (int)CardId.NumberS39UtopiatheLightning && !attacker.IsDisabled() && attacker.HasXyzMaterial(2, (int)CardId.Number39Utopia))
attacker.RealPower = 5000; attacker.RealPower = 5000;
} }
return attacker.RealPower > defender.GetDefensePower(); return attacker.RealPower > defender.GetDefensePower();
...@@ -144,7 +144,7 @@ namespace DevBot.Game.AI.Decks ...@@ -144,7 +144,7 @@ namespace DevBot.Game.AI.Decks
private bool Number39Utopia() private bool Number39Utopia()
{ {
if (!HasChainedTrap(0) && Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Card.Overlays.Count > 1) if (!HasChainedTrap(0) && Duel.Player == 1 && Duel.Phase == DuelPhase.BattleStart && Card.HasXyzMaterial(2))
return true; return true;
return false; return false;
} }
......
...@@ -184,6 +184,21 @@ namespace WindBot.Game ...@@ -184,6 +184,21 @@ namespace WindBot.Game
return (Disabled != 0); return (Disabled != 0);
} }
public bool HasXyzMaterial()
{
return Overlays.Count > 0;
}
public bool HasXyzMaterial(int count)
{
return Overlays.Count >= count;
}
public bool HasXyzMaterial(int count, int cardid)
{
return Overlays.Count >= count && Overlays.Contains(cardid);
}
public int GetDefensePower() public int GetDefensePower()
{ {
return IsAttack() ? Attack : Defense; return IsAttack() ? Attack : Defense;
......
...@@ -140,19 +140,24 @@ namespace WindBot.Game ...@@ -140,19 +140,24 @@ namespace WindBot.Game
return false; return false;
} }
public bool HasInMonstersZone(int cardId) public bool HasInMonstersZone(int cardId, bool notDisabled = false, bool hasXyzMaterial = false)
{ {
return HasInCards(MonsterZone, cardId); return HasInCards(MonsterZone, cardId, notDisabled, hasXyzMaterial);
} }
public bool HasInMonstersZone(List<int> cardId) public bool HasInMonstersZone(List<int> cardId, bool notDisabled = false, bool hasXyzMaterial = false)
{ {
return HasInCards(MonsterZone, cardId); return HasInCards(MonsterZone, cardId, notDisabled, hasXyzMaterial);
} }
public bool HasInSpellZone(int cardId) public bool HasInSpellZone(int cardId, bool notDisabled = false)
{ {
return HasInCards(SpellZone, cardId); return HasInCards(SpellZone, cardId, notDisabled);
}
public bool HasInSpellZone(List<int> cardId, bool notDisabled = false)
{
return HasInCards(SpellZone, cardId, notDisabled);
} }
public int GetRemainingCount(int cardId, int initialCount) public int GetRemainingCount(int cardId, int initialCount)
...@@ -225,21 +230,21 @@ namespace WindBot.Game ...@@ -225,21 +230,21 @@ namespace WindBot.Game
return nCards; return nCards;
} }
private static bool HasInCards(IEnumerable<ClientCard> cards, int cardId) private static bool HasInCards(IEnumerable<ClientCard> cards, int cardId, bool notDisabled = false, bool hasXyzMaterial = false)
{ {
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
if (card != null && card.Id == cardId) if (card != null && card.Id == cardId && !(notDisabled && card.IsDisabled()) && !(hasXyzMaterial && !card.HasXyzMaterial()))
return true; return true;
} }
return false; return false;
} }
private static bool HasInCards(IEnumerable<ClientCard> cards, List<int> cardId) private static bool HasInCards(IEnumerable<ClientCard> cards, List<int> cardId, bool notDisabled = false, bool hasXyzMaterial = false)
{ {
foreach (ClientCard card in cards) foreach (ClientCard card in cards)
{ {
if (card != null && cardId.Contains(card.Id)) if (card != null && cardId.Contains(card.Id) && !(notDisabled && card.IsDisabled()) && !(hasXyzMaterial && !card.HasXyzMaterial()))
return true; return true;
} }
return false; return false;
......
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