using Sprint3_actual.Collision_Detection; using Sprint3_actual.SoundManagement; namespace Sprint3_actual.StateFiles { public class LinkStateDownAttack : ILinkState { private Link link; private int counter = GlobalVars.swordCounter; public LinkStateDownAttack(Link link) { this.link = link; this.link.linkSprite = new LinkSpriteDownAttack(link); link.Sword.ActiveItemDown(); SoundEngine.Instance.playSwordSlash(); } public void Update() { counter--; if(counter == 0) { if (link.SwordBeam.IsRemoved()) { SoundEngine.Instance.playSwordBeam(); } link.SwordBeam.ActiveItemDown(); link.state = new LinkStateDownIdle(link); } } public void MoveLeft() { //NO-OP //Can't move while attacking } public void TakeDamage(ICollision side) { link.game.Player = new DamagedLink(link, side); //TO-DO: How does game get in here? Is there any alternative to passing game? } public void MoveRight() { //NO-OP //Can't move while attacking } public void MoveUp() { //NO-OP //Can't move while attacking } public void MoveDown() { //NO-OP //Can't move while attacking } public void Idle() { //NO-OP //Can't move while attacking } public void Attack() { //NO-OP //Already attacking } public void UseItem() { //NO-OP //Can't use item while moving } } }