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

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

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

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

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

示例1: switch

void GameControl::AddCompleteLines(int Lines) {    m_completeLines += Lines;    int diffLines = m_completeLines - m_prevLines;    switch (diffLines) {        case 1: //single line clear            AddScore((m_level+1)*40);            break;        case 2: //double line clear            AddScore((m_level+1)*100);            break;        case 3: //triple line clear            AddScore((m_level+1)*300);            break;        case 4: //tetris line clear            AddScore((m_level+1)*1200);            break;        default:            break;    }    //increase the level if we've got enough lines and then    //speed up the drop interval    m_prevLines = m_completeLines;    int currentLevel;    currentLevel = int(m_completeLines / LINES_PER_LEVEL);    if (currentLevel > GetLevel()) {        m_level++;        SetDropInterval(GetDropInterval() - (DROP_INTERVAL_INCREMENT));        sound->Play(SOUND_LEVEL_UP);    }    else        sound->Play(SOUND_CLEAR_LINE);}
开发者ID:shiver,项目名称:heavy_metal,代码行数:34,


示例2: Touch_flagonly

void Touch_flagonly( gentity_t *ent, gentity_t *other, trace_t *trace ) {	if ( !other->client ) {		return;	}	if ( ent->spawnflags & RED_FLAG && other->client->ps.powerups[ PW_REDFLAG ] ) {		AddScore( other, ent->accuracy ); // JPW NERVE set from map, defaults to 20		G_Script_ScriptEvent( ent, "death", "" );		// Removes itself		ent->touch = 0;		ent->nextthink = level.time + FRAMETIME;		ent->think = G_FreeEntity;	} else if ( ent->spawnflags & BLUE_FLAG && other->client->ps.powerups[ PW_BLUEFLAG ] )   {		AddScore( other, ent->accuracy ); // JPW NERVE set from map, defaults to 20		G_Script_ScriptEvent( ent, "death", "" );		// Removes itself		ent->touch = 0;		ent->nextthink = level.time + FRAMETIME;		ent->think = G_FreeEntity;	}}
开发者ID:MAN-AT-ARMS,项目名称:iortcw-archive,代码行数:28,


示例3: HoldNoteScoreToDancePoints

void ScoreKeeperMAX2::HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ){	// update dance points totals	if( !m_pPlayerStageStats->bFailed )		m_pPlayerStageStats->iActualDancePoints += HoldNoteScoreToDancePoints( holdScore );	m_pPlayerStageStats->iCurPossibleDancePoints += HoldNoteScoreToDancePoints( HNS_OK );	m_pPlayerStageStats->iHoldNoteScores[holdScore] ++;	// increment the current total possible dance score	m_pPlayerStageStats->iCurPossibleDancePoints += HoldNoteScoreToDancePoints( HNS_OK );	if( holdScore == HNS_OK )		AddScore( TNS_MARVELOUS );	else if ( holdScore == HNS_NG )		AddScore( TNS_GOOD ); // required for subtractive score display to work properly	// TODO: Remove indexing with PlayerNumber	PlayerNumber pn = m_pPlayerState->m_PlayerNumber;	NSMAN->ReportScore(		pn, 		holdScore+TNS_MARVELOUS,         m_pPlayerStageStats->iScore,        m_pPlayerStageStats->iCurCombo );}
开发者ID:Prcuvu,项目名称:StepMania-3.95,代码行数:25,


示例4: ObeliskDie

/*=======================================================================================================================================ObeliskDie=======================================================================================================================================*/static void ObeliskDie(gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod) {	int otherTeam;	otherTeam = OtherTeam(self->spawnflags);	self->takedamage = qfalse;	self->think = ObeliskRespawn;	self->nextthink = level.time + g_obeliskRespawnDelay.integer * 1000;	self->activator->s.modelindex2 = 0xff;	self->activator->s.frame = 2;	G_AddEvent(self->activator, EV_OBELISKEXPLODE, 0);	if (self->spawnflags == attacker->client->sess.sessionTeam) {		AddScore(attacker, self->r.currentOrigin, -CTF_CAPTURE_BONUS);	} else {		AddScore(attacker, self->r.currentOrigin, CTF_CAPTURE_BONUS);		attacker->client->rewardTime = level.time + REWARD_TIME;		attacker->client->ps.persistant[PERS_CAPTURES]++;	}	AddTeamScore(self->s.pos.trBase, otherTeam, 1);	CalculateRanks();	Team_CaptureFlagSound(self, self->spawnflags);	Team_ForceGesture(otherTeam);	teamgame.redObeliskAttackedTime = 0;	teamgame.blueObeliskAttackedTime = 0;	trap_SendServerCommand(-1, va("cp /"%s" S_COLOR_WHITE "/ndestroyed the %s obelisk!/n/"", attacker->client->pers.netname, TeamName(self->spawnflags)));}
开发者ID:KuehnhammerTobias,项目名称:ioqw,代码行数:37,


示例5: Touch_flagonly

void Touch_flagonly (gentity_t *ent, gentity_t *other, trace_t *trace) {	gentity_t* tmp;	if (!other->client)		return;		if ( ent->spawnflags & RED_FLAG && other->client->ps.powerups[ PW_REDFLAG ] ) {		if( ent->spawnflags & 4 ) {			other->client->ps.powerups[ PW_REDFLAG ] = 0;			other->client->speedScale = 0;		}		AddScore(other, ent->accuracy); // JPW NERVE set from map, defaults to 20		//G_AddExperience( other, 2.f );		tmp = ent->parent;		ent->parent = other;		G_Script_ScriptEvent( ent, "death", "" );		G_Script_ScriptEvent( &g_entities[other->client->flagParent], "trigger", "captured" );		ent->parent = tmp;		// Removes itself		ent->touch = NULL;		ent->nextthink = level.time + FRAMETIME;		ent->think = G_FreeEntity;	} else if ( ent->spawnflags & BLUE_FLAG && other->client->ps.powerups[ PW_BLUEFLAG ] ) {		if( ent->spawnflags & 4 ) {			other->client->ps.powerups[ PW_BLUEFLAG ] = 0;			other->client->speedScale = 0;		}		AddScore(other, ent->accuracy); // JPW NERVE set from map, defaults to 20		//G_AddExperience( other, 2.f );		tmp = ent->parent;		ent->parent = other;		G_Script_ScriptEvent( ent, "death", "" );		G_Script_ScriptEvent( &g_entities[other->client->flagParent], "trigger", "captured" );		ent->parent = tmp;		// Removes itself		ent->touch = NULL;		ent->nextthink = level.time + FRAMETIME;		ent->think = G_FreeEntity;	}}
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:56,


示例6: AddScore

bool Actor::Clicked(const Point p) {	if(IsValidAddPoint(p)) {		if (mArea.AddPoint(p)) {			AddScore(1);			AddScore(10*World::get_mutable_instance().PointAdded(p, mId));			return true;		}	}	return false;}
开发者ID:opatut,项目名称:gamejam,代码行数:10,


示例7: Touch_flagonly_multiple

void Touch_flagonly_multiple(gentity_t * ent, gentity_t * other, trace_t * trace){	gentity_t      *tmp;	if(!other->client)	{		return;	}	if(ent->spawnflags & RED_FLAG && other->client->ps.powerups[PW_REDFLAG])	{		other->client->ps.powerups[PW_REDFLAG] = 0;		other->client->speedScale = 0;		AddScore(other, ent->accuracy);	// JPW NERVE set from map, defaults to 20		//G_AddExperience( other, 2.f );		tmp = ent->parent;		ent->parent = other;		G_Script_ScriptEvent(ent, "death", "");		G_Script_ScriptEvent(&g_entities[other->client->flagParent], "trigger", "captured");#ifdef OMNIBOT		Bot_Util_SendTrigger(ent, NULL, va("Allies captured %s", ent->scriptName), "");#endif		ent->parent = tmp;	}	else if(ent->spawnflags & BLUE_FLAG && other->client->ps.powerups[PW_BLUEFLAG])	{		other->client->ps.powerups[PW_BLUEFLAG] = 0;		other->client->speedScale = 0;		AddScore(other, ent->accuracy);	// JPW NERVE set from map, defaults to 20		//G_AddExperience( other, 2.f );		tmp = ent->parent;		ent->parent = other;		G_Script_ScriptEvent(ent, "death", "");		G_Script_ScriptEvent(&g_entities[other->client->flagParent], "trigger", "captured");#ifdef OMNIBOT		Bot_Util_SendTrigger(ent, NULL, va("Axis captured %s", ent->scriptName), "");#endif		ent->parent = tmp;	}}
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:53,


示例8: AddScore

void CObject::CheckHitRect(CBullet &bullet, CBoss &boss){	for(int i = 0;i < BULLET_MAX;i++)	{		if(bullet.Flag[i])		{				if(boss.IsExist && boss.counter > 200)			{				if(HitCheck(bullet.HitRect[i], boss.HitRect) )				{					bullet.Flag[i] = FALSE;										bullet.IsRefrect[i] = FALSE;										bullet.SetPosition(i);										boss.CalcDamage(bullet.Attack, boss.Defence);										AddScore(boss.Score);									}			}		}			}}
开发者ID:Taka03,项目名称:Nolfeus,代码行数:27,


示例9: CheckShipBulletCollision

// Check if the ship's bullet has hit an invadervoid CheckShipBulletCollision(){	for ( int i = 0; i < INVADER_ROW_COUNT; i++ )	{		for ( int j = 0; j < INVADER_ROW_POPULATION; j++ )		{			invader_t *invader = &invaders[i][j];			if ( !invader->alive )				continue;			if ( bullety >= invader->y && bullety <= invader->y + invader->h )			{				if ( bulletx >= invader->x && bulletx <= invader->x + invader->w )				{					firing = false;					invader->alive = false;					killcount++;					AddScore( KILLPOINTS );										if ( killcount >= INVADER_ROW_COUNT * INVADER_ROW_POPULATION )						gameover = true;					return;				}			}		}	}	}
开发者ID:Fraaaan14,项目名称:christopherthorne,代码行数:33,


示例10: Use_Target_Score

/*QUAKED target_score (1 0 0) (-8 -8 -8) (8 8 8)"count" number of points to add, default 1The activator is given this many points.*/void Use_Target_Score (gentity_t *ent, gentity_t *other, gentity_t *activator) {	/* LQ3A */	UNREFERENCED_PARAMETER(other);	AddScore( activator, ent->r.currentOrigin, ent->count );}
开发者ID:monoknot,项目名称:loaded-q3a,代码行数:12,


示例11: if

//分析单只void CAndroidAI::AnalyseOne(){	BYTE byCard;	int nScore;	int nMin = 33;	for(int i = 0;i < m_byRemainTwoCount;i++ )	//找出最差的一张牌	{		byCard = m_byRemainTwo[i];		if( byCard >= 27 )						//如果是字		{			nScore = 2;		}		else if( byCard%9 == 0 || byCard%9 == 8 )	//如果是一或者九		{			nScore = 6;		}		else 		{			nScore = 10;		}		nScore += AddScore(byCard);		if( nScore < nMin )		{			nMin = nScore;			m_byBadlyCard = byCard;		}	}}
开发者ID:Michael-Z,项目名称:qipai-game,代码行数:31,


示例12: ObeliskTouch

static void ObeliskTouch( gentity_t *self, gentity_t *other, trace_t *trace ) {	int			tokens;	if ( !other->client ) {		return;	}	if ( OtherTeam(other->client->sess.sessionTeam) != self->spawnflags ) {		return;	}	tokens = other->client->ps.generic1;	if( tokens <= 0 ) {		return;	}	PrintMsg(NULL, "%s" S_COLOR_WHITE " brought in %i skull%s./n",					other->client->pers.netname, tokens, tokens ? "s" : "" );	AddTeamScore(self->s.pos.trBase, other->client->sess.sessionTeam, tokens);	Team_ForceGesture(other->client->sess.sessionTeam);	AddScore(other, self->r.currentOrigin, CTF_CAPTURE_BONUS*tokens);	// add the sprite over the player's head	other->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );	other->client->ps.eFlags |= EF_AWARD_CAP;	other->client->rewardTime = level.time + REWARD_SPRITE_TIME;	other->client->ps.persistant[PERS_CAPTURES] += tokens;		other->client->ps.generic1 = 0;	CalculateRanks();	Team_CaptureFlagSound( self, self->spawnflags );}
开发者ID:DingoOz,项目名称:Quake3-GLES-for-armv7,代码行数:35,


示例13: m_game

ScoreboardSurface::ScoreboardSurface(GameSurface& gameSurface)	: m_game(gameSurface)	, m_titleFont(nullptr, TTF_CloseFont)	, m_font(nullptr, TTF_CloseFont)	, m_title(nullptr, SDL_FreeSurface)	, m_timeTitle(nullptr, SDL_FreeSurface)	, m_timeText(nullptr, SDL_FreeSurface)	, m_scoreTitle(nullptr, SDL_FreeSurface)	, m_scoreText(nullptr, SDL_FreeSurface)	, m_defaultColor({ 0xFF, 0xFF, 0x00, 0xFF }){	TTF_Init();	m_titleFont.reset(TTF_OpenFont(k_font.c_str(), 48));	SDL_assert(m_titleFont);	m_font.reset(TTF_OpenFont(k_font.c_str(), 30));	SDL_assert(m_font);	m_title.reset(TTF_RenderText_Solid(m_titleFont.get(), "Grid Miner",		SDL_Color{ 0x00, 0x00, 0x00, 0xFF }));	SDL_assert(m_title);	m_timeTitle.reset(TTF_RenderText_Solid(m_font.get(), "Time", 		m_defaultColor));	m_scoreTitle.reset(TTF_RenderText_Solid(m_font.get(), "Score", 		m_defaultColor));	AddScore(0);}
开发者ID:jsfdez,项目名称:gridminer,代码行数:26,


示例14: list

bool CScore::LoadHighScore () {	CSPList list (520);	Scorelist.resize(Course.CourseList.size());	if (!list.Load (param.config_dir, "highscore")) {		Message ("could not load highscore list");		return false;	}	for (size_t i=0; i<list.Count(); i++) {		const string& line = list.Line(i);		string course = SPStrN (line, "course", "unknown");		TCourse* cidx = Course.GetCourse(course);		TScore score;		score.player = SPStrN (line, "plyr", "unknown");		score.points = SPIntN (line, "pts", 0);		score.herrings = SPIntN (line, "herr", 0);		score.time = SPFloatN (line, "time", 0);		AddScore (cidx, score);	}	return true;}
开发者ID:pseuudonym404,项目名称:tuxracer-touch,代码行数:25,


示例15: ObeliskDie

static voidObeliskDie(Gentity *self, Gentity *inflictor, Gentity *attacker,	   int damage,	   int mod){	int otherTeam;	otherTeam = OtherTeam(self->spawnflags);	AddTeamScore(self->s.pos.base, otherTeam, 1);	Team_ForceGesture(otherTeam);	CalculateRanks();	self->takedamage = qfalse;	self->think = ObeliskRespawn;	self->nextthink = level.time + g_obeliskRespawnDelay.integer * 1000;	self->activator->s.modelindex2 = 0xff;	self->activator->s.frame = 2;	G_AddEvent(self->activator, EV_OBELISKEXPLODE, 0);	AddScore(attacker, self->r.currentOrigin, CTF_CAPTURE_BONUS);	/* add the sprite over the player's head */	attacker->client->ps.eFlags &=		~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET |		  EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP);	attacker->client->ps.eFlags |= EF_AWARD_CAP;	attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME;	attacker->client->ps.persistant[PERS_CAPTURES]++;	teamgame.redObeliskAttackedTime = 0;	teamgame.blueObeliskAttackedTime = 0;}
开发者ID:icanhas,项目名称:yantar,代码行数:35,


示例16: Team_TouchEnemyFlag

intTeam_TouchEnemyFlag(Gentity *ent, Gentity *other, int team){	Gclient *cl = other->client;	if(g_gametype.integer == GT_1FCTF){		PrintMsg (NULL, "%s" S_COLOR_WHITE " got the flag!/n",			other->client->pers.netname);		cl->ps.powerups[PW_NEUTRALFLAG] = INT_MAX;	/* flags never expire */		if(team == TEAM_RED)			Team_SetFlagStatus(TEAM_FREE, FLAG_TAKEN_RED);		else			Team_SetFlagStatus(TEAM_FREE, FLAG_TAKEN_BLUE);	}else{	PrintMsg (NULL, "%s" S_COLOR_WHITE " got the %s flag!/n",		other->client->pers.netname, TeamName(team));	if(team == TEAM_RED)		cl->ps.powerups[PW_REDFLAG] = INT_MAX;	/* flags never expire */	else		cl->ps.powerups[PW_BLUEFLAG] = INT_MAX;		/* flags never expire */	Team_SetFlagStatus(team, FLAG_TAKEN);	}	AddScore(other, ent->r.currentOrigin, CTF_FLAG_BONUS);	cl->pers.teamState.flagsince = level.time;	Team_TakeFlagSound(ent, team);	return -1;	/* Do not respawn this automatically, but do delete it if it was FL_DROPPED */}
开发者ID:icanhas,项目名称:yantar,代码行数:33,


示例17: Use_Target_Score

/*QUAKED target_score (1 0 0) (-8 -8 -8) (8 8 8)"count" number of points to add, default 1The activator is given this many points.*/void Use_Target_Score( gentity_t *ent, gentity_t *other, gentity_t *activator ){  if( !activator )    return;  AddScore( activator, ent->count );}
开发者ID:norfenstein,项目名称:umbra,代码行数:12,


示例18: Team_TouchEnemyFlag

/*=======================================================================================================================================Team_TouchEnemyFlag=======================================================================================================================================*/int Team_TouchEnemyFlag(gentity_t *ent, gentity_t *other, int team) {	gclient_t *cl = other->client;	if (g_gametype.integer == GT_1FCTF) {		PrintMsg(NULL, "%s" S_COLOR_WHITE " got the flag!/n", other->client->pers.netname);		cl->ps.powerups[PW_NEUTRALFLAG] = INT_MAX; // flags never expire		if (team == TEAM_RED) {			Team_SetFlagStatus(TEAM_FREE, FLAG_TAKEN_RED);		} else {			Team_SetFlagStatus(TEAM_FREE, FLAG_TAKEN_BLUE);		}	} else {		PrintMsg(NULL, "%s" S_COLOR_WHITE " got the %s flag!/n", other->client->pers.netname, TeamName(team));		if (team == TEAM_RED) {			cl->ps.powerups[PW_REDFLAG] = INT_MAX; // flags never expire		} else {			cl->ps.powerups[PW_BLUEFLAG] = INT_MAX; // flags never expire		}		Team_SetFlagStatus(team, FLAG_TAKEN);	}	AddScore(other, ent->r.currentOrigin, CTF_FLAG_BONUS);	Team_TakeFlagSound(ent, team);	return -1; // do not respawn this automatically, but do delete it if it was FL_DROPPED}
开发者ID:KuehnhammerTobias,项目名称:ioqw,代码行数:35,


示例19: ObeliskTouch

/*=======================================================================================================================================ObeliskTouch=======================================================================================================================================*/static void ObeliskTouch(gentity_t *self, gentity_t *other, trace_t *trace) {	int tokens;	team_t otherTeam;	if (!other->client) {		return;	}	otherTeam = OtherTeam(other->client->sess.sessionTeam);	if (otherTeam != self->spawnflags) {		return;	}	tokens = other->client->ps.tokens;	if (tokens <= 0) {		return;	}	trap_SendServerCommand(-1, va("cp /"%s" S_COLOR_WHITE "/nbrought in %i %s %s!/n/"", other->client->pers.netname, tokens, TeamName(otherTeam), (tokens == 1) ? "skull" : "skulls"));	other->client->rewardTime = level.time + REWARD_TIME;	other->client->ps.persistant[PERS_CAPTURES] += tokens;	other->client->ps.tokens = 0;	AddScore(other, self->r.currentOrigin, CTF_CAPTURE_BONUS * tokens);	AddTeamScore(self->s.pos.trBase, other->client->sess.sessionTeam, tokens);	CalculateRanks();	Team_CaptureFlagSound(self, self->spawnflags);	Team_ForceGesture(other->client->sess.sessionTeam);}
开发者ID:KuehnhammerTobias,项目名称:ioqw,代码行数:37,


示例20: Pickup_Health

int Pickup_Health (gentity_t *ent, gentity_t *other) {	int			max;	int			quantity = 0;	// if medic isn't giving ammo to self or another medic or the enemy, give him some props	if( other->client->ps.stats[STAT_PLAYER_CLASS] != PC_MEDIC ) {		if( ent->parent && ent->parent->client && other->client->sess.sessionTeam == ent->parent->client->sess.sessionTeam ) {			if (!(ent->parent->client->PCSpecialPickedUpCount % MEDIC_SPECIAL_PICKUP_MOD)) {				AddScore(ent->parent, WOLF_HEALTH_UP);				G_LogPrintf("Health_Pack: %d %d/n", ent->parent - g_entities, other - g_entities);	// OSP			}			G_AddSkillPoints( ent->parent, SK_FIRST_AID, 1.f );			G_DebugAddSkillPoints( ent->parent, SK_FIRST_AID, 1.f, "health pack picked up" ); 			ent->parent->client->PCSpecialPickedUpCount++;		}	}			max = other->client->ps.stats[STAT_MAX_HEALTH];	if( other->client->sess.playerType == PC_MEDIC ) {		max *= 1.12f;	}	other->health += ent->item->quantity;	if (other->health > max ) {		other->health = max;	}	other->client->ps.stats[STAT_HEALTH] = other->health;	return -1;}
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:30,


示例21: ObeliskPain

static void ObeliskPain( gentity_t *self, gentity_t *attacker, int damage ) {	int actualDamage = damage / 10;	if (actualDamage <= 0) {		actualDamage = 1;	}	self->activator->s.modelindex2 = self->health * 0xff / g_obeliskHealth.integer;	if (!self->activator->s.frame) {		G_AddEvent(self, EV_OBELISKPAIN, 0);	}	self->activator->s.frame = 1;	AddScore(attacker, self->r.currentOrigin, actualDamage);}
开发者ID:DingoOz,项目名称:Quake3-GLES-for-armv7,代码行数:12,


示例22: ObeliskPain

/*=======================================================================================================================================ObeliskPain=======================================================================================================================================*/void ObeliskPain(gentity_t *self, gentity_t *attacker, int damage) {	int actualDamage;	actualDamage = damage / 10;	if (actualDamage <= 0) {		actualDamage = 1;	}	self->activator->s.modelindex2 = self->health * 0xff / g_obeliskHealth.integer;	if (!self->activator->s.frame) {		G_AddEvent(self, EV_OBELISKPAIN, 0);	}	self->activator->s.frame = 1;	if (self->spawnflags == attacker->client->sess.sessionTeam) {		AddScore(attacker, self->r.currentOrigin, -actualDamage);	} else {		AddScore(attacker, self->r.currentOrigin, actualDamage);	}}
开发者ID:KuehnhammerTobias,项目名称:ioqw,代码行数:28,


示例23: Pickup_Health

int Pickup_Health (gentity_t *ent, gentity_t *other) {	int			max;//	int			quantity = 0;	// tjw: addef for g_shortcuts	if(ent->parent && ent->parent->client)		other->client->pers.lasthealth_client = ent->parent->s.clientNum;	// if medic isn't giving ammo to self or another medic or the enemy, give him some props	if( other->client->ps.stats[STAT_PLAYER_CLASS] != PC_MEDIC ) {		if( ent->parent && ent->parent->client && other->client->sess.sessionTeam == ent->parent->client->sess.sessionTeam ) {			if (!(ent->parent->client->PCSpecialPickedUpCount % MEDIC_SPECIAL_PICKUP_MOD)) {				AddScore(ent->parent, WOLF_HEALTH_UP);				G_LogPrintf("Health_Pack: %d %d/n", ent->parent - g_entities, other - g_entities);	// OSP			}			// forty - #474 - don't give xp if we're picking up our own med packs.			if(other != ent->parent) {				G_AddSkillPoints( ent->parent, SK_FIRST_AID, 1.f );				G_DebugAddSkillPoints( ent->parent, SK_FIRST_AID, 1.f, "health pack picked up" );			}			ent->parent->client->PCSpecialPickedUpCount++;		}	}	max = other->client->ps.stats[STAT_MAX_HEALTH];	if( other->client->sess.playerType == PC_MEDIC ) {		max *= 1.12f;	}	other->health += ent->item->quantity;	// unpoison ourself if we pick up meds	other->client->pmext.poisoned = qfalse;	other->client->ps.viewlocked = 0;	other->client->ps.viewlocked_entNum = 0;	if (other->health > max ) {		other->health = max;	}	other->client->ps.stats[STAT_HEALTH] = other->health;	//omni-bot event	if ( ent->parent )		Bot_Event_Healed(other-g_entities, ent->parent);	return -1;}
开发者ID:thewolfteam,项目名称:Reloaded,代码行数:49,


示例24: Pickup_Health

/*** @brief Pick health.*/int Pickup_Health(gentity_t *ent, gentity_t *other){	int max;	if (ent->parent && ent->parent->client)	{		other->client->pers.lasthealth_client = ent->parent->s.clientNum;	}	// if medic isn't giving ammo to self or another medic or the enemy, give him some props	if (other->client->ps.stats[STAT_PLAYER_CLASS] != PC_MEDIC)	{		if (ent->parent && ent->parent->client && other->client->sess.sessionTeam == ent->parent->client->sess.sessionTeam)		{			if (!(ent->parent->client->PCSpecialPickedUpCount % MEDIC_SPECIAL_PICKUP_MOD))			{				AddScore(ent->parent, WOLF_HEALTH_UP);				G_LogPrintf("Health_Pack: %d %d/n", (int)(ent->parent - g_entities), (int)(other - g_entities));			}			G_AddSkillPoints(ent->parent, SK_FIRST_AID, 1.f);			G_DebugAddSkillPoints(ent->parent, SK_FIRST_AID, 1.f, "health pack picked up");			ent->parent->client->PCSpecialPickedUpCount++;		}	}	max = other->client->ps.stats[STAT_MAX_HEALTH];	if (other->client->sess.playerType == PC_MEDIC)	{		max *= 1.12f;	}	other->health += ent->item->quantity;	if (other->health > max)	{		other->health = max;	}	other->client->ps.stats[STAT_HEALTH] = other->health;#ifdef FEATURE_OMNIBOT	// omni-bot event	if (ent->parent)	{		Bot_Event_Healed(other - g_entities, ent->parent);	}#endif	return -1;}
开发者ID:gitter-badger,项目名称:etlegacy,代码行数:51,


示例25: RegisterActorDeath

//// AICTPGameGameMode::RegisterActorDeath//void AICTPGameGameMode::RegisterActorDeath( float DamageAmount, AActor* DamagedActor, AActor* DamageCauser ){	OnActorDeath.Broadcast( DamageAmount, DamagedActor, DamageCauser );	auto DamagerPlayerController = Cast<ARobotPlayerController>( DamageCauser->GetInstigatorController() );	if( DamagerPlayerController == nullptr )	{		return;	}	auto ScoreComponent = DamagedActor->FindComponentByClass<UScoreComponent>();	if( ScoreComponent == nullptr )	{		return;	}	DamagerPlayerController->AddScore( ScoreComponent->GetScore() );}
开发者ID:Bonnn,项目名称:Super-Robot-Rumble,代码行数:21,



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


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