Commit f2d7219b authored by mercury233's avatar mercury233

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

parents e6a8cac1 a927ee30
......@@ -2,27 +2,32 @@
# !name
# command
# description
# flags (avail flags: SUPPORT_MASTER_RULE_3, SUPPORT_NEW_MASTER_RULE, SUPPORT_MASTER_RULE_2020)
# flags (avail flags: SUPPORT_MASTER_RULE_3, SUPPORT_NEW_MASTER_RULE, SUPPORT_MASTER_RULE_2020, SELECT_DECKFILE)
!随机-非常简单
Random=AI_LV1
主要是一些沙包。
SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
SUPPORT_MASTER_RULE_2020
!随机-简单
Random=AI_LV2
一些比较弱的卡组。
SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
SUPPORT_MASTER_RULE_2020
!随机-普通
Random=AI_LV3
一些环境里可以看到的卡组。
SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
SUPPORT_MASTER_RULE_2020
!随机-报社
Random=AI_ANTI_META
一些报复社会(针对主流卡组的弱点)的卡组。
SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
SUPPORT_MASTER_RULE_2020
!P2-自选卡组
Name=P2 Deck=Lucky Dialog=gugugu.zh-CN
人机卡组由你选择。随缘出牌。可将你的卡组文件(.ydk)复制到WindBot的对应文件夹。
SELECT_DECKFILE SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!悠悠
Name=悠悠 Deck=MokeyMokey Dialog=mokey.zh-CN
......@@ -47,17 +52,17 @@ AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
!谜之剑士LV4-R5
Name=谜之剑士LV4 Deck='Rank V' Dialog=swordsman.zh-CN
5阶超量卡组。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!谜之剑士LV4-异热同心武器
Name=谜之剑士LV4 Deck='Zexal Weapons' Dialog=swordsman.zh-CN
神装电光皇卡组。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!琪露诺-彩虹
Name=琪露诺 Deck=Rainbow Dialog=cirno.zh-CN
全属性凡骨卡组。
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
AI_LV2 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!琪露诺-饼蛙
Name=琪露诺 Deck='Toadally Awesome' Dialog=cirno.zh-CN
......@@ -67,7 +72,7 @@ SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!复制植物-青眼
Name=复制植物 Deck=Blue-Eyes Dialog=copy.zh-CN
青眼卡组。
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_NEW_MASTER_RULE SUPPORT_MASTER_RULE_2020
AI_LV3 SUPPORT_MASTER_RULE_3 SUPPORT_MASTER_RULE_2020
!复制植物-十二兽
Name=复制植物 Deck=Zoodiac Dialog=copy.zh-CN
......
{
"welcome": [
"大家好我是新人",
"游戏王是怎么玩来着?",
"还好我不玩游戏王"
],
"deckerror": [
"卡组里{0}鸽了"
],
"duelstart": [
"不想干活怎么办",
"智商欠费不想干活怎么办"
],
"newturn": [
"好多可怕的新卡啊",
"这游戏好难玩",
"so lazy cant move"
],
"endturn": [
"搞得我只能鸽了",
"不是在此时,不知在何时",
"too hot need ice cream"
],
"directattack": [
"听起来很鸽",
"老鸽,稳"
],
"attack": [
"听起来不是很鸽",
"可怕"
],
"ondirectattack": [
"哇!",
"这么可怕的吗",
"听起来非常鸽",
"承受不住"
],
"facedownmonstername": "鸽子",
"activate": [
"不明觉鸽",
"鸽了,爽"
],
"summon": [
"可怕",
"不关我事",
"那还是不关我事",
"鸽了,爽"
],
"setmonster": [
"摸鱼中,不想更新",
"那还是鸽置吧"
],
"chaining": [
"那是什么",
"但我鸽了",
"无此服务",
"可怕"
]
}
......@@ -11,7 +11,9 @@ namespace WindBot.Game.AI
/// </summary>
public static bool IsMonsterInvincible(this ClientCard card)
{
return !card.IsDisabled() && Enum.IsDefined(typeof(InvincibleMonster), card.Id);
return !card.IsDisabled() &&
(card.Controller == 0 && Enum.IsDefined(typeof(InvincibleBotMonster), card.Id) ||
card.Controller == 1 && Enum.IsDefined(typeof(InvincibleEnemyMonster), card.Id));
}
/// <summary>
......
......@@ -2742,8 +2742,6 @@ namespace WindBot.Game.AI.Decks
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{
int HIINT_TOGRAVE = 504;
if (max == 1 && cards[0].Location == CardLocation.Deck
&& Util.GetLastChainCard() != null && Util.GetLastChainCard().IsCode(23002292) && Bot.GetRemainingCount(CardId.WakingtheDragon,1) > 0)
{
......@@ -2764,7 +2762,7 @@ namespace WindBot.Game.AI.Decks
Logger.DebugWriteLine("EvenlyMatched: min=" + min.ToString() + ", max=" + max.ToString());
}
else if (cards[0].Location == CardLocation.Hand && cards[cards.Count - 1].Location == CardLocation.Hand
&& (hint == 501 || hint == HIINT_TOGRAVE) && min == max)
&& (hint == HintMsg.Discard || hint == HintMsg.ToGrave) && min == max)
{
if (Duel.LastChainPlayer == 0 && Util.GetLastChainCard().IsCode(CardId.OneForOne)) return null;
Logger.DebugWriteLine("Hand drop except OneForOne");
......
......@@ -20,7 +20,7 @@ namespace WindBot.Game.AI.Decks
{
AddExecutor(ExecutorType.SpSummon);
AddExecutor(ExecutorType.Activate, DefaultDontChainMyself);
AddExecutor(ExecutorType.SummonOrSet);
AddExecutor(ExecutorType.SummonOrSet, DefaultMonsterSummon);
AddExecutor(ExecutorType.Repos, DefaultMonsterRepos);
AddExecutor(ExecutorType.SpellSet);
}
......
This diff is collapsed.
......@@ -83,18 +83,10 @@ namespace WindBot.Game.AI.Decks
private int m_swapFrogSummoned;
private int m_flipFlopFrogSummoned;
private int m_treebornFrogCount = 0;
public override void OnNewTurn()
{
m_treebornFrogCount = 0;
base.OnNewTurn();
}
private bool TreebornFrog()
{
m_treebornFrogCount++;
return m_treebornFrogCount <= 5;
return true;
}
private bool SwapFrogSummon()
......
......@@ -56,7 +56,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.MonsterReborn, MonsterReborn);
AddExecutor(ExecutorType.Summon, CardId.WhiteNightDragon, WhiteNightDragon);
AddExecutor(ExecutorType.Summon, CardId.HorusTheBlackFlameDragonLv6, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, CardId.HorusTheBlackFlameDragonLv6, DefaultMonsterSummon);
AddExecutor(ExecutorType.Summon, CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.AxeDragonute);
AddExecutor(ExecutorType.SummonOrSet, CardId.DodgerDragon);
......@@ -157,7 +157,7 @@ namespace WindBot.Game.AI.Decks
if (card.IsCode(11224103))
return false;
return DefaultTributeSummon();
return DefaultMonsterSummon();
}
private bool HorusTheBlackFlameDragonLv8()
......
......@@ -184,7 +184,6 @@ namespace WindBot.Game.AI.Decks
private bool JetSynchronUsed = false;
private bool ScrapWyvernUsed = false;
private bool MaskedChameleonUsed = false;
private int ShootingRiserDragonCount = 0;
private int[] HandCosts = new[]
{
......@@ -218,7 +217,6 @@ namespace WindBot.Game.AI.Decks
JetSynchronUsed = false;
ScrapWyvernUsed = false;
MaskedChameleonUsed = false;
ShootingRiserDragonCount = 0;
}
public override void OnChainEnd()
......@@ -845,9 +843,8 @@ namespace WindBot.Game.AI.Decks
}
else
{
if (Duel.LastChainPlayer == 0 || ShootingRiserDragonCount >= 10)
if (Duel.LastChainPlayer == 0)
return false;
ShootingRiserDragonCount++;
AI.SelectCard(new[] {
CardId.BlackRoseMoonlightDragon,
CardId.ScrapDragon,
......
This diff is collapsed.
......@@ -46,8 +46,8 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.SwordsOfRevealingLight, SwordsOfRevealingLight);
AddExecutor(ExecutorType.Activate, CardId.DoubleSummon, DoubleSummon);
AddExecutor(ExecutorType.Summon, CardId.AncientGearGolem, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, CardId.Frostosaurus, DefaultTributeSummon);
AddExecutor(ExecutorType.Summon, CardId.AncientGearGolem, DefaultMonsterSummon);
AddExecutor(ExecutorType.Summon, CardId.Frostosaurus, DefaultMonsterSummon);
AddExecutor(ExecutorType.SummonOrSet, CardId.AlexandriteDragon);
AddExecutor(ExecutorType.SummonOrSet, CardId.GeneWarpedWarwolf);
AddExecutor(ExecutorType.MonsterSet, CardId.GearGolemTheMovingFortress);
......
......@@ -181,7 +181,6 @@ namespace WindBot.Game.AI.Decks
private bool CymbalSkeletonUsed = false;
private bool BorrelswordDragonUsed = false;
private ClientCard RustyBardicheTarget = null;
private int ShootingRiserDragonCount = 0;
private int[] HandCosts = new[]
{
......@@ -215,7 +214,6 @@ namespace WindBot.Game.AI.Decks
CymbalSkeletonUsed = false;
BorrelswordDragonUsed = false;
RustyBardicheTarget = null;
ShootingRiserDragonCount = 0;
}
public override void OnChainEnd()
......@@ -611,10 +609,7 @@ namespace WindBot.Game.AI.Decks
}
else
{
if (Duel.LastChainPlayer == 0)
return false;
ShootingRiserDragonCount++;
return ShootingRiserDragonCount <= 10;
return Duel.LastChainPlayer != 0;
}
}
......@@ -825,8 +820,8 @@ namespace WindBot.Game.AI.Decks
if (ActivateDescription == 96)
{
// TODO: more FogBlade lost target
if ((Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2) && Duel.CurrentChain.Count == 0)
return false;
if ((Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2) && Duel.CurrentChain.Count == 0)
return false;
AI.SelectCard(CardId.OrcustCymbalSkeleton);
return true;
}
......@@ -1130,22 +1125,22 @@ namespace WindBot.Game.AI.Decks
{
return Duel.LastChainPlayer == 1;
}
else if (Duel.Phase == DuelPhase.End)
{
ClientCard target = null;
target = Bot.Banished.GetFirstMatchingFaceupCard(card=>card.IsCode(CardId.OrcustCymbalSkeleton));
if (target == null)
target = Bot.Banished.GetFirstMatchingFaceupCard(card => card.IsCode(CardId.OrcustHarpHorror));
if (target != null)
{
AI.SelectCard(target);
return true;
}
if(!Bot.HasInHand(CardId.OrcustHarpHorror) && Bot.GetRemainingCount(CardId.OrcustHarpHorror, 2) > 1)
{
AI.SelectCard(CardId.OrcustHarpHorror);
return true;
}
else if (Duel.Phase == DuelPhase.End)
{
ClientCard target = null;
target = Bot.Banished.GetFirstMatchingFaceupCard(card=>card.IsCode(CardId.OrcustCymbalSkeleton));
if (target == null)
target = Bot.Banished.GetFirstMatchingFaceupCard(card => card.IsCode(CardId.OrcustHarpHorror));
if (target != null)
{
AI.SelectCard(target);
return true;
}
if(!Bot.HasInHand(CardId.OrcustHarpHorror) && Bot.GetRemainingCount(CardId.OrcustHarpHorror, 2) > 1)
{
AI.SelectCard(CardId.OrcustHarpHorror);
return true;
}
}
return false;
}
......
......@@ -117,13 +117,11 @@ namespace WindBot.Game.AI.Decks
bool summon_used = false;
bool CardOfDemiseeff_used = false;
bool SeaStealthAttackeff_used = false;
int City_count = 0;
public override void OnNewTurn()
{
summon_used = false;
CardOfDemiseeff_used = false;
SeaStealthAttackeff_used = false;
City_count = 0;
base.OnNewTurn();
}
private bool PreventFeatherDustereff()
......@@ -356,9 +354,6 @@ namespace WindBot.Game.AI.Decks
}
else
{
if (City_count > 10)
return false;
ClientCard target = null;
foreach(ClientCard s in Bot.GetSpells())
{
......@@ -380,7 +375,6 @@ namespace WindBot.Game.AI.Decks
break;
}
}
City_count++;
AI.SelectPlace(Zones.z1 | Zones.z3);
AI.SelectCard(CardId.PhantasmSprialBattle);
return true;
......
......@@ -215,8 +215,7 @@ namespace WindBot.Game.AI.Decks
private bool Summon_used;
private bool Pilica_eff;
private bool plan_A;
private int SnowBell_count = 0;
//TODO: reset the flags when they should reset ( public override void OnNewTurn() )
public PureWindsExecutor(GameAI ai, Duel duel)
: base(ai, duel)
{
......@@ -302,7 +301,6 @@ namespace WindBot.Game.AI.Decks
Summon_used = false;
Pilica_eff = false;
plan_A = false;
SnowBell_count = 0;
base.OnNewTurn();
}
private bool windaset()
......@@ -770,7 +768,6 @@ namespace WindBot.Game.AI.Decks
private bool WindwitchSnowBellsp()
{
if (SnowBell_count >= 5) return false;
if ((Bot.HasInMonstersZone(CardId.CrystalWingSynchroDragon) ||
Bot.HasInMonstersZone(CardId.DaigustoSphreez) ||
Bot.HasInMonstersZone(CardId.MistWurm)) &&
......@@ -786,7 +783,6 @@ namespace WindBot.Game.AI.Decks
(Util.GetBotAvailZonesFromExtraDeck() == 0))
return false;
AI.SelectPosition(CardPosition.FaceUpDefence);
SnowBell_count++;
return true;
}
private bool DaigustoSphreezsp()
......
This diff is collapsed.
......@@ -73,7 +73,6 @@ namespace WindBot.Game.AI.Decks
bool snake_four_s = false;
bool tuner_eff_used = false;
bool crystal_eff_used = false;
int red_ss_count = 0;
bool white_eff_used = false;
bool lockbird_useful = false;
bool lockbird_used = false;
......@@ -758,7 +757,6 @@ namespace WindBot.Game.AI.Decks
public bool Red_ss()
{
if (red_ss_count >= 6) return false;
if ((Util.ChainContainsCard(CardId.DarkHole) || Util.ChainContainsCard(99330325) || Util.ChainContainsCard(53582587)) && Util.ChainContainsCard(CardId.Red)) return false;
if (Duel.LastChainPlayer == 0 && Util.GetLastChainCard().IsCode(CardId.Red))
{
......@@ -766,7 +764,6 @@ namespace WindBot.Game.AI.Decks
{
if (Util.IsChainTarget(m) && IsTrickstar(m.Id))
{
red_ss_count += 1;
AI.SelectCard(m);
Red_SelectPos();
return true;
......@@ -789,7 +786,6 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(c);
Red_SelectPos(c);
red_ss_count += 1;
return true;
}
if (c.IsCode(CardId.Pink)) return false;
......@@ -800,14 +796,12 @@ namespace WindBot.Game.AI.Decks
if (tosolve_enemy.Attack > 3200) AI.SelectPosition(CardPosition.FaceUpDefence);
AI.SelectCard(c);
Red_SelectPos(c);
red_ss_count += 1;
return true;
}
if (!Bot.HasInHand(CardId.White) && tosolve_enemy.Attack <= 3200 && c.IsCode(CardId.White))
{
AI.SelectCard(c);
Red_SelectPos(c);
red_ss_count += 1;
return true;
}
if (!Bot.HasInHand(CardId.White) && c.Attack < tosolve_enemy.Attack)
......@@ -824,7 +818,6 @@ namespace WindBot.Game.AI.Decks
if (tosolve_enemy.Attack > 1600) AI.SelectPosition(CardPosition.FaceUpDefence);
AI.SelectCard(c);
Red_SelectPos(c);
red_ss_count += 1;
return true;
}
}
......@@ -845,7 +838,6 @@ namespace WindBot.Game.AI.Decks
{
AI.SelectCard(card);
Red_SelectPos(card);
red_ss_count += 1;
return true;
}
}
......@@ -1710,7 +1702,6 @@ namespace WindBot.Game.AI.Decks
pink_ss = false;
snake_four_s = false;
crystal_eff_used = false;
red_ss_count = 0;
white_eff_used = false;
lockbird_useful = false;
lockbird_used = false;
......
......@@ -197,7 +197,6 @@ namespace WindBot.Game.AI.Decks
bool MagicianRightHand_used = false;
ClientCard MagiciansLeftHand_negate = null;
ClientCard MagicianRightHand_negate = null;
int PSYOmega_count = 0;
// go first
public override bool OnSelectHand()
......@@ -271,7 +270,6 @@ namespace WindBot.Game.AI.Decks
public override void OnNewTurn()
{
CrossoutDesignatorTarget = 0;
PSYOmega_count = 0;
MadameVerreGainedATK = false;
summoned = false;
enemy_activate_MaxxC = false;
......@@ -311,8 +309,8 @@ namespace WindBot.Game.AI.Decks
// overwrite OnSelectCard to act normally in SelectUnselect
public override IList<ClientCard> OnSelectCard(IList<ClientCard> cards, int min, int max, int hint, bool cancelable)
{
// Patronus HINTMSG_ATOHAND
if (hint == 506)
// Patronus
if (hint == HintMsg.AddToHand)
{
bool flag = true;
foreach(ClientCard card in cards)
......@@ -336,8 +334,8 @@ namespace WindBot.Game.AI.Decks
return selected;
}
}
// MaxxC HINTMSG_SPSUMMON
if (hint == 509 && enemy_activate_MaxxC)
// MaxxC solution
if (hint == HintMsg.SpSummon && enemy_activate_MaxxC)
{
// check whether SS from deck while using effect
bool flag = true;
......@@ -394,8 +392,8 @@ namespace WindBot.Game.AI.Decks
}
}
}
// MadameVerre HINTMSG_CONFIRM
if (hint == 526)
// MadameVerre
if (hint == HintMsg.Confirm)
{
Logger.DebugWriteLine("** min-max: " + min.ToString() + " / " + max.ToString());
foreach (ClientCard card in cards)
......@@ -2501,20 +2499,15 @@ namespace WindBot.Game.AI.Decks
// recycle from grave
if (Card.Location == CardLocation.Grave)
{
if (PSYOmega_count >= 5){
return false;
}
List<ClientCard> enemy_danger = CheckDangerousCardinEnemyGrave();
if (enemy_danger.Count > 0)
{
AI.SelectCard(enemy_danger);
PSYOmega_count ++;
return true;
}
if (!Bot.HasInHandOrInSpellZoneOrInGraveyard(CardId.Holiday) && Bot.HasInGraveyard(important_witchcraft))
{
AI.SelectCard(important_witchcraft);
PSYOmega_count ++;
return true;
}
if (CheckProblematicCards() == null)
......@@ -2523,7 +2516,6 @@ namespace WindBot.Game.AI.Decks
CardId.MaxxC, CardId.AshBlossom_JoyousSpring,
CardId.MagicianRightHand, CardId.MagiciansLeftHand, CardId.MagiciansRestage, CardId.Patronus,
CardId.LightningStorm, CardId.Reasoning);
PSYOmega_count ++;
return true;
}
}
......
......@@ -100,6 +100,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Summon, CardId.Goblindbergh);
AddExecutor(ExecutorType.Summon, CardId.TinGoldfish);
AddExecutor(ExecutorType.Summon, CardId.SummonerMonk);
AddExecutor(ExecutorType.Summon, CardId.Honest);
// Summons: Effects
AddExecutor(ExecutorType.Activate, CardId.Goblindbergh, GoblindberghEffect);
......@@ -122,13 +123,6 @@ namespace WindBot.Game.AI.Decks
AddExecutor(ExecutorType.Activate, CardId.SolemnStrike, DefaultSolemnStrike);
}
private int ZwCount = 0;
public override void OnNewTurn()
{
ZwCount = 0;
}
public override bool OnSelectHand()
{
return false;
......@@ -177,8 +171,7 @@ namespace WindBot.Game.AI.Decks
private bool ZwWeapon()
{
ZwCount++;
return ZwCount < 10;
return true;
}
private bool ReinforcementOfTheArmy()
......
......@@ -47,7 +47,6 @@ namespace WindBot.Game.AI.Decks
bool TigermortarSpsummoned = false;
bool ChakanineSpsummoned = false;
bool BroadbullSpsummoned = false;
int WhiptailEffectCount = 0;
public ZoodiacExecutor(GameAI ai, Duel duel)
: base(ai, duel)
......@@ -128,7 +127,6 @@ namespace WindBot.Game.AI.Decks
TigermortarSpsummoned = false;
ChakanineSpsummoned = false;
BroadbullSpsummoned = false;
WhiptailEffectCount = 0;
}
public override bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
......@@ -431,7 +429,7 @@ namespace WindBot.Game.AI.Decks
{
if (Duel.Phase == DuelPhase.Main1 || Duel.Phase == DuelPhase.Main2)
return false;
if (Card.IsDisabled() || WhiptailEffectCount >= 3)
if (Card.IsDisabled())
return false;
ClientCard target = null;
List<ClientCard> monsters = Bot.GetMonsters();
......@@ -461,7 +459,6 @@ namespace WindBot.Game.AI.Decks
CardId.Drident
});
}
WhiptailEffectCount++;
return true;
}
......
This diff is collapsed.
......@@ -59,7 +59,7 @@ namespace WindBot.Game.AI
_game = game;
DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DialogsData));
string dialogfilename = game.Dialog;
using (FileStream fs = File.OpenRead("Dialogs/" + dialogfilename + ".json"))
using (FileStream fs = Program.ReadFile("Dialogs", dialogfilename, "json"))
{
DialogsData data = (DialogsData)serializer.ReadObject(fs);
_welcome = data.welcome;
......
namespace WindBot.Game.AI.Enums
{
/// <summary>
/// Cards that are invincible to battle and should always attack to use effect.
/// </summary>
public enum InvincibleBotMonster
{
YubelTheUltimateNightmare = 31764700,
YubelTerrorIncarnate = 4779091,
SandaionTheTimelord = 33015627,
GabrionTheTimelord = 6616912,
MichionTheTimelord = 7733560,
ZaphionTheTimelord = 28929131,
HailonTheTimelord = 34137269,
RaphionTheTimelord = 60222213,
SadionTheTimelord = 65314286,
MetaionTheTimelord = 74530899,
KamionTheTimelord = 91712985,
LazionTheTimelord = 92435533,
TimelordProgenitorVorpgate = 67508932,
RocketWarrior = 30860696,
GoDDDDivineZeroKingRage = 40227329,
BloomDivaTheMelodiousChoir = 84988419,
BlackwingArmorMaster = 69031175,
DaigustoSphreez = 29552709,
Number92HearteartHDragon = 97403510,
NumberC96DarkStorm = 77205367,
Number54LionHeart = 54366836
}
/// <summary>
/// Cards that are invincible to battle.
/// </summary>
public enum InvincibleMonster
public enum InvincibleEnemyMonster
{
SpiritReaper = 23205979,
YubelTheUltimateNightmare = 31764700,
......
......@@ -73,13 +73,19 @@ namespace WindBot.Game.AI
public virtual BattlePhaseAction OnSelectAttackTarget(ClientCard attacker, IList<ClientCard> defenders)
{
// Overrided in DefalultExecutor
// Overrided in DefaultExecutor
return null;
}
public virtual bool OnPreBattleBetween(ClientCard attacker, ClientCard defender)
{
// Overrided in DefalultExecutor
// Overrided in DefaultExecutor
return true;
}
public virtual bool OnPreActivate(ClientCard card)
{
// Overrided in DefaultExecutor
return true;
}
......@@ -178,13 +184,23 @@ namespace WindBot.Game.AI
public virtual CardPosition OnSelectPosition(int cardId, IList<CardPosition> positions)
{
// Overrided in DefalultExecutor
// Overrided in DefaultExecutor
return 0;
}
public virtual bool OnSelectBattleReplay()
{
// Overrided in DefalultExecutor
// Overrided in DefaultExecutor
return false;
}
/// <summary>
/// Called when the executor type is SummonOrSet
/// </summary>
/// <returns>True if select to set the monster.</returns>
public virtual bool OnSelectMonsterSummonOrSet(ClientCard card)
{
// Overrided in DefaultExecutor
return false;
}
......
namespace WindBot.Game.AI
{
public static class HintMsg
{
public const int Release = 500,
Discard = 501,
Destroy = 502,
Remove = 503,
ToGrave = 504,
ReturnToHand = 505,
AddToHand = 506,
ToDeck = 507,
Summon = 508,
SpSummon = 509,
Set = 510,
FusionMaterial = 511,
SynchroMaterial = 512,
XyzMaterial = 513,
Faceup = 514,
Facedown = 515,
Attack = 516,
Defense = 517,
Equip = 518,
RemoveXyz = 519,
Control = 520,
DestroyReplace = 521,
FaceupAttack = 522,
FaceupDefense = 523,
FacedownAttack = 524,
FacedownDefense = 525,
Confirm = 526,
ToField = 527,
PosChange = 528,
Self = 529,
Oppo = 530,
Tribute = 531,
DeattachFrom = 532,
LinkMaterial = 533,
AttackTarget = 549,
Effect = 550,
Target = 551,
Coin = 552,
Dice = 553,
CardType = 554,
Option = 555,
ResolveEffect = 556,
Select = 560,
Position = 561,
Attribute = 562,
Race = 563,
Code = 564,
Number = 565,
LvRank = 567,
ResolveCard = 568,
Zone = 569,
DisableZone = 570,
ToZone = 571,
Counter = 572,
Disable = 573,
OperateCard = 574;
}
}
\ No newline at end of file
......@@ -32,7 +32,7 @@ namespace WindBot.Game
public int RealPower { get; set; }
public List<int> Overlays { get; private set; }
public int Owner { get; private set; }
public int Controller { get; private set; }
public int Controller { get; set; }
public int Disabled { get; private set; }
public int ProcCompleted { get; private set; }
public int SelectSeq { get; set; }
......
......@@ -43,7 +43,7 @@ namespace WindBot.Game
StreamReader reader = null;
try
{
reader = new StreamReader(new FileStream("Decks/" + name + ".ydk", FileMode.Open, FileAccess.Read));
reader = new StreamReader(Program.ReadFile("Decks", name, "ydk"));
Deck deck = new Deck();
bool side = false;
......
......@@ -96,30 +96,8 @@ namespace WindBot.Game
public void AddCard(CardLocation loc, int cardId, int player, int seq, int pos)
{
switch (loc)
{
case CardLocation.Hand:
Fields[player].Hand.Add(new ClientCard(cardId, loc, -1, pos));
break;
case CardLocation.Grave:
Fields[player].Graveyard.Add(new ClientCard(cardId, loc,-1, pos));
break;
case CardLocation.Removed:
Fields[player].Banished.Add(new ClientCard(cardId, loc, -1, pos));
break;
case CardLocation.MonsterZone:
Fields[player].MonsterZone[seq] = new ClientCard(cardId, loc, seq, pos);
break;
case CardLocation.SpellZone:
Fields[player].SpellZone[seq] = new ClientCard(cardId, loc, seq, pos);
break;
case CardLocation.Deck:
Fields[player].Deck.Add(new ClientCard(cardId, loc, -1, pos));
break;
case CardLocation.Extra:
Fields[player].ExtraDeck.Add(new ClientCard(cardId, loc, -1, pos));
break;
}
ClientCard card = new ClientCard(cardId, loc, seq, pos);
AddCard(loc, card, player, seq, pos, cardId);
}
public void AddCard(CardLocation loc, ClientCard card, int player, int seq, int pos, int id)
......@@ -127,6 +105,7 @@ namespace WindBot.Game
card.Location = loc;
card.Sequence = seq;
card.Position = pos;
card.Controller = player;
card.SetId(id);
switch (loc)
{
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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