Added weapon interface class
All checks were successful
Deploy Promiscuity Auth API / deploy (push) Successful in 1m14s
k8s smoke test / test (push) Successful in 6s

This commit is contained in:
Lucas 2026-01-07 02:46:59 -06:00
parent 07b57dc1f7
commit b0573be749
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
# weapon.gd
extends Resource
class_name iWeapon
# This acts as an interface base class.
# --- Common Stats ---
@export var weapon_name: String = "Unnamed Weapon"
@export var damage: float = 10.0
@export var attack_speed: float = 1.0 # attacks per second
@export var range: float = 1.5 # meters; melee = short, ranged = long
@export var knockback: float = 0.0
@export var stamina_cost: float = 5.0
# --- Rangedspecific Stats ---
@export var projectile_scene: PackedScene # null for melee
@export var projectile_speed: float = 20.0
@export var ammo_type: String = "" # e.g. "arrows", "bullets"
@export var ammo_per_shot: int = 1
# --- Meleespecific Stats ---
@export var swing_arc: float = 90.0 # degrees
@export var hitbox_size: float = 1.0
# --- Interface Methods ---
func attack(user):
push_error("Weapon.attack() not implemented in subclass")
return null
func can_attack(user) -> bool:
return true

View File

@ -0,0 +1 @@
uid://bttaq8w3plgqh