public override void BasicAttack(Level level) { if (Mouse.GetState().LeftButton == ButtonState.Pressed)// && pastButton.LeftButton == ButtonState.Released) { if (actionTimer > timeBetweenActions) { if (CurrentResource >= ProjectileAttack.ManaCost) { MouseState mouse = Mouse.GetState(); Vector2 tempVector = new Vector2(mouse.X, mouse.Y); Vector2 mousePos = Global.Camera.ScreenToWorld(tempVector); ProjectileAttack.Use(this, mousePos); CurrentResource -= ProjectileAttack.ManaCost; actionTimer = 0; Global.SoundManager.mageBasicAttack.Play(); } else { Global.Gui.WriteToConsole("Not enough mana"); } } else { Global.Gui.WriteToConsole("Cant attack yet"); } } //pastButton = Mouse.GetState(); }
public override void Abillity3(Level level) { if (Keyboard.GetState().IsKeyDown(Keys.D3) && pastKey3.IsKeyUp(Keys.D3)) { if (Global.hardMode && Level < Ability3LevelReq) { pastKey3 = Keyboard.GetState(); Global.Gui.WriteToConsole("You need level " + Ability3LevelReq + " to use that ability"); return; } if (CurrentResource >= ProjectileAttack.ManaCost) { MouseState mouse = Mouse.GetState(); Vector2 tempVector = new Vector2(mouse.X, mouse.Y); Vector2 mousePos = Global.Camera.ScreenToWorld(tempVector); ProjectileAttack.Use(this, mousePos); CurrentResource -= ProjectileAttack.ManaCost; Global.SoundManager.warriorAbillity3.Play(); } else { Global.Gui.WriteToConsole("Not enough mana"); } } pastKey3 = Keyboard.GetState(); }