/// <reference path="../../playerCharacter/_submodules/mood/moodlets.ts" />

setup.moodletGroups.swim = new MoodletGroup({
	accumulationMode: moodletAccumulationMode.HIGHEST
});

setup.moodlets.swim = new Moodlet({
	title: "Swimming",
	group: 'swim',
	description: 'You went for a swim.',
	effect: 10,
	timeMode: moodletTimeMode.Resetting,
	duration: 240
});

Macro.add('swim', {
	skipArgs : false,
	handler  : function () {
		try {
			const pc = State.variables.pc;
			const duration = this.args[0] ?? 30;

			jQuery(this.output).wiki(`<<mood 'swim' ${duration}>>`);
		}
		catch (ex) {
			return this.error('ERROR in swim-widget: ' + ex.message);
		}
	}
});