From 7c2e62efc275db3a537d85360b0e499be0aa0183 Mon Sep 17 00:00:00 2001 From: HF Date: Tue, 26 Apr 2022 13:10:34 +0200 Subject: [PATCH] adjust Clown Void event from 10min to 8min duration and make it 10% slower --- src/core/RpgEvent.js | 20 +++++++++----------- src/core/Void.js | 10 ++++------ 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/core/RpgEvent.js b/src/core/RpgEvent.js index d458045..f639a57 100644 --- a/src/core/RpgEvent.js +++ b/src/core/RpgEvent.js @@ -25,12 +25,12 @@ import chatProvider from './ChatProvider'; import canvases from './canvases.json'; // steps in minutes for event stages -const STEPS = [30, 10, 2, 1, 0, -10, -15, -40, -60]; +// STEPS[5] is event duration, adjusted from 10 to 8 on 2022.04.26 +const STEPS = [30, 10, 2, 1, 0, -8, -15, -40, -60]; // const STEPS = [4, 3, 2, 1, 0, -1, -2, -3, -4]; // gap between events in min, starting 1h after last event // so 60 is a 2h gap, has to be higher than first and highest STEP numbers const EVENT_GAP_MIN = 60; -// const EVENT_GAP_MIN = 5; /* * draw cross in center of chunk @@ -277,7 +277,9 @@ class RpgEvent { RpgEvent.broadcastChatMessage( 'Fight starting!', ); - this.void = new Void(this.eventCenterC); + // run event for 8min + const targetDuration = STEPS[5] * -1; + this.void = new Void(this.eventCenterC, targetDuration); this.eventState = 11; } else if (this.void) { const percent = this.void.checkStatus(); @@ -301,11 +303,9 @@ class RpgEvent { } } } - // run event for 10min setTimeout(this.runEventLoop, 1000); } else if (eventMinutes > STEPS[6]) { if (eventState !== 12) { - // after 10min of event // check if won if (this.void) { if (this.void.checkStatus() !== 100) { @@ -321,12 +321,10 @@ class RpgEvent { } this.eventState = 12; } - // for 30min after event - // do nothing setTimeout(this.runEventLoop, 60000); } else if (eventMinutes > STEPS[7]) { if (eventState !== 13) { - // 5min after last Event + // 7min after last Event // end debuff if lost if (this.success === 2) { RpgEvent.broadcastChatMessage( @@ -339,7 +337,7 @@ class RpgEvent { setTimeout(this.runEventLoop, 60000); } else if (eventMinutes > STEPS[8]) { if (eventState !== 14) { - // 30min after last Event + // 32min after last Event // clear old event area // reset success state logger.info('Restoring old event area'); @@ -352,11 +350,11 @@ class RpgEvent { } this.eventState = 14; } - // 30min to 50min after last Event + // 32min to 52min after last Event // do nothing setTimeout(this.runEventLoop, 60000); } else { - // 50min after last Event / 1h before next Event + // 52min after last Event / 1h before next Event // define and protect it this.eventTimestamp = await RpgEvent.setNextEvent(); await this.calcEventCenter(); diff --git a/src/core/Void.js b/src/core/Void.js index 2266ddb..37aab99 100644 --- a/src/core/Void.js +++ b/src/core/Void.js @@ -14,8 +14,6 @@ import { CANVAS_ID } from '../data/models/Event'; import canvases from './canvases.json'; const TARGET_RADIUS = 62; -const EVENT_DURATION_MIN = 10; -// const EVENT_DURATION_MIN = 1; class Void { // chunk coords @@ -37,7 +35,7 @@ class Void { // boolean if ended ended; - constructor(centerCell) { + constructor(centerCell, targetDuration) { // chunk coordinates const [i, j] = centerCell; this.i = i; @@ -46,9 +44,9 @@ class Void { this.maxClr = canvases[CANVAS_ID].colors.length; const area = TARGET_RADIUS ** 2 * Math.PI; const online = socketEvents.onlineCounter.total || 0; - // require an average of 0.25 px / min / user - const requiredSpeed = Math.floor(online / 1.8); - const ppm = Math.ceil(area / EVENT_DURATION_MIN + requiredSpeed); + // adjusted from 1.8 to 2.0 on 2022.04.26 + const requiredSpeed = Math.floor(online / 2.0); + const ppm = Math.ceil(area / targetDuration + requiredSpeed); this.msTimeout = 60 * 1000 / ppm; this.area = new Uint8Array(TILE_SIZE * 3 * TILE_SIZE * 3); this.userArea = new Uint8Array(TILE_SIZE * 3 * TILE_SIZE * 3);