Beispiel #1
0
        public override void Interact(Player player, Interactions interaction)
        {
            if (interaction == Interactions.Close || interaction == Interactions.Open)
            {
                _spriteRenderer.sprite = interaction == Interactions.Close ? _closed : _open;

                _isOpen = !_isOpen;
            }
            else if (interaction == Interactions.Drop)
            {
                //do nothing
            }
            else if (interaction == Interactions.Flush)
            {
                //Play sound
                _audioSource.PlayOneShot(_flush);
            }
            else if (interaction == Interactions.Flush_Cat)
            {
                if (player.IsPickedUpInteractableMurderable())
                {
                    _audioSource.PlayOneShot(_flush);
                    player.KillCat();
                    EvSys.Instance().AddMessage("Flushed Cat: <color=green> -1 to Cats</color>");
                }
            }
        }
Beispiel #2
0
 // Update is called once per frame
 void Update()
 {
     if (_cat != null)
     {
         _killWait += Time.deltaTime;
         if (_killWait >= _killAfter)
         {
             Destroy(_cat.gameObject);
             EvSys.Instance().AddMessage("Frozen Cat: <color=green>-3 to Cat Attraction</color>");
             _killWait = 0.0f;
             _cat      = null;
         }
     }
 }
Beispiel #3
0
        void Update()
        {
            if (_isOpen)
            {
                if (_spawnWait > _spawnRate)
                {
                    Cat cat = CatFactory.Instance().RandomCat();
                    cat.transform.position = _spawnLocation.position;

                    _spawnWait = 0.0f;

                    EvSys.Instance().AddMessage("Window Cat: <color=red>+1 to Cat Lady</color>");
                }

                _spawnWait += Time.deltaTime;
            }
        }
Beispiel #4
0
        public override void Interact(Player player, Interactions interaction)
        {
            if (interaction == Interactions.Free_Cat)
            {
                if (player.HasPickedUpInteractable() && player.IsPickedUpInteractableMurderable())
                {
                    Transform    closest = ClosestDropSpot(player.transform);
                    Interactable cat     = player.TakePickedupItem();
                    cat.transform.position = closest.position;
                    CatMeter.TotalCat--;

                    EvSys.Instance().AddMessage("Freed Cat: <color=green>-1 to Cats</color>");
                }
            }
            else if (interaction == Interactions.Scream_At_The_Neighbours)
            {
                EvSys.Instance().AddMessage("Screaming At The Neighbours: <color=green>+2 to Cat Attraction</color>");
                CatMeter.TotalAttraction += 2;
            }
        }
Beispiel #5
0
        public override void Interact(Player player, Interactions interaction)
        {
            if (interaction == Interactions.Trash_Newspaper)
            {
                if (player.HasPickedUpInteractable() && !player.IsPickedUpInteractableMurderable())
                {
                    Interactable interactable = player.TakePickedupItem();
                    Destroy(interactable.gameObject);
                    CatMeter.TotalAttraction--;
                    CatMeter.TotalNewspapers--;

                    EvSys.Instance().AddMessage("Destroyed Newspaper : <color=green>-1 to Cat Attraction</color>");
                }
            }
            else if (interaction == Interactions.Pickup)
            {
                _collider2D.enabled = false;
            }
            else if (interaction == Interactions.Drop)
            {
                _collider2D.enabled   = true;
                _collider2D.isTrigger = false;
            }
        }
Beispiel #6
0
 private void OnDestroy()
 {
     CatMeter.TotalAttraction--;
     CatMeter.TotalNewspapers++;
     EvSys.Instance().AddMessage("Destroyed Newspaper : <color=green>-1 to Cat Attraction</color>");
 }
Beispiel #7
0
 void Start()
 {
     CatMeter.TotalAttraction++;
     CatMeter.TotalNewspapers++;
     EvSys.Instance().AddMessage("Newspaper Hoarding: <color=red>+1 to Cat Attraction</color>");
 }