Example #1
0
        /// Override this to describe what happens when the object gets picked
        /// </summary>
        protected override void Pick()
        {
            base.Pick();
            _sprite            = gameObject.GetComponent <SpriteRenderer>();
            characterInventory = _collider.GetComponent <LucyInventory>();
            _characterPause    = _collider.GetComponent <CharacterPause>();

            _sprite.enabled = false;

            CheckLoreNumber(LoreNumber);
        }
Example #2
0
        /// <summary>
        /// Grabs useful components, enables damage and gets the inital color
        /// </summary>
        protected override void Initialization()
        {
            _animator = GetComponent <Animator>();
            if (_animator != null)
            {
                _animator.logWarnings = false;
            }



            _character = GetComponent <Character>();
            if (gameObject.GetComponentNoAlloc <SpriteRenderer>() != null)
            {
                _renderer = GetComponent <SpriteRenderer>();
                _renderer.material.color = Color.white;
            }
            if (_character != null)
            {
                if (_character.CharacterModel != null)
                {
                    if (_character.CharacterModel.GetComponentInChildren <Renderer>() != null)
                    {
                        _renderer = _character.CharacterModel.GetComponentInChildren <Renderer>();
                    }
                }
            }
            _autoRespawn = GetComponent <AutoRespawn>();
            _controller  = GetComponent <CorgiController>();
            _healthBar   = GetComponent <MMHealthBar>();
            _collider2D  = GetComponent <Collider2D>();

            _sprite             = gameObject.GetComponent <SpriteRenderer>();
            _characterInventory = GetComponent <LucyInventory>();
            _damageSpriteEffect = GetComponent <_2dxFX_CompressionFX>();


            _initialPosition = transform.position;
            _initialized     = true;
            CurrentHealth    = InitialHealth;
            DamageEnabled();

            // _characterInventory.CheckPowerNodeInventories();
            UpdateHealthBar(false);
            UpdateHealthCounter(CurrentHealth);

            //absolute bandaid for issue where GUI says health is 10 when actully full. Only when starting a scene in area 3 and 5.
            StartCoroutine(WaitAFrameAndCheckHealth());

            InitializeSpriteColor();
        }
        /// Override this to describe what happens when the object gets picked
        /// </summary>
        protected override void Pick()
        {
            _health    = _collider.GetComponent <LucyHealth>();
            _inventory = _collider.GetComponent <LucyInventory>();
            _sprite    = gameObject.GetComponent <SpriteRenderer>();

            //Starts the process of increasing heath count and size of health bar
            _health.BatteryObtained();
            _sprite.enabled = false;

            //Tell the inventory to update the GUI on power nodes collected
            _inventory.PowerNodesCollected++;
            _inventory.UpdateGUIPowerNodes();

            CheckPowerNodeNumber(PowerNodeNumber);
        }
Example #4
0
        /// Override this to describe what happens when the object gets picked
        /// </summary>
        protected override void Pick()
        {
            base.Pick();
            _sprite             = gameObject.GetComponent <SpriteRenderer>();
            _characterInventory = _collider.GetComponent <LucyInventory>();

            _sprite.enabled = false;
            _characterInventory.EquipWeaponOnPickup("InventoryHyperBeam");

            //if we haven't already obtained it
            if (!GameManager.Instance.HyperBeamObtained)
            {
                if (!GameManager.Instance.DebugMode)
                {
                    RunSplashScreen();
                }
                GameManager.Instance.HyperBeamObtained = true;
                RetroAdventureProgressManager.Instance.SaveProgress();
            }
        }
Example #5
0
        /// Override this to describe what happens when the object gets picked
        /// </summary>
        protected override void Pick()
        {
            base.Pick();
            _sprite            = gameObject.GetComponent <SpriteRenderer>();
            characterInventory = _collider.GetComponent <LucyInventory>();
            _lucyHealth        = _collider.GetComponent <LucyHealth>();

            _lucyHealth.KnockbackReducerAcquired();
            _sprite.enabled = false;

            //if we haven't already obtained it
            if (!GameManager.Instance.KnockbackReducerObtained)
            {
                if (!GameManager.Instance.DebugMode)
                {
                    RunSplashScreen();
                }
                GameManager.Instance.KnockbackReducerObtained = true;
                RetroAdventureProgressManager.Instance.SaveProgress();
            }
        }
        /// Override this to describe what happens when the object gets picked
        /// </summary>
        protected override void Pick()
        {
            base.Pick();
            _wallcling          = _collider.GetComponent <LucyWallClinging>();
            _sprite             = gameObject.GetComponent <SpriteRenderer>();
            _characterInventory = _collider.GetComponent <LucyInventory>();


            _wallcling.MaglockBootsObtained = true;
            _sprite.enabled = false;
            //if we haven't already obtained it
            if (!GameManager.Instance.MaglockBootsObtained)
            {
                if (!GameManager.Instance.DebugMode)
                {
                    RunSplashScreen();
                }
                GameManager.Instance.MaglockBootsObtained = true;
                RetroAdventureProgressManager.Instance.SaveProgress();
            }
        }
Example #7
0
        /// Override this to describe what happens when the object gets picked
        /// </summary>
        protected override void Pick()
        {
            base.Pick();
            _characterHandleMelee = _collider.GetComponent <CharacterHandleMelee> ();
            _sprite             = gameObject.GetComponent <SpriteRenderer> ();
            _characterInventory = _collider.GetComponent <LucyInventory>();

            _characterHandleMelee.AbilityPermitted = true;
            _sprite.enabled = false;

            //if we haven't already obtained it
            if (!GameManager.Instance.PlasmaBladeObtained)
            {
                if (!GameManager.Instance.DebugMode)
                {
                    RunSplashScreen();
                }
                GameManager.Instance.PlasmaBladeObtained = true;
                RetroAdventureProgressManager.Instance.SaveProgress();
            }
        }
Example #8
0
        /// Override this to describe what happens when the object gets picked
        /// </summary>
        protected override void Pick()
        {
            base.Pick();
            _sprite             = gameObject.GetComponent <SpriteRenderer>();
            _characterInventory = _collider.GetComponent <LucyInventory>();

            _sprite.enabled = false;
            _characterInventory.ArtifactBObtained = true;
            _characterInventory.CheckArtifacts();

            //if we haven't already obtained it
            if (!GameManager.Instance.ArtifactBObtained)
            {
                GameManager.Instance.NumberOfArtifactsObtained += 1;
                if (!GameManager.Instance.DebugMode)
                {
                    RunSplashScreen();
                }
                GameManager.Instance.ArtifactBObtained = true;
                RetroAdventureProgressManager.Instance.SaveProgress();
            }
        }
Example #9
0
        /// Override this to describe what happens when the object gets picked
        /// </summary>
        protected override void Pick()
        {
            base.Pick();
            _animator           = _collider.GetComponent <Animator>();
            _lucyFlamethrower   = _collider.GetComponent <LucyFlamethrower>();
            _sprite             = gameObject.GetComponent <SpriteRenderer>();
            _characterInventory = _collider.GetComponent <LucyInventory>();

            _lucyFlamethrower.SuperFlamethrowerObtained = true;
            _animator.runtimeAnimatorController         = Resources.Load("SFTAnimator") as RuntimeAnimatorController;
            _sprite.enabled = false;
            //if we haven't already obtained it
            if (!GameManager.Instance.SuperFlamethrowerObtained)
            {
                if (!GameManager.Instance.DebugMode)
                {
                    RunSplashScreen();
                }
                GameManager.Instance.SuperFlamethrowerObtained = true;
                RetroAdventureProgressManager.Instance.SaveProgress();
            }
        }
        /// Override this to describe what happens when the object gets picked
        /// </summary>
        protected override void Pick()
        {
            base.Pick();
            _animator           = _collider.GetComponent <Animator>();
            _sprite             = gameObject.GetComponent <SpriteRenderer>();
            _characterInventory = _collider.GetComponent <LucyInventory>();


            _animator.runtimeAnimatorController = Resources.Load("OrangeSuitAnimator") as RuntimeAnimatorController;
            _sprite.enabled = false;
            _characterInventory.EquipWeaponOnPickup("InventoryBlasterRifle");
            _characterInventory.RemoveUnarmed();

            //if we haven't gotten it before run the splash and effects.
            if (GameManager.Instance.BlasterObtained == false)
            {
                if (!GameManager.Instance.DebugMode)
                {
                    RunSplashScreen();
                }
                GameManager.Instance.BlasterObtained = true;
                RetroAdventureProgressManager.Instance.SaveProgress();
            }
        }