Ejemplo n.º 1
0
        public static void DoMeanThings(IAggressive animal)
        {
            Console.WriteLine(" DoMeanThings");

            Console.WriteLine();
            animal.ShowTeeth();

            int legs = animal.Bite();

            if (legs == 1)
            {
                Console.Write("You lost one leg");
            }
            if (legs == 2)
            {
                Console.Write("You lost your legs");
            }
            if (legs == 3)
            {
                Console.Write("You lost your legs and one arm");
            }
            if (legs == 4)
            {
                Console.Write("You lost your legs and your arms");
            }
        }
Ejemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("DestroyDetector"))
     {
         if (/*EnterDestroy &&*/ !_CanBeDetected)
         {
             _CanBeDetected = true;
         }
     }
     if (other.CompareTag("Player"))
     {
         //Debug.Log($"{name} {other.name} {_CanBeDetected}");
         if (other.TryGetComponent(out Damageable damageableComp))
         {
             IAggressive attacker = _myItem as IAggressive;
             attacker?.Attack(damageableComp);
             if (_myItem is HeartItem)
             {
                 HeartItem item = _myItem as HeartItem;
                 item.ChangeSprite();
                 item.Heal(damageableComp);
             }
         }
     }
 }
Ejemplo n.º 3
0
        public static void DoMeanThings(IAggressive animal)
        {
            Header("DoMeanThings");
            animal.ShowTeeth();
            switch (animal.Bite())
            {
            case 1:
                Console.WriteLine("You lost one leg");
                break;

            case 2:
                Console.WriteLine("You lost your legs");
                break;

            case 3:
                Console.WriteLine("You lost one arm");
                break;

            case 4:
                Console.WriteLine("You lost your arms");
                break;
            }
        }
Ejemplo n.º 4
0
    private void OnTriggerStay2D(Collider2D other)
    {
        //Debug.LogFormat("{0} stay here.", other.name);

        if (other.CompareTag("DestroyDetector"))
        {
            if (!_CanBeDetected || !StayDestroy)
            {
                return;
            }

            _stayTime -= Time.deltaTime;

            if (_stayTime <= 0f)
            {
                ItemStatus itemStatus = _myItem.GetDetectedItemStatus();
                if (itemStatus.ItemState - 1 < GameItemState.StateOne)
                {
                    _CanBeDetected = false;
                    _stayTime      = 0;
                    return;
                }
                _myItem.SetItemState(itemStatus.ItemState - 1);
                _myItem.ChangeSprite();
                _stayTime = StaticData.DestroyDuration;
            }
        }
        if (other.CompareTag("Player"))
        {
            if (other.TryGetComponent(out Damageable damageableComp) && !damageableComp.GetHit)
            {
                IAggressive attacker = _myItem as IAggressive;
                attacker?.Attack(damageableComp);
            }
        }
    }
Ejemplo n.º 5
0
 public void DoMeanThings(IAggressive Dog)
 {
     ShowTeeth();
     Bite();
 }
Ejemplo n.º 6
0
        private static void DoMeanThings(IAggressive c)
        {
            c.Bite();

            c.ShowTeeth();
        }
Ejemplo n.º 7
0
 private static void DoMeanThings(IAggressive a)
 {
     a.Bite();
     a.ShowTeeth();
 }