Merge branch 'main' of ssh://gitea.directonline.io:29417/sylvan-quest/client
This commit is contained in:
commit
c54d2a2da8
@ -76,21 +76,22 @@ const initializeEffects = (scene: Phaser.Scene) => {
|
||||
// Effect updates
|
||||
const updateScene = () => {
|
||||
const timeBasedLight = calculateLightStrength(gameStore.world.date)
|
||||
const defaultEffects = {
|
||||
light: timeBasedLight,
|
||||
rain: weatherState.value.isRainEnabled ? weatherState.value.rainPercentage : 0,
|
||||
fog: weatherState.value.isFogEnabled ? weatherState.value.fogDensity * 100 : 0
|
||||
}
|
||||
|
||||
const zoneEffects = zoneStore.zone?.zoneEffects?.reduce((acc, curr) => ({
|
||||
...acc,
|
||||
[curr.effect]: curr.strength
|
||||
}), {}) as { [key: string]: number }
|
||||
|
||||
if (zoneEffects && Object.keys(zoneEffects).length) {
|
||||
applyEffects(zoneEffects)
|
||||
} else {
|
||||
applyEffects({
|
||||
light: timeBasedLight,
|
||||
rain: weatherState.value.isRainEnabled ? weatherState.value.rainPercentage : 0,
|
||||
fog: weatherState.value.isFogEnabled ? weatherState.value.fogDensity * 100 : 0
|
||||
...defaultEffects,
|
||||
...(zoneEffects || {})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const applyEffects = (effectValues: any) => {
|
||||
if (effects.light.value) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user