Massive revamp of the Nuclide system classes, more efficient networking
and memory usage thanks to intelligent boxing of fields. Added Util_TimeToString, removed old VOX code, added lots of new helper classes...
This commit is contained in:
parent
e53a7a33e2
commit
249e4bc612
170 changed files with 3295 additions and 3273 deletions
|
@ -48,17 +48,6 @@ Game_ParseClientCommand(string cmd)
|
|||
{
|
||||
tokenize(cmd);
|
||||
|
||||
if (argv(1) == "timeleft") {
|
||||
string msg;
|
||||
string timestring;
|
||||
float timeleft;
|
||||
timeleft = cvar("mp_timelimit") - (time / 60);
|
||||
timestring = Vox_TimeToString(timeleft);
|
||||
msg = sprintf("we have %s minutes remaining", timestring);
|
||||
Vox_Singlecast(self, msg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (argv(0) == "say") {
|
||||
SV_SendChat(self, argv(1), world, 0);
|
||||
return;
|
||||
|
|
|
@ -216,7 +216,7 @@ bot::CheckRoute(void)
|
|||
flDist = floor(vlen(evenpos));
|
||||
|
||||
if (flDist <= rad) {
|
||||
dprint(sprintf("^2CBaseMonster::^3CheckRoute^7: " \
|
||||
dprint(sprintf("^2bot::^3CheckRoute^7: " \
|
||||
"%s reached node\n", this.targetname));
|
||||
m_iCurNode--;
|
||||
|
||||
|
@ -241,7 +241,7 @@ bot::CheckRoute(void)
|
|||
|
||||
/* can we walk directly to our target destination? */
|
||||
if (trace_fraction == 1.0) {
|
||||
dprint("^2CBaseMonster::^3CheckRoute^7: " \
|
||||
dprint("^2bot::^3CheckRoute^7: " \
|
||||
"Walking directly to last node\n");
|
||||
m_iCurNode = -1;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,6 @@ void Event_Callback(float mtime, __inout float btime);
|
|||
void View_AddEvent(void(void) pCallback, float flTime);
|
||||
void View_PlayAnimation(int);
|
||||
void View_PlayAnimation(int);
|
||||
void Vox_Play(string);
|
||||
void Event_ProcessModel(float, int, string);
|
||||
void ClientGame_ModelEvent(float, int, string);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ float
|
|||
Entities_ParseLump(void)
|
||||
{
|
||||
entity eOld;
|
||||
CBaseEntity eEnt = __NULL__;
|
||||
NSEntity eEnt = __NULL__;
|
||||
string strField, strValue;
|
||||
__fullspawndata = "";
|
||||
int iClass = FALSE;
|
||||
|
@ -57,7 +57,7 @@ Entities_ParseLump(void)
|
|||
|
||||
switch (strField) {
|
||||
case "classname":
|
||||
eEnt = (CBaseEntity)spawn();
|
||||
eEnt = (NSEntity)spawn();
|
||||
|
||||
/* check if our classname has a matching class */
|
||||
if (isfunction(strcat("spawnfunc_", strValue))) {
|
||||
|
@ -83,7 +83,7 @@ void
|
|||
Entities_RendererRestarted(void)
|
||||
{
|
||||
for (entity b = world; (b = findfloat(b, ::isCSQC, TRUE));) {
|
||||
CBaseEntity pf = (CBaseEntity) b;
|
||||
NSEntity pf = (NSEntity) b;
|
||||
pf.RendererRestarted();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ CSQC_Init(float apilevel, string enginename, float engineversion)
|
|||
registercommand("setang");
|
||||
registercommand("dev_sentence");
|
||||
registercommand("titles_test");
|
||||
registercommand("vox_test");
|
||||
registercommand("buildcubemaps");
|
||||
registercommand("dev_sunpos");
|
||||
registercommand("dev_measure");
|
||||
|
@ -88,10 +87,6 @@ CSQC_Init(float apilevel, string enginename, float engineversion)
|
|||
/* Sound shaders */
|
||||
Sound_Init();
|
||||
PropData_Init();
|
||||
|
||||
/* VOX */
|
||||
Vox_Init();
|
||||
|
||||
precache_sound("common/wpn_hudon.wav");
|
||||
precache_sound("common/wpn_hudoff.wav");
|
||||
precache_sound("common/wpn_moveselect.wav");
|
||||
|
@ -144,7 +139,6 @@ CSQC_RendererRestarted(string rstr)
|
|||
/* GS-Entbase */
|
||||
Fade_Init();
|
||||
Decal_Reload();
|
||||
FX_Init();
|
||||
Sky_Update(TRUE);
|
||||
Entities_RendererRestarted();
|
||||
}
|
||||
|
@ -301,7 +295,7 @@ CSQC_UpdateView(float w, float h, float focus)
|
|||
setproperty(VF_ORIGIN, pSeat->m_vecPredictedOrigin + pl.view_ofs);
|
||||
|
||||
if (pl.flags & FL_INVEHICLE) {
|
||||
CBaseVehicle veh = (CBaseVehicle)pl.vehicle;
|
||||
NSVehicle veh = (NSVehicle)pl.vehicle;
|
||||
|
||||
if (veh.UpdateView)
|
||||
veh.UpdateView();
|
||||
|
@ -386,7 +380,7 @@ CSQC_UpdateView(float w, float h, float focus)
|
|||
RenderTarget_Monitor_Update();
|
||||
|
||||
for (entity b = world; (b = findfloat(b, ::isCSQC, 1));) {
|
||||
CBaseEntity pf = (CBaseEntity) b;
|
||||
NSEntity pf = (NSEntity) b;
|
||||
pf.postdraw();
|
||||
}
|
||||
|
||||
|
@ -433,8 +427,6 @@ CSQC_UpdateView(float w, float h, float focus)
|
|||
|
||||
pSeat = __NULL__;
|
||||
pSeatLocal = __NULL__;
|
||||
|
||||
Vox_Update();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -615,7 +607,7 @@ CSQC_Parse_Event(void)
|
|||
sound(t, CHAN_VOICE, msg, 1.0, ATTN_NORM, pit);
|
||||
break;
|
||||
case EV_SENTENCE:
|
||||
CBaseEntity_ParseSentence();
|
||||
NSTalkMonster_ParseSentence();
|
||||
break;
|
||||
case EV_HUDHINT:
|
||||
string hint;
|
||||
|
@ -672,9 +664,6 @@ CSQC_Parse_Event(void)
|
|||
pSeat->m_flShakeFreq = readfloat();
|
||||
pSeat->m_flShakeTime = pSeat->m_flShakeDuration;
|
||||
break;
|
||||
case EV_SENTENCE_VOX:
|
||||
Vox_PlaySentence(readstring());
|
||||
break;
|
||||
default:
|
||||
ClientGame_EventParse(fHeader);
|
||||
}
|
||||
|
@ -761,9 +750,6 @@ CSQC_ConsoleCommand(string sCMD)
|
|||
case "titles_test":
|
||||
GameMessage_Setup(argv(1), 0);
|
||||
break;
|
||||
case "vox_test":
|
||||
Vox_Play(sCMD);
|
||||
break;
|
||||
case "+attack2":
|
||||
pSeat->m_iInputAttack2 = TRUE;
|
||||
break;
|
||||
|
@ -930,14 +916,24 @@ CSQC_Ent_Update(float new)
|
|||
|
||||
switch (t) {
|
||||
case ENT_ENTITY:
|
||||
CBaseEntity me = (CBaseEntity)self;
|
||||
NSEntity me = (NSEntity)self;
|
||||
if (new) {
|
||||
spawnfunc_CBaseEntity();
|
||||
spawnfunc_NSEntity();
|
||||
}
|
||||
me.ReceiveEntity(readfloat());
|
||||
break;
|
||||
case ENT_ENTITYRENDERABLE:
|
||||
NSRenderableEntity rend = (NSRenderableEntity)self;
|
||||
if (new) {
|
||||
spawnfunc_NSRenderableEntity();
|
||||
}
|
||||
rend.ReceiveEntity(readfloat());
|
||||
break;
|
||||
case ENT_MONSTER:
|
||||
basemonster_readentity(new);
|
||||
NSMonster_ReadEntity(new);
|
||||
break;
|
||||
case ENT_TALKMONSTER:
|
||||
NSTalkMonster_ReadEntity(new);
|
||||
break;
|
||||
case ENT_VEHICLE:
|
||||
basevehicle_readentity(new);
|
||||
|
@ -1111,6 +1107,5 @@ CSQC_Shutdown(void)
|
|||
Titles_Shutdown();
|
||||
Sound_Shutdown();
|
||||
PropData_Shutdown();
|
||||
Vox_Shutdown();
|
||||
EFX_Shutdown();
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ damage.qc
|
|||
chat.qc
|
||||
textmenu.qc
|
||||
vgui.qc
|
||||
vox.qc
|
||||
way.qc
|
||||
in_saturn.qc
|
||||
efx.qc
|
||||
|
|
|
@ -80,7 +80,7 @@ Predict_PlayerPreFrame(player pl)
|
|||
|
||||
if (pl.flags & FL_INVEHICLE)
|
||||
if (pl.vehicle) {
|
||||
CBaseVehicle veh = (CBaseVehicle)pl.vehicle;
|
||||
NSVehicle veh = (NSVehicle)pl.vehicle;
|
||||
veh.PredictPreFrame();
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ Predict_PlayerPostFrame(player pl)
|
|||
|
||||
if (pl.flags & FL_INVEHICLE)
|
||||
if (pl.vehicle) {
|
||||
CBaseVehicle veh = (CBaseVehicle)pl.vehicle;
|
||||
NSVehicle veh = (NSVehicle)pl.vehicle;
|
||||
veh.PredictPostFrame();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,729 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
var int g_voxcount;
|
||||
var int g_voxpos;
|
||||
var float g_voxtime = 0.0f;
|
||||
|
||||
sound_t *g_voxque;
|
||||
|
||||
void
|
||||
Vox_Play(string msg)
|
||||
{
|
||||
if (g_voxcount) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_voxcount = tokenize(msg);
|
||||
g_voxque = memalloc(sizeof(sound_t) * g_voxcount);
|
||||
|
||||
for (int i = 0; i < g_voxcount; i++) {
|
||||
g_voxque[i].m_strSnd = sprintf("vox/%s.wav", argv(i));
|
||||
g_voxque[i].m_flLength = soundlength(g_voxque[i].m_strSnd);
|
||||
}
|
||||
g_voxtime = time;
|
||||
}
|
||||
|
||||
void
|
||||
Vox_Update(void)
|
||||
{
|
||||
if (cltime < 2 || !g_voxcount) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_voxtime < time) {
|
||||
localcmd(sprintf("play %s\n", g_voxque[g_voxpos].m_strSnd));
|
||||
g_voxpos++;
|
||||
|
||||
if (g_voxpos == g_voxcount) {
|
||||
memfree(g_voxque);
|
||||
g_voxcount = 0;
|
||||
g_voxpos = 0;
|
||||
} else {
|
||||
g_voxtime = time + g_voxque[g_voxpos - 1].m_flLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Vox_Shutdown(void)
|
||||
{
|
||||
if (g_voxcount)
|
||||
memfree(g_voxque);
|
||||
|
||||
g_voxcount = 0;
|
||||
g_voxpos = 0;
|
||||
}
|
||||
|
||||
void
|
||||
Vox_Init(void)
|
||||
{
|
||||
precache_sound("vox/accelerating.wav");
|
||||
precache_sound("vox/accelerator.wav");
|
||||
precache_sound("vox/accepted.wav");
|
||||
precache_sound("vox/access.wav");
|
||||
precache_sound("vox/acknowledged.wav");
|
||||
precache_sound("vox/acknowledge.wav");
|
||||
precache_sound("vox/acquired.wav");
|
||||
precache_sound("vox/acquisition.wav");
|
||||
precache_sound("vox/across.wav");
|
||||
precache_sound("vox/activated.wav");
|
||||
precache_sound("vox/activate.wav");
|
||||
precache_sound("vox/activity.wav");
|
||||
precache_sound("vox/adios.wav");
|
||||
precache_sound("vox/administration.wav");
|
||||
precache_sound("vox/advanced.wav");
|
||||
precache_sound("vox/after.wav");
|
||||
precache_sound("vox/agent.wav");
|
||||
precache_sound("vox/alarm.wav");
|
||||
precache_sound("vox/alert.wav");
|
||||
precache_sound("vox/alien.wav");
|
||||
precache_sound("vox/aligned.wav");
|
||||
precache_sound("vox/all.wav");
|
||||
precache_sound("vox/alpha.wav");
|
||||
precache_sound("vox/amigo.wav");
|
||||
precache_sound("vox/ammunition.wav");
|
||||
precache_sound("vox/am.wav");
|
||||
precache_sound("vox/and.wav");
|
||||
precache_sound("vox/announcement.wav");
|
||||
precache_sound("vox/anomalous.wav");
|
||||
precache_sound("vox/antenna.wav");
|
||||
precache_sound("vox/an.wav");
|
||||
precache_sound("vox/any.wav");
|
||||
precache_sound("vox/apprehend.wav");
|
||||
precache_sound("vox/approach.wav");
|
||||
precache_sound("vox/area.wav");
|
||||
precache_sound("vox/are.wav");
|
||||
precache_sound("vox/armed.wav");
|
||||
precache_sound("vox/armor.wav");
|
||||
precache_sound("vox/armory.wav");
|
||||
precache_sound("vox/arm.wav");
|
||||
precache_sound("vox/arrest.wav");
|
||||
precache_sound("vox/ass.wav");
|
||||
precache_sound("vox/atomic.wav");
|
||||
precache_sound("vox/attention.wav");
|
||||
precache_sound("vox/at.wav");
|
||||
precache_sound("vox/authorized.wav");
|
||||
precache_sound("vox/authorize.wav");
|
||||
precache_sound("vox/automatic.wav");
|
||||
precache_sound("vox/a.wav");
|
||||
precache_sound("vox/away.wav");
|
||||
precache_sound("vox/backman.wav");
|
||||
precache_sound("vox/back.wav");
|
||||
precache_sound("vox/bad.wav");
|
||||
precache_sound("vox/bag.wav");
|
||||
precache_sound("vox/bailey.wav");
|
||||
precache_sound("vox/barracks.wav");
|
||||
precache_sound("vox/base.wav");
|
||||
precache_sound("vox/bay.wav");
|
||||
precache_sound("vox/been.wav");
|
||||
precache_sound("vox/before.wav");
|
||||
precache_sound("vox/be.wav");
|
||||
precache_sound("vox/beyond.wav");
|
||||
precache_sound("vox/biohazard.wav");
|
||||
precache_sound("vox/biological.wav");
|
||||
precache_sound("vox/birdwell.wav");
|
||||
precache_sound("vox/bizwarn.wav");
|
||||
precache_sound("vox/black.wav");
|
||||
precache_sound("vox/blast.wav");
|
||||
precache_sound("vox/blocked.wav");
|
||||
precache_sound("vox/bloop.wav");
|
||||
precache_sound("vox/blue.wav");
|
||||
precache_sound("vox/bottom.wav");
|
||||
precache_sound("vox/bravo.wav");
|
||||
precache_sound("vox/breached.wav");
|
||||
precache_sound("vox/breach.wav");
|
||||
precache_sound("vox/break.wav");
|
||||
precache_sound("vox/bridge.wav");
|
||||
precache_sound("vox/bust.wav");
|
||||
precache_sound("vox/button.wav");
|
||||
precache_sound("vox/but.wav");
|
||||
precache_sound("vox/buzwarn.wav");
|
||||
precache_sound("vox/b.wav");
|
||||
precache_sound("vox/bypass.wav");
|
||||
precache_sound("vox/cable.wav");
|
||||
precache_sound("vox/called.wav");
|
||||
precache_sound("vox/call.wav");
|
||||
precache_sound("vox/canal.wav");
|
||||
precache_sound("vox/captain.wav");
|
||||
precache_sound("vox/capture.wav");
|
||||
precache_sound("vox/cap.wav");
|
||||
precache_sound("vox/ceiling.wav");
|
||||
precache_sound("vox/celsius.wav");
|
||||
precache_sound("vox/center.wav");
|
||||
precache_sound("vox/centi.wav");
|
||||
precache_sound("vox/central.wav");
|
||||
precache_sound("vox/chamber.wav");
|
||||
precache_sound("vox/charlie.wav");
|
||||
precache_sound("vox/checkpoint.wav");
|
||||
precache_sound("vox/check.wav");
|
||||
precache_sound("vox/chemical.wav");
|
||||
precache_sound("vox/cleanup.wav");
|
||||
precache_sound("vox/clearance.wav");
|
||||
precache_sound("vox/clear.wav");
|
||||
precache_sound("vox/close.wav");
|
||||
precache_sound("vox/coded.wav");
|
||||
precache_sound("vox/code.wav");
|
||||
precache_sound("vox/collider.wav");
|
||||
precache_sound("vox/command.wav");
|
||||
precache_sound("vox/_comma.wav");
|
||||
precache_sound("vox/communication.wav");
|
||||
precache_sound("vox/complex.wav");
|
||||
precache_sound("vox/computer.wav");
|
||||
precache_sound("vox/condition.wav");
|
||||
precache_sound("vox/containment.wav");
|
||||
precache_sound("vox/contamination.wav");
|
||||
precache_sound("vox/control.wav");
|
||||
precache_sound("vox/coolant.wav");
|
||||
precache_sound("vox/coomer.wav");
|
||||
precache_sound("vox/core.wav");
|
||||
precache_sound("vox/correct.wav");
|
||||
precache_sound("vox/corridor.wav");
|
||||
precache_sound("vox/crew.wav");
|
||||
precache_sound("vox/cross.wav");
|
||||
precache_sound("vox/cryogenic.wav");
|
||||
precache_sound("vox/c.wav");
|
||||
precache_sound("vox/dadeda.wav");
|
||||
precache_sound("vox/damaged.wav");
|
||||
precache_sound("vox/damage.wav");
|
||||
precache_sound("vox/danger.wav");
|
||||
precache_sound("vox/day.wav");
|
||||
precache_sound("vox/deactivated.wav");
|
||||
precache_sound("vox/decompression.wav");
|
||||
precache_sound("vox/decontamination.wav");
|
||||
precache_sound("vox/deeoo.wav");
|
||||
precache_sound("vox/defense.wav");
|
||||
precache_sound("vox/degrees.wav");
|
||||
precache_sound("vox/delta.wav");
|
||||
precache_sound("vox/denied.wav");
|
||||
precache_sound("vox/deployed.wav");
|
||||
precache_sound("vox/deploy.wav");
|
||||
precache_sound("vox/destroyed.wav");
|
||||
precache_sound("vox/destroy.wav");
|
||||
precache_sound("vox/detain.wav");
|
||||
precache_sound("vox/detected.wav");
|
||||
precache_sound("vox/detonation.wav");
|
||||
precache_sound("vox/device.wav");
|
||||
precache_sound("vox/did.wav");
|
||||
precache_sound("vox/die.wav");
|
||||
precache_sound("vox/dimensional.wav");
|
||||
precache_sound("vox/dirt.wav");
|
||||
precache_sound("vox/disengaged.wav");
|
||||
precache_sound("vox/dish.wav");
|
||||
precache_sound("vox/disposal.wav");
|
||||
precache_sound("vox/distance.wav");
|
||||
precache_sound("vox/distortion.wav");
|
||||
precache_sound("vox/doctor.wav");
|
||||
precache_sound("vox/doop.wav");
|
||||
precache_sound("vox/door.wav");
|
||||
precache_sound("vox/do.wav");
|
||||
precache_sound("vox/down.wav");
|
||||
precache_sound("vox/dual.wav");
|
||||
precache_sound("vox/duct.wav");
|
||||
precache_sound("vox/d.wav");
|
||||
precache_sound("vox/east.wav");
|
||||
precache_sound("vox/echo.wav");
|
||||
precache_sound("vox/ed.wav");
|
||||
precache_sound("vox/effect.wav");
|
||||
precache_sound("vox/egress.wav");
|
||||
precache_sound("vox/eighteen.wav");
|
||||
precache_sound("vox/eight.wav");
|
||||
precache_sound("vox/eighty.wav");
|
||||
precache_sound("vox/electric.wav");
|
||||
precache_sound("vox/electromagnetic.wav");
|
||||
precache_sound("vox/elevator.wav");
|
||||
precache_sound("vox/eleven.wav");
|
||||
precache_sound("vox/eliminate.wav");
|
||||
precache_sound("vox/emergency.wav");
|
||||
precache_sound("vox/energy.wav");
|
||||
precache_sound("vox/engaged.wav");
|
||||
precache_sound("vox/engage.wav");
|
||||
precache_sound("vox/engine.wav");
|
||||
precache_sound("vox/enter.wav");
|
||||
precache_sound("vox/entry.wav");
|
||||
precache_sound("vox/environment.wav");
|
||||
precache_sound("vox/error.wav");
|
||||
precache_sound("vox/escape.wav");
|
||||
precache_sound("vox/evacuate.wav");
|
||||
precache_sound("vox/e.wav");
|
||||
precache_sound("vox/exchange.wav");
|
||||
precache_sound("vox/exit.wav");
|
||||
precache_sound("vox/expect.wav");
|
||||
precache_sound("vox/experimental.wav");
|
||||
precache_sound("vox/experiment.wav");
|
||||
precache_sound("vox/explode.wav");
|
||||
precache_sound("vox/explosion.wav");
|
||||
precache_sound("vox/exposure.wav");
|
||||
precache_sound("vox/exterminate.wav");
|
||||
precache_sound("vox/extinguisher.wav");
|
||||
precache_sound("vox/extinguish.wav");
|
||||
precache_sound("vox/extreme.wav");
|
||||
precache_sound("vox/facility.wav");
|
||||
precache_sound("vox/fahrenheit.wav");
|
||||
precache_sound("vox/failed.wav");
|
||||
precache_sound("vox/failure.wav");
|
||||
precache_sound("vox/farthest.wav");
|
||||
precache_sound("vox/fast.wav");
|
||||
precache_sound("vox/feet.wav");
|
||||
precache_sound("vox/field.wav");
|
||||
precache_sound("vox/fifteen.wav");
|
||||
precache_sound("vox/fifth.wav");
|
||||
precache_sound("vox/fifty.wav");
|
||||
precache_sound("vox/final.wav");
|
||||
precache_sound("vox/fine.wav");
|
||||
precache_sound("vox/fire.wav");
|
||||
precache_sound("vox/first.wav");
|
||||
precache_sound("vox/five.wav");
|
||||
precache_sound("vox/flooding.wav");
|
||||
precache_sound("vox/floor.wav");
|
||||
precache_sound("vox/fool.wav");
|
||||
precache_sound("vox/forbidden.wav");
|
||||
precache_sound("vox/force.wav");
|
||||
precache_sound("vox/forms.wav");
|
||||
precache_sound("vox/for.wav");
|
||||
precache_sound("vox/found.wav");
|
||||
precache_sound("vox/fourteen.wav");
|
||||
precache_sound("vox/fourth.wav");
|
||||
precache_sound("vox/fourty.wav");
|
||||
precache_sound("vox/four.wav");
|
||||
precache_sound("vox/foxtrot.wav");
|
||||
precache_sound("vox/freeman.wav");
|
||||
precache_sound("vox/freezer.wav");
|
||||
precache_sound("vox/from.wav");
|
||||
precache_sound("vox/front.wav");
|
||||
precache_sound("vox/fuel.wav");
|
||||
precache_sound("vox/f.wav");
|
||||
precache_sound("vox/get.wav");
|
||||
precache_sound("vox/going.wav");
|
||||
precache_sound("vox/goodbye.wav");
|
||||
precache_sound("vox/good.wav");
|
||||
precache_sound("vox/gordon.wav");
|
||||
precache_sound("vox/got.wav");
|
||||
precache_sound("vox/government.wav");
|
||||
precache_sound("vox/go.wav");
|
||||
precache_sound("vox/granted.wav");
|
||||
precache_sound("vox/great.wav");
|
||||
precache_sound("vox/green.wav");
|
||||
precache_sound("vox/grenade.wav");
|
||||
precache_sound("vox/guard.wav");
|
||||
precache_sound("vox/gulf.wav");
|
||||
precache_sound("vox/gun.wav");
|
||||
precache_sound("vox/guthrie.wav");
|
||||
precache_sound("vox/g.wav");
|
||||
precache_sound("vox/handling.wav");
|
||||
precache_sound("vox/hangar.wav");
|
||||
precache_sound("vox/has.wav");
|
||||
precache_sound("vox/have.wav");
|
||||
precache_sound("vox/hazard.wav");
|
||||
precache_sound("vox/head.wav");
|
||||
precache_sound("vox/health.wav");
|
||||
precache_sound("vox/heat.wav");
|
||||
precache_sound("vox/helicopter.wav");
|
||||
precache_sound("vox/helium.wav");
|
||||
precache_sound("vox/hello.wav");
|
||||
precache_sound("vox/help.wav");
|
||||
precache_sound("vox/here.wav");
|
||||
precache_sound("vox/hide.wav");
|
||||
precache_sound("vox/highest.wav");
|
||||
precache_sound("vox/high.wav");
|
||||
precache_sound("vox/hit.wav");
|
||||
precache_sound("vox/hole.wav");
|
||||
precache_sound("vox/hostile.wav");
|
||||
precache_sound("vox/hotel.wav");
|
||||
precache_sound("vox/hot.wav");
|
||||
precache_sound("vox/hours.wav");
|
||||
precache_sound("vox/hour.wav");
|
||||
precache_sound("vox/hundred.wav");
|
||||
precache_sound("vox/hydro.wav");
|
||||
precache_sound("vox/idiot.wav");
|
||||
precache_sound("vox/illegal.wav");
|
||||
precache_sound("vox/immediately.wav");
|
||||
precache_sound("vox/immediate.wav");
|
||||
precache_sound("vox/inches.wav");
|
||||
precache_sound("vox/india.wav");
|
||||
precache_sound("vox/ing.wav");
|
||||
precache_sound("vox/inoperative.wav");
|
||||
precache_sound("vox/inside.wav");
|
||||
precache_sound("vox/inspection.wav");
|
||||
precache_sound("vox/inspector.wav");
|
||||
precache_sound("vox/interchange.wav");
|
||||
precache_sound("vox/intruder.wav");
|
||||
precache_sound("vox/invallid.wav");
|
||||
precache_sound("vox/invasion.wav");
|
||||
precache_sound("vox/in.wav");
|
||||
precache_sound("vox/is.wav");
|
||||
precache_sound("vox/it.wav");
|
||||
precache_sound("vox/i.wav");
|
||||
precache_sound("vox/johnson.wav");
|
||||
precache_sound("vox/juliet.wav");
|
||||
precache_sound("vox/key.wav");
|
||||
precache_sound("vox/kill.wav");
|
||||
precache_sound("vox/kilo.wav");
|
||||
precache_sound("vox/kit.wav");
|
||||
precache_sound("vox/lab.wav");
|
||||
precache_sound("vox/lambda.wav");
|
||||
precache_sound("vox/laser.wav");
|
||||
precache_sound("vox/last.wav");
|
||||
precache_sound("vox/launch.wav");
|
||||
precache_sound("vox/leak.wav");
|
||||
precache_sound("vox/leave.wav");
|
||||
precache_sound("vox/left.wav");
|
||||
precache_sound("vox/legal.wav");
|
||||
precache_sound("vox/level.wav");
|
||||
precache_sound("vox/lever.wav");
|
||||
precache_sound("vox/lieutenant.wav");
|
||||
precache_sound("vox/lie.wav");
|
||||
precache_sound("vox/life.wav");
|
||||
precache_sound("vox/light.wav");
|
||||
precache_sound("vox/lima.wav");
|
||||
precache_sound("vox/liquid.wav");
|
||||
precache_sound("vox/loading.wav");
|
||||
precache_sound("vox/located.wav");
|
||||
precache_sound("vox/locate.wav");
|
||||
precache_sound("vox/location.wav");
|
||||
precache_sound("vox/locked.wav");
|
||||
precache_sound("vox/locker.wav");
|
||||
precache_sound("vox/lockout.wav");
|
||||
precache_sound("vox/lock.wav");
|
||||
precache_sound("vox/lower.wav");
|
||||
precache_sound("vox/lowest.wav");
|
||||
precache_sound("vox/magnetic.wav");
|
||||
precache_sound("vox/maintenance.wav");
|
||||
precache_sound("vox/main.wav");
|
||||
precache_sound("vox/malfunction.wav");
|
||||
precache_sound("vox/man.wav");
|
||||
precache_sound("vox/mass.wav");
|
||||
precache_sound("vox/materials.wav");
|
||||
precache_sound("vox/maximum.wav");
|
||||
precache_sound("vox/may.wav");
|
||||
precache_sound("vox/medical.wav");
|
||||
precache_sound("vox/men.wav");
|
||||
precache_sound("vox/mercy.wav");
|
||||
precache_sound("vox/mesa.wav");
|
||||
precache_sound("vox/message.wav");
|
||||
precache_sound("vox/meter.wav");
|
||||
precache_sound("vox/micro.wav");
|
||||
precache_sound("vox/middle.wav");
|
||||
precache_sound("vox/mike.wav");
|
||||
precache_sound("vox/miles.wav");
|
||||
precache_sound("vox/military.wav");
|
||||
precache_sound("vox/million.wav");
|
||||
precache_sound("vox/milli.wav");
|
||||
precache_sound("vox/minefield.wav");
|
||||
precache_sound("vox/minimum.wav");
|
||||
precache_sound("vox/minutes.wav");
|
||||
precache_sound("vox/mister.wav");
|
||||
precache_sound("vox/mode.wav");
|
||||
precache_sound("vox/motorpool.wav");
|
||||
precache_sound("vox/motor.wav");
|
||||
precache_sound("vox/move.wav");
|
||||
precache_sound("vox/must.wav");
|
||||
precache_sound("vox/nearest.wav");
|
||||
precache_sound("vox/nice.wav");
|
||||
precache_sound("vox/nineteen.wav");
|
||||
precache_sound("vox/ninety.wav");
|
||||
precache_sound("vox/nine.wav");
|
||||
precache_sound("vox/nominal.wav");
|
||||
precache_sound("vox/north.wav");
|
||||
precache_sound("vox/not.wav");
|
||||
precache_sound("vox/november.wav");
|
||||
precache_sound("vox/no.wav");
|
||||
precache_sound("vox/now.wav");
|
||||
precache_sound("vox/number.wav");
|
||||
precache_sound("vox/objective.wav");
|
||||
precache_sound("vox/observation.wav");
|
||||
precache_sound("vox/officer.wav");
|
||||
precache_sound("vox/of.wav");
|
||||
precache_sound("vox/ok.wav");
|
||||
precache_sound("vox/one.wav");
|
||||
precache_sound("vox/on.wav");
|
||||
precache_sound("vox/open.wav");
|
||||
precache_sound("vox/operating.wav");
|
||||
precache_sound("vox/operations.wav");
|
||||
precache_sound("vox/operative.wav");
|
||||
precache_sound("vox/option.wav");
|
||||
precache_sound("vox/order.wav");
|
||||
precache_sound("vox/organic.wav");
|
||||
precache_sound("vox/oscar.wav");
|
||||
precache_sound("vox/outside.wav");
|
||||
precache_sound("vox/out.wav");
|
||||
precache_sound("vox/overload.wav");
|
||||
precache_sound("vox/override.wav");
|
||||
precache_sound("vox/over.wav");
|
||||
precache_sound("vox/pacify.wav");
|
||||
precache_sound("vox/pain.wav");
|
||||
precache_sound("vox/pal.wav");
|
||||
precache_sound("vox/panel.wav");
|
||||
precache_sound("vox/percent.wav");
|
||||
precache_sound("vox/perimeter.wav");
|
||||
precache_sound("vox/_period.wav");
|
||||
precache_sound("vox/permitted.wav");
|
||||
precache_sound("vox/personnel.wav");
|
||||
precache_sound("vox/pipe.wav");
|
||||
precache_sound("vox/plant.wav");
|
||||
precache_sound("vox/platform.wav");
|
||||
precache_sound("vox/please.wav");
|
||||
precache_sound("vox/point.wav");
|
||||
precache_sound("vox/portal.wav");
|
||||
precache_sound("vox/power.wav");
|
||||
precache_sound("vox/presence.wav");
|
||||
precache_sound("vox/press.wav");
|
||||
precache_sound("vox/primary.wav");
|
||||
precache_sound("vox/proceed.wav");
|
||||
precache_sound("vox/processing.wav");
|
||||
precache_sound("vox/progress.wav");
|
||||
precache_sound("vox/proper.wav");
|
||||
precache_sound("vox/propulsion.wav");
|
||||
precache_sound("vox/prosecute.wav");
|
||||
precache_sound("vox/protective.wav");
|
||||
precache_sound("vox/push.wav");
|
||||
precache_sound("vox/quantum.wav");
|
||||
precache_sound("vox/quebec.wav");
|
||||
precache_sound("vox/questioning.wav");
|
||||
precache_sound("vox/question.wav");
|
||||
precache_sound("vox/quick.wav");
|
||||
precache_sound("vox/quit.wav");
|
||||
precache_sound("vox/radiation.wav");
|
||||
precache_sound("vox/radioactive.wav");
|
||||
precache_sound("vox/rads.wav");
|
||||
precache_sound("vox/rapid.wav");
|
||||
precache_sound("vox/reached.wav");
|
||||
precache_sound("vox/reach.wav");
|
||||
precache_sound("vox/reactor.wav");
|
||||
precache_sound("vox/red.wav");
|
||||
precache_sound("vox/relay.wav");
|
||||
precache_sound("vox/released.wav");
|
||||
precache_sound("vox/remaining.wav");
|
||||
precache_sound("vox/renegade.wav");
|
||||
precache_sound("vox/repair.wav");
|
||||
precache_sound("vox/reports.wav");
|
||||
precache_sound("vox/report.wav");
|
||||
precache_sound("vox/required.wav");
|
||||
precache_sound("vox/research.wav");
|
||||
precache_sound("vox/resevoir.wav");
|
||||
precache_sound("vox/resistance.wav");
|
||||
precache_sound("vox/right.wav");
|
||||
precache_sound("vox/rocket.wav");
|
||||
precache_sound("vox/roger.wav");
|
||||
precache_sound("vox/romeo.wav");
|
||||
precache_sound("vox/room.wav");
|
||||
precache_sound("vox/round.wav");
|
||||
precache_sound("vox/run.wav");
|
||||
precache_sound("vox/safety.wav");
|
||||
precache_sound("vox/safe.wav");
|
||||
precache_sound("vox/sargeant.wav");
|
||||
precache_sound("vox/satellite.wav");
|
||||
precache_sound("vox/save.wav");
|
||||
precache_sound("vox/science.wav");
|
||||
precache_sound("vox/scream.wav");
|
||||
precache_sound("vox/screen.wav");
|
||||
precache_sound("vox/search.wav");
|
||||
precache_sound("vox/secondary.wav");
|
||||
precache_sound("vox/seconds.wav");
|
||||
precache_sound("vox/second.wav");
|
||||
precache_sound("vox/sector.wav");
|
||||
precache_sound("vox/secured.wav");
|
||||
precache_sound("vox/secure.wav");
|
||||
precache_sound("vox/security.wav");
|
||||
precache_sound("vox/selected.wav");
|
||||
precache_sound("vox/select.wav");
|
||||
precache_sound("vox/service.wav");
|
||||
precache_sound("vox/seventeen.wav");
|
||||
precache_sound("vox/seventy.wav");
|
||||
precache_sound("vox/seven.wav");
|
||||
precache_sound("vox/severe.wav");
|
||||
precache_sound("vox/sewage.wav");
|
||||
precache_sound("vox/sewer.wav");
|
||||
precache_sound("vox/shield.wav");
|
||||
precache_sound("vox/shipment.wav");
|
||||
precache_sound("vox/shock.wav");
|
||||
precache_sound("vox/shoot.wav");
|
||||
precache_sound("vox/shower.wav");
|
||||
precache_sound("vox/shut.wav");
|
||||
precache_sound("vox/side.wav");
|
||||
precache_sound("vox/sierra.wav");
|
||||
precache_sound("vox/sight.wav");
|
||||
precache_sound("vox/silo.wav");
|
||||
precache_sound("vox/sixteen.wav");
|
||||
precache_sound("vox/sixty.wav");
|
||||
precache_sound("vox/six.wav");
|
||||
precache_sound("vox/slime.wav");
|
||||
precache_sound("vox/slow.wav");
|
||||
precache_sound("vox/soldier.wav");
|
||||
precache_sound("vox/someone.wav");
|
||||
precache_sound("vox/something.wav");
|
||||
precache_sound("vox/some.wav");
|
||||
precache_sound("vox/son.wav");
|
||||
precache_sound("vox/sorry.wav");
|
||||
precache_sound("vox/south.wav");
|
||||
precache_sound("vox/squad.wav");
|
||||
precache_sound("vox/square.wav");
|
||||
precache_sound("vox/stairway.wav");
|
||||
precache_sound("vox/status.wav");
|
||||
precache_sound("vox/sterile.wav");
|
||||
precache_sound("vox/sterilization.wav");
|
||||
precache_sound("vox/storage.wav");
|
||||
precache_sound("vox/subsurface.wav");
|
||||
precache_sound("vox/sub.wav");
|
||||
precache_sound("vox/sudden.wav");
|
||||
precache_sound("vox/suit.wav");
|
||||
precache_sound("vox/superconducting.wav");
|
||||
precache_sound("vox/supercooled.wav");
|
||||
precache_sound("vox/supply.wav");
|
||||
precache_sound("vox/surface.wav");
|
||||
precache_sound("vox/surrender.wav");
|
||||
precache_sound("vox/surrounded.wav");
|
||||
precache_sound("vox/surround.wav");
|
||||
precache_sound("vox/switch.wav");
|
||||
precache_sound("vox/systems.wav");
|
||||
precache_sound("vox/system.wav");
|
||||
precache_sound("vox/tactical.wav");
|
||||
precache_sound("vox/take.wav");
|
||||
precache_sound("vox/talk.wav");
|
||||
precache_sound("vox/tango.wav");
|
||||
precache_sound("vox/tank.wav");
|
||||
precache_sound("vox/target.wav");
|
||||
precache_sound("vox/team.wav");
|
||||
precache_sound("vox/temperature.wav");
|
||||
precache_sound("vox/temporal.wav");
|
||||
precache_sound("vox/ten.wav");
|
||||
precache_sound("vox/terminal.wav");
|
||||
precache_sound("vox/terminated.wav");
|
||||
precache_sound("vox/termination.wav");
|
||||
precache_sound("vox/test.wav");
|
||||
precache_sound("vox/that.wav");
|
||||
precache_sound("vox/then.wav");
|
||||
precache_sound("vox/there.wav");
|
||||
precache_sound("vox/the.wav");
|
||||
precache_sound("vox/third.wav");
|
||||
precache_sound("vox/thirteen.wav");
|
||||
precache_sound("vox/thirty.wav");
|
||||
precache_sound("vox/this.wav");
|
||||
precache_sound("vox/those.wav");
|
||||
precache_sound("vox/thousand.wav");
|
||||
precache_sound("vox/threat.wav");
|
||||
precache_sound("vox/three.wav");
|
||||
precache_sound("vox/through.wav");
|
||||
precache_sound("vox/time.wav");
|
||||
precache_sound("vox/topside.wav");
|
||||
precache_sound("vox/top.wav");
|
||||
precache_sound("vox/touch.wav");
|
||||
precache_sound("vox/towards.wav");
|
||||
precache_sound("vox/to.wav");
|
||||
precache_sound("vox/track.wav");
|
||||
precache_sound("vox/train.wav");
|
||||
precache_sound("vox/transportation.wav");
|
||||
precache_sound("vox/truck.wav");
|
||||
precache_sound("vox/tunnel.wav");
|
||||
precache_sound("vox/turn.wav");
|
||||
precache_sound("vox/turret.wav");
|
||||
precache_sound("vox/twelve.wav");
|
||||
precache_sound("vox/twenty.wav");
|
||||
precache_sound("vox/two.wav");
|
||||
precache_sound("vox/unauthorized.wav");
|
||||
precache_sound("vox/under.wav");
|
||||
precache_sound("vox/uniform.wav");
|
||||
precache_sound("vox/unlocked.wav");
|
||||
precache_sound("vox/until.wav");
|
||||
precache_sound("vox/upper.wav");
|
||||
precache_sound("vox/up.wav");
|
||||
precache_sound("vox/uranium.wav");
|
||||
precache_sound("vox/usa.wav");
|
||||
precache_sound("vox/used.wav");
|
||||
precache_sound("vox/user.wav");
|
||||
precache_sound("vox/use.wav");
|
||||
precache_sound("vox/us.wav");
|
||||
precache_sound("vox/vacate.wav");
|
||||
precache_sound("vox/valid.wav");
|
||||
precache_sound("vox/vapor.wav");
|
||||
precache_sound("vox/ventillation.wav");
|
||||
precache_sound("vox/vent.wav");
|
||||
precache_sound("vox/victor.wav");
|
||||
precache_sound("vox/violated.wav");
|
||||
precache_sound("vox/violation.wav");
|
||||
precache_sound("vox/voltage.wav");
|
||||
precache_sound("vox/vox_login.wav");
|
||||
precache_sound("vox/walk.wav");
|
||||
precache_sound("vox/wall.wav");
|
||||
precache_sound("vox/wanted.wav");
|
||||
precache_sound("vox/want.wav");
|
||||
precache_sound("vox/warm.wav");
|
||||
precache_sound("vox/warning.wav");
|
||||
precache_sound("vox/warn.wav");
|
||||
precache_sound("vox/waste.wav");
|
||||
precache_sound("vox/water.wav");
|
||||
precache_sound("vox/weapon.wav");
|
||||
precache_sound("vox/west.wav");
|
||||
precache_sound("vox/we.wav");
|
||||
precache_sound("vox/whiskey.wav");
|
||||
precache_sound("vox/white.wav");
|
||||
precache_sound("vox/wilco.wav");
|
||||
precache_sound("vox/will.wav");
|
||||
precache_sound("vox/without.wav");
|
||||
precache_sound("vox/with.wav");
|
||||
precache_sound("vox/woop.wav");
|
||||
precache_sound("vox/xeno.wav");
|
||||
precache_sound("vox/yankee.wav");
|
||||
precache_sound("vox/yards.wav");
|
||||
precache_sound("vox/year.wav");
|
||||
precache_sound("vox/yellow.wav");
|
||||
precache_sound("vox/yes.wav");
|
||||
precache_sound("vox/yourself.wav");
|
||||
precache_sound("vox/your.wav");
|
||||
precache_sound("vox/you.wav");
|
||||
precache_sound("vox/zero.wav");
|
||||
precache_sound("vox/zone.wav");
|
||||
precache_sound("vox/zulu.wav");
|
||||
}
|
||||
|
||||
class CVoxSpeaker:CBaseEntity
|
||||
{
|
||||
void CVoxSpeaker;
|
||||
virtual void(string) SentenceSample;
|
||||
virtual float(void) predraw;
|
||||
};
|
||||
|
||||
void
|
||||
CVoxSpeaker::SentenceSample(string sample)
|
||||
{
|
||||
sound(this, CHAN_VOICE, sample, 1.0, ATTN_NONE);
|
||||
}
|
||||
|
||||
float
|
||||
CVoxSpeaker::predraw(void)
|
||||
{
|
||||
ProcessWordQue();
|
||||
return (PREDRAW_NEXT);
|
||||
}
|
||||
|
||||
void
|
||||
CVoxSpeaker::CVoxSpeaker(void)
|
||||
{
|
||||
// blaaa
|
||||
drawmask = MASK_ENGINE;
|
||||
}
|
||||
|
||||
CVoxSpeaker g_voxSpeaker;
|
||||
|
||||
void
|
||||
Vox_PlaySentence(string sentence)
|
||||
{
|
||||
if (!g_voxSpeaker) {
|
||||
g_voxSpeaker = spawn(CVoxSpeaker);
|
||||
}
|
||||
|
||||
g_voxSpeaker.Sentence(sentence);
|
||||
}
|
|
@ -6,10 +6,7 @@
|
|||
baseentity.h
|
||||
decals.h
|
||||
client/defs.h
|
||||
client/basefx.qc
|
||||
shared/baseentity.qc
|
||||
client/basemonster.qc
|
||||
shared/basevehicle.qc
|
||||
shared/NSVehicle.h
|
||||
client/env_cubemap.qc
|
||||
client/env_glow.qc
|
||||
client/env_sun.qc
|
||||
|
|
|
@ -1,144 +0,0 @@
|
|||
class
|
||||
CBaseMonster:CBaseEntity
|
||||
{
|
||||
|
||||
void(void) CBaseMonster;
|
||||
|
||||
virtual void(void) customphysics;
|
||||
virtual float(void) predraw;
|
||||
};
|
||||
|
||||
void
|
||||
CBaseMonster::customphysics(void)
|
||||
{
|
||||
/* Page intentionally left blank */
|
||||
}
|
||||
|
||||
float
|
||||
CBaseMonster::predraw(void)
|
||||
{
|
||||
float render;
|
||||
|
||||
render = CBaseEntity::predraw();
|
||||
|
||||
/* mouth flapping action */
|
||||
bonecontrol5 = getchannellevel(this, CHAN_VOICE) * 20;
|
||||
m_flBaseTime = frame1time;
|
||||
|
||||
ProcessWordQue();
|
||||
|
||||
return render;
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
CBaseMonster::ReceiveEntity
|
||||
============
|
||||
*/
|
||||
void
|
||||
CBaseMonster::ReceiveEntity(float flChanged)
|
||||
{
|
||||
if (flChanged & BASEFL_CHANGED_ORIGIN) {
|
||||
origin[0] = readcoord();
|
||||
origin[1] = readcoord();
|
||||
origin[2] = readcoord();
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_ANGLES) {
|
||||
angles[0] = readshort() / (32767 / 360);
|
||||
angles[1] = readshort() / (32767 / 360);
|
||||
angles[2] = readshort() / (32767 / 360);
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_MODELINDEX) {
|
||||
setmodelindex(this, readshort());
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_SOLID) {
|
||||
solid = readbyte();
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_MOVETYPE) {
|
||||
movetype = readbyte();
|
||||
|
||||
if (movetype == MOVETYPE_PHYSICS) {
|
||||
movetype = MOVETYPE_NONE;
|
||||
}
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_SIZE) {
|
||||
mins[0] = readcoord();
|
||||
mins[1] = readcoord();
|
||||
mins[2] = readcoord();
|
||||
maxs[0] = readcoord();
|
||||
maxs[1] = readcoord();
|
||||
maxs[2] = readcoord();
|
||||
setsize(this, mins, maxs);
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_FRAME) {
|
||||
frame1time = 0.0;
|
||||
frame2time = 0.0f;
|
||||
frame = readbyte();
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_SKIN) {
|
||||
skin = readbyte() - 128;
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_EFFECTS) {
|
||||
effects = readfloat();
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_BODY) {
|
||||
m_iBody = readbyte();
|
||||
setcustomskin(this, "", sprintf("geomset 1 %i\n", m_iBody));
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_SCALE) {
|
||||
scale = readfloat();
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_VELOCITY) {
|
||||
velocity[0] = readfloat();
|
||||
velocity[1] = readfloat();
|
||||
velocity[2] = readfloat();
|
||||
}
|
||||
|
||||
#ifdef GS_RENDERFX
|
||||
if (flChanged & BASEFL_CHANGED_RENDERFX) {
|
||||
m_iRenderFX = readbyte();
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_RENDERMODE) {
|
||||
m_iRenderMode = readbyte();
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_RENDERCOLOR) {
|
||||
m_vecRenderColor[0] = readfloat();
|
||||
m_vecRenderColor[1] = readfloat();
|
||||
m_vecRenderColor[2] = readfloat();
|
||||
}
|
||||
if (flChanged & BASEFL_CHANGED_RENDERAMT) {
|
||||
m_flRenderAmt = readfloat();
|
||||
}
|
||||
#else
|
||||
if (flChanged & BASEFL_CHANGED_ALPHA) {
|
||||
alpha = readfloat();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (modelindex) {
|
||||
drawmask = MASK_ENGINE;
|
||||
} else {
|
||||
drawmask = 0;
|
||||
}
|
||||
|
||||
if (scale == 0.0)
|
||||
scale = 1.0f;
|
||||
|
||||
setorigin(this, origin);
|
||||
}
|
||||
|
||||
void
|
||||
CBaseMonster::CBaseMonster(void)
|
||||
{
|
||||
CBaseEntity::CBaseEntity();
|
||||
};
|
||||
|
||||
void
|
||||
basemonster_readentity(float new)
|
||||
{
|
||||
CBaseMonster me = (CBaseMonster)self;
|
||||
if (new) {
|
||||
spawnfunc_CBaseMonster();
|
||||
}
|
||||
me.ReceiveEntity(readfloat());
|
||||
}
|
|
@ -15,11 +15,10 @@
|
|||
*/
|
||||
|
||||
#include "../shared/baseentity.h"
|
||||
#include "../shared/basevehicle.h"
|
||||
|
||||
vector g_vecSunDir;
|
||||
|
||||
/* TODO: Find a better way to figure out what's a CBaseEntity at heart */
|
||||
/* TODO: Find a better way to figure out what's a NSEntity at heart */
|
||||
.float isCSQC;
|
||||
|
||||
/* things we don't have in CSQC normally and oughta be global */
|
||||
|
|
|
@ -33,7 +33,7 @@ void CMap_Check(void);
|
|||
void CMap_Shoot(void);
|
||||
|
||||
class
|
||||
env_cubemap:CBaseEntity
|
||||
env_cubemap:NSEntity
|
||||
{
|
||||
int m_iSize;
|
||||
|
||||
|
@ -60,7 +60,7 @@ env_cubemap::SpawnKey(string strField, string strKey)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ Client-side glare/glow orb effect like the flares in 1997's Unreal.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class env_glow:CBaseEntity
|
||||
class env_glow:NSEntity /* change to renderablentity? */
|
||||
{
|
||||
vector m_vecColor;
|
||||
float m_flAlpha;
|
||||
|
@ -156,7 +156,7 @@ env_glow::SpawnKey(string strField, string strKey)
|
|||
m_flMaxAlpha = stof(strKey) / 255;
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ Cannot be triggered. Repeats automatically.
|
|||
This entity was introduced in The Wastes (2018).
|
||||
*/
|
||||
|
||||
class env_particle:CBaseEntity
|
||||
class env_particle:NSEntity
|
||||
{
|
||||
entity m_eTarget;
|
||||
float m_flNextTime;
|
||||
|
@ -92,7 +92,7 @@ void env_particle::SpawnKey(string strField, string strKey)
|
|||
m_iCount = stoi(strKey);
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,25 +64,16 @@ string g_hlefx[] = {
|
|||
"gs_weirdo3"
|
||||
};
|
||||
|
||||
class env_sound:CBaseEntity
|
||||
class env_sound:NSEntity
|
||||
{
|
||||
int m_iRoomType;
|
||||
int m_iRadius;
|
||||
|
||||
void(void) env_sound;
|
||||
|
||||
virtual void(string, string) SpawnKey;
|
||||
};
|
||||
|
||||
void
|
||||
env_sound::env_sound(void)
|
||||
{
|
||||
m_iRadius = 256;
|
||||
Init();
|
||||
|
||||
setsize(this, [0,0,0], [0,0,0]);
|
||||
setorigin(this, origin);
|
||||
}
|
||||
|
||||
void
|
||||
env_sound::SpawnKey(string strField, string strKey)
|
||||
{
|
||||
|
@ -104,6 +95,16 @@ env_sound::SpawnKey(string strField, string strKey)
|
|||
m_iRoomType = EFX_Load(g_hlefx[efx_alias]);
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
env_sound::env_sound(void)
|
||||
{
|
||||
m_iRadius = 256;
|
||||
Init();
|
||||
|
||||
setsize(this, [0,0,0], [0,0,0]);
|
||||
setorigin(this, origin);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ var int autocvar_dsp_soundscapes = TRUE;
|
|||
|
||||
int g_scapes;
|
||||
|
||||
class env_soundscape:CBaseEntity
|
||||
class env_soundscape:NSEntity
|
||||
{
|
||||
int m_iID;
|
||||
int m_iShader;
|
||||
|
@ -37,6 +37,7 @@ class env_soundscape:CBaseEntity
|
|||
float m_flVolume;
|
||||
|
||||
void(void) env_soundscape;
|
||||
|
||||
virtual void(string, string) SpawnKey;
|
||||
};
|
||||
|
||||
|
@ -61,7 +62,7 @@ env_soundscape::SpawnKey(string strField, string strKey)
|
|||
m_iRadius = stoi(strKey);
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
class env_sprite:CBaseEntity
|
||||
class env_sprite:NSRenderableEntity
|
||||
{
|
||||
float framerate;
|
||||
int loops;
|
||||
|
|
|
@ -44,7 +44,7 @@ Util_IsSky(vector pos)
|
|||
return (0);
|
||||
}
|
||||
|
||||
class env_sun:CBaseEntity
|
||||
class env_sun:NSEntity
|
||||
{
|
||||
vector m_vecLensPos;
|
||||
float m_flLensAlpha;
|
||||
|
@ -56,8 +56,18 @@ class env_sun:CBaseEntity
|
|||
virtual void(void) postdraw;
|
||||
virtual float(void) predraw;
|
||||
virtual void(string, string) SpawnKey;
|
||||
virtual void(void) RendererRestarted;
|
||||
};
|
||||
|
||||
void
|
||||
env_sun::RendererRestarted(void)
|
||||
{
|
||||
precache_pic("textures/sfx/flare1");
|
||||
precache_pic("textures/sfx/flare2");
|
||||
precache_pic("textures/sfx/flare3");
|
||||
precache_pic("textures/sfx/flare4");
|
||||
}
|
||||
|
||||
float
|
||||
env_sun::predraw(void)
|
||||
{
|
||||
|
@ -116,7 +126,7 @@ env_sun::postdraw(void)
|
|||
void
|
||||
env_sun::Init(void)
|
||||
{
|
||||
CBaseEntity::Init();
|
||||
super::Init();
|
||||
setorigin(this, origin);
|
||||
drawmask = MASK_ENGINE;
|
||||
}
|
||||
|
@ -129,19 +139,6 @@ env_sun::Initialized(void)
|
|||
localcmd(sprintf("r_shadows_throwdirection %v\n", v_forward));
|
||||
}
|
||||
|
||||
void
|
||||
env_sun::env_sun(void)
|
||||
{
|
||||
precache_pic("textures/sfx/flare1");
|
||||
precache_pic("textures/sfx/flare2");
|
||||
precache_pic("textures/sfx/flare3");
|
||||
precache_pic("textures/sfx/flare4");
|
||||
drawmask = MASK_ENGINE;
|
||||
setsize(this, [0,0,0], [0,0,0]);
|
||||
setorigin(this, origin);
|
||||
Init();
|
||||
}
|
||||
|
||||
void
|
||||
env_sun::SpawnKey(string strField, string strKey)
|
||||
{
|
||||
|
@ -156,6 +153,15 @@ env_sun::SpawnKey(string strField, string strKey)
|
|||
m_iUseAngles = stoi(strKey);
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
env_sun::env_sun(void)
|
||||
{
|
||||
drawmask = MASK_ENGINE;
|
||||
setsize(this, [0,0,0], [0,0,0]);
|
||||
setorigin(this, origin);
|
||||
Init();
|
||||
}
|
|
@ -24,7 +24,7 @@ Dustmote emitting brush volume.
|
|||
This entity was introduced in Half-Life 2 (2004).
|
||||
*/
|
||||
|
||||
class func_dustmotes:CBaseEntity
|
||||
class func_dustmotes:NSEntity
|
||||
{
|
||||
int m_iCount;
|
||||
int m_iPart;
|
||||
|
@ -68,7 +68,7 @@ func_dustmotes::predraw(void)
|
|||
void
|
||||
func_dustmotes::Init(void)
|
||||
{
|
||||
CBaseEntity::Init();
|
||||
super::Init();
|
||||
|
||||
precache_model(model);
|
||||
setmodel(this, model);
|
||||
|
@ -86,7 +86,7 @@ func_dustmotes::SpawnKey(string strField, string strKey)
|
|||
m_iCount = stoi(strKey);
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ This entity was introduced in Half-Life 2 (2004).
|
|||
var int autocvar_dev_loddistance = 0;
|
||||
#endif
|
||||
|
||||
class func_lod:CBaseEntity
|
||||
class func_lod:NSRenderableEntity
|
||||
{
|
||||
int m_iDisappearDist;
|
||||
vector m_vecTestPos;
|
||||
|
@ -87,14 +87,14 @@ func_lod::SpawnKey(string strField, string strKey)
|
|||
solid = stoi(strKey) == 1 ? SOLID_NOT : SOLID_BSP;
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
func_lod::Init(void)
|
||||
{
|
||||
CBaseEntity::Init();
|
||||
super::Init();
|
||||
|
||||
precache_model(model);
|
||||
setmodel(this, model);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
class info_notnull:CBaseEntity
|
||||
class info_notnull:NSEntity
|
||||
{
|
||||
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
class
|
||||
infodecal:CBaseEntity
|
||||
infodecal:NSEntity
|
||||
{
|
||||
decal m_decChild;
|
||||
string m_strTexture;
|
||||
|
@ -48,7 +48,7 @@ infodecal::SpawnKey(string strField, string strKey)
|
|||
targetname = strKey;
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,9 +49,10 @@ from 4 positions across the entire horizon - thus eliminating any harsh shadows.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class light_environment:CBaseEntity
|
||||
class light_environment:NSEntity
|
||||
{
|
||||
void(void) light_environment;
|
||||
|
||||
virtual void(void) Init;
|
||||
virtual void(void) Initialized;
|
||||
virtual void(string, string) SpawnKey;
|
||||
|
@ -60,7 +61,7 @@ class light_environment:CBaseEntity
|
|||
void
|
||||
light_environment::Init(void)
|
||||
{
|
||||
CBaseEntity::Init();
|
||||
super::Init();
|
||||
setorigin(this, origin);
|
||||
drawmask = MASK_ENGINE;
|
||||
}
|
||||
|
@ -83,7 +84,7 @@ light_environment::SpawnKey(string strField, string strKey)
|
|||
g_vecSunDir[1] = stof(strKey);
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,12 +29,13 @@ Used for zoo and test maps in which less interactive overlays are desired.
|
|||
This entity was introduced in Half-Life 2 (2004).
|
||||
*/
|
||||
|
||||
class point_message:CBaseEntity
|
||||
class point_message:NSEntity
|
||||
{
|
||||
float m_flRadius;
|
||||
string m_strMessage;
|
||||
|
||||
void(void) point_message;
|
||||
|
||||
virtual void(string, string) SpawnKey;
|
||||
};
|
||||
|
||||
|
@ -53,7 +54,7 @@ point_message::SpawnKey(string strField, string strKey)
|
|||
setorigin(this, origin);
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ waste disk space and memory. Use wisely.
|
|||
This entity was introduced in Half-Life 2 (2004).
|
||||
*/
|
||||
|
||||
class prop_dynamic:CBaseEntity
|
||||
class prop_dynamic:NSRenderableEntity
|
||||
{
|
||||
void(void) prop_dynamic;
|
||||
|
||||
|
@ -74,20 +74,20 @@ prop_dynamic::SpawnKey(string strField, string strKey)
|
|||
avelocity = stov(strKey);
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
float
|
||||
prop_dynamic::predraw(void)
|
||||
{
|
||||
angles += avelocity * frametime;
|
||||
return CBaseEntity::predraw();
|
||||
return super::predraw();
|
||||
}
|
||||
|
||||
void
|
||||
prop_dynamic::Init(void)
|
||||
{
|
||||
CBaseEntity::Init();
|
||||
super::Init();
|
||||
|
||||
precache_model(model);
|
||||
setmodel(this, model);
|
||||
|
|
|
@ -38,7 +38,7 @@ void(float radius, vector texcoordbias) R_EndPolygonRibbon = #0;
|
|||
|
||||
var int autocvar_rope_debug = FALSE;
|
||||
|
||||
class prop_rope:CBaseEntity
|
||||
class prop_rope:NSEntity
|
||||
{
|
||||
string m_strShader;
|
||||
float m_flSag;
|
||||
|
@ -229,7 +229,7 @@ prop_rope::SpawnKey(string strField, string strKey)
|
|||
m_flSwingFactor = stof(strKey);
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,9 +34,10 @@ var vector g_skypos;
|
|||
var int g_skyscale;
|
||||
|
||||
class
|
||||
sky_camera:CBaseEntity
|
||||
sky_camera:NSEntity
|
||||
{
|
||||
void(void) sky_camera;
|
||||
|
||||
virtual void(string, string) SpawnKey;
|
||||
};
|
||||
|
||||
|
@ -44,16 +45,16 @@ void
|
|||
sky_camera::SpawnKey(string strField, string strKey)
|
||||
{
|
||||
switch (strField) {
|
||||
case "scale":
|
||||
g_skyscale = stoi(strKey);
|
||||
break;
|
||||
case "origin":
|
||||
origin = stov(strKey);
|
||||
setorigin(this, origin);
|
||||
g_skypos = origin;
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strField, strKey);
|
||||
case "scale":
|
||||
g_skyscale = stoi(strKey);
|
||||
break;
|
||||
case "origin":
|
||||
origin = stov(strKey);
|
||||
setorigin(this, origin);
|
||||
g_skypos = origin;
|
||||
break;
|
||||
default:
|
||||
super::SpawnKey(strField, strKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,14 +5,9 @@
|
|||
#includelist
|
||||
baseentity.h
|
||||
decals.h
|
||||
shared/baseentity.qc
|
||||
server/baseoutput.qc
|
||||
server/basetrigger.qc
|
||||
server/basemonster.qc
|
||||
server/basenpc.qc
|
||||
server/basephysics.qc
|
||||
shared/basevehicle.h
|
||||
shared/basevehicle.qc
|
||||
server/NSOutput.qc
|
||||
server/NSPhysicsEntity.qc
|
||||
shared/NSVehicle.h
|
||||
server/info_null.qc
|
||||
server/info_notnull.qc
|
||||
server/info_intermission.qc
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
*/
|
||||
|
||||
/* inspired by https://developer.valvesoftware.com/wiki/Inputs_and_Outputs
|
||||
a lot of the action also happens in CBaseTrigger.
|
||||
a lot of the action happens in NSIO.
|
||||
*/
|
||||
|
||||
/* modern trigger architecture */
|
||||
class CBaseOutput:CBaseEntity
|
||||
class NSOutput:NSEntity
|
||||
{
|
||||
entity m_eActivator;
|
||||
string m_strTarget;
|
||||
|
@ -29,8 +29,8 @@ class CBaseOutput:CBaseEntity
|
|||
int m_iCount;
|
||||
int m_iOldCount;
|
||||
|
||||
void(void) CBaseOutput;
|
||||
void(void) NSOutput;
|
||||
virtual void(void) TriggerOutput;
|
||||
virtual void(void) SpawnInit;
|
||||
virtual void(void) Init;
|
||||
virtual void(void) Respawn;
|
||||
};
|
|
@ -15,11 +15,11 @@
|
|||
*/
|
||||
|
||||
void
|
||||
CBaseOutput::TriggerOutput(void)
|
||||
NSOutput::TriggerOutput(void)
|
||||
{
|
||||
/* plug into all the inputs. */
|
||||
for (entity f = world; (f = find(f, ::targetname, m_strTarget));) {
|
||||
CBaseTrigger trigger = (CBaseTrigger)f;
|
||||
NSEntity trigger = (NSEntity)f;
|
||||
|
||||
if (trigger.Input != __NULL__) {
|
||||
trigger.Input(m_eActivator, m_strInput, m_strData);
|
||||
|
@ -32,22 +32,22 @@ CBaseOutput::TriggerOutput(void)
|
|||
}
|
||||
|
||||
void
|
||||
CBaseOutput::SpawnInit(void)
|
||||
NSOutput::Init(void)
|
||||
{
|
||||
/* SpawnInit of CBaseEntity will tokenize __fullspawndata which
|
||||
in turn will break CBaseTrigger::CreateOutput's tokenize loop,
|
||||
as we'll be creating a bunch of CBaseOutput's in there */
|
||||
/* Init of NSIO will tokenize __fullspawndata which
|
||||
in turn will break NSIO::CreateOutput's tokenize loop,
|
||||
as we'll be creating a bunch of NSOutputs in there */
|
||||
}
|
||||
|
||||
void
|
||||
CBaseOutput::Respawn(void)
|
||||
NSOutput::Respawn(void)
|
||||
{
|
||||
/* gotta reset our counter */
|
||||
m_iCount = m_iOldCount;
|
||||
}
|
||||
|
||||
void
|
||||
CBaseOutput::CBaseOutput(void)
|
||||
NSOutput::NSOutput(void)
|
||||
{
|
||||
/* Make sure Respawn() will be called between rounds */
|
||||
identity = 1;
|
|
@ -29,7 +29,7 @@ enumflags
|
|||
BPHY_SHARP
|
||||
};
|
||||
|
||||
class CBasePhysics:CBaseEntity
|
||||
class NSPhysicsEntity:NSSurfacePropEntity
|
||||
{
|
||||
int m_iEnabled;
|
||||
int m_iShape;
|
||||
|
@ -37,7 +37,7 @@ class CBasePhysics:CBaseEntity
|
|||
int m_iFlags;
|
||||
float m_flInertiaScale;
|
||||
|
||||
void(void) CBasePhysics;
|
||||
void(void) NSPhysicsEntity;
|
||||
virtual void(void) Respawn;
|
||||
virtual void(void) touch;
|
||||
virtual void(void) TouchThink;
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
void
|
||||
CBasePhysics::PhysicsEnable(void)
|
||||
NSPhysicsEntity::PhysicsEnable(void)
|
||||
{
|
||||
if (physics_supported() == TRUE)
|
||||
physics_enable(this, TRUE);
|
||||
|
@ -27,7 +27,7 @@ CBasePhysics::PhysicsEnable(void)
|
|||
}
|
||||
|
||||
void
|
||||
CBasePhysics::PhysicsDisable(void)
|
||||
NSPhysicsEntity::PhysicsDisable(void)
|
||||
{
|
||||
if (physics_supported() == TRUE) {
|
||||
physics_enable(this, FALSE);
|
||||
|
@ -39,51 +39,51 @@ CBasePhysics::PhysicsDisable(void)
|
|||
}
|
||||
|
||||
void
|
||||
CBasePhysics::SetMass(float val)
|
||||
NSPhysicsEntity::SetMass(float val)
|
||||
{
|
||||
mass = val;
|
||||
}
|
||||
float
|
||||
CBasePhysics::GetMass(void)
|
||||
NSPhysicsEntity::GetMass(void)
|
||||
{
|
||||
return mass;
|
||||
}
|
||||
|
||||
void
|
||||
CBasePhysics::SetFriction(float val)
|
||||
NSPhysicsEntity::SetFriction(float val)
|
||||
{
|
||||
friction = val;
|
||||
}
|
||||
float
|
||||
CBasePhysics::GetFriction(void)
|
||||
NSPhysicsEntity::GetFriction(void)
|
||||
{
|
||||
return friction;
|
||||
}
|
||||
|
||||
void
|
||||
CBasePhysics::SetBounceFactor(float val)
|
||||
NSPhysicsEntity::SetBounceFactor(float val)
|
||||
{
|
||||
bouncefactor = val;
|
||||
}
|
||||
float
|
||||
CBasePhysics::GetBounceFactor(void)
|
||||
NSPhysicsEntity::GetBounceFactor(void)
|
||||
{
|
||||
return bouncefactor;
|
||||
}
|
||||
|
||||
void
|
||||
CBasePhysics::SetInertia(float val)
|
||||
NSPhysicsEntity::SetInertia(float val)
|
||||
{
|
||||
m_flInertiaScale = val;
|
||||
}
|
||||
float
|
||||
CBasePhysics::GetInertia(void)
|
||||
NSPhysicsEntity::GetInertia(void)
|
||||
{
|
||||
return m_flInertiaScale;
|
||||
}
|
||||
|
||||
void
|
||||
CBasePhysics::ApplyForceCenter(vector vecForce)
|
||||
NSPhysicsEntity::ApplyForceCenter(vector vecForce)
|
||||
{
|
||||
if (physics_supported() == TRUE) {
|
||||
physics_addforce(this, vecForce, [0,0,0]);
|
||||
|
@ -93,7 +93,7 @@ CBasePhysics::ApplyForceCenter(vector vecForce)
|
|||
}
|
||||
|
||||
void
|
||||
CBasePhysics::ApplyForceOffset(vector vecForce, vector vecOffset)
|
||||
NSPhysicsEntity::ApplyForceOffset(vector vecForce, vector vecOffset)
|
||||
{
|
||||
if (physics_supported() == TRUE) {
|
||||
physics_addforce(this, vecForce, vecOffset);
|
||||
|
@ -103,7 +103,7 @@ CBasePhysics::ApplyForceOffset(vector vecForce, vector vecOffset)
|
|||
}
|
||||
|
||||
void
|
||||
CBasePhysics::ApplyTorqueCenter(vector vecTorque)
|
||||
NSPhysicsEntity::ApplyTorqueCenter(vector vecTorque)
|
||||
{
|
||||
if (physics_supported() == TRUE)
|
||||
physics_addtorque(this, vecTorque * m_flInertiaScale);
|
||||
|
@ -115,7 +115,7 @@ CBasePhysics::ApplyTorqueCenter(vector vecTorque)
|
|||
}
|
||||
|
||||
void
|
||||
CBasePhysics::TouchThink(void)
|
||||
NSPhysicsEntity::TouchThink(void)
|
||||
{
|
||||
/* let players collide */
|
||||
dimension_solid = 255;
|
||||
|
@ -167,7 +167,7 @@ CBasePhysics::TouchThink(void)
|
|||
}
|
||||
|
||||
void
|
||||
CBasePhysics::touch(void)
|
||||
NSPhysicsEntity::touch(void)
|
||||
{
|
||||
PhysicsEnable();
|
||||
makevectors(vectoangles(origin - other.origin));
|
||||
|
@ -175,7 +175,7 @@ CBasePhysics::touch(void)
|
|||
}
|
||||
|
||||
void
|
||||
CBasePhysics::Pain(void)
|
||||
NSPhysicsEntity::Pain(void)
|
||||
{
|
||||
if (m_iFlags & BPHY_NODMGPUSH)
|
||||
return;
|
||||
|
@ -190,7 +190,7 @@ CBasePhysics::Pain(void)
|
|||
}
|
||||
|
||||
void
|
||||
CBasePhysics::Death(void)
|
||||
NSPhysicsEntity::Death(void)
|
||||
{
|
||||
Hide();
|
||||
|
||||
|
@ -213,7 +213,7 @@ CBasePhysics::Death(void)
|
|||
}
|
||||
|
||||
void
|
||||
CBasePhysics::Respawn(void)
|
||||
NSPhysicsEntity::Respawn(void)
|
||||
{
|
||||
SetMovetype(MOVETYPE_PHYSICS);
|
||||
SetSolid(SOLID_PHYSICS_BOX + m_iShape);
|
||||
|
@ -241,7 +241,7 @@ CBasePhysics::Respawn(void)
|
|||
}
|
||||
|
||||
void
|
||||
CBasePhysics::SpawnKey(string strKey, string strValue)
|
||||
NSPhysicsEntity::SpawnKey(string strKey, string strValue)
|
||||
{
|
||||
switch (strKey) {
|
||||
case "physmodel":
|
||||
|
@ -269,15 +269,15 @@ CBasePhysics::SpawnKey(string strKey, string strValue)
|
|||
m_iFlags |= BPHY_SHARP;
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CBasePhysics::CBasePhysics(void)
|
||||
NSPhysicsEntity::NSPhysicsEntity(void)
|
||||
{
|
||||
mass = 1.0f;
|
||||
m_flInertiaScale = 1.0f;
|
||||
CBaseEntity::CBaseEntity();
|
||||
super::NSSurfacePropEntity();
|
||||
}
|
|
@ -56,7 +56,7 @@ enumflags
|
|||
AG_SAMPLE
|
||||
};
|
||||
|
||||
class ambient_generic:CBaseTrigger
|
||||
class ambient_generic:NSPointTrigger
|
||||
{
|
||||
string m_strActivePath;
|
||||
string m_strSoundPath;
|
||||
|
@ -192,7 +192,7 @@ ambient_generic::SpawnKey(string strKey, string strValue)
|
|||
case "cspinup":
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ ambient_generic::SpawnKey(string strKey, string strValue)
|
|||
void
|
||||
ambient_generic::ambient_generic(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
|
||||
if (!m_strSoundPath) {
|
||||
objerror("ambient_generic: No sound file specified!");
|
||||
|
|
|
@ -36,7 +36,7 @@ enumflags
|
|||
BUTTA_TEXON
|
||||
};
|
||||
|
||||
class button_target:CBaseTrigger
|
||||
class button_target:NSSurfacePropEntity
|
||||
{
|
||||
void(void) button_target;
|
||||
|
||||
|
@ -91,5 +91,5 @@ button_target::Damage(void)
|
|||
void
|
||||
button_target::button_target(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSSurfacePropEntity();
|
||||
}
|
||||
|
|
|
@ -33,9 +33,10 @@ sequences. This is really for test-maps and showroom entities.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class cycler:CBaseTrigger
|
||||
class cycler:NSSurfacePropEntity
|
||||
{
|
||||
void(void) cycler;
|
||||
|
||||
virtual void(void) Respawn;
|
||||
virtual void(void) Pain;
|
||||
};
|
||||
|
@ -54,7 +55,8 @@ cycler::Pain(void)
|
|||
void
|
||||
cycler::Respawn(void)
|
||||
{
|
||||
CBaseEntity::Respawn();
|
||||
super::Respawn();
|
||||
|
||||
SetSolid(SOLID_BBOX);
|
||||
takedamage = DAMAGE_YES;
|
||||
health = 9999;
|
||||
|
@ -63,5 +65,5 @@ cycler::Respawn(void)
|
|||
void
|
||||
cycler::cycler(void)
|
||||
{
|
||||
CBaseEntity::CBaseEntity();
|
||||
super::NSSurfacePropEntity();
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ Decorative, does nothing yet.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class cycler_sprite:CBaseEntity
|
||||
class cycler_sprite:NSRenderableEntity
|
||||
{
|
||||
|
||||
};
|
||||
|
|
|
@ -15,11 +15,8 @@
|
|||
*/
|
||||
|
||||
#include "../shared/baseentity.h"
|
||||
#include "basetrigger.h"
|
||||
#include "basemonster.h"
|
||||
#include "basenpc.h"
|
||||
#include "baseoutput.h"
|
||||
#include "basephysics.h"
|
||||
#include "NSOutput.h"
|
||||
#include "NSPhysicsEntity.h"
|
||||
|
||||
void FX_Spark(vector, vector);
|
||||
void FX_BreakModel(int, vector, vector, vector, float);
|
||||
|
@ -60,3 +57,34 @@ string Util_FixModel(string mdl)
|
|||
|
||||
return mdl;
|
||||
}
|
||||
|
||||
/* Backwards compat */
|
||||
class CBaseMonster:NSMonster
|
||||
{
|
||||
void(void) CBaseMonster;
|
||||
};
|
||||
void
|
||||
CBaseMonster::CBaseMonster(void)
|
||||
{
|
||||
super::NSMonster();
|
||||
}
|
||||
|
||||
class CBaseNPC:NSTalkMonster
|
||||
{
|
||||
void(void) CBaseNPC;
|
||||
};
|
||||
void
|
||||
CBaseNPC::CBaseNPC(void)
|
||||
{
|
||||
super::NSTalkMonster();
|
||||
}
|
||||
|
||||
class CBasePhysics:NSPhysicsEntity
|
||||
{
|
||||
void(void) CBasePhysics;
|
||||
};
|
||||
void
|
||||
CBasePhysics::CBasePhysics(void)
|
||||
{
|
||||
super::NSPhysicsEntity();
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ enum
|
|||
SKIN_RANDOM
|
||||
};
|
||||
|
||||
class env_beverage:CBaseTrigger
|
||||
class env_beverage:NSRenderableEntity
|
||||
{
|
||||
int m_iUses;
|
||||
int m_iReady;
|
||||
|
@ -80,7 +80,7 @@ env_beverage::SpawnKey(string strKey, string strValue)
|
|||
m_iUses = stoi(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ env_beverage::env_beverage(void)
|
|||
precache_model("models/can.mdl");
|
||||
precache_sound("weapons/g_bounce3.wav");
|
||||
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
|
||||
if (!m_iUses) {
|
||||
m_iUses = 10;
|
||||
|
|
|
@ -45,7 +45,7 @@ enumflags
|
|||
ENVEXPLO_NOSPARKS
|
||||
};
|
||||
|
||||
class env_explosion:CBaseTrigger
|
||||
class env_explosion:NSPointTrigger
|
||||
{
|
||||
int m_iMagnitude;
|
||||
float m_flMaxDelay;
|
||||
|
@ -78,12 +78,12 @@ env_explosion::SpawnKey(string strKey, string strValue)
|
|||
m_iMagnitude = stoi(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
env_explosion::env_explosion(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ enumflags
|
|||
EVF_ONLYUSER
|
||||
};
|
||||
|
||||
class env_fade:CBaseTrigger
|
||||
class env_fade:NSRenderableEntity
|
||||
{
|
||||
float m_flFadeDuration;
|
||||
float m_flFadeHold;
|
||||
|
@ -92,12 +92,12 @@ env_fade::SpawnKey(string strKey, string strValue)
|
|||
m_flFadeHold = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
env_fade::env_fade(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ enum
|
|||
|
||||
const string CENVGLOBAL_CVAR = "env_global_data";
|
||||
|
||||
class env_global:CBaseTrigger
|
||||
class env_global:NSPointTrigger
|
||||
{
|
||||
string m_strGlobalState;
|
||||
int m_iTriggerMode;
|
||||
|
@ -145,14 +145,14 @@ env_global::SpawnKey(string strKey, string strValue)
|
|||
m_iInitialState = stoi(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
env_global::env_global(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
|
||||
if (!m_strGlobalState) {
|
||||
objerror("env_global: No globalstate name given! Aborting\n");
|
||||
|
|
|
@ -40,11 +40,12 @@ enumflags
|
|||
EHH_ALLPLAYERS
|
||||
};
|
||||
|
||||
class env_hudhint:CBaseTrigger
|
||||
class env_hudhint:NSPointTrigger
|
||||
{
|
||||
string m_strMessage;
|
||||
|
||||
void(void) env_hudhint;
|
||||
|
||||
virtual void(entity, int) Trigger;
|
||||
virtual void(string, string) SpawnKey;
|
||||
};
|
||||
|
@ -63,14 +64,14 @@ env_hudhint::SpawnKey(string strKey, string strValue)
|
|||
m_strMessage = strValue;
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
env_hudhint::env_hudhint(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -53,7 +53,7 @@ enumflags
|
|||
ENVLAZ_DECALEND
|
||||
};
|
||||
|
||||
class env_laser:CBaseTrigger
|
||||
class env_laser:NSPointTrigger
|
||||
{
|
||||
int m_iState;
|
||||
int m_iStateOld;
|
||||
|
@ -83,7 +83,7 @@ env_laser::think(void)
|
|||
nextthink = time + 0.1;
|
||||
}
|
||||
|
||||
t = (CBaseTrigger)find(world, ::targetname, m_strLaserDest);
|
||||
t = find(world, ::targetname, m_strLaserDest);
|
||||
angles = t.origin;
|
||||
|
||||
if (!t) {
|
||||
|
@ -198,14 +198,13 @@ env_laser::SpawnKey(string strKey, string strValue)
|
|||
m_flDPS = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
env_laser::env_laser(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
identity = 1;
|
||||
super::NSPointTrigger();
|
||||
pvsflags = PVSF_IGNOREPVS;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ enumflags
|
|||
EMF_ALLPLAYERS
|
||||
};
|
||||
|
||||
class env_message:CBaseTrigger
|
||||
class env_message:NSPointTrigger
|
||||
{
|
||||
string m_strSound;
|
||||
float m_flVolume;
|
||||
|
@ -96,13 +96,13 @@ env_message::SpawnKey(string strKey, string strValue)
|
|||
m_iAttenuation = stoi(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void env_message::env_message(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -77,9 +77,10 @@ enumflags
|
|||
SF_NORENDERCOLOR
|
||||
};
|
||||
|
||||
class env_render:CBaseTrigger
|
||||
class env_render:NSRenderableEntity
|
||||
{
|
||||
void(void) env_render;
|
||||
|
||||
virtual void(entity, int) Trigger;
|
||||
};
|
||||
|
||||
|
@ -88,7 +89,7 @@ env_render::Trigger(entity act, int state)
|
|||
{
|
||||
for (entity e = world;
|
||||
(e = find(e, ::targetname, target));) {
|
||||
CBaseEntity trigger = (CBaseEntity)e;
|
||||
NSRenderableEntity trigger = (NSRenderableEntity)e;
|
||||
|
||||
dprint(sprintf("^2env_render::^3Trigger^7: with spawnflags %d\n", spawnflags));
|
||||
dprint(sprintf("\tTarget: %s\n", target));
|
||||
|
@ -114,6 +115,6 @@ env_render::Trigger(entity act, int state)
|
|||
void
|
||||
env_render::env_render(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -35,7 +35,7 @@ This entity was introduced in Half-Life (1998).
|
|||
|
||||
#define EVS_GLOBAL 1
|
||||
|
||||
class env_shake:CBaseTrigger
|
||||
class env_shake:NSPointTrigger
|
||||
{
|
||||
float m_flRadius;
|
||||
float m_flAmplitude;
|
||||
|
@ -70,12 +70,12 @@ env_shake::SpawnKey(string strKey, string strValue)
|
|||
m_flFrequency = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
env_shake::env_shake(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ Shoots model entities from its location.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class env_shooter:CBaseTrigger
|
||||
class env_shooter:NSPointTrigger
|
||||
{
|
||||
int m_iGibs;
|
||||
int m_iGibsLeft;
|
||||
|
@ -143,14 +143,14 @@ env_shooter::SpawnKey(string strKey, string strValue)
|
|||
m_flSkin = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
env_shooter::env_shooter(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
|
||||
if (!m_strShootModel) {
|
||||
remove(this);
|
||||
|
|
|
@ -47,11 +47,12 @@ enumflags
|
|||
EVSPARK_STARTON
|
||||
};
|
||||
|
||||
class env_spark:CBaseTrigger
|
||||
class env_spark:NSPointTrigger
|
||||
{
|
||||
float m_flMaxDelay;
|
||||
|
||||
void(void) env_spark;
|
||||
|
||||
virtual void(void) CreateSpark;
|
||||
virtual void(void) TimedSpark;
|
||||
virtual void(entity, int) Trigger;
|
||||
|
@ -118,7 +119,7 @@ env_spark::SpawnKey(string strKey, string strValue)
|
|||
m_flMaxDelay = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -126,5 +127,5 @@ void
|
|||
env_spark::env_spark(void)
|
||||
{
|
||||
Sound_Precache("env_spark.sfx");
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ enumflags
|
|||
ENVS_PLAYONCE
|
||||
};
|
||||
|
||||
class env_sprite:CBaseTrigger
|
||||
class env_sprite:NSRenderableEntity
|
||||
{
|
||||
int m_iToggled;
|
||||
float m_flFramerate;
|
||||
|
@ -151,7 +151,7 @@ env_sprite::SpawnKey(string strKey, string strValue)
|
|||
m_flScale = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ env_sprite::env_sprite(void)
|
|||
m_flFramerate = 10;
|
||||
m_flScale = 1.0f;
|
||||
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
|
||||
m_iToggled = ((spawnflags & ENVS_STARTON) > 0);
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ const string funcbreakable_surftable[] = {
|
|||
"gs_material_rocks"
|
||||
};
|
||||
|
||||
class func_breakable:CBaseTrigger
|
||||
class func_breakable:NSSurfacePropEntity
|
||||
{
|
||||
float m_flDelay;
|
||||
float m_flExplodeMag;
|
||||
|
@ -144,7 +144,7 @@ func_breakable::Pain(void)
|
|||
return;
|
||||
}
|
||||
|
||||
Sound_Play(this, CHAN_VOICE, SurfData_GetInfo(m_iMaterial, SURFDATA_SND_BULLETIMPACT));
|
||||
Sound_Play(this, CHAN_VOICE, GetSurfaceData(SURFDATA_SND_BULLETIMPACT));
|
||||
}
|
||||
|
||||
|
||||
|
@ -152,7 +152,7 @@ void
|
|||
func_breakable::Explode(void)
|
||||
{
|
||||
vector rp = absmin + (0.5 * (absmax - absmin));
|
||||
FX_BreakModel(vlen(size) / 10, absmin, absmax, [0,0,0], SurfData_GetInfo(m_iMaterial, SURFDATA_MATERIAL));
|
||||
FX_BreakModel(vlen(size) / 10, absmin, absmax, [0,0,0], GetSurfaceData(SURFDATA_MATERIAL));
|
||||
FX_Explosion(rp);
|
||||
Damage_Radius(rp, this, m_flExplodeMag, m_flExplodeRad, TRUE, 0);
|
||||
UseTargets(this, TRIG_TOGGLE, 0.0f); /* delay... ignored. */
|
||||
|
@ -167,7 +167,7 @@ func_breakable::Death(void)
|
|||
vector neworg = self.origin;
|
||||
|
||||
/* become the classname assigned */
|
||||
CBaseEntity t = (CBaseEntity)self;
|
||||
NSEntity t = (NSEntity)self;
|
||||
callfunction(self.classname);
|
||||
|
||||
/* apply the saved values back */
|
||||
|
@ -178,7 +178,7 @@ func_breakable::Death(void)
|
|||
t.Respawn();
|
||||
}
|
||||
|
||||
if (m_iMaterial == BREAKMT_GLASS_UNBREAKABLE) {
|
||||
if (material == BREAKMT_GLASS_UNBREAKABLE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ func_breakable::Death(void)
|
|||
think = Explode;
|
||||
nextthink = time + random(0.0,0.5);
|
||||
} else {
|
||||
FX_BreakModel(vlen(size) / 10, absmin, absmax, [0,0,0], SurfData_GetInfo(m_iMaterial, SURFDATA_MATERIAL));
|
||||
FX_BreakModel(vlen(size) / 10, absmin, absmax, [0,0,0], GetSurfaceData(SURFDATA_MATERIAL));
|
||||
/* TODO: ability to have whoever destroyed the crate be the activator */
|
||||
UseTargets(this, TRIG_TOGGLE, 0.0f);
|
||||
Hide();
|
||||
|
@ -215,7 +215,7 @@ void
|
|||
func_breakable::Trigger(entity act, int state)
|
||||
{
|
||||
if (health > 0)
|
||||
func_breakable::Death();
|
||||
Death();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -243,7 +243,7 @@ func_breakable::PlayerTouch(void)
|
|||
touch = __NULL__;
|
||||
Damage_Apply(this, other, fDamage, 0, DMG_CRUSH);
|
||||
|
||||
if ((m_iMaterial == BREAKMT_GLASS) || (m_iMaterial == BREAKMT_COMPUTER)) {
|
||||
if ((GetSurfaceData(SURFDATA_MATERIAL) == GSMATERIAL_GLASS) || (GetSurfaceData(SURFDATA_MATERIAL) == GSMATERIAL_COMPUTER)) {
|
||||
Damage_Apply(other, this, fDamage / 4, 0, DMG_CRUSH);
|
||||
}
|
||||
}
|
||||
|
@ -297,7 +297,8 @@ func_breakable::SpawnKey(string strKey, string strValue)
|
|||
switch (strKey) {
|
||||
case "material":
|
||||
float id = stof(strValue);
|
||||
SurfData_SetStage(funcbreakable_surftable[id]);
|
||||
SetSurfaceData(funcbreakable_surftable[id]);
|
||||
SetPropData(funcbreakable_surftable[id]);
|
||||
break;
|
||||
case "explodemagnitude":
|
||||
m_flExplodeMag = stof(strValue);
|
||||
|
@ -318,7 +319,7 @@ func_breakable::SpawnKey(string strKey, string strValue)
|
|||
m_strBreakSpawn = strValue;
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -328,19 +329,19 @@ func_breakable::func_breakable(void)
|
|||
{
|
||||
/* func_breakable defaults to glass */
|
||||
if (classname == "func_breakable") {
|
||||
PropData_SetStage(funcbreakable_surftable[0]);
|
||||
SurfData_SetStage(funcbreakable_surftable[0]);
|
||||
SetPropData(funcbreakable_surftable[0]);
|
||||
SetSurfaceData(funcbreakable_surftable[0]);
|
||||
} else {
|
||||
PropData_SetStage(funcbreakable_surftable[1]);
|
||||
SurfData_SetStage(funcbreakable_surftable[1]);
|
||||
SetPropData(funcbreakable_surftable[1]);
|
||||
SetSurfaceData(funcbreakable_surftable[1]);
|
||||
}
|
||||
|
||||
/* proper init */
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSSurfacePropEntity();
|
||||
|
||||
/* contrary to what some map designers think, angles are not supported */
|
||||
GetSpawnAngles() = angles = [0,0,0];
|
||||
|
||||
/* precache impact sound */
|
||||
Sound_Precache(SurfData_GetInfo(m_iMaterial, SURFDATA_SND_BULLETIMPACT));
|
||||
Sound_Precache(GetSurfaceData(SURFDATA_SND_BULLETIMPACT));
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ By default it's visible and has collision.
|
|||
This entity was introduced in Half-Life 2 (2004).
|
||||
*/
|
||||
|
||||
class func_brush:CBaseTrigger
|
||||
class func_brush:NSRenderableEntity
|
||||
{
|
||||
int m_iSolidity;
|
||||
int m_iStartOff;
|
||||
|
@ -107,6 +107,8 @@ func_brush::SpawnKey(string strKey, string strValue)
|
|||
break;
|
||||
case "invert_exclusion":
|
||||
break;
|
||||
default:
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,6 +130,5 @@ func_brush::Respawn(void)
|
|||
void
|
||||
func_brush::func_brush(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
Respawn();
|
||||
super::NSRenderableEntity();
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ enum
|
|||
FRAME_ON
|
||||
};
|
||||
|
||||
class func_button:CBaseTrigger
|
||||
class func_button:NSSurfacePropEntity
|
||||
{
|
||||
float m_flSpeed;
|
||||
float m_flLip;
|
||||
|
@ -409,7 +409,7 @@ func_button::SpawnKey(string strKey, string strValue)
|
|||
m_strSndPressed = sprintf("func_button.hlsfx_%i", stoi(strValue) + 1i);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -418,7 +418,7 @@ func_button::func_button(void)
|
|||
{
|
||||
m_flWait = 4.0f;
|
||||
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSSurfacePropEntity();
|
||||
|
||||
/* sounds */
|
||||
Sound_Precache(m_strSndPressed);
|
||||
|
|
|
@ -29,7 +29,7 @@ This entity was introduced in Half-Life (1998).
|
|||
#define SF_CONVEYOR_VISUAL 1
|
||||
#define SF_CONVEYOR_NOTSOLID 2
|
||||
|
||||
class func_conveyor:CBaseTrigger
|
||||
class func_conveyor:NSRenderableEntity
|
||||
{
|
||||
float m_flSpeed;
|
||||
vector m_vecMoveDir;
|
||||
|
@ -77,10 +77,9 @@ func_conveyor::Respawn(void)
|
|||
angles = GetSpawnAngles();
|
||||
|
||||
SetMovementDirection();
|
||||
SetSolid(SOLID_BSP);
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetMovetype(MOVETYPE_NONE);
|
||||
SetSolid(SOLID_BSPTRIGGER);
|
||||
|
||||
/* TODO: Apply some effect flag the engine handles? */
|
||||
if (!(spawnflags & SF_CONVEYOR_VISUAL)) {
|
||||
|
@ -105,7 +104,7 @@ func_conveyor::Input(entity eAct, string strInput, string strData)
|
|||
m_flSpeed = stof(strData);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::Input(eAct, strInput, strData);
|
||||
super::Input(eAct, strInput, strData);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,5 +112,5 @@ void
|
|||
func_conveyor::func_conveyor(void)
|
||||
{
|
||||
m_flSpeed = 100;
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ enum
|
|||
DOORSTATE_DOWN
|
||||
};
|
||||
|
||||
class func_door:CBaseTrigger
|
||||
class func_door:NSRenderableEntity
|
||||
{
|
||||
string targetClose;
|
||||
vector m_vecPos1;
|
||||
|
@ -95,6 +95,7 @@ class func_door:CBaseTrigger
|
|||
string m_strSndStop;
|
||||
|
||||
void(void) func_door;
|
||||
|
||||
virtual void(void) SetMovementDirection;
|
||||
virtual void(vector, void(void) func) MoveToDestination;
|
||||
virtual void(void) MoveAway;
|
||||
|
@ -133,7 +134,7 @@ func_door::Arrived(void)
|
|||
|
||||
if (targetClose)
|
||||
for (entity f = world; (f = find(f, ::targetname, targetClose));) {
|
||||
CBaseTrigger trigger = (CBaseTrigger)f;
|
||||
NSEntity trigger = (NSEntity)f;
|
||||
if (trigger.Trigger != __NULL__) {
|
||||
trigger.Trigger(this, TRIG_TOGGLE);
|
||||
}
|
||||
|
@ -465,14 +466,14 @@ func_door::SpawnKey(string strKey, string strValue)
|
|||
m_strUnlockedSfx = sprintf("func_button.hlsfx_%i", x+1i);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
func_door::func_door(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
|
||||
if (m_strSndOpen)
|
||||
Sound_Precache(m_strSndOpen);
|
||||
|
|
|
@ -67,7 +67,7 @@ enumflags
|
|||
|
||||
#define SF_DOOR_SILENT 0x80000000i
|
||||
|
||||
class func_door_rotating:CBaseTrigger
|
||||
class func_door_rotating:NSRenderableEntity
|
||||
{
|
||||
string targetClose;
|
||||
string m_strSndStop;
|
||||
|
@ -164,7 +164,7 @@ void func_door_rotating::Returned(void)
|
|||
|
||||
if (targetClose)
|
||||
for (entity f = world; (f = find(f, ::targetname, targetClose));) {
|
||||
CBaseTrigger trigger = (CBaseTrigger)f;
|
||||
NSEntity trigger = (NSEntity)f;
|
||||
if (trigger.Trigger != __NULL__) {
|
||||
trigger.Trigger(this, TRIG_TOGGLE);
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ func_door_rotating::SpawnKey(string strKey, string strValue)
|
|||
m_strLockedSfx = sprintf("func_button.hlsfx_%i", x+1i);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -472,7 +472,7 @@ void func_door_rotating::func_door_rotating(void)
|
|||
m_flDelay = 4;
|
||||
m_flDistance = 90;
|
||||
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
|
||||
if (m_strSndOpen)
|
||||
Sound_Precache(m_strSndOpen);
|
||||
|
|
|
@ -30,7 +30,7 @@ This entity was introduced in Half-Life (1998).
|
|||
|
||||
#define SF_GUNTARGET_ON 1
|
||||
|
||||
class func_guntarget:CBaseTrigger
|
||||
class func_guntarget:NSSurfacePropEntity
|
||||
{
|
||||
float m_flSpeed;
|
||||
string m_strOnDeath;
|
||||
|
@ -117,7 +117,7 @@ func_guntarget::Death(void)
|
|||
} else {
|
||||
entity a;
|
||||
for (a = world; (a = find(a, ::targetname, m_strOnDeathLegacy));) {
|
||||
CBaseTrigger trigger = (CBaseTrigger)a;
|
||||
NSEntity trigger = (NSEntity)a;
|
||||
trigger.Trigger(g_dmg_eAttacker, TRIG_TOGGLE);
|
||||
}
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ func_guntarget::Input(entity eAct, string strInput, string strData)
|
|||
Trigger(eAct, TRIG_TOGGLE);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::Input(eAct, strInput, strData);
|
||||
super::Input(eAct, strInput, strData);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -216,14 +216,14 @@ func_guntarget::SpawnKey(string strKey, string strValue)
|
|||
m_strOnDeath = strcat(m_strOnDeath, ",_", strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void func_guntarget::func_guntarget(void)
|
||||
{
|
||||
m_flSpeed = 100;
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSSurfacePropEntity();
|
||||
|
||||
if (m_strOnDeath)
|
||||
m_strOnDeath = CreateOutput(m_strOnDeath);
|
||||
|
|
|
@ -29,7 +29,7 @@ Brush that fills up your health when used, to a maximum of 100 HP.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class func_healthcharger:CBaseTrigger
|
||||
class func_healthcharger:NSRenderableEntity
|
||||
{
|
||||
entity m_eUser;
|
||||
float m_flDelay;
|
||||
|
@ -151,7 +151,7 @@ func_healthcharger::SpawnKey(string strKey, string strValue)
|
|||
m_strSndDone = strValue;
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ func_healthcharger::func_healthcharger(void)
|
|||
m_strSndCharging = "items/medcharge4.wav";
|
||||
m_strSndDone = "items/medshotno1.wav";
|
||||
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
|
||||
precache_sound(m_strSndFirst);
|
||||
precache_sound(m_strSndCharging);
|
||||
|
|
|
@ -14,11 +14,13 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
class func_lod:CBaseEntity
|
||||
class func_lod:NSEntity
|
||||
{
|
||||
void(void) func_lod;
|
||||
|
||||
virtual float(entity, float) SendEntity;
|
||||
virtual void(string, string) SpawnKey;
|
||||
virtual void(void) Respawn;
|
||||
};
|
||||
|
||||
float
|
||||
|
@ -36,15 +38,20 @@ func_lod::SpawnKey(string strKey, string strValue)
|
|||
SetSolid(stoi(strValue) == 1 ? SOLID_NOT : SOLID_BSP);
|
||||
break;
|
||||
default:
|
||||
CBaseEntity::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
func_lod::Respawn(void)
|
||||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
}
|
||||
|
||||
void
|
||||
func_lod::func_lod(void)
|
||||
{
|
||||
CBaseEntity::CBaseEntity();
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetModel(model);
|
||||
SetOrigin(origin);
|
||||
super::NSEntity();
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ sound, damage, delay and so on.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class func_mortar_field:CBaseTrigger
|
||||
class func_mortar_field:NSBrushTrigger
|
||||
{
|
||||
int m_iType;
|
||||
int m_iCount;
|
||||
|
@ -172,14 +172,7 @@ func_mortar_field::Trigger(entity act, int state)
|
|||
void
|
||||
func_mortar_field::Respawn(void)
|
||||
{
|
||||
SetMovetype(MOVETYPE_NONE);
|
||||
SetSolid(SOLID_NOT);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
#ifdef GS_RENDERFX
|
||||
SetRenderMode(RM_TRIGGER);
|
||||
#endif
|
||||
InitBrushTrigger();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -202,12 +195,12 @@ func_mortar_field::SpawnKey(string strKey, string strValue)
|
|||
m_flSpread = stof(strValue) / 2;
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
func_mortar_field::func_mortar_field(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSBrushTrigger();
|
||||
}
|
||||
|
|
|
@ -39,17 +39,17 @@ This entity was introduced in Half-Life (1998).
|
|||
|
||||
enumflags
|
||||
{
|
||||
FUNCPEND_STARTON,
|
||||
FUNCPEND_STARTON,
|
||||
FUNCPEND_UNUSED1,
|
||||
FUNCPEND_UNUSED2,
|
||||
FUNCPEND_NONSOLID,
|
||||
FUNCPEND_RETURNONTRIGGER,
|
||||
FUNCPEND_UNUSED3,
|
||||
FUNCPEND_XAXIS,
|
||||
FUNCPEND_YAXIS
|
||||
FUNCPEND_NONSOLID,
|
||||
FUNCPEND_RETURNONTRIGGER,
|
||||
FUNCPEND_UNUSED3,
|
||||
FUNCPEND_XAXIS,
|
||||
FUNCPEND_YAXIS
|
||||
};
|
||||
|
||||
class func_pendulum:CBaseTrigger
|
||||
class func_pendulum:NSRenderableEntity
|
||||
{
|
||||
int m_iActive;
|
||||
float m_flProgress;
|
||||
|
@ -127,12 +127,12 @@ func_pendulum::SpawnKey(string strKey, string strValue)
|
|||
m_flDistance = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
func_pendulum::func_pendulum(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ Physics brush.
|
|||
This entity was introduced in Half-Life 2 (2004).
|
||||
*/
|
||||
|
||||
class func_physbox:CBasePhysics
|
||||
class func_physbox:NSPhysicsEntity
|
||||
{
|
||||
void(void) func_physbox;
|
||||
virtual void(string, string) SpawnKey;
|
||||
|
@ -33,7 +33,7 @@ class func_physbox:CBasePhysics
|
|||
void
|
||||
func_physbox::Respawn(void)
|
||||
{
|
||||
CBasePhysics::Respawn();
|
||||
NSPhysicsEntity::Respawn();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -41,12 +41,12 @@ func_physbox::SpawnKey(string strKey, string strValue)
|
|||
{
|
||||
switch (strKey) {
|
||||
default:
|
||||
CBasePhysics::SpawnKey(strKey, strValue);
|
||||
NSPhysicsEntity::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
func_physbox::func_physbox(void)
|
||||
{
|
||||
CBasePhysics::CBasePhysics();
|
||||
super::NSPhysicsEntity();
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ enum
|
|||
PLATSTATE_DOWN
|
||||
};
|
||||
|
||||
class func_plat:CBaseTrigger
|
||||
class func_plat:NSRenderableEntity
|
||||
{
|
||||
int m_iState;
|
||||
|
||||
|
@ -155,7 +155,7 @@ func_plat::SpawnKey(string strKey, string strValue)
|
|||
m_flSpeed = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -163,5 +163,5 @@ void
|
|||
func_plat::func_plat(void)
|
||||
{
|
||||
m_flSpeed = 100.0f;
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ func_pushable::OnPlayerUse(void)
|
|||
void
|
||||
func_pushable::Respawn(void)
|
||||
{
|
||||
func_breakable::Respawn();
|
||||
super::Respawn();
|
||||
movetype = MOVETYPE_STEP;
|
||||
touch = PlayerTouch;
|
||||
PlayerUse = OnPlayerUse;
|
||||
|
@ -147,5 +147,5 @@ func_pushable::Respawn(void)
|
|||
void
|
||||
func_pushable::func_pushable(void)
|
||||
{
|
||||
func_breakable::func_breakable();
|
||||
super::func_breakable();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ Brush that fills up your armor when used, to a maximum of 100 points.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class func_recharge:CBaseTrigger
|
||||
class func_recharge:NSRenderableEntity
|
||||
{
|
||||
entity m_eUser;
|
||||
float m_flDelay;
|
||||
|
@ -157,7 +157,7 @@ func_recharge::SpawnKey(string strKey, string strValue)
|
|||
m_strSndDone = strValue;
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ func_recharge::func_recharge(void)
|
|||
m_strSndCharging = "items/suitcharge1.wav";
|
||||
m_strSndDone = "items/suitchargeno1.wav";
|
||||
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
|
||||
precache_sound(m_strSndFirst);
|
||||
precache_sound(m_strSndCharging);
|
||||
|
|
|
@ -60,7 +60,7 @@ enum
|
|||
ROTBTNSTATE_CLOSING
|
||||
};
|
||||
|
||||
class func_rot_button:CBaseTrigger
|
||||
class func_rot_button:NSRenderableEntity
|
||||
{
|
||||
vector m_vecMoveAngle;
|
||||
int m_iState;
|
||||
|
@ -216,12 +216,12 @@ func_rot_button::SpawnKey(string strKey, string strValue)
|
|||
m_iHealth = stoi(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
func_rot_button::func_rot_button(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ enumflags
|
|||
FR_TOGGLEDIR
|
||||
};
|
||||
|
||||
class func_rotating:CBaseTrigger
|
||||
class func_rotating:NSRenderableEntity
|
||||
{
|
||||
vector m_vecMoveDir;
|
||||
float m_flSpeed;
|
||||
|
@ -181,7 +181,7 @@ func_rotating::SpawnKey(string strKey, string strValue)
|
|||
m_flDamage = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,6 +189,6 @@ void
|
|||
func_rotating::func_rotating(void)
|
||||
{
|
||||
m_flSpeed = 100;
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
func_rotating::SetMovementDirection();
|
||||
super::NSRenderableEntity();
|
||||
SetMovementDirection();
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ enumflags
|
|||
FNCTANK_CONTROLLABLE
|
||||
};
|
||||
|
||||
class func_tank:CBaseVehicle
|
||||
class func_tank:NSVehicle
|
||||
{
|
||||
/* attributes */
|
||||
float m_flYawRate; /* TODO */
|
||||
|
@ -254,7 +254,7 @@ func_tank::SpawnKey(string strKey, string strValue)
|
|||
m_strSndRotate = strValue;
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,7 @@ void
|
|||
func_tank::func_tank(void)
|
||||
{
|
||||
m_iVehicleFlags |= VHF_FROZEN | VHF_NOATTACK;
|
||||
CBaseVehicle::CBaseVehicle();
|
||||
super::NSVehicle();
|
||||
|
||||
if (m_strSpriteFlash)
|
||||
precache_model(m_strSpriteFlash);
|
||||
|
|
|
@ -25,7 +25,7 @@ to gain control.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class func_tankcontrols:CBaseTrigger
|
||||
class func_tankcontrols:NSBrushTrigger
|
||||
{
|
||||
void(void) func_tankcontrols;
|
||||
|
||||
|
@ -37,7 +37,7 @@ void
|
|||
func_tankcontrols::OnPlayerUse(void)
|
||||
{
|
||||
entity f;
|
||||
CBaseVehicle tank;
|
||||
NSVehicle tank;
|
||||
|
||||
tank = __NULL__;
|
||||
|
||||
|
@ -48,7 +48,7 @@ func_tankcontrols::OnPlayerUse(void)
|
|||
for (f = world; (f = find(f, ::targetname, target));) {
|
||||
/* we found the right entity */
|
||||
if (f.classname == "func_tank" || f.classname == "func_tankmortar") {
|
||||
tank = (CBaseVehicle)f;
|
||||
tank = (NSVehicle)f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,19 +63,12 @@ func_tankcontrols::OnPlayerUse(void)
|
|||
void
|
||||
func_tankcontrols::Respawn(void)
|
||||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
InitBrushTrigger();
|
||||
PlayerUse = OnPlayerUse;
|
||||
|
||||
#ifdef GS_RENDERFX
|
||||
SetRenderMode(RM_TRIGGER);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
func_tankcontrols::func_tankcontrols(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSBrushTrigger();
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ enumflags
|
|||
TRAIN_NOTSOLID
|
||||
};
|
||||
|
||||
class func_tracktrain:CBaseTrigger
|
||||
class func_tracktrain:NSBrushTrigger
|
||||
{
|
||||
float m_flWait;
|
||||
float m_flSpeed;
|
||||
|
@ -275,7 +275,7 @@ func_tracktrain::SpawnKey(string strKey, string strValue)
|
|||
m_strStopSnd = sprintf("func_tracktrain.stop_%i", stoi(strValue) + 1i);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ func_tracktrain::func_tracktrain(void)
|
|||
{
|
||||
/* FIXME: This is all decided by the first path_corner pretty much */
|
||||
m_flSpeed = 100;
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSBrushTrigger();
|
||||
|
||||
if (m_strMoveSnd)
|
||||
Sound_Precache(m_strMoveSnd);
|
||||
|
|
|
@ -26,22 +26,21 @@ to gain control.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class func_tracktraincontrols:CBaseTrigger
|
||||
class func_tracktraincontrols:NSBrushTrigger
|
||||
{
|
||||
void(void) func_tracktraincontrols;
|
||||
|
||||
virtual void(void) Respawn;
|
||||
};
|
||||
|
||||
void
|
||||
func_tracktraincontrols::Respawn(void)
|
||||
{
|
||||
InitBrushTrigger();
|
||||
}
|
||||
|
||||
void
|
||||
func_tracktraincontrols::func_tracktraincontrols(void)
|
||||
{
|
||||
precache_model(model);
|
||||
SetModel(model);
|
||||
SetOrigin(origin);
|
||||
|
||||
#ifdef GS_RENDERFX
|
||||
SetRenderMode(RM_TRIGGER);
|
||||
#endif
|
||||
|
||||
SetSolid(SOLID_NOT);
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSBrushTrigger();
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ enumflags
|
|||
TRAIN_NOTSOLID
|
||||
};
|
||||
|
||||
class func_train:CBaseTrigger
|
||||
class func_train:NSRenderableEntity
|
||||
{
|
||||
float m_flWait;
|
||||
float m_flSpeed;
|
||||
|
@ -257,7 +257,7 @@ func_train::SpawnKey(string strKey, string strValue)
|
|||
m_strStopSnd = sprintf("func_train.stop_%i", stoi(strValue) + 1i);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,7 +266,7 @@ func_train::func_train(void)
|
|||
{
|
||||
/* FIXME: This is all decided by the first path_corner pretty much */
|
||||
m_flSpeed = 100;
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
|
||||
if (m_strMoveSnd)
|
||||
Sound_Precache(m_strMoveSnd);
|
||||
|
|
|
@ -78,7 +78,7 @@ class func_vehicle_wheel
|
|||
virtual void(float) Physics;
|
||||
};
|
||||
|
||||
class func_vehicle:CBaseVehicle
|
||||
class func_vehicle:NSVehicle
|
||||
{
|
||||
/* map-entity fields */
|
||||
float m_flBounceFactor;
|
||||
|
@ -102,6 +102,7 @@ class func_vehicle:CBaseVehicle
|
|||
float m_flTurn;
|
||||
|
||||
void(void) func_vehicle;
|
||||
|
||||
virtual void(void) customphysics;
|
||||
virtual void(void) Respawn;
|
||||
virtual void(void) Realign;
|
||||
|
@ -439,7 +440,7 @@ func_vehicle::Realign(void)
|
|||
{
|
||||
entity t;
|
||||
entity f;
|
||||
CBaseEntity first, second;
|
||||
NSEntity first, second;
|
||||
string strFirst, strSecond;
|
||||
|
||||
first = second = __NULL__;
|
||||
|
@ -464,7 +465,7 @@ func_vehicle::Realign(void)
|
|||
for (f = world; (f = find(f, ::targetname, strFirst));) {
|
||||
/* we found the right entity */
|
||||
if (f.classname == "path_track" || f.classname == "path_corner") {
|
||||
first = (CBaseEntity)f;
|
||||
first = (NSEntity)f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -473,14 +474,14 @@ func_vehicle::Realign(void)
|
|||
for (f = world; (f = find(f, ::targetname, strSecond));) {
|
||||
/* we found the right entity */
|
||||
if (f.classname == "path_track" || f.classname == "path_corner") {
|
||||
second = (CBaseEntity)f;
|
||||
second = (NSEntity)f;
|
||||
}
|
||||
}
|
||||
|
||||
if (first && second) {
|
||||
vector end_pos;
|
||||
first = (CBaseEntity)first;
|
||||
second = (CBaseEntity)second;
|
||||
first = (NSEntity)first;
|
||||
second = (NSEntity)second;
|
||||
angles = vectoangles(first.origin - second.origin);
|
||||
|
||||
end_pos = first.origin;
|
||||
|
@ -561,7 +562,7 @@ func_vehicle::SpawnKey(string strKey, string strValue)
|
|||
// TODO
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -578,7 +579,7 @@ func_vehicle::func_vehicle(void)
|
|||
m_vecGravityDir = [0,0,-1];
|
||||
m_iVehicleFlags |= VHF_FROZEN;
|
||||
|
||||
CBaseVehicle::CBaseVehicle();
|
||||
super::NSVehicle();
|
||||
|
||||
m_wlFL = spawn(func_vehicle_wheel);
|
||||
m_wlFR = spawn(func_vehicle_wheel);
|
||||
|
|
|
@ -32,7 +32,7 @@ enumflags
|
|||
FTW_STARTHIDDEN
|
||||
};
|
||||
|
||||
class func_wall_toggle:CBaseTrigger
|
||||
class func_wall_toggle:NSRenderableEntity
|
||||
{
|
||||
int m_oldmodelindex;
|
||||
int m_iVisible;
|
||||
|
@ -89,13 +89,12 @@ func_wall_toggle::Input(entity eAct, string strInput, string strData)
|
|||
Trigger(eAct, TRIG_TOGGLE);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::Input(eAct, strInput, strData);
|
||||
super::Input(eAct, strInput, strData);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
func_wall_toggle::func_wall_toggle(void)
|
||||
{
|
||||
precache_model(model);
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ enumflags
|
|||
GPEFL_TRIGGERONLY
|
||||
};
|
||||
|
||||
class game_player_equip:CBaseTrigger
|
||||
class game_player_equip:NSPointTrigger
|
||||
{
|
||||
string m_strBuffer;
|
||||
|
||||
|
@ -62,7 +62,7 @@ game_player_equip::SpawnUnit(string cname, vector org)
|
|||
vector neworg = self.origin;
|
||||
|
||||
/* become the classname assigned */
|
||||
CBaseEntity t = (CBaseEntity)self;
|
||||
NSEntity t = (NSEntity)self;
|
||||
callfunction(self.classname);
|
||||
|
||||
/* apply the saved values back */
|
||||
|
@ -103,9 +103,9 @@ game_player_equip::Trigger(entity act, int state)
|
|||
for (x = 0; x < count; x++) {
|
||||
if (isfunction(strcat("spawnfunc_", cname))) {
|
||||
cname = strcat("spawnfunc_", cname);
|
||||
game_player_equip::SpawnUnit(cname, act.origin);
|
||||
SpawnUnit(cname, act.origin);
|
||||
} else if (isfunction(cname)) {
|
||||
game_player_equip::SpawnUnit(cname, act.origin);
|
||||
SpawnUnit(cname, act.origin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,5 +133,5 @@ game_player_equip::SpawnKey(string strKey, string strValue)
|
|||
void
|
||||
game_player_equip::game_player_equip(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ enumflags
|
|||
GTF_ALLPLAYERS
|
||||
};
|
||||
|
||||
class game_text:CBaseTrigger
|
||||
class game_text:NSPointTrigger
|
||||
{
|
||||
float m_flPosX;
|
||||
float m_flPosY;
|
||||
|
@ -129,11 +129,11 @@ game_text::SpawnKey(string strKey, string strValue)
|
|||
m_iChannel = stoi(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void game_text::game_text(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -47,5 +47,5 @@ void gibshooter2::gibshooter2(void)
|
|||
m_flScale = 1.0;
|
||||
|
||||
precache_model(m_strShootModel);
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::env_shooter();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ and angles towards the aim target.
|
|||
This entity was introduced in Quake (1996).
|
||||
*/
|
||||
|
||||
class info_intermission:CBaseTrigger
|
||||
class info_intermission:NSPointTrigger
|
||||
{
|
||||
void(void) info_intermission;
|
||||
};
|
||||
|
@ -39,5 +39,5 @@ class info_intermission:CBaseTrigger
|
|||
void
|
||||
info_intermission::info_intermission(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ This entity was introduced in Quake (1996).
|
|||
*/
|
||||
|
||||
|
||||
class info_notnull:CBaseTrigger
|
||||
class info_notnull:NSPointTrigger
|
||||
{
|
||||
void(void) info_notnull;
|
||||
};
|
||||
|
@ -40,5 +40,5 @@ class info_notnull:CBaseTrigger
|
|||
void
|
||||
info_notnull::info_notnull(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ prepare to crash.
|
|||
This entity was introduced in Quake (1996).
|
||||
*/
|
||||
|
||||
class info_null:CBaseEntity
|
||||
class info_null:NSPointTrigger
|
||||
{
|
||||
void(void) info_null;
|
||||
|
||||
|
@ -47,7 +47,7 @@ info_null::WarnDeveloper(void)
|
|||
return;
|
||||
|
||||
for (entity f = world; (f = find(f, ::target, targetname));) {
|
||||
CBaseEntity enty = (CBaseTrigger)f;
|
||||
NSEntity enty = (NSEntity)f;
|
||||
if (enty.identity)
|
||||
if (enty.target == targetname) {
|
||||
print(sprintf("^1info_null::WarnDeveloper^7: " \
|
||||
|
@ -69,7 +69,7 @@ void
|
|||
info_null::info_null(void)
|
||||
{
|
||||
#ifdef DEBUG_INFONULL
|
||||
CBaseEntity::CBaseEntity();
|
||||
super::NSPointTrigger();
|
||||
#else
|
||||
remove(self);
|
||||
#endif
|
||||
|
|
|
@ -36,13 +36,14 @@ which is probably overkill). No angle has to be supplied.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class infodecal:CBaseTrigger
|
||||
class infodecal:NSPointTrigger
|
||||
{
|
||||
decal m_decChild;
|
||||
|
||||
string m_strTexture;
|
||||
|
||||
void(void) infodecal;
|
||||
|
||||
virtual void(entity, int) Trigger;
|
||||
virtual void(void) Respawn;
|
||||
virtual void(string, string) SpawnKey;
|
||||
|
@ -95,7 +96,7 @@ infodecal::SpawnKey(string strKey, string strValue)
|
|||
m_strTexture = strtolower(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,5 +108,5 @@ infodecal::infodecal(void)
|
|||
return;
|
||||
}
|
||||
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -26,10 +26,12 @@ This is a food item that will give the user 1 health when touched.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class item_food:CBaseEntity
|
||||
class item_food:NSEntity
|
||||
{
|
||||
int m_iIsCan;
|
||||
|
||||
void(void) item_food;
|
||||
|
||||
virtual void(void) Setup;
|
||||
virtual void(void) Touch;
|
||||
};
|
||||
|
|
|
@ -97,7 +97,7 @@ though.
|
|||
This entity was introduced in Nuclide (2021).
|
||||
*/
|
||||
|
||||
class light:CBaseTrigger
|
||||
class light:NSPointTrigger
|
||||
{
|
||||
int m_iEnabled;
|
||||
float m_flStyle;
|
||||
|
@ -188,7 +188,7 @@ light::SpawnKey(string strKey, string strValue)
|
|||
case "_light":
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,8 @@ light::light(void)
|
|||
{
|
||||
m_iStartActive = TRUE;
|
||||
m_strPattern = "m";
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
|
||||
super::NSPointTrigger();
|
||||
|
||||
/* switch styles before 12 are builtins from Quake. */
|
||||
if (m_flSwitchStyle > 0 && m_flSwitchStyle <= 11) {
|
||||
|
|
|
@ -119,12 +119,12 @@ momentary_door::SpawnKey(string strKey, string strValue)
|
|||
m_flReturnspeed = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
momentary_door::momentary_door(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::CBaseMomentary();
|
||||
}
|
||||
|
|
|
@ -37,14 +37,14 @@ This entity was introduced in Half-Life (1998).
|
|||
|
||||
enumflags
|
||||
{
|
||||
MRBFL_DOORHACK,
|
||||
MRBFL_NOTUSE,
|
||||
MRBFL_DOORHACK,
|
||||
MRBFL_NOTUSE,
|
||||
MRBFL_UNUSED4,
|
||||
MRBFL_UNUSED8,
|
||||
MRBFL_AUTORETURN,
|
||||
MRBFL_AUTORETURN,
|
||||
MRBFL_UNUSED32,
|
||||
MRBFL_XAXIS,
|
||||
MRBFL_YAXIS
|
||||
MRBFL_YAXIS
|
||||
};
|
||||
|
||||
class momentary_rot_button:CBaseMomentary
|
||||
|
@ -151,12 +151,12 @@ momentary_rot_button::SpawnKey(string strKey, string strValue)
|
|||
m_flReturnspeed = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
momentary_rot_button::momentary_rot_button(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::CBaseMomentary();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
class CBaseMomentary:CBaseTrigger
|
||||
class CBaseMomentary:NSRenderableEntity
|
||||
{
|
||||
entity m_eUser;
|
||||
float m_flProgress;
|
||||
|
@ -33,4 +33,5 @@ class CBaseMomentary:CBaseTrigger
|
|||
|
||||
void CBaseMomentary::CBaseMomentary(void)
|
||||
{
|
||||
super::NSRenderableEntity();
|
||||
}
|
||||
|
|
|
@ -38,9 +38,10 @@ enumflags
|
|||
MF_FADECORPSE
|
||||
};
|
||||
|
||||
class monster_furniture:CBaseMonster
|
||||
class monster_furniture:NSMonster
|
||||
{
|
||||
void(void) monster_furniture;
|
||||
|
||||
virtual void(void) Respawn;
|
||||
};
|
||||
|
||||
|
@ -57,8 +58,7 @@ monster_furniture::Respawn(void)
|
|||
void
|
||||
monster_furniture::monster_furniture(void)
|
||||
{
|
||||
precache_model(model);
|
||||
CBaseEntity::CBaseEntity();
|
||||
super::NSMonster();
|
||||
spawnflags |= MSF_MULTIPLAYER;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ This entity was introduced in Half-Life (1998).
|
|||
|
||||
#define MGF_NONSOLID 4
|
||||
|
||||
class monster_generic:CBaseNPC
|
||||
class monster_generic:NSTalkMonster
|
||||
{
|
||||
void(void) monster_generic;
|
||||
|
||||
|
@ -41,7 +41,7 @@ class monster_generic:CBaseNPC
|
|||
void
|
||||
monster_generic::Respawn(void)
|
||||
{
|
||||
CBaseNPC::Respawn();
|
||||
NSTalkMonster::Respawn();
|
||||
|
||||
if (spawnflags & MGF_NONSOLID) {
|
||||
takedamage = DAMAGE_NO;
|
||||
|
@ -63,5 +63,5 @@ monster_generic::monster_generic(void)
|
|||
}
|
||||
|
||||
spawnflags |= MSF_MULTIPLAYER;
|
||||
CBaseNPC::CBaseNPC();
|
||||
super::NSTalkMonster();
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ enumflags
|
|||
MMF_MONSTERCLIP
|
||||
};
|
||||
|
||||
class monstermaker:CBaseTrigger
|
||||
class monstermaker:NSPointTrigger
|
||||
{
|
||||
string m_strMonster;
|
||||
int m_iMonsterSpawned;
|
||||
|
@ -90,7 +90,7 @@ monstermaker::Spawner(void)
|
|||
string tname = self.netname;
|
||||
|
||||
/* become the classname assigned */
|
||||
CBaseMonster t = (CBaseMonster)self;
|
||||
NSMonster t = (NSMonster)self;
|
||||
callfunction(self.classname);
|
||||
|
||||
/* apply the saved values back */
|
||||
|
@ -218,7 +218,7 @@ monstermaker::SpawnKey(string strKey, string strValue)
|
|||
netname = __NULL__;
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,5 +226,5 @@ void
|
|||
monstermaker::monstermaker(void)
|
||||
{
|
||||
m_flDelay = 1.0f;
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -32,14 +32,14 @@ This entity was introduced in Half-Life (1998).
|
|||
|
||||
#define MM_MULTITHREADED 1
|
||||
|
||||
class multi_manager_sub:CBaseTrigger
|
||||
class multi_manager_sub:NSPointTrigger
|
||||
{
|
||||
entity m_eActivator;
|
||||
int m_iValue;
|
||||
float m_flUntilTriggered;
|
||||
};
|
||||
|
||||
class multi_manager:CBaseTrigger
|
||||
class multi_manager:NSPointTrigger
|
||||
{
|
||||
multi_manager_sub m_eTriggers[16];
|
||||
string m_strBuffer;
|
||||
|
@ -62,7 +62,7 @@ multi_manager::Trigger(entity act, int state)
|
|||
dprint(sprintf("^2%s::^3Trigger^7: %s (%s)\n",
|
||||
this.classname, wow.target, eFind.classname));
|
||||
|
||||
CBaseTrigger::UseTargets(wow.m_eActivator, TRIG_TOGGLE, 0.0f);
|
||||
UseTargets(wow.m_eActivator, TRIG_TOGGLE, 0.0f);
|
||||
}
|
||||
|
||||
if (GetMaster() == FALSE)
|
||||
|
@ -141,7 +141,7 @@ multi_manager::multi_manager(void)
|
|||
int b;
|
||||
m_strBuffer = "";
|
||||
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
|
||||
for (b = 0; b < 16; b++) {
|
||||
m_eTriggers[b] = spawn(multi_manager_sub);
|
||||
|
|
|
@ -28,7 +28,7 @@ state for it to trigger its target.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class multisource:CBaseTrigger
|
||||
class multisource:NSPointTrigger
|
||||
{
|
||||
void(void) multisource;
|
||||
|
||||
|
@ -45,7 +45,7 @@ multisource::QueryTargets(void)
|
|||
|
||||
/* normal triggers */
|
||||
for (a = world; (a = find(a, ::target, targetname));) {
|
||||
CBaseTrigger tTemp = (CBaseTrigger) a;
|
||||
NSEntity tTemp = (NSEntity) a;
|
||||
if (cvar("developer") == 1) {
|
||||
dprint("[^1MULTISOURCE^7] ");
|
||||
dprint(tTemp.classname);
|
||||
|
@ -91,5 +91,5 @@ multisource::Respawn(void)
|
|||
void
|
||||
multisource::multisource(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ enumflags
|
|||
PC_FIREONCE
|
||||
};
|
||||
|
||||
class path_corner:CBaseTrigger
|
||||
class path_corner:NSPointTrigger
|
||||
{
|
||||
int m_iFired;
|
||||
float m_flSpeed;
|
||||
|
@ -68,7 +68,7 @@ path_corner::Trigger(entity act, int state)
|
|||
}
|
||||
|
||||
for (a = world; (a = find(a, ::targetname, m_strMessage));) {
|
||||
CBaseTrigger trigger = (CBaseTrigger)a;
|
||||
NSEntity trigger = (NSEntity)a;
|
||||
trigger.Trigger(act, state);
|
||||
m_iFired = TRUE;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ path_corner::SpawnKey(string strKey, string strValue)
|
|||
m_strMessage = strValue;
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,5 +112,5 @@ path_corner::path_corner(void)
|
|||
{
|
||||
m_flWait = 1.0f;
|
||||
m_flSpeed = 100.0f;
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ This is commonly used when a mission objective has failed.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class player_loadsaved:CBaseTrigger
|
||||
class player_loadsaved:NSRenderableEntity // for the rendercolor values
|
||||
{
|
||||
string m_strMessage;
|
||||
float m_flLoadTime;
|
||||
|
@ -40,6 +40,7 @@ class player_loadsaved:CBaseTrigger
|
|||
float m_flFadeHold;
|
||||
|
||||
void(void) player_loadsaved;
|
||||
|
||||
virtual void(entity, int) Trigger;
|
||||
virtual void(void) ReloadSave;
|
||||
virtual void(string, string) SpawnKey;
|
||||
|
@ -97,12 +98,12 @@ player_loadsaved::SpawnKey(string strKey, string strValue)
|
|||
m_flLoadTime = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
player_loadsaved::player_loadsaved(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
}
|
||||
|
|
|
@ -24,9 +24,10 @@ Strips the activator of all of its weapons.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class player_weaponstrip:CBaseTrigger
|
||||
class player_weaponstrip:NSPointTrigger
|
||||
{
|
||||
void(void) player_weaponstrip;
|
||||
|
||||
virtual void(entity, int) Trigger;
|
||||
};
|
||||
|
||||
|
@ -50,5 +51,5 @@ player_weaponstrip::Trigger(entity act, int unused)
|
|||
void
|
||||
player_weaponstrip::player_weaponstrip(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ PCAMFL_STARTOFF : Start with the camera turned off, outputting no signal.
|
|||
This entity was introduced in Half-Life 2 (2004).
|
||||
*/
|
||||
|
||||
class point_camera:CBaseTrigger
|
||||
class point_camera:NSPointTrigger
|
||||
{
|
||||
float m_flFOV;
|
||||
int m_iUseSAR;
|
||||
|
@ -78,7 +78,7 @@ point_camera::Input(entity eAct, string strInput, string strData)
|
|||
m_iValue = FALSE;
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::Input(eAct, strInput, strData);
|
||||
super::Input(eAct, strInput, strData);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ point_camera::SpawnKey(string strKey, string strValue)
|
|||
m_flFogEnd = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,5 +125,5 @@ point_camera::point_camera(void)
|
|||
{
|
||||
m_flFOV = 90;
|
||||
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#define PRPDRFL_NOALERT 16384
|
||||
#define PRPDRFL_NOUSE 32768
|
||||
|
||||
class prop_door_rotating:CBaseTrigger
|
||||
class prop_door_rotating:NSPointTrigger
|
||||
{
|
||||
vector m_vecDest1;
|
||||
vector m_vecDest2;
|
||||
|
@ -121,7 +121,7 @@ prop_door_rotating::SpawnKey(string strKey, string strValue)
|
|||
m_flSpeed = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,5 +130,5 @@ prop_door_rotating::prop_door_rotating(void)
|
|||
{
|
||||
m_flDistance = 90;
|
||||
m_flSpeed = 100;
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ Physics model
|
|||
This entity was introduced in Half-Life 2 (2004).
|
||||
*/
|
||||
|
||||
class prop_physics:CBasePhysics
|
||||
class prop_physics:NSPhysicsEntity
|
||||
{
|
||||
void(void) prop_physics;
|
||||
virtual void(string, string) SpawnKey;
|
||||
|
@ -33,7 +33,7 @@ class prop_physics:CBasePhysics
|
|||
void
|
||||
prop_physics::Respawn(void)
|
||||
{
|
||||
CBasePhysics::Respawn();
|
||||
NSPhysicsEntity::Respawn();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -41,12 +41,12 @@ prop_physics::SpawnKey(string strKey, string strValue)
|
|||
{
|
||||
switch (strKey) {
|
||||
default:
|
||||
CBasePhysics::SpawnKey(strKey, strValue);
|
||||
NSPhysicsEntity::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
prop_physics::prop_physics(void)
|
||||
{
|
||||
CBasePhysics::CBasePhysics();
|
||||
super::NSPhysicsEntity();
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ a random interval between 10 and 15 seconds in total.
|
|||
It was introduced in Gunman Chronicles (2000).
|
||||
*/
|
||||
|
||||
class random_speaker:CBaseTrigger
|
||||
class random_speaker:NSPointTrigger
|
||||
{
|
||||
string m_strSample;
|
||||
float m_flVolume;
|
||||
|
@ -142,12 +142,12 @@ random_speaker::SpawnKey(string strKey, string strValue)
|
|||
m_flRandPercent = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
random_speaker::random_speaker(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ its targets, based on some limits given.
|
|||
It was introduced in Gunman Chronicles (2000).
|
||||
*/
|
||||
|
||||
class random_trigger:CBaseTrigger
|
||||
class random_trigger:NSPointTrigger
|
||||
{
|
||||
float m_flMinTime;
|
||||
float m_flRandMin;
|
||||
|
@ -81,12 +81,12 @@ random_trigger::SpawnKey(string strKey, string strValue)
|
|||
m_flRandMax = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
random_trigger::random_trigger(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ world. It'll enable mouth flapping and all sorts of other cool effects.
|
|||
This entity was introduced in Half-Life (1998).
|
||||
*/
|
||||
|
||||
class scripted_sentence:CBaseTrigger
|
||||
class scripted_sentence:NSPointTrigger
|
||||
{
|
||||
string m_strSpeaker;
|
||||
string m_strSentence;
|
||||
|
@ -42,6 +42,7 @@ class scripted_sentence:CBaseTrigger
|
|||
float m_flDuration;
|
||||
|
||||
void(void) scripted_sentence;
|
||||
|
||||
virtual void(entity, int) Trigger;
|
||||
virtual void(string, string) SpawnKey;
|
||||
};
|
||||
|
@ -75,7 +76,7 @@ scripted_sentence::Trigger(entity act, int unused)
|
|||
|
||||
dprint(sprintf("^2scripted_sentence::^3Trigger^7: %s on %s\n", m_strSentence, m_strSpeaker));
|
||||
|
||||
CBaseNPC npc = (CBaseNPC)spe;
|
||||
NSTalkMonster npc = (NSTalkMonster)spe;
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EV_SENTENCE);
|
||||
WriteEntity(MSG_MULTICAST, npc);
|
||||
|
@ -105,12 +106,12 @@ scripted_sentence::SpawnKey(string strKey, string strValue)
|
|||
m_flWait = stof(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
scripted_sentence::scripted_sentence(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ enum
|
|||
SS_TURNTOFACE /* Turn to the scripted_sequence's angle before performing the animation. */
|
||||
};
|
||||
|
||||
class scripted_sequence:CBaseTrigger
|
||||
class scripted_sequence:NSPointTrigger
|
||||
{
|
||||
int m_iEnabled;
|
||||
|
||||
|
@ -114,10 +114,10 @@ class scripted_sequence:CBaseTrigger
|
|||
void
|
||||
scripted_sequence::RunOnEntity(entity targ)
|
||||
{
|
||||
CBaseMonster f;
|
||||
NSMonster f;
|
||||
float duration;
|
||||
|
||||
f = (CBaseMonster)targ;
|
||||
f = (NSMonster)targ;
|
||||
|
||||
if (!m_iEnabled)
|
||||
return;
|
||||
|
@ -199,9 +199,9 @@ scripted_sequence::RunOnEntity(entity targ)
|
|||
f.m_iSequenceState = SEQUENCESTATE_ENDING;
|
||||
|
||||
if (spawnflags & SSFL_NOSCRIPTMOVE)
|
||||
f.think = CBaseMonster::FreeState;
|
||||
f.think = NSMonster::FreeState;
|
||||
else
|
||||
f.think = CBaseMonster::FreeStateMoved;
|
||||
f.think = NSMonster::FreeStateMoved;
|
||||
|
||||
dprint(sprintf("\tEnding: %f\n", f.nextthink));
|
||||
|
||||
|
@ -214,17 +214,17 @@ scripted_sequence::RunOnEntity(entity targ)
|
|||
void
|
||||
scripted_sequence::Trigger(entity act, int unused)
|
||||
{
|
||||
CBaseMonster f;
|
||||
NSMonster f;
|
||||
|
||||
dprint(sprintf("^2scripted_sequence::^3Trigger^7: with spawnflags %d\n", spawnflags));
|
||||
f = (CBaseMonster)find(world, ::targetname, m_strMonster);
|
||||
f = (NSMonster)find(world, ::targetname, m_strMonster);
|
||||
|
||||
/* target doesn't exist/hasn't spawned */
|
||||
if (!f) {
|
||||
for (entity c = world; (c = find(c, ::classname, m_strMonster));) {
|
||||
/* within radius */
|
||||
if (vlen(origin - c.origin) < m_flSearchRadius) {
|
||||
f = (CBaseMonster)c;
|
||||
f = (NSMonster)c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -241,10 +241,10 @@ scripted_sequence::Trigger(entity act, int unused)
|
|||
void
|
||||
scripted_sequence::InitIdle(void)
|
||||
{
|
||||
CBaseMonster f;
|
||||
NSMonster f;
|
||||
|
||||
dprint(sprintf("^2scripted_sequence::^3InitIdle^7: with spawnflags %d\n", spawnflags));
|
||||
f = (CBaseMonster)find(world, ::targetname, m_strMonster);
|
||||
f = (NSMonster)find(world, ::targetname, m_strMonster);
|
||||
|
||||
/* target doesn't exist/hasn't spawned */
|
||||
if (!f) {
|
||||
|
@ -252,7 +252,7 @@ scripted_sequence::InitIdle(void)
|
|||
for (entity c = world; (c = find(c, ::classname, m_strMonster));) {
|
||||
/* within radius */
|
||||
if (vlen(origin - c.origin) < m_flSearchRadius) {
|
||||
f = (CBaseMonster)c;
|
||||
f = (NSMonster)c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -273,12 +273,12 @@ scripted_sequence::InitIdle(void)
|
|||
void
|
||||
scripted_sequence::touch(void)
|
||||
{
|
||||
CBaseMonster f;
|
||||
NSMonster f;
|
||||
|
||||
if (other.classname != m_strMonster)
|
||||
return;
|
||||
|
||||
f = (CBaseMonster)other;
|
||||
f = (NSMonster)other;
|
||||
|
||||
/* we already ARE on a sequence. */
|
||||
if (f.m_iSequenceState != SEQUENCESTATE_NONE)
|
||||
|
@ -325,19 +325,20 @@ scripted_sequence::SpawnKey(string strKey, string strValue)
|
|||
m_flSearchRadius = stof(strValue);
|
||||
break;
|
||||
case "m_flRepeat":
|
||||
/* TODO: */
|
||||
break;
|
||||
case "m_fMoveTo":
|
||||
m_iMove = stoi(strValue);
|
||||
break;
|
||||
default:
|
||||
CBaseTrigger::SpawnKey(strKey, strValue);
|
||||
super::SpawnKey(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
scripted_sequence::scripted_sequence(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSPointTrigger();
|
||||
}
|
||||
|
||||
CLASSEXPORT(aiscripted_sequence, scripted_sequence)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue