Esempio n. 1
0
        private static void updateBallObjPoint()
        {
            if (ballEnt.GetField <bool>("beingCarried"))
            {
                Entity player = ballEnt.GetField <Entity>("carrier");
                GSCFunctions.Objective_Position(ballObjID, player.Origin);
                GSCFunctions.Objective_Icon(ballObjID, "waypoint_kill");
                GSCFunctions.Objective_Team(ballObjID, player.SessionTeam == "allies" ? "axis" : "allies");

                GSCFunctions.Objective_OnEntity(ballObjIDAllies, player);
                GSCFunctions.Objective_State(ballObjIDAllies, "active");
                GSCFunctions.Objective_Team(ballObjIDAllies, player.SessionTeam);

                ballObjAllies_defend.SetShader("waypoint_defend");
                ballObjAllies_defend.SetTargetEnt(player);
                ballObjAllies_defend.Alpha = player.SessionTeam == "allies" ? 0.5f : 0f;
                ballObjAllies_defend.SetWaypoint(true, true, false, false);
                ballObjAxis_defend.SetShader("waypoint_defend");
                ballObjAxis_defend.SetTargetEnt(player);
                ballObjAxis_defend.Alpha = player.SessionTeam == "axis" ? 0.5f : 0f;
                ballObjAxis_defend.SetWaypoint(true, true, false, false);

                //ballObjAllies_kill.SetTargetEnt(player);
                ballObjAllies_kill.Alpha = player.SessionTeam == "axis" ? 0.5f : 0f;
                //ballObjAxis_kill.SetTargetEnt(player);
                ballObjAxis_kill.Alpha = player.SessionTeam == "allies" ? 0.5f : 0f;

                StartAsync(updateBallObjWorld());

                ballText_allies.SetPlayerNameString(player);
                ballText_axis.SetPlayerNameString(player);
            }
            else
            {
                GSCFunctions.Objective_Icon(ballObjID, "waypoint_targetneutral");
                GSCFunctions.Objective_OnEntity(ballObjID, ballEnt);
                GSCFunctions.Objective_Team(ballObjID, "none");

                GSCFunctions.Objective_State(ballObjIDAllies, "invisible");

                ballObjAllies_defend.SetShader("waypoint_targetneutral");
                ballObjAllies_defend.SetTargetEnt(ballEnt);
                ballObjAllies_defend.SetWaypoint(true, true, false, false);
                ballObjAllies_defend.SetWaypointEdgeStyle_RotatingIcon();
                ballObjAllies_defend.Alpha = 0.5f;
                ballObjAxis_defend.SetShader("waypoint_targetneutral");
                ballObjAxis_defend.SetTargetEnt(ballEnt);
                ballObjAxis_defend.SetWaypoint(true, true, false, false);
                ballObjAxis_defend.SetWaypointEdgeStyle_RotatingIcon();
                ballObjAxis_defend.Alpha = 0.5f;

                //ballObjAllies_kill.ClearTargetEnt();
                ballObjAllies_kill.Alpha = 0f;
                //ballObjAxis_kill.ClearTargetEnt();
                ballObjAxis_kill.Alpha = 0f;

                ballText_allies.SetText("AWAY");
                ballText_axis.SetText("AWAY");
            }
        }
Esempio n. 2
0
        private static IEnumerator updateBallObjWorld()
        {
            Entity carrier = ballEnt.GetField <Entity>("carrier");

            if (carrier == level)
            {
                yield break;
            }

            ballObjAllies_kill.X = carrier.Origin.X;
            ballObjAllies_kill.Y = carrier.Origin.Y;
            ballObjAllies_kill.Z = carrier.Origin.Z + 60;
            ballObjAllies_kill.SetWaypoint(true, true, false, false);
            ballObjAxis_kill.X = carrier.Origin.X;
            ballObjAxis_kill.Y = carrier.Origin.Y;
            ballObjAxis_kill.Z = carrier.Origin.Z + 60;
            ballObjAxis_kill.SetWaypoint(true, true, false, false);

            GSCFunctions.Objective_Position(ballObjID, carrier.Origin);

            yield return(Wait(2));

            if (ballEnt.GetField <bool>("beingCarried"))
            {
                StartAsync(updateBallObjWorld());
            }
        }
Esempio n. 3
0
        public static HudElem createReviveHeadIcon(Entity player)
        {
            HudElem icon = NewTeamHudElem("allies");

            icon.SetShader("waypoint_revive", 8, 8);
            icon.Alpha = .85f;
            icon.SetWaypoint(true, true);
            icon.SetTargetEnt(player);
            return(icon);
        }
Esempio n. 4
0
        public static HudElem createPackageIcon(Entity package, bool isSupport = false)
        {
            HudElem icon = NewHudElem();

            icon.Alpha           = .7f;
            icon.Archived        = false;
            icon.HideIn3rdPerson = false;
            icon.HideWhenDead    = false;
            icon.HideWhenInDemo  = false;
            icon.HideWhenInMenu  = false;
            if (isSupport)
            {
                string contents = package.GetField <string>("content");
                string shader   = "";
                if (package.HasField("swapCount") && package.GetField <int>("swapCount") > 1)
                {
                    shader = "waypoint_ammo_friendly";
                }
                else if (horde.weaponNames.Keys.Contains(getBaseWeaponName(contents)))
                {
                    shader = horde.weaponIcons[getBaseWeaponName(contents)];
                }
                else if (horde.perkNames.Keys.Contains(contents))
                {
                    shader = horde.perkIcons[contents];
                }

                icon.SetShader(shader, 10, 10);
            }
            else
            {
                icon.SetShader(horde.killstreakIcons[package.GetField <string>("content")], 10, 10);
            }
            icon.X = package.Origin.X;
            icon.Y = package.Origin.Y;
            icon.Z = package.Origin.Z + 15;
            icon.SetWaypoint(true, true, false, false);
            package.SetField("icon", icon);
            return(icon);
        }
Esempio n. 5
0
        private static IEnumerator spawnStations(Vector3 alliesPos, Vector3 axisPos)
        {
            yield return(Wait(.1f));

            if (isHalftime)
            {
                alliesStation = GSCFunctions.Spawn("script_model", axisPos + new Vector3(0, 0, 100));
            }
            else
            {
                alliesStation = GSCFunctions.Spawn("script_model", alliesPos + new Vector3(0, 0, 100));
            }

            alliesStation.SetModel("tag_origin");
            Entity alliesStationBack = GSCFunctions.Spawn("script_model", alliesStation.Origin);

            alliesStationBack.SetModel("tag_origin");
            alliesStation.SetField("back", alliesStationBack);
            alliesStation.SetField("team", "allies");
            OnInterval(50, () => monitorZone(alliesStation));

            if (isHalftime)
            {
                axisStation = GSCFunctions.Spawn("script_model", alliesPos + new Vector3(0, 0, 100));
            }
            else
            {
                axisStation = GSCFunctions.Spawn("script_model", axisPos + new Vector3(0, 0, 100));
            }

            axisStation.SetModel("tag_origin");
            Entity axisStationBack = GSCFunctions.Spawn("script_model", axisStation.Origin);

            axisStationBack.SetModel("tag_origin");
            axisStation.SetField("back", axisStationBack);
            axisStation.SetField("team", "axis");
            OnInterval(50, () => monitorZone(axisStation));

            alliesStation.SetField("isScoring", false);
            alliesStation.SetField("team", "allies");
            axisStation.SetField("isScoring", false);
            axisStation.SetField("team", "axis");

            GSCFunctions.Objective_Add(alliesSiteAttackerID, "active", alliesStation.Origin, "waypoint_target");
            GSCFunctions.Objective_Team(alliesSiteAttackerID, "allies");
            GSCFunctions.Objective_Add(alliesSiteDefenderID, "active", alliesStation.Origin, "waypoint_defend");
            GSCFunctions.Objective_Team(alliesSiteDefenderID, "axis");
            GSCFunctions.Objective_Add(axisSiteAttackerID, "active", axisStation.Origin, "waypoint_target");
            GSCFunctions.Objective_Team(axisSiteAttackerID, "axis");
            GSCFunctions.Objective_Add(axisSiteDefenderID, "active", axisStation.Origin, "waypoint_defend");
            GSCFunctions.Objective_Team(axisSiteDefenderID, "allies");

            //Hud
            alliesSiteAttackerWaypoint                  = GSCFunctions.NewTeamHudElem("allies");
            alliesSiteAttackerWaypoint.Alpha            = 0.5f;
            alliesSiteAttackerWaypoint.Archived         = true;
            alliesSiteAttackerWaypoint.HideIn3rdPerson  = false;
            alliesSiteAttackerWaypoint.HideWhenDead     = false;
            alliesSiteAttackerWaypoint.HideWhenInDemo   = false;
            alliesSiteAttackerWaypoint.HideWhenInMenu   = false;
            alliesSiteAttackerWaypoint.LowResBackground = false;
            alliesSiteAttackerWaypoint.SetShader("waypoint_target", 10, 10);
            alliesSiteAttackerWaypoint.X = alliesStation.Origin.X;
            alliesSiteAttackerWaypoint.Y = alliesStation.Origin.Y;
            alliesSiteAttackerWaypoint.Z = alliesStation.Origin.Z;
            alliesSiteAttackerWaypoint.SetWaypoint(true, true, false, false);
            alliesSiteAttackerWaypoint.SetWaypointEdgeStyle_RotatingIcon();

            alliesSiteDefenderWaypoint                  = GSCFunctions.NewTeamHudElem("axis");
            alliesSiteDefenderWaypoint.Alpha            = 0.5f;
            alliesSiteDefenderWaypoint.Archived         = true;
            alliesSiteDefenderWaypoint.HideIn3rdPerson  = false;
            alliesSiteDefenderWaypoint.HideWhenDead     = false;
            alliesSiteDefenderWaypoint.HideWhenInDemo   = false;
            alliesSiteDefenderWaypoint.HideWhenInMenu   = false;
            alliesSiteDefenderWaypoint.LowResBackground = false;
            alliesSiteDefenderWaypoint.SetShader("waypoint_defend", 10, 10);
            alliesSiteDefenderWaypoint.X = alliesStation.Origin.X;
            alliesSiteDefenderWaypoint.Y = alliesStation.Origin.Y;
            alliesSiteDefenderWaypoint.Z = alliesStation.Origin.Z;
            alliesSiteDefenderWaypoint.SetWaypoint(true, true, false, false);
            alliesSiteDefenderWaypoint.SetWaypointEdgeStyle_RotatingIcon();

            axisSiteAttackerWaypoint                  = GSCFunctions.NewTeamHudElem("axis");
            axisSiteAttackerWaypoint.Alpha            = 0.5f;
            axisSiteAttackerWaypoint.Archived         = true;
            axisSiteAttackerWaypoint.HideIn3rdPerson  = false;
            axisSiteAttackerWaypoint.HideWhenDead     = false;
            axisSiteAttackerWaypoint.HideWhenInDemo   = false;
            axisSiteAttackerWaypoint.HideWhenInMenu   = false;
            axisSiteAttackerWaypoint.LowResBackground = false;
            axisSiteAttackerWaypoint.SetShader("waypoint_target", 10, 10);
            axisSiteAttackerWaypoint.X = axisStation.Origin.X;
            axisSiteAttackerWaypoint.Y = axisStation.Origin.Y;
            axisSiteAttackerWaypoint.Z = axisStation.Origin.Z;
            axisSiteAttackerWaypoint.SetWaypoint(true, true, false, false);
            axisSiteAttackerWaypoint.SetWaypointEdgeStyle_RotatingIcon();

            axisSiteDefenderWaypoint                  = GSCFunctions.NewTeamHudElem("allies");
            axisSiteDefenderWaypoint.Alpha            = 0.5f;
            axisSiteDefenderWaypoint.Archived         = true;
            axisSiteDefenderWaypoint.HideIn3rdPerson  = false;
            axisSiteDefenderWaypoint.HideWhenDead     = false;
            axisSiteDefenderWaypoint.HideWhenInDemo   = false;
            axisSiteDefenderWaypoint.HideWhenInMenu   = false;
            axisSiteDefenderWaypoint.LowResBackground = false;
            axisSiteDefenderWaypoint.SetShader("waypoint_defend", 10, 10);
            axisSiteDefenderWaypoint.X = axisStation.Origin.X;
            axisSiteDefenderWaypoint.Y = axisStation.Origin.Y;
            axisSiteDefenderWaypoint.Z = axisStation.Origin.Z;
            axisSiteDefenderWaypoint.SetWaypoint(true, true, false, false);
            axisSiteDefenderWaypoint.SetWaypointEdgeStyle_RotatingIcon();

            playStationFX();
        }
Esempio n. 6
0
        private static void spawnBall(Vector3 location)
        {
            ballEnt = GSCFunctions.Spawn("script_model", location + new Vector3(0, 0, 1030));
            ballEnt.SetModel("viewmodel_light_marker");
            ballEnt.SetField("beingCarried", false);
            ballEnt.SetField("carrier", level);
            ballEnt.SetField("parentEnt", level);
            ballEnt.SetField("lastThrow", 999999999);
            ballEnt.MoveTo(ballEnt.Origin - new Vector3(0, 0, 1000), 10, .5f, 1);
            ballEnt.EnableLinkTo();
            ballEnt.NotSolid();
            baseFX = GSCFunctions.SpawnFX(ballSiteFX, location);

            //ballFX = GSCFunctions.Spawn("script_model", ballEnt.Origin);
            //ballFX.SetModel("tag_origin");
            //ballFX.LinkTo(ballEnt, "tag_origin");
            StartAsync(ball_waitForPrematch());

            //Huds
            ballObjAllies_defend                  = GSCFunctions.NewTeamHudElem("allies");
            ballObjAllies_defend.Alpha            = 0.5f;
            ballObjAllies_defend.Archived         = true;
            ballObjAllies_defend.HideIn3rdPerson  = false;
            ballObjAllies_defend.HideWhenDead     = false;
            ballObjAllies_defend.HideWhenInDemo   = false;
            ballObjAllies_defend.HideWhenInMenu   = false;
            ballObjAllies_defend.LowResBackground = false;
            ballObjAllies_defend.SetShader("waypoint_targetneutral", 10, 10);
            ballObjAllies_defend.SetTargetEnt(ballEnt);
            ballObjAllies_defend.SetWaypoint(true, true, false, false);
            ballObjAllies_defend.SetWaypointEdgeStyle_RotatingIcon();

            ballObjAllies_kill                  = GSCFunctions.NewTeamHudElem("allies");
            ballObjAllies_kill.Alpha            = 0f;
            ballObjAllies_kill.Archived         = true;
            ballObjAllies_kill.HideIn3rdPerson  = false;
            ballObjAllies_kill.HideWhenDead     = false;
            ballObjAllies_kill.HideWhenInDemo   = false;
            ballObjAllies_kill.HideWhenInMenu   = false;
            ballObjAllies_kill.LowResBackground = false;
            ballObjAllies_kill.SetShader("waypoint_kill", 10, 10);
            //ballObjAllies_kill.SetTargetEnt(ballEnt);
            //ballObjAllies_kill.SetWaypoint(true, true, false, false);
            //ballObjAllies_kill.SetWaypointEdgeStyle_RotatingIcon();

            ballObjAxis_defend                  = GSCFunctions.NewTeamHudElem("axis");
            ballObjAxis_defend.Alpha            = 0.5f;
            ballObjAxis_defend.Archived         = true;
            ballObjAxis_defend.HideIn3rdPerson  = false;
            ballObjAxis_defend.HideWhenDead     = false;
            ballObjAxis_defend.HideWhenInDemo   = false;
            ballObjAxis_defend.HideWhenInMenu   = false;
            ballObjAxis_defend.LowResBackground = false;
            ballObjAxis_defend.SetShader("waypoint_targetneutral", 10, 10);
            ballObjAxis_defend.SetTargetEnt(ballEnt);
            ballObjAxis_defend.SetWaypoint(true, true, false, false);
            ballObjAxis_defend.SetWaypointEdgeStyle_RotatingIcon();

            ballObjAxis_kill                  = GSCFunctions.NewTeamHudElem("axis");
            ballObjAxis_kill.Alpha            = 0f;
            ballObjAxis_kill.Archived         = true;
            ballObjAxis_kill.HideIn3rdPerson  = false;
            ballObjAxis_kill.HideWhenDead     = false;
            ballObjAxis_kill.HideWhenInDemo   = false;
            ballObjAxis_kill.HideWhenInMenu   = false;
            ballObjAxis_kill.LowResBackground = false;
            ballObjAxis_kill.SetShader("waypoint_kill", 10, 10);
        }