Exemple #1
0
        public Parachutable(ActorInitializer init, ParachutableInfo info)
        {
            this.self = init.Self;
            this.info = info;

            positionable = self.TraitOrDefault<IPositionable>();
        }
Exemple #2
0
        public Parachutable(ActorInitializer init, ParachutableInfo info)
        {
            this.self = init.Self;
            this.info = info;

            positionable = self.TraitOrDefault <IPositionable>();
        }
Exemple #3
0
        public Parachute(Actor cargo, WPos dropPosition)
        {
            this.cargo = cargo;

            parachutableInfo = cargo.Info.Traits.GetOrDefault<ParachutableInfo>();

            if (parachutableInfo != null)
                fallVector = new WVec(0, 0, parachutableInfo.FallRate);

            var parachuteSprite = parachutableInfo != null ? parachutableInfo.ParachuteSequence : null;
            if (parachuteSprite != null)
            {
                parachute = new Animation(cargo.World, parachuteSprite);
                parachute.PlayThen("open", () => parachute.PlayRepeating("idle"));
            }

            var shadowSprite = parachutableInfo != null ? parachutableInfo.ShadowSequence : null;
            if (shadowSprite != null)
            {
                shadow = new Animation(cargo.World, shadowSprite);
                shadow.PlayRepeating("idle");
            }

            if (parachutableInfo != null)
                parachuteOffset = parachutableInfo.ParachuteOffset;

            // Adjust x,y to match the target subcell
            cargo.Trait<IPositionable>().SetPosition(cargo, cargo.World.Map.CellContaining(dropPosition));
            var cp = cargo.CenterPosition;
            pos = new WPos(cp.X, cp.Y, dropPosition.Z);
        }
Exemple #4
0
        public Parachute(Actor self, WPos dropPosition)
        {
            um = self.TraitOrDefault<UpgradeManager>();
            pos = self.TraitOrDefault<IPositionable>();

            // Parachutable trait is a prerequisite for running this activity
            para = self.Info.Traits.Get<ParachutableInfo>();
            fallVector = new WVec(0, 0, para.FallRate);
            this.dropPosition = dropPosition;
        }
Exemple #5
0
        public Parachute(Actor self, WPos dropPosition, Actor ignoreActor = null)
        {
            pos = self.TraitOrDefault<IPositionable>();
            ignore = ignoreActor;

            // Parachutable trait is a prerequisite for running this activity
            para = self.Info.TraitInfo<ParachutableInfo>();
            fallVector = new WVec(0, 0, para.FallRate);
            this.dropPosition = dropPosition;
            IsInterruptible = false;
        }
 public Parachutable(Actor self, ParachutableInfo info)
 {
     this.info    = info;
     positionable = self.Trait <IPositionable>();
 }