prefer imbris syntax proposal, documentation and changelog

This commit is contained in:
Christof Petig 2023-03-13 10:01:11 +01:00
parent 1f976f9f1c
commit b555d619fb
3 changed files with 28 additions and 14 deletions

View File

@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Camera zoom can now be locked, to prevent accidental zooming while rolling in combat. It comes - Camera zoom can now be locked, to prevent accidental zooming while rolling in combat. It comes
with a keybind to enable/disable the setting, and an Auto/Toggle behavior setting. Auto behavior with a keybind to enable/disable the setting, and an Auto/Toggle behavior setting. Auto behavior
will only lock the camera zoom while movement and combat inputs are also being pressed. will only lock the camera zoom while movement and combat inputs are also being pressed.
- Custom spots can be added without recompilation (only ron and vox files)
### Changed ### Changed
- Bats move slower and use a simple proportional controller to maintain altitude - Bats move slower and use a simple proportional controller to maintain altitude

View File

@ -1,8 +1,13 @@
[ [
// ( // example entry, increase freq to activate
// base_structures: "spots_general.mage_tower", (
// freq: 100.0, // ron file pointing to voxel model and defining special colors
// condition: And3((Typical, MaxGradient(0.2), Biome([Forest, Taiga]))), base_structures: "spots_general.mage_tower",
// spawn: false, // maximum occurance per each 1000km^2 world area
// ), freq: 0.0,
// placement requirements
condition: All([Typical, MaxGradient(0.2), Biome([Forest, Taiga])]),
// whether to prevent trees etc. around this spot
spawn: false,
),
] ]

View File

@ -851,8 +851,8 @@ enum SpotCondition {
MinWaterDepth(f32), MinWaterDepth(f32),
Not(Box<SpotCondition>), Not(Box<SpotCondition>),
And(Box<(SpotCondition, SpotCondition)>), All(Vec<SpotCondition>),
And3(Box<(SpotCondition, SpotCondition, SpotCondition)>), Any(Vec<SpotCondition>),
} }
impl SpotCondition { impl SpotCondition {
@ -872,13 +872,21 @@ impl SpotCondition {
SpotCondition::IsUnderwater.is_valid(g, c) && c.water_alt > c.alt + depth SpotCondition::IsUnderwater.is_valid(g, c) && c.water_alt > c.alt + depth
}, },
SpotCondition::Not(condition) => !condition.is_valid(g, c), SpotCondition::Not(condition) => !condition.is_valid(g, c),
SpotCondition::And(conditions) => { SpotCondition::All(conditions) => 'outer: {
conditions.0.is_valid(g, c) && conditions.1.is_valid(g, c) for cond in conditions.iter() {
if !cond.is_valid(g, c) {
break 'outer false;
}
}
true
}, },
SpotCondition::And3(conditions) => { SpotCondition::Any(conditions) => 'outer: {
conditions.0.is_valid(g, c) for cond in conditions.iter() {
&& conditions.1.is_valid(g, c) if cond.is_valid(g, c) {
&& conditions.2.is_valid(g, c) break 'outer true;
}
}
false
}, },
} }
} }