public static int Main(string[] args) { using (var facade = new GameLauncherFacade()) { try { facade.Logging += (sender, e) => Console.WriteLine("[{0}] {1}", e.Level, e.Message); facade.Initialize(); Console.WriteLine("Testing Arena game..."); var result = facade.PlayArenaGame( deck1: "凤凰", deck2: "凤凰", heroLv1: 50, heroLv2: 50, p1CardAtBuff: 100, // 玩家1的卡牌攻击BUFF,百分比数 p1CardHpBuff: 100, // 玩家1的卡牌体力BUFF,百分比数 p1HeroHpBuff: 100, // 玩家1的英雄体力BUFF,百分比数 p2CardAtBuff: 100, // 玩家2的卡牌攻击BUFF,百分比数 p2CardHpBuff: 100, // 玩家2的卡牌体力BUFF,百分比数 p2HeroHpBuff: 100, // 玩家2的英雄体力BUFF,百分比数 firstAttack: FirstAttack.Player1, deckOrder: DeckOrder.Random, vc1Text: "Any", // 玩家1的特殊胜利条件设置,参见http://www.mkhx.cc#help gameCount: 10 ); Console.WriteLine("ValidationResult: {0}", result.ValidationResult); Console.WriteLine("Player1Win: {0}", result.Player1Win); Console.WriteLine("Player2Win: {0}", result.Player2Win); Console.WriteLine("================"); Console.WriteLine("Testing Boss game..."); var bossGameResult = facade.PlayBossGame( playerDeck: "凤凰*10", bossName: "网页版复仇女神", // 魔神名字参见http://www.mkhx.cc#boss-battle,包括各个版本的不同魔神 heroLv: 50, kingdomBuff: 10, // 玩家王国军团种族加成等级 forestBuff: 10, // 玩家森林军团种族加成等级 savageBuff: 10, // 玩家蛮荒军团种族加成等级 hellBuff: 10, // 玩家地狱军团种族加成等级 guardType: BossGuardType.NormalGuard, gameCount: 20 ); Console.WriteLine("ValidationResult: {0}", bossGameResult.ValidationResult); Console.WriteLine("Average Damage: {0}", bossGameResult.AvgDamage); Console.WriteLine("Damage CV: {0}", bossGameResult.CvDamage); Console.WriteLine("================"); Console.WriteLine("Testing Map game..."); var mapGameResult = facade.playMapGame( playerDeck: "精灵法师*12", mapName: "5-5-3", heroLv: 50, gameCount: 100); Console.WriteLine("ValidationResult: {0}", mapGameResult.ValidationResult); Console.WriteLine("WinCount: {0}", mapGameResult.WinCount); Console.WriteLine("AdvWinCount: {0}", mapGameResult.AdvWinCount); Console.WriteLine("================"); Console.WriteLine("Testing Lilith game..."); var lilithGameResult = facade.playLilithGame( playerDeck: "凤凰*10", lilithName: "困难莉莉丝+陷阱3", // 莉莉丝识别名,使用【<难度>莉莉丝+<第四技能>】的形式 heroLv: 50, gameType: LilithGameType.RushBoss, remainingGuard: 5, // 清兵模式下指定清到还剩几个敌方卡牌为止(包括莉莉丝),设置为0表示清兵+尾刀 remainingHp: 5000, // 尾刀模式下指定莉莉丝剩余体力 eventCardNames: "凤凰,金属巨龙", // 以半角逗号分隔的活动卡牌名称列表 gameCount: 100); Console.WriteLine("ValidationResult: {0}", lilithGameResult.ValidationResult); Console.WriteLine("AvgBattleCount: {0}", lilithGameResult.AvgBattleCount); Console.WriteLine("AvgDamageToLilith: {0}", lilithGameResult.AvgDamageToLilith); Console.WriteLine("================"); Console.WriteLine("Testing custom Lilith game..."); var customLilithGameResult = facade.playCustomLilithGame( playerDeck: "凤凰*10", lilithDeck: "困难莉莉丝+法力反射10,金属巨龙+弱点攻击9", heroLv: 50, lilithCardAtBuff: 150, lilithCardHpBuff: 150, gameType: LilithGameType.ClearGuards, remainingGuard: 1, remainingHp: 0, eventCardNames: "凤凰", gameCount: 50 ); Console.WriteLine("ValidationResult: {0}", customLilithGameResult.ValidationResult); Console.WriteLine("AvgBattleCount: {0}", customLilithGameResult.AvgBattleCount); Console.WriteLine("AvgDamageToLilith: {0}", customLilithGameResult.AvgDamageToLilith); Console.WriteLine("================"); return 0; } catch (System.Exception e) { Console.WriteLine(e.ToString() + e.StackTrace); return 1; } } }