Downloads containing PhoenixGun.asc

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Anniversary Bash 26 CTF Jazz2Online Capture the flag N/A Download file
JJ2+ Only: Anniversary Bash 25 CTF Jazz2Online Capture the flag N/A Download file
TSF with JJ2+ Only: Blast ConcussionFeatured Download Violet CLM Capture the flag 9.7 Download file
JJ2+ Only: violetclm DOM Episodes I...Featured Download Violet CLM Custom / Concept 9 Download file
Custom Weapons...Featured Download Violet CLM Other 10 Download file

File preview

#pragma require "PhoenixGun.asc"
#include "MLLE-Weapons.asc"
#pragma require "SmokeWopens.j2a"

namespace SmokeWopens {
	namespace PhoenixGun {
		class Wopen : MLLEWeapons::WeaponInterface {
			Wopen() {
				super(
					regularObjectTemplate: MLLEWeapons::ObjectTemplate(
						xSpeed: 8,
						animSpeed: 2,
						killAnim: jjAnimSets[ANIM::AMMO].firstAnim + 82,
						curAnim: 1,
						lightType: LIGHT::POINT2,
						counterEnd: 85
					),
					powerupObjectTemplate: MLLEWeapons::ObjectTemplate(
						xSpeed: 13,
						animSpeed: 2,
						killAnim: jjAnimSets[ANIM::AMMO].firstAnim + 82,
						curAnim: 1,
						lightType: LIGHT::POINT2,
						counterEnd: 175
					),
					animSetFilename: "SmokeWopens.j2a",
					animSetID: 2,
					poweredUpPickupAnimation: 0,
					roundsPerPickup: 1,
					traits: se::weapon_default_traits | se::weapon_is_super_weapon | se::weapon_melts_ice,
					behavior: function(obj, powerup) {
						jjSample(obj.xPos, obj.yPos, SOUND::COMMON_BIRDFLY);
						obj.var[6] = 8;
						obj.var[7] = 0;
						obj.special = 1;
						if (obj.eventID == OBJECT::ICEBULLET) obj.eventID = OBJECT::BLASTERBULLET;
						obj.behavior = Behavior;
					}
				);
			}
		}
		
		void Behavior(jjOBJ@ obj) {
			const bool powerup = (obj.counterEnd / 100) != 0;
			const bool nativeDraw = obj.state == STATE::EXPLODE || powerup;
			obj.behave(BEHAVIOR::BULLET, nativeDraw);
			if (!nativeDraw) jjDrawRotatedSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, MLLEWeapons::HelpfulBulletFunctions::GetAngle(obj), MLLEWeapons::HelpfulBulletFunctions::GetDirection(obj), 1, SPRITE::SINGLEHUE, 16);
		
			if (obj.state == STATE::FLY && (obj.counter % 6) == 0) {
				const int nextAngle = MLLEWeapons::HelpfulBulletFunctions::GetAngle(obj);
				const int var6 = powerup ? 10 : 2;
				for (int i = -9; i <= 9; i += 18) {
					jjOBJ@ o = jjObjects[jjAddObject(OBJECT::FIRESHIELDBULLET, obj.xPos, obj.yPos, obj.creatorID, obj.creatorType, BEHAVIOR::BULLET)];
					o.xSpeed = jjSin(nextAngle) * i;
					o.ySpeed = jjCos(nextAngle) * i;
					o.xAcc = o.yAcc = 0;
					o.playerHandling = obj.playerHandling;
					o.counter = 0;
					o.counterEnd = 200;
					o.animSpeed = 3;
					o.determineCurAnim(ANIM::AMMO, 14);
					o.var[3] = 6;
					o.var[6] = var6;
					o.lightType = LIGHT::POINT2;
				}
			}
		}
	}
}