Пример #1
0
 public ProductionItem(ProductionQueue queue, string item, int cost, PowerManager pm, Action onComplete)
 {
     Item = item;
     RemainingTime = TotalTime = 1;
     RemainingCost = TotalCost = cost;
     OnComplete = onComplete;
     Queue = queue;
     this.pm = pm;
     ai = Queue.Actor.World.Map.Rules.Actors[Item];
     bi = ai.TraitInfo<BuildableInfo>();
 }
Пример #2
0
        public virtual int GetBuildTime(ActorInfo unit, BuildableInfo bi = null)
        {
            if (self.World.AllowDevCommands && self.Owner.PlayerActor.Trait<DeveloperMode>().FastBuild)
                return 0;

            var time = unit.GetBuildTime() * Info.BuildSpeed / 100;
            return time;
        }
Пример #3
0
        public virtual int GetBuildTime(ActorInfo unit, BuildableInfo bi)
        {
            if (developerMode.FastBuild)
                return 0;

            var time = bi.BuildDuration;
            if (time == -1)
            {
                var valued = unit.TraitInfoOrDefault<ValuedInfo>();
                time = valued != null ? valued.Cost : 0;
            }

            time = time * bi.BuildDurationModifier * Info.BuildDurationModifier / 10000;
            return time;
        }