Beispiel #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");
            }
        }
Beispiel #2
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();
        }