diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index c2aec78..6f1e01a 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -63,7 +63,7 @@ { GD.Randomize(); ActivityObject.IsDebug = Debug; - + GlobalNodeRoot = GetNode(GlobalNodeRootPath); // 初始化鼠标 Cursor = CursorPack.Instance(); diff --git a/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs index 0c86c92..423ecc1 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs @@ -877,11 +877,11 @@ { if (holster.PickupWeapon(this) == -1) { + //替换武器 var slot = holster.SlotList[holster.ActiveIndex]; if (slot.Type == Attribute.WeightType) { - var weapon = holster.RemoveWeapon(holster.ActiveIndex); - weapon.ThrowWeapon(roleMaster); + roleMaster.ThrowWeapon(); roleMaster.PickUpWeapon(this); } } diff --git a/DungeonShooting_Godot/src/game/role/Role.cs b/DungeonShooting_Godot/src/game/role/Role.cs index 4ec04ec..c89ad12 100644 --- a/DungeonShooting_Godot/src/game/role/Role.cs +++ b/DungeonShooting_Godot/src/game/role/Role.cs @@ -397,12 +397,17 @@ /// 武器在武器袋中的位置 public virtual void ThrowWeapon(int index) { - var weapon = Holster.RemoveWeapon(index); - //播放抛出效果 - if (weapon != null) + var weapon = Holster.GetWeapon(index); + if (weapon == null) { - weapon.ThrowWeapon(this); + return; } + + var temp = new Vector2(weapon.Attribute.HoldPosition.x, 0); + var pos = weapon.GlobalPosition + temp.Rotated(weapon.GlobalRotation); + Holster.RemoveWeapon(index); + //播放抛出效果 + weapon.ThrowWeapon(this, pos); } ///