Esempio n. 1
0
        private static bool checkForWallRun(Entity player)
        {
            if (!player.IsOnGround())
            {
                return(true);
            }

            Vector3 playerAngles  = player.Angles;//player.GetPlayerAngles();
            Vector3 playerOrigin  = player.Origin;
            Vector3 right         = GSCFunctions.AnglesToRight(playerAngles);
            Vector3 rightPosition = playerOrigin + (right * 5);
            Vector3 leftPosition  = playerOrigin + (right * -5);
            bool    wallR         = !GSCFunctions.PhysicsTrace(playerOrigin, rightPosition).Equals(rightPosition) && GSCFunctions.SightTracePassed(playerOrigin, rightPosition, false);
            bool    wallL         = !GSCFunctions.PhysicsTrace(playerOrigin, leftPosition).Equals(leftPosition) && GSCFunctions.SightTracePassed(playerOrigin, leftPosition, false);

            Log.Write(LogLevel.All, "L {0} R {1}", wallL, wallR);

            if (player.IsAlive)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
    private static void nukeAftermathEffect()
    {
        //OnNotify("spawning_intermission"
        Entity  aftermathEnt = GSCFunctions.GetEnt("mp_global_intermission", "classname");
        Vector3 up           = GSCFunctions.AnglesToUp(aftermathEnt.Angles);
        Vector3 right        = GSCFunctions.AnglesToRight(aftermathEnt.Angles);

        GSCFunctions.PlayFX(effects[2], aftermathEnt.Origin, up, right);
    }
Esempio n. 3
0
        private static Entity SpawnTriggerFX(int fxid, Vector3 pos)
        {
            Vector3 upangles = GSCFunctions.VectorToAngles(new Vector3(0, 0, 1000));
            Vector3 forward  = GSCFunctions.AnglesToForward(upangles);
            Vector3 right    = GSCFunctions.AnglesToRight(upangles);

            Entity effect = GSCFunctions.SpawnFX(fxid, pos, forward, right);

            GSCFunctions.TriggerFX(effect);

            return(effect);
        }
Esempio n. 4
0
        private static void shThrustersDirectional(Entity player)
        {
            bool    isGrounded       = !player.GetField <bool>("mayThrust");
            bool    hasThrusted      = player.GetField <bool>("hasThrustedForward");
            int     thrustsAvailable = player.GetField <int>("thrusterEnergy");
            int     lastThrustTime   = player.GetField <int>("lastThrust");
            int     time             = GSCFunctions.GetTime();
            Vector3 movement         = player.GetNormalizedMovement();

            if (!isGrounded && !hasThrusted && thrustsAvailable > 0 && time > (lastThrustTime + 200) && player.IsAlive && movement.X > 0)
            {
                player.SetField("hasThrustedForward", true);
                player.SetPerk("specialty_automantle", true, false);
                player.SetField("thrusterEnergy", player.GetField <int>("thrusterEnergy") - 1);
                if (player.HasPerk("specialty_quieter"))
                {
                    player.PlaySound("bullet_mega_flesh");
                }
                else
                {
                    player.PlaySound("weap_hind_rocket_fire");
                }
                shThrustRadarBlip(player);
                Vector3 currentVel = player.GetVelocity();
                Vector3 angles     = player.GetPlayerAngles();
                Vector3 forward    = GSCFunctions.AnglesToForward(angles);
                //Log.Debug("X: {0}, Y: {1}, Z: {2}", forward.X, forward.Y, forward.Z);
                Vector3 newVel = new Vector3(currentVel.X + (forward.X * 250), currentVel.Y + (forward.Y * 250), currentVel.Z);

                player.SetVelocity(newVel);
            }
            else if (!hasThrusted && thrustsAvailable > 0 && time > (lastThrustTime + 200) && player.IsAlive && movement.Y != 0 && movement.X == 0)//Dodge
            {
                player.SetField("hasThrustedForward", true);
                player.SetPerk("specialty_automantle", true, false);
                player.SetField("thrusterEnergy", player.GetField <int>("thrusterEnergy") - 1);
                if (player.HasPerk("specialty_quieter"))
                {
                    player.PlaySound("bullet_mega_flesh");
                }
                else
                {
                    player.PlaySound("weap_hind_rocket_fire");
                }
                shThrustRadarBlip(player);
                Vector3 currentVel = player.GetVelocity();
                Vector3 angles     = player.GetPlayerAngles();
                Vector3 right      = GSCFunctions.AnglesToRight(angles);
                //Log.Debug("X: {0}, Y: {1}, Z: {2}", forward.X, forward.Y, forward.Z);
                Vector3 newVel;
                if (movement.Y > 0)
                {
                    newVel = new Vector3(currentVel.X + (right.X * 300), currentVel.Y + (right.Y * 300), currentVel.Z);
                }
                else
                {
                    newVel = new Vector3(currentVel.X + (-right.X * 300), currentVel.Y + (-right.Y * 300), currentVel.Z);
                }

                player.SetVelocity(newVel);
                player.SlideVelocity += newVel;
                AfterDelay(1000, () => player.SetField("hasThrustedForward", false));
            }
            else if (!hasThrusted && thrustsAvailable == 0)
            {
                player.PlayLocalSound("weap_motiontracker_open_plr");
            }
        }