Downloads containing xlmovergrowth.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: Overgrowth Jgke Capture the flag N/A Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
#include "MLLE-Include-1.5.asc" ///@MLLE-Generated
#pragma require "xlmovergrowth-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "xlmovergrowth.j2l" ///@MLLE-Generated

void onLevelLoad() {
    jjObjectPresets[OBJECT::CARROT].behavior = MaybeBoostedCarrot();
}

bool boostedCarrots = false;

int getPlayerCount() {
    int playerCount = 0;

	for (int i = 0; i < 32; i++) {
        if(jjPlayers[i].isInGame) {
            playerCount += 1;
        }
    }

    return playerCount;
}

void onPlayer(jjPLAYER@ plr) {
    boostedCarrots = getPlayerCount() > 4;
}

class MaybeBoostedCarrot : jjBEHAVIORINTERFACE {
    void onBehave(jjOBJ@ obj) {
        if(obj.xOrg/32 > 50 && obj.xOrg/32 < 75) {
            if(boostedCarrots && obj.eventID != OBJECT::FULLENERGY) {
                jjConsole("Over 4 rabbits: middle carrot changed to Full NRG");
                obj.eventID = OBJECT::FULLENERGY;
                obj.determineCurAnim(ANIM::PICKUPS, 82, true);
            } else if (!boostedCarrots && obj.eventID != OBJECT::CARROT) {
                jjConsole("4 rabbits or less: middle carrot changed to +1");
                obj.eventID = OBJECT::CARROT;
                obj.determineCurAnim(ANIM::PICKUPS, 21, true);
            }
        }
        obj.behave(BEHAVIOR::PICKUP);
    }
}