Inheritance: IResolveOrder, ISync, INotifyCreated
Exemplo n.º 1
0
        public DebugFiringOffsets(Actor self)
        {
            armaments = Lazy.New(() => self.TraitsImplementing<Armament>());

            var localPlayer = self.World.LocalPlayer;
            devMode = localPlayer != null ? localPlayer.PlayerActor.Trait<DeveloperMode>() : null;
        }
Exemplo n.º 2
0
 public BaseProvider(Actor self, BaseProviderInfo info)
 {
     Info = info;
     this.self = self;
     devMode = self.Owner.PlayerActor.Trait<DeveloperMode>();
     progress = total = info.InitialDelay;
 }
Exemplo n.º 3
0
        public CombatDebugOverlay(Actor self)
        {
            healthInfo = self.Info.TraitInfoOrDefault<HealthInfo>();
            coords = Exts.Lazy(self.Trait<BodyOrientation>);

            var localPlayer = self.World.LocalPlayer;
            devMode = localPlayer != null ? localPlayer.PlayerActor.Trait<DeveloperMode>() : null;
        }
Exemplo n.º 4
0
        public CombatDebugOverlay(Actor self)
        {
            armaments = Lazy.New(() => self.TraitsImplementing<Armament>());
            health = Lazy.New(() => self.TraitOrDefault<Health>());

            var localPlayer = self.World.LocalPlayer;
            devMode = localPlayer != null ? localPlayer.PlayerActor.Trait<DeveloperMode>() : null;
        }
Exemplo n.º 5
0
        public CombatDebugOverlay(Actor self)
        {
            attack = Exts.Lazy(() => self.TraitOrDefault<AttackBase>());
            coords = Exts.Lazy(() => self.Trait<IBodyOrientation>());
            health = Exts.Lazy(() => self.TraitOrDefault<Health>());

            var localPlayer = self.World.LocalPlayer;
            devMode = localPlayer != null ? localPlayer.PlayerActor.Trait<DeveloperMode>() : null;
        }
Exemplo n.º 6
0
		public CombatDebugOverlay(Actor self)
		{
			healthInfo = self.Info.TraitInfoOrDefault<HealthInfo>();
			blockInfo = self.Info.TraitInfoOrDefault<BlocksProjectilesInfo>();
			attack = Exts.Lazy(() => self.TraitOrDefault<AttackBase>());
			coords = Exts.Lazy(() => self.Trait<BodyOrientation>());

			var localPlayer = self.World.LocalPlayer;
			devMode = localPlayer != null ? localPlayer.PlayerActor.Trait<DeveloperMode>() : null;
		}
Exemplo n.º 7
0
        public RenderDebugState(Actor self, RenderDebugStateInfo info)
        {
            var buildingInfo = self.Info.TraitInfoOrDefault<BuildingInfo>();
            var yOffset = buildingInfo == null ? 1 : buildingInfo.Dimensions.Y;
            offset = new WVec(0, 512 * yOffset, 0);

            this.self = self;
            color = GetColor();
            font = Game.Renderer.Fonts[info.Font];

            var localPlayer = self.World.LocalPlayer;
            devMode = localPlayer != null ? localPlayer.PlayerActor.Trait<DeveloperMode>() : null;
            ai = self.Owner.PlayerActor.TraitsImplementing<HackyAI>().FirstOrDefault(x => x.IsEnabled);
        }
Exemplo n.º 8
0
        public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
        {
            ClearQueue();

            playerPower = newOwner.PlayerActor.Trait<PowerManager>();
            playerResources = newOwner.PlayerActor.Trait<PlayerResources>();
            developerMode = newOwner.PlayerActor.Trait<DeveloperMode>();

            if (!Info.Sticky)
            {
                Race = self.Owner.Country.Race;
                Enabled = !Info.Race.Any() || Info.Race.Contains(Race);
            }

            // Regenerate the produceables and tech tree state
            oldOwner.PlayerActor.Trait<TechTree>().Remove(this);
            CacheProduceables(newOwner.PlayerActor);
            newOwner.PlayerActor.Trait<TechTree>().Update();
        }
Exemplo n.º 9
0
        public ProductionQueue(ActorInitializer init, Actor playerActor, ProductionQueueInfo info)
        {
            self = init.self;
            Info = info;
            playerResources = playerActor.Trait<PlayerResources>();
            playerPower = playerActor.Trait<PowerManager>();
            developerMode = playerActor.Trait<DeveloperMode>();

            Race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Country.Race;
            Enabled = !info.Race.Any() || info.Race.Contains(Race);

            CacheProduceables(playerActor);
        }
Exemplo n.º 10
0
        public ProductionQueue(ActorInitializer init, Actor playerActor, ProductionQueueInfo info)
        {
            self = init.Self;
            Info = info;
            playerResources = playerActor.Trait<PlayerResources>();
            playerPower = playerActor.Trait<PowerManager>();
            developerMode = playerActor.Trait<DeveloperMode>();

            Faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
            Enabled = !info.Factions.Any() || info.Factions.Contains(Faction);

            CacheProducibles(playerActor);
            allProducibles = producible.Where(a => a.Value.Buildable || a.Value.Visible).Select(a => a.Key);
            buildableProducibles = producible.Where(a => a.Value.Buildable).Select(a => a.Key);
        }
Exemplo n.º 11
0
 public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
 {
     powerManager = newOwner.PlayerActor.Trait<PowerManager>();
     developerMode = newOwner.PlayerActor.Trait<DeveloperMode>();
 }
Exemplo n.º 12
0
 public PowerTooltip(Actor self)
 {
     this.self = self;
     powerManager = self.Owner.PlayerActor.Trait<PowerManager>();
     developerMode = self.Owner.PlayerActor.Trait<DeveloperMode>();
 }