Merge remote-tracking branch 'origin/feature/#313-effects' into feature/map-refactor

This commit is contained in:
2025-01-25 15:34:40 +01:00
6 changed files with 41 additions and 54 deletions

View File

@ -1,6 +1,5 @@
import { BaseEvent } from '#application/base/baseEvent'
import WeatherManager from '#managers/weatherManager'
import CharacterRepository from '#repositories/characterRepository'
import ChatService from '#services/chatService'
type TypePayload = {
@ -20,7 +19,10 @@ export default class ToggleFogCommand extends BaseEvent {
// Check if character exists and is GM
if (!(await this.isCharacterGM())) return
await WeatherManager.toggleFog()
const args = ChatService.getArgs('fog', data.message)
await WeatherManager.setFogValue(args![0] ? Number(args![0]) : null);
callback(true)
} catch (error: any) {
this.logger.error('command error', error.message)
callback(false)

View File

@ -1,6 +1,5 @@
import { BaseEvent } from '#application/base/baseEvent'
import WeatherManager from '#managers/weatherManager'
import CharacterRepository from '#repositories/characterRepository'
import ChatService from '#services/chatService'
type TypePayload = {
@ -20,7 +19,10 @@ export default class ToggleRainCommand extends BaseEvent {
// Check if character exists and is GM
if (!(await this.isCharacterGM())) return
await WeatherManager.toggleRain()
let args = ChatService.getArgs('rain', data.message)
await WeatherManager.setRainValue(args![0] ? Number(args![0]) : null);
callback(true)
} catch (error: any) {
this.logger.error('command error', error.message)
callback(false)