public Aircraft( ActorInitializer init , AircraftInfo info) { if (init.Contains<LocationInit>()) this.Location = init.Get<LocationInit,int2>(); this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : info.InitialFacing; this.Altitude = init.Contains<AltitudeInit>() ? init.Get<AltitudeInit,int>() : 0; Info = info; }
public static int GetInitialTurretFacing(ActorInitializer init, int def) { if (init.Contains<TurretFacingInit>()) return init.Get<TurretFacingInit,int>(); if (init.Contains<FacingInit>()) return init.Get<FacingInit,int>(); return def; }
public Aircraft( ActorInitializer init , AircraftInfo info) { this.self = init.self; if( init.Contains<LocationInit>() ) this.SubPxPosition = 1024 * Util.CenterOfCell( init.Get<LocationInit, int2>() ); this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : info.InitialFacing; this.Altitude = init.Contains<AltitudeInit>() ? init.Get<AltitudeInit,int>() : 0; Info = info; }
public Turreted(ActorInitializer init, TurretedInfo info) { this.info = info; turretFacing = info.InitialFacing; turretFacing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : info.InitialFacing; facing = init.self.TraitOrDefault<IFacing>(); }
public Transforms(ActorInitializer init, TransformsInfo info) { self = init.Self; this.info = info; buildingInfo = self.World.Map.Rules.Actors[info.IntoActor].TraitInfoOrDefault<BuildingInfo>(); faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName; }
public Mobile(ActorInitializer init, MobileInfo info) { this.self = init.self; this.Info = info; uim = self.World.WorldActor.Trait<UnitInfluence>(); if (init.Contains<LocationInit>()) { this.__fromCell = this.__toCell = init.Get<LocationInit, int2>(); this.PxPosition = Util.CenterOfCell(fromCell); } this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : info.InitialFacing; this.Altitude = init.Contains<AltitudeInit>() ? init.Get<AltitudeInit, int>() : 0; }
public BodyOrientation(ActorInitializer init, BodyOrientationInfo info) { this.info = info; var self = init.Self; var faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName; quantizedFacings = Exts.Lazy(() => { // Override value is set if (info.QuantizedFacings >= 0) return info.QuantizedFacings; var qboi = self.Info.TraitInfoOrDefault<IQuantizeBodyOrientationInfo>(); // If a sprite actor has neither custom QuantizedFacings nor a trait implementing IQuantizeBodyOrientationInfo, throw if (qboi == null) { if (self.Info.HasTraitInfo<WithSpriteBodyInfo>()) throw new InvalidOperationException("Actor '" + self.Info.Name + "' has a sprite body but no facing quantization." + " Either add the QuantizeFacingsFromSequence trait or set custom QuantizedFacings on BodyOrientation."); else throw new InvalidOperationException("Actor type '" + self.Info.Name + "' does not define a quantized body orientation."); } return qboi.QuantizedBodyFacings(self.Info, self.World.Map.Rules.Sequences, faction); }); }
public Transforms(ActorInitializer init, TransformsInfo info) { self = init.self; this.info = info; bi = self.World.Map.Rules.Actors[info.IntoActor].Traits.GetOrDefault<BuildingInfo>(); race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Country.Race; }
public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info) : base(init.self) { Info = info; buildComplete = init.Contains<SkipMakeAnimsInit>(); turret = turrets.FirstOrDefault(); }
public Husk(ActorInitializer init) { this.self = init.self; this.location = init.Get<LocationInit,int2>(); this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : 128; self.World.WorldActor.Trait<UnitInfluence>().Add(self, this); }
public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info) : base(init.self) { Info = info; Turret = init.self.Trait<Turreted>(); if (init.Contains<SkipMakeAnimsInit>()) buildComplete = true; }
public RenderBuilding( ActorInitializer init, Func<int> baseFacing ) : base(init.self, baseFacing) { var self = init.self; if( init.Contains<SkipMakeAnimsInit>() || !self.Info.Traits.Get<RenderBuildingInfo>().HasMakeAnimation ) anim.PlayThen( "idle", () => self.World.AddFrameEndTask( _ => Complete( self ) ) ); else anim.PlayThen( "make", () => self.World.AddFrameEndTask( _ => Complete( self ) ) ); }
public Mobile(ActorInitializer init, MobileInfo info) { this.self = init.self; this.Info = info; toSubCell = fromSubCell = info.SharesCell ? SubCell.Center : SubCell.FullCell; if (init.Contains<SubCellInit>()) { this.fromSubCell = this.toSubCell = init.Get<SubCellInit, SubCell>(); } if (init.Contains<LocationInit>()) { this.__fromCell = this.__toCell = init.Get<LocationInit, int2>(); this.PxPosition = Util.CenterOfCell(fromCell) + info.SubCellOffsets[fromSubCell]; } this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : info.InitialFacing; this.Altitude = init.Contains<AltitudeInit>() ? init.Get<AltitudeInit, int>() : 0; }
public ProvidesPrerequisite(ActorInitializer init, ProvidesPrerequisiteInfo info) { this.info = info; prerequisite = info.Prerequisite; if (string.IsNullOrEmpty(prerequisite)) prerequisite = init.Self.Info.Name; var race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Country.Race; Update(init.Self.Owner, race); }
public ProvidesPrerequisite(ActorInitializer init, ProvidesPrerequisiteInfo info) { this.info = info; prerequisite = info.Prerequisite; if (string.IsNullOrEmpty(prerequisite)) prerequisite = init.Self.Info.Name; var faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName; Update(init.Self.Owner, faction); }
public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info) : base(init.self) { Info = info; Turret = init.self.Trait<Turreted>(); if (init.Contains<SkipMakeAnimsInit>()) { State = PopupState.Closed; init.self.Trait<RenderBuilding>() .PlayCustomAnimRepeating(init.self, "closed-idle"); Turret.desiredFacing = null; } }
public Mobile(ActorInitializer init, MobileInfo info) { this.self = init.self; this.Info = info; shroud = self.World.WorldActor.Trait<Shroud>(); uim = self.World.WorldActor.Trait<UnitInfluence>(); bim = self.World.WorldActor.Trait<BuildingInfluence>(); canShareCell = self.HasTrait<SharesCell>(); if (init.Contains<LocationInit>()) { this.__fromCell = this.__toCell = init.Get<LocationInit,int2>(); AddInfluence(); } this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : info.InitialFacing; this.Altitude = init.Contains<AltitudeInit>() ? init.Get<AltitudeInit,int>() : 0; TerrainCost = new Dictionary<string, float>(); TerrainSpeed = new Dictionary<string, float>(); if (info.TerrainTypes.Count() != info.TerrainSpeeds.Count()) throw new InvalidOperationException("Mobile TerrainType/TerrainSpeed length mismatch"); if (info.TerrainCostOverrides != null) for (int i = 0; i < info.TerrainCostOverrides.Count(); i++) { TerrainCost.Add(info.TerrainCostOverrides[i], info.TerrainCosts[i]); } for (int i = 0; i < info.TerrainTypes.Count(); i++) { if (!TerrainCost.ContainsKey(info.TerrainTypes[i])) TerrainCost.Add(info.TerrainTypes[i], 1f/info.TerrainSpeeds[i]); TerrainSpeed.Add(info.TerrainTypes[i], info.TerrainSpeeds[i]); } }
public TDGunboat(ActorInitializer init, TDGunboatInfo info) { Info = info; self = init.Self; if (init.Contains <LocationInit>()) { SetPosition(self, init.Get <LocationInit, CPos>()); } if (init.Contains <CenterPositionInit>()) { SetPosition(self, init.Get <CenterPositionInit, WPos>()); } Facing = init.Contains <FacingInit>() ? init.Get <FacingInit, int>() : Info.GetInitialFacing(); // Prevent mappers from setting bogus facings if (Facing != 64 && Facing != 192) { Facing = Facing > 127 ? 192 : 64; } }
public FrozenUnderFog(ActorInitializer init, FrozenUnderFogInfo info) { // Spawned actors (e.g. building husks) shouldn't be revealed startsRevealed = info.StartsRevealed && !init.Contains <ParentActorInit>(); var footprintCells = FootprintUtils.Tiles(init.Self).ToList(); footprint = footprintCells.Select(cell => cell.ToMPos(init.World.Map)).ToArray(); footprintRegion = CellRegion.BoundingRegion(init.World.Map.TileShape, footprintCells); tooltip = Exts.Lazy(() => init.Self.TraitsImplementing <IToolTip>().FirstOrDefault()); health = Exts.Lazy(() => init.Self.TraitOrDefault <Health>()); frozen = new Dictionary <Player, FrozenActor>(); visible = init.World.Players.ToDictionary(p => p, p => false); }
public RenderBuilding( ActorInitializer init, RenderBuildingInfo info, Func<int> baseFacing ) : base(init.self, baseFacing) { Info = info; var self = init.self; // Work around a bogus crash anim.PlayRepeating( NormalizeSequence(self, "idle") ); // Can't call Complete() directly from ctor because other traits haven't been inited yet if (self.Info.Traits.Get<RenderBuildingInfo>().HasMakeAnimation && !init.Contains<SkipMakeAnimsInit>()) self.QueueActivity(new MakeAnimation(self, () => Complete(self))); else self.QueueActivity(new CallFunc(() => Complete(self))); }
public Mobile(ActorInitializer init, MobileInfo info) : base(info) { self = init.Self; speedModifiers = Exts.Lazy(() => self.TraitsImplementing <ISpeedModifier>().ToArray().Select(x => x.GetSpeedModifier())); ToSubCell = FromSubCell = info.LocomotorInfo.SharesCell ? init.World.Map.Grid.DefaultSubCell : SubCell.FullCell; if (init.Contains <SubCellInit>()) { FromSubCell = ToSubCell = init.Get <SubCellInit, SubCell>(); returnToCellOnCreationRecalculateSubCell = false; } if (init.Contains <LocationInit>()) { fromCell = toCell = init.Get <LocationInit, CPos>(); SetVisualPosition(self, init.World.Map.CenterOfSubCell(FromCell, FromSubCell)); } Facing = oldFacing = init.Contains <FacingInit>() ? init.Get <FacingInit, int>() : info.InitialFacing; // Sets the initial visual position // Unit will move into the cell grid (defined by LocationInit) as its initial activity if (init.Contains <CenterPositionInit>()) { oldPos = init.Get <CenterPositionInit, WPos>(); SetVisualPosition(self, oldPos); returnToCellOnCreation = true; } if (init.Contains <CreationActivityDelayInit>()) { creationActivityDelay = init.Get <CreationActivityDelayInit, int>(); } }
public WithCrumbleOverlay(ActorInitializer init, WithCrumbleOverlayInfo info) : base(info) { this.info = info; if (init.Contains <SkipMakeAnimsInit>(info)) { return; } renderSprites = init.Self.Trait <RenderSprites>(); overlay = new Animation(init.World, renderSprites.GetImage(init.Self)); animation = new AnimationWithOffset(overlay, null, () => IsTraitDisabled); }
public Aircraft(ActorInitializer init, AircraftInfo info) { this.info = info; this.self = init.self; if (init.Contains <LocationInit>()) { SetPosition(self, init.Get <LocationInit, CPos>()); } if (init.Contains <AltitudeInit>()) { var z = init.Get <AltitudeInit, int>() * 1024 / Game.CellSize; SetPosition(self, CenterPosition + new WVec(0, 0, z - CenterPosition.Z)); } if (init.Contains <CenterPositionInit>()) { SetPosition(self, init.Get <CenterPositionInit, WPos>()); } this.Facing = init.Contains <FacingInit>() ? init.Get <FacingInit, int>() : info.InitialFacing; }
public Building(ActorInitializer init, BuildingInfo info) { self = init.Self; topLeft = init.Get <LocationInit, CPos>(); Info = info; occupiedCells = Info.UnpathableTiles(TopLeft) .Select(c => Pair.New(c, SubCell.FullCell)).ToArray(); targetableCells = Info.FootprintTiles(TopLeft, FootprintCellType.Occupied) .Select(c => Pair.New(c, SubCell.FullCell)).ToArray(); CenterPosition = init.World.Map.CenterOfCell(topLeft) + Info.CenterOffset(init.World); SkipMakeAnimation = init.Contains <SkipMakeAnimsInit>(); }
public ProductionQueue(ActorInitializer init, Actor playerActor, ProductionQueueInfo info) { self = init.Self; Info = info; playerResources = playerActor.Trait <PlayerResources>(); developerMode = playerActor.Trait <DeveloperMode>(); Faction = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : self.Owner.Faction.InternalName; IsValidFaction = !info.Factions.Any() || info.Factions.Contains(Faction); Enabled = IsValidFaction; 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); }
public FrozenUnderFog(ActorInitializer init, FrozenUnderFogInfo info) { this.info = info; var map = init.World.Map; // Spawned actors (e.g. building husks) shouldn't be revealed startsRevealed = info.StartsRevealed && !init.Contains <ParentActorInit>(); var footprintCells = FootprintUtils.Tiles(init.Self).ToList(); footprint = footprintCells.SelectMany(c => map.ProjectedCellsCovering(c.ToMPos(map))).ToArray(); tooltip = Exts.Lazy(() => init.Self.TraitsImplementing <IToolTip>().FirstOrDefault()); health = Exts.Lazy(() => init.Self.TraitOrDefault <Health>()); frozen = new Dictionary <Player, FrozenActor>(); visible = init.World.Players.ToDictionary(p => p, p => false); }
public WithCrumbleOverlay(ActorInitializer init, WithCrumbleOverlayInfo info) { if (init.Contains <SkipMakeAnimsInit>()) { return; } var rs = init.Self.Trait <RenderSprites>(); var overlay = new Animation(init.World, rs.GetImage(init.Self)); var anim = new AnimationWithOffset(overlay, null, () => !buildComplete); // Remove the animation once it is complete overlay.PlayThen(info.Sequence, () => init.World.AddFrameEndTask(w => rs.Remove(anim))); rs.Add(anim, info.Palette, info.IsPlayerPalette); }
public AutoTarget(ActorInitializer init, AutoTargetInfo info) : base(info) { var self = init.Self; ActiveAttackBases = self.TraitsImplementing <AttackBase>().ToArray().Where(Exts.IsTraitEnabled); if (init.Contains <StanceInit>()) { stance = init.Get <StanceInit, UnitStance>(); } else { stance = self.Owner.IsBot || !self.Owner.Playable ? info.InitialStanceAI : info.InitialStance; } PredictedStance = stance; }
public GainsExperience(ActorInitializer init, GainsExperienceInfo info) { self = init.Self; this.info = info; MaxLevel = info.Conditions.Count; var cost = self.Info.TraitInfo <ValuedInfo>().Cost; foreach (var kv in info.Conditions) { nextLevel.Add(Pair.New(kv.Key * cost, kv.Value)); } if (init.Contains <ExperienceInit>()) { initialExperience = init.Get <ExperienceInit, int>(); } }
public FreeActor(ActorInitializer init, FreeActorInfo info) { if (init.Contains <FreeActorInit>() && !init.Get <FreeActorInit>().ActorValue) { return; } init.Self.World.AddFrameEndTask(w => { w.CreateActor(info.Actor, new TypeDictionary { new ParentActorInit(init.Self), new LocationInit(init.Self.Location + info.SpawnOffset), new OwnerInit(init.Self.Owner), new FacingInit(info.Facing), }); }); }
public AutoTarget(ActorInitializer init, AutoTargetInfo info) { var self = init.Self; this.info = info; attack = self.Trait <AttackBase>(); if (init.Contains <StanceInit>()) { Stance = init.Get <StanceInit, UnitStance>(); } else { Stance = self.Owner.IsBot || !self.Owner.Playable ? info.InitialStanceAI : info.InitialStance; } PredictedStance = Stance; at = self.TraitOrDefault <AttackFollow>(); }
public BodyOrientation(ActorInitializer init, BodyOrientationInfo info) { this.info = info; var self = init.Self; var race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Faction.InternalName; quantizedFacings = Exts.Lazy(() => { // Override value is set if (info.QuantizedFacings >= 0) return info.QuantizedFacings; var qboi = self.Info.Traits.GetOrDefault<IQuantizeBodyOrientationInfo>(); if (qboi == null) throw new InvalidOperationException("Actor type '" + self.Info.Name + "' does not define a quantized body orientation."); return qboi.QuantizedBodyFacings(self.Info, self.World.Map.SequenceProvider, race); }); }
public RenderBuilding(ActorInitializer init, RenderBuildingInfo info, Func <int> baseFacing) : base(init.self, baseFacing) { var self = init.self; // Work around a bogus crash anim.PlayRepeating(NormalizeSequence(self, "idle")); self.Trait <IBodyOrientation>().SetAutodetectedFacings(anim.CurrentSequence.Facings); // Can't call Complete() directly from ctor because other traits haven't been inited yet if (self.Info.Traits.Get <RenderBuildingInfo>().HasMakeAnimation&& !init.Contains <SkipMakeAnimsInit>()) { self.QueueActivity(new MakeAnimation(self, () => Complete(self))); } else { self.QueueActivity(new CallFunc(() => Complete(self))); } }
public GainsExperience(ActorInitializer init, GainsExperienceInfo info) { self = init.self; this.Info = info; var cost = self.Info.Traits.Get <ValuedInfo>().Cost; Levels = Info.CostThreshold.Select(t => (int)(t * cost)).ToArray(); RankAnim = new Animation("rank"); RankAnim.PlayFetchIndex("rank", () => Level - 1); if (init.Contains <ExperienceInit>()) { Experience = init.Get <ExperienceInit, int>(); while (Level < Levels.Length && Experience >= Levels[Level]) { Level++; } } }
public Pluggable(ActorInitializer init, PluggableInfo info) { Info = info; var plugInit = init.Contains <PlugsInit>() ? init.Get <PlugsInit, Dictionary <CVec, string> >() : new Dictionary <CVec, string>(); if (plugInit.ContainsKey(Info.Offset)) { initialPlug = plugInit[Info.Offset]; } if (info.Requirements.Count > 0) { plugTypesAvailability = new Dictionary <string, bool>(); foreach (var plug in info.Requirements) { plugTypesAvailability[plug.Key] = true; } } }
public SelfConstructing(ActorInitializer init, SelfConstructingInfo info) : base(init, info) { Info = info; wsb = init.Self.Trait <WithSpriteBody>(); if (!string.IsNullOrEmpty(Info.Condition) && token == Actor.InvalidConditionToken) { token = init.Self.GrantCondition(Info.Condition); } spawnType = init.Contains <PlaceBuildingInit>(null) ? SpawnType.PlaceBuilding : init.Contains <SpawnedByMapInit>() ? SpawnType.Other : SpawnType.Deploy; for (Steps = 0; ; Steps++) { if (!wsb.DefaultAnimation.HasSequence(Info.Sequence.Substring(0, Info.Sequence.Length - 1) + Steps)) { break; } } }
public GainsExperience(ActorInitializer init, GainsExperienceInfo info) { self = init.Self; this.info = info; MaxLevel = info.Upgrades.Count; var cost = self.Info.Traits.Get <ValuedInfo>().Cost; foreach (var kv in info.Upgrades) { nextLevel.Add(Pair.New(kv.Key * cost, kv.Value)); } if (init.Contains <ExperienceInit>()) { GiveExperience(init.Get <ExperienceInit, int>(), info.SuppressLevelupAnimation); } um = self.Trait <UpgradeManager>(); }
public WithMakeAnimation(ActorInitializer init, WithMakeAnimationInfo info) { this.info = info; var self = init.self; renderBuilding = self.Trait <RenderBuilding>(); var building = self.Trait <Building>(); if (!init.Contains <SkipMakeAnimsInit>()) { renderBuilding.PlayCustomAnimThen(self, info.Sequence, () => { building.NotifyBuildingComplete(self); }); } else { building.NotifyBuildingComplete(self); } }
public FreeActor(ActorInitializer init, FreeActorInfo info) { if (init.Contains <FreeActorInit>() && !init.Get <FreeActorInit>().ActorValue) { return; } init.Self.World.AddFrameEndTask(w => { var a = w.CreateActor(info.Actor, new TypeDictionary { new ParentActorInit(init.Self), new LocationInit(init.Self.Location + info.SpawnOffset), new OwnerInit(init.Self.Owner), new FacingInit(info.Facing), }); if (info.InitialActivity != null) { a.QueueActivity(Game.CreateObject <Activity>(info.InitialActivity)); } }); }
public BodyOrientation(ActorInitializer init, BodyOrientationInfo info) { this.info = info; var self = init.Self; var race = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : self.Owner.Faction.InternalName; quantizedFacings = Exts.Lazy(() => { // Override value is set if (info.QuantizedFacings >= 0) { return(info.QuantizedFacings); } var qboi = self.Info.Traits.GetOrDefault <IQuantizeBodyOrientationInfo>(); if (qboi == null) { throw new InvalidOperationException("Actor type '" + self.Info.Name + "' does not define a quantized body orientation."); } return(qboi.QuantizedBodyFacings(self.Info, self.World.Map.SequenceProvider, race)); }); }
public RenderSprites(ActorInitializer init, RenderSpritesInfo info) { this.info = info; race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Country.Race; }
public LeavesHusk(ActorInitializer init, LeavesHuskInfo info) { this.info = info; race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.self.Owner.Country.Race; }
public RenderSprites(ActorInitializer init, RenderSpritesInfo info) { this.info = info; race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Faction.InternalName; }
public Production(ActorInitializer init, ProductionInfo info) { Info = info; rp = Exts.Lazy(() => init.Self.IsDead ? null : init.Self.TraitOrDefault<RallyPoint>()); Faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
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); }
public ProduceActorPower(ActorInitializer init, ProduceActorPowerInfo info) : base(init.Self, info) { faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public SpawnActorOnDeath(ActorInitializer init, SpawnActorOnDeathInfo info) { this.info = info; enabled = !info.RequiresLobbyCreeps || init.Self.World.WorldActor.Trait<MapCreeps>().Enabled; faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public FallsToEarth(ActorInitializer init, FallsToEarthInfo info) { init.Self.QueueActivity(false, new FallToEarth(init.Self, info)); effectiveOwner = init.Contains <EffectiveOwnerInit>() ? init.Get <EffectiveOwnerInit, Player>() : init.Self.Owner; }
public ProductionCA(ActorInitializer init, ProductionCAInfo info) : base(info) { rp = Exts.Lazy(() => init.Self.IsDead ? null : init.Self.TraitOrDefault <RallyPoint>()); Faction = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public TransformOnCapture(ActorInitializer init, TransformOnCaptureInfo info) { this.info = info; faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public Husk(ActorInitializer init) { this.location = init.Get<LocationInit,int2>(); this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit,int>() : 128; }
public CreateActorOnDeath(ActorInitializer init, CreateActorOnDeathInfo info) { this.info = info; enabled = !info.RequiresLobbyCreeps || init.Self.World.WorldActor.Trait <MapCreeps>().Enabled; faction = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
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); }
public TransformOnCapture(ActorInitializer init, TransformOnCaptureInfo info) { this.info = info; faction = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public ClonesProducedUnits(ActorInitializer init, ClonesProducedUnitsInfo info) { this.info = info; production = init.Self.Trait <Production>(); race = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public ProduceActorPowerCA(ActorInitializer init, ProduceActorPowerCAInfo info) : base(init.Self, info) { faction = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public InfiltrateForTransform(ActorInitializer init, InfiltrateForTransformInfo info) { this.info = info; faction = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public GrantConditionOnFaction(ActorInitializer init, GrantConditionOnFactionInfo info) : base(info) { faction = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public RenderSprites(ActorInitializer init, RenderSpritesInfo info) { Info = info; faction = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public SpawnActorOnDeath(ActorInitializer init, SpawnActorOnDeathInfo info) { this.info = info; faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName; }