Commit 1ccd1824 authored by Tang Xinwei's avatar Tang Xinwei

发牌姬二期:宝箱怪、AI用赌博卡智力改善

贡献者:神数不神
parent 7ffb811e
Pipeline #29864 passed with stage
in 37 seconds
...@@ -239,8 +239,8 @@ namespace WindBot.Game.AI ...@@ -239,8 +239,8 @@ namespace WindBot.Game.AI
}); });
SetFuncFilter(ExecutorType.Activate, () => { SetFuncFilter(ExecutorType.Activate, () => {
if (Card.IsCode(5990062)) return Bot.HasInSpellZone(9373534); //[大逆转谜题]只有在自己场上有手里剑覆盖的场合才发动 if (Card.IsCode(5990062)) return Bot.HasInSpellZone(9373534); //[大逆转谜题]只有在自己场上有手里剑覆盖的场合才发动
if (Card.IsCode(3493058)) return Bot.GetSpellCount() + Enemy.GetSpellCount() > 0; //[骰子旋风]玩家场上有魔陷才发动 if (Card.IsCode(3493058)) return Enemy.GetSpellCount() > 0; //[骰子旋风]对方玩家场上有魔陷才发动
if (Card.IsCode(22802010)) //[无差别崩坏]自己场上怪兽少于对方才发动 if (Card.IsCode(22802010)) //[无差别崩坏]自己场上怪兽少于对方才发动
return Bot.MonsterZone.Count(c => c != null && c.IsFaceup() && !c.HasType(CardType.Link)) < Enemy.MonsterZone.Count(c => c != null && c.IsFaceup() && !c.HasType(CardType.Link)); return Bot.MonsterZone.Count(c => c != null && c.IsFaceup() && !c.HasType(CardType.Link)) < Enemy.MonsterZone.Count(c => c != null && c.IsFaceup() && !c.HasType(CardType.Link));
return false; return false;
...@@ -637,7 +637,31 @@ namespace WindBot.Game.AI ...@@ -637,7 +637,31 @@ namespace WindBot.Game.AI
lowMonsters.AddRange(powerfulMonsters); lowMonsters.AddRange(powerfulMonsters);
return Util.CheckSelectCount(lowMonsters, cards, min, max); return Util.CheckSelectCount(lowMonsters, cards, min, max);
} }
if (hint == HintMsg.Destroy)
{
if (AI.HaveSelectedCards()) return null;
//[骰子旋风]破坏对方场上的魔法陷阱
List<ClientCard> ccards = new List<ClientCard>(cards);
bool spellCard = true;
List<ClientCard> enemyCards = new List<ClientCard>();
List<ClientCard> botCards = new List<ClientCard>();
foreach (ClientCard card in ccards)
{
if (card == null) continue;
if (!card.HasType(CardType.Spell) && !card.HasType(CardType.Trap))
{
spellCard = false;
break;
}
if (card.Controller == 1) enemyCards.Add(card);
else botCards.Add(card);
}
if (spellCard)
{
enemyCards.AddRange(botCards);
return Util.CheckSelectCount(enemyCards, cards, min, max);
}
}
return null; return null;
} }
......
...@@ -1172,10 +1172,15 @@ namespace WindBot.Game ...@@ -1172,10 +1172,15 @@ namespace WindBot.Game
if (!Executor.OnPreActivate(card)) if (!Executor.OnPreActivate(card))
return false; return false;
} }
bool result = card != null && exec.Type == type && Func<bool> Func = () =>
(exec.CardId == -1 || exec.CardId == card.Id) && {
(exec.Func == null || exec.Func()); if (Executor.FuncFilters.ContainsKey(exec.Type) && Executor.FuncFilters[exec.Type] != null
if (card.Id != 0 && type == ExecutorType.Activate && result) && !Executor.FuncFilters[exec.Type]()) return false;
return exec.Func == null || exec.Func();
};
bool result = card != null && exec.Type == type &&
(exec.CardId == -1 || exec.CardId == card.Id) && Func();
if (card.Id != 0 && type == ExecutorType.Activate && result)
{ {
int count = card.IsDisabled() ? 3 : 1; int count = card.IsDisabled() ? 3 : 1;
if (!_activatedCards.ContainsKey(card.Id)) if (!_activatedCards.ContainsKey(card.Id))
......
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