Cheat Gun

This commit is contained in:
Marco 2025-02-15 17:51:06 +01:00
commit cb27f33a6d
21 changed files with 620 additions and 436 deletions

View file

@ -59,8 +59,8 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
private InventoryManager _inventoryManager;
[Export] public Sprite2D HitboxSprite { get; set; }
[Export] public Sprite2D HitboxSprite { get; set; }
[Export] public BulletOwner BulletGroup { get; set; } = BulletOwner.Player;
private bool _isStrafing { get; set; }
private bool _canMove = true;
@ -179,6 +179,16 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
}
}*/
// public void ItemAdded(LootItem item, int amount)
// {
// switch (item.Item)
// {
// case ItemTypes.Weapon:
// AddWeapon(item.WeaponData);
// break;
// }
// }
public void AddWeapon(Weapon weapon)
{
EquippedWeapons.Add(weapon);
@ -443,7 +453,7 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
private void _on_damage_hit_box_area_entered(Area2D area)
{
if (!_canMove) return;
if (area is Bullet bullet && bullet.BulletOwner != BulletOwner.Player)
if (area is Bullet bullet && bullet.BulletOwner != BulletGroup)
{
this.Hit(bullet.Damage, bullet.DamageType);
bullet.QueueFree();