Example #1
0
        public static SkillList UnselectedSkillList(Contractor contractor)
        {
            string storedProcedureName = "usp_getContractorUnselectedSkills";

            MySqlParameter[] parameterList = new MySqlParameter[]
            {
                new MySqlParameter("contractorIDIn", contractor.ContractorID)
            };

            MySqlDataReader result = ExecuteReader(storedProcedureName, parameterList);

            SkillList skillList = new SkillList();

            while (result.Read())
            {
                skillList.Add(new Skill(
                                  result.GetString("skillName"),
                                  result.GetString("skillDescription")
                                  ));
            }

            result.Close();

            return(skillList);
        }
Example #2
0
    public void AddPassiveSkill(uint _id)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupPassiveSkill(_id);
        SkillList.Add(_newSkill);
    }
Example #3
0
    public void AddLeaderSkill(uint _id)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupLeaderSkill(_id);
        SkillList.Add(_newSkill);
    }
Example #4
0
    public void AddLimitBreakSkill(uint _id, int level)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupLimitBreakSkill(_id, (uint)level);
        SkillList.Add(_newSkill);
    }
    public void CreateSkillList(MasterDataHero master)
    {
        UnitSkillContext unit = new UnitSkillContext();

        unit.setupHeroSkill((uint)master.default_skill_id, 0, 0, true);
        SkillList.Add(unit);
    }
Example #6
0
    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));
                }
            });
        }));
    }
Example #7
0
    public P_ZhangFei() : base("张飞")
    {
        Sex   = PSex.Male;
        Age   = PAge.Medieval;
        Index = 14;
        Cost  = 10;
        Tips  = "定位:攻击\n" +
                "难度:简单\n" +
                "史实:三国时期蜀汉名将,“五虎上将”之一,曾在长坂坡负责断后,曹军无人敢逼近。\n" +
                "攻略:\n张飞是一个使用起来很简单的武将,为新手推荐。\n" +
                "张飞可以很容易制造出很高等级的房屋,如果人数较多而地图较小,高级房屋可以造成相当巨大的优势。但反之,如果人数少而地图大,滥用【咆哮】会导致张飞在前期现金数量迅速减少,而陷入发展不平衡的困境。由于张飞几乎可以完全控制地图上各片地的发展情况,所以集中力量发展还是分散建设到不同土地上,是张飞面临的首要问题。一般而言,张飞每片地应当保持至少2座房屋,以形成对【反客为主】的完全防御。";

        PSkill PaoXiao = new PSkill("咆哮")
        {
            Lock = true
        };

        SkillList.Add(PaoXiao
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(PaoXiao.Name)
            {
                IsLocked = true,
                Player = Player,
                Time = PPeriod.SettleStage.Start,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer);
                },
                Effect = (PGame Game) => {
                    Game.TagManager.FindPeekTag <PPurchaseTag>(PPurchaseTag.TagName).Limit += 3;
                }
            });
        }));
    }
Example #8
0
 public Monster()
 {
     for (int i = 0; i < 2; ++i)
     {
         SkillList.Add(Skill.Bite);
     }
 }
Example #9
0
    public void AddLinkSkill(MasterDataParamChara cCharaMasterData, uint nLinkPoint)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupLinkSkill(cCharaMasterData, nLinkPoint);
        _newSkill.setLinkTitleImage("LINK SKILL_gray", "skill_name_bg0");
        SkillList.Add(_newSkill);
    }
Example #10
0
    public void AddRaceBonus(MasterDataParamChara cCharaMasterData)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupRaceBonus(cCharaMasterData);
        _newSkill.setLinkTitleImage("RACE BONUS_gray", "skill_name_bg0");
        SkillList.Add(_newSkill);
    }
Example #11
0
    public void AddLinkBonus(CharaOnce cCharaOnce, MasterDataParamChara cCharaMasterData)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupLinkEffectInfo(cCharaOnce, cCharaMasterData, false);
        _newSkill.setLinkTitleImage("linkubo-nasu_gray", "skill_name_bg0");
        SkillList.Add(_newSkill);
    }
Example #12
0
    public void AddLinkPassive(MasterDataParamChara cCharaMasterData)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupLinkPassive(cCharaMasterData);
        _newSkill.setLinkTitleImage("LINK PASSIVE_gray", "skill_name_bg0");
        SkillList.Add(_newSkill);
    }
Example #13
0
    private void AddPlayerSkills()
    {                                                                                                 //Add the player skills to the entity skill list
        EntitySkill entitySkill = EntitySkill.FromSkill((Skill)SkillReference.value);                 //turn the skill into entity skill with cooldown timer

        SkillList.Add(entitySkill);                                                                   //Adding the normal skill

        EntitySkill entityUltimateSkill = EntitySkill.FromSkill((Skill)UltimateSkillReference.value); //turn the skill into entity skill with cooldown timer

        SkillList.Add(entityUltimateSkill);                                                           //Adding the normal skill
    }
Example #14
0
    public P_Temujin() : base("铁木真")
    {
        Sex   = PSex.Male;
        Age   = PAge.Renaissance;
        Index = 11;
        Cost  = 20;
        Tips  = "定位:控制\n" +
                "难度:简单\n" +
                "史实:大蒙古国可汗,杰出的军事家、政治家,统一了蒙古诸部,开疆拓土,远至东欧,被尊为“成吉思汗”。\n" +
                "攻略:\n铁木真是一个新手推荐武将,基本上使用没有任何难度。";

        PSkill QiangLve = new PSkill("抢掠")
        {
            SoftLockOpen = true
        };

        SkillList.Add(QiangLve
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(QiangLve.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PTime.Injure.EmitInjure,
                AIPriority = 15,
                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 && !Player.Equals(InjureTag.ToPlayer) && InjureTag.ToPlayer.Area.HandCardArea.CardNumber + InjureTag.ToPlayer.Area.EquipmentCardArea.CardNumber > 0;
                },
                AICondition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    return InjureTag.ToPlayer.TeamIndex != Player.TeamIndex;
                },
                Effect = (PGame Game) => {
                    QiangLve.AnnouceUseSkill(Player);
                    int Result = Game.Judge(Player, 6);
                    if (Result % 2 == 0)
                    {
                        PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                        PCard Card = new P_CheevnHuoTaChieh().Instantiate();
                        Card.Point = 0;
                        PTrigger Trigger = Card.Model.MoveInHandTriggerList.Find((Func <PPlayer, PCard, PTrigger> TriggerGenerator) => TriggerGenerator(Player, Card).Time.Equals(PTime.Injure.AcceptInjure))?.Invoke(Player, Card);
                        if (Trigger != null)
                        {
                            Game.Logic.StartSettle(new PSettle("抢掠[趁火打劫]", Trigger.Effect));
                        }
                    }
                }
            });
        }));
    }
Example #15
0
    /// <summary>
    /// 加载技能信息
    /// </summary>
    /// <param name="proto"></param>
    public void LoadSkill(RoleData_SkillReturnProto proto)
    {
        List <RoleData_SkillReturnProto.SkillData> lst = proto.Skills;

        for (int i = 0; i < lst.Count; i++)
        {
            RoleInfoSkill skillInfo = new RoleInfoSkill();
            skillInfo.SkillId    = lst[i].SkillId;
            skillInfo.SKillLevel = lst[i].SKillLevel;
            skillInfo.SlotsNO    = lst[i].SlotsNO;
            SkillList.Add(skillInfo);
        }
    }
Example #16
0
 public override void Awake()
 {
     base.Awake();
     IdleInitAction = new IdleAction(this, "Idle", NV, mr, colliders, Ani);
     AttackAction   = new NormalAttack(this, new string[] { "attack1", "attack2" }, 0.44f, NV, Ani);
     BackAction     = new TakeBack(this, "", NV, transform);
     InjuredAction  = new InjuredAction(this, "GetHit", 1, NV, Ani);
     RunAction      = new RunAction(this, "Run", NV, Ani);
     DieAction      = new DieAction(this, "Die", mr, NV, transform, colliders, Ani, 0.2f);
     //技能节点初始化(skill1Action是AI中需要cd和weight控制的技能,而skill1Action是根据相应的触发条件触发的)
     skill1Action = new SYSkillAction(this, "skill1", 0.7f, 0.7f, NV, 10, Ani);
     skill2Action = new JumpAction(this, "skill2", 1.4f, 3f, NV, 3, Ani, 1.65f);
     //将通过冷却和权值的技能添加到总技能列表中(所以仅将skill1Action进行CD和Weight的封装并添加,而skill2Action在update中根据条件来单独控制技能的触发)
     SkillList.Add(new SkillCDAndWeight_New(skill1Action, 10, 20));
 }
Example #17
0
        /// <summary>
        /// 用户获得道具
        /// </summary>
        /// <returns></returns>
        public bool AddSkill(int id)
        {
            if (id == 0)
            {
                return(false);
            }

            var skill = SkillList.Find(t => (t.ID == id));

            if (skill != null)
            {
                return(false);
            }
            skill    = new SkillData();
            skill.ID = id;
            skill.Lv = 1;
            SkillList.Add(skill);
            return(true);
        }
Example #18
0
        public static SkillList GetSkills()
        {
            string storedProcedureName = "usp_getSkills";

            MySqlDataReader results = ExecuteReader(storedProcedureName);

            SkillList skillList = new SkillList();

            while (results.Read())
            {
                skillList.Add(new Skill(
                                  results.GetString("SkillName"),
                                  results.GetString("skillDescription")
                                  ));
            }

            results.Close();

            return(skillList);
        }
Example #19
0
 public void SetMagePassive(string name, string pathImage)//aqui tb
 {
     Passive = new SkillDmgBuff(name, pathImage)
     {
         ID           = 30,
         Damage       = 0,
         manaCost     = 0,
         block        = 1,
         Amplificator = 0.01,
         Buff         = 1.04,
         cooldown     = 0,
         timer        = 0,
         tipo         = SkillType.passive,
         atrib        = AtributBonus.For,
         tipoatributo = Element.Common
     };
     Passive.description = "Skill Passiva que faz coisas de skill passiva. Essa é uma descrição POG e XGH";
     Passive.Unlocked    = true;
     SkillList.Add(Passive);
 }
Example #20
0
    public P_Newton() : base("牛顿")
    {
        Sex   = PSex.Male;
        Age   = PAge.Renaissance;
        Index = 19;
        Cost  = 40;
        Tips  = "定位:防御\n" +
                "难度:中等\n" +
                "史实:英国物理学家、数学家。主要贡献包括但不限于发现万有引力定律、牛顿运动定律、光的色散原理,提出微积分、牛顿迭代法、二项式定理,发明反射式望远镜等。代表作《自然哲学的数学原理》。\n" +
                "攻略:\n牛顿是一个趣味性十足的武将,技能应用十分灵活,【惯性】的存在使其拥有极强的移动能力,能够灵活规避各种危险,同时在前期迅速攫取土地,中后期能够更快经过奖励处,从而拥有一定的续航能力。牛顿可以配合队友的上屋抽梯或逃避敌人的【剑舞】或【霸王】,需要较强的预判力。";

        PSkill Grx_ = new PSkill("惯性");

        SkillList.Add(Grx_
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(Grx_.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PPeriod.WalkingStage.Start,
                AIPriority = 10,
                Condition = (PGame Game) => {
                    return Game.NowPlayer.Equals(Player) && Player.Position.HouseNumber == 0 &&
                    Player.Money > 500;
                },
                AICondition = (PGame Game) => {
                    PStepCountTag StepCountTag = Game.TagManager.FindPeekTag <PStepCountTag>(PStepCountTag.TagName);
                    int Current = PAiMapAnalyzer.Expect(Game, Player, Game.Map.NextStepBlock(Player.Position, StepCountTag.StepCount));
                    PBlock NewtonTarget = Grx_Next(Game, Player.Position).Key;
                    int Possible = PAiMapAnalyzer.Expect(Game, Player, Game.Map.NextStepBlock(NewtonTarget, StepCountTag.StepCount));
                    return Possible - Current > 500;
                },
                Effect = (PGame Game) => {
                    Grx_.AnnouceUseSkill(Player);
                    Game.LoseMoney(Player, 500);
                    Game.MovePosition(Player, Player.Position, Grx_Next(Game, Player.Position).Key);
                }
            });
        }));
    }
Example #21
0
        public static SkillList GetNonRequiredSkills(JobRequest jobRequest)
        {
            string storedProcedureName = "usp_getNonRequiredSkills";

            MySqlParameter[] parameterList = new MySqlParameter[]
            {
                new MySqlParameter("jobRequestIDIn", jobRequest.JobRequestID)
            };

            MySqlDataReader results = ExecuteReader(storedProcedureName, parameterList);

            SkillList skillList = new SkillList();

            while (results.Read())
            {
                skillList.Add(new Skill(
                                  results.GetString("skillName"),
                                  results.GetString("skillDescription")
                                  ));
            }

            results.Close();
            return(skillList);
        }
Example #22
0
    public P_TangYin() : base("唐寅")
    {
        Sex   = PSex.Male;
        Age   = PAge.Industrial;
        Index = 20;
        Cost  = 25;
        Tips  = "定位:攻击\n" +
                "难度:简单\n" +
                "史实:明代画家、书法家、诗人,“明四家”和“吴中四才子”之一。以风流之名传于世,后代有“唐伯虎点秋香”等传说。\n" +
                "攻略:\n唐寅是一个上手简单的攻击型武将,并且具有一定的防御能力。【风流】作为主要输出技能,能够保持前期的经济压制和后期的装备压制,并可通过伤害类计策触发,因此【浑水摸鱼】【关门捉贼】等牌都是关键牌。【浪子】作为防御技能,能够在后期积累了一定装备的基础上避开关键区域,防止崩盘,因此唐寅对装备牌的需求也较大。唐寅可通过对队友造成伤害以获得装备;反之,【风流】的输出也会受到装备的限制,对手可以通过给唐寅没用的装备,替换唐寅原本的装备,降低【风流】的收益甚至令其变为负收益。";

        PSkill LangZi = new PSkill("浪子");

        SkillList.Add(LangZi
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.DiceStage.Start
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(LangZi.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 10,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) &&
                    Player.HasEquipInArea();
                },
                AICondition = (PGame Game) => {
                    KeyValuePair <PCard, int> CardValue = PAiCardExpectation.EquipToThrow(Game, Player);
                    KeyValuePair <int, int> SkillValue = LangZiBannedNumber(Game, Player);
                    return CardValue.Key != null && SkillValue.Key > 0 && SkillValue.Value >= 100 && SkillValue.Value + CardValue.Value >= 300;
                },
                Effect = (PGame Game) => {
                    LangZi.AnnouceUseSkill(Player);
                    PCard TargetCard = null;
                    if (Player.IsAI)
                    {
                        TargetCard = PAiCardExpectation.EquipToThrow(Game, Player).Key;
                    }
                    else
                    {
                        do
                        {
                            TargetCard = PNetworkManager.NetworkServer.ChooseManager.AskToChooseOwnCard(Player, LangZi.Name + "[选择一张装备牌]", true, true);
                        } while (!TargetCard.Type.IsEquipment());
                    }
                    if (TargetCard != null)
                    {
                        int BannedNumber = 0;
                        if (Player.IsAI)
                        {
                            BannedNumber = LangZiBannedNumber(Game, Player).Key;
                        }
                        else
                        {
                            BannedNumber = PNetworkManager.NetworkServer.ChooseManager.Ask1To6(Player, LangZi.Name + "[选择不会被掷出的数字]");
                        }
                        if (BannedNumber > 0)
                        {
                            Game.CardManager.MoveCard(TargetCard, Player.Area.HandCardArea.CardList.Contains(TargetCard) ? Player.Area.HandCardArea : Player.Area.EquipmentCardArea, Game.CardManager.ThrownCardHeap);
                            Player.Tags.CreateTag(new PNumberedTag(LangZi.Name, BannedNumber));
                        }
                    }
                }
            });
        })
                      .AddTrigger((PPlayer Player, PSkill Skill) => {
            return(new PTrigger(LangZi.Name + "[掷骰无效触发]")
            {
                IsLocked = true,
                Player = Player,
                Time = PPeriod.DiceStage.During,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) && Player.Tags.ExistTag(LangZi.Name);
                },
                Effect = (PGame Game) => {
                    int BannedNumber = Player.Tags.PopTag <PNumberedTag>(LangZi.Name).Value;
                    PDiceResultTag DiceResult = Game.TagManager.FindPeekTag <PDiceResultTag>(PDiceResultTag.TagName);
                    if (BannedNumber == DiceResult.DiceResult)
                    {
                        LangZi.AnnouceUseSkill(Player);
                        int NewNumber = BannedNumber;
                        while (NewNumber == BannedNumber)
                        {
                            NewNumber = PMath.RandInt(1, 6);
                        }
                        PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder("掷骰结果更改为" + NewNumber.ToString()));
                        DiceResult.DiceResult = NewNumber;
                    }
                }
            });
        })
                      );
        PSkill    FengLiu       = new PSkill("风流");
        const int FengLiuInjure = 600;

        SkillList.Add(FengLiu
                      .AddTimeTrigger(
                          new PTime[] {
            PTime.Injure.EmitInjure
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(FengLiu.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 150,
                Condition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    return InjureTag.Injure > 0 && Player.Equals(InjureTag.FromPlayer) && InjureTag.ToPlayer != null && !Player.Equals(InjureTag.ToPlayer);
                },
                AICondition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    PPlayer ToPlayer = InjureTag.ToPlayer;
                    if (ToPlayer.TeamIndex == Player.TeamIndex)
                    {
                        if (ToPlayer.Money > FengLiuInjure + InjureTag.Injure && ToPlayer.Money > Player.Money)
                        {
                            return true;
                        }
                        else if (ToPlayer.Money <= InjureTag.Injure)
                        {
                            return true;
                        }
                        else if (ToPlayer.Area.EquipmentCardArea.CardNumber == 0)
                        {
                            return false;
                        }
                    }
                    foreach (PCardType CardType in new PCardType[] {
                        PCardType.WeaponCard, PCardType.DefensorCard, PCardType.TrafficCard
                    })
                    {
                        PCard CurrentCard = Player.GetEquipment(CardType);
                        PCard TestCard = ToPlayer.GetEquipment(CardType);
                        if (ToPlayer.TeamIndex == Player.TeamIndex)
                        {
                            if (CurrentCard == null && TestCard != null && TestCard.Model.AIInEquipExpectation(Game, Player) > TestCard.Model.AIInEquipExpectation(Game, ToPlayer))
                            {
                                return true;
                            }
                        }
                        else if (CurrentCard != null && TestCard != null && CurrentCard.Model.AIInEquipExpectation(Game, Player) >= TestCard.Model.AIInEquipExpectation(Game, Player) + TestCard.Model.AIInEquipExpectation(Game, ToPlayer))
                        {
                            return false;
                        }
                    }
                    return ToPlayer.TeamIndex != Player.TeamIndex;
                },
                Effect = (PGame Game) => {
                    FengLiu.AnnouceUseSkill(Player);
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    PPlayer ToPlayer = InjureTag.ToPlayer;
                    int Answer = 0;
                    PCard TargetCard = null;
                    if (ToPlayer.Area.EquipmentCardArea.CardNumber == 0)
                    {
                        Answer = 1;
                    }
                    else
                    {
                        if (ToPlayer.IsAI)
                        {
                            if (ToPlayer.TeamIndex == Player.TeamIndex)
                            {
                                if (ToPlayer.Money <= InjureTag.Injure)
                                {
                                    Answer = 1;
                                }
                                else if (PAiCardExpectation.FindMostValuable(Game, Player, ToPlayer, false, true, false, true).Value > 0)
                                {
                                    Answer = 1;
                                }
                            }
                            else
                            {
                                int Value = FengLiuInjure * 2;
                                if (ToPlayer.Money <= InjureTag.Injure)
                                {
                                    Value -= FengLiuInjure;
                                }
                                else if (ToPlayer.Money <= InjureTag.Injure + FengLiuInjure)
                                {
                                    Value += 30000;
                                }

                                foreach (PCard TestCard in ToPlayer.Area.EquipmentCardArea.CardList)
                                {
                                    int NowValue = TestCard.Model.AIInEquipExpectation(Game, ToPlayer);
                                    int GiveValue = TestCard.Model.AIInEquipExpectation(Game, Player);
                                    int OverrideValue = 0;
                                    if (Player.GetEquipment(TestCard.Type) != null)
                                    {
                                        OverrideValue = Player.GetEquipment(TestCard.Type).Model.AIInEquipExpectation(Game, Player);
                                    }
                                    int ExtraValue = ToPlayer.General is P_HuaMulan ? 3500 : 0;
                                    if (Value > NowValue + GiveValue - OverrideValue - ExtraValue)
                                    {
                                        Value = NowValue + GiveValue - OverrideValue - ExtraValue;
                                        TargetCard = TestCard;
                                    }
                                }
                                if (TargetCard == null)
                                {
                                    Answer = 1;
                                }
                            }
                        }
                        else
                        {
                            Answer = PNetworkManager.NetworkServer.ChooseManager.Ask(ToPlayer, FengLiu.Name, new string[] { "交给" + Player.Name + "一件装备", "受到的伤害+" + FengLiuInjure.ToString() });
                        }
                    }
                    if (Answer == 0)
                    {
                        Game.GiveCardTo(ToPlayer, Player, false, true, false, true);
                    }
                    else
                    {
                        InjureTag.Injure += FengLiuInjure;
                    }
                }
            });
        })
                      );
    }
Example #23
0
    public P_LiuJi() : base("刘基")
    {
        Sex   = PSex.Male;
        Age   = PAge.Industrial;
        Index = 12;
        Cost  = 10;
        Tips  = "定位:防御\n" +
                "难度:简单\n" +
                "史实:明代政治家、文学家,“明初诗文三大家”之一,在平定张士诚、陈友谅和北伐中作为参谋,以神机妙算著称。\n" +
                "攻略:\n刘基作为军事大师,两个技能均和判定有关,可以称作是使用伏兵的专家。刘基可以从【闪电】、【瘟疫】、【陷阱】这类会轮转的牌中获益,而对于【乐不思蜀】、【兵粮寸断】有天然的免疫能力。\n【八卦阵】可以说是刘基的神器,当刘基持有【八卦阵】时,每次受到伤害不但减半,而且反而可以摸1000,配合陈圆圆,队友之间互相伤害可以形成共赢的效果。";

        PSkill MiaoSuan = new PSkill("妙算")
        {
            SoftLockOpen = true
        };

        SkillList.Add(MiaoSuan
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(MiaoSuan.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PTime.Judge.JudgeTime,
                AIPriority = 100,
                Condition = (PGame Game) => {
                    PJudgeTag JudgeTag = Game.TagManager.FindPeekTag <PJudgeTag>(PJudgeTag.TagName);
                    return JudgeTag.Player.Equals(Player);
                },
                Effect = (PGame Game) => {
                    PJudgeTag JudgeTag = Game.TagManager.FindPeekTag <PJudgeTag>(PJudgeTag.TagName);
                    MiaoSuan.AnnouceUseSkill(Player);
                    int ChosenResult = 1;
                    if (Player.IsAI)
                    {
                        ChosenResult = JudgeTag.AdvisedResult;
                    }
                    else
                    {
                        ChosenResult = PNetworkManager.NetworkServer.ChooseManager.Ask1To6(Player, MiaoSuan.Name);
                    }
                    JudgeTag.Result = ChosenResult;
                }
            });
        }));

        PSkill TianDu = new PSkill("天妒")
        {
            SoftLockOpen = true
        };

        SkillList.Add(TianDu
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(TianDu.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PTime.Judge.AfterJudgeTime,
                AIPriority = 100,
                Condition = (PGame Game) => {
                    PJudgeTag JudgeTag = Game.TagManager.FindPeekTag <PJudgeTag>(PJudgeTag.TagName);
                    return JudgeTag.Player.Equals(Player);
                },
                Effect = (PGame Game) => {
                    PJudgeTag JudgeTag = Game.TagManager.FindPeekTag <PJudgeTag>(PJudgeTag.TagName);
                    TianDu.AnnouceUseSkill(Player);
                    Game.GetMoney(Player, 200 * JudgeTag.Result);
                }
            });
        }));
    }
Example #24
0
    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);
                    }
                }
            });
        }));
    }
Example #25
0
    public P_HuaMulan() : base("花木兰")
    {
        Sex   = PSex.Female;
        Age   = PAge.Renaissance;
        Index = 23;
        Cost  = 20;
        Tips  = "定位:爆发\n" +
                "难度:简单\n" +
                "史实:出自经典诗歌《木兰辞》。中国古代替父从军的女英雄。\n" +
                "攻略:\n花木兰是一名拥有不俗爆发能力的武将。【枭姬】的存在使得花木兰极度依赖装备牌,因此能够与唐寅、时迁等武将配合,同时也能够对这些武将形成强大的威慑力。【枭姬】往往能够提供绝地反杀的能力,或能使花木兰东山再起,因此在针对花木兰时必须注意其队伍的研究所或给牌武将,同时慎用【落凤弓】、【借刀杀人】等牌,从一定程度上来说提供了花木兰一定的防御力。【易装】是一个强大的爆发技能,不仅能与队友交换装备达成爆发,还能抢夺敌方的大量装备,形成局势逆转,因此可在一定程度上克制关羽。【易装】还可用来转换性别,从而使敌方的【百花裙】等装备失效。针对花木兰必须阻止其装备成形,因此吕蒙是一个不错的选择。";

        PSkill XiaoJi = new PSkill("枭姬")
        {
            SoftLockOpen = true
        };

        SkillList.Add(XiaoJi
                      .AddTrigger((PPlayer Player, PSkill Skill) => {
            return(new PTrigger(XiaoJi.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PTime.Card.LeaveAreaTime,
                AIPriority = 200,
                Condition = (PGame Game) => {
                    PMoveCardTag MoveCardTag = Game.TagManager.FindPeekTag <PMoveCardTag>(PMoveCardTag.TagName);
                    return Player.Area.EquipmentCardArea.Equals(MoveCardTag.Source) && !Player.Equals(MoveCardTag.Destination.Owner);
                },
                Effect = (PGame Game) => {
                    XiaoJi.AnnouceUseSkill(Player);
                    Game.GetCard(Player);
                    Game.GetMoney(Player, 1500);
                }
            });
        }));

        PPlayer YiZhuangTarget(PGame Game, PPlayer Player)
        {
            return(PMath.Max(Game.AlivePlayers(Player), (PPlayer TargetPlayer) => {
                int Profit = 0;
                PSex OriginalSex = Player.Sex;
                Player.Sex = PSex.Male;
                foreach (PCardType CardType in new PCardType[] {
                    PCardType.WeaponCard, PCardType.DefensorCard, PCardType.TrafficCard
                })
                {
                    PCard Card = Player.GetEquipment(CardType);
                    PCard TargetCard = TargetPlayer.GetEquipment(CardType);
                    if (Card != null)
                    {
                        Profit += 2000;
                        Profit -= Card.Model.AIInEquipExpectation(Game, Player);
                        Profit += Card.Model.AIInEquipExpectation(Game, TargetPlayer) * (Player.TeamIndex == TargetPlayer.TeamIndex ? 1 : -1);
                    }
                    if (TargetCard != null)
                    {
                        Profit += TargetCard.Model.AIInEquipExpectation(Game, Player);
                        Profit -= TargetCard.Model.AIInEquipExpectation(Game, TargetPlayer) * (Player.TeamIndex == TargetPlayer.TeamIndex ? 1 : -1);
                    }
                }
                Player.Sex = OriginalSex;
                return Profit - 7500;
            }, true).Key);
        }

        PSkill YiZhuang = new PSkill("易装")
        {
            Initiative = true
        };

        SkillList.Add(YiZhuang
                      .AnnounceGameOnce()
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(YiZhuang.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(YiZhuang.Name);
                },
                AICondition = (PGame Game) => {
                    if (Game.Teammates(Player).Exists((PPlayer _Player) => _Player.General is P_WuZhao))
                    {
                        PPlayer _Player = Game.PlayerList.Find((PPlayer __Player) => __Player.General is P_WuZhao);
                        if (_Player.RemainLimit("女权"))
                        {
                            return false;
                        }
                        else if (Player.Tags.ExistTag(P_WuZhao.NvQuanTag.Name))
                        {
                            return false;
                        }
                    }
                    return YiZhuangTarget(Game, Player) != null;
                },
                Effect = (PGame Game) => {
                    YiZhuang.AnnouceUseSkill(Player);
                    PPlayer Target = null;
                    if (Player.IsAI)
                    {
                        Target = YiZhuangTarget(Game, Player);
                    }
                    else
                    {
                        Target = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.Except(Player), YiZhuang.Name);
                    }
                    if (Target != null)
                    {
                        List <PCard> MulanEquipments = new List <PCard>();
                        foreach (PCard Card in Player.Area.EquipmentCardArea.CardList)
                        {
                            MulanEquipments.Add(Card);
                        }
                        List <PCard> TargetEquipements = new List <PCard>();
                        foreach (PCard Card in Target.Area.EquipmentCardArea.CardList)
                        {
                            TargetEquipements.Add(Card);
                        }
                        foreach (PCard Card in MulanEquipments)
                        {
                            Game.CardManager.MoveCard(Card, Player.Area.EquipmentCardArea, Game.CardManager.SettlingArea);
                        }
                        foreach (PCard Card in TargetEquipements)
                        {
                            Game.CardManager.MoveCard(Card, Target.Area.EquipmentCardArea, Game.CardManager.SettlingArea);
                        }
                        foreach (PCard Card in MulanEquipments)
                        {
                            Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Target.Area.EquipmentCardArea);
                        }
                        foreach (PCard Card in TargetEquipements)
                        {
                            Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Player.Area.EquipmentCardArea);
                        }
                        Player.Sex = PSex.Male;
                        Player.Tags.CreateTag(new PTag(YiZhuang.Name));
                        YiZhuang.DeclareUse(Player);
                    }
                }
            });
        }));
    }
Example #26
0
    public P_YuJi() : base("虞姬")
    {
        Sex   = PSex.Female;
        Age   = PAge.Classic;
        Index = 13;
        Cost  = 15;
        Tips  = "定位:攻击\n" +
                "难度:简单\n" +
                "史实:楚汉相争时期,西楚霸王项羽的美人,项羽曾为其作《垓下歌》。\n" +
                "攻略:\n虞姬是一个依赖于手牌的武将,所以研究所是她和她的队友的优先选择。对于虞姬而言,如何较为准确地衡量手牌的价值是一个比较困难的问题。对于两张点数不同的牌,两张牌自身的价值有高有低,两张牌用来【剑舞】的价值也有高有低,使用什么牌来【剑舞】,是虞姬玩家水平分别的体现。\n" +
                "通常,虞姬玩家可以弃掉自己不需要的装备、伏兵和难以发挥积极作用的【擒贼擒王】、【假痴不癫】、【空城计】等牌发动【剑舞】。虞姬玩家也可以在手上存留很多牌,当与敌人近身接触时,把所有牌都用来【剑舞】,造成巨大的输出,以求直接杀死对手。";

        PSkill JianWu = new PSkill("剑舞")
        {
            Initiative = true
        };

        KeyValuePair <PCard, int> JianWuTest(PGame Game, PPlayer Player)
        {
            KeyValuePair <PCard, int> Answer = new KeyValuePair <PCard, int>(null, 0);

            for (int i = 1; i <= 6; ++i)
            {
                int Expect = (int)PMath.Sum(Game.AlivePlayers().FindAll((PPlayer _Player) => {
                    return(!_Player.Equals(Player) && _Player.Distance(Player) <= i);
                }).ConvertAll((PPlayer _Player) => {
                    return((double)PAiTargetChooser.InjureExpect(Game, Player, Player, _Player, 800, JianWu));
                }));
                KeyValuePair <PCard, int> Test = PMath.Max(Player.Area.HandCardArea.CardList.FindAll((PCard Card) => Card.Point == i), (PCard Card) => {
                    return(Expect - Card.Model.AIInHandExpectation(Game, Player));
                }, true);
                if (Test.Value > Answer.Value)
                {
                    Answer = Test;
                }
            }
            return(Answer);
        }

        SkillList.Add(JianWu
                      .AddTimeTrigger(
                          new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        },
                          (PTime Time, PPlayer Player, PSkill Skill) => {
            return(new PTrigger(JianWu.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = Time,
                AIPriority = 190,
                CanRepeat = true,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Player.Area.HandCardArea.CardNumber > 0;
                },
                AICondition = (PGame Game) => {
                    return JianWuTest(Game, Player).Key != null;
                },
                Effect = (PGame Game) => {
                    JianWu.AnnouceUseSkill(Player);
                    PCard TargetCard = null;
                    if (Player.IsAI)
                    {
                        TargetCard = JianWuTest(Game, Player).Key;
                        PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder(Player.Name + "弃置了" + Player.Name + "的" + TargetCard.Name));
                        Game.CardManager.MoveCard(TargetCard, Player.Area.HandCardArea, Game.CardManager.ThrownCardHeap);
                    }
                    else
                    {
                        TargetCard = Game.ThrowCard(Player, Player, true, false);
                    }
                    if (TargetCard != null)
                    {
                        Game.Traverse((PPlayer _Player) => {
                            if (!_Player.Equals(Player) && _Player.Distance(Player) <= TargetCard.Point)
                            {
                                Game.Injure(Player, _Player, 800, JianWu);
                            }
                        }, Player);
                    }
                }
            });
        }));
    }
Example #27
0
    public P_ZhuQue() : base("朱雀")
    {
        Sex         = PSex.Male;
        Age         = PAge.Ancient;
        Index       = 1003;
        Cost        = 1;
        Tips        = string.Empty;
        CanBeChoose = false;

        //PSkill ShenShou = new PSkill("神兽") {
        //    Lock = true
        //};
        //SkillList.Add(ShenShou
        //    .AddTrigger(
        //    (PPlayer Player, PSkill Skill) => {
        //        return new PTrigger(ShenShou.Name) {
        //            IsLocked = true,
        //            Player = Player,
        //            Time = PTime.StartGameTime,
        //            AIPriority = 100,
        //            Effect = (PGame Game) => {
        //                ShenShou.AnnouceUseSkill(Player);
        //                Game.GetMoney(Player, 30000);
        //            }
        //        };
        //    })
        //    .AddTrigger(
        //    (PPlayer Player, PSkill Skill) => {
        //        return new PTrigger(ShenShou.Name) {
        //            IsLocked = true,
        //            Player = Player,
        //            Time = PPeriod.StartTurn.During,
        //            AIPriority = 100,
        //            Condition = (PGame Game) => {
        //                return Player.Equals(Game.NowPlayer);
        //            },
        //            Effect = (PGame Game) => {
        //                ShenShou.AnnouceUseSkill(Player);
        //                Game.GetMoney(Player, 500);
        //            }
        //        };
        //    }));

        PSkill ZhuQue = new PSkill("朱雀")
        {
            Lock = true
        };

        SkillList.Add(ZhuQue
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(ZhuQue.Name)
            {
                IsLocked = true,
                Player = Player,
                Time = PPeriod.StartTurn.During,
                AIPriority = 250,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer);
                },
                Effect = (PGame Game) => {
                    ZhuQue.AnnouceUseSkill(Player);
                    Game.Traverse((PPlayer _Player) => {
                        if (!_Player.Equals(Player))
                        {
                            Game.LoseMoney(_Player, 300);
                        }
                    }, Player);
                }
            });
        }));
    }
Example #28
0
    public P_PanYue() : base("潘岳")
    {
        Sex   = PSex.Male;
        Age   = PAge.Medieval;
        Index = 2;
        Tips  = "定位:辅助\n" +
                "难度:简单\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 XianJu = new PSkill("闲居");

        SkillList.Add(XianJu
                      // 用每回合限一次这个模板控制条件
                      .AnnounceTurnOnce()
                      // 回合结束时触发技能
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(XianJu.Name)
            {
                IsLocked = false,
                Player = Player,
                Time = PPeriod.EndTurn.During,
                AIPriority = 100,
                Condition = (PGame Game) => {
                    return Player.Equals(Game.NowPlayer) && Player.Position.Lord != null && !Player.Equals(Player.Position.Lord) && Player.RemainLimit(XianJu.Name);
                },
                AICondition = (PGame Game) => {
                    return Player.Position.Lord.TeamIndex == Player.TeamIndex;
                },
                Effect = (PGame Game) => {
                    XianJu.AnnouceUseSkill(Player);
                    Game.GetHouse(Player.Position, 1);
                }
            });
        })

                      // 伤害结算结束时,如果造成或受到伤害,将每回合限一次的模板打上标记
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(XianJu.Name + "[条件记录]")
            {
                IsLocked = true,
                Player = Player,
                Time = PTime.Injure.EndSettle,
                Condition = (PGame Game) => {
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    return Player.Equals(Game.NowPlayer) && (Player.Equals(InjureTag.ToPlayer) || Player.Equals(InjureTag.FromPlayer)) && InjureTag.Injure > 0;
                },
                Effect = (PGame Game) => {
                    Player.Tags.FindPeekTag <PUsedTag>(PUsedTag.TagNamePrefix + XianJu.Name).Count++;
                }
            });
        }));
    }
Example #29
0
    public P_BaiHu() : base("白虎")
    {
        Sex         = PSex.Male;
        Age         = PAge.Ancient;
        Index       = 1002;
        Cost        = 1;
        Tips        = string.Empty;
        CanBeChoose = false;

        //PSkill ShenShou = new PSkill("神兽") {
        //    Lock = true
        //};
        //SkillList.Add(ShenShou
        //    .AddTrigger(
        //    (PPlayer Player, PSkill Skill) => {
        //        return new PTrigger(ShenShou.Name) {
        //            IsLocked = true,
        //            Player = Player,
        //            Time = PTime.StartGameTime,
        //            AIPriority = 100,
        //            Effect = (PGame Game) => {
        //                ShenShou.AnnouceUseSkill(Player);
        //                Game.GetMoney(Player, 30000);
        //            }
        //        };
        //    })
        //    .AddTrigger(
        //    (PPlayer Player, PSkill Skill) => {
        //        return new PTrigger(ShenShou.Name) {
        //            IsLocked = true,
        //            Player = Player,
        //            Time = PPeriod.StartTurn.During,
        //            AIPriority = 100,
        //            Condition = (PGame Game) => {
        //                return Player.Equals(Game.NowPlayer);
        //            },
        //            Effect = (PGame Game) => {
        //                ShenShou.AnnouceUseSkill(Player);
        //                Game.GetMoney(Player, 500);
        //            }
        //        };
        //    }));

        PSkill BaiHu = new PSkill("白虎")
        {
            Lock = true
        };

        SkillList.Add(BaiHu
                      .AddTrigger(
                          (PPlayer Player, PSkill Skill) => {
            return(new PTrigger(BaiHu.Name)
            {
                IsLocked = true,
                Player = Player,
                Time = PPeriod.EndTurn.During,
                AIPriority = 250,
                Condition = (PGame Game) => {
                    PChiaTaoFaKuoTag ChiaTaoFaKuoTag = Game.TagManager.FindPeekTag <PChiaTaoFaKuoTag>(PChiaTaoFaKuoTag.TagName);
                    return Player.Equals(Game.NowPlayer) && ChiaTaoFaKuoTag.LordList.Count >= 1;
                },
                Effect = (PGame Game) => {
                    BaiHu.AnnouceUseSkill(Player);
                    PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                    PChiaTaoFaKuoTag ChiaTaoFaKuoTag = Game.TagManager.FindPeekTag <PChiaTaoFaKuoTag>(PChiaTaoFaKuoTag.TagName);
                    ChiaTaoFaKuoTag.LordList.ForEach((PPlayer _Player) => {
                        if (!_Player.Tags.ExistTag(PTag.LockedTag.Name))
                        {
                            _Player.Tags.CreateTag(PTag.LockedTag);
                        }
                    });
                }
            });
        }));
    }
Example #30
0
    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);
                }
            });
        }));
    }