Ejemplo n.º 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.Unique)
            {
                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);
        }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 3
0
 public void SendRansom(Architecture to, Architecture from)
 {
     this.RansomFund = this.Ransom;
     from.DecreaseFund(this.RansomFund);
     this.RansomArchitecture = to;
     //this.RansomArriveDays = (int) (Session.Current.Scenario.GetDistance(from.ArchitectureArea, to.ArchitectureArea) / 5.0);
     this.RansomArriveDays = (int)(Session.Current.Scenario.GetDistance(from.ArchitectureArea, to.ArchitectureArea) / 5.0) * Session.Parameters.DayInTurn;
     if (this.RansomArriveDays <= 0)
     {
         this.RansomArriveDays = 1;
     }
 }