Stash WIP zone effect

This commit is contained in:
2024-10-11 15:04:50 +02:00
parent f51cb839bf
commit b264ab3e40
4 changed files with 397 additions and 66 deletions

View File

@ -2,13 +2,18 @@ import { defineStore } from 'pinia'
import { useGameStore } from '@/stores/gameStore'
import type { Zone, Object, Tile, ZoneObject } from '@/types'
type TeleportSettings = {
export type TeleportSettings = {
toZoneId: number
toPositionX: number
toPositionY: number
toRotation: number
}
export type ZoneEffects = {
zoneEffect: string
zoneEffectPercentage: number
}
export const useZoneEditorStore = defineStore('zoneEditor', {
state: () => {
return {
@ -33,14 +38,18 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
name: '',
width: 0,
height: 0,
pvp: false
pvp: false,
zoneEffects: {
zoneEffect: '',
zoneEffectPercentage: 0
} as ZoneEffects
},
teleportSettings: {
toZoneId: 0,
toPositionX: 0,
toPositionY: 0,
toRotation: 0
}
} as TeleportSettings
}
},
actions: {
@ -66,6 +75,10 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
if (!this.zone) return
this.zone.pvp = pvp
},
setZoneEffects(zoneEffects: ZoneEffects) {
if (!this.zone) return
this.zone.zoneEffects = zoneEffects
},
setTool(tool: string) {
this.tool = tool
},