Пример #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");
            }
        }
Пример #2
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);
        }
Пример #3
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);
        }