コード例 #1
0
ファイル: endboss.c プロジェクト: Acknex/Prince-of-Lotteria
void ebDoSparkle (ENTITY* e, int modulo)
{
	int i, numVertices = ent_status(e, 0);
	
	for (i = 0; i < numVertices; i++)
	{
		if (i % modulo == 0)
		{
			VECTOR pos;
			vec_for_vertex(&pos, e, i);
			
			effect(bossSparkle_p, 1, &pos, nullvector);
		}
	}
}
コード例 #2
0
ファイル: level.c プロジェクト: MasterQ32/SQEditor
function ent_setminmax(ENTITY *ent)
{
	VECTOR pos;
	vec_set(&ent->max_x, vector(-9999999, -9999999, -9999999));
	vec_set(&ent->min_x, vector(9999999, 9999999, 9999999));
	int i;
	CONTACT c;
	for(i = 1; i <= ent_status(ent, 0); i++)
	{
		VECTOR pos;
		ent_getvertex(ent, &c, i);
		pos.x = c.v->x;
		pos.y = c.v->z;
		pos.z = c.v->y;
		//vec_mul(&pos, &ent->scale_x);
		
		ent->max_x = maxv(pos.x, ent->max_x);
		ent->max_y = maxv(pos.y, ent->max_y);
		ent->max_z = maxv(pos.z, ent->max_z);
		ent->min_x = minv(pos.x, ent->min_x);
		ent->min_y = minv(pos.y, ent->min_y);
		ent->min_z = minv(pos.z, ent->min_z);
	}
}
コード例 #3
0
ファイル: endboss.c プロジェクト: Acknex/Prince-of-Lotteria
action ebWarghost ()
{
	g_entEbWarghost = my;
	my->material = g_mtlBossGhost;
	
	lvlLavaSuperReset ();
	
	var deadRotate = 0;
	
	var origScale = my->scale_x;
	var deadScale = origScale;
	
	BOOL isSpining = false;
	
	while (1)
	{
		// pos
		{
			VECTOR vecPos;
			vecPos.x = my->x;
			vecPos.y = 1024;
			vecPos.z = 150;
			
			if (player != NULL)
			{
				vecPos.x = player->x;
				vecPos.z = player->z;
			}
				
			vec_lerp(my->x, my->x, &vecPos, time_step * 0.025);
		}
		
		// ang
		{
			VECTOR vecLookAt, vecLook;
			vec_set(&vecLookAt, my->x);
			
			vecLookAt.y -= 1000;
			
			if (player != NULL)
			{
				vecLookAt.x = player->x;
				vecLookAt.y = player->y;
			}
			
			vec_diff(&vecLook, &vecLookAt, my->x);
			vec_to_angle(my->pan, &vecLook);
			
			if (!isEbWarghostAlive())
			{
				setPlayerControls(false);
				setPlayerPan(my);
				
				deadRotate += 10 * time_step;
				deadScale += 0.3 * time_step;
				
				g_sndEbVol = clamp(g_sndEbVol - g_sndEbVolDec * time_step, 0, 100);
				snd_tune(g_fhLvlLavastageSong, g_sndEbVol, 3, 0);
				
				if (!isSpining)
				{
					snd_play(g_sndBossSpin, 100, 0);
					snd_play(g_sndBossDeadSpeech, 100, 0);
					
					isSpining = true;
				}
			}
			
			my->pan += deadRotate;
			my->scale_x = my->scale_y = my->scale_z = deadScale;
			
			if (my->scale_x / origScale > 3)
				break;
		}
		
		if (g_ebDoHit)
			ent_animate(my, "jump", g_ebDoHitPercent, ANM_CYCLE);
		else
			ent_animate(my, "attack", total_ticks % 100, ANM_CYCLE);
			
		wait(1);
	}
	
	snd_play(g_sndBossSplatter, 100, 0);
	
	VECTOR vecPos, vecDir;
	int i, j, numVerts = ent_status(my, 0);
	
	snd_play(g_sndBossDead, 100, 0);
	
	set(my, INVISIBLE);
	
	for (i = 0; i < numVerts; i++)
	{
		vec_for_vertex(&vecPos, my, i+1);
		
		vec_diff(&vecDir, &vecPos, my->x);
		vec_normalize(&vecDir, 1);
		
		effEbBlood(&vecPos, &vecDir, 25+random(100), false, 1, 4 + random(4));
	}
	
	while (redness < 100)
	{
		redness = clamp(redness + g_rednessInc * time_step, 0, 100);
		
		g_sndEbVol = clamp(g_sndEbVol - g_sndEbVolDec * time_step, 0, 100);
		snd_tune(g_fhLvlLavastageSong, g_sndEbVol, 5, 0);		
		
		wait(1);
	}
	
	wait(-1);
	
	proc_mode = PROC_GLOBAL;
	ptr_remove(my);
	
	creditsInit();
}