Esempio n. 1
0
 private void SelectPersons()
 {
     this.ShowTabListInFrame(UndoneWorkKind.Frame, FrameKind.Person, FrameFunction.Architecture_PersonToTroop, false, true, true, true, this.CreatingArchitecture.Persons, this.CreatingPersons, "出征人物", "");
     this.GameFramePlugin.SetOKFunction(delegate {
         this.CreatingPersons = this.TabListPlugin.SelectedItemList as GameObjectList;
         if (this.CreatingPersons.Count > 0)
         {
             Person selectedLeader = this.CreatingPersons[0] as Person;
             if (this.CreatingPersons.Count > 1)
             {
                 int maxFightingAbility = 0;
                 foreach (Person p in this.CreatingPersons)
                 {
                     this.CreatingTroop = Troop.CreateSimulateTroop(this.CreatingArchitecture, this.CreatingPersons, p, this.CreatingMilitary, this.RationDays, this.CreatingArchitecture.Position);
                     this.MoveCandidatesToPersons();
                     if (this.CreatingTroop.FightingForce > maxFightingAbility)
                     {
                         maxFightingAbility = this.CreatingTroop.FightingForce;
                         selectedLeader     = p;
                     }
                 }
             }
             this.CreatingLeader = selectedLeader;
             this.RefreshDetailDisplay();
         }
     });
 }
Esempio n. 2
0
 private void InitialCreateingTroop()
 {
     if (this.ShellMilitaryKind == null)
     {
         if (this.CreatingArchitecture.GetCampaignMilitaryList().Count == 1)
         {
             this.CreatingTroop = Troop.CreateSimulateTroop(this.CreatingArchitecture, this.CreatingPersons, this.CreatingLeader, this.CreatingMilitary, this.RationDays, this.CreatingArchitecture.Position);
             this.MoveCandidatesToPersons();
             this.CreatingMilitary = this.CreatingArchitecture.CampaignMilitaryList[0] as Military;
             this.AfterSelectMilitary();
         }
     }
     else
     {
         this.CreatingMilitary = Military.SimCreate(this.screen.Scenario, this.CreatingArchitecture, this.ShellMilitaryKind);
         if (this.CreatingArchitecture.GetCampaignMilitaryList().Count == 1)
         {
             this.CreatingTroop = Troop.CreateSimulateTroop(this.CreatingArchitecture, this.CreatingPersons, this.CreatingLeader, this.CreatingMilitary, this.RationDays, this.CreatingArchitecture.Position);
             this.MoveCandidatesToPersons();
             this.CreatingMilitary.SetShelledMilitary(this.CreatingArchitecture.CampaignMilitaryList[0] as Military);
             this.AfterSelectMilitary();
         }
     }
     this.RefreshDetailDisplay();
 }
Esempio n. 3
0
        private void RefreshDetailDisplay()
        {
            if (this.CreatingArchitecture != null)
            {
                if (this.CreatingPersons != null)
                {
                    foreach (Person person in this.CreatingPersons)
                    {
                        foreach (Skill s in person.Skills.GetSkillList())
                        {
                            s.Influences.PurifyInfluence(person, Applier.Skill, s.ID);
                        }
                        foreach (Title t in person.Titles)
                        {
                            t.Influences.PurifyInfluence(person, Applier.Title, t.ID);
                        }
                        foreach (Stunt s in person.Stunts.GetStuntList())
                        {
                            s.Influences.PurifyInfluence(person, Applier.Stunt, 0);
                        }
                        foreach (Treasure t in person.Treasures)
                        {
                            t.Influences.PurifyInfluence(person, Applier.Treasure, t.TreasureGroup);
                        }
                    }
                }
                this.CreatingTroop = Troop.CreateSimulateTroop(this.CreatingArchitecture, this.CreatingPersons, this.CreatingLeader, this.CreatingMilitary, this.RationDays, this.CreatingArchitecture.Position);
                this.MoveCandidatesToPersons();
                if ((!this.shezhizijin && !this.setttingRation && (this.CreatingMilitary != null)) && (this.CreatingPersons != null))
                {
                    /*
                     * if (this.CreatingArchitecture.Food >= this.CreatingTroop.FoodMax)
                     * {
                     *  this.RationDays = this.CreatingTroop.RationDays;
                     *  this.CreatingTroop.Food = this.CreatingTroop.FoodMax;
                     * }
                     * else
                     * {
                     *  this.RationDays = this.CreatingArchitecture.Food / this.CreatingTroop.FoodCostPerDay;
                     *  this.CreatingTroop.Food = this.CreatingTroop.FoodCostPerDay * this.RationDays;
                     * }
                     */

                    if (!this.CreatingTroop.IsTransport)
                    {
                        if (this.CreatingArchitecture.Food >= this.CreatingTroop.FoodMax)
                        {
                            this.RationDays         = this.CreatingTroop.RationDays;
                            this.CreatingTroop.Food = this.CreatingTroop.FoodMax;
                        }
                        else
                        {
                            this.RationDays         = this.CreatingArchitecture.Food / this.CreatingTroop.FoodCostPerDay;
                            this.CreatingTroop.Food = this.CreatingTroop.FoodCostPerDay * this.RationDays;
                        }
                    }
                    else
                    {
                        if (this.CreatingArchitecture.Food >= this.CreatingTroop.FoodCostPerDay * 20)
                        {
                            this.RationDays         = 20;
                            this.CreatingTroop.Food = this.CreatingTroop.FoodCostPerDay * 20;
                        }
                        else
                        {
                            this.RationDays         = this.CreatingArchitecture.Food / this.CreatingTroop.FoodCostPerDay;
                            this.CreatingTroop.Food = this.CreatingTroop.FoodCostPerDay * this.RationDays;
                        }
                    }
                }
                if ((this.CreatingMilitary != null) && (this.CreatingPersons != null))
                {
                    /*
                     * if (this.CreatingArchitecture.Fund  >= this.CreatingTroop.Army.zijinzuidazhi)
                     * {
                     *  this.zijin = this.CreatingTroop.Army.zijinzuidazhi;
                     *  this.CreatingTroop.zijin = this.CreatingTroop.Army.zijinzuidazhi;
                     * }
                     * else
                     * {
                     *  this.zijin = this.CreatingArchitecture.Fund;
                     *  this.CreatingTroop.zijin = this.CreatingArchitecture.Fund;
                     *
                     * }*/
                    this.CreatingTroop.zijin = this.zijin;
                }

                /*
                 * if (this.shezhizijin)
                 * {
                 *  this.CreatingTroop.zijin = this.zijin ;
                 *
                 * }
                 */
                this.MilitaryButtonEnabled = this.CreatingArchitecture.CampaignMilitaryList.Count > 1;
                this.PersonButtonEnabled   = (this.CreatingMilitary != null) && (this.CreatingArchitecture.PersonCount > 1);
                this.LeaderButtonEnabled   = (this.CreatingPersons != null) && (this.CreatingPersons.Count > 1);
                this.CreateButtonEnabled   = ((this.CreatingTroop.PersonCount > 0) && (this.CreatingTroop.Leader != null)) && (this.CreatingTroop.Army != null);
                this.RationButtonEnabled   = this.CreateButtonEnabled;
                this.zijinButtonEnabled    = this.CreateButtonEnabled && this.CreatingTroop.IsTransport;
                this.TroopNameText.Text    = this.CreatingTroop.DisplayName;
                foreach (LabelText text in this.LabelTexts)
                {
                    text.Text.Text = StaticMethods.GetPropertyValue(this.CreatingTroop, text.PropertyName).ToString();
                }
                this.OtherPersonText.Clear();
                this.OtherPersonText.AddText("其他人物", Color.Yellow);
                this.OtherPersonText.AddNewLine();
                if (this.CreatingTroop.PersonCount > 0)
                {
                    int num = this.CreatingTroop.PersonCount - 1;
                    this.OtherPersonText.AddText(num.ToString() + "人", Color.Lime);
                    this.OtherPersonText.AddNewLine();
                    foreach (Person person in this.CreatingTroop.Persons)
                    {
                        if (person != this.CreatingTroop.Leader)
                        {
                            this.OtherPersonText.AddText(person.Name);
                            this.OtherPersonText.AddNewLine();
                        }
                    }
                }
                this.OtherPersonText.ResortTexts();
                this.CombatMethodText.Clear();
                this.CombatMethodText.AddText("部队战法", Color.Yellow);
                this.CombatMethodText.AddNewLine();
                if (this.CreatingTroop.PersonCount > 0)
                {
                    this.CombatMethodText.AddText(this.CreatingTroop.CombatMethods.Count.ToString() + "种", Color.Lime);
                    this.CombatMethodText.AddNewLine();
                    foreach (CombatMethod method in this.CreatingTroop.CombatMethods.CombatMethods.Values)
                    {
                        this.CombatMethodText.AddText(method.Name, Color.Red);
                        this.CombatMethodText.AddText(" 战意消耗" + ((method.Combativity - this.CreatingTroop.DecrementOfCombatMethodCombativityConsuming)).ToString(), Color.LightGreen);
                        this.CombatMethodText.AddNewLine();
                    }
                }
                this.CombatMethodText.ResortTexts();
                this.StuntText.Clear();
                this.StuntText.AddText("战斗特技", Color.Yellow);
                this.StuntText.AddNewLine();
                if (this.CreatingTroop.PersonCount > 0)
                {
                    this.StuntText.AddText(this.CreatingTroop.Stunts.Count.ToString() + "种", Color.Lime);
                    this.StuntText.AddNewLine();
                    foreach (Stunt stunt in this.CreatingTroop.Stunts.Stunts.Values)
                    {
                        this.StuntText.AddText(stunt.Name, Color.Red);
                        this.StuntText.AddText(" 战意消耗" + stunt.Combativity, Color.LightGreen);
                        this.StuntText.AddNewLine();
                    }
                }
                this.StuntText.ResortTexts();
                this.InfluenceText.Clear();
                this.InfluenceText.AddText("部队特性", Color.Yellow);
                this.InfluenceText.AddNewLine();
                if (this.CreatingMilitary != null)
                {
                    this.InfluenceText.AddText(this.CreatingMilitary.Kind.Name, Color.Lime);
                    this.InfluenceText.AddNewLine();
                    foreach (Influence influence in this.CreatingMilitary.Kind.Influences.Influences.Values)
                    {
                        this.InfluenceText.AddText(influence.Name, Color.Red);
                        this.InfluenceText.AddText(influence.Description, Color.LightGreen);
                        this.InfluenceText.AddNewLine();
                    }
                }
                this.InfluenceText.ResortTexts();
            }
        }