Ejemplo 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");
            }
        }
Ejemplo 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());
            }
        }
Ejemplo n.º 3
0
        private static IEnumerator ball_waitForPrematch()
        {
            while (!prematchOver)
            {
                yield return(Wait(.1f));
            }

            GSCFunctions.Objective_Add(ballObjID, "active");
            GSCFunctions.Objective_Icon(ballObjID, "waypoint_targetneutral");
            GSCFunctions.Objective_Position(ballObjID, ballEnt.Origin);

            GSCFunctions.Objective_Add(ballObjIDAllies, "invisible");
            GSCFunctions.Objective_Icon(ballObjIDAllies, "waypoint_escort");
            GSCFunctions.Objective_Position(ballObjIDAllies, ballEnt.Origin);
            //ballFX.Origin = ballEnt.Origin;
            //GSCFunctions.PlayFXOnTag(ballGlow, ballFX, "tag_origin");
            playBallFX();

            GSCFunctions.TriggerFX(baseFX);

            OnInterval(50, () => monitorBallPickup(ballEnt));
        }