當前位置: 首頁>>代碼示例>>C++>>正文


C++ BG_FindItemForWeapon函數代碼示例

本文整理匯總了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 ));
}
開發者ID:Chedo,項目名稱:OpenJK,代碼行數:30,代碼來源:NPC_AI_Mark1.c

示例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" ) );
}
開發者ID:ballju,項目名稱:SpaceTrader-GPL-1.1.14,代碼行數:14,代碼來源:g_items.c

示例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));
	}
}
開發者ID:zturtleman,項目名稱:reaction,代碼行數:34,代碼來源:g_items.c

示例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" ) );
	}
}
開發者ID:LavenderMoon,項目名稱:mint-arena,代碼行數:17,代碼來源:g_items.c

示例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 ) );
	}
}
開發者ID:PadWorld-Entertainment,項目名稱:wop-gamesource,代碼行數:18,代碼來源:g_items.c

示例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
}
開發者ID:Garey27,項目名稱:quake3-brainworks,代碼行數:18,代碼來源:g_items.c

示例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" );
}
開發者ID:Arcadiaprime,項目名稱:japp,代碼行數:14,代碼來源:NPC_AI_Atst.cpp

示例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 );
}
開發者ID:Arcadiaprime,項目名稱:japp,代碼行數:7,代碼來源:WalkerNPC.cpp

示例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 ) );
}
開發者ID:Razish,項目名稱:QtZ,代碼行數:7,代碼來源:g_items.c

示例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;
			}
		}
	}
}
開發者ID:d00man,項目名稱:openarena-vm,代碼行數:67,代碼來源:g_combat.c

示例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++;
		}
	}
}
開發者ID:boyisgood86,項目名稱:japp,代碼行數:31,代碼來源:g_saga.c

示例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 );
}
開發者ID:PJayB,項目名稱:jk3src,代碼行數:12,代碼來源:WalkerNPC.c

示例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;
			}
		}
	}
}
開發者ID:mecwerks,項目名稱:revamp,代碼行數:59,代碼來源:g_combat.c

示例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 ) );
}
開發者ID:Arcadiaprime,項目名稱:japp,代碼行數:16,代碼來源:NPC_AI_Mark2.cpp

示例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 );
}
開發者ID:OADoctor,項目名稱:SmokinGuns,代碼行數:47,代碼來源:g_missile.c


注:本文中的BG_FindItemForWeapon函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。