Downloads containing xlmtapiictf04.j2as

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

File preview

#pragma require "xlmtapIIctf04extra.j2l"
#pragma require "A_CarrFIXday.j2t"
#pragma require "BubbleGun.j2a"

const array<uint16> MountainTiles = {
	680, 681, 682, 683, 684, 685,
	690, 691, 692, 693, 694, 695,
	700, 701, 702, 703, 704, 705,
	710, 711, 712, 713, 714, 715
};

jjPAL pal;
int hue, sat, light;

void onLevelLoad() {
	jjWaterLayer = 6;
	jjSetWaterLevel(32*67.4, true);
	jjWaterInteraction = WATERINTERACTION::SWIM;
	jjSetWaterGradient(20, 140, 180, 0, 0, 190);
	
	jjTexturedBGTexture = TEXTURE::PSYCH;
	jjUseLayer8Speeds = true;

	pal.load("IC - Jungrock1.j2t");	
	for (int n = 144; n <= 254; n++) {
		hue = jjPalette.color[n].getHue();
		sat = jjPalette.color[n].getSat();
		light = jjPalette.color[n].getLight();
		
		if (n < 176 || n > 207) pal.color[n].setHSL(hue + 185, sat, light);
	}
	pal.apply();
	
	//cooba began here
	if (!jjTilesFromTileset("A_CarrFIXday.j2t", 857, 2)) {
		jjAlert("|ERROR: A_CarrFIXday.j2t not found!", false, STRING::MEDIUM);
		return;
	}
	
	if (!jjTilesFromTileset("A_CarrFIXday.j2t", 868, 2)) {
		jjAlert("|ERROR: A_CarrFIXday.j2t not found!", false, STRING::MEDIUM);
		return;
	}
	
/*	if (!jjTilesFromTileset("A_CarrFIXday.j2t", 746, 4)) {
		jjAlert("|ERROR: A_CarrFIXday.j2t not found!", false, STRING::MEDIUM);
		return;
	}
	
	if (!jjTilesFromTileset("A_CarrFIXday.j2t", 756, 4)) {
		jjAlert("|ERROR: A_CarrFIXday.j2t not found!", false, STRING::MEDIUM);
		return;
	}
	
	if (!jjTilesFromTileset("A_CarrFIXday.j2t", 766, 4)) {
		jjAlert("|ERROR: A_CarrFIXday.j2t not found!", false, STRING::MEDIUM);
		return;
	}
	
	if (!jjTilesFromTileset("A_CarrFIXday.j2t", 776, 4)) {
		jjAlert("|ERROR: A_CarrFIXday.j2t not found!", false, STRING::MEDIUM);
		return;
	} */
	
	jjMASKMAP woodenbridge(202);
	for (int i = 910; i < 914; i++) {
		jjPIXELMAP imported(i);
		imported.save(i - 180);
		woodenbridge.save(i - 180);
	}
	
	jjTilesFromTileset("IC - Jungrock1.j2t", 0, 0);		//remove this in jj2+ 5.5
	
	//cooba ended here
	

	
	array<jjLAYER@> extraLayers = jjLayersFromLevel("xlmtapIIctf04extra.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]});
	
	extraLayers[1].spriteMode = 
	extraLayers[2].spriteMode = 
	extraLayers[3].spriteMode =
	extraLayers[4].spriteMode =
	extraLayers[5].spriteMode = SPRITE::BRIGHTNESS;
	
	extraLayers[1].spriteParam =
	extraLayers[2].spriteParam =
	extraLayers[3].spriteParam =
	extraLayers[4].spriteParam =
	extraLayers[5].spriteParam = 95;
	
	
	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;
	
	for (uint16 i = 0; i < MountainTiles.length(); i++) {
		jjPIXELMAP ColoredMountains(MountainTiles[i]);
			for (uint x = 0; x < ColoredMountains.width; ++x) {
				for (uint y = 0; y < ColoredMountains.height; ++y) {
					if (ColoredMountains[x,y] == 105 || ColoredMountains[x,y] == 12)
						ColoredMountains[x,y] = 16;
					else if (ColoredMountains[x,y] == 194 || ColoredMountains[x,y] == 195)
						ColoredMountains[x,y] = 17;											
				}
			}
		ColoredMountains.save(MountainTiles[i], true);
	}
	
	auto proposedLayerOrder = jjLayerOrderGet();
	array<jjLAYER@> layers = jjLayerOrderGet();
	for (uint i = 1; i < 3; i++) {
		jjLAYER@ layer = jjLAYER(layers[12]);
  
		layer.xSpeed = 0.09/i; 
		layer.ySpeed = 0.06/i;
		layer.xOffset = i*50;
		layer.yOffset = i*42;
		layer.spriteMode = SPRITE::BRIGHTNESS;
		layer.spriteParam = 110 + 16*i;
		
  
		proposedLayerOrder.insertAt(proposedLayerOrder.length - 1, layer);
	}
	jjLayerOrderSet(proposedLayerOrder);
}

void onLevelBegin() {
	jjPalette.gradient(0,80,150, 175,175 ,175 , 176, 32);
	jjPalette.apply();
}

void onMain(){
  jjOBJ@ obj;
  for(int i=0;i<jjObjectCount;i++)
  {
    @obj=jjObjects[i];
    if(!obj.isActive) {continue;}
    switch(obj.eventID)
    {
      case OBJECT::GREENSPRING:
		if(obj.yPos>60*32) {obj.ySpeed=-25;}
        if(obj.freeze>0&&jjGameTicks%2==0) {obj.freeze++;}
        break;
	}
   }
   
   jjWeapons[WEAPON::GUN8].comesFromGunCrates = true;
   jjWeapons[WEAPON::GUN9].comesFromGunCrates = true;
   
   
}

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