Downloads containing xlmsnowlandN.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Snowland Toni_ Capture the flag 6.7 Download file

File preview

#include "MLLE-Include-1.4.asc"
const bool MLLESetupSuccessful = MLLE::Setup();
#pragma require "xlmsnowlandN-MLLE-Data-1.j2l"
#pragma require "xlmsnowlandN.j2l"

void recolor(jjANIMFRAME@ frame, int begin, int end, int shift) {
    jjPIXELMAP image(frame);
    for (int i = image.height; i-- != 0;) {
        for (int j = image.width; j-- != 0;) {
            int color = image[j, i];
            if (color >= begin && color < end)
                image[j, i] = color + shift;
        }
    }
    image.save(frame);
}
void recolor(jjANIMATION@ anim, int begin, int end, int shift) {
    for (int i = anim.frameCount; i-- != 0;) {
        recolor(jjAnimFrames[anim + i], begin, end, shift);
    }
}

void onLevelLoad() {
        jjObjectPresets[OBJECT::FULLENERGY].behavior = CannotBeShotDown;
        jjObjectPresets[OBJECT::ELECTROBULLET].xSpeed *= 1.5;
        jjUseLayer8Speeds = true;
        jjDelayGeneratedCrateOrigins = true;
	recolor(jjAnimations[jjAnimSets[ANIM::AMMO] + 23], 32, 40, -8);
  	recolor(jjAnimations[jjAnimSets[ANIM::AMMO] + 25], 32, 40, -8);
}

void CannotBeShotDown(jjOBJ@ obj) {
    obj.behave(BEHAVIOR::PICKUP);
    if (obj.state == STATE::FLOATFALL) obj.state = STATE::FLOAT;
}

void onLevelBegin() {
    for (int i = 1; i < jjObjectCount; i++) {
        if (jjObjects[i].eventID == OBJECT::CTFBASE || jjObjects[i].behavior == BEHAVIOR::FLAG) jjObjects[i].yOrg += 8;
    }
}

void onMain() {
	for (int i = 1; i < jjObjectCount; i++) { 
	   jjOBJ@ o = jjObjects[i];
	   if (o.isActive) {
	       if (o.eventID == OBJECT::SEEKERBULLET || o.eventID == OBJECT::SEEKERBULLETPU) {
			   if (o.yPos > 26.85*32 - 18 && o.yPos < 32*32)
				   if ((o.xPos > 51*32 && o.xPos <52*32) || (o.xPos > 58*32 && o.xPos <59*32))
					   if (o.doesHurt == 0) {
					       o.counter = o.counterEnd;
						   o.doesHurt++;
					    }
	        }
	    }
	}
}