import * as mc from "@minecraft/server";
import mountFlying from "../C/Flying";
import { processLinkedMountsAndRiders } from "../C/Linking";
import { incubator } from "../C/Incubator";
import { eggTimer } from "../C/Egg";
import { decreasePhoenixArmorCooldown } from "../A/PhoenixArmor";
import { getArmorType } from "../U/ArmorUtility";
import { ArmorType } from "../DATA/ArmorConfig";
import { reflectProjectiles } from "../A/SerpentDragonArmor";
import { doubleJump } from "../A/GriffinArmour";
import { slowNearbyEntities } from "../A/IceDragonArmour";
import { applyArmorEffect } from "../A/ArmourEffects";
export default class IntervalManger {
    gameplayLogger(message, status) {
        if (status !== undefined && status > 0) {
            message = "SUCCESS: " + message;
        }
        else if (status !== undefined && status < 0) {
            message = "FAIL: " + message;
        }
    }
    constructor() {
        this.gameplayLogger = this.gameplayLogger.bind(this);
        let x = 0;
        mc.system.runInterval(() => {
            x++;
            this.intervalScript(this.gameplayLogger, x);
        });
    }
    intervalScript(log, x) {
        mountFlying(log);
        if (x % 60 === 0) {
            processLinkedMountsAndRiders();
        }
        if (x % 100 === 0) {
            incubator(log);
        }
        if (x % 300 === 0) {
            eggTimer(log);
        }
        if (x % 100 === 0) {
            decreasePhoenixArmorCooldown(log);
        }
        for (const player of mc.world.getAllPlayers()) {
            const armorType = getArmorType(player);
            if (armorType === ArmorType.SerpentDragon) {
                reflectProjectiles(log, player);
            }
            if (armorType === ArmorType.Griffin) {
                doubleJump(player);
            }
            if (armorType === ArmorType.IceDragon) {
                slowNearbyEntities(log, player);
            }
            if (armorType != ArmorType.None) {
                applyArmorEffect(log, player, armorType);
            }
        }
    }
}

//# sourceMappingURL=../../../../../_KiCuMountsBPDebug/kicu/mmad/M/IntervalManager.js.map
