hasMany(Character::class); } /** * Get the shops at this location. */ public function shops(): HasMany { return $this->hasMany(Shop::class); } /** * Get the crimes available at this location. */ public function crimes(): HasMany { return $this->hasMany(Crime::class); } /** * Check if a character can travel to this location */ public function canTravel(Character $character): bool { // Check level requirement if ($this->requires_level && $character->level < $this->requires_level) { return false; } // Check if character has enough money if ($character->money < $this->travel_cost) { return false; } return true; } /** * Get the travel cost from another location to this one */ public function getTravelCostFrom(Location $from): int { // For now, just use this location's travel cost // In a more advanced system, we'd calculate based on distance return $this->travel_cost; } }