本文整理汇总了C++中InitTrigger函数的典型用法代码示例。如果您正苦于以下问题:C++ InitTrigger函数的具体用法?C++ InitTrigger怎么用?C++ InitTrigger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InitTrigger函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:alexey-lysiuk,项目名称:quake2,代码行数:17,代码来源:g_trigger.c
示例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 );
}
开发者ID:MAN-AT-ARMS,项目名称:iortcw-archive,代码行数:13,代码来源:ai_cast_script_ents.c
示例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);
}
开发者ID:redrumrobot,项目名称:dretchstorm,代码行数:18,代码来源:g_trigger.c
示例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);
}
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:17,代码来源:g_trigger.c
示例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;
}
开发者ID:stayoutEE,项目名称:TF2003-qvm,代码行数:16,代码来源:triggers.c
示例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 );
}
开发者ID:redrumrobot,项目名称:trem-gpp-bots,代码行数:17,代码来源:g_trigger.c
示例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;
}
开发者ID:basecq,项目名称:q2dos,代码行数:13,代码来源:g_trigger.c
示例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;
}
开发者ID:DusteDdk,项目名称:aq2-tng-bk,代码行数:13,代码来源:g_trigger.c
示例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;
}
开发者ID:codetwister,项目名称:qfusion,代码行数:51,代码来源:g_trigger.cpp
示例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;
}
开发者ID:nacitar,项目名称:QHome,代码行数:14,代码来源:map_ents.c
示例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);
}
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:18,代码来源:g_trigger.c
示例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 );
}
开发者ID:MAN-AT-ARMS,项目名称:iortcw-archive,代码行数:24,代码来源:g_trigger.c
示例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 );
}
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:15,代码来源:func_buy_zone.cpp
示例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);
}
开发者ID:meveric,项目名称:WoP-Pandora,代码行数:22,代码来源:g_trigger.c
示例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 );
}
开发者ID:redrumrobot,项目名称:trem-gpp-bots,代码行数:20,代码来源:g_trigger.c
示例16: SP_trigger_teleport
/*QUAKED trigger_teleport (.1 .5 .1) ? SNAP_ANGLES NO_MISSILES NO_NPCS STASIS DEAD_OK x x INACTIVE
Allows client side prediction of teleportation events.
Must point at a target_position, which will be the teleport destination.
SNAP_ANGLES - Make the entity that passes through snap to the target_position's angles
NO_MISSILES - Missiles and thrown objects cannot pass through
NO_NPCS - NPCs cannot pass through
STASIS - will play stasis teleport sound and fx instead of starfleet
DEAD_OK - even if dead, you will teleport
*/
void SP_trigger_teleport( gentity_t *self )
{
InitTrigger (self);
// unlike other triggers, we need to send this one to the client
self->svFlags &= ~SVF_NOCLIENT;
self->s.eType = ET_TELEPORT_TRIGGER;
self->e_TouchFunc = touchF_trigger_teleporter_touch;
self->e_ThinkFunc = thinkF_trigger_teleporter_find_closest_portal;
self->nextthink = level.time + START_TIME_LINK_ENTS;
gi.linkentity (self);
}
开发者ID:AlexXT,项目名称:OpenJK,代码行数:25,代码来源:g_trigger.cpp
示例17: SP_trigger_monsterjump
/*QUAKED trigger_monsterjump (.5 .5 .5) ?
Walking monsters that touch this will jump in the direction of the trigger's angle
"speed" default to 200, the speed thrown forward
"height" default to 200, the speed thrown upwards
*/
void SP_trigger_monsterjump()
{
if ( !self->speed )
self->speed = 200;
if ( !self->height )
self->height = 200;
if ( self->s.v.angles[0] == 0 && self->s.v.angles[1] == 0
&& self->s.v.angles[2] == 0 )
SetVector( self->s.v.angles, 0, 360, 0 );
InitTrigger();
self->s.v.touch = ( func_t ) trigger_monsterjump_touch;
}
开发者ID:angeld29,项目名称:qwprogs-qvm,代码行数:20,代码来源:triggers.c
示例18: 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;
// make sure the client precaches this sound
G_SoundIndex("sounds/world/jumppad");
self->s.eType = ET_PUSH_TRIGGER;
self->touch = trigger_push_touch;
self->think = AimAtTarget;
self->nextthink = level.time + FRAMETIME;
trap_LinkEntity (self);
}
开发者ID:meveric,项目名称:WoP-Pandora,代码行数:19,代码来源:g_trigger.c
示例19: SP_trigger_flagonly
void SP_trigger_flagonly( gentity_t *ent ) {
char *scorestring; // JPW NERVE
ent->touch = Touch_flagonly;
InitTrigger( ent );
// JPW NERVE -- if this trigger has a "score" field set, then completing an objective
// inside of this field will add "score" to the right player team. storing this
// in ent->accuracy since that's unused.
G_SpawnString( "score", "20", &scorestring );
ent->accuracy = atof( scorestring );
// jpw
trap_LinkEntity( ent );
}
开发者ID:MAN-AT-ARMS,项目名称:iortcw-archive,代码行数:15,代码来源:g_trigger.c
示例20: InitTrigger
void CTriggerPush::Spawn()
{
if( pev->angles == g_vecZero )
pev->angles.y = 360;
InitTrigger();
if( pev->speed == 0 )
pev->speed = 100;
if( FBitSet( pev->spawnflags, SF_TRIGGER_PUSH_START_OFF ) )// if flagged to Start Turned Off, make trigger nonsolid.
pev->solid = SOLID_NOT;
SetUse( &CTriggerPush::ToggleUse );
UTIL_SetOrigin( pev, pev->origin ); // Link into the list
}
开发者ID:CryoKeen,项目名称:HLEnhanced,代码行数:16,代码来源:CTriggerPush.cpp
注:本文中的InitTrigger函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论