/// <summary> /// Constructor. /// </summary> public FSMStateWaitAtStandingPosition(String popupScript) { mPopupScript = popupScript; mSetActiveAnimationMsg = new SpriteRender.SetActiveAnimationMessage(); mGetTileAtObjectMsg = new Level.GetTileAtObjectMessage(); mGetAttachmentPointMsg = new SpriteRender.GetAttachmentPointMessage(); mOnPopupCloseMsg = new StrandedPopup.OnPopupClosedMessage(); mSetStateMsg = new FiniteStateMachine.SetStateMessage(); }
/// <summary> /// Constructor. /// </summary> public FSMStateGoToStandingPosition() { mValidSafeHouses = new List <GameObject>(100); mSetActiveAnimationMsg = new SpriteRender.SetActiveAnimationMessage(); mSetDestinationMsg = new PathFind.SetDestinationMessage(); mSetSourceMsg = new PathFind.SetSourceMessage(); mGetCurrentBestNodeMsg = new PathFind.GetCurrentBestNodeMessage(); mClearDestinationMsg = new PathFind.ClearDestinationMessage(); mSetTargetObjectMsg = new PathFollow.SetTargetObjectMessage(); mSetStateMsg = new FiniteStateMachine.SetStateMessage(); mGetTileAtObjectMsg = new Level.GetTileAtObjectMessage(); mIncrementScoreMsg = new PlayerScore.IncrementScoreMessage(); mGetSafeHouseScoreMessage = new Behaviours.FSMCivilian.GetSafeHouseScoreMessage(); }
/// <summary> /// Call this to initialize a Behaviour with data supplied in a file. /// </summary> /// <param name="fileName">The file to load from.</param> public override void LoadContent(String fileName) { base.LoadContent(fileName); TwinStickDefinition def = GameObjectManager.pInstance.pContentManager.Load <TwinStickDefinition>(fileName); mMoveSpeed = def.mMoveSpeed; mGun = new GameObject("GameObjects\\Items\\Gun\\Gun"); GameObjectManager.pInstance.Add(mGun); mGun.pPosition = mParentGOH.pPosition; mGun.pPosX = mGun.pPosX + 1.0f; //mGun.pPosition.Y = mGun.pPosition.Y + 4.5f; mGunCooldown = StopWatchManager.pInstance.GetNewStopWatch(); mGunCooldown.pLifeTime = 5; // 1 bullet fired every 5 frames. mGrenadeCooldown = StopWatchManager.pInstance.GetNewStopWatch(); mGrenadeCooldown.pLifeTime = 60; mSafeHousePlaced = false; mGunLevel = 0; mGOFloodFill = new GameObjectFloodFill(); mGunLevelInfo = new GunLevelInfo[] { new GunLevelInfo(1.0f, 1.0f, 1.0f), new GunLevelInfo(2.0f, 1.5f, 1.1f), new GunLevelInfo(4.0f, 1.5f, 1.2f), new GunLevelInfo(7.0f, 1.5f, 1.3f), new GunLevelInfo(11.0f, 1.5f, 1.4f), new GunLevelInfo(16.0f, 2.0f, 1.5f), }; mSpriteFxMsg = new SpriteRender.SetSpriteEffectsMessage(); mGetSpriteFxMsg = new SpriteRender.GetSpriteEffectsMessage(); mSpriteActiveAnimMsg = new SpriteRender.SetActiveAnimationMessage(); mSetExtractionPointActivateMsg = new ExtractionPoint.SetExtractionPointActivateMessage(); mGetAttachmentPointMsg = new SpriteRender.GetAttachmentPointMessage(); mGetTileAtObjectMsg = new Level.GetTileAtObjectMessage(); mSetDamageModifierMessage = new Explosive.SetDamageMultiplierMessage(); }
/// <summary> /// Constructor. /// </summary> public FSMStateFollowTarget(String animationName) { mAnimationName = animationName; // We need to detect when the GameObject reaches a safe house and to do so we need // to do a collision check against all objects of a particular classification, in this // case "SAFE_HOUSE". We preallocate the two lists needed to do the check to avoid // triggering the GC. mSafeHouseInRange = new List <GameObject>(16); mSafeHouseClassifications = new List <GameObjectDefinition.Classifications>(); mSafeHouseClassifications.Add(GameObjectDefinition.Classifications.SAFE_HOUSE); mSetActiveAnimationMsg = new SpriteRender.SetActiveAnimationMessage(); mSetDestinationMsg = new PathFind.SetDestinationMessage(); mSetSourceMsg = new PathFind.SetSourceMessage(); mGetCurrentBestNodeMsg = new PathFind.GetCurrentBestNodeMessage(); mClearDestinationMsg = new PathFind.ClearDestinationMessage(); mIncrementScoreMsg = new PlayerScore.IncrementScoreMessage(); mSetTargetObjectMsg = new PathFollow.SetTargetObjectMessage(); mGetTileAtObjectMsg = new Level.GetTileAtObjectMessage(); mGetSafeHouseScoreMessage = new Behaviours.FSMCivilian.GetSafeHouseScoreMessage(); mSetStateMsg = new FiniteStateMachine.SetStateMessage(); }
/// <summary> /// Constructor. /// </summary> public FSMStateResearchStatBoost() { mSetTargetMsg = new StatBoostResearch.SetTargetMessage(); mGetTileAtObjectMsg = new Level.GetTileAtObjectMessage(); mSetStateMsg = new FiniteStateMachine.SetStateMessage(); }