Name | Author | Game Mode | Rating | |||||
---|---|---|---|---|---|---|---|---|
Custom Weapons... | Violet CLM | Other | 10 |
#pragma require "weaponVMega5.asc"
#include "MLLE-Weapons.asc"
#pragma require "weaponVMega.j2a"
namespace WeaponVMega {
namespace Backfire {
class Weapon : MLLEWeapons::WeaponInterface {
Weapon() {
super(
regularObjectTemplate: MLLEWeapons::ObjectTemplate(
xSpeed: 4,
xAcc: 0.0625f,
counterEnd: 40,
lightType: LIGHT::POINT,
killAnim: 1,
animSpeed: 3,
var: array<int> = {0,0,0,0,0,0,2}
),
powerupObjectTemplate: MLLEWeapons::ObjectTemplate(
xSpeed: 4.5,
xAcc: 0.1875,
counterEnd: 70/2,
lightType: LIGHT::POINT2,
killAnim: 1,
animSpeed: 2,
var: array<int> = {0,0,0,0,0,0,2}
),
animSetFilename: "weaponVMega.j2a",
animSetID: 4,
pickupAnimation: 2,
poweredUpPickupAnimation: 3,
spread: SPREAD::RF,
replacedByBubbles: true,
traits: se::weapon_default_traits | se::weapon_melts_ice | se::weapon_fails_underwater,
behavior: function(obj, powerup) { obj.behavior = Behavior; }
);
}
}
void Behavior(jjOBJ@ obj) {
if (obj.state == STATE::START) {
jjOBJ@ spawn = jjObjects[jjAddObject(obj.eventID, obj.xPos, obj.yPos, obj.objectID, CREATOR::OBJECT, BEHAVIOR::INACTIVE)];
spawn.xSpeed = -obj.xSpeed;
spawn.ySpeed = -obj.ySpeed;
spawn.xAcc = -obj.xAcc;
spawn.yAcc = -obj.yAcc;
spawn.var[7] = -obj.var[7];
spawn.counterEnd = obj.counterEnd;
spawn.creator = obj.creator;
spawn.curAnim = obj.curAnim;
spawn.killAnim = obj.killAnim;
spawn.counterEnd = obj.counterEnd;
spawn.animSpeed = obj.animSpeed;
spawn.var[3] = obj.var[3];
spawn.var[6] = obj.var[6];
spawn.playerHandling = obj.playerHandling;
spawn.state = STATE::FLY;
spawn.behavior = Behavior;
if (obj.creatorType == CREATOR::PLAYER)
jjSample(obj.xPos, obj.yPos, SOUND::COMMON_PISTOL1);
}
const bool dying = obj.state == STATE::EXPLODE;
obj.behave(BEHAVIOR::BULLET, dying);
if (!dying) {
if (abs(obj.xSpeed) > abs(obj.ySpeed))
obj.ySpeed *= 0.95f;
else
obj.xSpeed *= 0.95f;
jjDrawRotatedSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, MLLEWeapons::HelpfulBulletFunctions::GetAngle(obj), MLLEWeapons::HelpfulBulletFunctions::GetDirection(obj), 1, SPRITE::SINGLEHUE, !MLLEWeapons::HelpfulBulletFunctions::IsPowerup(obj) ? 40 : 32);
}
}
}
}
Jazz2Online © 1999-INFINITY (Site Credits). We have a Privacy Policy. Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats.
Eat your lima beans, Johnny.