예제 #1
0
        public void SetPxPosition(Actor self, PPos px)
        {
            var cell = px.ToCPos();

            SetLocation(cell, fromSubCell, cell, fromSubCell);
            PxPosition = px;
            FinishedMoving(self);
        }
        public void ApplyOrders(World world, PPos xy, MouseInput mi)
        {
            if (world.OrderGenerator == null) return;

            var orders = world.OrderGenerator.Order(world, xy.ToCPos(), mi).ToArray();
            orders.Do(o => world.IssueOrder(o));

            world.PlayVoiceForOrders(orders);
        }
        public void ApplyOrders(World world, PPos xy, MouseInput mi)
        {
            if (world.OrderGenerator == null)
            {
                return;
            }

            var orders = world.OrderGenerator.Order(world, xy.ToCPos(), mi).ToArray();

            orders.Do(o => world.IssueOrder(o));

            world.PlayVoiceForOrders(orders);
        }
예제 #4
0
        public void Tick(World world)
        {
            paraAnim.Tick();

            altitude -= fallRate;

            if (altitude <= 0)
            {
                world.AddFrameEndTask(w =>
                {
                    w.Remove(this);
                    var loc = location.ToCPos();
                    cargo.CancelActivity();
                    cargo.Trait <ITeleportable>().SetPosition(cargo, loc);
                    w.Add(cargo);
                });
            }
        }
예제 #5
0
        public void Tick(Actor self)
        {
            if (--ticks <= 0)
            {
                var move = self.Trait<IMove>();
                if (move.Altitude > 0 && self.GetDamageState() >= DamageState.Heavy)
                {
                    var facing = self.Trait<IFacing>();
                    var altitude = new PVecInt(0, move.Altitude);
                    position = (self.CenterLocation - (PVecInt)Combat.GetTurretPosition(self, facing, smokeTurret).ToInt2());

                    if (self.World.RenderedShroud.IsVisible(position.ToCPos()))
                        self.World.AddFrameEndTask(
                            w => w.Add(new Smoke(w, position - altitude, "smokey")));
                }

                ticks = interval;
            }
        }
예제 #6
0
        public void Tick(Actor self)
        {
            if (--ticks <= 0)
            {
                var move = self.Trait <IMove>();
                if (move.Altitude > 0 && self.GetDamageState() >= DamageState.Heavy)
                {
                    var facing   = self.Trait <IFacing>();
                    var altitude = new PVecInt(0, move.Altitude);
                    position = (self.CenterLocation - Combat.GetTurretPosition(self, facing, smokeTurret));

                    if (self.World.LocalShroud.IsVisible(position.ToCPos()))
                    {
                        self.World.AddFrameEndTask(
                            w => w.Add(new Smoke(w, position - altitude, "smokey")));
                    }
                }

                ticks = interval;
            }
        }
예제 #7
0
        public void Tick(World world)
        {
            paraAnim.Tick();

            altitude -= fallRate;

            if (altitude <= 0)
            {
                world.AddFrameEndTask(w =>
                {
                    w.Remove(this);
                    var loc = location.ToCPos();
                    cargo.CancelActivity();
                    cargo.Trait <ITeleportable>().SetPosition(cargo, loc);
                    w.Add(cargo);

                    foreach (var npl in cargo.TraitsImplementing <INotifyParachuteLanded>())
                    {
                        npl.OnLanded();
                    }
                });
            }
        }
예제 #8
0
 public void SetPxPosition(Actor self, PPos px)
 {
     SetPosition(self, px.ToCPos());
 }