Пример #1
0
 public static Military Create(GameScenario scenario, Architecture architecture, MilitaryKind kind)
 {
     Military military = new Military();
     military.Scenario = scenario;
     military.KindID = kind.ID;
     military.ID = scenario.Militaries.GetFreeGameObjectID();
     if (kind.RecruitLimit == 1)
     {
         military.Name = kind.Name;
     }
     else
     {
         military.Name = kind.Name + "队";
     }
     architecture.AddMilitary(military);
     architecture.BelongedFaction.AddMilitary(military);
     scenario.Militaries.AddMilitary(military);
     architecture.DecreaseFund((int) (kind.CreateCost * kind.GetRateOfNewMilitary(architecture)));
     if (kind.IsTransport)
     {
         military.Quantity = kind.MaxScale;
         military.Morale = military.MoraleCeiling;
         military.Combativity = military.CombativityCeiling;
     }
     return military;
 }
Пример #2
0
 public void SendRansom(Architecture to, Architecture from)
 {
     this.RansomFund = this.Ransom;
     from.DecreaseFund(this.RansomFund);
     this.RansomArchitecture = to;
     this.RansomArriveDays = (int) (base.Scenario.GetDistance(from.ArchitectureArea, to.ArchitectureArea) / 5.0);
     if (this.RansomArriveDays <= 0)
     {
         this.RansomArriveDays = 1;
     }
 }
Пример #3
0
 public void UpgradeTechnique(Technique technique, Architecture architecture)
 {
     this.UpgradingTechnique = technique.ID;
     this.UpgradingDaysLeft = getTechniqueActualTime(technique);
     if (this.TechniquePoint < this.getTechniqueActualPointCost(technique))
     {
         this.DepositTechniquePointForTechnique(this.getTechniqueActualPointCost(technique) - this.TechniquePoint);
         if (this.TechniquePoint < this.getTechniqueActualPointCost(technique))
         {
             this.DepositTechniquePointForFacility(this.getTechniqueActualPointCost(technique) - this.TechniquePoint);
         }
     }
     this.DecreaseTechniquePoint(this.getTechniqueActualPointCost(technique));
     architecture.DecreaseFund(this.getTechniqueActualFundCost(technique));
     ExtensionInterface.call("UpgradeTechnique", new Object[] { this.Scenario, this });
     if (this.OnUpgradeTechnique != null)
     {
         this.OnUpgradeTechnique(this, technique, architecture);
     }
 }