forked from woofmeow/straywild
Expand generated terrain with biome-driven props
This commit is contained in:
parent
e8888ed05a
commit
1e24fb0bfc
103 changed files with 5427 additions and 351 deletions
21
world/generation/terrain_biome_prop_rule.gd
Normal file
21
world/generation/terrain_biome_prop_rule.gd
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
class_name TerrainBiomePropRule
|
||||
extends Resource
|
||||
|
||||
@export var procedural_group: StringName
|
||||
@export_range(0, 10000, 1) var placement_chance := 0
|
||||
@export_range(0, 10000, 1) var adjacency_bonus := 0
|
||||
@export_range(0, 10000, 1) var maximum_density := 10000
|
||||
@export_range(0, 64, 1) var minimum_placements := 0
|
||||
## Empty permits every compatible prop in the procedural group.
|
||||
@export var allowed_prop_ids := PackedStringArray()
|
||||
|
||||
|
||||
func allows_prop(definition: TerrainPropDefinition) -> bool:
|
||||
return (
|
||||
definition != null
|
||||
and definition.procedural_group == procedural_group
|
||||
and (
|
||||
allowed_prop_ids.is_empty()
|
||||
or String(definition.stable_id) in allowed_prop_ids
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue