📄 gamespawn.java
字号:
/* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */// Created on 18.11.2003 by RST.// $Id: GameSpawn.java,v 1.17 2006/01/21 21:53:32 salomo Exp $package jake2.game;import jake2.Defines;import jake2.Globals;import jake2.game.monsters.*;import jake2.qcommon.Com;import jake2.util.Lib;public class GameSpawn { static EntThinkAdapter SP_item_health = new EntThinkAdapter() { public String getID(){ return "SP_item_health"; } public boolean think(edict_t ent) { GameItems.SP_item_health(ent); return true; } }; static EntThinkAdapter SP_item_health_small = new EntThinkAdapter() { public String getID(){ return "SP_item_health_small"; } public boolean think(edict_t ent) { GameItems.SP_item_health_small(ent); return true; } }; static EntThinkAdapter SP_item_health_large = new EntThinkAdapter() { public String getID(){ return "SP_item_health_large"; } public boolean think(edict_t ent) { GameItems.SP_item_health_large(ent); return true; } }; static EntThinkAdapter SP_item_health_mega = new EntThinkAdapter() { public String getID(){ return "SP_item_health_mega"; } public boolean think(edict_t ent) { GameItems.SP_item_health_mega(ent); return true; } }; static EntThinkAdapter SP_info_player_start = new EntThinkAdapter() { public String getID(){ return "SP_info_player_start"; } public boolean think(edict_t ent) { PlayerClient.SP_info_player_start(ent); return true; } }; static EntThinkAdapter SP_info_player_deathmatch = new EntThinkAdapter() { public String getID(){ return "SP_info_player_deathmatch"; } public boolean think(edict_t ent) { PlayerClient.SP_info_player_deathmatch(ent); return true; } }; static EntThinkAdapter SP_info_player_coop = new EntThinkAdapter() { public String getID(){ return "SP_info_player_coop"; } public boolean think(edict_t ent) { PlayerClient.SP_info_player_coop(ent); return true; } }; static EntThinkAdapter SP_info_player_intermission = new EntThinkAdapter() { public String getID(){ return "SP_info_player_intermission"; } public boolean think(edict_t ent) { PlayerClient.SP_info_player_intermission(); return true; } }; static EntThinkAdapter SP_func_plat = new EntThinkAdapter() { public String getID(){ return "SP_func_plat"; } public boolean think(edict_t ent) { GameFunc.SP_func_plat(ent); return true; } }; static EntThinkAdapter SP_func_water = new EntThinkAdapter() { public String getID(){ return "SP_func_water"; } public boolean think(edict_t ent) { GameFunc.SP_func_water(ent); return true; } }; static EntThinkAdapter SP_func_train = new EntThinkAdapter() { public String getID(){ return "SP_func_train"; } public boolean think(edict_t ent) { GameFunc.SP_func_train(ent); return true; } }; static EntThinkAdapter SP_func_clock = new EntThinkAdapter() { public String getID(){ return "SP_func_clock"; } public boolean think(edict_t ent) { GameMisc.SP_func_clock(ent); return true; } }; /** * QUAKED worldspawn (0 0 0) ? * * Only used for the world. "sky" environment map name "skyaxis" vector axis * for rotating sky "skyrotate" speed of rotation in degrees/second "sounds" * music cd track number "gravity" 800 is default gravity "message" text to * print at user logon */ static EntThinkAdapter SP_worldspawn = new EntThinkAdapter() { public String getID(){ return "SP_worldspawn"; } public boolean think(edict_t ent) { ent.movetype = Defines.MOVETYPE_PUSH; ent.solid = Defines.SOLID_BSP; ent.inuse = true; // since the world doesn't use G_Spawn() ent.s.modelindex = 1; // world model is always index 1 //--------------- // reserve some spots for dead player bodies for coop / deathmatch PlayerClient.InitBodyQue(); // set configstrings for items GameItems.SetItemNames(); if (GameBase.st.nextmap != null) GameBase.level.nextmap = GameBase.st.nextmap; // make some data visible to the server if (ent.message != null && ent.message.length() > 0) { GameBase.gi.configstring(Defines.CS_NAME, ent.message); GameBase.level.level_name = ent.message; } else GameBase.level.level_name = GameBase.level.mapname; if (GameBase.st.sky != null && GameBase.st.sky.length() > 0) GameBase.gi.configstring(Defines.CS_SKY, GameBase.st.sky); else GameBase.gi.configstring(Defines.CS_SKY, "unit1_"); GameBase.gi.configstring(Defines.CS_SKYROTATE, "" + GameBase.st.skyrotate); GameBase.gi.configstring(Defines.CS_SKYAXIS, Lib .vtos(GameBase.st.skyaxis)); GameBase.gi.configstring(Defines.CS_CDTRACK, "" + ent.sounds); GameBase.gi.configstring(Defines.CS_MAXCLIENTS, "" + (int) (GameBase.maxclients.value)); // status bar program if (GameBase.deathmatch.value != 0) GameBase.gi.configstring(Defines.CS_STATUSBAR, "" + dm_statusbar); else GameBase.gi.configstring(Defines.CS_STATUSBAR, "" + single_statusbar); //--------------- // help icon for statusbar GameBase.gi.imageindex("i_help"); GameBase.level.pic_health = GameBase.gi.imageindex("i_health"); GameBase.gi.imageindex("help"); GameBase.gi.imageindex("field_3"); if ("".equals(GameBase.st.gravity)) GameBase.gi.cvar_set("sv_gravity", "800"); else GameBase.gi.cvar_set("sv_gravity", GameBase.st.gravity); GameBase.snd_fry = GameBase.gi.soundindex("player/fry.wav"); // standing in lava / slime GameItems.PrecacheItem(GameItems.FindItem("Blaster")); GameBase.gi.soundindex("player/lava1.wav"); GameBase.gi.soundindex("player/lava2.wav"); GameBase.gi.soundindex("misc/pc_up.wav"); GameBase.gi.soundindex("misc/talk1.wav"); GameBase.gi.soundindex("misc/udeath.wav"); // gibs GameBase.gi.soundindex("items/respawn1.wav"); // sexed sounds GameBase.gi.soundindex("*death1.wav"); GameBase.gi.soundindex("*death2.wav"); GameBase.gi.soundindex("*death3.wav"); GameBase.gi.soundindex("*death4.wav"); GameBase.gi.soundindex("*fall1.wav"); GameBase.gi.soundindex("*fall2.wav"); GameBase.gi.soundindex("*gurp1.wav"); // drowning damage GameBase.gi.soundindex("*gurp2.wav"); GameBase.gi.soundindex("*jump1.wav"); // player jump GameBase.gi.soundindex("*pain25_1.wav"); GameBase.gi.soundindex("*pain25_2.wav"); GameBase.gi.soundindex("*pain50_1.wav"); GameBase.gi.soundindex("*pain50_2.wav"); GameBase.gi.soundindex("*pain75_1.wav"); GameBase.gi.soundindex("*pain75_2.wav"); GameBase.gi.soundindex("*pain100_1.wav"); GameBase.gi.soundindex("*pain100_2.wav"); // sexed models // THIS ORDER MUST MATCH THE DEFINES IN g_local.h // you can add more, max 15 GameBase.gi.modelindex("#w_blaster.md2"); GameBase.gi.modelindex("#w_shotgun.md2"); GameBase.gi.modelindex("#w_sshotgun.md2"); GameBase.gi.modelindex("#w_machinegun.md2"); GameBase.gi.modelindex("#w_chaingun.md2"); GameBase.gi.modelindex("#a_grenades.md2"); GameBase.gi.modelindex("#w_glauncher.md2"); GameBase.gi.modelindex("#w_rlauncher.md2"); GameBase.gi.modelindex("#w_hyperblaster.md2"); GameBase.gi.modelindex("#w_railgun.md2"); GameBase.gi.modelindex("#w_bfg.md2"); //------------------- GameBase.gi.soundindex("player/gasp1.wav"); // gasping for air GameBase.gi.soundindex("player/gasp2.wav"); // head breaking surface, not gasping GameBase.gi.soundindex("player/watr_in.wav"); // feet hitting water GameBase.gi.soundindex("player/watr_out.wav"); // feet leaving water GameBase.gi.soundindex("player/watr_un.wav"); // head going underwater GameBase.gi.soundindex("player/u_breath1.wav"); GameBase.gi.soundindex("player/u_breath2.wav"); GameBase.gi.soundindex("items/pkup.wav"); // bonus item pickup GameBase.gi.soundindex("world/land.wav"); // landing thud GameBase.gi.soundindex("misc/h2ohit1.wav"); // landing splash GameBase.gi.soundindex("items/damage.wav"); GameBase.gi.soundindex("items/protect.wav"); GameBase.gi.soundindex("items/protect4.wav"); GameBase.gi.soundindex("weapons/noammo.wav"); GameBase.gi.soundindex("infantry/inflies1.wav"); GameBase.sm_meat_index = GameBase.gi .modelindex("models/objects/gibs/sm_meat/tris.md2"); GameBase.gi.modelindex("models/objects/gibs/arm/tris.md2"); GameBase.gi.modelindex("models/objects/gibs/bone/tris.md2"); GameBase.gi.modelindex("models/objects/gibs/bone2/tris.md2"); GameBase.gi.modelindex("models/objects/gibs/chest/tris.md2"); GameBase.gi.modelindex("models/objects/gibs/skull/tris.md2"); GameBase.gi.modelindex("models/objects/gibs/head2/tris.md2"); // // Setup light animation tables. 'a' is total darkness, 'z' is // doublebright. // // 0 normal GameBase.gi.configstring(Defines.CS_LIGHTS + 0, "m"); // 1 FLICKER (first variety) GameBase.gi.configstring(Defines.CS_LIGHTS + 1, "mmnmmommommnonmmonqnmmo"); // 2 SLOW STRONG PULSE GameBase.gi.configstring(Defines.CS_LIGHTS + 2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba"); // 3 CANDLE (first variety) GameBase.gi.configstring(Defines.CS_LIGHTS + 3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg"); // 4 FAST STROBE GameBase.gi.configstring(Defines.CS_LIGHTS + 4, "mamamamamama"); // 5 GENTLE PULSE 1 GameBase.gi.configstring(Defines.CS_LIGHTS + 5, "jklmnopqrstuvwxyzyxwvutsrqponmlkj"); // 6 FLICKER (second variety) GameBase.gi .configstring(Defines.CS_LIGHTS + 6, "nmonqnmomnmomomno"); // 7 CANDLE (second variety) GameBase.gi.configstring(Defines.CS_LIGHTS + 7, "mmmaaaabcdefgmmmmaaaammmaamm"); // 8 CANDLE (third variety) GameBase.gi.configstring(Defines.CS_LIGHTS + 8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa"); // 9 SLOW STROBE (fourth variety) GameBase.gi.configstring(Defines.CS_LIGHTS + 9, "aaaaaaaazzzzzzzz"); // 10 FLUORESCENT FLICKER GameBase.gi.configstring(Defines.CS_LIGHTS + 10, "mmamammmmammamamaaamammma"); // 11 SLOW PULSE NOT FADE TO BLACK GameBase.gi.configstring(Defines.CS_LIGHTS + 11, "abcdefghijklmnopqrrqponmlkjihgfedcba");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -