Esempio n. 1
0
	void daBalboa_c::executeState_ThrowWrench() {

		float frame = this->animationChr.getCurrentFrame();
		if (frame == 54.0) {
			u32 settings;
			u8 up = this->upsideDown;
			u8 throwc = this->throwCount;
			u8 dir;

			if (this->direction) { dir = 0; }
			else 				 { dir = 1; }

			settings = (dir) | (up << 1);
			settings = settings | (throwc & 1 << 8);

			if (this->isBigBoss == 1) { settings = settings | 0x10; }

			CreateActor(544, settings, this->pos, 0, 0);
		}

		if(this->animationChr.isAnimationDone()) {
			this->throwCount += 1;

			if (this->throwCount & 1) {
				bindAnimChr_and_setUpdateRate("throw_4_left_hand", 1, 0.0, throwRate);
			}
			else {
				bindAnimChr_and_setUpdateRate("throw_4_right_hand", 1, 0.0, throwRate);
			}
		}

		if (this->throwCount > throwMax) {
			doStateChange(&StateID_BackDown); }
	}
void ActorFactory::LoadFile(const char* i_szFilename)
{
	if(!i_szFilename)
	{
		MGD_LOG::LOGManager::GetSingleton().WriteLog(MGD_LOG::MGD_ERROR, ACTOR_FACTORY_CONTEXT, "File name incorrect: %s", i_szFilename);
		return;
	}

	tinyxml2::XMLDocument oDocument;
	tinyxml2::XMLError oErr = oDocument.LoadFile(i_szFilename);
	if(oErr != tinyxml2::XML_NO_ERROR)
	{
		MGD_LOG::LOGManager::GetSingleton().WriteLog(MGD_LOG::MGD_ERROR, ACTOR_FACTORY_CONTEXT, "Error loading file: %s", i_szFilename);
		return;
	}
	const tinyxml2::XMLElement* pRoot = oDocument.RootElement();
	if(pRoot)
	{
		MGDVector<Component*> oNewComponents;
		
		//CREATE ACTOR TEMPLATES
		for (const tinyxml2::XMLElement* pTemplateActor = pRoot->FirstChildElement("TemplateActor"); pTemplateActor; pTemplateActor = pTemplateActor->NextSiblingElement("TemplateActor"))
		{
			CreateTemplateActor(pTemplateActor);
		}

		//CREATE ACTOR
		for (const tinyxml2::XMLElement* pActor = pRoot->FirstChildElement("Actor"); pActor; pActor = pActor->NextSiblingElement("Actor"))
		{
			CreateActor(pActor, oNewComponents);			
		}

		InitComponents(oNewComponents);
	}
}
Esempio n. 3
0
	GameStrategy::GameStrategy( HGEHelpers::HGESharedPtr hge, const Options& options ) : ApplicationStrategy ( hge ),
																	 mField ( new Field () ), 																		
																	 mWinnerBanner ( hge )
	{
		mField->CreateCells( hge );
		
		CellState userShape = options.GetUserShape();
		TypeActor opponent = options.GetTypeActor();

		CellState opponentShape = empty;
		if ( opponent != TA_User )
			opponentShape = ( userShape == cross ? nill : cross ) ;

		mOpponent = CreateActor ( opponent, hge, opponentShape );
		mUser = CreateActor ( TA_User,  hge, userShape );

		mGameJournal = std::tr1::shared_ptr<GameJournal> ( new GameJournal ( userShape, mOpponent, mUser ) );
	}
Esempio n. 4
0
Palleon::CEmbedRemoteCall CWorldEditor::ProcessCreateActor(const Palleon::CEmbedRemoteCall& rpc)
{
	try
	{
		auto id = boost::lexical_cast<uint32>(rpc.GetParam(WORLDEDITOR_PARAM_ID));
		CreateActor(id);
		return MakeSuccessRpc();
	}
	catch(...)
	{
		return MakeFailureRpc();
	}
}
Esempio n. 5
0
//============================================================================
//ファイル読み込み
//============================================================================
//[input]
//	pRender:レンダラー用デバイス
//	pFileMgr:ファイル管理用デバイス
//===========================================================================
void CCharacter::Load( Renderer::IRender *pRender, File::IFileManager *pFileMgr )
{
	printf("LOAD MODEL[%s]", m_strFileName.c_str() );
	
	pFileMgr->SetCurrentPath("Model");
	
	m_pModel = pRender->CreateModelFromFile( m_strFileName.c_str() );
	
	printf( "                 : -> %s\n", m_pModel->IsInvalid() ? "Failed" : "Succeeded" );
	
	#if defined ( DEBUG ) | ( _DEBUG )
	
		/*3Dラインの生成*/
		m_pLine3D = pRender->CreateLine3D( 10000, true );
	
	#endif
	
	//アクターの生成
	for( int i = 0;i < SCREEN_MAX;++i )
	{
		CreateActor( i, CCommonObject::GetSceneMgr( i )->GetSceneMgr() );
	}
	
}
Esempio n. 6
0
Actor::Actor(Actor* actor)
{
    CreateActor(new AnimationArray(actor->m_animations), new Animation(actor->m_currentAnimation), new Vector2d(actor->m_halfSize), new OffsetMatrix(actor->m_offset));
}
Esempio n. 7
0
Actor::Actor(AnimationArray* animations, Animation* currentAnimation, Vector2d* halfSize)
{
    CreateActor(animations, currentAnimation, halfSize, new OffsetMatrix(new Vector2d(0.f, 0.f), new Vector2d(0.f, 0.f), new Vector2d(0.f, 0.f), new Vector2d(0.f, 0.f)));
}
Esempio n. 8
0
Actor::Actor(AnimationArray* animations, Animation* currentAnimation, Vector2d* halfSize, OffsetMatrix* offsetMatrix)
{
    CreateActor(animations, currentAnimation, halfSize, offsetMatrix);
}
Esempio n. 9
0
void DllWrapperCreateActor( ActorType actorType, DWORD color, float length, float radius, LPCTSTR lEffectFileName, LPCTSTR lMeshFileName )
{
	CreateActor( actorType, color, length, radius, (char*)lEffectFileName, (char*)lMeshFileName );
}
Esempio n. 10
0
	bool CText2Scene::Parse(const char* filename)
	{
		if (!m_pParser->Read(filename))
		{
			return false;
		}
		DeleteStage();
		m_pStage = new CStage();
		CScene* pCurScene = NULL ;
		CActor* pCurActor = NULL; 
		string text;
		string parenthesis;
		const string contd("(CONT'D)");
		TScreenplay::iterator p;
		TScreenplay sp = m_pParser->GetScreenplay();
		for(p = sp.begin(); p != sp.end(); ++p)
		{
			text = (*p)->second;
			switch((*p)->first)
			{
			case Description::Action:
				break;
			case Description::Animation:
				break;
			case Description::Character:
				{
					ToUpper(text);
					// TODO:
					// temporary hack for "(CONT'D)"
					size_t found = text.find(contd);
					while (found != string::npos)
					{
						text.erase(found, contd.length());
						found = text.find(contd);
					}
					// end of hack
					Trim(text);

					// Add to stage if it does not exist
					TActor::iterator p;
					bool bExist = false;
					for(p = m_pStage->m_Actors.begin(); p != m_pStage->m_Actors.end(); ++p)
					{
						if ((*p)->m_Name == text)
						{
							pCurActor = *p;
							bExist = true;
							break;
						}
					}
					if (!bExist)
					{
						pCurActor = CreateActor(text.c_str());
						m_pStage->m_Actors.push_back(pCurActor);
					}
					// Add to scene if it does not exist
					bExist = false;
					for(p = pCurScene->m_Actors.begin(); p != pCurScene->m_Actors.end(); ++p)
					{
						if ((*p)->m_Name == text)
						{
							bExist = true;
							break;
						}
					}
					if (!bExist)
					{
						pCurScene->m_Actors.push_back(pCurActor);
					}
				}
				break;
			case Description::Dialog:
				if (pCurActor != NULL && pCurScene != NULL)
				{
					Trim(text);
					CDialog* pDialog = new CDialog();
					pDialog->m_pScene = pCurScene;
					pDialog->m_Cue = text;
					pDialog->m_Parenthesis = parenthesis;
					pCurActor->m_Dialogs.push_back(pDialog);
					parenthesis = "";
				}
				break;
			case Description::Heading:
				pCurScene = CreateScene(text.c_str()) ;
				m_pStage->m_Scenes.push_back(pCurScene);
				break;
			case Description::Parenthesis:
				parenthesis = text;
				Trim(parenthesis);
				break;
			case Description::Transition:
				break;
			default:
				// unformated text
				break;
			}
		}
		return true;
	}