// Method only here since inventory doesn't exist private IAttack GetSecondaryAttack(string attackName) { IAttack secondaryAttack = new Bomb(Game, Link); switch (attackName) { case ("Bomb"): secondaryAttack = new Bomb(Game, Link); break; case ("Arrow"): secondaryAttack = new Arrow(Game, Link, Link.Direction); break; case ("BlueCandle"): secondaryAttack = new BlueCandle(Game, Link, Link.Direction); break; case ("Boomerang"): secondaryAttack = new Boomerang(Game, Link, Link.Direction); break; case ("Bullet"): secondaryAttack = new Bullet(Game, Link, Link.Direction); break; } return(secondaryAttack); }
public void AttackState() { Timer++; if (Timer == 1) { IAttack boomerang = new Boomerang(Game, Self, Self.Direction); boomerang.Attack(); Game.soundEffects[0].Play(); AttackCounter = 0; } else if (Timer >= AttackDelay) { Reset(); Timer = 0; Self.State = States.MonsterState.Idle; } }