本文整理汇总了C++中BG_FindItemForWeapon函数的典型用法代码示例。如果您正苦于以下问题:C++ BG_FindItemForWeapon函数的具体用法?C++ BG_FindItemForWeapon怎么用?C++ BG_FindItemForWeapon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BG_FindItemForWeapon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NPC_Mark1_Precache
/*
-------------------------
NPC_Mark1_Precache
-------------------------
*/
void NPC_Mark1_Precache(void)
{
G_SoundIndex( "sound/chars/mark1/misc/mark1_wakeup");
G_SoundIndex( "sound/chars/mark1/misc/shutdown");
G_SoundIndex( "sound/chars/mark1/misc/walk");
G_SoundIndex( "sound/chars/mark1/misc/run");
G_SoundIndex( "sound/chars/mark1/misc/death1");
G_SoundIndex( "sound/chars/mark1/misc/death2");
G_SoundIndex( "sound/chars/mark1/misc/anger");
G_SoundIndex( "sound/chars/mark1/misc/mark1_fire");
G_SoundIndex( "sound/chars/mark1/misc/mark1_pain");
G_SoundIndex( "sound/chars/mark1/misc/mark1_explo");
// G_EffectIndex( "small_chunks");
G_EffectIndex( "env/med_explode2");
G_EffectIndex( "explosions/probeexplosion1");
G_EffectIndex( "blaster/smoke_bolton");
G_EffectIndex( "bryar/muzzle_flash");
G_EffectIndex( "explosions/droidexplosion1" );
RegisterItem( BG_FindItemForAmmo( AMMO_METAL_BOLTS));
RegisterItem( BG_FindItemForAmmo( AMMO_BLASTER ));
RegisterItem( BG_FindItemForWeapon( WP_BOWCASTER ));
RegisterItem( BG_FindItemForWeapon( WP_BRYAR_PISTOL ));
}
示例2: ClearRegisteredItems
/*
==============
ClearRegisteredItems
==============
*/
void ClearRegisteredItems( void ) {
memset( itemRegistered, 0, sizeof( itemRegistered ) );
// players always start with the base weapon
RegisterItem( BG_FindItemForWeapon( WP_PISTOL ) );
RegisterItem( BG_FindItemForWeapon( WP_GAUNTLET ) );
RegisterItem( BG_FindItem("Bag 'O Money" ) );
RegisterItem( BG_FindItem("Hidden Stash" ) );
}
示例3: ClearRegisteredItems
/*
==============
ClearRegisteredItems
==============
*/
void ClearRegisteredItems(void)
{
memset(itemRegistered, 0, sizeof(itemRegistered));
// players always start with the base weapon
//Blaze: Changed WP_MACHINEGUN to WP_PISTOL and WP_GAUNTLET to WP_KNIFE
RegisterItem(BG_FindItemForWeapon(WP_PISTOL));
RegisterItem(BG_FindItemForWeapon(WP_KNIFE));
//Elder: add unique items here
RegisterItem(BG_FindItemForHoldable(HI_KEVLAR));
RegisterItem(BG_FindItemForHoldable(HI_SLIPPERS));
RegisterItem(BG_FindItemForHoldable(HI_SILENCER));
RegisterItem(BG_FindItemForHoldable(HI_BANDOLIER));
RegisterItem(BG_FindItemForHoldable(HI_LASER));
// JBravo: adding the helmet
if (g_RQ3_haveHelmet.integer)
RegisterItem(BG_FindItemForHoldable(HI_HELMET));
//Makro - all weapons should be loaded in teamplay
//JBravo: and CTF
if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF || g_gametype.integer == GT_TEAM) {
RegisterItem(BG_FindItemForWeapon(WP_M3));
RegisterItem(BG_FindItemForWeapon(WP_MP5));
RegisterItem(BG_FindItemForWeapon(WP_HANDCANNON));
RegisterItem(BG_FindItemForWeapon(WP_SSG3000));
RegisterItem(BG_FindItemForWeapon(WP_M4));
RegisterItem(BG_FindItemForWeapon(WP_AKIMBO));
RegisterItem(BG_FindItemForWeapon(WP_GRENADE));
}
}
示例4: ClearRegisteredItems
/*
==============
ClearRegisteredItems
==============
*/
void ClearRegisteredItems( void ) {
memset( itemRegistered, 0, sizeof( itemRegistered ) );
// !TODO: Have map determine the base weapons:
// players always start with the base weapon
RegisterItem( BG_FindItemForWeapon( WP_MACHINEGUN ) );
RegisterItem( BG_FindItemForWeapon( WP_GAUNTLET ) );
if( g_gametype.integer == GT_HARVESTER ) {
RegisterItem( BG_FindItem( "Red Cube" ) );
RegisterItem( BG_FindItem( "Blue Cube" ) );
}
}
示例5: ClearRegisteredItems
/*
==============
ClearRegisteredItems
==============
*/
void ClearRegisteredItems( void ) {
memset( itemRegistered, 0, sizeof( itemRegistered ) );
// players always start with the base weapon
RegisterItem( BG_FindItemForWeapon( WP_NIPPER ) );
RegisterItem( BG_FindItemForWeapon( WP_PUNCHY ) );
RegisterItem( BG_FindItemForWeapon( WP_KILLERDUCKS ) );
if ( IsSyc() ) {
RegisterItem( BG_FindItemForWeapon( WP_SPRAYPISTOL ) );
}
}
示例6: ClearRegisteredItems
/*
==============
ClearRegisteredItems
==============
*/
void ClearRegisteredItems( void ) {
memset( itemRegistered, 0, sizeof( itemRegistered ) );
// players always start with the base weapon
RegisterItem( BG_FindItemForWeapon( WP_MACHINEGUN ) );
RegisterItem( BG_FindItemForWeapon( WP_GAUNTLET ) );
#ifdef MISSIONPACK
if( g_gametype.integer == GT_HARVESTER ) {
RegisterItem( BG_FindItem( "Red Cube" ) );
RegisterItem( BG_FindItem( "Blue Cube" ) );
}
#endif
}
示例7: NPC_ATST_Precache
void NPC_ATST_Precache( void ) {
G_SoundIndex( "sound/chars/atst/atst_damaged1" );
G_SoundIndex( "sound/chars/atst/atst_damaged2" );
// RegisterItem( BG_FindItemForWeapon( WP_ATST_MAIN )); //precache the weapon
//rwwFIXMEFIXME: add this weapon
RegisterItem( BG_FindItemForWeapon( WP_BOWCASTER ) ); //precache the weapon
RegisterItem( BG_FindItemForWeapon( WP_ROCKET_LAUNCHER ) ); //precache the weapon
G_EffectIndex( "env/med_explode2" );
// G_EffectIndex( "smaller_chunks" );
G_EffectIndex( "blaster/smoke_bolton" );
G_EffectIndex( "explosions/droidexplosion1" );
}
示例8: RegisterAssets
static void RegisterAssets( Vehicle_t *pVeh ) {
//atst uses turret weapon
RegisterItem( BG_FindItemForWeapon( WP_TURRET ) );
//call the standard RegisterAssets now
g_vehicleInfo[VEHICLE_BASE].RegisterAssets( pVeh );
}
示例9: ClearRegisteredItems
void ClearRegisteredItems( void ) {
memset( itemRegistered, 0, sizeof( itemRegistered ) );
// players always start with the base weapon
//RAZMARK: Adding new weapons
RegisterItem( BG_FindItemForWeapon( WP_QUANTIZER ) );
}
示例10: TossClientItems
/*
=================
TossClientItems
Toss the weapon and powerups for the killed player
=================
*/
void TossClientItems( gentity_t *self ) {
gitem_t *item;
int weapon;
float angle;
int i;
gentity_t *drop;
// drop the weapon if not a gauntlet or machinegun
weapon = self->s.weapon;
//Never drop in elimination or last man standing mode!
if( g_gametype.integer == GT_ELIMINATION || g_gametype.integer == GT_LMS)
return;
// make a special check to see if they are changing to a new
// weapon that isn't the mg or gauntlet. Without this, a client
// can pick up a weapon, be killed, and not drop the weapon because
// their weapon change hasn't completed yet and they are still holding the MG.
if ( weapon == WP_MACHINEGUN || weapon == WP_GRAPPLING_HOOK ) {
if ( self->client->ps.weaponstate == WEAPON_DROPPING ) {
weapon = self->client->pers.cmd.weapon;
}
if ( !( self->client->ps.stats[STAT_WEAPONS] & ( 1 << weapon ) ) ) {
weapon = WP_NONE;
}
}
if (g_instantgib.integer || g_rockets.integer || g_gametype.integer == GT_CTF_ELIMINATION || g_elimination_allgametypes.integer){
//Nothing!
}
else
if ( weapon > WP_MACHINEGUN && weapon != WP_GRAPPLING_HOOK &&
self->client->ps.ammo[ weapon ] ) {
// find the item type for this weapon
item = BG_FindItemForWeapon( weapon );
// spawn the item
Drop_Item( self, item, 0 );
}
// drop all the powerups if not in teamplay
if ( g_gametype.integer != GT_TEAM ) {
angle = 45;
for ( i = 1 ; i < PW_NUM_POWERUPS ; i++ ) {
if ( self->client->ps.powerups[ i ] > level.time ) {
item = BG_FindItemForPowerup( i );
if ( !item ) {
continue;
}
drop = Drop_Item( self, item, angle );
// decide how many seconds it has left
drop->count = ( self->client->ps.powerups[ i ] - level.time ) / 1000;
if ( drop->count < 1 ) {
drop->count = 1;
}
angle += 45;
}
}
}
}
示例11: G_SiegeRegisterWeaponsAndHoldables
//go through all classes on a team and register their
//weapons and items for precaching.
void G_SiegeRegisterWeaponsAndHoldables( int team ) {
siegeTeam_t *stm = BG_SiegeFindThemeForTeam( team );
if ( stm ) {
int i = 0;
siegeClass_t *scl;
while ( i < stm->numClasses ) {
scl = stm->classes[i];
if ( scl ) {
int j = 0;
while ( j < WP_NUM_WEAPONS ) {
if ( scl->weapons & (1 << j) ) { //we use this weapon so register it.
RegisterItem( BG_FindItemForWeapon( j ) );
}
j++;
}
j = 0;
while ( j < HI_NUM_HOLDABLE ) {
if ( scl->invenItems & (1 << j) ) { //we use this item so register it.
RegisterItem( BG_FindItemForHoldable( j ) );
}
j++;
}
}
i++;
}
}
}
示例12: RegisterAssets
static void RegisterAssets( Vehicle_t *pVeh )
{
//atst uses turret weapon
#ifdef _JK2MP
RegisterItem(BG_FindItemForWeapon(WP_TURRET));
#else
// PUT SOMETHING HERE...
#endif
//call the standard RegisterAssets now
g_vehicleInfo[VEHICLE_BASE].RegisterAssets( pVeh );
}
示例13: TossPlayerItems
/*
=================
TossPlayerItems
Toss the weapon and powerups for the killed player
=================
*/
void TossPlayerItems( gentity_t *self ) {
gitem_t *item;
int weapon;
float angle;
int i;
gentity_t *drop;
// drop the weapon if not a gauntlet or machinegun
weapon = self->s.weapon;
// make a special check to see if they are changing to a new
// weapon that isn't the mg or gauntlet. Without this, a player
// can pick up a weapon, be killed, and not drop the weapon because
// their weapon change hasn't completed yet and they are still holding the MG.
if ( weapon == WP_MACHINEGUN || weapon == WP_GRAPPLING_HOOK ) {
if ( self->player->ps.weaponstate == WEAPON_DROPPING ) {
BG_DecomposeUserCmdValue( self->player->pers.cmd.stateValue, &weapon );
}
if ( !( self->player->ps.stats[STAT_WEAPONS] & ( 1 << weapon ) ) ) {
weapon = WP_NONE;
}
}
if ( weapon > WP_MACHINEGUN && weapon != WP_GRAPPLING_HOOK &&
self->player->ps.ammo[ weapon ] ) {
// find the item type for this weapon
item = BG_FindItemForWeapon( weapon );
// spawn the item
Drop_Item( self, item, 0 );
}
// drop all the powerups if not in teamplay
if ( g_gametype.integer != GT_TEAM ) {
angle = 45;
for ( i = 1 ; i < PW_NUM_POWERUPS ; i++ ) {
if ( self->player->ps.powerups[ i ] > level.time ) {
item = BG_FindItemForPowerup( i );
if ( !item ) {
continue;
}
drop = Drop_Item( self, item, angle );
// decide how many seconds it has left
drop->count = ( self->player->ps.powerups[ i ] - level.time ) / 1000;
if ( drop->count < 1 ) {
drop->count = 1;
}
angle += 45;
}
}
}
}
示例14: NPC_Mark2_Precache
void NPC_Mark2_Precache( void ) {
G_SoundIndex( "sound/chars/mark2/misc/mark2_explo" );// blows up on death
G_SoundIndex( "sound/chars/mark2/misc/mark2_pain" );
G_SoundIndex( "sound/chars/mark2/misc/mark2_fire" );
G_SoundIndex( "sound/chars/mark2/misc/mark2_move_lp" );
G_EffectIndex( "explosions/droidexplosion1" );
G_EffectIndex( "env/med_explode2" );
G_EffectIndex( "blaster/smoke_bolton" );
G_EffectIndex( "bryar/muzzle_flash" );
RegisterItem( BG_FindItemForWeapon( WP_BRYAR_PISTOL ) );
RegisterItem( BG_FindItemForAmmo( AMMO_METAL_BOLTS ) );
RegisterItem( BG_FindItemForAmmo( AMMO_POWERCELL ) );
RegisterItem( BG_FindItemForAmmo( AMMO_BLASTER ) );
}
示例15: G_Suck
void G_Suck( gentity_t *self ) {
int wait = self->wait;
// if in water disable burning
if (!Q_stricmp(self->classname, "grenadeend")){
gitem_t *item;
item = BG_FindItemForWeapon( WP_DYNAMITE );
self->s.apos.trDelta[0] = 0;
self->s.modelindex = item- bg_itemlist;
self->s.modelindex2 = 1;
self->item = item;
self->s.eType = ET_ITEM;
self->r.contents = CONTENTS_TRIGGER2;
self->wait = -1;
self->flags |= FL_THROWN_ITEM;
self->touch = Touch_Item;
self->classname = "grenadesit";
self->think = G_KnifeThink;
self->nextthink = level.time + 100;
self->wait = level.time + 60000;
self->r.currentAngles[1] = rand() % 360;
self->r.currentAngles[PITCH] = 90;
VectorCopy(self->r.currentAngles, self->s.apos.trBase);
return;
}
if(self->s.pos.trType == TR_STATIONARY){
// just to be sure KnifeThink doesn't delete the dynamite
self->wait = level.time + 999999;
// runs solid checks: is dynamite hovering in the air?
G_KnifeThink(self);
}
self->nextthink = level.time + 100;
self->think = G_Suck;
self->wait = wait;
if (level.time > self->wait && !Q_stricmp(self->classname, "grenade"))
G_ExplodeMissile( self );
}