Complete overhaul of code structure and relevant files (#639)
This commit is contained in:
22
src/Main/CheckStates/Grimoire.js
Normal file
22
src/Main/CheckStates/Grimoire.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { CMOptions } from '../../Config/VariablesAndData';
|
||||
import Flash from '../../Disp/Notifications/Flash';
|
||||
import Notification from '../../Disp/Notifications/Notification';
|
||||
import PlaySound from '../../Disp/Notifications/Sound';
|
||||
import { LastMagicBarFull } from '../VariablesAndData';
|
||||
|
||||
/**
|
||||
* This function checks if the magic meter is full
|
||||
* It is called by CM.Main.Loop
|
||||
*/
|
||||
export default function CheckMagicMeter() {
|
||||
if (Game.Objects['Wizard tower'].minigameLoaded && CMOptions.GrimoireBar === 1) {
|
||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||
if (minigame.magic < minigame.magicM) LastMagicBarFull = false;
|
||||
else if (!LastMagicBarFull) {
|
||||
LastMagicBarFull = true;
|
||||
Flash(3, 'MagicFlash');
|
||||
PlaySound(CMOptions.MagicSoundURL, 'MagicSound', 'MagicVolume');
|
||||
Notification('MagicNotification', 'Magic Meter full', 'Your Magic Meter is full. Cast a spell!');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user