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


C# Person.MoveToArchitecture方法代码示例

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


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

示例1: 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

示例2: ConvincePersonInTroop

        private void ConvincePersonInTroop(Person person)
        {
            if (person.LocationTroop.PersonCount >= 2)
            {
                if (!person.LocationTroop.Destroyed)
                {
                    Troop locationTroop = person.LocationTroop;

                    person.LocationTroop.Persons.Remove(person);
                    person.LocationTroop = null;
                    locationTroop.RefreshAfterLosePerson();
                    person.MoveToArchitecture(this.BelongedFaction.Capital, locationTroop.Position);

                }
                else
                {
                    person.MoveToArchitecture(this.BelongedFaction.Capital, null);

                }
            }
            else
            {
                if (!person.LocationTroop.Destroyed)
                {
                    person.LocationTroop.ChangeFaction(this.BelongedFaction);
                }
            }
        }
开发者ID:k45399735,项目名称:ZhongHuaSanGuoZhi,代码行数:28,代码来源:Person.cs

示例3: CreateNewFaction

        private void CreateNewFaction(Person leader)
        {
            if (leader.Status != PersonStatus.Normal && leader.Status != PersonStatus.NoFaction) return;

            Faction newFaction = new Faction();
            newFaction.Scenario = this;
            newFaction.ID = this.Factions.GetFreeGameObjectID();
            this.Factions.AddFactionWithEvent(newFaction);
            foreach (Faction faction2 in this.Factions)
            {
                if (faction2 != newFaction)
                {
                    this.DiplomaticRelations.AddDiplomaticRelation(this, newFaction.ID, faction2.ID, 0);
                }
            }
            newFaction.Leader = leader;
            leader.Loyalty = 100;
            newFaction.Reputation = leader.Reputation;
            newFaction.Name = leader.Name;
            if (leader.PersonBiography != null)
            {
                foreach (MilitaryKind kind in leader.PersonBiography.MilitaryKinds.MilitaryKinds.Values)
                {
                    newFaction.BaseMilitaryKinds.AddMilitaryKind(kind);
                }
                newFaction.ColorIndex = leader.PersonBiography.FactionColor;
            }
            else
            {
                newFaction.BaseMilitaryKinds.AddBasicMilitaryKinds(this);
                newFaction.ColorIndex = -1;
            }

            List<int> allUnusedColors = new List<int>();
            for (int i = 0; i < this.GameCommonData.AllColors.Count; ++i)
            {
                allUnusedColors.Add(i);
            }
            foreach (Faction f in this.Factions)
            {
                allUnusedColors.Remove(f.ColorIndex);
            }
            if (allUnusedColors.Count == 0)
            {
                newFaction.ColorIndex = GameObject.Random(this.GameCommonData.AllColors.Count);
            }
            else
            {
                if (!allUnusedColors.Contains(newFaction.ColorIndex))
                {
                    newFaction.ColorIndex = allUnusedColors[GameObject.Random(allUnusedColors.Count)];
                }
            }

            newFaction.FactionColor = this.GameCommonData.AllColors[newFaction.ColorIndex];

            Architecture newFactionCapital = leader.LocationArchitecture;
            Faction oldFaction = newFactionCapital.BelongedFaction;

            newFaction.Capital = newFactionCapital;

            if (leader.BelongedFaction == null)
            {
                leader.Status = PersonStatus.Normal;
            }
            else
            {
                this.ChangeDiplomaticRelation(newFaction.ID, newFactionCapital.BelongedFaction.ID, -500);
            }
            newFaction.PrepareData();

            newFactionCapital.ResetFaction(newFaction);

            newFaction.AddArchitectureKnownData(newFactionCapital);
            newFaction.FirstSection.AddArchitecture(newFactionCapital);

            leader.MoveToArchitecture(newFactionCapital);

            if (oldFaction != null && !GameObject.Chance((int)oldFaction.Leader.PersonalLoyalty * 10))
            {
                oldFaction.Leader.AddHated(leader);
            }
            foreach (Person p in this.AvailablePersons)
            {
                if ((p.BelongedFaction == null || p.BelongedFaction == oldFaction) && !p.IsCaptive && p.Status != PersonStatus.Princess && p != leader)
                {
                    int offset = Person.GetIdealOffset(leader, p);
                    if (p.HasCloseStrainTo(leader) || p.IsVeryCloseTo(leader) || (GameObject.Chance(100 - offset * 20)))
                    {
                        if (p.BelongedFaction == null || p.IsVeryCloseTo(leader) || (GameObject.Chance(100 - ((int)p.PersonalLoyalty) * 25 + (5 - offset) * 10)
                            && GameObject.Chance(220 - p.Loyalty * 2 + (5 - offset) * 20)))
                        {
                            if (p.BelongedFaction != null)
                            {
                                p.ChangeFaction(newFaction);
                            }
                            p.InitialLoyalty();
                            if (p.LocationTroop == null)
                            {
                                p.MoveToArchitecture(newFactionCapital);
//.........这里部分代码省略.........
开发者ID:hero1991,项目名称:ZhongHuaSanGuoZhi,代码行数:101,代码来源:GameScenario.cs

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