Downloads containing weaponMega9.mut

Downloads
Name Author Game Mode Rating
JJ2+ Only: Weapon MegaFeatured Download Violet CLM Mutator 8.7 Download file

File preview

#pragma name "Weapon Mega: Meteor"
#pragma require "weaponMega9.mut"
#include "weaponMega.asc"

bool LoadWeaponMega9() {
	if (!SafeToReplaceWeapon(WEAPON::GUN9))
		return false;
	
	Preset1.behavior = Meteor;
	Preset2.behavior = Meteor;
	Preset1.determineCurAnim(AnimSet, 0);
	Preset2.determineCurAnim(AnimSet, 1);
	Preset1.special = 0; Preset2.special = 0;
	Preset1.determineCurFrame(); Preset2.determineCurFrame();
	Preset1.xSpeed = 4; Preset2.xSpeed = 5;
	Preset1.ySpeed = 6; Preset2.ySpeed = 7;
	Preset1.playerHandling = Preset2.playerHandling = HANDLING::PARTICLE;
	Preset1.counter = Preset2.counter = 0;
	Preset1.lightType = Preset2.lightType = LIGHT::NORMAL;
	Preset1.light = Preset2.light = 10;
	Preset1.var[6] = 0; Preset2.var[6] = 8;
	
	return true;
}
const bool WeaponMega9Loaded = LoadWeaponMega9();

void Meteor(jjOBJ@ obj) {
	if (obj.state == STATE::START) {
		obj.state = STATE::DELAYEDSTART;
		obj.xSpeed += obj.var[7] / 65536.f;
		obj.yPos -= 120;
		jjObjects[jjAddObject(OBJECT::EXPLOSION, obj.xPos, obj.yPos + 60, obj.objectID)].curAnim = obj.curAnim + 2;
	} else if (obj.state == STATE::DELAYEDSTART) {
		if (++obj.counter > 12) {
			obj.state = STATE::FLY;
			obj.playerHandling = HANDLING::PLAYERBULLET;
		}
	} else if (++obj.counter > 75 || obj.state == STATE::EXPLODE) {
		obj.frameID = 4;
		obj.curAnim = jjAnimSets[ANIM::AMMO] + 77; //TNT
		obj.behavior = BEHAVIOR::EXPLOSION;
	} else {
		obj.xPos += obj.xSpeed;
		obj.yPos += obj.ySpeed += 0.1f;
		obj.var[10] = obj.var[10] + 1; //ricochet
		obj.frameID = obj.objectID + jjGameTicks / 4;
		obj.determineCurFrame();
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL, 0, 1);
	}
}