Downloads containing xlmdestination.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Intergalactic Destination Dragusela Battle N/A Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, se::EnergyBlastMLLEWrapper(), null, null, null, null, null, null}); ///@MLLE-Generated
#include "MLLE-Include-1.6w.asc" ///@MLLE-Generated
#pragma require "xlmdestination-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "AsteroidSet.j2t" ///@MLLE-Generated
#pragma require "BattleshipsO.j2t" ///@MLLE-Generated
#pragma require "Moonrise.j2t" ///@MLLE-Generated
#pragma require "xlmdestination.j2l" ///@MLLE-Generated
#include "SEenergyblast-mlle.asc" ///@MLLE-Generated
#pragma require "SEenergyblast-mlle.asc" ///@MLLE-Generated
///@SaveAndRunArgs -server -battle ///@MLLE-Generated

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

void onPlayerInput(jjPLAYER@ player) {
	MLLE::WeaponHook.processPlayerInput(player);
}

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

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

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;
}

void onLevelLoad() {
	jjObjectPresets[OBJECT::GUNCRATE].behavior = GreyCrate();
        jjWeapons[WEAPON::GUN8].comesFromGunCrates = true;
        jjWeapons[WEAPON::GUN9].comesFromGunCrates = true;
}

class GreyCrate : jjBEHAVIORINTERFACE {
	void onBehave(jjOBJ@ obj) {
		obj.behave(BEHAVIOR::CRATE, false);
	}
	void onDraw(jjOBJ@ obj) {
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::SINGLEHUE, 72);
	}
}