Esempio n. 1
0
void MUTI_SKILL_MANAGER::BornWithNumber(int number,float x,float y,float angle,int speed,bool lianfa, bool foe1,int damage1)
{
	HGE *hge = hgeCreate(HGE_VERSION);
	SKILL->born(0, 0, 0, 0);
	if (lianfa)
	{
		SKILL->setCD(5);
		lianfale = true;
	}
	else lianfale = false;
	if (number > 1)
	{
		BASE_ARROW *arrow = new BASE_ARROW[number];
		for (int i = 0; i < number; i++)
		{
			arrow[i].Init(x, y, angle-(i-0.5*number)*0.314, speed, foe1,damage1);// need test
			arrows.push_back(arrow[i]);
		}
		arrow_count += number;
	}
	else
	{
		BASE_ARROW *arrow = new BASE_ARROW;
			arrow->Init(x, y, angle, speed,foe1,damage1);
			arrows.push_back(*arrow);
		arrow_count += 1;
	}
	hge->Effect_Play(SKILL->sound);
	arrows.shrink_to_fit();
	//arrows.resize(arrow_count);
}
Esempio n. 2
0
void MUTI_SKILL_MANAGER::Render_Alive()
{
	HGE* hge = hgeCreate(HGE_VERSION);
	
	for (int i = 0; i != arrows.size(); ++i)
	{
		
		
		if (arrows[i].alive == false)
		{
			if (arrows[i].boomed == false)
			{
				MUTIBOOM *boomfish = new MUTIBOOM(boom, arrows[i].x, arrows[i].y, arrows[i].delta);
				boomfish->Play();
				boom_pool.push_back(*boomfish);
				delete boomfish;
				boomfish = NULL;
				arrows[i].boomed = true;
				hge->Effect_Play(effect);
			}
		}
		else
			SKILL->render(arrows[i].x, arrows[i].y, arrows[i].angle);
	}

	for (int i = 0; i < boom_pool.size(); ++i)
	{
	
		   boom_pool[i].anim->RenderEx(boom_pool[i].GetX(), boom_pool[i].GetY(), 0, boom_pool[i].GetSize(), boom_pool[i].GetSize());
		if (boom_pool[i].lifespan<=0)
		{
			delete boom_pool.cbegin()->anim;
			boom_pool.erase(boom_pool.cbegin());
		}
	}
	boom_pool.shrink_to_fit();



}