Files
SurvivalOfTheSnippest/level/scripts/weapon_data.gd
T

40 lines
1.5 KiB
GDScript
Raw Normal View History

2025-11-15 16:03:38 +00:00
extends Resource
class_name WeaponData
## Resource that stores weapon statistics and properties
## Can be reused for both equipped weapons and world pickups
2025-11-15 16:44:58 +00:00
enum Hand { MAIN_HAND, OFF_HAND, TWO_HAND }
2025-11-15 16:03:38 +00:00
@export_category("Weapon Info")
@export var weapon_name: String = "Weapon"
@export_multiline var description: String = ""
2025-11-15 16:44:58 +00:00
@export var hand_type: Hand = Hand.MAIN_HAND
2025-11-15 16:03:38 +00:00
@export_category("Combat Stats")
@export var damage: float = 10.0
@export var attack_range: float = 3.0
@export var attack_cooldown: float = 0.5
@export var attack_animation: String = "Attack1" # Animation to play when attacking
2025-11-15 17:17:32 +00:00
@export var knockback_force: float = 8.0 # How much to push the target back
2025-11-15 16:03:38 +00:00
2025-11-21 23:53:28 +00:00
@export_category("Attack Timing")
## Time before hitbox activates (wind-up/anticipation)
@export var startup_time: float = 0.15
## Duration hitbox stays active (the actual hit window)
@export var active_time: float = 0.2
## Time after hitbox deactivates (follow-through, can't act)
## Note: recovery_time = attack_cooldown - startup_time - active_time (calculated automatically)
2025-11-15 17:07:28 +00:00
@export_category("Defense Stats")
@export var can_block: bool = false
@export_range(0.0, 1.0) var block_reduction: float = 0.5 # Percentage of damage blocked (0.5 = 50%)
2025-11-15 16:03:38 +00:00
@export_category("Visual")
@export var mesh_scene: PackedScene # The 3D mesh for this weapon
@export var icon: Texture2D # Optional icon for UI
@export_category("Physics (for world pickups)")
@export var pickup_radius: float = 1.5 # How close player needs to be to pick up
@export var weight: float = 1.0 # Mass when dropped in world