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


C# Troop.RefreshAfterLosePerson方法代码示例

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


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

示例1: HandleChallengeResult

        internal void HandleChallengeResult(TroopDamage damage, int result, Troop sourceTroop, Person sourcePerson, Troop destinationTroop, Person destinationPerson, GameScenario scenario)
        {
            scenario.GameScreen.TroopPersonChallenge(result, sourceTroop, sourcePerson, destinationTroop, destinationPerson);

            switch (result)
            {
                case 1: //P1武将胜利
                    sourcePerson.Scenario.YearTable.addChallengeEntry(sourcePerson.Scenario.Date, sourcePerson, destinationPerson, "被打下馬");
                    damage.SourceMoraleChange += 20;
                    damage.DestinationMoraleChange -= 20;
                    damage.SourceCombativityChange += 20;
                    damage.DestinationCombativityChange -= 20;  //第2只军队战意下降
                    break;
                case 2: //2:P2武将胜利
                    sourcePerson.Scenario.YearTable.addChallengeEntry(sourcePerson.Scenario.Date, destinationPerson, sourcePerson, "被打下馬");
                    damage.SourceMoraleChange -= 20;
                    damage.DestinationMoraleChange += 20;
                    damage.SourceCombativityChange -= 20;
                    damage.DestinationCombativityChange += 20;
                    break;
                case 3: //3:P1武将被杀
                    sourcePerson.Scenario.YearTable.addChallengeEntry(sourcePerson.Scenario.Date, destinationPerson, sourcePerson, "被擊殺");
                    this.challengePersonDie(sourcePerson,sourceTroop, destinationPerson);
                    damage.SourceMoraleChange -= 30;
                    damage.DestinationMoraleChange += 30;
                    damage.SourceCombativityChange -= 30;
                    damage.DestinationCombativityChange += 30;
                    break;
                case 4: //4:P2武将被杀
                    sourcePerson.Scenario.YearTable.addChallengeEntry(sourcePerson.Scenario.Date, sourcePerson, destinationPerson, "被擊殺");
                    this.challengePersonDie(destinationPerson, destinationTroop, sourcePerson);
                    damage.SourceMoraleChange += 30;
                    damage.DestinationMoraleChange -= 30;
                    damage.SourceCombativityChange += 30;
                    damage.DestinationCombativityChange -= 30;
                    break;
                case 5: //5:P1武将逃跑
                    sourcePerson.Scenario.YearTable.addChallengeEntry(sourcePerson.Scenario.Date, destinationPerson, sourcePerson, "逃跑");
                    damage.SourceMoraleChange -= 20;
                    damage.DestinationMoraleChange += 20;
                    break;
                case 6: //6:P2武将逃跑
                    sourcePerson.Scenario.YearTable.addChallengeEntry(sourcePerson.Scenario.Date, sourcePerson, destinationPerson, "逃跑");
                    damage.SourceMoraleChange += 20;
                    damage.DestinationMoraleChange -= 20;
                    break;
                case 7: //7、P1武将被俘虏
                    sourcePerson.Scenario.YearTable.addChallengeEntry(sourcePerson.Scenario.Date, destinationPerson, sourcePerson, "被俘虜");
                    destinationTroop.CatchCaptiveFromTroop(sourcePerson);
                    sourceTroop.RefreshAfterLosePerson();
                    damage.SourceMoraleChange -= 20;
                    damage.DestinationMoraleChange += 20;
                    damage.SourceCombativityChange -= 20;
                    damage.DestinationCombativityChange += 20;
                    break;
                case 8: //8、P2武将被俘虏
                    sourcePerson.Scenario.YearTable.addChallengeEntry(sourcePerson.Scenario.Date, sourcePerson, destinationPerson, "被俘虜");
                    sourceTroop.CatchCaptiveFromTroop(destinationPerson);
                    destinationTroop.RefreshAfterLosePerson();
                    damage.SourceMoraleChange += 20;
                    damage.DestinationMoraleChange -= 20;
                    damage.SourceCombativityChange += 20;
                    damage.DestinationCombativityChange -= 20; 
                    break;
                case 9: //9、P1武将被说服
                    sourcePerson.Scenario.YearTable.addChallengeEntry(sourcePerson.Scenario.Date, destinationPerson, sourcePerson, "被說服");
                    destinationPerson.ConvincePersonSuccess(sourcePerson);
                    damage.SourceCombativityChange -= 30;
                    damage.DestinationCombativityChange += 30;
                    break;
                case 10: //10、P2武将被说服
                    sourcePerson.Scenario.YearTable.addChallengeEntry(sourcePerson.Scenario.Date, sourcePerson, destinationPerson, "被說服");
                    sourcePerson.ConvincePersonSuccess(destinationPerson);
                    damage.SourceCombativityChange += 30;
                    damage.DestinationCombativityChange -= 30; 
                    break;
                case -1: //-1:平局
                    sourcePerson.Scenario.YearTable.addChallengeDrawEntry(sourcePerson.Scenario.Date, sourcePerson, destinationPerson);
                    break;
                case -2: //-2:平局:P1武将被杀
                    sourcePerson.Scenario.YearTable.addChallengeDrawKilledEntry(sourcePerson.Scenario.Date, destinationPerson, sourcePerson);
                    this.challengePersonDie(sourcePerson, sourceTroop, destinationPerson);
                    break;
                case -3: //-3:平局:P2武将被杀
                    sourcePerson.Scenario.YearTable.addChallengeDrawKilledEntry(sourcePerson.Scenario.Date, sourcePerson, destinationPerson);
                    this.challengePersonDie(destinationPerson, destinationTroop, sourcePerson);
                    break;
                case -4: //-4:平局:双方武将被杀
                    sourcePerson.Scenario.YearTable.addChallengeDrawBothKilledEntry(sourcePerson.Scenario.Date, sourcePerson, destinationPerson);
                    this.challengePersonDie(sourcePerson, sourceTroop, destinationPerson);
                    this.challengePersonDie(destinationPerson, destinationTroop, sourcePerson);
                    break;
            }


        }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:96,代码来源:Challenge.cs

示例2: ToDeath

        public void ToDeath()
        {
            Architecture locationArchitecture;
            Troop locationTroop=new Troop();
            GameObjects.Faction belongedFaction = this.BelongedFaction;
            int deathLocation = 0;
            if (this.LocationTroop != null)
            {
                locationTroop = this.LocationTroop;
                locationArchitecture = this.LocationTroop.StartingArchitecture;
                deathLocation = 2;
                if (!locationTroop.Destroyed)
                {
                    locationTroop.Persons.Remove(this);
                    this.LocationTroop = null;
                    locationTroop.RefreshAfterLosePerson();
                }

            }
            else if (this.LocationArchitecture != null)
            {
                locationArchitecture = this.LocationArchitecture;
                deathLocation = 1;
            }
            else
            {
                deathLocation = 3;
                throw new Exception("try to kill person onway");
            }

            this.Alive = false;  //死亡
            this.BelongedCaptive = null;
            this.LocationArchitecture = null;
            this.Status = PersonStatus.None;
            if (this.OnDeath != null && locationArchitecture != null && deathLocation == 1)
            {
                this.OnDeath(this, locationArchitecture);
            }

            if (belongedFaction != null && this == belongedFaction.Leader)
            {
                string name = belongedFaction.Name;
                base.Scenario.YearTable.addKingDeathEntry(base.Scenario.Date, this, belongedFaction);
                GameObjects.Faction faction2 = belongedFaction.ChangeLeaderAfterLeaderDeath();
                if (faction2 != null)
                {
                    if (belongedFaction == faction2)
                    {
                        bool changeName = false;
                        if ((name == this.Name) && (belongedFaction.Leader.Ambition >= (int) PersonAmbition.普通))
                        {
                            belongedFaction.Name = belongedFaction.Leader.Name;
                            changeName = true;
                        }
                        if (this.OnChangeLeader != null)
                        {
                            this.OnChangeLeader(belongedFaction, belongedFaction.Leader, changeName, name);
                        }
                    }
                    else if (this.OnDeathChangeFaction != null)
                    {
                        this.OnDeathChangeFaction(this, faction2.Leader, name);
                    }
                }
                else
                {
                    foreach (Architecture architecture2 in belongedFaction.Architectures.GetList())
                    {
                        architecture2.ResetFaction(null);
                    }
                    belongedFaction.Destroy();
                }
            }
            else
            {

                Treasure baowu;

                while (this.Treasures.Count > 0)
                {
                    baowu = (Treasure)this.Treasures[0];
                    this.LoseTreasure(baowu);
                    baowu.Available = false;
                    baowu.HidePlace = locationArchitecture;
                }
            }
            ExtensionInterface.call("PersonDie", new Object[] { this.Scenario, this });
        }
开发者ID:k45399735,项目名称:ZhongHuaSanGuoZhi,代码行数:88,代码来源:Person.cs


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