Downloads containing xlmtwilight.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Twilight River Dragusela Capture the flag N/A Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, WeaponVMega::Boomerang::Weapon(), null, null, null, null, null, null}); ///@MLLE-Generated
#include "MLLE-Include-1.6w.asc" ///@MLLE-Generated
#pragma require "xlmtwilight-MLLE-Data-2.j2l" ///@MLLE-Generated
#pragma require "xlmtwilight-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "ssworlds_s1.j2t" ///@MLLE-Generated
#pragma require "PsychLSD.j2t" ///@MLLE-Generated
#pragma require "xlmtwilight.j2l" ///@MLLE-Generated
#include "WeaponVMega1.asc" ///@MLLE-Generated
#pragma require "WeaponVMega1.asc" ///@MLLE-Generated
///@SaveAndRunArgs -server -capture ///@MLLE-Generated

void onLevelLoad() {
	jjUseLayer8Speeds = true;
    for (int i = 1; i < 255; i++) {
        jjOBJ@ preset = jjObjectPresets[i];
        if (preset.playerHandling == HANDLING::PICKUP) {
            preset.behavior = CannotBeShotDown(preset.behavior);
        }
    }
}

bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
	return MLLE::WeaponHook.drawAmmo(player, canvas);
}

void onLevelBegin() {
	MLLE::SpawnOffgrids();
        jjWeapons[3].allowedPowerup = true;
        jjWeapons[5].allowedPowerup = true;
        jjWeapons[6].allowedPowerup = true;
        jjWeapons[8].allowedPowerup = true;
}

void onLevelReload() {
	MLLE::SpawnOffgridsLocal();
}

class CannotBeShotDown : jjBEHAVIORINTERFACE {
    CannotBeShotDown(const jjBEHAVIOR &in behavior) {
        originalBehavior = behavior;
    }
    void onBehave(jjOBJ@ obj) {
        obj.behave(originalBehavior);
        if (obj.state == STATE::FLOATFALL)
            obj.state = STATE::FLOAT;
    }
    bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
        if (bullet is null) {
            obj.behavior = originalBehavior;
            if (player.objectHit(obj, force, obj.playerHandling))
                return true;
            obj.behavior = this;
        }
        return false;
    }
    private jjBEHAVIOR originalBehavior;
}