Exemplo n.º 1
0
        protected override void Created(Actor self)
        {
            base.Created(self);

            conditionManager = self.TraitOrDefault <ConditionManager>();
            Update(self);
        }
Exemplo n.º 2
0
        void INotifyCreated.Created(Actor self)
        {
            conditionManager = self.TraitOrDefault <ConditionManager>();
            AutoReloads      = self.TraitsImplementing <ReloadAmmoPool>().Any(r => r.Info.AmmoPool == Info.Name && r.Info.RequiresCondition == null);

            UpdateCondition(self);

            RemainingTicks = Info.SelfReloadDelay;
        }
Exemplo n.º 3
0
        void INotifyCreated.Created(Actor self)
        {
            conditionManager = self.TraitOrDefault <ConditionManager>();

            if (initialExperience > 0)
            {
                GiveExperience(initialExperience, info.SuppressLevelupAnimation);
            }
        }
Exemplo n.º 4
0
        void INotifyCreated.Created(Actor self)
        {
            conditionManager = self.TraitOrDefault <ConditionManager>();
            var building = self.TraitOrDefault <Building>();

            if (building != null && !building.SkipMakeAnimation)
            {
                Forward(self, () => building.NotifyBuildingComplete(self));
            }
        }
Exemplo n.º 5
0
        protected override void Created(Actor self)
        {
            conditionManager = self.TraitOrDefault <ConditionManager>();
            otherCloaks      = self.TraitsImplementing <Cloak>().Where(c => c != this).ToArray();

            if (Cloaked)
            {
                wasCloaked = true;

                if (conditionManager != null && cloakedToken == ConditionManager.InvalidConditionToken && !string.IsNullOrEmpty(Info.CloakedCondition))
                {
                    cloakedToken = conditionManager.GrantCondition(self, Info.CloakedCondition);
                }
            }

            base.Created(self);
        }
Exemplo n.º 6
0
        void INotifyCreated.Created(Actor self)
        {
            conditionManager = self.TraitOrDefault <ConditionManager>();

            if (conditionManager != null && cargo.Any())
            {
                foreach (var c in cargo)
                {
                    string passengerCondition;
                    if (Info.PassengerConditions.TryGetValue(c.Info.Name, out passengerCondition))
                    {
                        passengerTokens.GetOrAdd(c.Info.Name).Push(conditionManager.GrantCondition(self, passengerCondition));
                    }
                }

                if (!string.IsNullOrEmpty(Info.LoadedCondition))
                {
                    loadedTokens.Push(conditionManager.GrantCondition(self, Info.LoadedCondition));
                }
            }
        }
Exemplo n.º 7
0
        void INotifyCreated.Created(Actor self)
        {
            conditionManager = self.TraitOrDefault <ConditionManager>();

            notify = self.TraitsImplementing <INotifyDeployTriggered>().ToArray();

            switch (deployState)
            {
            case DeployState.Undeployed:
                OnUndeployCompleted();
                break;

            case DeployState.Deploying:
                if (canTurn)
                {
                    self.Trait <IFacing>().Facing = Info.Facing;
                }

                Deploy(true);
                break;

            case DeployState.Deployed:
                if (canTurn)
                {
                    self.Trait <IFacing>().Facing = Info.Facing;
                }

                OnDeployCompleted();
                break;

            case DeployState.Undeploying:
                if (canTurn)
                {
                    self.Trait <IFacing>().Facing = Info.Facing;
                }

                Undeploy(true);
                break;
            }
        }
Exemplo n.º 8
0
 void INotifyCreated.Created(Actor self)
 {
     conditionManager = self.TraitOrDefault <ConditionManager>();
 }
Exemplo n.º 9
0
        protected override void Created(Actor self)
        {
            conditionManager = self.Trait <ConditionManager>();

            base.Created(self);
        }
Exemplo n.º 10
0
 public ExternalCondition(Actor self, ExternalConditionInfo info)
 {
     Info             = info;
     conditionManager = self.Trait <ConditionManager>();
 }
Exemplo n.º 11
0
 protected virtual void Created(Actor self)
 {
     conditionManager = self.TraitOrDefault <ConditionManager>();
     speedModifiers   = self.TraitsImplementing <ISpeedModifier>().ToArray().Select(sm => sm.GetSpeedModifier());
     cachedPosition   = self.CenterPosition;
 }
Exemplo n.º 12
0
 void INotifyCreated.Created(Actor self)
 {
     conditionManager = self.TraitOrDefault <ConditionManager>();
     targetPriorities = self.TraitsImplementing <AutoTargetPriority>().ToArray();
     ApplyStanceCondition(self);
 }