void UpdatePlayerConditionReference(Actor self) { playerConditionTrait = self.Owner.PlayerActor.TraitsImplementing <ExternalCondition>() .FirstOrDefault(t => t.Info.Condition == Info.Condition); if (playerConditionTrait == null) { throw new YamlException("There is no ExternalCondition trait defined on the player actor for condition '{0}'.".F(Info.Condition)); } }
public PreyActivity(Actor self, Actor dockact, bool facingDock, Dock d) { info = self.Info.TraitInfo <AcolytePreyInfo>(); wsb = self.Trait <WithSpriteBody>(); dockactor = dockact; lockfacing = facingDock; playanim = true; _d = d; ticks = self.Info.TraitInfo <AcolytePreyInfo>().leechinterval; resLayer = self.World.WorldActor.Trait <ResourceLayer>(); externalCondition = dockact.TraitsImplementing <ExternalCondition>() .FirstOrDefault(t => t.Info.Condition == self.Info.TraitInfo <AcolytePreyInfo>().GrantsCondition&& t.CanGrantCondition(dockactor, self)); }
void UpdatePlayerConditionReference(Actor self) { playerConditionTrait = self.Owner.PlayerActor.TraitsImplementing <ExternalCondition>() .FirstOrDefault(t => t.Info.Condition == Info.Condition); }