本文整理汇总了C++中InitTrigger函数的典型用法代码示例。如果您正苦于以下问题:C++ InitTrigger函数的具体用法?C++ InitTrigger怎么用?C++ InitTrigger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InitTrigger函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SP_trigger_push
/*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE START_OFF SILENT
Pushes the player
"speed" defaults to 1000
*/
void SP_trigger_push (edict_t *self)
{
InitTrigger (self);
windsound = gi.soundindex ("misc/windfly.wav");
self->touch = trigger_push_touch;
if (!self->speed)
self->speed = 1000;
if (self->targetname)
self->use = trigger_push_use;
gi.linkentity (self);
}
示例2: ai_trigger_activate
void ai_trigger_activate( gentity_t *self ) {
if ( self->r.linked ) {
return;
}
self->use = 0;
self->AIScript_AlertEntity = 0;
self->touch = AICast_Touch_Trigger;
InitTrigger( self );
trap_LinkEntity( self );
}
示例3: SP_trigger_heal
/*
===============
SP_trigger_heal
===============
*/
void SP_trigger_heal(gentity_t * self)
{
G_SpawnInt("heal", "5", &self->damage);
self->touch = trigger_heal_touch;
self->use = trigger_heal_use;
InitTrigger(self);
// link in to the world if starting active
if(!(self->spawnflags & 1))
trap_LinkEntity(self);
}
示例4: SP_trigger_concussive_dust
/*QUAKED trigger_concussive_dust (.5 .5 .5) ?
Allows client side prediction of teleportation events.
Must point at a target_position, which will be the teleport destination.
*/
void SP_trigger_concussive_dust(gentity_t * self)
{
InitTrigger(self);
// unlike other triggers, we need to send this one to the client
// self->r.svFlags &= ~SVF_NOCLIENT;
// self->r.svFlags |= SVF_BROADCAST;
self->s.eType = ET_CONCUSSIVE_TRIGGER;
self->touch = trigger_concussive_touch;
trap_LinkEntity(self);
}
示例5: SP_trigger_push
/*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE
Pushes the player
*/
void SP_trigger_push( )
{
if ( !CheckExistence( ) )
{
dremove( self );
return;
}
InitTrigger( );
trap_precache_sound( "ambience/windfly.wav" );
self->s.v.touch = ( func_t ) trigger_push_touch;
if ( !self->speed )
self->speed = 1000;
}
示例6: SP_trigger_push
/*QUAKED trigger_push (.5 .5 .5) ?
Must point at a target_position, which will be the apex of the leap.
This will be client side predicted, unlike target_push
*/
void SP_trigger_push( gentity_t *self )
{
InitTrigger( self );
// unlike other triggers, we need to send this one to the client
self->r.svFlags &= ~SVF_NOCLIENT;
self->s.eType = ET_PUSH_TRIGGER;
self->touch = trigger_push_touch;
self->think = AimAtTarget;
self->nextthink = level.time + FRAMETIME;
trap_LinkEntity( self );
}
示例7: SP_trigger_gravity
void SP_trigger_gravity (edict_t *self)
{
if (st.gravity == 0)
{
gi.dprintf(DEVELOPER_MSG_GAME, "trigger_gravity without gravity set at %s\n", vtos(self->s.origin));
G_FreeEdict (self);
return;
}
InitTrigger (self);
self->gravity = atoi(st.gravity);
self->touch = trigger_gravity_touch;
}
示例8: SP_trigger_monsterjump
void
SP_trigger_monsterjump (edict_t * self)
{
if (!self->speed)
self->speed = 200;
if (!st.height)
st.height = 200;
if (self->s.angles[YAW] == 0)
self->s.angles[YAW] = 360;
InitTrigger (self);
self->touch = trigger_monsterjump_touch;
self->movedir[2] = st.height;
}
示例9: SP_trigger_hurt
void SP_trigger_hurt( edict_t *self )
{
InitTrigger( self );
if( self->dmg > 300 ) // HACK: force KILL spawnflag for big damages
self->spawnflags |= 32;
if( self->spawnflags & 4 ) // SILENT
{
self->noise_index = 0;
}
else if( st.noise )
{
self->noise_index = trap_SoundIndex( st.noise );
G_PureSound( st.noise );
}
else if( self->spawnflags & 32 || self->spawnflags & 64 ) // KILL or FALL
{
self->noise_index = trap_SoundIndex( S_PLAYER_FALLDEATH );
}
else
{
self->noise_index = 0;
}
// gameteam field from editor
if( st.gameteam >= TEAM_SPECTATOR && st.gameteam < GS_MAX_TEAMS )
{
self->s.team = st.gameteam;
}
else
{
self->s.team = TEAM_SPECTATOR;
}
self->touch = hurt_touch;
if( !self->dmg )
self->dmg = 5;
if( self->spawnflags & 16 || !self->wait )
self->wait = 0.1f;
if( self->spawnflags & 1 )
self->r.solid = SOLID_NOT;
else
self->r.solid = SOLID_TRIGGER;
if( self->spawnflags & 2 )
self->use = hurt_use;
}
示例10: trigger_jumper
void trigger_jumper ( )
{
if ( CheckExistence ( ) == 0 )
{
dremove ( self);
return;
}
InitTrigger ( );
trap_precache_sound ( "misc/boing.wav");
self->s.v.touch = ( func_t ) trigger_jumper_touch;
if ( !self->speed )
self->speed = 1000;
}
示例11: SP_trigger_teleport
/*QUAKED trigger_teleport (.5 .5 .5) ?
Allows client side prediction of teleportation events.
Must point at a target_position, which will be the teleport destination.
*/
void SP_trigger_teleport( gentity_t *self ) {
InitTrigger (self);
// unlike other triggers, we need to send this one to the client
self->r.svFlags &= ~SVF_NOCLIENT;
// make sure the client precaches this sound
G_SoundIndex("sound/world/jumppad.wav");
self->s.eType = ET_TELEPORT_TRIGGER;
self->touch = trigger_teleporter_touch;
trap_LinkEntity (self);
}
示例12: target
/*QUAKED trigger_deathCheck (.5 .5 .5) ? - GIBFLAG
GIBFLAG entity will never fire its target(s) if aiName entity was gibbed
aiName entity making alertentity call
this entity will test if aiName is in its volume
Must be targeted at one or more entities.
Once triggered, this entity is destroyed
*/
void SP_trigger_deathCheck( gentity_t *ent ) {
VectorCopy( ent->s.angles, ent->s.angles2 );
if ( !( ent->aiName ) ) {
G_Error( "trigger_once_enabledeath does not have an aiName \n" );
}
ent->wait = -1; // this will remove itself after one use
ent->AIScript_AlertEntity = Enable_Trigger_Touch;
ent->use = Use_Multi;
InitTrigger( ent );
trap_LinkEntity( ent );
}
示例13: InitTrigger
void CBuyZone::Spawn()
{
InitTrigger();
SetTouch( &CBuyZone::BuyZoneTouch );
// Support for legacy-style teamnums.
if ( m_LegacyTeamNum == 1 )
{
ChangeTeam( TEAM_TERRORIST );
}
else if ( m_LegacyTeamNum == 2 )
{
ChangeTeam( TEAM_CT );
}
}
示例14: and
/*QUAKED trigger_multiple (.5 .5 .5) ?
"wait" : Seconds between triggerings, 0.5 default, -1 = one time only.
"random" wait variance, default is 0
Variable sized repeatable trigger. Must be targeted at one or more entities.
so, the basic time between firing is a random time between
(wait - random) and (wait + random)
*/
void SP_trigger_multiple( gentity_t *ent ) {
G_SpawnFloat( "wait", "0.5", &ent->wait );
G_SpawnFloat( "random", "0", &ent->random );
if ( ent->random >= ent->wait && ent->wait >= 0 ) {
ent->random = ent->wait - FRAMETIME;
G_Printf( "trigger_multiple has random >= wait\n" );
}
ent->touch = Touch_Multi;
ent->use = Use_Multi;
InitTrigger( ent );
trap_LinkEntity (ent);
}
示例15: SP_trigger_ammo
/*
===============
SP_trigger_ammo
===============
*/
void SP_trigger_ammo( gentity_t *self )
{
G_SpawnInt( "ammo", "1", &self->damage );
if( self->damage <= 0 )
{
self->damage = 1;
G_Printf( S_COLOR_YELLOW "WARNING: trigger_ammo with negative ammo key\n" );
}
self->touch = trigger_ammo_touch;
InitTrigger( self );
trap_LinkEntity( self );
}