当前位置: 首页>>代码示例>>C#>>正文


C# Person.ChangeFaction方法代码示例

本文整理汇总了C#中GameObjects.Person.ChangeFaction方法的典型用法代码示例。如果您正苦于以下问题:C# Person.ChangeFaction方法的具体用法?C# Person.ChangeFaction怎么用?C# Person.ChangeFaction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameObjects.Person的用法示例。


在下文中一共展示了Person.ChangeFaction方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ApplyEffectKind

 public override void ApplyEffectKind(Person person, Event e)
 {
     if (person.BelongedFaction == null && person.LocationArchitecture != null)
     {
         person.Status = GameObjects.PersonDetail.PersonStatus.Normal;
         person.ChangeFaction(person.LocationArchitecture.BelongedFaction);
     }
     else if (person.LocationArchitecture != null && person.BelongedCaptive != null)
     {
         person.ChangeFaction(person.BelongedCaptive.LocationArchitecture.BelongedFaction);
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:12,代码来源:EventEffect210.cs

示例2: ApplyEffectKind

        public override void ApplyEffectKind(Person person, Event e)
        {
            FactionList factionlist = person.Scenario.Factions;
            Faction targetFaction = factionlist.GetGameObject(targetFactionID) as Faction;
            /*
            if (targetFaction != null)
            {
                throw new Exception("targetFaction 为" + targetFaction.Name);
            }
            */

            if (person.BelongedFaction == null && person.LocationArchitecture != null && targetFaction != null)
            {
                //person.Status = GameObjects.PersonDetail.PersonStatus.Normal;
                person.MoveToArchitecture(targetFaction.Capital);
                person.ChangeFaction(targetFaction);
            }
            else if (person.LocationArchitecture != null && person.LocationArchitecture.BelongedFaction != null)
            {
                person.MoveToArchitecture(targetFaction.Capital);
                person.ChangeFaction(targetFaction);
                //person.ChangeFaction(targetFaction);
            }
        }
开发者ID:kpxp,项目名称:ZhongHuaSanGuoZhi-New-Code,代码行数:24,代码来源:EventEffect250.cs

示例3: shoudongluyong

        /*
        public void shoudongluyong()
        {
            this.shoudongluyongshibai = false;
            this.HireNoFactionPerson();
            if (this.shoudongluyongshibai)
            {
                this.Scenario.GameScreen.xianshishijiantupian(this.NoFactionPersons[0] as Person, "", "luyongshibai", "", "",true );

            }
            this.shoudongluyongshibai = false;
        }
        */
        public void ManualHire(Person person)
        {
            this.DecreaseFund(this.HirePersonFund);

            if ((person.BelongedFaction != null) || (person.LocationArchitecture != this))
            {
                //this.NoFactionPerson.Remove(person);
                this.Scenario.GameScreen.xianshishijiantupian(person, "", "luyongshibai", "", "", true);

            }
            else
            {
                int idealOffset = Person.GetIdealOffset(person, this.BelongedFaction.Leader);
                if (GlobalVariables.IdealTendencyValid && idealOffset > person.IdealTendency.Offset + (double)this.BelongedFaction.Reputation / this.BelongedFaction.MaxPossibleReputation * 75)
                {
                    this.Scenario.GameScreen.xianshishijiantupian(person, "", "LinianButong", "", "", true);

                }
                else if (
                        (!GlobalVariables.IdealTendencyValid || (idealOffset <= person.IdealTendency.Offset + (double)this.BelongedFaction.Reputation / this.BelongedFaction.MaxPossibleReputation * 75))
                        && (GameObject.Random(idealOffset * idealOffset + 100) < 100)
                        && (!this.BelongedFaction.IsAlien || (int)person.PersonalLoyalty < 2)
                        && (!person.HatedPersons.Contains(this.BelongedFaction.LeaderID))
                       )
                {
                    person.ChangeFaction(this.BelongedFaction);
                    ExtensionInterface.call("HirePerson", new Object[] { this.Scenario, this, person });

                    this.Scenario.GameScreen.xianshishijiantupian(person, this.Name, "ArchitectureHirePerson", "", "", this.BelongedFaction.Name, false);
                    if (this.HasSpy)
                    {
                        this.CreateHireNewPersonSpyMessage(person);
                    }
                }
                else
                {
                    this.Scenario.GameScreen.xianshishijiantupian(person, "", "luyongshibai", "", "", true);

                }
            }

            this.HireFinished = true;
            this.HasManualHire = true;
        }
开发者ID:kanjianlema,项目名称:ZhongHuaSanGuoZhi,代码行数:57,代码来源:Architecture.cs

示例4: haizichusheng

        public void haizichusheng(Person person, Person father, Person muqin, bool doAffect)
        {
            person.Available = true;
            foreach (Treasure treasure in person.Treasures)
            {
                treasure.Available = true;
            }

            person.LocationArchitecture = muqin.BelongedArchitecture;
            person.ChangeFaction(muqin.BelongedFaction);

            if (muqin.IsCaptive)
            {
                person.Loyalty = muqin.Loyalty;
                Captive c = Captive.Create(this, person, muqin.BelongedCaptive.BelongedFaction);
            }
            else
            {
                if (GlobalVariables.lockChildrenLoyalty && father != null && father.BelongedFaction == person.LocationArchitecture.BelongedFaction)
                {
                    person.Loyalty = 120;
                }
                if (GameObject.Chance(father.childrenLoyaltyRate))
                {
                    person.Loyalty = father.childrenLoyalty;
                }
                else if (GameObject.Chance(muqin.childrenLoyaltyRate))
                {
                    person.Loyalty = muqin.childrenLoyalty;
                }
            }

            if (doAffect)
            {
                person.muqinyingxiangnengli(muqin);
            }
            if (person.BaseCommand < 1) person.BaseCommand = 1;
            if (person.BaseStrength < 1) person.BaseStrength = 1;
            if (person.BaseIntelligence < 1) person.BaseIntelligence = 1;
            if (person.BasePolitics < 1) person.BasePolitics = 1;
            if (person.BaseGlamour < 1) person.BaseGlamour = 1;
            this.GameScreen.haizizhangdachengren(person, person);
        }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:43,代码来源:GameScenario.cs

示例5: haizichusheng

        public void haizichusheng(Person person, Person father, Person muqin, bool doAffect)
        {
            person.Available = true;
            foreach (Treasure treasure in person.Treasures)
            {
                treasure.Available = true;
            }

            person.LocationArchitecture = muqin.BelongedArchitecture;
            person.ChangeFaction(muqin.BelongedFaction);

            if (muqin.IsCaptive)
            {
                person.Loyalty = muqin.Loyalty;
                Captive.Create(this, person, muqin.BelongedArchitecture.BelongedFaction);
            }
            else
            {
                if (GlobalVariables.lockChildrenLoyalty && father != null && father.BelongedFaction == person.LocationArchitecture.BelongedFaction)
                {
                    person.Loyalty = 120;
                }
                if (GameObject.Chance(father.childrenLoyaltyRate))
                {
                    person.Loyalty = father.childrenLoyalty;
                }
                else if (GameObject.Chance(muqin.childrenLoyaltyRate))
                {
                    person.Loyalty = muqin.childrenLoyalty;
                }
            }

            ExtensionInterface.call("ChildrenJoinFaction", new Object[] { this, person });

            this.GameScreen.haizizhangdachengren(person, person);
        }
开发者ID:hero1991,项目名称:ZhongHuaSanGuoZhi,代码行数:36,代码来源:GameScenario.cs

示例6: ConvincePersonSuccess

        internal void ConvincePersonSuccess(Person person)
        {
            if (this.BelongedFaction == null)  //盗贼不能说服武将
            {
                return;
            }
            GameObjects.Faction belongedFaction = null;
            if (person.BelongedFaction != null && this.BelongedFaction!=null)
            {
                belongedFaction = person.BelongedFaction;
                base.Scenario.ChangeDiplomaticRelation(this.BelongedFaction.ID, person.BelongedFaction.ID, -10);
                if (person.BelongedFaction.Leader.hasStrainTo(person))
                {
                    base.Scenario.ChangeDiplomaticRelation(this.BelongedFaction.ID, person.BelongedFaction.ID, -10);
                }
                if (person.BelongedFaction.Leader.hasCloseStrainTo(person))
                {
                    base.Scenario.ChangeDiplomaticRelation(this.BelongedFaction.ID, person.BelongedFaction.ID, -10);
                }
                person.RebelCount++;
            }

            Architecture from = null;
            if (person.IsCaptive)
            {
                from = person.BelongedCaptive.LocationArchitecture;
                person.Status = PersonStatus.Normal;
                person.BelongedCaptive = null;
            }
            else if (person.LocationTroop != null)
            {
                from = person.LocationTroop.StartingArchitecture;
            }
            else
            {
                from = person.LocationArchitecture;
            }

            person.ChangeFaction(this.BelongedFaction);

            if (person.LocationTroop != null)  //单挑中说服敌人
            {
                this.ConvincePersonInTroop(person);
            }
            else if (from == null)
            {
                person.MoveToArchitecture(this.TargetArchitecture, null);
            }
            else
            {
                person.MoveToArchitecture(this.TargetArchitecture, from.ArchitectureArea.Area[0]);
            }

            /*if (!(flag || (person.LocationArchitecture == null)))
            {
                person.LocationArchitecture.RemovePerson(person);
            }*/
            this.AddGlamourExperience(40);
            this.IncreaseReputation(40);
            this.BelongedFaction.IncreaseReputation(20 * this.MultipleOfTacticsReputation);
            this.BelongedFaction.IncreaseTechniquePoint((20 * this.MultipleOfTacticsTechniquePoint) * 100);

            ExtensionInterface.call("DoConvinceSuccess", new Object[] { this.Scenario, this });
            if (this.OnConvinceSuccess != null)
            {
                this.OnConvinceSuccess(this, person, belongedFaction);
            }
        }
开发者ID:k45399735,项目名称:ZhongHuaSanGuoZhi,代码行数:68,代码来源:Person.cs


注:本文中的GameObjects.Person.ChangeFaction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。