Added rpg system for combat

added lots of loot to find
added level up system
This commit is contained in:
2026-01-11 23:12:09 +01:00
parent ab16194c39
commit 3a7fb29d58
32 changed files with 5076 additions and 96 deletions

View File

@@ -13,16 +13,34 @@ var detection_range: float = 150.0
func _ready():
super._ready()
max_health = 25.0
max_health = 15.0 # Reduced from 25.0 for better balance
current_health = max_health
move_speed = 40.0 # Much slower
damage = 8.0
exp_reward = 5.0 # Rats give low EXP
state_timer = idle_duration
# CRITICAL: Ensure collision mask is set correctly (walls are on layer 7 = bit 6 = 64)
collision_mask = 1 | 2 | 64 # Collide with players (layer 1), objects (layer 2), and walls (layer 7 = bit 6 = 64)
# Override to set weak stats for rats
func _initialize_character_stats():
super._initialize_character_stats()
# Rats are weak enemies - very low END for low DEF
character_stats.baseStats.end = 5 # END=5 gives DEF=1.0 (5 * 0.2)
character_stats.baseStats.str = 7 # Low STR = low damage
character_stats.baseStats.dex = 8 # Slightly higher DEX (rats are fast)
character_stats.baseStats.int = 5
character_stats.baseStats.wis = 5
character_stats.baseStats.lck = 5
# Re-initialize hp and mp with new stats
character_stats.hp = character_stats.maxhp
character_stats.mp = character_stats.maxmp
# Sync max_health from character_stats
max_health = character_stats.maxhp
current_health = max_health
func _ai_behavior(delta):
# Update state timer
state_timer -= delta