Added rpg system for combat
added lots of loot to find added level up system
This commit is contained in:
@@ -15,16 +15,34 @@ var fly_height: float = 8.0 # Z position when flying
|
||||
func _ready():
|
||||
super._ready()
|
||||
|
||||
max_health = 30.0
|
||||
max_health = 18.0 # Reduced from 30.0 for better balance
|
||||
current_health = max_health
|
||||
move_speed = 40.0 # Reasonable speed for bats
|
||||
damage = 5.0
|
||||
exp_reward = 6.0 # Bats give low-moderate 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 bats
|
||||
func _initialize_character_stats():
|
||||
super._initialize_character_stats()
|
||||
# Bats 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 = 5 # Low STR = low damage
|
||||
character_stats.baseStats.dex = 10 # Higher DEX (bats are agile)
|
||||
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 _physics_process(delta):
|
||||
# Always update animation (even when dead, and on clients)
|
||||
_update_animation(delta)
|
||||
|
||||
Reference in New Issue
Block a user