private void StabTile(Tile tile) { if (player.IsOnGround) { tile.OnSwordHit(weapon); // Create cling effect. if (!tile.IsDestroyed && tile.ClingWhenStabbed) { Effect clingEffect = new EffectCling(true); Vector2F pos = player.Center + (13 * Directions.ToVector(direction)); player.RoomControl.SpawnEntity(clingEffect, pos); AudioSystem.PlaySound(GameData.SOUND_EFFECT_CLING); } } // Begin the player stab state. player.SwordStabState.Weapon = weapon; player.SwordStabState.ContinueHoldingSword = true; player.BeginState(player.SwordStabState); }
//----------------------------------------------------------------------------- // Internal methods //----------------------------------------------------------------------------- private void StabTile(Tile tile) { isStabbing = true; chargeTimer = 0; player.Movement.MoveCondition = PlayerMoveCondition.NoControl; // TODO: allows sideways movement for stabbing. player.toolAnimation.Play(GameData.ANIM_SWORD_STAB); player.Graphics.PlayAnimation(GameData.ANIM_PLAYER_STAB); if (player.IsOnGround) tile.OnSwordHit(); }