public PowerUp(Game1 world, Vector2 powerupPos) : base(world) { int[] powerUpAnimationFrames; Animation powerUpAnimation; if (world.powerUpCounter == 15) { m_color = PowerUpColor.BLUE; m_sprite = world.m_spriteEnemies; world.powerUpCounter = 0; powerUpAnimationFrames = new int[] { 70, 71, 72 }; powerUpAnimation = new Animation(PlayType.Once, powerUpAnimationFrames, 3.0f); } else { m_color = PowerUpColor.RED; m_sprite = world.m_spriteEnemies; powerUpAnimationFrames = new int[] { 75, 76, 77 }; powerUpAnimation = new Animation(PlayType.Once, powerUpAnimationFrames, 3.0f); } Dictionary <string, Animation> powerUpAnimations = new Dictionary <string, Animation>() { { "default", powerUpAnimation } }; m_animator = new AnimationController(m_world.m_spriteEnemies, powerUpAnimations, 5, 18); currAnimation = "default"; m_pos = powerupPos; }
private void Start() { powerUp = GameObject.FindGameObjectWithTag("PowerUp").GetComponent <PowerUpColor>(); skillAudioSource = GetComponent <AudioSource>(); if (areaAttack) { Instantiate(hitEffect, transform.position, transform.rotation); } }
public void UseItem(Item _item) { Debug.Log("entrei"); switch (_item.type) { case ItemType.Potion: switch (_item.potionType) { case PotionType.HealLow: Health.HealAmount(10); break; case PotionType.HealMedium: Health.HealAmount(20); break; case PotionType.HealHigh: Health.HealAmount(30); break; case PotionType.HealFire: Debug.Log("Curou Queimadura"); break; case PotionType.HealEletric: Debug.Log("Curou eletricidade"); break; case PotionType.HealPoison: Debug.Log("Curou Veneno"); break; case PotionType.HealIce: Debug.Log("Curou Gelo"); break; case PotionType.IntensifyFire: PowerUpColor.IntensifyPower(1); break; case PotionType.IntensifyIce: PowerUpColor.IntensifyPower(2); break; case PotionType.IntensifyPoison: PowerUpColor.IntensifyPower(3); break; case PotionType.IntensifyEletric: PowerUpColor.IntensifyPower(4); break; } RemoveAmount(_item); break; } }