Downloads containing xlmtapiibtl02.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: Total Annihilation II:...Featured Download Loon Multiple 9.3 Download file

File preview

#pragma require "xlmtapIIbtl02extra.j2l"
#pragma require "DiamEvilFix.j2t"
#pragma require "BubbleGun.j2a"

jjPAL Sky;

void onLevelLoad() {
	jjUseLayer8Speeds = true;

	jjPAL newPal;
	newPal.load("DiamEvilFix.j2t") || newPal.load("Diam1.j2t");
	newPal.apply();
	
	jjSetWaterGradient(60, 30, 200, 0, 0, 0);
	jjWaterChangeSpeed = 0;
	jjSetWaterLevel(252*32, true);
	jjWaterLighting = (WATERLIGHT::GLOBAL);
	
	Sky.load("Diam2.j2t");
	jjPalette.copyFrom(176, 32, 176, Sky, 1);
	jjPalette.apply();
	
	array<jjLAYER@> extraLayers = jjLayersFromLevel("xlmtapIIbtl02extra.j2l", array<uint> = {1,3,5,6,7,8}, 0);
	array<jjLAYER@> extraLayersM = jjLayersFromLevel("xlmtapIIbtl02extra2.j2l", array<uint> = {7}, 0);
	jjLayerOrderSet(array<jjLAYER@> = {jjLayers[1], jjLayers[2], jjLayers[3], jjLayers[4], jjLayers[5], extraLayers[0], extraLayers[1], extraLayers[2], extraLayers[3], jjLayers[6], jjLayers[7], extraLayers[4], extraLayers[5], jjLayers[8]});
	
	jjLayers[6].spriteMode =
	jjLayers[7].spriteMode =
	extraLayers[0].spriteMode = 
	extraLayers[1].spriteMode = 
	extraLayers[2].spriteMode = 
	extraLayers[3].spriteMode =
	extraLayers[4].spriteMode =
	extraLayers[5].spriteMode = SPRITE::BRIGHTNESS;
	
	jjLayers[6].spriteParam =
	jjLayers[7].spriteParam =
	extraLayers[0].spriteParam =
	extraLayers[1].spriteParam =
	extraLayers[2].spriteParam =
	extraLayers[3].spriteParam =
	extraLayers[4].spriteParam =
	extraLayers[5].spriteParam = 90;
	
	jjTexturedBGFadePositionY = 0.4;
	jjTexturedBGFadePositionX = 0.1;
	
	jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::BRIDGE] + 1];
	for (uint j = 0; j < anim.frameCount; j++) {
		jjANIMFRAME@ frame = jjAnimFrames[anim + j];
		jjPIXELMAP sprite(frame);
		for (uint x = 0; x < sprite.width; ++x) {
			for (uint y = 0; y < sprite.height; ++y) {
				if (sprite[x,y] >= 64 && sprite[x,y] <= 71) sprite[x,y] = 112 + (sprite[x,y]&7)*2;
			}
		}
		sprite.save(frame);
	}
	
	jjAnimSets[ANIM::CUSTOM[0]].load(0, "BubbleGun.j2a");
	jjAnimSets[ANIM::CUSTOM[1]].load(1, "BubbleGun.j2a");
	jjAnimSets[ANIM::CUSTOM[2]].load(2, "BubbleGun.j2a");
	jjAnimations[jjAnimSets[ANIM::AMMO] + 29] = jjAnimations[jjAnimSets[ANIM::AMMO] + 8];
	jjAnimations[jjAnimSets[ANIM::AMMO] + 28] = jjAnimations[jjAnimSets[ANIM::CUSTOM[0]] + 0];
	
	jjObjectPresets[OBJECT::ICEBULLET].special = jjObjectPresets[OBJECT::ICEBULLET].determineCurAnim(ANIM::AMMO, 8);
	jjObjectPresets[OBJECT::ICEBULLET].xSpeed = 2;
	jjObjectPresets[OBJECT::ICEBULLET].counterEnd = 105;
	jjObjectPresets[OBJECT::ICEBULLET].var[6] = 0;
	jjObjectPresets[OBJECT::ICEBULLET].freeze = 0;
	jjObjectPresets[OBJECT::ICEBULLET].lightType = jjObjectPresets[OBJECT::BLASTERBULLET].lightType;

	jjObjectPresets[OBJECT::ICEBULLETPU].special = jjObjectPresets[OBJECT::ICEBULLETPU].determineCurAnim(ANIM::CUSTOM[0], 0);
	jjObjectPresets[OBJECT::ICEBULLETPU].xSpeed = 3;
	jjObjectPresets[OBJECT::ICEBULLETPU].counterEnd = 105;
	jjObjectPresets[OBJECT::ICEBULLETPU].var[6] = 8;
	jjObjectPresets[OBJECT::ICEBULLETPU].freeze = 0;
	jjObjectPresets[OBJECT::ICEBULLETPU].lightType = jjObjectPresets[OBJECT::BLASTERBULLET].lightType;
	
	jjObjectPresets[OBJECT::ICEBULLET].behavior = jjObjectPresets[OBJECT::ICEBULLETPU].behavior = BubbleGun();
	
	jjObjectPresets[OBJECT::ICEPOWERUP].determineCurAnim(ANIM::CUSTOM[1], 0, true);
	
	jjWeapons[WEAPON::ICE].spread = SPREAD::NORMAL;
	jjWeapons[WEAPON::ICE].defaultSample = false;
}

void onLevelReload() {
	jjPAL newPal;
	newPal.load("DiamEvilFix.j2t") || newPal.load("Diam1.j2t");
	newPal.apply();
	
	
	Sky.load("Diam2.j2t");
	jjPalette.copyFrom(176, 32, 176, Sky, 1);
	jjPalette.apply();
}
void onLevelBegin() {
	
	for (int x = 0; x < jjLayerWidth[4]; x++) {
		for (int y = 0; y < jjLayerHeight[4]; y++) {
			uint16 tile = jjTileGet(4, x, y);
						
			if (jjEventGet(x, y) == 119) jjTileSet(4, x, y, tile ^ TILE::VFLIPPED);
		}
	}
}

class BubbleGun : jjBEHAVIORINTERFACE {
    void onBehave(jjOBJ@ bubble) {
		if (bubble.state == STATE::START) {
			bubble.state = STATE::FLY;
			if (jjPlayers[bubble.creatorID].isLocal) jjSample(bubble.xPos, bubble.yPos, SOUND::COMMON_PLOP2, 0, 0);
		}
		
		if (jjMaskedPixel(int(bubble.xPos) + int(bubble.xSpeed), int(bubble.yPos)) || jjMaskedPixel(int(bubble.xPos) - int(bubble.xSpeed), int(bubble.yPos)) || jjMaskedPixel(int(bubble.xPos), int(bubble.yPos) + int(bubble.ySpeed)) || jjMaskedPixel(int(bubble.xPos), int(bubble.yPos) - int(bubble.ySpeed))) {
			jjSample(bubble.xPos, bubble.yPos, SOUND::P2_SPLOUT, 0, 0);
		}
		
		bubble.behave(BEHAVIOR::WATERSHIELDBULLET);
		
		if (bubble.state == STATE::FLY && bubble.counter > 0) {
			switch (bubble.direction) {
				case 1: bubble.xSpeed -= (bubble.eventID == OBJECT::ICEBULLETPU? 0.1:0.04); bubble.ySpeed -= (bubble.eventID == OBJECT::ICEBULLETPU? 0.1:0.04); break;
				case -1: bubble.xSpeed += (bubble.eventID == OBJECT::ICEBULLETPU? 0.1:0.04); bubble.ySpeed -= (bubble.eventID == OBJECT::ICEBULLETPU? 0.1:0.04); break;
			}
		}
		
		bubble.killAnim = jjObjectPresets[OBJECT::WATERSHIELDBULLET].killAnim;
	}
}

void onMain(){  
	jjWeapons[WEAPON::GUN8].comesFromGunCrates = true;
	jjWeapons[WEAPON::GUN9].comesFromGunCrates = true;
	jjObjectPresets[OBJECT::ELECTROBULLET].counterEnd = jjObjectPresets[OBJECT::ELECTROBULLET].counterEnd;
}

// 	newPal.load("Dreary Diamondus.j2t") || newPal.load("Diam1.j2t");
// 	newPal.load("DiamGrasslandFix.j2t") || newPal.load("Diam1.j2t");
//  newPal.load("DiamEvilFix.j2t") || newPal.load("Diam1.j2t");
//  jjSetWaterGradient(30, 185, 255, 0, 30, 145);