예제 #1
0
    public void RemoteFire(Vector3 Position, Vector3 Rotation, Vector3 Momentum, string Name)
    {
        JumperRocket Rocket = JumperRocketScene.Instance() as JumperRocket;

        Rocket.IsLocal         = false;
        Rocket.Translation     = Position;
        Rocket.RotationDegrees = Rotation;
        Rocket.Momentum        = Momentum;
        Rocket.Name            = Name;
        World.EntitiesRoot.AddChild(Rocket);
    }
예제 #2
0
    public static void Fire(Items.Instance Item, Player UsingPlayer)
    {
        JumperRocket Rocket = JumperRocketScene.Instance() as JumperRocket;

        Rocket.IsLocal         = true;
        Rocket.Player          = UsingPlayer;
        Rocket.Translation     = UsingPlayer.RocketStart.GetGlobalTransform().origin;
        Rocket.RotationDegrees = new Vector3(-UsingPlayer.LookVertical, UsingPlayer.LookHorizontal, 0);
        Rocket.Momentum        = new Vector3(0, 0, RocketTravelSpeed)
                                 .Rotated(new Vector3(1, 0, 0), Deg2Rad(Rocket.RotationDegrees.x))
                                 .Rotated(new Vector3(0, 1, 0), Deg2Rad(Rocket.RotationDegrees.y));
        Rocket.Name = System.Guid.NewGuid().ToString();
        World.EntitiesRoot.AddChild(Rocket);

        Net.SteelRpc(Self, nameof(RemoteFire), Rocket.Translation, Rocket.RotationDegrees, Rocket.Momentum, Rocket.GetName());

        UsingPlayer.SfxManager.FpRocketFire();
    }