Ejemplo n.º 1
0
        public Entity[] CreateTeleporter(Vector3 origin, Vector3 angle, Vector3 endorigin)
        {
            Call("precacheshader", new Parameter[] { "hudicon_neutral" });
            Entity box = Call <Entity>("spawn", new Parameter[] { "script_model", new Parameter(origin) });

            box.Call("setmodel", new Parameter[] { "com_plasticcase_friendly" });
            box.SetField("angles", new Parameter(angle));
            box.Call("clonebrushmodeltoscriptmodel", new Parameter[] { _airdropCollision });
            box.SetField("endorigin", endorigin);
            Vector3 v = origin;

            v.Z += 17f;
            Entity laptop = Call <Entity>("spawn", new Parameter[] { "script_model", new Parameter(v) });

            laptop.Call("setmodel", new Parameter[] { "com_laptop_2_open" });
            LaptopRotate(laptop);
            HudElem elem = HudElem.NewHudElem();

            elem.SetShader("hudicon_neutral", 20, 20);
            elem.X = box.Origin.X;
            elem.Y = box.Origin.Y;
            elem.Z = box.Origin.Z + 40f;
            elem.Call("SetWayPoint", new Parameter[] { 1, 1 });
            int num = 0x1f - curObjID++;

            Call("objective_state", new Parameter[] { num, "active" });
            Call("objective_position", new Parameter[] { num, new Parameter(origin) });
            Call("objective_icon", new Parameter[] { num, "hudicon_neutral" });

            return(new Entity[] { box });
        }
Ejemplo n.º 2
0
        public static void CreateFlagShader(Vector3 origin)
        {
            HudElem elem = HudElem.NewHudElem();

            elem.SetShader("waypoint_flag_friendly", 15, 15);
            elem.Alpha = 0.6f;
            elem.X     = origin.X;
            elem.Y     = origin.Y;
            elem.Z     = origin.Z + 100f;
            elem.Call("SetWayPoint", 1, 1);
        }
Ejemplo n.º 3
0
        private void CreateFlagShader(Entity flag)
        {
            HudElem elem = HudElem.NewHudElem();

            elem.SetShader("waypoint_flag_friendly", 15, 15);
            elem.Alpha = 0.6f;
            elem.X     = flag.Origin.X;
            elem.Y     = flag.Origin.Y;
            elem.Z     = flag.Origin.Z + 100f;
            elem.Call("SetWayPoint", 1, 1);
        }
Ejemplo n.º 4
0
        public void CreateFlagShader(Entity flag)
        {
            HudElem elem = HudElem.NewHudElem();

            elem.SetShader("waypoint_flag_friendly", 20, 20);
            elem.Alpha = 0.6f;
            elem.X     = flag.Origin.X;
            elem.Y     = flag.Origin.Y;
            elem.Z     = flag.Origin.Z + 100f;
            elem.Call("SetWayPoint", new Parameter[] { 1, 1 });
        }
Ejemplo n.º 5
0
        public static HudElem BonusDropHud(string shader, float xpoint)
        {
            var icon = HudElem.NewHudElem();

            icon.HorzAlign  = "center";
            icon.VertAlign  = "middle";
            icon.AlignX     = "center";
            icon.AlignY     = "middle";
            icon.Foreground = true;
            icon.SetShader(shader, 30, 30);
            icon.Alpha = 1;
            icon.Y     = 200;
            icon.X     = xpoint;

            return(icon);
        }
Ejemplo n.º 6
0
        public static void BonusDropTakeHud(Entity player, string text, string shader)
        {
            var hud = HudElem.NewHudElem();

            hud.HorzAlign = "center";
            hud.VertAlign = "middle";
            hud.AlignX    = "center";
            hud.AlignY    = "middle";
            hud.Font      = "objective";
            hud.FontScale = 2;
            hud.Alpha     = 1;
            hud.Color     = new Vector3(1, 1, 1);
            hud.GlowColor = new Vector3(1f, 0.3f, 0.3f);
            hud.GlowAlpha = 0.85f;
            hud.X         = 0;
            hud.Y         = 140;

            hud.Call("moveovertime", 2);
            hud.Call("fadeovertime", 2);
            hud.Y     = 80;
            hud.Alpha = 0;

            var icon = HudElem.NewTeamHudElem("allies");

            icon.HorzAlign  = "center";
            icon.VertAlign  = "middle";
            icon.AlignX     = "center";
            icon.AlignY     = "middle";
            icon.X          = 0;
            icon.Y          = 125;
            icon.Foreground = true;
            icon.SetShader(shader, 30, 30);
            icon.Alpha = 1;

            icon.Call("moveovertime", 2);
            icon.Call("fadeovertime", 2);
            icon.Y     = 65;
            icon.Alpha = 0;

            player.AfterDelay(2000, e =>
            {
                hud.Call("destroy");
                icon.Call("destroy");
            });
        }
Ejemplo n.º 7
0
        public static HudElem CreateShader(Vector3 origin, string shader, string team = "")
        {
            HudElem elem;

            if (team != "")
            {
                elem = HudElem.NewTeamHudElem(team);
            }
            else
            {
                elem = HudElem.NewHudElem();
            }
            elem.SetShader(shader, 15, 15);
            elem.Alpha = 0.6f;
            elem.X     = origin.X;
            elem.Y     = origin.Y;
            elem.Z     = origin.Z + 50f;
            elem.Call("SetWayPoint", 1, 1);

            return(elem);
        }
Ejemplo n.º 8
0
        private HudElem CreateShader(Entity ent, string shader, string team = "")
        {
            HudElem elem;

            if (team != "")
            {
                elem = HudElem.NewTeamHudElem(team);
            }
            else
            {
                elem = HudElem.NewHudElem();
            }
            elem.SetShader(shader, 15, 15);
            elem.Alpha = 0.6f;
            elem.X     = ent.Origin.X;
            elem.Y     = ent.Origin.Y;
            elem.Z     = ent.Origin.Z + 50f;
            elem.Call("SetWayPoint", 1, 1);

            return(elem);
        }