Commit 8c3b26dc authored by wind2009's avatar wind2009 Committed by GitHub

update (#126)

parent 26acbca2
{
"welcome": [
"啊~~让我再睡一会嘛~",
"你要加入公会吗?",
"AI功能正在测试中,遇到问题请及时反馈。"
],
"deckerror": [
......@@ -12,7 +13,7 @@
],
"newturn": [
"我的回合,抽卡!",
"我抽了一张卡。"
"魔力补充!"
],
"endturn": [
"不想干活怎么办……",
......@@ -24,7 +25,7 @@
"快走开,我要回去睡觉了。",
],
"attack": [
"{0},攻击{1},我来为你加油!",
"{0},攻击{1}!",
"{0},替我打倒{1}!"
],
"ondirectattack": [
......@@ -35,11 +36,10 @@
],
"facedownmonstername": "怪兽",
"activate": [
"我发动{0}的效果。",
"{0}效果发动。"
"{0}的效果发动!"
],
"summon": [
"我召唤{0}。",
"召唤{0}!",
"出来吧,{0}!",
"{0},来帮我一下。"
],
......@@ -47,7 +47,7 @@
"……"
],
"chaining": [
"我使用{0}的力量。",
"等一下,我发动{0}。"
"发动{0}!",
"要不是有{0},我都快睡着了。"
]
}
......@@ -324,12 +324,7 @@ namespace WindBot.Game.AI.Decks
public int SelectSTPlace(ClientCard card=null, bool avoid_Impermanence = false)
{
List<int> list = new List<int>();
list.Add(0);
list.Add(1);
list.Add(2);
list.Add(3);
list.Add(4);
List<int> list = new List<int> { 0, 1, 2, 3, 4 };
int n = list.Count;
while (n-- > 1)
{
......
......@@ -193,12 +193,7 @@ namespace WindBot.Game.AI.Decks
public int SelectSTPlace()
{
List<int> list = new List<int>();
list.Add(0);
list.Add(1);
list.Add(2);
list.Add(3);
list.Add(4);
List<int> list = new List<int> { 0, 1, 2, 3, 4 };
int n = list.Count;
while (n-- > 1)
{
......
......@@ -88,6 +88,10 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.RelinquishedAnima);
// counter & quick effect
AddExecutor(ExecutorType.Activate, CardId.Schmietta, DeckSSWitchcraft);
AddExecutor(ExecutorType.Activate, CardId.Pittore, DeckSSWitchcraft);
AddExecutor(ExecutorType.Activate, CardId.Potterie, DeckSSWitchcraft);
AddExecutor(ExecutorType.Activate, CardId.Genni, DeckSSWitchcraft);
AddExecutor(ExecutorType.Activate, CardId.PSYGamma, PSYGammaActivate);
AddExecutor(ExecutorType.Activate, CardId.MaxxC, MaxxCActivate);
AddExecutor(ExecutorType.Activate, CardId.GolemAruru, GolemAruruActivate);
......@@ -132,10 +136,6 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.Patronus, PatronusActivate);
AddExecutor(ExecutorType.Activate, CardId.MagiciansRestage, MagiciansRestageActivate);
AddExecutor(ExecutorType.Activate, CardId.Holiday, HolidayActivate);
AddExecutor(ExecutorType.Activate, CardId.Schmietta, DeckSSWitchcraft);
AddExecutor(ExecutorType.Activate, CardId.Pittore, DeckSSWitchcraft);
AddExecutor(ExecutorType.Activate, CardId.Potterie, DeckSSWitchcraft);
AddExecutor(ExecutorType.Activate, CardId.Genni, DeckSSWitchcraft);
// summon
AddExecutor(ExecutorType.Summon, CardId.Schmietta, WitchcraftSummon);
......@@ -227,7 +227,7 @@ namespace WindBot.Game.AI.Decks
// MagiciansLeftHand / MagicianRightHand
if (!MagicianRightHand_used && card.IsSpell() && card.Controller == 1)
{
if (Bot.MonsterZone.GetFirstMatchingCard(c => (c.Race & (int)CardRace.SpellCaster) != 0) != null
if (Bot.MonsterZone.GetFirstMatchingCard(c => c.HasRace(CardRace.SpellCaster)) != null
&& Bot.HasInSpellZone(CardId.MagicianRightHand, true))
{
Logger.DebugWriteLine("MagicianRightHand negate: " + card.Name ?? "???");
......@@ -236,7 +236,7 @@ namespace WindBot.Game.AI.Decks
}
if (!MagiciansLeftHand_used && card.IsTrap() && card.Controller == 1)
{
if (Bot.MonsterZone.GetFirstMatchingCard(c => (c.Race & (int)CardRace.SpellCaster) != 0) != null
if (Bot.MonsterZone.GetFirstMatchingCard(c => c.HasRace(CardRace.SpellCaster)) != null
&& Bot.HasInSpellZone(CardId.MagiciansLeftHand, true))
{
Logger.DebugWriteLine("MagiciansLeftHand negate: " + card.Name ?? "???");
......@@ -422,7 +422,8 @@ namespace WindBot.Game.AI.Decks
{
return base.OnSelectPosition(cardId, positions);
}
if ((Duel.Player == 1 && (cardId == CardId.MadameVerre ||
if (!Enemy.HasInMonstersZone(_CardId.BlueEyesChaosMAXDragon)
&& (Duel.Player == 1 && (cardId == CardId.MadameVerre ||
Util.GetOneEnemyBetterThanValue(Data.Attack + 1) != null))
|| cardId == CardId.MaxxC || cardId == CardId.AshBlossom_JoyousSpring)
{
......@@ -490,7 +491,7 @@ namespace WindBot.Game.AI.Decks
int discardable_hands = 0;
int count_witchcraftspell = Bot.Hand.GetMatchingCardsCount(card => (card.IsSpell() && (card.HasSetcode(Witchcraft_setcode)) && card != except));
int count_remainhands = CheckRemainInDeck(CardId.MagiciansLeftHand, CardId.MagicianRightHand);
int count_MagiciansRestage = Bot.Hand.GetCardCount(CardId.MagiciansRestage);
int count_MagiciansRestage = Bot.Hand.GetMatchingCardsCount(card => card.Id == CardId.MagiciansRestage && card != except);
int count_MetalfoesFusion = Bot.Hand.GetCardCount(CardId.MetalfoesFusion);
int count_WitchcrafterBystreet = Bot.SpellZone.GetMatchingCardsCount(card => card.IsFaceup() && card.Id == CardId.WitchcrafterBystreet && !card.IsDisabled());
if (count_MagiciansRestage > 0)
......@@ -859,12 +860,7 @@ namespace WindBot.Game.AI.Decks
/// <param name="avoid_list">Whether need to avoid set in this place</param>
public void SelectSTPlace(ClientCard card = null, bool avoid_Impermanence = false, List<int> avoid_list=null)
{
List<int> list = new List<int>();
list.Add(0);
list.Add(1);
list.Add(2);
list.Add(3);
list.Add(4);
List<int> list = new List<int> { 0, 1, 2, 3, 4 };
int n = list.Count;
while (n-- > 1)
{
......@@ -890,6 +886,7 @@ namespace WindBot.Game.AI.Decks
// Spell&trap's set
public bool SpellSet(){
if (Duel.Phase == DuelPhase.Main1 && Bot.HasAttackingMonster() && Duel.Turn > 1) return false;
if (Card.Id == CardId.CrossoutDesignator && Duel.Turn >= 5) return false;
// set condition
int[] activate_with_condition = { CardId.Masterpiece, CardId.Draping };
......@@ -1118,7 +1115,14 @@ namespace WindBot.Game.AI.Decks
if (SpellNegatable()) return false;
if (CheckDiscardableSpellCount() <= 1) return false;
if ((Card.Id == CardId.ThatGrassLooksGreener || Card.Id == CardId.Reasoning) && CheckWhetherWillbeRemoved()) return false;
if (Card.Id == CardId.MagiciansLeftHand || Card.Id == CardId.MagicianRightHand)
{
if (Bot.MonsterZone.GetFirstMatchingCard(card => card.HasRace(CardRace.SpellCaster)) == null
&& (summoned || Bot.Hand.GetFirstMatchingCard(card => card.HasRace(CardRace.SpellCaster) && card.Level <= 4) == null))
{
return false;
}
}
SelectSTPlace(Card, true);
return true;
}
......@@ -1132,12 +1136,11 @@ namespace WindBot.Game.AI.Decks
if ((Card.Id == CardId.ThatGrassLooksGreener || Card.Id == CardId.Reasoning) && CheckWhetherWillbeRemoved()) return false;
if (Card.Id == CardId.MagiciansLeftHand || Card.Id == CardId.MagicianRightHand)
{
if (Bot.MonsterZone.GetFirstMatchingCard(card => (card.Race & (int)CardRace.SpellCaster) != 0) == null
&& (summoned || Bot.Hand.GetFirstMatchingCard(card => (card.Race & (int)CardRace.SpellCaster) != 0) == null))
if (Bot.MonsterZone.GetFirstMatchingCard(card => card.HasRace(CardRace.SpellCaster)) == null
&& (summoned || Bot.Hand.GetFirstMatchingCard(card => card.HasRace(CardRace.SpellCaster) && card.Level <= 4) == null))
{
return false;
}
}
SelectSTPlace(Card, true);
return true;
......@@ -1301,6 +1304,7 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectNextCard(CardId.Haine, CardId.MadameVerre, CardId.GolemAruru);
}
UseSSEffect.Add(Card.Id);
return true;
}
......@@ -1919,7 +1923,7 @@ namespace WindBot.Game.AI.Decks
int code = Util.GetLastChainCard().Id;
if (code == 0) return false;
if (CheckCalledbytheGrave(code) > 0 || CrossoutDesignatorTarget == code) return false;
if (Enemy.Graveyard.GetFirstMatchingCard(card => card.IsMonster() && card.Id == code) != null)
if (Enemy.Graveyard.GetFirstMatchingCard(card => card.IsMonster() && card.IsOriginalCode(code)) != null)
{
if (!(Card.Location == CardLocation.SpellZone))
{
......@@ -2011,9 +2015,11 @@ namespace WindBot.Game.AI.Decks
{
if (NegatedCheck(true) || CheckLastChainNegated()) return false;
// negate
if (Duel.LastChainPlayer == 1)
if (Duel.LastChainPlayer == 1 && Util.GetLastChainCard() != null)
{
int code = Util.GetLastChainCard().Id;
int alias = Util.GetLastChainCard().Alias;
if (alias != 0 && alias - code < 10) code = alias;
if (code == 0) return false;
if (CheckCalledbytheGrave(code) > 0 || CrossoutDesignatorTarget == code) return false;
if (CheckRemainInDeck(code) > 0)
......@@ -2065,7 +2071,7 @@ namespace WindBot.Game.AI.Decks
{
return false;
}
if (Bot.MonsterZone.GetFirstMatchingCard(card => (card.Race & (int)CardRace.SpellCaster) != 0) == null)
if (Bot.MonsterZone.GetFirstMatchingCard(card => card.HasRace(CardRace.SpellCaster)) == null)
{
return false;
}
......@@ -2204,7 +2210,7 @@ namespace WindBot.Game.AI.Decks
// negate monsters
if ((LastChainCard == null || LastChainCard.Controller != 1 || LastChainCard.Location != CardLocation.MonsterZone
|| LastChainCard.IsDisabled() || LastChainCard.IsShouldNotBeTarget() || LastChainCard.IsShouldNotBeSpellTrapTarget()))
|| CheckLastChainNegated() || LastChainCard.IsShouldNotBeTarget() || LastChainCard.IsShouldNotBeSpellTrapTarget()))
return false;
if (Card.Location == CardLocation.SpellZone)
{
......@@ -2468,7 +2474,7 @@ namespace WindBot.Game.AI.Decks
// banish hands
if (Card.Location == CardLocation.MonsterZone)
{
if (Duel.Player == 1 || Bot.HasInMonstersZone(CardId.PSYLambda))
if (Duel.Player == 1 || Bot.HasInMonstersZone(CardId.PSYLambda) || (Util.IsChainTarget(Card)) )
{
return true;
} else
......
......@@ -100,6 +100,12 @@
RedSupernovaDragon = 99585850,
NumberF0UtopicFutureDragon = 26973555,
InvokedAugoeides = 97300502,
DragonmaidStrahl = 24799107
DragonmaidStrahl = 24799107,
RavenousCrocodragonArchethys = 87188910,
AdamancipatorRisenRaptite = 73079836,
AdamancipatorRisenDragite = 9464441,
TeardroptheRikkaQueen = 33779875,
CeruleanSkyFire = 54828837,
SacredBeastAwakening = 53701259
}
}
......@@ -50,6 +50,7 @@
HoarrGeneraiderBossofRumbling = 68199168,
RedFamiliar = 8372133,
AccesscodeTalker = 86066372,
ChaosSummoningBeast = 27439792,
CosmoBrain = 85679527,
ShiranuiSolitaire = 94801854,
......
......@@ -251,6 +251,11 @@ namespace WindBot.Game
return (Attribute & (int)attribute) != 0;
}
public bool HasRace(CardRace race)
{
return (Race & (int)race) != 0;
}
public bool HasSetcode(int setcode)
{
if (Data == null) return false;
......
......@@ -522,14 +522,17 @@ namespace WindBot.Game
int final = _duel.Fields[player].LifePoints - packet.ReadInt32();
if (final < 0) final = 0;
if (_debug)
Logger.WriteLine("(" + player.ToString() + " got damage , LifePoint left= " + final.ToString() + ")");
Logger.WriteLine("(" + player.ToString() + " got damage , LifePoint left = " + final.ToString() + ")");
_duel.Fields[player].LifePoints = final;
}
private void OnRecover(BinaryReader packet)
{
int player = GetLocalPlayer(packet.ReadByte());
_duel.Fields[player].LifePoints += packet.ReadInt32();
int final = _duel.Fields[player].LifePoints + packet.ReadInt32();
if (_debug)
Logger.WriteLine("(" + player.ToString() + " got healed , LifePoint left = " + final.ToString() + ")");
_duel.Fields[player].LifePoints = final;
}
private void OnLpUpdate(BinaryReader packet)
......
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