#pragma once
-entityclass(BGMScript);
-classfield(BGMScript) .string bgmscript;
-classfield(BGMScript) .float bgmscriptattack;
-classfield(BGMScript) .float bgmscriptdecay;
-classfield(BGMScript) .float bgmscriptsustain;
-classfield(BGMScript) .float bgmscriptrelease;
+#include <common/mapobjects/bgmscript.qh>
classfield(BGMScript) .float just_toggled;
-#ifdef CSQC
void BGMScript_InitEntity(entity e);
float doBGMScript(entity e);
-#endif
// generated file; do not modify
+#include <common/mapobjects/bgmscript.qc>
#include <common/mapobjects/models.qc>
#include <common/mapobjects/platforms.qc>
#include <common/mapobjects/subs.qc>
// generated file; do not modify
+#include <common/mapobjects/bgmscript.qh>
#include <common/mapobjects/models.qh>
#include <common/mapobjects/platforms.qh>
#include <common/mapobjects/subs.qh>
--- /dev/null
+#include "bgmscript.qh"
--- /dev/null
+#pragma once
+
+entityclass(BGMScript);
+classfield(BGMScript) .string bgmscript;
+classfield(BGMScript) .float bgmscriptattack;
+classfield(BGMScript) .float bgmscriptdecay;
+classfield(BGMScript) .float bgmscriptsustain;
+classfield(BGMScript) .float bgmscriptrelease;
REGISTER_NET_LINKED(ENT_CLIENT_LASER)
#ifdef SVQC
-.float modelscale;
void misc_laser_aim(entity this)
{
vector a;
}
#elif defined(CSQC)
-// a laser goes from origin in direction angles
-// it has color 'beam_color'
-// and stops when something is in the way
-entityclass(Laser);
-classfield(Laser) .int cnt; // end effect
-classfield(Laser) .vector colormod;
-classfield(Laser) .int state; // on-off
-classfield(Laser) .int count; // flags for the laser
-classfield(Laser) .vector velocity; // laser endpoint if it is FINITE
-classfield(Laser) .float alpha;
-classfield(Laser) .float scale; // scaling factor of the thickness
-classfield(Laser) .float modelscale; // scaling factor of the dlight
-
void Draw_Laser(entity this)
{
if(this.active == ACTIVE_NOT)
#pragma once
+// a laser goes from origin in direction angles
+// it has color 'beam_color'
+// and stops when something is in the way
+entityclass(Laser);
+classfield(Laser) .int cnt; // end effect
+classfield(Laser) .vector colormod;
+classfield(Laser) .int state; // on-off
+classfield(Laser) .int count; // flags for the laser
+classfield(Laser) .vector velocity; // laser endpoint if it is FINITE
+classfield(Laser) .float alpha;
+classfield(Laser) .float scale; // scaling factor of the thickness
+classfield(Laser) .float modelscale; // scaling factor of the dlight
const int LASER_FINITE = BIT(1);
const int LASER_NOTRACE = BIT(2);
#include <common/net_linked.qh>
#include "subs.qh"
#include "triggers.qh"
-
-entityclass(BGMScript);
-classfield(BGMScript) .string bgmscript;
-classfield(BGMScript) .float bgmscriptattack;
-classfield(BGMScript) .float bgmscriptdecay;
-classfield(BGMScript) .float bgmscriptsustain;
-classfield(BGMScript) .float bgmscriptrelease;
+#include "bgmscript.qh"
#include <common/constants.qh>
-#include "../../lib/csqcmodel/sv_model.qh"
-
-.float modelscale;
+#include <lib/csqcmodel/sv_model.qh>
void g_model_setcolormaptoactivator(entity this, entity actor, entity trigger)
{
#pragma once
+.float modelscale;
+
#ifdef CSQC
entityclass(Wall);
classfield(Wall) .float lip;
#include "counter.qh"
-#ifdef SVQC
-void counter_reset(entity this);
+#ifdef SVQC
void counter_use(entity this, entity actor, entity trigger)
{
+ if(this.active != ACTIVE_ACTIVE)
+ return;
+
entity store = this;
if(this.spawnflags & COUNTER_PER_PLAYER)
{
setthink(this, func_null);
this.nextthink = 0;
this.counter_cnt = 0;
+ this.active = ACTIVE_ACTIVE;
}
/*QUAKED spawnfunc_trigger_counter (.5 .5 .5) ? nomessage COUNTER_FIRE_AT_COUNT
this.counter_cnt = 0;
this.use = counter_use;
this.reset = counter_reset;
+ this.active = ACTIVE_ACTIVE;
}
#endif
#pragma once
#ifdef SVQC
-spawnfunc(trigger_counter);
+void counter_reset(entity this);
.float counter_cnt;
#include "delay.qh"
+
#ifdef SVQC
void delay_delayeduse(entity this)
{
void delay_use(entity this, entity actor, entity trigger)
{
+ if(this.active != ACTIVE_ACTIVE)
+ return;
+
this.enemy = actor;
this.goalentity = trigger;
setthink(this, delay_delayeduse);
this.enemy = this.goalentity = NULL;
setthink(this, func_null);
this.nextthink = 0;
+ this.active = ACTIVE_ACTIVE;
}
spawnfunc(trigger_delay)
this.use = delay_use;
this.reset = delay_reset;
+ this.active = ACTIVE_ACTIVE;
}
#endif
#include "gamestart.qh"
+
#ifdef SVQC
void gamestart_use(entity this, entity actor, entity trigger)
{
SUB_UseTargets(this, this, trigger);
- delete(this);
-}
-
-void gamestart_use_this(entity this)
-{
- gamestart_use(this, NULL, NULL);
+ delete(this); // TODO: deleting this means it can't be used upon map reset!
}
spawnfunc(trigger_gamestart)
this.nextthink = game_starttime + this.wait;
}
else
- InitializeEntity(this, gamestart_use_this, INITPRIO_FINDTARGET);
+ InitializeEntity(this, adaptor_think2use, INITPRIO_FINDTARGET);
}
-
#endif
trigger_keylock_link(this);
}
#elif defined(CSQC)
-void keylock_remove(entity this)
-{
- strfree(this.target);
- strfree(this.target2);
- strfree(this.target3);
- strfree(this.target4);
- strfree(this.killtarget);
- strfree(this.targetname);
-}
-
NET_HANDLE(ENT_CLIENT_KEYLOCK, bool isnew)
{
this.itemkeys = ReadInt24_t();
return = true;
this.classname = "trigger_keylock";
- this.entremove = keylock_remove;
+ this.entremove = trigger_remove_generic;
}
#endif