public P_BaiQi() : base("白起") { Sex = PSex.Male; Age = PAge.Classic; Index = 9; Cost = 25; Tips = "定位:爆发\n" + "难度:简单\n" + "史实:战国时期秦国名将,“战国四大名将”之一,曾在伊阙之战、长平之战中大败三晋军队,歼敌数十万,功封武安君。\n" + "攻略:\n白起是一个强制命中系武将,白起的存在使得对方无法通过【李代桃僵】、【指桑骂槐】一类的牌免除伤害,或通过【八卦阵】、【龙胆】等方式减少伤害,而必须硬吃下伤害的100%(通常这个数字比伤害值高)。随之带来的损失则是收费地的地价永久性减少,很多时候这是不值的,但在必杀一击上,白起一点都不会含糊。"; PSkill CanSha = new PSkill("残杀"); SkillList.Add(CanSha .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(CanSha.Name) { IsLocked = false, Player = Player, Time = PTime.Injure.EmitInjure, AIPriority = 100, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return InjureTag.Injure > 0 && InjureTag.ToPlayer != null && Player.Equals(InjureTag.FromPlayer) && InjureTag.InjureSource is PBlock && ((PBlock)InjureTag.InjureSource).Price >= 1000; }, AICondition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); if (InjureTag.ToPlayer.TeamIndex != Player.TeamIndex) { int Benefit = PMath.Percent(InjureTag.Injure, 100); if (Benefit + InjureTag.Injure >= InjureTag.ToPlayer.Money) { // 一击必杀 return true; } if (Benefit >= 2000) { PBlock Source = (PBlock)InjureTag.InjureSource; int Cost = 1000 + PAiMapAnalyzer.HouseValue(Game, Player, Source) * Source.HouseNumber * 1000 / Source.Price; if (Cost < Benefit) { return true; } } } return false; }, Effect = (PGame Game) => { CanSha.AnnouceUseSkill(Player); PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); PBlock Source = (PBlock)InjureTag.InjureSource; Source.Price -= 1000; PNetworkManager.NetworkServer.TellClients(new PRefreshBlockBasicOrder(Source)); Game.LoseMoney(InjureTag.ToPlayer, PMath.Percent(InjureTag.Injure, 100)); } }); })); }
public P_PaiHuaChooon() : base(CardName, PCardType.DefensorCard) { Point = 2; Index = 50; foreach (PTime Time in new PTime[] { PTime.Injure.AcceptInjure }) { MoveInEquipTriggerList.Add((PPlayer Player, PCard Card) => { return(new PTrigger(CardName) { IsLocked = false, Player = Player, Time = Time, AIPriority = 150, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return Player.Equals(InjureTag.ToPlayer) && InjureTag.Injure > 0 && InjureTag.FromPlayer != null && !InjureTag.FromPlayer.Sex.Equals(Player.Sex); }, AICondition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return InjureTag.Injure > 500; }, Effect = (PGame Game ) => { AnnouceUseEquipmentSkill(Player); PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); InjureTag.Injure = PMath.Percent(InjureTag.Injure, 50); } }); }); } }
public static List <int> DirectionExpectations(PGame Game, PPlayer Player, PBlock Block) { /* * AI决策商业用地类型的机制: * 购物中心收益:2*(40%*max(1,20*建房次数上限/环长)+20%)*地价*敌方人数 * 研究所收益 :牌堆期望收益*2*己方人数 * 公园收益 :(max(1,20*建房次数上限/环长)*60%+50%)*地价 * 城堡收益 :(50%+敌方人数*20%)*赠送房屋数量*地价 * 当铺收益 :2000*己方人数 * * 特殊计算: * 杨玉环:研究所+4000 */ int RingLength = PAiMapAnalyzer.GetRingLength(Game, Block); int MaxOperationCount = Player.PurchaseLimit; int MikuBias = (Player.General is P_IzayoiMiku && Player.RemainLimit("轮舞曲")) ? 1 : 0; int ShoppingCenterExpectation = 2 * PMath.Percent(Block.Price, 40 * Math.Max(1, 20 * MaxOperationCount / RingLength) + 20) * Game.Enemies(Player).Count; int InsituteExpectation = 2000 * 2 * Game.Teammates(Player).Count; int ParkExpectation = PMath.Percent(Block.Price, 60 * Math.Max(1, 20 * MaxOperationCount / RingLength) + 50); int CastleExpectation = Game.Enemies(Player).Exists((PPlayer _Player) => _Player.Money > 3000 && _Player.Weapon != null && _Player.Weapon.Model is P_ToouShihChi) ? 0: PMath.Percent(Block.Price, 50 + 20 * Game.Enemies(Player).Count) * Game.GetBonusHouseNumberOfCastle(Player, Block); if (MikuBias == 1 && Game.GetBonusHouseNumberOfCastle(Player, Block) >= PMath.Max(Game.Map.BlockList.FindAll((PBlock _Block) => _Block.IsBusinessLand && _Block.Lord != null && _Block.Lord.TeamIndex == Player.TeamIndex).ConvertAll((PBlock _Block) => _Block.HouseNumber))) { CastleExpectation = PMath.Percent(Block.Price, 50 + 40 * Game.Enemies(Player).Count) * Game.GetBonusHouseNumberOfCastle(Player, Block); } int PawnshopExpectation = 2000 * Game.Teammates(Player).Count; int AltarExpectation = 1000 * 20 * 6 / RingLength * Game.Enemies(Player).Count; if (Player.General is P_YangYuHuan) { InsituteExpectation += 4000; } if (Player.General is P_Xdyu || Player.General is P_Gryu) { ShoppingCenterExpectation += 4000; } List <int> ExpectationList = new List <int>() { ShoppingCenterExpectation, InsituteExpectation, ParkExpectation, CastleExpectation, AltarExpectation }; return(ExpectationList); }
public void PurchaseLand(PPlayer Player, PBlock Block) { PPurchaseLandTag PurchaseLandTag = Monitor.CallTime(PTime.PurchaseLandTime, new PPurchaseLandTag(Player, Block)); Player = PurchaseLandTag.Player; Block = PurchaseLandTag.Block; int LandPrice = PurchaseLandTag.LandPrice; if (Player != null && Block != null && Player.IsAlive) { LoseMoney(Player, LandPrice); Block.Lord = Player; GetHouse(Block, 1); PNetworkManager.NetworkServer.TellClients(new PRefreshBlockBasicOrder(Block)); if (Block.IsBusinessLand && Block.BusinessType.Equals(PBusinessType.NoType)) { PBusinessType ChosenType = PBusinessType.NoType; List <PBusinessType> Types = new List <PBusinessType>() { PBusinessType.ShoppingCenter, PBusinessType.Institute, PBusinessType.Altar, PBusinessType.Castle, PBusinessType.Park }; if (Player.IsUser) { ChosenType = Types[PNetworkManager.NetworkServer.ChooseManager.Ask(Player, "选择商业用地的发展方向", Types.ConvertAll((PBusinessType BusinessType) => BusinessType.Name).ToArray(), Types.ConvertAll((PBusinessType BusinessType) => BusinessType.ToolTip).ToArray())]; } else { ChosenType = PAiBusinessChooser.ChooseDirection(this, Player, Block); } Block.BusinessType = ChosenType; if (ChosenType.Equals(PBusinessType.Park)) { GetMoney(Player, PMath.Percent(Block.Price, 50)); } else if (ChosenType.Equals(PBusinessType.Castle)) { GetHouse(Block, GetBonusHouseNumberOfCastle(Player, Block)); } PNetworkManager.NetworkServer.TellClients(new PRefreshBlockBasicOrder(Block)); } else { Block.BusinessType = PBusinessType.NoType; } PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder(Player.Name + "购买了" + Block.Name)); } }
public P_PaKuaChevn() : base(CardName, PCardType.DefensorCard) { Point = 1; Index = 49; foreach (PTime Time in new PTime[] { PTime.Injure.AcceptInjure }) { MoveInEquipTriggerList.Add((PPlayer Player, PCard Card) => { return(new PTrigger(CardName) { IsLocked = false, Player = Player, Time = Time, AIPriority = 150, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return Player.Equals(InjureTag.ToPlayer) && InjureTag.Injure > 0; }, AICondition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); if (InjureTag.FromPlayer != null && InjureTag.FromPlayer.General is P_IzayoiMiku && Player.General is P_Gabriel) { return false; } return InjureTag.Injure > 500 || Player.General is P_LiuJi; }, Effect = (PGame Game ) => { AnnouceUseEquipmentSkill(Player); PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); int Result = Game.Judge(Player, InjureTag.Injure > 500 ? 5 : 6); if (Result % 2 == 1) { PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder(CardName + ":成功")); InjureTag.Injure = PMath.Percent(InjureTag.Injure, 50); } else { PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder(CardName + ":失败")); } } }); }); } }
public static int HouseValue(PGame Game, PPlayer Player, PBlock Block) { if (Block.Lord == null) { return(0); } int EnemyCount = Game.Enemies(Block.Lord).Count; int Value = PMath.Percent(Block.Price, 50 + 20 * EnemyCount * (Block.BusinessType.Equals(PBusinessType.ShoppingCenter) ? 2 : 1) * (Block.BusinessType.Equals(PBusinessType.Club) ? 2 : 1)); if (Player.TeamIndex == Block.Lord.TeamIndex) { return(Value); } else { return(-Value); } }
public P_ZhouYu() : base("周瑜") { Sex = PSex.Male; Age = PAge.Medieval; Index = 22; Cost = 25; Tips = "定位:全能\n" + "难度:困难\n" + "史实:东汉末期东吴名将,“东吴四都督”之一。在赤壁之战中以少胜多,大破曹军,奠定了“三分天下”的基础。\n" + "攻略:\n周瑜是一名集续航、辅助、控制于一体的武将。【英姿】作为强大的续航技能,能够大大提高自己的生存能力。【纵火】是使用周瑜的难点所在,需要较强的局势判断能力。前期【纵火】的使用往往倾向于敌方,能够显著降低其输出能力,而后期经过一定房屋的积累或【诸葛连弩】等卡牌的使用,使得对己方使用【纵火】成为了一个选择,而这时也可以对【纵火】过的敌方土地做第二次无损的【纵火】。作为团队的重要辅助位置,周瑜的技能依赖房屋而非卡牌,团队商业用地选择城堡、购物中心或公园,能获取更高的【纵火】收益。"; PSkill YingZi = new PSkill("英姿") { SoftLockOpen = true }; SkillList.Add(YingZi .AddTimeTrigger( new PTime[] { PPeriod.StartTurn.During }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(YingZi.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 100, Condition = (PGame Game) => { return Player.Equals(Game.NowPlayer); }, Effect = (PGame Game) => { YingZi.AnnouceUseSkill(Player); Game.GetMoney(Player, 200); } }); })); PSkill ZongHuo = new PSkill("纵火") { Initiative = true }; SkillList.Add(ZongHuo .AnnounceTurnOnce() .AddTimeTrigger( new PTime[] { PPeriod.FirstFreeTime.During, PPeriod.SecondFreeTime.During }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(ZongHuo.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 180, CanRepeat = true, Condition = (PGame Game) => { return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.RemainLimit(ZongHuo.Name) && Player.Position.HouseNumber > 0 && Player.Position.Lord != null; }, AICondition = (PGame Game) => { int CurrentToll = Player.Position.Toll; int NewToll = PMath.Percent(Player.Position.Price + PMath.Percent(Player.Position.Price, 10), 20 + 40 * (Player.Position.HouseNumber - 1)) * (Player.Position.BusinessType.Equals(PBusinessType.ShoppingCenter) ? 2 : 1) * (Player.Position.BusinessType.Equals(PBusinessType.Club) ? 2 : 1); int Value = NewToll - CurrentToll; return Value * (Player.TeamIndex == Player.Position.Lord.TeamIndex ? 1 : -1) > 0; }, Effect = (PGame Game) => { ZongHuo.AnnouceUseSkill(Player); Game.LoseHouse(Player.Position, 1); Player.Position.Price += PMath.Percent(Player.Position.Price, 10); PNetworkManager.NetworkServer.TellClients(new PRefreshBlockBasicOrder(Player.Position)); ZongHuo.DeclareUse(Player); } }); })); }
public P_ZhaoYun() : base("赵云") { Sex = PSex.Male; Age = PAge.Medieval; Index = 6; Tips = "定位:攻防兼备\n" + "难度:中等\n" + "史实:三国时期蜀汉名将,初从公孙瓒,后随刘备四处征战,曾多次救护后主刘禅,被誉为“一身都是胆”。\n" + "攻略:\n赵云和张三丰相似,都拥有控制伤害的技能。\n赵云的技能是需要消耗房屋的,一般来说,赵云可以把低价值土地上的房屋全部转换成【胆】,而留下几个城堡、购物中心之类的高伤害地点。【胆】的进攻收益和伤害基数有直接关系,留下高伤害地点可以让【胆】的效果有最大的发挥。当然,赵云也要留存一些【胆】来防御敌人的高额伤害。"; PSkill LongDan = new PSkill("龙胆") { Initiative = true }; SkillList.Add(LongDan .AnnounceTurnOnce() .AddTimeTrigger( new PTime[] { PPeriod.FirstFreeTime.During, PPeriod.SecondFreeTime.During }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(LongDan.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 20, CanRepeat = true, Condition = (PGame Game) => { return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.RemainLimit(LongDan.Name) && Player.HasHouse; }, AICondition = (PGame Game) => { PBlock Block = PAiMapAnalyzer.MinValueHouse(Game, Player, false, true).Key; if (Block == null) { return false; } else if (!Player.Tags.ExistTag(PDanTag.TagName)) { return Block.Price <= 2000; } return Block.Price <= 1000; }, Effect = (PGame Game) => { LongDan.AnnouceUseSkill(Player); Game.ThrowHouse(Player, Player, LongDan.Name); Player.Tags.CreateTag(new PDanTag()); LongDan.DeclareUse(Player); } }); }) .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(LongDan.Name + "I") { IsLocked = false, Player = Player, Time = PTime.Injure.EmitInjure, AIPriority = 100, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return Player.Tags.ExistTag(PDanTag.TagName) && InjureTag.Injure > 0 && Player.Equals(InjureTag.FromPlayer) && InjureTag.ToPlayer != null; }, AICondition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return LongDanICondition(Game, Player, InjureTag.ToPlayer, InjureTag.Injure); }, Effect = (PGame Game) => { LongDan.AnnouceUseSkill(Player); Player.Tags.MinusTag(PDanTag.TagName, 1); Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure = PMath.Percent(Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure, 150); } }); }) .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(LongDan.Name + "II") { IsLocked = false, Player = Player, Time = PTime.Injure.AcceptInjure, AIPriority = 100, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return Player.Tags.ExistTag(PDanTag.TagName) && InjureTag.Injure > 0 && Player.Equals(InjureTag.ToPlayer); }, AICondition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return LongDanIICondition(Game, Player, InjureTag.FromPlayer, InjureTag.Injure); }, Effect = (PGame Game) => { LongDan.AnnouceUseSkill(Player); Player.Tags.MinusTag(PDanTag.TagName, 1); Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure = PMath.Percent(Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure, 50); } }); })); }
public static bool LongDanIICondition(PGame Game, PPlayer Player, PPlayer Source, int BaseInjure) { return((BaseInjure >= Player.Money || (BaseInjure - PMath.Percent(BaseInjure, 50)) * (Source == null ? 1 : 2) > PAiMapAnalyzer.MinValueHouse(Game, Player, true).Value + 2000) && (Source == null || Source.TeamIndex != Player.TeamIndex)); }
public static bool LongDanICondition(PGame Game, PPlayer Player, PPlayer Target, int BaseInjure) { return((PMath.Percent(BaseInjure, 150) - BaseInjure) * 2 > PAiMapAnalyzer.MinValueHouse(Game, Player, true).Value + 2000 && (Target.TeamIndex != Player.TeamIndex)); }
public P_IzayoiMiku() : base("诱宵美九") { Sex = PSex.Female; Age = PAge.Industrial; Index = 28; Cost = 50; Tips = "定位:攻击\n" + "难度:简单\n" + "史实:轻小说《约会大作战》中女主角。龙胆寺女子学院学生,歌手,偶像。\n" + "攻略:\n【独奏】可以压制住全部的防御牌,既不能被闪避也不能被减伤,还无法通过【借尸还魂】、【走为上计】自救,一定程度上使得项羽、廉颇、屈原一类的自伤角色不敢铤而走险。贞德的【圣女】能够对【独奏】形成一定程度的克制。如果美九有【古锭刀】,则每一次过路费都触发【古锭刀】技能的效果,从而成为很强的火力点。新版美九的【独奏】无法触发花木兰的【枭姬】,但花木兰仍可以通过【易装】给她【古锭刀】来形成配合。\n美九的团队通常需要建一座城堡来发动【轮舞曲】。如果在未来大概率拿不到新的商业用地的情况下,即使是3级城堡,在【轮舞曲】之后也相当于免费升了2级的购物中心。"; NewGeneral = true; PSkill Solo = new PSkill("独奏"); SkillList.Add(Solo .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(Solo.Name) { IsLocked = false, Player = Player, Time = PTime.Injure.BeforeEmitInjure, AIPriority = 200, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return Player.Equals(InjureTag.FromPlayer) && InjureTag.Injure > 0 && InjureTag.ToPlayer != null && InjureTag.ToPlayer.Area.OwnerCardNumber > 0; }, AICondition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); PPlayer ToPlayer = InjureTag.ToPlayer; return ToPlayer.TeamIndex != Player.TeamIndex || (ToPlayer.General is P_Gabriel); }, Effect = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); PPlayerCardArea ToPlayerArea = InjureTag.ToPlayer.Area; Solo.AnnouceUseSkill(Player); Game.CardManager.MoveAll(ToPlayerArea.HandCardArea, ToPlayerArea.OutOfGameArea); // Game.CardManager.MoveAll(ToPlayerArea.EquipmentCardArea, ToPlayerArea.OutOfGameArea); Player.Tags.CreateTag(new PSoloTag()); } }); }) .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(Solo.Name) { IsLocked = true, Player = Player, Time = PTime.Injure.EndSettle, AIPriority = 200, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return Player.Equals(InjureTag.FromPlayer) && InjureTag.Injure > 0 && InjureTag.ToPlayer != null && Player.Tags.ExistTag(PSoloTag.TagName); }, Effect = (PGame Game) => { Solo.AnnouceUseSkill(Player); PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); PPlayer ToPlayer = InjureTag.ToPlayer; Player.Tags.PopTag <PSoloTag>(PSoloTag.TagName); if (ToPlayer.IsAlive) { Game.CardManager.MoveAll(ToPlayer.Area.OutOfGameArea, ToPlayer.Area.HandCardArea); } else { Game.CardManager.MoveAll(ToPlayer.Area.OutOfGameArea, Player.Area.HandCardArea); PPlayer ExtraTarget = null; int ExtraInjure = PMath.Percent(InjureTag.Injure, 50); if (Player.IsAI) { ExtraTarget = PAiTargetChooser.InjureTarget(Game, Player, Player, PTrigger.Except(Player), ExtraInjure, Solo); } else { ExtraTarget = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.Except(Player), Solo.Name + "[造成" + ExtraInjure.ToString() + "点伤害]", true); } if (ExtraTarget != null) { Game.Injure(Player, ExtraTarget, ExtraInjure, Solo); } } } }); })); PSkill Rando = new PSkill("轮舞曲") { Initiative = true }; SkillList.Add(Rando .AnnounceGameOnce() .AddTimeTrigger( new PTime[] { PPeriod.FirstFreeTime.During, PPeriod.SecondFreeTime.During }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(Rando.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 280, CanRepeat = true, Condition = (PGame Game) => { return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.RemainLimit(Rando.Name) && Game.Map.BlockList.Exists((PBlock Block) => Block.Lord != null && Block.IsBusinessLand); }, AICondition = (PGame Game) => { PBlock MaxHouseBlock = PMath.Max(Game.Map.BlockList.FindAll((PBlock Block) => Block.Lord != null && Block.IsBusinessLand && Block.Lord.TeamIndex == Player.TeamIndex && !Block.BusinessType.Equals(PBusinessType.ShoppingCenter)), (PBlock Block) => Block.HouseNumber, true).Key; if (MaxHouseBlock == null) { return false; } int ClubBonus = PMath.Percent(MaxHouseBlock.Price, 40) * Game.Enemies(Player).Count *MaxHouseBlock.HouseNumber; if (MaxHouseBlock.BusinessType.Equals(PBusinessType.Institute)) { ClubBonus -= 4000 * Game.Teammates(Player).Count; } int TeammateCardBonus = -2000 * PMath.Sum(Game.Teammates(Player, false).ConvertAll((PPlayer _Player) => Math.Min(2, _Player.Area.HandCardArea.CardNumber))); int EnemyCardBonus = 2000 * PMath.Sum(Game.Enemies(Player).ConvertAll((PPlayer _Player) => Math.Min(2, _Player.Area.HandCardArea.CardNumber))); int SumBonus = ClubBonus + TeammateCardBonus + EnemyCardBonus; return SumBonus >= 8000 * (1 + Game.Map.BlockList.FindAll((PBlock _Block) => _Block.IsBusinessLand && _Block.Lord == null).Count); }, Effect = (PGame Game) => { Rando.AnnouceUseSkill(Player); Game.Traverse((PPlayer _Player) => { if (_Player != Player) { for (int i = 0; i < 2; ++i) { if (_Player.Area.HandCardArea.CardNumber > 0) { Game.ThrowCard(_Player, _Player, true, false, false); } } } }, Player); PBlock Target = null; if (Player.IsAI) { PBlock MaxHouseBlock = PMath.Max(Game.Map.BlockList.FindAll((PBlock Block) => Block.Lord != null && Block.IsBusinessLand && Block.Lord.TeamIndex == Player.TeamIndex && !Block.BusinessType.Equals(PBusinessType.ShoppingCenter)), (PBlock Block) => Block.HouseNumber, true).Key; Target = MaxHouseBlock; } else { Target = PNetworkManager.NetworkServer.ChooseManager.AskToChooseBlock(Player, Rando.Name + "-选择一处商业用地", (PBlock Block) => Block.IsBusinessLand && Block.Lord != null); } Target.BusinessType = PBusinessType.Club; PNetworkManager.NetworkServer.TellClients(new PRefreshBlockBasicOrder(Target)); Rando.DeclareUse(Player); } }); })); }
public PBlockPassTriggerInstaller() : base("格子的经过结算") { TriggerList.Add(new PTrigger("经过奖励点(固定数额)") { IsLocked = true, Time = PTime.PassBlockTime, Condition = (PGame Game) => { return(Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Block.GetMoneyPassSolid > 0); }, Effect = (PGame Game) => { Game.GetMoney(Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Player, Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Block.GetMoneyPassSolid); } }); TriggerList.Add(new PTrigger("经过奖励点(百分比)") { IsLocked = true, Time = PTime.PassBlockTime, Condition = (PGame Game) => { return(Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Block.GetMoneyPassPercent > 0); }, Effect = (PGame Game) => { Game.GetMoney(Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Player, PMath.Percent(Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Player.Money, Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Block.GetMoneyPassPercent)); } }); TriggerList.Add(new PTrigger("经过天灾(固定数额)") { IsLocked = true, Time = PTime.PassBlockTime, Condition = (PGame Game) => { return(Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Block.GetMoneyPassSolid < 0); }, Effect = (PGame Game) => { Game.Injure(null, Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Player, -Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Block.GetMoneyPassSolid, null); } }); TriggerList.Add(new PTrigger("经过天灾(百分比)") { IsLocked = true, Time = PTime.PassBlockTime, Condition = (PGame Game) => { return(Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Block.GetMoneyPassPercent < 0); }, Effect = (PGame Game) => { Game.Injure(null, Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Player, PMath.Percent(Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Player.Money, -Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Block.GetMoneyPassPercent), null); } }); MultiPlayerTriggerList.Add((PPlayer Player) => new PTrigger("经过祭坛[献祭]") { Player = Player, Time = PTime.PassBlockTime, Condition = (PGame Game) => { PPassBlockTag PassBlockTag = Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName); return(Player.Equals(PassBlockTag.Block.Lord) && PassBlockTag.Block.BusinessType.Equals(PBusinessType.Altar)); }, AICondition = (PGame Game) => { PPassBlockTag PassBlockTag = Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName); return(Player.TeamIndex != PassBlockTag.Player.TeamIndex); }, Effect = (PGame Game) => { PPassBlockTag PassBlockTag = Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName); Game.LoseMoney(PassBlockTag.Player, 1000); } }); TriggerList.Add(new PTrigger("牌库") { IsLocked = true, Time = PTime.PassBlockTime, Condition = (PGame Game) => { return(Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Block.GetCardPass > 0); }, Effect = (PGame Game) => { Game.GetCard(Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Player, Game.TagManager.FindPeekTag <PPassBlockTag>(PPassBlockTag.TagName).Block.GetCardPass); } }); }
/// <summary> /// AI计算从一个点开始走的期望 /// </summary> /// <param name="Game">游戏句柄</param> /// <param name="Player">玩家句柄</param> /// <param name="Block">起点的格子</param> /// <param name="Banned">被禁止投出的骰子点数(用于唐寅的技能【浪子】)</param> /// <param name="IncludePassMoney">计算是否包括经过奖励(用于计算前进收益)</param> /// <returns></returns> public static int StartFromExpect(PGame Game, PPlayer Player, PBlock Block, int Banned = 0, bool IncludePassMoney = true) { PBlock CurrentBlock = Block; if (!Player.NoLadder) { CurrentBlock = CurrentBlock.NextBlock; } if (Player.Traffic != null && Player.Traffic.Model is P_ChiihTuu) { CurrentBlock = CurrentBlock.NextBlock; } if (Player.NoLadder) { return(Expect(Game, Player, CurrentBlock)); } int Expectation = 0; int NewtonTargetStep = (Player.General is P_Newton ? P_Newton.Grx_Next(Game, Block).Value : 0); for (int i = 6; i >= 1; --i) { if (Banned == i) { continue; } int SingleExpect = Expect(Game, Player, CurrentBlock); if (NewtonTargetStep > 0) { SingleExpect = Math.Max(SingleExpect, Expect(Game, Player, Game.Map.NextStepBlock(CurrentBlock, NewtonTargetStep))); } Expectation += SingleExpect; if (IncludePassMoney) { if (CurrentBlock.GetMoneyPassSolid != 0) { int Disaster = Block.GetMoneyPassSolid; if (Disaster < 0 && -Disaster <= 1000 && Player.Traffic != null && Player.Traffic.Model is P_NanManHsiang) { Disaster = 0; } else if (Disaster < 0 && Player.Defensor != null && Player.Defensor.Model is P_YinYangChing) { Disaster = 0; } Expectation += i * Disaster; } if (CurrentBlock.GetMoneyPassPercent != 0) { int Disaster = PMath.Percent(Player.Money, CurrentBlock.GetMoneyPassPercent); if (Disaster < 0 && -Disaster <= 1000 && Player.Traffic != null && Player.Traffic.Model is P_NanManHsiang) { Disaster = 0; } else if (Disaster < 0 && Player.Defensor != null && Player.Defensor.Model is P_YinYangChing) { Disaster = 0; } Expectation += i * Disaster; } if (CurrentBlock.GetCardPass != 0) { Expectation += i * 2000 * CurrentBlock.GetCardPass; } if (CurrentBlock.BusinessType.Equals(PBusinessType.Altar) && CurrentBlock.Lord != null && CurrentBlock.Lord.TeamIndex != Player.TeamIndex) { Expectation -= 1000; } } CurrentBlock = Block.NextBlock; } Player.Area.AmbushCardArea.CardList.ForEach((PCard Card) => { if (Card.Model is P_TsaaoMuChiehPing Cao) { Expectation += Cao.AIExpect(Game, Player, Block); } }); return(Expectation / (Banned > 0 ? 5 : 6)); }
public P_Gabriel() : base("破军歌姬") { Sex = PSex.Female; Age = PAge.Future; Index = 2001; Cost = 1; Tips = string.Empty; CanBeChoose = false; PSkill ElfMiku = new PSkill("精灵加护·美九") { Lock = true }; SkillList.Add(ElfMiku .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(ElfMiku.Name) { IsLocked = true, Player = Player, Time = PTime.EnterDyingTime, AIPriority = 100, Condition = (PGame Game) => { return Game.TagManager.FindPeekTag <PDyingTag>(PDyingTag.TagName).Player.Equals(Player) && Game.AlivePlayersExist <P_IzayoiMiku>(); }, Effect = (PGame Game) => { ElfMiku.AnnouceUseSkill(Player); int TargetMoney = 10000; int Bonus = TargetMoney - Player.Money; if (Bonus > 0) { Game.GetMoney(Player, Bonus); } Player.Tags.CreateTag(new PElfPowerTag()); } }); })); PSkill AngelAwakeMiku = new PSkill("音之天使·觉醒") { Lock = true }; SkillList.Add(AngelAwakeMiku .AnnounceGameOnce() .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(AngelAwakeMiku.Name) { IsLocked = true, Player = Player, Time = PPeriod.StartTurn.During, AIPriority = 200, Condition = (PGame Game) => { PElfPowerTag ElfPowerTag = Player.Tags.FindPeekTag <PElfPowerTag>(PElfPowerTag.TagName); return Game.NowPlayer.Equals(Player) && Player.RemainLimit(AngelAwakeMiku.Name) && ElfPowerTag != null && ElfPowerTag.Value >= 3 && Game.AlivePlayers().Exists((PPlayer _Player) => _Player.General is P_IzayoiMiku); }, Effect = (PGame Game) => { AngelAwakeMiku.AnnouceUseSkill(Player); PPlayer Miku = Game.AlivePlayers().Find((PPlayer _Player) => _Player.General is P_IzayoiMiku); Game.Map.BlockList.ForEach((PBlock Block) => { if (Block.IsBusinessLand) { Block.Lord = Miku; Block.BusinessType = PBusinessType.Club; PNetworkManager.NetworkServer.TellClients(new PRefreshBlockBasicOrder(Block)); } }); AngelAwakeMiku.DeclareUse(Player); } }); })); PSkill Requiem = new PSkill("镇魂曲") { Lock = true }; SkillList.Add(Requiem .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(Requiem.Name) { IsLocked = true, Player = Player, Time = PTime.Injure.AcceptInjure, AIPriority = 255, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return InjureTag.Injure > 0 && InjureTag.ToPlayer != null && InjureTag.ToPlayer.General is P_IzayoiMiku; }, Effect = (PGame Game) => { Requiem.AnnouceUseSkill(Player); PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); InjureTag.Injure -= PMath.Percent(InjureTag.Injure, 20); } }); })); PSkill March = new PSkill("进行曲") { Lock = true }; SkillList.Add(March .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(March.Name) { IsLocked = true, Player = Player, Time = PPeriod.EndTurn.During, AIPriority = 255, Condition = (PGame Game) => { return Game.NowPlayer.General is P_IzayoiMiku && Game.NowPlayer.Equals(Game.NowPlayer.Position.Lord); }, Effect = (PGame Game) => { March.AnnouceUseSkill(Player); PElfPowerTag ElfPowerTag = Player.Tags.FindPeekTag <PElfPowerTag>(PElfPowerTag.TagName); int BonusHouse = 0; if (ElfPowerTag != null) { BonusHouse = ElfPowerTag.Value; } Game.GetHouse(Game.NowPlayer.Position, 1 + BonusHouse); Game.GetCard(Game.NowPlayer, 1); } }); })); }
public P_WangXu() : base("王诩") { Sex = PSex.Male; Age = PAge.Classic; Index = 5; Tips = "定位:全能\n" + "难度:困难\n" + "史实:战国时期思想家、纵横家,号“鬼谷子”。\n" + "攻略:\n王诩具有两个技能,在免费武将里是一个较为难用的武将,建议对游戏有一定了解之后使用。\n【纵横】可以将牌转化成【远交近攻】,但3和6两个点数里有不少高价值的牌,如【借尸还魂】、【欲擒故纵】、【抛砖引玉】、【走为上计】等,是否将这些牌转化成显性1000收益、隐性收益视队友状况而定的【远交近攻】,需要结合场上形势进行把握。\n【隐居】提高了王诩的生存能力,但【隐居】本身是负收益技能,移出游戏的王诩失去了收取过路费的能力,还会亏一座房屋,如果每回合都使用,必定只能苟延残喘片刻。所以,【隐居】的目的地需要给自己留出几个回合较为安全的空间,让自己在【隐居】的间隙可以造成输出。\n对于新手而言,也可以选择无脑【纵横】给大神队友补牌,后期保持【隐居】牵制敌人的打法。"; PSkill ZongHeng = new PSkill("纵横") { Initiative = true }; SkillList.Add(ZongHeng .AddTimeTrigger( new PTime[] { PPeriod.FirstFreeTime.During, PPeriod.SecondFreeTime.During }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(ZongHeng.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 200, CanRepeat = true, Condition = (PGame Game) => { return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.Area.HandCardArea.CardList.Exists((PCard Card) => Card.Point % 3 == 0); }, AICondition = (PGame Game) => { return Player.Area.HandCardArea.CardList.Exists((PCard Card) => { return Card.Point % 3 == 0 && Card.Model.AIInHandExpectation(Game, Player) < 3000; }) && P_YooenChiaoChinKung.AIEmitTargets(Game, Player)[0] != null; }, Effect = (PGame Game) => { ZongHeng.AnnouceUseSkill(Player); PCard TargetCard = null; if (Player.IsAI) { TargetCard = PAiCardExpectation.FindLeastValuable(Game, Player, Player, true, false, false, true, (PCard Card) => Card.Point % 3 == 0).Key; } else { List <PCard> Waiting = Player.Area.HandCardArea.CardList.FindAll((PCard Card) => Card.Point % 3 == 0); int Result = PNetworkManager.NetworkServer.ChooseManager.Ask(Player, ZongHeng.Name, Waiting.ConvertAll((PCard Card) => Card.Name).Concat(new List <string> { "取消" }).ToArray()); if (Result >= 0 && Result < Waiting.Count) { TargetCard = Waiting[Result]; } } if (TargetCard != null) { TargetCard.Model = new P_YooenChiaoChinKung(); PTrigger Trigger = TargetCard.Model.MoveInHandTriggerList.Find((Func <PPlayer, PCard, PTrigger> TriggerGenerator) => TriggerGenerator(Player, TargetCard).Time.Equals(PPeriod.FirstFreeTime.During))?.Invoke(Player, TargetCard); if (Trigger != null) { Game.Logic.StartSettle(new PSettle("纵横[远交近攻]", Trigger.Effect)); } } } }); })); PSkill YinJu = new PSkill("隐居") { Initiative = true }; SkillList.Add(YinJu .AnnounceTurnOnce() .AddTimeTrigger( new PTime[] { PPeriod.FirstFreeTime.During, PPeriod.SecondFreeTime.During }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(YinJu.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 10, CanRepeat = true, Condition = (PGame Game) => { return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.RemainLimit(YinJu.Name) && Player.HasHouse; }, AICondition = (PGame Game) => { if (!Player.CanBeInjured) { return false; } if (Game.NowPeriod.Equals(PPeriod.FirstFreeTime)) { bool CanGo = false; PAiMapAnalyzer.NextBlocks(Game, Player).ForEach((PBlock Block) => { if (Block.Lord != null && Block.Lord.TeamIndex != Player.TeamIndex && Block.Toll >= Player.Money) { CanGo = true; } if (Block.GetMoneyStopSolid < 0 && -Block.GetMoneyStopSolid >= Player.Money) { CanGo = true; } if (Block.GetMoneyStopPercent < 0 && PMath.Percent(Player.Money, -Block.GetMoneyStopPercent) >= Player.Money) { CanGo = true; } }); return CanGo || PAiMapAnalyzer.OutOfGameExpect(Game, Player, true) - PAiMapAnalyzer.MinValueHouse(Game, Player).Value > 0; } else { return false; } }, Effect = (PGame Game) => { YinJu.AnnouceUseSkill(Player); PBlock Block = null; if (Player.IsAI) { Block = PAiMapAnalyzer.MinValueHouse(Game, Player).Key; } else { Block = PNetworkManager.NetworkServer.ChooseManager.AskToChooseBlock(Player, YinJu.Name, (PBlock _Block) => { return Player.Equals(_Block.Lord) && _Block.HouseNumber > 0; }); } if (Block != null) { Game.MovePosition(Player, Player.Position, Block); PNetworkManager.NetworkServer.TellClients(new PHighlightBlockOrder(Block.Index.ToString())); Game.LoseHouse(Block, 1); Player.Tags.CreateTag(PTag.OutOfGameTag); YinJu.DeclareUse(Player); } } }); })); }
public P_HeShen() : base("和珅") { Sex = PSex.Male; Age = PAge.Industrial; Index = 24; Cost = 30; Tips = "定位:防御\n" + "难度:简单\n" + "史实:清朝中期权臣,中国历史上有名的巨贪,聚敛了约十亿两白银的巨大财富。\n" + "攻略:\n和珅是一名拥有不错防御力的武将。【贪污】使和珅的起始资金变相增加,而【受贿】可用于关键击杀,但一般都用于辅助队友。和珅的技能使用基本没有任何难度,因此十分适合新手使用。"; PSkill TanWu = new PSkill("贪污") { Lock = true }; SkillList.Add(TanWu .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(TanWu.Name) { IsLocked = true, Player = Player, Time = PTime.PurchaseLandTime, Condition = (PGame Game) => { PPurchaseLandTag PurchaseLandTag = Game.TagManager.FindPeekTag <PPurchaseLandTag>(PPurchaseLandTag.TagName); return Player.Equals(PurchaseLandTag.Player); }, Effect = (PGame Game) => { TanWu.AnnouceUseSkill(Player); PPurchaseLandTag PurchaseLandTag = Game.TagManager.FindPeekTag <PPurchaseLandTag>(PPurchaseLandTag.TagName); PurchaseLandTag.LandPrice = PMath.Percent(PurchaseLandTag.LandPrice, 50); } }); }) .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(TanWu.Name) { IsLocked = true, Player = Player, Time = PTime.PurchaseHouseTime, Condition = (PGame Game) => { PPurchaseHouseTag PurchaseHouseTag = Game.TagManager.FindPeekTag <PPurchaseHouseTag>(PPurchaseHouseTag.TagName); return Player.Equals(PurchaseHouseTag.Player); }, Effect = (PGame Game) => { TanWu.AnnouceUseSkill(Player); PPurchaseHouseTag PurchaseHouseTag = Game.TagManager.FindPeekTag <PPurchaseHouseTag>(PPurchaseHouseTag.TagName); PurchaseHouseTag.HousePrice = PMath.Percent(PurchaseHouseTag.HousePrice, 50); } }); })); PSkill ShouHui = new PSkill("受贿") { Initiative = true }; int ShouHuiExpect(PGame Game, PPlayer Player) { int Sum = 0; int Cnt = 0; foreach (PBlock Block in PAiMapAnalyzer.NextBlocks(Game, Player)) { if (Block.CanPurchase && Block.Lord == null) { Sum += Block.Price; Cnt++; } else if (Player.Equals(Block.Lord)) { Sum += Block.HousePrice; Cnt++; } } if (Cnt == 0) { return(-1); } else { return(Sum / Cnt); } } PPlayer ShouHuiTarget(PGame Game, PPlayer Player) { foreach (PPlayer Target in Game.Teammates(Player)) { if (ShouHuiExpect(Game, Target) >= 1500 && Target.Money >= 2000 && Player.RemainLimit(ShouHui.Name, Target)) { return(Target); } } foreach (PPlayer Target in Game.Enemies(Player)) { if (Player.RemainLimit(ShouHui.Name, Target)) { int Expect = ShouHuiExpect(Game, Target); if (Expect < 0) { Expect = 3000; // 无法判断下次购买土地或房屋的收益 } Expect -= PAiTargetChooser.InjureExpect(Game, Player, Player, Target, 1000, ShouHui); if (Expect <= -1000) { return(Target); } } } return(null); } SkillList.Add(ShouHui .AnnounceEachPlayerOnce() .AddTimeTrigger( new PTime[] { PPeriod.FirstFreeTime.During, PPeriod.SecondFreeTime.During }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(ShouHui.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 10, CanRepeat = true, Condition = (PGame Game) => { return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Game.AlivePlayers().Exists((PPlayer _Player) => Player.RemainLimit(ShouHui.Name, _Player)); }, AICondition = (PGame Game) => { return ShouHuiTarget(Game, Player) != null; }, Effect = (PGame Game) => { ShouHui.AnnouceUseSkill(Player); PPlayer Target = null; if (Player.IsAI) { Target = ShouHuiTarget(Game, Player); } else { Target = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, (PGame _Game, PPlayer _Player) => Player.RemainLimit(ShouHui.Name, _Player), ShouHui.Name, true); } if (Target != null) { Game.Injure(Player, Target, 1000, ShouHui); Target.Tags.CreateTag(new PShouHuiTag()); ShouHui.DeclareUseFor(Player, Target); } } }); }) .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(ShouHui.Name) { IsLocked = true, Player = null, Time = PTime.PurchaseLandTime, Condition = (PGame Game) => { PPurchaseLandTag PurchaseLandTag = Game.TagManager.FindPeekTag <PPurchaseLandTag>(PPurchaseLandTag.TagName); return PurchaseLandTag.Player.Tags.ExistTag(PShouHuiTag.TagName); }, Effect = (PGame Game) => { PPurchaseLandTag PurchaseLandTag = Game.TagManager.FindPeekTag <PPurchaseLandTag>(PPurchaseLandTag.TagName); PurchaseLandTag.LandPrice = 0; ShouHui.AnnouceUseSkill(PurchaseLandTag.Player); PurchaseLandTag.Player.Tags.PopTag <PShouHuiTag>(PShouHuiTag.TagName); } }); }) .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(ShouHui.Name) { IsLocked = true, Player = null, Time = PTime.PurchaseHouseTime, Condition = (PGame Game) => { PPurchaseHouseTag PurchaseHouseTag = Game.TagManager.FindPeekTag <PPurchaseHouseTag>(PPurchaseHouseTag.TagName); return PurchaseHouseTag.Player.Tags.ExistTag(PShouHuiTag.TagName); }, Effect = (PGame Game) => { PPurchaseHouseTag PurchaseHouseTag = Game.TagManager.FindPeekTag <PPurchaseHouseTag>(PPurchaseHouseTag.TagName); PurchaseHouseTag.HousePrice = 0; ShouHui.AnnouceUseSkill(PurchaseHouseTag.Player); PurchaseHouseTag.Player.Tags.PopTag <PShouHuiTag>(PShouHuiTag.TagName); } }); })); }
public P_ZhangSanFeng() : base("张三丰") { Sex = PSex.Male; Age = PAge.Industrial; Index = 8; Tips = "定位:攻防兼备\n" + "难度:中等\n" + "史实:宋末元初武术家,道家内丹祖师,武当派、太极拳的开创者,被封为“通微显化天尊”。\n" + "攻略:\n张三丰的技能需要预判下一回合的走向,玩家如果能对场上的局势有一定的预判能力,就能最大化地发挥张三丰两个状态的加成。\n因为张三丰的技能没有消耗,所以也可以走纯阳或者纯阴,做一个简单的防御(或攻击)将使用。"; PSkill TaiJi = new PSkill("太极") { Lock = true }; SkillList.Add(TaiJi .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(TaiJi.Name) { IsLocked = true, Player = Player, Time = PPeriod.StartTurn.During, AIPriority = 200, Condition = (PGame Game) => { return Game.NowPlayer.Equals(Player); }, Effect = (PGame Game) => { TaiJi.AnnouceUseSkill(Player); Player.Tags.PopTag <PTag>(PYinTag.Name); Player.Tags.PopTag <PTag>(PYangTag.Name); int ChooseResult = 0; if (Player.IsAI) { int Yin = -PAiMapAnalyzer.OutOfGameExpect(Game, Player, false); int Yang = PAiMapAnalyzer.OutOfGameExpect(Game, Player, true, true); ChooseResult = (Yin >= Yang ? 0 : 1); } else { ChooseResult = PNetworkManager.NetworkServer.ChooseManager.Ask(Player, TaiJi.Name, new string[] { "阴", "阳" }, new string[] { "造成的伤害+20%", "受到的伤害-20%" }); } if (ChooseResult == 0) { Player.Tags.CreateTag(PYinTag); } else { Player.Tags.CreateTag(PYangTag); } } }); }) .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(TaiJi.Name + "[阴]") { IsLocked = true, Player = Player, Time = PTime.Injure.EmitInjure, AIPriority = 100, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return Player.Tags.ExistTag(PYinTag.Name) && InjureTag.Injure > 0 && InjureTag.ToPlayer != null && Player.Equals(InjureTag.FromPlayer); }, Effect = (PGame Game) => { TaiJi.AnnouceUseSkill(Player); Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure += PMath.Percent(Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure, 20); } }); }) .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(TaiJi.Name + "[阳]") { IsLocked = true, Player = Player, Time = PTime.Injure.AcceptInjure, AIPriority = 100, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return Player.Tags.ExistTag(PYangTag.Name) && InjureTag.Injure > 0 && Player.Equals(InjureTag.ToPlayer); }, Effect = (PGame Game) => { TaiJi.AnnouceUseSkill(Player); Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure -= PMath.Percent(Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure, 20); } }); })); }
public P_LvMeng() : base("吕蒙") { Sex = PSex.Male; Age = PAge.Medieval; Index = 26; Cost = 25; Tips = "定位:控制\n" + "难度:困难\n" + "史实:东汉末期东吴名将,“东吴四都督”之一。早年武勇过人,后勤奋读书,渐有国士之风,留有“士别三日当刮目相待”的佳话。\n" + "攻略:\n吕蒙是一名拥有强大控制和防御能力的武将。【勤学】能够极大加速牌堆的流动,同时检索出足量的装备,因此吕蒙对【诸葛连弩】的需求较高,而经过一定次数的【勤学】后又有极大概率找到【诸葛连弩】,因此吕蒙往往能够手握大量的装备牌。但吕蒙对房屋的需求很高,若无法获得【诸葛连弩】或建造公园,【勤学】的价值便下降很多。【勤学】对花木兰、关羽等需要装备牌的武将可以呈现明显克制,同时能够快速洗出新的【声东击西】、【借尸还魂】等关键牌,还可防止敌方拿到牌堆剩下的关键牌,因此对发动时机要求非常高。【白衣】能够与【勤学】形成高效的联动,因此吕蒙对赵云、关羽等通过过路费输出的武将拥有较高的防御力。吕蒙的防御力和加快牌堆流动的能力往往能将战局引导向对吕蒙有利的方向,但需要一定记忆牌堆的能力才能充分发挥其优势。"; PSkill QinXue = new PSkill("勤学") { Initiative = true }; const int QinXueParameter = 4; SkillList.Add(QinXue .AnnounceTurnOnce() .AddTimeTrigger( new PTime[] { PPeriod.FirstFreeTime.During, PPeriod.SecondFreeTime.During }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(QinXue.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 185, CanRepeat = true, Condition = (PGame Game) => { return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.HasHouse && Player.RemainLimit(QinXue.Name); }, AICondition = (PGame Game) => { KeyValuePair <PBlock, int> MinBlock = PAiMapAnalyzer.MinValueHouse(Game, Player, false, true); if (MinBlock.Key == null) { return false; } int PossibleEquipmentCount = Game.CardManager.CardHeap.CardList.FindAll((PCard _Card) => _Card.Type.IsEquipment()).Count; int AllCardCount = Game.CardManager.CardHeap.CardNumber; int CardCountExpectation = 0; if (AllCardCount >= QinXueParameter) { CardCountExpectation = PossibleEquipmentCount * QinXueParameter / AllCardCount; } if (Player.Area.EquipmentCardArea.CardNumber < 3) { return CardCountExpectation * 2000 > MinBlock.Value; } else { return CardCountExpectation * 1500 > MinBlock.Value; } }, Effect = (PGame Game) => { QinXue.AnnouceUseSkill(Player); Game.ThrowHouse(Player, Player, QinXue.Name); List <PCard> QinXueCardList = Game.GetCard(Player, QinXueParameter, true); foreach (PCard Card in QinXueCardList) { if (Card.Type.IsEquipment()) { Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Player.Area.HandCardArea); } else { Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Game.CardManager.ThrownCardHeap); } } QinXue.DeclareUse(Player); } }); })); bool BaiYiCondition(PGame Game, PPlayer Player, PPlayer Source, int BaseInjure) { if (BaseInjure >= Player.Money && PMath.Percent(BaseInjure, 50) < Player.Money) { return(true); } else { int Profit = (BaseInjure - PMath.Percent(BaseInjure, 50)) * (Source == null ? 1 : (Source.TeamIndex == Player.TeamIndex ? 0 : 2)); int Value = PAiCardExpectation.FindLeastValuable(Game, Player, Player, true, true, false, true, (PCard Card) => Card.Type.IsEquipment()).Value; return(Profit > Value + 1000); } } PSkill BaiYi = new PSkill("白衣"); SkillList.Add(BaiYi .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(BaiYi.Name) { IsLocked = false, Player = Player, Time = PTime.Injure.AcceptInjure, AIPriority = 50, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return InjureTag.Injure > 0 && Player.Equals(InjureTag.ToPlayer) && InjureTag.InjureSource is PBlock && Player.HasEquipInArea(); }, AICondition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return BaiYiCondition(Game, Player, InjureTag.FromPlayer, InjureTag.Injure); }, Effect = (PGame Game) => { BaiYi.AnnouceUseSkill(Player); PCard TargetCard = null; if (Player.IsAI) { TargetCard = PAiCardExpectation.FindLeastValuable(Game, Player, Player, true, true, false, true, (PCard Card) => Card.Type.IsEquipment()).Key; } else { do { TargetCard = PNetworkManager.NetworkServer.ChooseManager.AskToChooseOwnCard(Player, BaiYi.Name + "[选择一张装备牌]", true, true); } while (!TargetCard.Type.IsEquipment()); } if (TargetCard != null) { Game.CardManager.MoveCard(TargetCard, Player.Area.HandCardArea.CardList.Contains(TargetCard) ? Player.Area.HandCardArea : Player.Area.EquipmentCardArea, Game.CardManager.ThrownCardHeap); PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder(Player.Name + "弃置了" + TargetCard.Name)); PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); InjureTag.Injure = PMath.Percent(InjureTag.Injure, 50); } } }); })); }
public static int ChangeFaceExpect(PGame Game, PPlayer Player, PBlock Start = null) { if (Start == null) { Start = Player.Position; } int Value = 0; List <PBlock> Blocks = NextBlocks(Game, Player); foreach (PBlock Block in Blocks) { int DeltaMoney = 0; int Disaster = Block.GetMoneyStopSolid; if (Disaster < 0 && -Disaster <= 1000 && Player.Traffic != null && Player.Traffic.Model is P_NanManHsiang) { Disaster = 0; } else if (Disaster < 0 && Player.Defensor != null && Player.Defensor.Model is P_YinYangChing) { Disaster = 0; } DeltaMoney += Disaster; Disaster = PMath.Percent(Player.Money, Block.GetMoneyStopPercent); if (Disaster < 0 && -Disaster <= 1000 && Player.Traffic != null && Player.Traffic.Model is P_NanManHsiang) { Disaster = 0; } else if (Disaster < 0 && Player.Defensor != null && Player.Defensor.Model is P_YinYangChing) { Disaster = 0; } DeltaMoney += Disaster; if (Block.Lord != null && Block.Lord.TeamIndex != Player.TeamIndex) { int Toll = Block.Toll; if (Block.BusinessType.Equals(PBusinessType.ShoppingCenter)) { Toll *= 2; } if (Block.BusinessType.Equals(PBusinessType.Club)) { Toll += PMath.Percent(Toll, 100); } if (Block.Lord.Weapon != null && Block.Lord.Weapon.Model is P_KuTingTao && Player.Area.HandCardArea.CardNumber == 0) { Toll *= 2; } if (Toll <= 1000 && Player.Traffic != null && Player.Traffic.Model is P_NanManHsiang) { Toll = 0; } DeltaMoney -= Toll; } if (-DeltaMoney >= Player.Money) { Value = 1000 * Blocks.Count; break; } else if (Block.Lord == null && Block.Price < Player.Money) { int LandValue = PMath.Percent(Block.Price, 10) * Game.Enemies(Player).Count; if (Block.IsBusinessLand) { LandValue += PMath.Max(PAiBusinessChooser.DirectionExpectations(Game, Player, Block)); } Value -= LandValue; } } Value /= Blocks.Count; Value *= (Player.BackFace ? -1 : 1); // 陈胜特殊处理 if (Player.General is P_ChenSheng) { int CurrentValue = StartFromExpect(Game, Player, Player.Position, 0, false); int MaxValue = PMath.Max(new List <int> { 1, 2, 3, 4, 5, 6 }, (int ChenShengStep) => StartFromExpect(Game, Player, Game.Map.NextStepBlock(Player.Position, ChenShengStep), 0, false)).Value - CurrentValue; Value += 2000 + MaxValue; } return(Value); }
public static int Expect(PGame Game, PPlayer Player, PBlock Block, bool InPortal = false) { int DeltaMoney = 0; int Disaster = Block.GetMoneyStopSolid; if (Disaster < 0 && -Disaster <= 1000 && Player.Traffic != null && Player.Traffic.Model is P_NanManHsiang) { Disaster = 0; } else if (Disaster < 0 && Player.Defensor != null && Player.Defensor.Model is P_YinYangChing) { Disaster = 0; } DeltaMoney += Disaster; Disaster = PMath.Percent(Player.Money, Block.GetMoneyStopPercent); if (Disaster < 0 && -Disaster <= 1000 && Player.Traffic != null && Player.Traffic.Model is P_NanManHsiang) { Disaster = 0; } else if (Disaster < 0 && Player.Defensor != null && Player.Defensor.Model is P_YinYangChing) { Disaster = 0; } DeltaMoney += Disaster; if (Block.Lord != null && Block.Lord.TeamIndex != Player.TeamIndex) { int Toll = Block.Toll; if (Block.BusinessType.Equals(PBusinessType.ShoppingCenter)) { Toll *= 2; } if (Block.BusinessType.Equals(PBusinessType.Club)) { Toll += PMath.Percent(Toll, 100); } if (Block.Lord.Weapon != null && Block.Lord.Weapon.Model is P_KuTingTao && Player.Area.HandCardArea.CardNumber == 0) { Toll *= 2; } if (Toll <= 1000 && Player.Traffic != null && Player.Traffic.Model is P_NanManHsiang) { Toll = 0; } DeltaMoney -= Toll; } if (Player.Money + DeltaMoney <= 0) { return(-30000 + DeltaMoney * 2); } else if (Player.Money <= 3000) { DeltaMoney *= 2; } DeltaMoney += 2000 * Block.GetCardStop; int LandValue = 0; if (Block.Lord == null && Block.Price < Player.Money) { LandValue = PMath.Percent(Block.Price, 10) * Game.Enemies(Player).Count; if (Block.IsBusinessLand) { LandValue += PMath.Max(PAiBusinessChooser.DirectionExpectations(Game, Player, Block)); } } else if (Player.Equals(Block.Lord)) { int PurchaseLimit = Player.PurchaseLimit; LandValue += PMath.Percent(Block.Price, 20) * Game.Enemies(Player).Count *PurchaseLimit; if (Block.BusinessType.Equals(PBusinessType.Park)) { LandValue += PMath.Percent(Block.Price, 60) * PurchaseLimit; } else if (Block.BusinessType.Equals(PBusinessType.ShoppingCenter) || Block.BusinessType.Equals(PBusinessType.Club)) { LandValue += PMath.Percent(Block.Price, 20) * Game.Enemies(Player).Count *PurchaseLimit; } if (Player.General is P_YangYuHuan) { LandValue += P_ShunShouChiienYang.AIExpect(Game, Player, 0).Value; } } if (Block.Lord != null && Block.Lord.TeamIndex == Player.TeamIndex) { if (Block.BusinessType.Equals(PBusinessType.Institute)) { LandValue += 2 * 2000; } else if (Block.BusinessType.Equals(PBusinessType.Pawnshop)) { LandValue += 2000; } if (Player.General is P_PanYue && (Block.PortalBlockList.Count == 0 || InPortal)) { if (!Player.Equals(Game.NowPlayer) || Player.RemainLimit("闲居")) { LandValue += PMath.Percent(Block.Price, 20 * Game.Enemies(Player).Count + 50); } } } int PortalValue = 0; if (!InPortal && Block.PortalBlockList.Count > 0) { PortalValue = PMath.Max(Block.PortalBlockList, (PBlock _Block) => Expect(Game, Player, _Block, true)).Value; } return(DeltaMoney + LandValue * 20 / GetRingLength(Game, Block) + PortalValue); }
public PBlockTriggerInstaller() : base("格子的停留结算") { TriggerList.Add(new PTrigger("初始化结算阶段购买土地或房屋的次数") { IsLocked = true, Time = PPeriod.SettleStage.Before, Effect = (PGame Game) => { Game.TagManager.CreateTag(new PPurchaseTag(1, 0)); } }); TriggerList.Add(new PTrigger("清除结算阶段购买土地或房屋的次数") { IsLocked = true, Time = PPeriod.SettleStage.After, Effect = (PGame Game) => { Game.TagManager.PopTag <PPurchaseTag>(PPurchaseTag.TagName); } }); TriggerList.Add(new PTrigger("奖励点(固定数额)") { IsLocked = true, Time = PPeriod.SettleStage.During, Condition = (PGame Game) => { return(Game.NowPlayer.Position.GetMoneyStopSolid > 0); }, Effect = (PGame Game) => { Game.GetMoney(Game.NowPlayer, Game.NowPlayer.Position.GetMoneyStopSolid); } }); TriggerList.Add(new PTrigger("奖励点(百分比)") { IsLocked = true, Time = PPeriod.SettleStage.During, Condition = (PGame Game) => { return(Game.NowPlayer.Position.GetMoneyStopPercent > 0); }, Effect = (PGame Game) => { Game.GetMoney(Game.NowPlayer, PMath.Percent(Game.NowPlayer.Money, Game.NowPlayer.Position.GetMoneyStopPercent)); } }); TriggerList.Add(new PTrigger("天灾(固定数额)") { IsLocked = true, Time = PPeriod.SettleStage.During, Condition = (PGame Game) => { return(Game.NowPlayer.Position.GetMoneyStopSolid < 0); }, Effect = (PGame Game) => { Game.Injure(null, Game.NowPlayer, -Game.NowPlayer.Position.GetMoneyStopSolid, null); } }); TriggerList.Add(new PTrigger("天灾(百分比)") { IsLocked = true, Time = PPeriod.SettleStage.During, Condition = (PGame Game) => { return(Game.NowPlayer.Position.GetMoneyStopPercent < 0); }, Effect = (PGame Game) => { Game.Injure(null, Game.NowPlayer, PMath.Percent(Game.NowPlayer.Money, -Game.NowPlayer.Position.GetMoneyStopPercent), null); } }); TriggerList.Add(new PTrigger("牌库") { IsLocked = true, Time = PPeriod.SettleStage.During, Condition = (PGame Game) => { return(Game.NowPlayer.Position.GetCardStop > 0); }, Effect = (PGame Game) => { Game.GetCard(Game.NowPlayer, Game.NowPlayer.Position.GetCardStop); } }); MultiPlayerTriggerList.Add((PPlayer Player) => new PTrigger("购买土地") { IsLocked = false, Player = Player, Time = PPeriod.SettleStage.During, Condition = (PGame Game) => { PBlock NowBlock = Game.NowPlayer.Position; PPurchaseTag PurchaseTag = Game.TagManager.FindPeekTag <PPurchaseTag>(PPurchaseTag.TagName); return(Game.NowPlayer.Equals(Player) && NowBlock.CanPurchase && NowBlock.Lord == null && PurchaseTag.Count < PurchaseTag.Limit && NowBlock.Price < Game.NowPlayer.Money); }, Effect = (PGame Game) => { Game.TagManager.FindPeekTag <PPurchaseTag>(PPurchaseTag.TagName).Count++; Game.PurchaseLand(Game.NowPlayer, Game.NowPlayer.Position); } }); MultiPlayerTriggerList.Add((PPlayer Player) => new PTrigger("购买房屋") { IsLocked = false, Player = Player, Time = PPeriod.SettleStage.During, CanRepeat = true, Condition = (PGame Game) => { PBlock NowBlock = Game.NowPlayer.Position; PPurchaseTag PurchaseTag = Game.TagManager.FindPeekTag <PPurchaseTag>(PPurchaseTag.TagName); return(Game.NowPlayer.Equals(Player) && Game.NowPlayer.Equals(NowBlock.Lord) && PurchaseTag.Count < PurchaseTag.Limit && NowBlock.HousePrice < Game.NowPlayer.Money); }, AICondition = (PGame Game) => { PBlock NowBlock = Game.NowPlayer.Position; PPurchaseTag PurchaseTag = Game.TagManager.FindPeekTag <PPurchaseTag>(PPurchaseTag.TagName); /* * AI的买房策略: * 第1次:必买 * 第2次:钱多于20000 or 钱多于10000且地价高于2000 * 以上:钱多于15000且地价多于3000 or 钱多于10000且为购物中心 * * 必买:公园 or 破军歌姬 * 必不买:廉颇 or 无房被兵 * * 赵云:2000次数上限为3,1000无限建 */ if (NowBlock.BusinessType.Equals(PBusinessType.Park)) { return(true); } if (Player.General is P_Gabriel && Game.AlivePlayersExist <P_IzayoiMiku>()) { return(true); } if (Player.General is P_LianPo) { return(false); } if (Player.Area.AmbushCardArea.CardList.Exists((PCard Card) => Card.Model is P_PingLiangTsuunTuan) && !Player.HasHouse) { return(false); } if (PurchaseTag.Count == 0) { return(true); } if (PurchaseTag.Count == 1) { if (Player.Money >= 20000) { return(true); } else if (Player.Money >= 10000 && NowBlock.Price >= 2000) { return(true); } } if (Player.Money >= 15000 && NowBlock.Price >= 3000) { return(true); } if (Player.Money >= 10000 && (NowBlock.BusinessType.Equals(PBusinessType.ShoppingCenter) || NowBlock.BusinessType.Equals(PBusinessType.Club))) { return(true); } if (Player.General is P_ZhaoYun) { if (Player.Money >= 5000 && NowBlock.Price < 3000 && PurchaseTag.Count <= 2) { return(true); } if (Player.Money >= 2000 && NowBlock.Price < 2000) { return(true); } } return(false); }, Effect = (PGame Game) => { Game.TagManager.FindPeekTag <PPurchaseTag>(PPurchaseTag.TagName).Count++; Game.PurchaseHouse(Game.NowPlayer, Game.NowPlayer.Position); } }); MultiPlayerTriggerList.Add((PPlayer Player) => new PTrigger("研究所[视察研究成果]") { Player = Player, Time = PPeriod.SettleStage.During, Condition = (PGame Game) => { PBlock NowBlock = Game.NowPlayer.Position; return(Player.Equals(NowBlock.Lord) && NowBlock.BusinessType.Equals(PBusinessType.Institute)); }, AICondition = (PGame Game) => { return(Player.TeamIndex == Game.NowPlayer.TeamIndex); }, Effect = (PGame Game) => { int Number = PMath.RandInt(2, 7) / 2; Game.GetCard(Game.NowPlayer, Number); } }); MultiPlayerTriggerList.Add((PPlayer Player) => new PTrigger("当铺[典当手牌]") { Player = Player, Time = PPeriod.SettleStage.During, Condition = (PGame Game) => { PBlock NowBlock = Game.NowPlayer.Position; return(Game.NowPlayer.Equals(Player) && NowBlock.Lord != null && Player.Area.HandCardArea.CardNumber > 0 && NowBlock.BusinessType.Equals(PBusinessType.Pawnshop)); }, AICondition = (PGame Game) => { return(Game.NowPlayer.TeamIndex == Game.NowPlayer.Position.Lord.TeamIndex || PAiCardExpectation.FindLeastValuable(Game, Player, Player, true, false, false, true).Value < 750); }, Effect = (PGame Game) => { Game.GiveCardTo(Game.NowPlayer, Game.NowPlayer.Position.Lord, true, false); Game.GetMoney(Game.NowPlayer, 2000); } }); TriggerList.Add(new PTrigger("公园[扩建政府补助]") { IsLocked = true, Time = PTime.PurchaseHouseTime, Condition = (PGame Game) => { return(Game.TagManager.FindPeekTag <PPurchaseHouseTag>(PPurchaseHouseTag.TagName).Block.BusinessType.Equals(PBusinessType.Park)); }, Effect = (PGame Game) => { PPurchaseHouseTag PurchaseHouseTag = Game.TagManager.FindPeekTag <PPurchaseHouseTag>(PPurchaseHouseTag.TagName); Game.GetMoney(PurchaseHouseTag.Player, PMath.Percent(PurchaseHouseTag.Block.Price, 10)); } }); MultiPlayerTriggerList.Add((PPlayer Player) => new PTrigger("收取过路费") { Player = Player, Time = PPeriod.SettleStage.During, Condition = (PGame Game) => { return(!Game.NowPlayer.Equals(Player) && Player.Equals(Game.NowPlayer.Position.Lord)); }, AICondition = (PGame Game) => { if ((Game.NowPlayer.General is P_PanYue || Game.NowPlayer.General is P_ChenSheng) && Game.NowPlayer.TeamIndex == Player.TeamIndex) { // 给闲居和起义让路 return(false); } return(PAiTargetChooser.InjureExpect(Game, Player, Player, Game.NowPlayer, Game.NowPlayer.Position.Toll, Game.NowPlayer.Position) > 0); }, Effect = (PGame Game) => { Game.Toll(Player, Game.NowPlayer, Game.NowPlayer.Position); } }); }
public P_Xdyu() : base("项羽") { Sex = PSex.Male; Age = PAge.Classic; Index = 17; Cost = 30; Tips = "定位:攻击\n" + "难度:中等\n" + "史实:秦末西楚霸王。曾在巨鹿之战中破釜沉舟,大破秦军。\n" + "攻略:\n项羽是一个十分考验玩家判断力的武将,【霸王】在小图的发挥显著强于大图,能够配合虞姬的【剑舞】,也可以增加天灾对敌人的伤害,还可以在一定程度上辅助队友的输出,范围为1限制了项羽的跨队列输出,但敌人越多就越强,颇有乌江快战之风范。\n" + "【沉舟】是一个爆发力极强的技能,相应地也要付出较大的代价。要想达到正收益,技能发动往往是在中后期,而购物中心往往是项羽的不二选择,当现金小于18000时【沉舟】已经是正收益,而对于领地来说只需花费小于正常花费即可一试。当然,在现金较低的情况下,项羽甚至可以连续【沉舟】,在高风险的同时可能获得极高的回报,或可重振西楚霸业。\n"; PSkill Bawh = new PSkill("霸王"); SkillList.Add(Bawh .AddTimeTrigger( new PTime[] { PTime.Injure.AcceptInjure }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(Bawh.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 200, Condition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return InjureTag.Injure > 0 && InjureTag.ToPlayer != null && !Player.Equals(InjureTag.ToPlayer) && InjureTag.ToPlayer.Distance(Player) <= 1; }, AICondition = (PGame Game) => { PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); return InjureTag.ToPlayer.TeamIndex != Player.TeamIndex; }, Effect = (PGame Game) => { Bawh.AnnouceUseSkill(Player); PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName); InjureTag.Injure += 800; } }); })); PSkill Ifvb = new PSkill("沉舟") { Initiative = true }; SkillList.Add(Ifvb .AnnounceTurnOnce() .AddTimeTrigger( new PTime[] { PPeriod.FirstFreeTime.During, PPeriod.SecondFreeTime.During }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(Ifvb.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 200, CanRepeat = true, Condition = (PGame Game) => { return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.RemainLimit(Ifvb.Name) && Player.Position.Lord != null; }, AICondition = (PGame Game) => { if (Player.Money <= 1000) { return false; } return PMath.Percent(Player.Money, 50) + 1500 < 3 * PAiMapAnalyzer.HouseValue(Game, Player, Player.Position); }, Effect = (PGame Game) => { Ifvb.AnnouceUseSkill(Player); Game.LoseMoney(Player, PMath.Percent(Player.Money, 50)); Game.GetHouse(Player.Position, 3); Ifvb.DeclareUse(Player); } }); })); }
/// <summary> /// 伤害预测收益,无修正情形为基本伤害的2倍or0 /// </summary> /// <param name="Game"></param> /// <param name="Player">视点玩家</param> /// <param name="FromPlayer">造成伤害的玩家</param> /// <param name="Target"></param> /// <param name="BaseInjure">基本伤害量</param> /// <param name="Source">伤害方式</param> /// <returns></returns> public static int InjureExpect(PGame Game, PPlayer Player, PPlayer FromPlayer, PPlayer Target, int BaseInjure, PObject Source) { #region 防止伤害的情况 if (Player.OutOfGame || !Target.CanBeInjured || (FromPlayer == null && Target.HasEquipment <P_YinYangChing>()) || (BaseInjure <= 1000 && Target.HasEquipment <P_NanManHsiang>())) { return(0); } #endregion int FromCof = FromPlayer == null ? 0 : (Player.TeamIndex == FromPlayer.TeamIndex ? 1 : -1); int ToCof = (Player.TeamIndex != Target.TeamIndex ? 1 : -1); int Sum = 0; #region 成伤害时发动的技能:古锭刀,龙胆,太极,苍狼,趁火打劫,女权,怒斩 if (FromPlayer != null) { if (FromPlayer.Tags.ExistTag(P_WuZhao.NvQuanTag.Name) && (Source is PBlock || Source is PCard)) { BaseInjure += 2000; } if (FromPlayer.General is P_Gryu && Source is PBlock && FromPlayer.Area.EquipmentCardArea.CardNumber > Target.Area.EquipmentCardArea.CardNumber) { BaseInjure += 600; } if ((Target.Area.HandCardArea.CardNumber == 0 || (FromPlayer.General is P_IzayoiMiku && FromPlayer.TeamIndex != Target.TeamIndex)) && FromPlayer.HasEquipment <P_KuTingTao>() && Source is PBlock) { BaseInjure *= 2; } if (FromPlayer.General is P_ZhaoYun && FromPlayer.Tags.ExistTag(P_ZhaoYun.PDanTag.TagName)) { if (P_ZhaoYun.LongDanICondition(Game, FromPlayer, Target, BaseInjure)) { BaseInjure = PMath.Percent(BaseInjure, 150); } } if (FromPlayer.General is P_ZhangSanFeng && Player.Tags.ExistTag(P_ZhangSanFeng.PYinTag.Name)) { BaseInjure += PMath.Percent(BaseInjure, 20); } } if (Target.Area.OwnerCardNumber > 0) { if (FromPlayer != null && FromPlayer.HasEquipment <P_TsaangLang>() && Source != null && Source is PCard Card && Card.Model is PSchemeCardModel) { Sum += 2000 * FromCof + 2000 * ToCof; } if (Player.HasInHand <P_CheevnHuoTaChieh>()) { Sum += 2000 + 2000 * ToCof; } } #endregion #region 受到伤害时发动的技能:八卦阵,百花裙,龙胆,太极,霸王,白衣,镇魂曲 if (Target.HasEquipment <P_PaKuaChevn>()) { // 美九改版,八卦阵有效 if (Target.General is P_LiuJi) { Sum -= 1000 * ToCof; BaseInjure = PMath.Percent(BaseInjure, 50); } else { BaseInjure = (BaseInjure + PMath.Percent(BaseInjure, 50)) / 2; } } if (Target.HasEquipment <P_PaiHuaChooon>() && FromPlayer != null && !Target.Sex.Equals(FromPlayer.Sex)) { BaseInjure = PMath.Percent(BaseInjure, 50); } if (Target.General is P_ZhaoYun && Target.Tags.ExistTag(P_ZhaoYun.PDanTag.TagName)) { if (P_ZhaoYun.LongDanIICondition(Game, Target, FromPlayer, BaseInjure)) { BaseInjure = PMath.Percent(BaseInjure, 50); } } if (Target.General is P_ZhangSanFeng && Target.Tags.ExistTag(P_ZhangSanFeng.PYangTag.Name)) { BaseInjure -= PMath.Percent(BaseInjure, 20); } if (Game.AlivePlayers().Exists((PPlayer _Player) => { return(!_Player.Equals(Target) && _Player.TeamIndex != Target.TeamIndex && _Player.Distance(Target) <= 1 && _Player.General is P_Xdyu); })) { BaseInjure += 800; } if (Target.General is P_LvMeng && Target.Area.EquipmentCardArea.CardNumber > 0 && !(FromPlayer.General is P_IzayoiMiku && FromPlayer.TeamIndex != Target.TeamIndex)) { BaseInjure = Math.Min(PMath.Percent(BaseInjure, 50) + 2000, BaseInjure); } if (Target.General is P_IzayoiMiku && Game.AlivePlayersExist <P_Gabriel>()) { BaseInjure -= PMath.Percent(BaseInjure, 20); } #endregion int ExpectTargetMoney = Target.Money - BaseInjure; #region 濒死时发动的技能:蓄谋,精灵加护,圣女 if (ExpectTargetMoney <= 0) { bool flag = true; if (!(FromPlayer.General is P_LvZhi)) { if (Target.General is P_Gabriel) { flag = false; // 破军歌姬的复活 if (FromPlayer.Equals(Target)) { // 对自己伤害,不触发复活 } else if (FromPlayer.TeamIndex == Target.TeamIndex) { // 美九自己的伤害,触发复活大利好 Sum += 15000; } else { // 对方的伤害 if (Game.AlivePlayersExist <P_IzayoiMiku>()) { // 美九未死,大不利 Sum -= 15000; } else { flag = true; } } } else if (Game.AlivePlayersExist <P_JeanneDarc>() && Source is PBlock) { PPlayer Jeanne = Game.AlivePlayers().Find((PPlayer _Player) => _Player.General is P_JeanneDarc); if (Jeanne.TeamIndex == Target.TeamIndex && Jeanne.Area.OwnerCardNumber > 0 && Jeanne.Money > 5000 && ExpectTargetMoney > -10000) { flag = false; Sum += (5000 + (Target.Equals(Jeanne) ? 0 : 2000) - 2000 * Jeanne.Area.OwnerCardNumber) * (Target.TeamIndex == Player.TeamIndex ? 1 : -1); } } } if (flag) { Sum += 30000 * ToCof; } } #endregion Sum += BaseInjure * ToCof; Sum += BaseInjure * FromCof; #region 受到伤害后:离骚 if (Target.General is P_QuYuan) { // Sum -= 900 * ToCof; // 因为离骚总是会发动,其他伤害也会触发,天灾也会触发 // 所以不应该将离骚计入伤害计算 } #endregion #region 伤害结束后:风云 if (FromPlayer != null && FromPlayer.General is P_ChenYuanYuan) { Sum += 200 * FromCof; } if (Target.General is P_ChenYuanYuan) { Sum -= 200 * ToCof; } #endregion #region 队友间平衡:自身和目标的合理阈值为50%-200% if (FromPlayer.TeamIndex == Target.TeamIndex) { if (FromPlayer.General is P_IzayoiMiku && Target.General is P_Gabriel) { // 美九对破军歌姬的伤害,积极性 Sum += 2000; } else if (FromPlayer.General is P_Gabriel && Target.General is P_IzayoiMiku) { // 破军歌姬对美九的伤害,消极性 Sum -= 20000; } else { if (FromPlayer.Money > ExpectTargetMoney * 2) { Sum -= 2000; } else if (FromPlayer.Money >= Target.Money) { Sum -= 100; } else if (FromPlayer.Money < Target.Money * 2) { Sum += 1000; } } } #endregion #region 美九歌厅的翻面效果 if (Source is PBlock Block && Block.BusinessType.Equals(PBusinessType.Club)) { Sum += PAiMapAnalyzer.ChangeFaceExpect(Game, Target) * (-ToCof); } #endregion #region 贞德设为高嘲讽 if (Game.AlivePlayersExist <P_JeanneDarc>()) { PPlayer Jeanne = Game.AlivePlayers().Find((PPlayer _Player) => _Player.General is P_JeanneDarc); if (Jeanne.TeamIndex != Player.TeamIndex) { if (Target.Equals(Jeanne) && Sum > 0) { Sum += PMath.Percent(Sum, 20); } } } #endregion return(Sum); }
public P_HuaXiong() : base("华雄") { Sex = PSex.Male; Age = PAge.Medieval; Index = 10; Cost = 20; Tips = "定位:辅助\n" + "难度:中等\n" + "史实:汉末董卓帐下都督,在《三国演义》中,华雄是一员猛将,曾击败孙坚,斩杀祖茂、俞涉、潘凤。\n" + "攻略:\n" + "1.华雄的资本是初始比其他人多出的15000资金,这让华雄成为了前期被擒贼擒王围堵的对象,降低了华雄的预期土地水平。因此耀武的实际收益小于15000。\n" + "2.耀武的收益是一次性的。和持续性收益的武将相比,节奏越快的战斗,华雄的优势越大。加快游戏节奏的诸葛连弩、草木皆兵,甚至闪电,都可以帮助扩大华雄的相对收益。\n" + "3.叫阵是一个期望收益为负的技能,除非有希望斩杀或者有不需要的装备,不应该随意发动叫阵。\n" + "4.叫阵是一个直击技能。如果存储一些装备牌,就可以在敌人现金较少的时候连续叫阵实现斩杀。因此,手牌数多的华雄可以限制敌人将现金转化成房屋等其他战斗资源的决策。\n" + "5.在团队里华雄主要充当一个奶妈角色,用其天然的高现金数,让队友收取过路费。同时华雄凭借叫阵也能承担一个直击斩杀手的功能。\n" + "6.到游戏后期,因为耀武的均回合收益已经下降到很低,华雄能为团队做出的贡献很少。"; PSkill YaoWu = new PSkill("耀武") { Lock = true }; SkillList.Add(YaoWu .AddTrigger( (PPlayer Player, PSkill Skill) => { return(new PTrigger(YaoWu.Name) { IsLocked = true, Player = Player, Time = PTime.StartGameTime, AIPriority = 100, Effect = (PGame Game) => { YaoWu.AnnouceUseSkill(Player); Player.Money = PMath.Percent(Player.Money, 150); PNetworkManager.NetworkServer.TellClients(new PRefreshMoneyOrder(Player)); } }); })); PSkill JiaoZhen = new PSkill("叫阵") { Initiative = true }; SkillList.Add(JiaoZhen .AddTimeTrigger( new PTime[] { PPeriod.FirstFreeTime.During, PPeriod.SecondFreeTime.During }, (PTime Time, PPlayer Player, PSkill Skill) => { return(new PTrigger(JiaoZhen.Name) { IsLocked = false, Player = Player, Time = Time, AIPriority = 200, CanRepeat = true, Condition = (PGame Game) => { return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.Area.EquipmentCardArea.CardNumber > 0; }, AICondition = (PGame Game) => { if (PAiTargetChooser.InjureTarget(Game, Player, Player, (PGame _Game, PPlayer _Player) => { return _Player.IsAlive && !_Player.Equals(Player) && !(_Player.General is P_LiuJi); }, 1000, JiaoZhen) == null || Player.Money <= 2000) { return false; } if (Game.Enemies(Player).Exists((PPlayer _Player) => _Player.Money <= 2000)) { return true; } foreach (PCardType CardType in new PCardType[] { PCardType.WeaponCard, PCardType.DefensorCard, PCardType.TrafficCard }) { KeyValuePair <PCard, int> MaxCard = PMath.Max( Player.Area.HandCardArea.CardList.FindAll((PCard _Card) => _Card.Type.Equals(CardType)), (PCard _Card) => _Card.Model.AIInEquipExpectation(Game, Player)); PCard CurrentCard = Player.GetEquipment(CardType); if (CurrentCard != null) { int Expect = CurrentCard.Model.AIInEquipExpectation(Game, Player); if (MaxCard.Value > Expect) { return true; } if (Expect <= 1000) { return true; } } } return false; }, Effect = (PGame Game) => { JiaoZhen.AnnouceUseSkill(Player); PPlayer Target = null; if (Player.IsAI) { Target = PAiTargetChooser.InjureTarget(Game, Player, Player, (PGame _Game, PPlayer _Player) => { return _Player.IsAlive && !_Player.Equals(Player) && !(_Player.General is P_LiuJi); }, 1000, JiaoZhen); } else { Target = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.Except(Player), JiaoZhen.Name, true); } if (Target != null) { if (Game.PkPoint(Player, Target) > 0) { Game.Injure(Player, Target, 1000, JiaoZhen); } else { Game.ThrowCard(Player, Player, false); Game.LoseMoney(Player, 1000); } } } }); })); }