Пример #1
0
// Constructor
trpgAttach::trpgAttach()
{
    name = 0;
    Reset();
}
Пример #2
0
 boss_infinite_corruptorAI(Creature* creature) : ScriptedAI(creature)
 {
     pInstance = me->GetInstanceScript();
     timeRift = NULL;
     Reset();
 }
Пример #3
0
void GameMain::Update(){
  if (true == is_game_end){
	  if (ResMed.Get(AudioKey::Game).isPlaying()){
		  ResMed.Get(AudioKey::Game).stop();
	  }
	if (!ResMed.Get(AudioKey::TimeOut).isPlaying()){
		ResMed.Get(AudioKey::TimeOut).play();
	}
  }
  if (true == is_end){
	  scene_manager->ChangeScene(std::shared_ptr<Result>(new Result(result)));
	  return;
  }

  if (!ResMed.Get(AudioKey::Game).isPlaying()){
    ResMed.Get(AudioKey::Game).play();
    ResMed.Get(AudioKey::Game).looping(true);
  }
  if (food_click_limit == 0){
    if (Collision::MouseToBox(App::Get().mousePosition(), food[0]->GetBox())){
      if (App::Get().isPushButton(Mouse::LEFT)){
        ResMed.Get(AudioKey::Eating).play();
        selected.push_back(SelectedFood(Position::Left, food[0]->GetFoodType(), food[0]->GetFoodVariation()));
        AddFood(food[0]->GetFoodType());
        Reset();
      }
    }

    if (App::Get().isPushKey(GLFW_KEY_LEFT_SHIFT) || App::Get().isPushKey('Z')){
      ResMed.Get(AudioKey::Eating).play();
      selected.push_back(SelectedFood(Position::Left, food[0]->GetFoodType(), food[0]->GetFoodVariation()));
      AddFood(food[0]->GetFoodType());
      Reset();
    }

    if (Collision::MouseToBox(App::Get().mousePosition(), food[1]->GetBox())){
      if (App::Get().isPushButton(Mouse::LEFT)){
        ResMed.Get(AudioKey::Eating).play();
        selected.push_back(SelectedFood(Position::Middle, food[1]->GetFoodType(), food[1]->GetFoodVariation()));
        AddFood(food[1]->GetFoodType());
        Reset();
      }
    }

    if (App::Get().isPushKey(GLFW_KEY_SPACE) || App::Get().isPushKey('B')){
      ResMed.Get(AudioKey::Eating).play();
      selected.push_back(SelectedFood(Position::Middle, food[1]->GetFoodType(), food[1]->GetFoodVariation()));
      AddFood(food[1]->GetFoodType());
      Reset();
    }

    if (Collision::MouseToBox(App::Get().mousePosition(), food[2]->GetBox())){
      if (App::Get().isPushButton(Mouse::LEFT) || App::Get().isPushKey(GLFW_KEY_RIGHT_SHIFT)){
        ResMed.Get(AudioKey::Eating).play();
        selected.push_back(SelectedFood(Position::Right, food[2]->GetFoodType(), food[2]->GetFoodVariation()));
        AddFood(food[2]->GetFoodType());
        Reset();
      }
    }

    if (App::Get().isPushKey(GLFW_KEY_RIGHT_SHIFT) || App::Get().isPushKey(GLFW_KEY_SLASH)){
      ResMed.Get(AudioKey::Eating).play();
      selected.push_back(SelectedFood(Position::Right, food[2]->GetFoodType(), food[2]->GetFoodVariation()));
      AddFood(food[2]->GetFoodType());
      Reset();
    }
  }

  for (auto& itr : selected){
    itr.Update();
  }

  UpdateList();
  if (true != is_game_end){
	  if (food_click_limit > 0){
		  food_click_limit--;
	  }
  }

  time_limit--;
  if (time_limit < ENDWAITTIME){
    is_game_end = true;
  }
  if (time_limit < 0){
	  is_end = true;
  }
}
Пример #4
0
 boss_hazzarahAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
Пример #5
0
 mob_frost_bombAI(Creature* pCreature) : ScriptedAI(pCreature)
 {
     m_pInstance = (instance_icecrown_citadel*)pCreature->GetInstanceData();
     Reset();
 }
Пример #6
0
void ProcessModeMatch::InitProcess()
{
	if (!Enabled) return;

	if (m_Eng_Interface==NULL)
	{
		cerr << "ProcessModeMatch::InitProcess: Error, Engine_Interface is NULL, abort mode mathcing..." << endl;
		Enabled=false;
		return;
	}
	m_Eng_Interface->SetInterpolationType(Engine_Interface_Base::NODE_INTERPOLATE);

	int Dump_Dim=0;
	m_ny = -1;
	for (int n=0; n<3; ++n)
	{
		if (start[n]>stop[n])
		{
			unsigned int help=start[n];
			start[n]=stop[n];
			stop[n]=help;
		}

		//exclude boundaries from mode-matching
		if (start[n]==0)
			++start[n];
		if (stop[n]==Op->GetNumberOfLines(n)-1)
			--stop[n];

		if (stop[n]!=start[n])
			++Dump_Dim;

		if (stop[n] == start[n])
			m_ny = n;
	}

	if ((Dump_Dim!=2) || (m_ny<0))
	{
		cerr << "ProcessModeMatch::InitProcess(): Warning Mode Matching Integration Box \"" << m_filename << "\" is not a surface (found dimension: " << Dump_Dim << ")" << endl;
		SetEnable(false);
		Reset();
		return;
	}

	int nP = (m_ny+1)%3;
	int nPP = (m_ny+2)%3;
	m_numLines[0] = stop[nP] - start[nP] + 1;
	m_numLines[1] = stop[nPP] - start[nPP] + 1;

	for (int n=0; n<2; ++n)
	{
		int ny = (m_ny+n+1)%3;
		int res = m_ModeParser[n]->Parse(m_ModeFunction[ny], "x,y,z,rho,a,r,t");
		if (res >= 0)
		{
			cerr << "ProcessModeMatch::InitProcess(): Warning, an error occured parsing the mode matching function (see below) ..." << endl;
			cerr << m_ModeFunction[ny] << "\n" << string(res, ' ') << "^\n" << m_ModeParser[n]->ErrorMsg() << "\n";
			SetEnable(false);
			Reset();
		}
	}

	for (int n=0; n<2; ++n)
	{
		m_ModeDist[n] = Create2DArray<double>(m_numLines);
	}

	unsigned int pos[3] = {0,0,0};
	double discLine[3] = {0,0,0};
	double gridDelta = 1; // 1 -> mode-matching function is definied in drawing units...
	double var[7];
	pos[m_ny] = start[m_ny];
	discLine[m_ny] = Op->GetDiscLine(m_ny,pos[m_ny],m_dualMesh);
	double norm = 0;
	double area = 0;
	for (unsigned int posP = 0; posP<m_numLines[0]; ++posP)
	{
		pos[nP] = start[nP] + posP;
		discLine[nP] = Op->GetDiscLine(nP,pos[nP],m_dualMesh);
		for (unsigned int posPP = 0; posPP<m_numLines[1]; ++posPP)
		{
			pos[nPP] = start[nPP] + posPP;
			discLine[nPP] = Op->GetDiscLine(nPP,pos[nPP],m_dualMesh);

			var[0] = discLine[0] * gridDelta; // x
			var[1] = discLine[1] * gridDelta; // y
			var[2] = discLine[2] * gridDelta; // z
			var[3] = sqrt(discLine[0]*discLine[0] + discLine[1]*discLine[1]) * gridDelta; // rho = sqrt(x^2 + y^2)
			var[4] = atan2(discLine[1], discLine[0]); // a = atan(y,x)
			var[5] = sqrt(pow(discLine[0],2)+pow(discLine[1],2)+pow(discLine[2],2)) * gridDelta; // r
			var[6] = asin(1)-atan(var[2]/var[3]); //theta (t)

			if (m_Mesh_Type == CYLINDRICAL_MESH)
			{
				var[3] = discLine[0] * gridDelta; // rho
				var[4] = discLine[1]; // a
				var[0] = discLine[0] * cos(discLine[1]) * gridDelta; // x = r*cos(a)
				var[1] = discLine[0] * sin(discLine[1]) * gridDelta; // y = r*sin(a)
				var[5] = sqrt(pow(discLine[0],2)+pow(discLine[2],2)) * gridDelta; // r
				var[6] = asin(1)-atan(var[2]/var[3]); //theta (t)
			}
			area = Op->GetNodeArea(m_ny,pos,m_dualMesh);
			for (int n=0; n<2; ++n)
			{
				m_ModeDist[n][posP][posPP] = m_ModeParser[n]->Eval(var); //calc mode template
				if ((isnan(m_ModeDist[n][posP][posPP])) || (isinf(m_ModeDist[n][posP][posPP])))
					m_ModeDist[n][posP][posPP] = 0.0;
				norm += pow(m_ModeDist[n][posP][posPP],2) * area;
			}
//			cerr << discLine[0] << " " << discLine[1] << " : " << m_ModeDist[0][posP][posPP] << " , " << m_ModeDist[1][posP][posPP] << endl;
		}
	}

	norm = sqrt(norm);
//	cerr << norm << endl;
	// normalize template function...
	for (unsigned int posP = 0; posP<m_numLines[0]; ++posP)
		for (unsigned int posPP = 0; posPP<m_numLines[1]; ++posPP)
		{
			for (int n=0; n<2; ++n)
			{
				m_ModeDist[n][posP][posPP] /= norm;
			}
//			cerr << posP << " " << posPP << " : " << m_ModeDist[0][posP][posPP] << " , " << m_ModeDist[1][posP][posPP] << endl;
		}

	ProcessIntegral::InitProcess();
}
 mob_omrogg_headsAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
Пример #8
0
 npc_letollAI(Creature* pCreature) : npc_escortAI(pCreature)
 {
     m_uiEventTimer = 5000;
     m_uiEventCount = 0;
     Reset();
 }
Пример #9
0
 npc_mana_bomb_exp_triggerAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
Пример #10
0
 npc_captive_child(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
Пример #11
0
 npc_akunoAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); }
Пример #12
0
	// Frees a list.
	virtual void Free() {
		if (the_list_ != NULL)
			free(the_list_);
		Reset();
	}
Пример #13
0
trpgChildRef::~trpgChildRef()
{
    Reset();
}
Пример #14
0
trpgAttach::~trpgAttach()
{
    Reset();
}
Пример #15
0
/********************************************************************************
 Update the camera
 ********************************************************************************/
void Camera3::Update(double dt)
{
	// WASD movement
	if ( myKeys['w'] == true)
	{
		Walk( dt );
	}
	else
	{
		MoveVel_W = 0.0f;
	}
	if (myKeys['s'] == true)
	{
		Walk( -dt );
	}
	else
	{
		MoveVel_S = 0.0f;
	}
	if (myKeys['a'] == true)
	{
		Strafe( -dt );
	}
	else
	{
		MoveVel_A = 0.0f;
	}
	if (myKeys['d'] == true)
	{
		Strafe( dt );
	}
	else
	{
		MoveVel_D = 0.0f;
	}

	// Rotation
	if ( myKeys[VK_UP] == true)
	{
		LookUp( dt );
	}
	if (myKeys[VK_DOWN] == true)
	{
		LookUp( -dt );
	}
	if (myKeys[VK_LEFT] == true)
	{
		TurnLeft( -dt );
	}
	if (myKeys[VK_RIGHT] == true)
	{
		TurnRight( dt );
	}

	// Jump
	if (myKeys[32] == true)
	{
		Jump( dt );
		myKeys[32]	= false;
	}
	UpdateJump(dt);

	//Update the camera direction based on mouse move
	// left-right rotate
	if ( Application::camera_yaw != 0 )
		Yaw( dt );
	if ( Application::camera_pitch != 0 )
		Pitch( dt );

	if(Application::IsKeyPressed('R'))
	{
		Reset();
	}
}
Пример #16
0
PipeStream::~PipeStream() {
  Reset();
}
// ----------------------------------------------------------------------------
vHavokStiffSpringConstraintChainDesc::vHavokStiffSpringConstraintChainDesc()
: vHavokConstraintChainDesc(false)
{
  Reset();
}
//}}}
//{{{ Destructor
////////////////////////////////////////////////////////////////////////////
///
/// Destructor function, ensures a full halt and reset
/// are executed for all levels of the class.
///
Codec_MmeAudioPcm_c::~Codec_MmeAudioPcm_c(void)
{
	Halt();
	Reset();
}
Пример #19
0
DXProg_FillTex::DXProg_FillTex() {
	Reset();
}
Пример #20
0
 boss_ragefireAI(Creature* pCreature) : ScriptedAI(pCreature)
 {
     pInstance = (InstanceScript*)pCreature->GetInstanceScript();
     Reset();
 }
Пример #21
0
 boss_epoch_hunterAI(Creature* pCreature) : ScriptedAI(pCreature)
 {
     m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
     Reset();
 }
Пример #22
0
void CRandomSetSource::SetSource(const TDesC8& aSource)
	{
	iValue.Set(aSource);
	Reset();
	}
Пример #23
0
 boss_sindragosaAI(Creature* pCreature) : ScriptedAI(pCreature)
 {
     m_pInstance = (instance_icecrown_citadel*)pCreature->GetInstanceData();
     Reset();
 }
Пример #24
0
 mob_felkael_phoenixAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
StackAsArray::Iter::Iter (StackAsArray const& _stack) : stack (_stack)
{
	Reset ();
}
Пример #26
0
 mob_felkael_phoenix_eggAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) { Reset(); }
Пример #27
0
void CvDistanceMap::SetPlayer(PlayerTypes ePlayer)
{
	Reset();
	m_ePlayer = ePlayer;
}
Пример #28
0
 mob_arcane_sphereAI(Creature* pCreature) : ScriptedAI(pCreature)
 {
     m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
     Reset();
 }
Пример #29
0
            void UpdateAI(uint32 diff) override
            {
                if (!IsRunning)
                    return;

                if (EventProgress_Timer <= diff)
                {
                    if (instance->GetBossState(DATA_HARBINGER_SKYRISS) == FAIL)
                    {
                        Reset();
                        return;
                    }

                    if (CanSpawn)
                    {
                        //continue beam omega pod, unless we are about to summon skyriss
                        if (Phase != 7)
                            DoCast(me, SPELL_TARGET_OMEGA);

                        switch (Phase)
                        {
                        case 2:
                            switch (urand(0, 1))
                            {
                            case 0:
                                me->SummonCreature(ENTRY_TRICKSTER, 478.326f, -148.505f, 42.56f, 3.19f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
                                break;
                            case 1:
                                me->SummonCreature(ENTRY_PH_HUNTER, 478.326f, -148.505f, 42.56f, 3.19f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
                                break;
                            }
                            break;
                        case 3:
                            me->SummonCreature(ENTRY_MILLHOUSE, 413.292f, -148.378f, 42.56f, 6.27f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
                            break;
                        case 4:
                            Talk(YELL_RELEASE2B);
                            break;
                        case 5:
                            switch (urand(0, 1))
                            {
                            case 0:
                                me->SummonCreature(ENTRY_AKKIRIS, 420.179f, -174.396f, 42.58f, 0.02f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
                                break;
                            case 1:
                                me->SummonCreature(ENTRY_SULFURON, 420.179f, -174.396f, 42.58f, 0.02f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
                                break;
                            }
                            break;
                        case 6:
                            switch (urand(0, 1))
                            {
                            case 0:
                                me->SummonCreature(ENTRY_TW_DRAK, 471.795f, -174.58f, 42.58f, 3.06f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
                                break;
                            case 1:
                                me->SummonCreature(ENTRY_BL_DRAK, 471.795f, -174.58f, 42.58f, 3.06f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
                                break;
                            }
                            break;
                        case 7:
                            me->SummonCreature(ENTRY_SKYRISS, 445.763f, -191.639f, 44.64f, 1.60f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
                            Talk(YELL_WELCOME);
                            break;
                        }
                        CanSpawn = false;
                        ++Phase;
                    }
                    if (CanProgress())
                    {
                        switch (Phase)
                        {
                        case 1:
                            Talk(YELL_INTRO2);
                            EventProgress_Timer = 10000;
                            ++Phase;
                            break;
                        case 2:
                            Talk(YELL_RELEASE1);
                            DoPrepareForPhase();
                            EventProgress_Timer = 7000;
                            break;
                        case 3:
                            Talk(YELL_RELEASE2A);
                            DoPrepareForPhase();
                            EventProgress_Timer = 10000;
                            break;
                        case 4:
                            DoPrepareForPhase();
                            EventProgress_Timer = 15000;
                            break;
                        case 5:
                            Talk(YELL_RELEASE3);
                            DoPrepareForPhase();
                            EventProgress_Timer = 15000;
                            break;
                        case 6:
                            Talk(YELL_RELEASE4);
                            DoPrepareForPhase();
                            EventProgress_Timer = 15000;
                            break;
                        case 7:
                            DoPrepareForPhase();
                            EventProgress_Timer = 15000;
                            break;
                        }
                    }
                }
                else
                    EventProgress_Timer -= diff;
            }
Пример #30
0
// Constructor
trpgModelRef::trpgModelRef()
{
    Reset();
}