📄 cl_tent.java
字号:
cl_explosions[index].clear(); return cl_explosions[index]; } /* * ================= CL_SmokeAndFlash ================= */ static void SmokeAndFlash(float[] origin) { explosion_t ex; ex = AllocExplosion(); Math3D.VectorCopy(origin, ex.ent.origin); ex.type = ex_misc; ex.frames = 4; ex.ent.flags = Defines.RF_TRANSLUCENT; ex.start = Globals.cl.frame.servertime - 100; ex.ent.model = cl_mod_smoke; ex = AllocExplosion(); Math3D.VectorCopy(origin, ex.ent.origin); ex.type = ex_flash; ex.ent.flags = Defines.RF_FULLBRIGHT; ex.frames = 2; ex.start = Globals.cl.frame.servertime - 100; ex.ent.model = cl_mod_flash; } /* * ================= * CL_ParseBeam * ================= */ static int ParseBeam(model_t model) { int ent; float[] start = new float[3]; float[] end = new float[3]; beam_t[] b; int i; ent = MSG.ReadShort(Globals.net_message); MSG.ReadPos(Globals.net_message, start); MSG.ReadPos(Globals.net_message, end); // override any beam with the same entity b = cl_beams; for (i = 0; i < MAX_BEAMS; i++) if (b[i].entity == ent) { b[i].entity = ent; b[i].model = model; b[i].endtime = Globals.cl.time + 200; Math3D.VectorCopy(start, b[i].start); Math3D.VectorCopy(end, b[i].end); Math3D.VectorClear(b[i].offset); return ent; } // find a free beam b = cl_beams; for (i = 0; i < MAX_BEAMS; i++) { if (b[i].model == null || b[i].endtime < Globals.cl.time) { b[i].entity = ent; b[i].model = model; b[i].endtime = Globals.cl.time + 200; Math3D.VectorCopy(start, b[i].start); Math3D.VectorCopy(end, b[i].end); Math3D.VectorClear(b[i].offset); return ent; } } Com.Printf("beam list overflow!\n"); return ent; } /* * ================= CL_ParseBeam2 ================= */ static int ParseBeam2(model_t model) { int ent; float[] start = new float[3]; float[] end = new float[3]; float[] offset = new float[3]; beam_t[] b; int i; ent = MSG.ReadShort(Globals.net_message); MSG.ReadPos(Globals.net_message, start); MSG.ReadPos(Globals.net_message, end); MSG.ReadPos(Globals.net_message, offset); // Com_Printf ("end- %f %f %f\n", end[0], end[1], end[2]); // override any beam with the same entity b = cl_beams; for (i = 0; i < MAX_BEAMS; i++) if (b[i].entity == ent) { b[i].entity = ent; b[i].model = model; b[i].endtime = Globals.cl.time + 200; Math3D.VectorCopy(start, b[i].start); Math3D.VectorCopy(end, b[i].end); Math3D.VectorCopy(offset, b[i].offset); return ent; } // find a free beam b = cl_beams; for (i = 0; i < MAX_BEAMS; i++) { if (b[i].model == null || b[i].endtime < Globals.cl.time) { b[i].entity = ent; b[i].model = model; b[i].endtime = Globals.cl.time + 200; Math3D.VectorCopy(start, b[i].start); Math3D.VectorCopy(end, b[i].end); Math3D.VectorCopy(offset, b[i].offset); return ent; } } Com.Printf("beam list overflow!\n"); return ent; } // ROGUE /* * ================= CL_ParsePlayerBeam - adds to the cl_playerbeam array * instead of the cl_beams array ================= */ static int ParsePlayerBeam(model_t model) { int ent; float[] start = new float[3]; float[] end = new float[3]; float[] offset = new float[3]; beam_t[] b; int i; ent = MSG.ReadShort(Globals.net_message); MSG.ReadPos(Globals.net_message, start); MSG.ReadPos(Globals.net_message, end); // PMM - network optimization if (model == cl_mod_heatbeam) Math3D.VectorSet(offset, 2, 7, -3); else if (model == cl_mod_monster_heatbeam) { model = cl_mod_heatbeam; Math3D.VectorSet(offset, 0, 0, 0); } else MSG.ReadPos(Globals.net_message, offset); // Com_Printf ("end- %f %f %f\n", end[0], end[1], end[2]); // override any beam with the same entity // PMM - For player beams, we only want one per player (entity) so.. b = cl_playerbeams; for (i = 0; i < MAX_BEAMS; i++) { if (b[i].entity == ent) { b[i].entity = ent; b[i].model = model; b[i].endtime = Globals.cl.time + 200; Math3D.VectorCopy(start, b[i].start); Math3D.VectorCopy(end, b[i].end); Math3D.VectorCopy(offset, b[i].offset); return ent; } } // find a free beam b = cl_playerbeams; for (i = 0; i < MAX_BEAMS; i++) { if (b[i].model == null || b[i].endtime < Globals.cl.time) { b[i].entity = ent; b[i].model = model; b[i].endtime = Globals.cl.time + 100; // PMM - this needs to be // 100 to prevent multiple // heatbeams Math3D.VectorCopy(start, b[i].start); Math3D.VectorCopy(end, b[i].end); Math3D.VectorCopy(offset, b[i].offset); return ent; } } Com.Printf("beam list overflow!\n"); return ent; } // rogue // stack variable private static final float[] start = new float[3]; private static final float[] end = new float[3]; /* * ================= CL_ParseLightning ================= */ static int ParseLightning(model_t model) { int srcEnt, destEnt; beam_t[] b; int i; srcEnt = MSG.ReadShort(Globals.net_message); destEnt = MSG.ReadShort(Globals.net_message); MSG.ReadPos(Globals.net_message, start); MSG.ReadPos(Globals.net_message, end); // override any beam with the same source AND destination entities b = cl_beams; for (i = 0; i < MAX_BEAMS; i++) if (b[i].entity == srcEnt && b[i].dest_entity == destEnt) { // Com_Printf("%d: OVERRIDE %d . %d\n", cl.time, srcEnt, // destEnt); b[i].entity = srcEnt; b[i].dest_entity = destEnt; b[i].model = model; b[i].endtime = Globals.cl.time + 200; Math3D.VectorCopy(start, b[i].start); Math3D.VectorCopy(end, b[i].end); Math3D.VectorClear(b[i].offset); return srcEnt; } // find a free beam b = cl_beams; for (i = 0; i < MAX_BEAMS; i++) { if (b[i].model == null || b[i].endtime < Globals.cl.time) { // Com_Printf("%d: NORMAL %d . %d\n", cl.time, srcEnt, destEnt); b[i].entity = srcEnt; b[i].dest_entity = destEnt; b[i].model = model; b[i].endtime = Globals.cl.time + 200; Math3D.VectorCopy(start, b[i].start); Math3D.VectorCopy(end, b[i].end); Math3D.VectorClear(b[i].offset); return srcEnt; } } Com.Printf("beam list overflow!\n"); return srcEnt; } // stack variable // start, end /* * ================= CL_ParseLaser ================= */ static void ParseLaser(int colors) { laser_t[] l; int i; MSG.ReadPos(Globals.net_message, start); MSG.ReadPos(Globals.net_message, end); l = cl_lasers; for (i = 0; i < MAX_LASERS; i++) { if (l[i].endtime < Globals.cl.time) { l[i].ent.flags = Defines.RF_TRANSLUCENT | Defines.RF_BEAM; Math3D.VectorCopy(start, l[i].ent.origin); Math3D.VectorCopy(end, l[i].ent.oldorigin); l[i].ent.alpha = 0.30f; l[i].ent.skinnum = (colors >> ((Lib.rand() % 4) * 8)) & 0xff; l[i].ent.model = null; l[i].ent.frame = 4; l[i].endtime = Globals.cl.time + 100; return; } } } // stack variable private static final float[] pos = new float[3]; private static final float[] dir = new float[3]; // ============= // ROGUE static void ParseSteam() { int id, i; int r; int cnt; int color; int magnitude; cl_sustain_t[] s; cl_sustain_t free_sustain; id = MSG.ReadShort(Globals.net_message); // an id of -1 is an instant // effect if (id != -1) // sustains { // Com_Printf ("Sustain effect id %d\n", id); free_sustain = null; s = cl_sustains; for (i = 0; i < MAX_SUSTAINS; i++) { if (s[i].id == 0) { free_sustain = s[i]; break; } } if (free_sustain != null) { s[i].id = id; s[i].count = MSG.ReadByte(Globals.net_message); MSG.ReadPos(Globals.net_message, s[i].org); MSG.ReadDir(Globals.net_message, s[i].dir); r = MSG.ReadByte(Globals.net_message); s[i].color = r & 0xff; s[i].magnitude = MSG.ReadShort(Globals.net_message); s[i].endtime = Globals.cl.time + MSG.ReadLong(Globals.net_message); s[i].think = new cl_sustain_t.ThinkAdapter() { void think(cl_sustain_t self) { CL_newfx.ParticleSteamEffect2(self); } }; s[i].thinkinterval = 100; s[i].nextthink = Globals.cl.time; } else { // Com_Printf ("No free sustains!\n"); // FIXME - read the stuff anyway cnt = MSG.ReadByte(Globals.net_message); MSG.ReadPos(Globals.net_message, pos); MSG.ReadDir(Globals.net_message, dir); r = MSG.ReadByte(Globals.net_message); magnitude = MSG.ReadShort(Globals.net_message); magnitude = MSG.ReadLong(Globals.net_message); // really // interval } } else // instant { cnt = MSG.ReadByte(Globals.net_message); MSG.ReadPos(Globals.net_message, pos); MSG.ReadDir(Globals.net_message, dir); r = MSG.ReadByte(Globals.net_message); magnitude = MSG.ReadShort(Globals.net_message); color = r & 0xff; CL_newfx.ParticleSteamEffect(pos, dir, color, cnt, magnitude); // S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0); } } // stack variable // pos static void ParseWidow() { int id, i; cl_sustain_t[] s; cl_sustain_t free_sustain; id = MSG.ReadShort(Globals.net_message); free_sustain = null; s = cl_sustains; for (i = 0; i < MAX_SUSTAINS; i++) { if (s[i].id == 0) { free_sustain = s[i]; break; } } if (free_sustain != null) { s[i].id = id; MSG.ReadPos(Globals.net_message, s[i].org); s[i].endtime = Globals.cl.time + 2100; s[i].think = new cl_sustain_t.ThinkAdapter() { void think(cl_sustain_t self) { CL_newfx.Widowbeamout(self);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -