Downloads containing ab20ctf16.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Anniversary Bash 20 Levels Jazz2Online Multiple N/A Download file

File preview

const uint8 EXTRAAMMOPIECES = 3;
const int VANISHTIME = 560; //8 seconds
jjOBJ@ extrapiece;

void onLevelLoad() {
	jjTexturedBGTexture = TEXTURE::PSYCH;
	
	jjObjectPresets[OBJECT::ICEAMMO15].behavior = ExtraAmmoFrom15Crate;
	jjObjectPresets[OBJECT::TOASTERAMMO15].behavior = ExtraAmmoFrom15Crate;
	jjObjectPresets[OBJECT::FULLENERGY].behavior = StillPickup;
	
	jjObjectPresets[OBJECT::ICEAMMO15].var[2] = OBJECT::GUN8AMMO3;
}

void ExtraAmmoFrom15Crate(jjOBJ@ obj) {
	if (obj.state == STATE::START) {
		obj.doesHurt = EXTRAAMMOPIECES;
		obj.var[10] = obj.var[2];
	}	
	if (obj.state == STATE::ACTION) {
		while (obj.doesHurt > 0) {
			@extrapiece = jjObjects[jjAddObject(obj.var[10], obj.xPos + jjRandom()%24, obj.yPos)];
			extrapiece.behavior = BEHAVIOR::FLICKERGEM;
			extrapiece.counter = VANISHTIME;
			extrapiece.state = STATE::FLOATFALL;
			
			obj.doesHurt--;
		}
	}
	if (obj.eventID == OBJECT::ICEAMMO15) {
		obj.behave(BEHAVIOR::AMMO15, false);
		jjDrawTile(int(obj.xPos) - 12, int(obj.yPos) - 19, 628);
	}
	obj.behave(BEHAVIOR::AMMO15);
}

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