29 #include "../idlib/precompiled.h"
58 idVec3 up = axis[ 2 ] * 5.0f;
68 viewTextBounds.ExpandSelf( 128.0
f );
69 viewBounds.ExpandSelf( 512.0
f );
75 target = ent->
targets[
i ].GetEntity();
91 if ( ent->
IsType( idTrigger::Type ) ) {
92 func =
static_cast<idTrigger *
>( ent )->GetScriptFunction();
103 target = ent->
targets[
i ].GetEntity();
181 if ( funcname.
Length() ) {
227 if ( funcname.
Length() ) {
269 triggerFirst =
false;
270 triggerWithSelf =
false;
374 if ( !activator->
IsType( idPlayer::Type ) ) {
474 bool player = other->
IsType( idPlayer::Type );
479 if ( static_cast< idPlayer * >( other )->spectating ) {
539 triggerFirst =
false;
817 if (
wait >= 0.0
f ) {
1009 if ( !other->
IsType( idPlayer::Type ) ) {
1068 fadeColor = spawnArgs.GetVec4(
"fadeColor",
"0, 0, 0, 1" );
1069 fadeTime =
SEC2MS( spawnArgs.GetFloat(
"fadeTime",
"0.5" ) );
1138 int numClipModels,
i;
1149 for ( i = 0; i < numClipModels; i++ ) {
1150 cm = clipModelList[
i ];
1231 idTrigger_Flag::idTrigger_Flag(
void ) {
1237 void idTrigger_Flag::Spawn(
void ) {
1238 team = spawnArgs.GetInt(
"team",
"0" );
1239 player = spawnArgs.GetBool(
"player",
"0" );
1241 idStr funcname = spawnArgs.GetString(
"eventflag",
"" );
1242 if ( funcname.
Length() ) {
1244 if ( eventFlag ==
NULL ) {
1245 gameLocal.
Warning(
"trigger '%s' at (%s) event unknown '%s'",
name.c_str(), GetPhysics()->GetOrigin().ToString(0), funcname.
c_str() );
1256 bool bTrigger =
false;
1257 idItemTeam * flag =
NULL;
1260 if ( !other->
IsType( idPlayer::Type ) )
1264 if ( player->carryingFlag ==
false )
1267 if ( team != -1 && ( player->
team != team || (player->
team != 0 && player->
team != 1)) )
1270 idItemTeam * flags[2];
1275 int iFriend = 1 - player->
team;
1276 int iOpp = player->
team;
1281 if ( flags[iFriend]->carried && !flags[iFriend]->dropped &&
1282 !flags[iOpp]->carried && !flags[iOpp]->dropped )
1283 flag = flags[iFriend];
1287 if ( !other->
IsType( idItemTeam::Type ) )
1290 idItemTeam * item =
static_cast<idItemTeam *
>( other );
1292 if ( item->team == team || team == -1 ) {
1300 switch ( eventFlag->GetNumArgs() ) {
1303 flag->PostEventMS( eventFlag, 0 );
1306 flag->PostEventMS( eventFlag, 0, 0 );
1309 flag->PostEventMS( eventFlag, 0, 0, 0 );
virtual const idVec3 & GetOrigin(int id=0) const =0
const idEventDef EV_ActivateTargets("activateTargets","e")
idPlayer * GetLocalPlayer() const
int ClipModelsTouchingBounds(const idBounds &bounds, int contentMask, idClipModel **clipModelList, int maxCount) const
idEntity * GetEntity(void) const
virtual void EnableClip(void)=0
float GetFloat(const char *key, const char *defaultString="0") const
void Event_Trigger(idEntity *activator)
void WriteString(const char *string)
int GetInt(const char *key, const char *defaultString="0") const
bool PostEventSec(const idEventDef *ev, float time)
virtual void SetContents(int contents, int id=-1)=0
void CallFunction(const function_t *func, bool clearStack)
virtual void DebugArrow(const idVec4 &color, const idVec3 &start, const idVec3 &end, int size, const int lifetime=0)=0
idVec3 GetCenter(void) const
void Save(idSaveGame *savefile) const
void Event_Trigger(idEntity *activator)
void DelayedStart(int delay)
void Event_Trigger(idEntity *activator)
void Event_Touch(idEntity *other, trace_t *trace)
const idEventDef EV_Activate("activate","e")
void Event_Touch(idEntity *other, trace_t *trace)
void Restore(idRestoreGame *savefile)
void Save(idSaveGame *savefile) const
void void void void void Error(const char *fmt,...) const id_attribute((format(printf
bool IsType(const idTypeInfo &c) const
const idMat3 & GetAxis(void) const
void Restore(idRestoreGame *savefile)
idList< idEntityPtr< idEntity > > targets
void CallScript(void) const
virtual void Disable(void)
void ReadBool(bool &value)
void Event_Touch(idEntity *other, trace_t *trace)
void Event_TriggerAction(idEntity *activator)
const idVec3 & GetOrigin(void) const
void TriggerAction(idEntity *activator)
void WriteClipModel(const class idClipModel *clipModel)
const char * Name(void) const
int Icmp(const char *text) const
#define EVENT(event, function)
void WriteBool(const bool value)
void void void Warning(const char *fmt,...) const id_attribute((format(printf
class idPlayerView playerView
void Event_Use(idEntity *activator)
GLuint GLuint GLsizei count
static const idEventDef * FindEvent(const char *name)
void Event_Toggle(idEntity *activator)
idPhysics * GetPhysics(void) const
const char * GetString(const char *key, const char *defaultString="") const
void ReadFloat(float &value)
idVec3 ToForward(void) const
void Save(idSaveGame *savefile) const
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
void WriteFloat(const float value)
const idEventDef EV_TriggerAction("<triggerAction>","e")
void Restore(idRestoreGame *savefile)
cmHandle_t Handle(void) const
bool GetBool(const char *key, const char *defaultString="0") const
void Event_Trigger(idEntity *activator)
virtual void Enable(void)
const idBounds & GetBounds(void) const
void Save(idSaveGame *savefile) const
void Save(idSaveGame *savefile) const
void CancelEvents(const idEventDef *ev)
bool IsTraceModel(void) const
void Save(idSaveGame *savefile) const
virtual const idMat3 & GetAxis(int id=0) const =0
virtual void Enable(void)
virtual void DrawText(const char *text, const idVec3 &origin, float scale, const idVec4 &color, const idMat3 &viewAxis, const int align=1, const int lifetime=0, bool depthTest=false)=0
void FromTransformedBounds(const idBounds &bounds, const idVec3 &origin, const idMat3 &axis)
idLinkList< idEntity > spawnNode
bool CheckFacing(idEntity *activator)
const function_t * scriptFunction
virtual void Damage(idEntity *inflictor, idEntity *attacker, const idVec3 &dir, const char *damageDefName, const float damageScale, const int location)
idLinkList< idEntity > spawnedEntities
void TriggerAction(idEntity *activator)
virtual void DisableClip(void)=0
const char * ToString(int precision=2) const
void WriteInt(const int value)
void ReadClipModel(idClipModel *&clipModel)
void Fade(idVec4 color, int time)
const idEventDef EV_Timer("<timer>", NULL)
void Restore(idRestoreGame *savefile)
const idEventDef EV_Enable("enable", NULL)
const function_t * GetScriptFunction(void) const
idMat3 ToMat3(void) const
virtual const idBounds & GetAbsBounds(int id=-1) const =0
int ContentsModel(const idVec3 &start, const idClipModel *mdl, const idMat3 &trmAxis, int contentMask, cmHandle_t model, const idVec3 &modelOrigin, const idMat3 &modelAxis)
#define CLASS_DECLARATION(nameofsuperclass, nameofclass)
const char * GetName(void) const
virtual void SetClipModel(idClipModel *model, float density, int id=0, bool freeOld=true)=0
void Restore(idRestoreGame *savefile)
const char * c_str(void) const
bool RequirementMet(idEntity *activator, const idStr &requires, int removeItem)
void BecomeActive(int flags)
void Event_TriggerAction(idEntity *activator)
const idEventDef EV_Remove("<immediateremove>", NULL)
virtual int GetContents(int id=-1) const =0
function_t * FindFunction(const char *name) const
float dot(float a[], float b[])
virtual void DebugBounds(const idVec4 &color, const idBounds &bounds, const idVec3 &org=vec3_origin, const int lifetime=0)=0
const char * GetEntityDefName(void) const
virtual void Disable(void)
idRenderWorld * gameRenderWorld
char * va(const char *fmt,...)
static float ACos(float a)
bool PostEventMS(const idEventDef *ev, int time)
void Restore(idRestoreGame *savefile)
const idEventDef EV_Touch("<touch>","et")
virtual void Enable(void)
void ReadString(idStr &string)
void Restore(idRestoreGame *savefile)
void Event_TriggerAction(idEntity *activator)
void BecomeInactive(int flags)
const idEventDef EV_Disable("disable", NULL)
void ActivateTargets(idEntity *activator) const
void Save(idSaveGame *savefile)
virtual void Disable(void)