Downloads containing xlmrova.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: RovaniemiFeatured Download Loon Battle 9.1 Download file

File preview

// bg, 187

#pragma require "xlmrovaextra.j2l"
#pragma require "SEfirework.asc"
#include "SEfirework.asc"
se::DefaultWeaponHook weaponHook;
bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
	return weaponHook.drawAmmo(player, canvas);
}

void onLevelLoad() {
	jjUseLayer8Speeds = true;
	jjTexturedBGTexture = TEXTURE::PSYCH;
	
	jjPalette.gradient(122, 122, 122, 232, 232, 232, 176, 32); // 176-207
	jjPalette.gradient(120, 40, 75, 51, 0, 15, 160, 16); // 160-206
	jjPalette.gradient(140, 20, 51, 20, 0, 12, 224, 16); // 160-206
	// jjPalette.gradient(252, 252, 252, 0, 0, 0, 128, 12); // 160-206
	jjPalette.gradient(215, 215, 255, 0, 0, 25, 96, 11);
	
	jjSetWaterGradient(187, 187, 187, 0, 0, 0);
	jjWaterChangeSpeed = 1;
	jjSetWaterLevel(78*32, true);
	jjWaterLighting = (WATERLIGHT::GLOBAL);
	
	jjIsSnowingOutdoorsOnly = true;
	
	array<jjLAYER@> extraLayers = jjLayersFromLevel("xlmrovaextra.j2l", array<uint> = {1,2,3,5,6,7}, 0);
	
	jjLayerOrderSet(array<jjLAYER@> = {jjLayers[1], jjLayers[2], jjLayers[3], jjLayers[4], jjLayers[5], jjLayers[6], jjLayers[7], extraLayers[0], extraLayers[1], extraLayers[2], extraLayers[3], extraLayers[4], extraLayers[5], jjLayers[8]});
	
	jjLayers[7].spriteMode = SPRITE::BRIGHTNESS;
	
	jjLayers[7].spriteParam = 93;
	
	extraLayers[0].spriteMode = 
	extraLayers[1].spriteMode = 
	extraLayers[2].spriteMode = SPRITE::BRIGHTNESS;
	
	extraLayers[0].spriteParam =
	extraLayers[1].spriteParam =
	extraLayers[2].spriteParam = 80;
	
	array<int> BarrelSprites = {3,6,7,8,9};
	for (uint i = 0; i < BarrelSprites.length(); i++) {
		jjANIMATION@ animBarrel = jjAnimations[jjAnimSets[ANIM::PICKUPS] + BarrelSprites[i]];
		for (uint j = 0; j < animBarrel.frameCount; j++) {
			jjANIMFRAME@ frame = jjAnimFrames[animBarrel + j];
			jjPIXELMAP sprite(frame);
			for (uint x = 0; x < sprite.width; ++x) {
				for (uint y = 0; y < sprite.height; ++y) {
					if (sprite[x,y] == 40) sprite[x,y] = 24;
					if (sprite[x,y] == 53) sprite[x,y] = 41;
					if (sprite[x,y] >= 56 && sprite[x,y] <= 62) sprite[x,y] -= 31;
					if (sprite[x,y] >= 80 && sprite[x,y] <= 87) sprite[x,y] -= 64;
				}
			}
			sprite.save(frame);
		}
	}
	se::firework.loadAnims(jjAnimSets[ANIM::CUSTOM[1]]);
	se::firework.loadSamples(array<SOUND::Sample> = {SOUND::INTRO_BOEM1, SOUND::INTRO_BOEM2});
	se::firework.setAsWeapon(3, weaponHook);
	
	jjOBJ@ preset = jjObjectPresets[OBJECT::FROZENSPRING];
	preset.behavior = coloredSpring;
	preset.bulletHandling = HANDLING::IGNOREBULLET;
	preset.freeze = 0;
	preset.ySpeed = -26.5f;
	preset.xPos = preset.xOrg + 8;
}


void onMain() {
	for (int i = 0; i < 1024; i++) {
		jjPARTICLE@ particle = jjParticles[i];
		if (particle.type == PARTICLE::FLOWER && particle.yPos > jjWaterLevel) {
			particle.type = PARTICLE::INACTIVE;
		}
	}
	weaponHook.processMain();
	for (int i = 1; i < jjObjectCount; i++) {
		if ((jjObjects[i].eventID == OBJECT::FULLENERGY || jjObjects[i].eventID == OBJECT::COPTER || jjObjects[i].eventID == OBJECT::TOASTERPOWERUP || jjObjects[i].eventID == OBJECT::LIGHTNINGSHIELD) && (jjObjects[i].state == STATE::FLY || jjObjects[i].behavior == BEHAVIOR::MONITOR || jjObjects[i].eventID == OBJECT::LIGHTNINGSHIELD)) {
			jjObjects[i].xPos = jjObjects[i].xOrg - 16;
		}
	}
	jjWeapons[WEAPON::GUN8].comesFromGunCrates = true;
    jjWeapons[WEAPON::GUN9].comesFromGunCrates = true;
}

void onPlayer(jjPLAYER@ player) {
	weaponHook.processPlayer(player);
}
void onPlayerInput(jjPLAYER@ player) {
	weaponHook.processPlayerInput(player);
}
void onReceive(jjSTREAM &in packet, int clientID) {
	weaponHook.processPacket(packet, clientID);
}

void coloredSpring(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::SPRING, false);
	jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 248);
}

void offsetPosition(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::SPRING);
	if (obj.xPos > 88*32 && obj.xPos < 90*32) obj.xPos = obj.xOrg + 12;
}