@@ -51,6 +52,7 @@ import ZoneEditor from '@/components/gameMaster/zoneEditor/ZoneEditor.vue'
import GmPanel from '@/components/gameMaster/GmPanel.vue'
import Inventory from '@/components/gui/UserPanel.vue'
import { loadAssets } from '@/composables/zoneComposable'
+import Effects from '@/components/Effects.vue'
const gameStore = useGameStore()
const zoneEditorStore = useZoneEditorStore()
diff --git a/src/stores/zoneEditorStore.ts b/src/stores/zoneEditorStore.ts
index a97ae2a..29fa7e3 100644
--- a/src/stores/zoneEditorStore.ts
+++ b/src/stores/zoneEditorStore.ts
@@ -1,8 +1,8 @@
import { defineStore } from 'pinia'
import { useGameStore } from '@/stores/gameStore'
-import type { Zone, Object, Tile, ZoneObject } from '@/types'
+import type { Zone, Object, Tile, ZoneObject, ZoneEffects } from '@/types'
-type TeleportSettings = {
+export type TeleportSettings = {
toZoneId: number
toPositionX: number
toPositionY: number
@@ -33,14 +33,15 @@ export const useZoneEditorStore = defineStore('zoneEditor', {
name: '',
width: 0,
height: 0,
- pvp: false
+ pvp: false,
+ effects: [] as ZoneEffects[]
},
teleportSettings: {
toZoneId: 0,
toPositionX: 0,
toPositionY: 0,
toRotation: 0
- }
+ } as TeleportSettings
}
},
actions: {
@@ -66,6 +67,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
},
diff --git a/src/types.ts b/src/types.ts
index 7e5657a..f2f4bf7 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -53,6 +53,7 @@ export type Zone = {
height: number
tiles: any | null
pvp: boolean
+ zoneEffects: ZoneEffects
zoneEventTiles: ZoneEventTile[]
zoneObjects: ZoneObject[]
characters: Character[]
@@ -61,6 +62,14 @@ export type Zone = {
updatedAt: Date
}
+export type ZoneEffects = {
+ id: string
+ zoneId: number
+ zone: Zone
+ effect: string
+ strength: number
+}
+
export type ZoneObject = {
id: string
zoneId: number