Пример #1
0
        /// <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);

            PointAndShootDefinition def = GameObjectManager.pInstance.pContentManager.Load <PointAndShootDefinition>(fileName);

            mGun = new GameObject(def.mGunScriptName);
            GameObjectManager.pInstance.Add(mGun);
            mGun.pPosition = mParentGOH.pPosition;
            mGun.pPosX     = mGun.pPosX + 1.0f;

            mGunCooldown           = StopWatchManager.pInstance.GetNewStopWatch();
            mGunCooldown.pLifeTime = def.mFiringDelay; // 1 bullet fired every mFiringDelay frames.

            mFiringRange           = def.mFiringRange;
            mBulletSpeed           = def.mBulletSpeed;
            mTargetClassifications = def.mTargetClassifications;
            mBulletScriptName      = def.mBulletScriptName;

            mPotentialTargets = new List <GameObject>(16);

            mSetLookTargetMsg      = new FaceForward.SetLookTargetMessage();
            mSetSpriteEffectsMsg   = new SpriteRender.SetSpriteEffectsMessage();
            mGetAttachmentPointMsg = new SpriteRender.GetAttachmentPointMessage();
        }
Пример #2
0
        /// <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);

            mDef = GameObjectManager.pInstance.pContentManager.Load <StatBoostResearchDefinition>(fileName);

            mOnResearchCompleteMsg = new OnResearchComplete();
            mGetAttachmentPointMsg = new SpriteRender.GetAttachmentPointMessage();
        }
Пример #3
0
        /// <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();
        }
Пример #4
0
        /// <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();
        }
Пример #5
0
        /// <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);

            ExplosiveDefinition def = GameObjectManager.pInstance.pContentManager.Load <ExplosiveDefinition>(fileName);

            mExplosionEffect = def.mEffectFileName;

            mExplosionAnimationNames = def.mAnimationsToPlay;

            mManualExplosion = def.mManualExplosion;

            mDamagedCaused = def.mDamageCaused;

            mDamageAppliedTo = new List <GameObjectDefinition.Classifications>();

            for (Int32 i = 0; i < def.mDamageAppliedTo.Count; i++)
            {
                mDamageAppliedTo.Add(def.mDamageAppliedTo[i]);
            }

            mObjectsInRange = new List <GameObject>(16);

            if (def.mDetonationTimerDuration != 0)
            {
                mDetonationTimer = StopWatchManager.pInstance.GetNewStopWatch();

                mDetonationTimer.pLifeTime = def.mDetonationTimerDuration;
            }

            mSetActiveAnimationMessage       = new SpriteRender.SetActiveAnimationMessage();
            mApplyDamageMsg                  = new Health.ApplyDamageMessage();
            mApplyDamageMsg.mDamageAmount_In = mDamagedCaused;
            mGetAttachmentPointMsg           = new SpriteRender.GetAttachmentPointMessage();

            Reset();
        }
Пример #6
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public FSMStateWaitAtTarget()
 {
     mGetAttachmentPointMsg = new SpriteRender.GetAttachmentPointMessage();
     mSetActiveAnimationMsg = new SpriteRender.SetActiveAnimationMessage();
     mSetStateMsg           = new FiniteStateMachine.SetStateMessage();
 }