• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ RegisterItem函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中RegisterItem函数的典型用法代码示例。如果您正苦于以下问题:C++ RegisterItem函数的具体用法?C++ RegisterItem怎么用?C++ RegisterItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了RegisterItem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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( FindItemForAmmo( 	AMMO_METAL_BOLTS));
	RegisterItem( FindItemForAmmo( AMMO_BLASTER ));
	RegisterItem( FindItemForWeapon( WP_BOWCASTER ));
	RegisterItem( FindItemForWeapon( WP_BRYAR_PISTOL ));
}
开发者ID:AlexXT,项目名称:OpenJK,代码行数:30,代码来源:AI_Mark1.cpp


示例2: 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


示例3: 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


示例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', bg_numItems );
	itemRegistered[ bg_numItems ] = 0;

	RegisterItem( FindItemForWeapon( WP_BRYAR_PISTOL ) );	//these are given in g_client, ClientSpawn(), but MUST be registered HERE, BEFORE cgame starts.
	RegisterItem( FindItemForWeapon( WP_STUN_BATON ) );			//these are given in g_client, ClientSpawn(), but MUST be registered HERE, BEFORE cgame starts.
	RegisterItem( FindItemForInventory( INV_ELECTROBINOCULARS ));
	// saber or baton is cached in SP_info_player_deathmatch now.

extern void Player_CacheFromPrevLevel(void);//g_client.cpp
	Player_CacheFromPrevLevel();	//reads from transition carry-over;
}
开发者ID:LTolosa,项目名称:Jedi-Outcast,代码行数:17,代码来源:g_items.cpp


示例6: 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


示例7: 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


示例8: NPC_ATST_Precache

/*
-------------------------
NPC_ATST_Precache
-------------------------
*/
void NPC_ATST_Precache(void)
{
    G_SoundIndex( "sound/chars/atst/atst_damaged1" );
    G_SoundIndex( "sound/chars/atst/atst_damaged2" );

    RegisterItem( FindItemForWeapon( WP_ATST_MAIN ));	//precache the weapon
    RegisterItem( FindItemForWeapon( WP_BOWCASTER ));	//precache the weapon
    RegisterItem( 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:MrSquirrely,项目名称:Jedi-Academy,代码行数:19,代码来源:AI_Atst.cpp


示例9: G_SpawnItem

/*
============
G_SpawnItem

Sets the clipping size and plants the object on the floor.

Items can't be immediately dropped to floor, because they might
be on an entity that hasn't spawned yet.
============
*/
void G_SpawnItem (gentity_t *ent, gitem_t *item) {
	G_SpawnFloat( "random", "0", &ent->random );
	G_SpawnFloat( "wait", "0", &ent->wait );

	if((item->giType == IT_TEAM && (g_instantgib.integer || g_rockets.integer) ) || (!g_instantgib.integer && !g_rockets.integer) )
	{
		//Don't load pickups in Elimination (or maybe... gives warnings)
		if (g_gametype.integer != GT_ELIMINATION && g_gametype.integer != GT_CTF_ELIMINATION && g_gametype.integer != GT_LMS)
			RegisterItem( item );
		//Registrer flags anyway in CTF Elimination:
		if (g_gametype.integer == GT_CTF_ELIMINATION && item->giType == IT_TEAM)
			RegisterItem( item );
		if ( G_ItemDisabled(item) )
			return;
	}
        if(!g_persistantpowerups.integer && item->giType == IT_PERSISTANT_POWERUP)
            return;

	ent->item = item;
	// some movers spawn on the second frame, so delay item
	// spawns until the third frame so they can ride trains
	ent->nextthink = level.time + FRAMETIME * 2;
	ent->think = FinishSpawningItem;

	ent->physicsBounce = 0.50;		// items are bouncy

	if (g_gametype.integer == GT_ELIMINATION || g_gametype.integer == GT_LMS || 
			( item->giType != IT_TEAM && (g_instantgib.integer || g_rockets.integer || g_elimination_allgametypes.integer || g_gametype.integer==GT_CTF_ELIMINATION) ) ) {
		ent->s.eFlags |= EF_NODRAW; //Invisible in elimination
                ent->r.svFlags |= SVF_NOCLIENT;  //Don't broadcast
        }

	if(g_gametype.integer == GT_DOUBLE_D && (strcmp(ent->classname, "team_CTF_redflag")==0 || strcmp(ent->classname, "team_CTF_blueflag")==0 || strcmp(ent->classname, "team_CTF_neutralflag") == 0 || item->giType == IT_PERSISTANT_POWERUP  ))
		ent->s.eFlags |= EF_NODRAW; //Don't draw the flag models/persistant powerups

	if( g_gametype.integer != GT_1FCTF && strcmp(ent->classname, "team_CTF_neutralflag") == 0)
		ent->s.eFlags |= EF_NODRAW; // Don't draw the flag in CTF_elimination

        if(strcmp(ent->classname, "domination_point") == 0)
                ent->s.eFlags |= EF_NODRAW; // Don't draw domination_point. It is just a pointer to where the Domination points should be placed
	if ( item->giType == IT_POWERUP ) {
		G_SoundIndex( "sound/items/poweruprespawn.wav" );
		G_SpawnFloat( "noglobalsound", "0", &ent->speed);
	}

	if ( item->giType == IT_PERSISTANT_POWERUP ) {
		ent->s.generic1 = ent->spawnflags;
	}
}
开发者ID:OpenArena,项目名称:legacy,代码行数:59,代码来源:g_items.c


示例10: G_SpawnItem

/*
============
G_SpawnItem

Sets the clipping size and plants the object on the floor.

Items can't be immediately dropped to floor, because they might
be on an entity that hasn't spawned yet.
============
*/
void G_SpawnItem (gentity_t *ent, gitem_t *item) {
	G_SpawnFloat( "random", "0", &ent->random );
	G_SpawnFloat( "wait", "0", &ent->wait );

	RegisterItem( item );
	ent->item = item;

	// targetname indicates they want to spawn it later
	if( ent->targetname )
	{
		ent->e_UseFunc = useF_item_spawn_use;
	}
	else
	{	// some movers spawn on the second frame, so delay item
		// spawns until the third frame so they can ride trains
		ent->nextthink = level.time + START_TIME_MOVERS_SPAWNED + 50;
		ent->e_ThinkFunc = thinkF_FinishSpawningItem;
	}

	ent->physicsBounce = 0.50;		// items are bouncy

	// Set a default infoString text color
	// NOTE: if we want to do cool cross-hair colors for items, we can just modify this, but for now, don't do it
	VectorSet( ent->startRGBA, 1.0f, 1.0f, 1.0f );
}
开发者ID:AlexXT,项目名称:OpenJK,代码行数:35,代码来源:g_items.cpp


示例11: G_SpawnItem

/*
============
G_SpawnItem

Sets the clipping size and plants the object on the floor.

Items can't be immediately dropped to floor, because they might
be on an entity that hasn't spawned yet.
============
*/
void G_SpawnItem (gentity_t *ent, gitem_t *item) {
	G_SpawnFloat( "random", "0", &ent->random );
	G_SpawnFloat( "wait", "0", &ent->wait );

	RegisterItem( item );
	if ( G_ItemDisabled(item) )
		return;

	ent->item = item;
	// some movers spawn on the second frame, so delay item
	// spawns until the third frame so they can ride trains
	ent->nextthink = level.time + FRAMETIME * 2;
	ent->think = FinishSpawningItem;

	ent->physicsBounce = 0.50;		// items are bouncy

	if ( item->giType == IT_POWERUP ) {
		G_SoundIndex( "sound/items/poweruprespawn.wav" );
		G_SpawnFloat( "noglobalsound", "0", &ent->speed);
	}

	if ( item->giType == IT_PERSISTANT_POWERUP ) {
		// allow both teams to pick it up
		if ( ( ent->spawnflags & 2 ) && ( ent->spawnflags & 4 ) ) {
			ent->s.team = 255;
		}
		// only one team can pick it up
		else if ( ent->spawnflags & 2 )
			ent->s.team = TEAM_RED;
		else if ( ent->spawnflags & 4 )
			ent->s.team = TEAM_BLUE;
	}
}
开发者ID:LavenderMoon,项目名称:mint-arena,代码行数:43,代码来源:g_items.c


示例12: G_SpawnItem

/*
============
G_SpawnItem

Sets the clipping size and plants the object on the floor.

Items can't be immediately dropped to floor, because they might
be on an entity that hasn't spawned yet.
============
*/
void G_SpawnItem( gentity_t *ent, gitem_t *item ) {
	char    *noise;
	int page;

	G_SpawnFloat( "random", "0", &ent->random );
	G_SpawnFloat( "wait", "0", &ent->wait );

	RegisterItem( item );
	ent->item = item;
	// some movers spawn on the second frame, so delay item
	// spawns until the third frame so they can ride trains
	ent->nextthink = level.time + FRAMETIME * 2;
	ent->think = FinishSpawningItem;

	if ( G_SpawnString( "noise", 0, &noise ) ) {
		ent->noise_index = G_SoundIndex( noise );
	}

	ent->physicsBounce = 0.50;      // items are bouncy

	if ( ent->model ) {
		ent->s.modelindex2 = G_ModelIndex( ent->model );
	}

	if ( item->giType == IT_CLIPBOARD ) {
		if ( G_SpawnInt( "notebookpage", "1", &page ) ) {
			ent->key = page;
		}
	}

	if ( item->giType == IT_POWERUP ) {
		G_SoundIndex( "sound/items/poweruprespawn.wav" );
	}
}
开发者ID:MAN-AT-ARMS,项目名称:iortcw-archive,代码行数:44,代码来源:g_items.c


示例13: G_SpawnItem

/*
============
G_SpawnItem

Sets the clipping size and plants the object on the floor.

Items can't be immediately dropped to floor, because they might
be on an entity that hasn't spawned yet.
============
*/
qboolean G_SpawnItem (gentity_t *ent, gitem_t *item) {
	G_SpawnFloat( "random", "0", &ent->random );
	G_SpawnFloat( "wait", "0", &ent->wait );

	RegisterItem( item );
	
	if ( G_ItemDisabled(item) )
		return qfalse;

	if ( g_spacetrader.integer ) {
		if ( !G_ST_exec( ST_SPAWN_ITEM, ent, item ) )
			return qfalse;
	}

	ent->item = item;
	// some movers spawn on the second frame, so delay item
	// spawns until the third frame so they can ride trains
	ent->nextthink = level.time + FRAMETIME * 2;
	ent->think = FinishSpawningItem;

	ent->physicsBounce = 0.50;		// items are bouncy

	if ( item->giType == IT_PERSISTANT_POWERUP ) {
		ent->s.generic1 = ent->spawnflags;
	}

	return qtrue;
}
开发者ID:ballju,项目名称:SpaceTrader-GPL-1.1.14,代码行数:38,代码来源:g_items.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: 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


示例16: G_SpawnItem

/*
============
G_SpawnItem

Sets the clipping size and plants the object on the floor.

Items can't be immediately dropped to floor, because they might
be on an entity that hasn't spawned yet.
============
*/
void G_SpawnItem (gentity_t *ent, gitem_t *item) {
	G_SpawnFloat( "random", "0", &ent->random );
	G_SpawnFloat( "wait", "0", &ent->wait );

	RegisterItem( item );
	if ( G_ItemDisabled(item) )
		return;

	ent->item = item;
	// some movers spawn on the second frame, so delay item
	// spawns until the third frame so they can ride trains
	ent->nextthink = level.time + FRAMETIME * 2;
	ent->think = FinishSpawningItem;

	ent->physicsBounce = 0.50;		// items are bouncy

	if ( item->giType == IT_POWERUP ) {
		G_SoundIndex( "sound/items/poweruprespawn.wav" );
		G_SpawnFloat( "noglobalsound", "0", &ent->speed);
	}

#ifdef MISSIONPACK
	if ( item->giType == IT_PERSISTANT_POWERUP ) {
		ent->s.generic1 = ent->spawnflags;
	}
#endif
}
开发者ID:Garey27,项目名称:quake3-brainworks,代码行数:37,代码来源:g_items.c


示例17: G_SpawnItem

/*
============
G_SpawnItem

Sets the clipping size and plants the object on the floor.

Items can't be immediately dropped to floor, because they might
be on an entity that hasn't spawned yet.
============
*/
void G_SpawnItem(gentity_t * ent, gitem_t * item)
{
	G_SpawnFloat("random", "0", &ent->random);
	G_SpawnFloat("wait", "0", &ent->wait);

	//Elder: check spawn angles; client-side should make use of them too
	G_SpawnFloat("angle", "0", &ent->s.angles[1]);

	RegisterItem(item);
	if (G_ItemDisabled(item))
		return;

	ent->item = item;
	// some movers spawn on the second frame, so delay item
	// spawns until the third frame so they can ride trains
	ent->nextthink = level.time + FRAMETIME * 2;
	ent->think = FinishSpawningItem;
	//Makro - respawn function
	ent->reset = G_ResetItem;

	ent->physicsBounce = 0.50;	// items are bouncy

	if (item->giType == IT_POWERUP) {
		G_SoundIndex("sound/items/poweruprespawn.wav");
		G_SpawnFloat("noglobalsound", "0", &ent->speed);
	}
}
开发者ID:zturtleman,项目名称:reaction,代码行数:37,代码来源:g_items.c


示例18: 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


示例19: NPC_Probe_Precache

void NPC_Probe_Precache(void)
{
	for ( int i = 1; i < 4; i++)
	{
		G_SoundIndex( va( "sound/chars/probe/misc/probetalk%d", i ) );
	}
	G_SoundIndex( "sound/chars/probe/misc/probedroidloop" );
	G_SoundIndex("sound/chars/probe/misc/anger1");
	G_SoundIndex("sound/chars/probe/misc/fire");

	G_EffectIndex( "chunks/probehead" );
	G_EffectIndex( "env/med_explode2" );
	G_EffectIndex( "explosions/probeexplosion1");
	G_EffectIndex( "bryar/muzzle_flash" );

	RegisterItem( FindItemForAmmo( AMMO_BLASTER ));
	RegisterItem( FindItemForWeapon( WP_BRYAR_PISTOL ) );
}
开发者ID:Christian-Barrett,项目名称:OpenJK,代码行数:18,代码来源:AI_ImperialProbe.cpp


示例20: ClearRegisteredItems

/*
==============
ClearRegisteredItems
==============
*/
void ClearRegisteredItems() 
{
#pragma message("this should probably be removed!")
	memset( itemRegistered, 0, sizeof( itemRegistered ) );
	// Always load health/ammo/fuel pickups
	RegisterItem( BG_FindItem( "5 Health" ) );
	RegisterItem( BG_FindItem( "25 Health" ) );
	RegisterItem( BG_FindItem( "50 Health" ) );
	RegisterItem( BG_FindItem( "Some Fuel" ) );
	RegisterItem( BG_FindItem( "More Fuel" ) );
	RegisterItem( BG_FindItem( "Shells" ) );
	RegisterItem( BG_FindItem( "Bullets" ) );
	RegisterItem( BG_FindItem( "Slugs" ) );
	RegisterItem( BG_FindItem( "Rockets" ) );
}
开发者ID:MilitaryForces,项目名称:MilitaryForces,代码行数:20,代码来源:g_items.c



注:本文中的RegisterItem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ RegisterKernelFunction函数代码示例发布时间:2022-05-30
下一篇:
C++ RegisterAIUpdateEvent函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap