您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Drop_Item函数代码示例

51自学网 2021-06-01 20:30:20
  C++
这篇教程C++ Drop_Item函数代码示例写得很实用,希望能帮到您。

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

在下文中一共展示了Drop_Item函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: TossClientItems

/*=================TossClientItemsToss 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,


示例2: PortalTouch

static void PortalTouch(gentity_t * self, gentity_t * other, trace_t * trace){	gentity_t      *destination;	// see if we will even let other try to use it	if(other->health <= 0)	{		return;	}	if(!other->client)	{		return;	}//  if( other->client->ps.persistant[PERS_TEAM] != self->spawnflags ) {//      return;//  }	if(other->client->ps.powerups[PW_NEUTRALFLAG])	{							// only happens in One Flag CTF		Drop_Item(other, BG_FindItemForPowerup(PW_NEUTRALFLAG), 0);		other->client->ps.powerups[PW_NEUTRALFLAG] = 0;	}	else if(other->client->ps.powerups[PW_REDFLAG])	{							// only happens in standard CTF		Drop_Item(other, BG_FindItemForPowerup(PW_REDFLAG), 0);		other->client->ps.powerups[PW_REDFLAG] = 0;	}	else if(other->client->ps.powerups[PW_BLUEFLAG])	{							// only happens in standard CTF		Drop_Item(other, BG_FindItemForPowerup(PW_BLUEFLAG), 0);		other->client->ps.powerups[PW_BLUEFLAG] = 0;	}	// find the destination	destination = NULL;	while((destination = G_Find(destination, FOFS(classname), "hi_portal destination")) != NULL)	{		if(destination->count == self->count)		{			break;		}	}	// if there is not one, die!	if(!destination)	{		if(self->pos1[0] || self->pos1[1] || self->pos1[2])		{			TeleportPlayer(other, self->pos1, self->s.angles);		}		G_Damage(other, other, other, NULL, NULL, 100000, DAMAGE_NO_PROTECTION, MOD_TELEFRAG);		return;	}	TeleportPlayer(other, destination->s.pos.trBase, destination->s.angles);}
开发者ID:SinSiXX,项目名称:Rogue-Reborn,代码行数:56,


示例3: TossPlayerGametypeItems

/*===========TossPlayerGametypeItemsDrop CTF flag and Harvester cubes===========*/void TossPlayerGametypeItems(gentity_t *ent) {	int j;	gitem_t *item;	gentity_t *drop;	int angle = 0;	// drop flags in CTF	item = NULL;	j = 0;	if ( ent->player->ps.powerups[ PW_REDFLAG ] ) {		item = BG_FindItemForPowerup( PW_REDFLAG );		j = PW_REDFLAG;	} else if ( ent->player->ps.powerups[ PW_BLUEFLAG ] ) {		item = BG_FindItemForPowerup( PW_BLUEFLAG );		j = PW_BLUEFLAG;	} else if ( ent->player->ps.powerups[ PW_NEUTRALFLAG ] ) {		item = BG_FindItemForPowerup( PW_NEUTRALFLAG );		j = PW_NEUTRALFLAG;	}	if ( item ) {		drop = Drop_Item( ent, item, angle );		angle += 45;		// decide how many seconds it has left		drop->count = ( ent->player->ps.powerups[ j ] - level.time ) / 1000;		if ( drop->count < 1 ) {			drop->count = 1;		}		ent->player->ps.powerups[ j ] = 0;	}#ifdef MISSIONPACK	if ( g_gametype.integer == GT_HARVESTER ) {		if ( ent->player->ps.tokens > 0 ) {			if ( ent->player->sess.sessionTeam == TEAM_RED ) {				item = BG_FindItem( "Blue Cube" );			} else {				item = BG_FindItem( "Red Cube" );			}			if ( item ) {				for ( j = 0; j < ent->player->ps.tokens; j++ ) {					drop = Drop_Item( ent, item, angle );					if ( ent->player->sess.sessionTeam == TEAM_RED ) {						drop->s.team = TEAM_BLUE;					} else {						drop->s.team = TEAM_RED;					}					angle += 45;				}			}			ent->player->ps.tokens = 0;		}	}#endif}
开发者ID:mecwerks,项目名称:revamp,代码行数:63,


示例4: TossPlayerItems

/*=================TossPlayerItemsToss 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,


示例5: RestartLevel

//#define rndnum(y,z) ((random()*((z)-((y)+1)))+(y))void RestartLevel(){	edict_t *player;	int i;	edict_t *dropped = NULL;	techspawn = false;	ResetItems();	match_nextthink = level.time + 1;	match_state = STATE_NEEDPLAYERS;	match_state_end = 1;	ResetCaps();	hstime = level.time - 10;	mapvoteactive = false;	for_each_player(player, i)	{		player->client->resp.score = 0;		player->client->resp.frags = 0;		player->client->resp.spree = 0;		player->client->resp.deaths = 0;		player->client->pers.db_hud = true;		if(player->client->pers.pl_state == 2)			player->client->pers.pl_state = 3;		player->client->resp.startframe = level.newframenum;		if (ctf->value)		{			if ((!flag1_item || !flag2_item) && ctf->value)				CTFInit();			if (player->client->pers.inventory[ITEM_INDEX(flag1_item)])			{				dropped = Drop_Item(player, flag1_item);				player->client->pers.inventory[ITEM_INDEX(flag1_item)] = 0;				my_bprintf(PRINT_HIGH, "%s lost the %s flag!/n",					player->client->pers.netname, CTFTeamName(CTF_TEAM1));			}			else if (player->client->pers.inventory[ITEM_INDEX(flag2_item)])			{				dropped = Drop_Item(player, flag2_item);				player->client->pers.inventory[ITEM_INDEX(flag2_item)] = 0;				my_bprintf(PRINT_HIGH, "%s lost the %s flag!/n",					player->client->pers.netname, CTFTeamName(CTF_TEAM2));			}			if (dropped)			{				dropped->think = G_FreeEdict;				dropped->timestamp = level.time;				dropped->nextthink = level.time + 0.2;			}			//JSW - clear flag carrier var			player->hasflag = 0;		}	}
开发者ID:qbism,项目名称:tmg,代码行数:52,


示例6: TossClientWeapon

void TossClientWeapon (edict_t *self){	gitem_t		*item;	edict_t		*drop;	qboolean	quad;	float		spread;	if (!deathmatch->value)		return;	item = self->client->pers.weapon;	if (! self->client->pers.inventory[self->client->ammo_index] )		item = NULL;	if (item && (strcmp (item->pickup_name, "Blaster") == 0))		item = NULL;#if defined(_DEBUG) && defined(_Z_TESTMODE)	if (item && (strcmp (item->pickup_name, "Line Draw") == 0))		item = NULL;#endif	if (!((int)(dmflags->value) & DF_QUAD_DROP))		quad = false;	else		quad = (self->client->quad_framenum > (level.framenum + 10));	if (item && quad)		spread = 22.5;	else		spread = 0.0;	if (item)	{		self->client->v_angle[YAW] -= spread;		drop = Drop_Item (self, item);		self->client->v_angle[YAW] += spread;		drop->spawnflags = DROPPED_PLAYER_ITEM;	}	if (quad)	{		self->client->v_angle[YAW] += spread;		drop = Drop_Item (self, FindItemByClassname ("item_quad"));		self->client->v_angle[YAW] -= spread;		drop->spawnflags |= DROPPED_PLAYER_ITEM;		drop->touch = Touch_Item;		drop->nextthink = level.time + (self->client->quad_framenum - level.framenum) * FRAMETIME;		drop->think = G_FreeEdict;	}}
开发者ID:ZwS,项目名称:qudos,代码行数:51,


示例7: monster_death_use

/*================monster_death_useWhen a monster dies, it fires all of its targets with the currentenemy as activator.================*/void monster_death_use (edict_t *self){	edict_t	*player;	int		i;	self->flags &= ~(FL_FLY|FL_SWIM);	self->monsterinfo.aiflags &= AI_GOOD_GUY;	// Lazarus: If actor/monster is being used as a camera by a player,	// turn camera off for that player	for (i=0,player=g_edicts+1; i<maxclients->value; i++, player++) {		if(player->client && player->client->spycam == self)			camera_off(player);	}	if (self->item)	{		Drop_Item (self, self->item);		self->item = NULL;	}	if (self->deathtarget)		self->target = self->deathtarget;	if (!self->target)		return;	G_UseTargets (self, self->enemy);}
开发者ID:qbism,项目名称:qbq2,代码行数:37,


示例8: Drop_Ammo

void Drop_Ammo (edict_t *ent, gitem_t *item){	edict_t	*dropped;	int		index;	index = ITEM_INDEX(item);	dropped = Drop_Item (ent, item);	if (ent->client->pers.inventory[index] >= item->quantity)		dropped->count = item->quantity;	else		dropped->count = ent->client->pers.inventory[index];	//Wheaty: Only drop ONE grenade/*	if (item->tag == AMMO_TYPE_GRENADES)	{		dropped->count = 1;	} */	//Wheaty: Clear inventory of any grenades (even though you only drop 1)//	if (!item->tag == AMMO_TYPE_GRENADES)		ent->client->pers.inventory[index] -= dropped->count;//	else//		ent->client->pers.inventory[index] = 0;	ValidateSelectedItem (ent);	WeighPlayer(ent);}
开发者ID:basecq,项目名称:q2dos,代码行数:27,


示例9: RQ3_ResetItem

/*==============RQ3_ResetItemAdded by ElderItems respawn themselves after a period of timeBased on the AQ2 item code which was based off Q2 CTF techsThis can be called directly when a player dies in a CONTENTS_NODROP area==============*/void RQ3_ResetItem(int itemTag){	gitem_t *rq3_item;	gentity_t *rq3_temp;	float angle = rand() % 360;// JBravo: no resetting items in TP or CTB	if (g_gametype.integer == GT_TEAMPLAY || g_gametype.integer == GT_CTF)		return;	if (g_gametype.integer == GT_TEAM && !g_RQ3_tdmMode.integer)		return;	switch (itemTag) {	case HI_KEVLAR:	case HI_LASER:	case HI_SILENCER:	case HI_BANDOLIER:	case HI_SLIPPERS:	case HI_HELMET:		//Free entity and reset position in unique item array		//level.uniqueItemsUsed &= ~(1 << ent->item->giTag);		rq3_item = BG_FindItemForHoldable(itemTag);		rq3_temp = (gentity_t *) SelectRandomDeathmatchSpawnPoint();		Drop_Item(rq3_temp, rq3_item, angle);		//G_Printf("RQ3_DroppedItemThink: Freeing item entity + respawning/n");		break;	default:		//Elder: shouldn't have to come here		G_Printf("RQ3_ResetItem: Out of range or invalid item %d/n", itemTag);		break;	}}
开发者ID:zturtleman,项目名称:reaction,代码行数:42,


示例10: adminSpawnRune

void adminSpawnRune(edict_t *self, int type, int index){	gitem_t *item;	edict_t *rune;	item = FindItem("Rune");		// get the item properties	rune = Drop_Item(self, item);	// create the entity that holds those properties	V_ItemClear(&rune->vrxitem);	// initialize the rune	rune->vrxitem.quantity = 1;		switch(type)	{	case ITEM_WEAPON:		spawnNorm(rune, index, ITEM_WEAPON); return;	case ITEM_ABILITY:		spawnNorm(rune, index, ITEM_ABILITY); return;	case ITEM_COMBO:		spawnCombo(rune, index); return;	case ITEM_CLASSRUNE:	spawnClassRune(rune, index); return;	//Try to spawn a unique (or a random one if it fails to find one at the index)	case ITEM_UNIQUE:		if (!spawnUnique(rune, index)) spawnNorm(rune, index, 0); return;	}	//Randomize id	strcpy(rune->vrxitem.id, GetRandomString(16));	//Free the ent (if no rune was spawned)	G_FreeEdict(rune);}
开发者ID:mylemans,项目名称:vrxcl,代码行数:26,


示例11: Drop_Weapon

voidDrop_Weapon(edict_t *ent, gitem_t *item){	int index;	if (!ent || !item)	{		return;	}	if ((int)(dmflags->value) & DF_WEAPONS_STAY)	{		return;	}	index = ITEM_INDEX(item);	/* see if we're already using it */	if (((item == ent->client->pers.weapon) ||		 (item == ent->client->newweapon)) &&		(ent->client->pers.inventory[index] == 1))	{		gi.cprintf(ent, PRINT_HIGH, "Can't drop current weapon/n");		return;	}	Drop_Item(ent, item);	ent->client->pers.inventory[index]--;}
开发者ID:phine4s,项目名称:xatrix,代码行数:29,


示例12: dropWeapon

gentity_s* dropWeapon(int32_t client, int32_t weapon, int32_t camo){	uint16_t tag = scr_const->tag_weapon_right;	gentity_s* ent = Drop_Item(&g_entities[client], weapon, 20, tag, 0);	ent->item[0].ammoCount = ent->item[0].clipAmmoCount = 999;	ent->s.renderOptions = camo;	Scr_AddEntity(SCRIPTINSTANCE_SERVER, ent);	return ent;}
开发者ID:therifboy,项目名称:echelon-bo2,代码行数:9,


示例13: Drop_General

void Drop_General (edict_t *ent, gitem_t *item){	if (!item)		return; // out of ammo, switched before frame?	Drop_Item (ent, item);	ent->client->pers.inventory[ITEM_INDEX(item)]--;	ValidateSelectedItem (ent);	WeighPlayer(ent);}
开发者ID:basecq,项目名称:q2dos,代码行数:10,


示例14: Drop_Item

static edict_t *Drop_General( edict_t *ent, const gsitem_t *item ){	edict_t *dropped = Drop_Item( ent, item );	if( dropped )	{		if( ent->r.client && ent->r.client->ps.inventory[item->tag] > 0 )			ent->r.client->ps.inventory[item->tag]--;	}	return dropped;}
开发者ID:DenMSC,项目名称:qfusion,代码行数:10,


示例15: TossClientItems

/*=================TossClientItemsToss the weapon and powerups for the killed player=================*/void TossClientItems( gentity_t *self ) {	gitem_t		*item;	if ( IsBot( self ) )		return;	//bots don't drop items in single player	//the player drops a backpack in single player	item = BG_FindItemForBackpack(); 	Drop_Item( self, item, 0 );}
开发者ID:Clever-Boy,项目名称:entityplus,代码行数:18,


示例16: Drop_Spec

void Drop_Spec(edict_t *ent, gitem_t *item){        edict_t *spec;        spec = Drop_Item(ent, item);        //gi.cprintf(ent, PRINT_HIGH, "Dropping special item./n");        spec->nextthink = level.time + 1;        spec->think = MakeTouchSpecThink;                //zucc this and the one below should probably be -- not = 0, if                // a server turns on multiple item pickup.        ent->client->pers.inventory[ITEM_INDEX(item)]--;}
开发者ID:MaddTheSane,项目名称:Quake2-Action,代码行数:12,


示例17: printf

void Container::DropItem(const short lat, const short lon){	if (_state == 's')	{		_state = 'g';		_myLatitude = lat;		_myLongitude= lon;		printf(Drop_Item(BAG));	}	else		printf(NO_BAG);}
开发者ID:qweilak,项目名称:Leptis---simple-text-adventure-game,代码行数:12,


示例18: G_Gametype_GENERIC_PlayerKilled

void G_Gametype_GENERIC_PlayerKilled( edict_t *targ, edict_t *attacker, edict_t *inflictor ){	if( !attacker || GS_MatchState() != MATCH_STATE_PLAYTIME || ( targ->r.svflags & SVF_CORPSE ) )		return;	if( !attacker->r.client || attacker == targ || attacker == world )		teamlist[targ->s.team].stats.score--;	else	{		if( GS_InvidualGameType() )			teamlist[attacker->s.team].stats.score = attacker->r.client->level.stats.score;		if( GS_IsTeamDamage( &targ->s, &attacker->s ) )			teamlist[attacker->s.team].stats.score--;		else			teamlist[attacker->s.team].stats.score++;	}	// drop items	if( targ->r.client && !( G_PointContents( targ->s.origin ) & CONTENTS_NODROP ) )	{		// drop the weapon		if ( targ->r.client->ps.stats[STAT_WEAPON] > WEAP_GUNBLADE )		{			gsitem_t *weaponItem = GS_FindItemByTag( targ->r.client->ps.stats[STAT_WEAPON] );			if( weaponItem )			{				edict_t *drop = Drop_Item( targ, weaponItem );				if( drop )				{					drop->count = targ->r.client->ps.inventory[ weaponItem->weakammo_tag ];					targ->r.client->ps.inventory[ weaponItem->weakammo_tag ] = 0;				}			}		}		// drop ammo pack (won't drop anything if player doesn't have any strong ammo)		Drop_Item( targ, GS_FindItemByTag( AMMO_PACK ) );	}}
开发者ID:MaryJaneInChain,项目名称:qfusion,代码行数:39,


示例19: Drop_Briefcase

void Drop_Briefcase (edict_t *ent, gitem_t *item){	if (!item)		return; // out of ammo, switched before frame?	Drop_Item (ent, item);	ent->client->pers.inventory[ITEM_INDEX(item)]--;	ValidateSelectedItem (ent);		ent->s.modelindex3 = 0;	gi.cprintf(ent, PRINT_HIGH, "You dropped the briefcase!/n");	ent->client->has_briefcase = false;//used to display icon in hud}
开发者ID:basecq,项目名称:q2dos,代码行数:14,


示例20: switch

edict_t *DropRandomAmmo (edict_t *self){	gitem_t *item;	switch (GetRandom(1, 6))	{	case 1: item = FindItemByClassname("ammo_shells"); break;	case 2: item = FindItemByClassname("ammo_bullets"); break;	case 3: item = FindItemByClassname("ammo_grenades"); break;	case 4: item = FindItemByClassname("ammo_rockets"); break;	case 5: item = FindItemByClassname("ammo_cells"); break;	case 6: item = FindItemByClassname("ammo_slugs"); break;	}	return Drop_Item(self, item);}
开发者ID:zardoru,项目名称:vrxcl,代码行数:15,


示例21: monster_death_use

/*================monster_death_use When a monster dies, it fires all of its targets with the currentenemy as activator.================*/void monster_death_use(edict_t *self){	self->flags &= ~(FL_FLY | FL_SWIM);	self->monsterinfo.aiflags &= AI_GOOD_GUY;		if(self->item){		Drop_Item(self, self->item);		self->item = NULL;	}		if(self->deathtarget)		self->target = self->deathtarget;			if(!self->target)		return;			G_UseTargets(self, self->enemy);}
开发者ID:luaman,项目名称:qforge-2,代码行数:25,


示例22: Drop_Ammo

static void Drop_Ammo( edict_t *ent, gsitem_t *item ){	edict_t	*dropped;	int index;	index = item->tag;	dropped = Drop_Item( ent, item );	if( dropped )	{		if( ent->r.client->ps.inventory[index] >= item->quantity )			dropped->count = item->quantity;		else			dropped->count = ent->r.client->ps.inventory[index];		ent->r.client->ps.inventory[index] -= dropped->count;	}}
开发者ID:hettoo,项目名称:racesow,代码行数:17,


示例23: TossClientItems

/*=================TossClientItemsToss the weapon and powerups for the killed player=================*/void TossClientItems( gentity_t *self ) {	gitem_t     *item;	int weapon;	gentity_t   *drop = 0;	// 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 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.	// (SA) always drop what you were switching to	if ( 1 ) {		if ( self->client->ps.weaponstate == WEAPON_DROPPING ) {			weapon = self->client->pers.cmd.weapon;		}		if ( !( COM_BitCheck( self->client->ps.weapons, weapon ) ) ) {			weapon = WP_NONE;		}	}	// JPW NERVE don't drop these weapon types	if ( ( weapon == WP_FLAMETHROWER ) || ( weapon == WP_GARAND ) || ( weapon == WP_MAUSER ) || ( weapon == WP_VENOM ) ) {		weapon = WP_NONE;	}	// jpw	if ( weapon > WP_NONE && weapon < WP_MONSTER_ATTACK1 && self->client->ps.ammo[ BG_FindAmmoForWeapon( weapon_t (weapon) )] ) {		// find the item type for this weapon		item = BG_FindItemForWeapon( weapon_t (weapon) );		// spawn the item		// Rafael		if ( !( self->client->ps.persistant[PERS_HWEAPON_USE] ) ) {			drop = Drop_Item( self, item, 0, qfalse );			// JPW NERVE -- fix ammo counts			drop->count = self->client->ps.ammoclip[BG_FindClipForWeapon( weapon_t (weapon) )];			drop->item->quantity = self->client->ps.ammoclip[BG_FindClipForWeapon( weapon_t (weapon) )];			// jpw		}	}}
开发者ID:bibendovsky,项目名称:rtcw,代码行数:51,


示例24: DeadDropSpec

void DeadDropSpec(edict_t * ent){	gitem_t *spec;	edict_t *dropped;	int i;	for(i = 0; i<ITEM_COUNT; i++)	{		if (INV_AMMO(ent, tnums[i]) > 0) {			spec = GET_ITEM(tnums[i]);			dropped = Drop_Item(ent, spec);			// hack the velocity to make it bounce random			dropped->velocity[0] = (rand() % 600) - 300;			dropped->velocity[1] = (rand() % 600) - 300;			dropped->nextthink = level.time + 1;			dropped->think = MakeTouchSpecThink;			dropped->owner = NULL;			dropped->spawnflags = DROPPED_PLAYER_ITEM;			ent->client->pers.inventory[ITEM_INDEX(spec)] = 0;		}	}}
开发者ID:andrijan,项目名称:ajaq,代码行数:22,


示例25: DeadDropSpec

void DeadDropSpec(edict_t *ent){        gitem_t *spec;        edict_t *dropped;        int i;        i = 0;        while (tnames[i]) {                if ((spec = FindItemByClassname(tnames[i])) != NULL &&                        ent->client->pers.inventory[ITEM_INDEX(spec)]) {                        dropped = Drop_Item(ent, spec);                        // hack the velocity to make it bounce random                        dropped->velocity[0] = (rand() % 600) - 300;                        dropped->velocity[1] = (rand() % 600) - 300;                        dropped->nextthink = level.time + 1;                        dropped->think = MakeTouchSpecThink;                        dropped->owner = NULL;                        ent->client->pers.inventory[ITEM_INDEX(spec)] = 0;                }                i++;        }}
开发者ID:MaddTheSane,项目名称:Quake2-Action,代码行数:22,


示例26: M_default_die

//==========================================// M_default_die//==========================================void M_default_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point){	//if(AIDevel.debugMode && bot_debugmonster->value)	Com_Printf("AI_monster: Die/n");	//throw gibs	//G_Sound (self, CHAN_BODY, trap_SoundIndex ("sound/misc/udeath.wav"), 1, ATTN_NORM);	//ThrowSmallPileOfGibs ( self, 8, damage );	ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);	self->deadflag = DEAD_DEAD;		if (self->item)	{		Drop_Item (self, self->item);		self->item = NULL;	}	AI_EnemyRemoved( self );	//explode	barrel_delay (self, inflictor, attacker, damage, point);}
开发者ID:ZwS,项目名称:qudos,代码行数:26,


示例27: DeadDropSpec

void DeadDropSpec(edict_t * ent){	gitem_t *spec;	edict_t *dropped;	int i, itemNum;	for(i = 0; i<ITEM_COUNT; i++)	{		itemNum = ITEM_FIRST + i;		if (INV_AMMO(ent, itemNum) > 0) {			spec = GET_ITEM(itemNum);			dropped = Drop_Item(ent, spec);			// hack the velocity to make it bounce random			dropped->velocity[0] = (rand() % 600) - 300;			dropped->velocity[1] = (rand() % 600) - 300;			dropped->nextthink = level.framenum + 1 * HZ;			dropped->think = MakeTouchSpecThink;			dropped->owner = NULL;			dropped->spawnflags = DROPPED_PLAYER_ITEM;			ent->client->inventory[ITEM_INDEX(spec)] = 0;		}	}}
开发者ID:AQ2Chile,项目名称:aq2-tng,代码行数:23,


示例28: Drop_Weapon

/*================Drop_Weapon================*/void Drop_Weapon (edict_t *ent, gitem_t *item){	int		index;  // Make sure ent exists!  if (!G_EntExists(ent)) return;	if (dmflag & DF_WEAPONS_STAY)		return;	index = ITEM_INDEX(item);	// see if we're already using it	if ( ((item == ent->client->pers.weapon) || (item == ent->client->newweapon))&& (ent->client->pers.inventory[index] == 1) )	{		if (!ent->bot_client)			safe_cprintf (ent, PRINT_HIGH, "Can't drop current weapon/n");		return;	}	Drop_Item (ent, item);	ent->client->pers.inventory[index]--;}
开发者ID:qbism,项目名称:tmg,代码行数:28,


示例29: Drop_Weapon

/** Drop_Weapon*/void Drop_Weapon( edict_t *ent, const gsitem_t *item ){	int otherweapon;	edict_t *drop;	int ammodrop = 0;	if( item->tag < 1 || item->tag >= WEAP_TOTAL )	{		G_PrintMsg( ent, "Can't drop unknown weapon/n" );		return;	}	// find out the amount of ammo to drop	if( ent->r.client->ps.inventory[item->tag] > 1 && ent->r.client->ps.inventory[item->ammo_tag] > 5 )	{		ammodrop = ent->r.client->ps.inventory[item->ammo_tag] / 2;	}	else // drop all	{		ammodrop = ent->r.client->ps.inventory[item->ammo_tag];	}	drop = Drop_Item( ent, item );	if( drop )	{		ent->r.client->ps.inventory[item->ammo_tag] -= ammodrop;		drop->count = ammodrop;		drop->spawnflags |= DROPPED_PLAYER_ITEM;		ent->r.client->ps.inventory[item->tag]--;		if( !ent->r.client->ps.inventory[item->tag] )		{			otherweapon = GS_SelectBestWeapon( &ent->r.client->ps );			Use_Weapon( ent, GS_FindItemByTag( otherweapon ) );		}	}}
开发者ID:codetwister,项目名称:qfusion,代码行数:40,


示例30: dom_dropflag

void dom_dropflag (edict_t *ent, gitem_t *item){	edict_t *flag;	//if (!G_EntExists(ent))	//	return;	if (!ent || !ent->inuse || G_IsSpectator(ent))		return;	if (!domination->value || !ent->client->pers.inventory[flag_index])		return;	gi.bprintf(PRINT_HIGH, "%s dropped the flag./n", ent->client->pers.netname);	flag = Drop_Item (ent, item);	flag->think = dom_flagthink;	flag->count = 0;	//Wait a second before starting to think	flag->nextthink = level.time + 1.0;	ent->client->pers.inventory[ITEM_INDEX(item)] = 0;	ValidateSelectedItem (ent);	DEFENSE_TEAM = 0;	//FLAG_FRAMES = 0;	if (SpawnWaitingPlayers())		OrganizeTeams(true);}
开发者ID:mylemans,项目名称:vrxcl,代码行数:24,



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


C++ DrvDoReset函数代码示例
C++ Draw_Pic函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。