protected override void TraitDisabled(Actor self) { if (!self.IsDead && self.IsInWorld && conditionToken != Actor.InvalidConditionToken) { if (playerConditionTrait.TryRevokeCondition(self.Owner.PlayerActor, self, conditionToken)) { conditionToken = Actor.InvalidConditionToken; } } }
public override Activity Tick(Actor self) { if (IsCanceled) { wsb.PlayCustomAnimationRepeating(self, wsb.Info.Sequence); playanim = true; if (externalCondition != null) { Game.Debug("revoke: " + token); externalCondition.TryRevokeCondition(self, dockactor, token); } return(NextActivity); } if (ChildActivity != null) { ActivityUtils.RunActivity(self, ChildActivity); return(this); } if (playanim) { playanim = false; QueueChild(self.Trait <IMove>().VisualMove(self, self.CenterPosition, _d.CenterPosition)); QueueChild(new CallFunc(() => { var facing = self.Trait <IFacing>(); if (dockactor != null && facing != null && lockfacing) { var desiredFacing = (dockactor.CenterPosition - self.CenterPosition).HorizontalLengthSquared != 0 ? (dockactor.CenterPosition - self.CenterPosition).Yaw.Facing : facing.Facing; facing.Facing = desiredFacing; } wsb.PlayCustomAnimationRepeating(self, info.PreySequence); Game.Debug("Manager: " + externalCondition); if (externalCondition != null) { token = externalCondition.GrantCondition(dockactor, self); } })); } if (self.Info.TraitInfo <AcolytePreyInfo>().LeechesResources&& --ticks <= 0) { Leech(self); ticks = self.Info.TraitInfo <AcolytePreyInfo>().leechinterval; } return(this); }