Downloads containing weaponVMega9.asc

Downloads
Name Author Game Mode Rating
JJ2+ Only: Anniversary Bash 25 CTF Jazz2Online Capture the flag N/A Download file
TSF with JJ2+ Only: Star of the year V2Featured Download TreyLina Capture the flag 8.5 Download file
TSF with JJ2+ Only: Anniversary Bash 24 CTF Jazz2Online Capture the flag N/A Download file
JJ2+ Only: violetclm DOM Episodes I...Featured Download Violet CLM Custom / Concept 9 Download file
TSF with JJ2+ Only: Anniversary Bash 22 levels Jazz2Online Multiple N/A Download file
Custom Weapons...Featured Download Violet CLM Other 10 Download file

File preview

#pragma require "weaponVMega9.asc"
#include "MLLE-Weapons.asc"
#pragma require "weaponVMega.j2a"

namespace WeaponVMega {
	namespace Meteor {
		class Weapon : MLLEWeapons::WeaponInterface {
			Weapon() {
				super(
					regularObjectTemplate: MLLEWeapons::ObjectTemplate(
						xSpeed: 4,
						playerHandling: HANDLING::PARTICLE, //initially
						lightType: LIGHT::NORMAL,
						light: 10,
						var: array<int> = {0,0,0,0,0,6,2},
						animSpeed: 2
					),
					powerupObjectTemplate: MLLEWeapons::ObjectTemplate(
						xSpeed: 5,
						playerHandling: HANDLING::PARTICLE,
						lightType: LIGHT::NORMAL,
						light: 10,
						curAnim: 1,
						var: array<int> = {0,0,0,0,0,7,2},
						animSpeed: 3
					),
					animSetFilename: "weaponVMega.j2a",
					animSetID: 8,
					pickupAnimation: 4,
					poweredUpPickupAnimation: 5,
					pickupFrameIDToUseForAmmoCrate: -10,
					traits: se::weapon_default_traits | se::weapon_goes_through_walls | se::weapon_melts_ice,
					behavior: function(obj, powerup) { obj.behavior = Behavior; }
				);
			}
		}
		void Behavior(jjOBJ@ obj) {
			if (obj.state == STATE::START) {
				obj.state = STATE::DELAYEDSTART;
				obj.xSpeed += obj.var[7] / 65536.f;
				obj.yPos -= 120;
				obj.ySpeed += obj.var[5];
				jjObjects[jjAddObject(OBJECT::EXPLOSION, obj.xPos, obj.yPos + 60, obj.objectID)].curAnim = obj.curAnim + 2;
				DefaultWeapons::DefaultSample(obj, WEAPON::GUN9);
			} 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);
			}
		}
	}
}