Ejemplo n.º 1
0
            public override void Use(edict_t self, edict_t other, edict_t activator)
            {
                if (GameBase.level.intermissiontime != 0)
                {
                    return;
                }
                if (0 == GameBase.deathmatch.value && 0 == GameBase.coop.value)
                {
                    if (GameBase.g_edicts[1].health <= 0)
                    {
                        return;
                    }
                }

                if (GameBase.deathmatch.value != 0 && 0 == (( Int32 )GameBase.dmflags.value & Defines.DF_ALLOW_EXIT) && other != GameBase.g_edicts[0])
                {
                    GameCombat.T_Damage(other, self, self, Globals.vec3_origin, other.s.origin, Globals.vec3_origin, 10 * other.max_health, 1000, 0, Defines.MOD_EXIT);
                    return;
                }

                if (GameBase.deathmatch.value != 0)
                {
                    if (activator != null && activator.client != null)
                    {
                        GameBase.gi.Bprintf(Defines.PRINT_HIGH, activator.client.pers.netname + " exited the level.\\n");
                    }
                }

                if (self.map.IndexOf('*') > -1)
                {
                    GameBase.game.serverflags &= ~(Defines.SFL_CROSS_TRIGGER_MASK);
                }
                PlayerHud.BeginIntermission(self);
            }
Ejemplo n.º 2
0
        public static void EndDMLevel()
        {
            edict_t ent;
            string  s, t, f;
            string  seps = " ,\\n\\r";

            if (((int)dmflags.value & Defines.DF_SAME_LEVEL) != 0)
            {
                PlayerHud.BeginIntermission(CreateTargetChangeLevel(level.mapname));
                return;
            }

            if (sv_maplist.string_renamed.Length > 0)
            {
                s = sv_maplist.string_renamed;
                f = null;
                StringTokenizer tk = new StringTokenizer(s, seps);
                while (tk.RemainingTokens > 0)
                {
                    tk.MoveNext();
                    t = tk.Current;
                    if (f == null)
                    {
                        f = t;
                    }
                    if (t.EqualsIgnoreCase(level.mapname))
                    {
                        if (tk.RemainingTokens == 0)
                        {
                            if (f == null)
                            {
                                PlayerHud.BeginIntermission(CreateTargetChangeLevel(level.mapname));
                            }
                            else
                            {
                                PlayerHud.BeginIntermission(CreateTargetChangeLevel(f));
                            }
                        }
                        else
                        {
                            tk.MoveNext();
                            PlayerHud.BeginIntermission(CreateTargetChangeLevel(tk.Current));
                        }
                        return;
                    }
                }
            }

            if (level.nextmap.Length > 0)
            {
                PlayerHud.BeginIntermission(CreateTargetChangeLevel(level.nextmap));
            }
            else
            {
                EdictIterator edit = null;
                edit = G_Find(edit, findByClass, "target_changelevel");
                if (edit == null)
                {
                    PlayerHud.BeginIntermission(CreateTargetChangeLevel(level.mapname));
                    return;
                }

                ent = edit.o;
                PlayerHud.BeginIntermission(ent);
            }
        }