Downloads containing 420.mut

Downloads
Name Author Game Mode Rating
JJ2 1.23 vanilla: Miscellaneous stuff Violet CLM Multiple N/A Download file

File preview

const array<uint> Anims = {jjAnimations[jjObjectPresets[OBJECT::CHIPS].curAnim], jjAnimations[jjObjectPresets[OBJECT::FRIES].curAnim], jjAnimations[jjObjectPresets[OBJECT::PIZZA].curAnim], jjAnimations[jjObjectPresets[OBJECT::TACO].curAnim], jjAnimations[jjObjectPresets[OBJECT::BURGER].curAnim]};
const uint firstAmmoAnim = jjAnimSets[ANIM::AMMO];
const uint firstPickupAnim = jjAnimSets[ANIM::PICKUPS];

void onLevelLoad() {
	if (jjAnimSets[ANIM::CATERPIL] == 0) //STONED
		jjAnimSets[ANIM::CATERPIL].load();
}

void onLevelBegin() {
	auto layers = jjLayerOrderGet();
	int layer4Position;
	for (int i = 0; i < int(layers.length); ++i)
		if (layers[i] is jjLayers[4]) {
			layer4Position = i;
			break;
		}
	for (int i = 0; i < int(layers.length); ++i) {
		const float xSpeed = layers[i].xSpeed;
		int rotationRadiusMultiplier = 1;
		if (xSpeed == 1 && layers[i].ySpeed == 1) {
			rotationRadiusMultiplier = 0;
		} else {
			layers[i].rotationAngle = (i - layer4Position  - 1) * 256;
			if (xSpeed > 1)
				rotationRadiusMultiplier = int(ceil(layers[i].xSpeed));
			else if (xSpeed > 0.5)
				rotationRadiusMultiplier = 2;
		}
		layers[i].rotationRadiusMultiplier = rotationRadiusMultiplier;
	}
	for (uint i = 10; i < 255; ++i)
		jjPalette.color[i].setHSL(jjPalette.color[i].getHue(), 255, jjPalette.color[i].getLight());
	jjPalette.apply();
	for (int i = 0; i < jjLocalPlayerCount; ++i)
		jjLocalPlayers[i].lightType = LIGHT::FLICKER;
}

array<int> stonedSound(4, 0);
void onPlayer(jjPLAYER@ play) {
	play.stoned = 140;
	if (play.lighting == 100)
		play.lighting = 80;
	stonedSound[play.localPlayerID] = jjSampleLooped(play.xPos, play.yPos, SOUND::STONED_STONED, play.localPlayerID);
	play.cameraFreeze(play.xPos + jjSin(jjGameTicks * 8) * 20, play.yPos + jjCos(jjGameTicks * 8) * 20, true, true);
}

void onMain() {
	if (jjGameTicks % 210 == 1) {
		for (uint i = 0; i < 95; ++i) {
			jjAnimations[firstPickupAnim + i].firstFrame = Anims[jjRandom() % Anims.length];
			jjAnimations[firstPickupAnim + i].frameCount = 1;
		}
		for (uint i = 0; i < 83; ++i) {
			jjAnimations[firstAmmoAnim + i].firstFrame = Anims[jjRandom() % Anims.length];
			jjAnimations[firstAmmoAnim + i].frameCount = 1;
		}
	}
	if (jjGameTicks & 31 == 0)
		jjSetDarknessColor(jjPALCOLOR(jjRandom() & 127, jjRandom() & 127, jjRandom() & 127));
}

bool onLocalChat(string &in stringReceived, CHAT::Type chatType) {
	if (stringReceived.length < 6 || stringReceived.substr(stringReceived.length - 6) != ", dude") {
		jjChat(((chatType == CHAT::ME) ? "/me " : "") + stringReceived + ", dude", chatType == CHAT::TEAMCHAT);
		return true;
	}
	return false;
}