Ejemplo n.º 1
0
 public RepairBridge(Actor self, Actor target, EnterBehaviour enterBehaviour, string notification)
     : base(self, target, enterBehaviour)
 {
     this.target       = target;
     legacyHut         = target.TraitOrDefault <LegacyBridgeHut>();
     hut               = target.TraitOrDefault <BridgeHut>();
     this.notification = notification;
 }
Ejemplo n.º 2
0
 public RepairBridge(Actor self, Actor target, EnterBehaviour enterBehaviour, string notification)
     : base(self, target, enterBehaviour)
 {
     this.target = target;
     legacyHut = target.TraitOrDefault<LegacyBridgeHut>();
     hut = target.TraitOrDefault<BridgeHut>();
     this.notification = notification;
 }
Ejemplo n.º 3
0
        protected override bool TryStartEnter(Actor self, Actor targetActor)
        {
            enterActor     = targetActor;
            enterLegacyHut = enterActor.TraitOrDefault <LegacyBridgeHut>();
            enterHut       = enterActor.TraitOrDefault <BridgeHut>();

            // Make sure we can still repair the target before entering
            // (but not before, because this may stop the actor in the middle of nowhere)
            if (!CanEnterHut())
            {
                Cancel(self, true);
                return(false);
            }

            return(true);
        }