Name | Author | Game Mode | Rating | |||||
---|---|---|---|---|---|---|---|---|
Spherical Coalesence | ThunDerDraGon | Capture the flag | N/A |
#pragma name "Ares Exoskeleton v1.0"
#pragma require "AA-Functions.asc"
#pragma require "Exo_Gun2.png"
#pragma require "Ares_Arm_1.png"
#pragma require "Ares_Arm_2.png"
#pragma require "Ares_Arm_3.png"
#pragma require "Exo_Gun3.png"
#pragma require "Ares_Bullet.png"
#pragma require "Airburst_Grenade.png"
#pragma require "Exoskeleton_charge.wav"
#pragma require "Cannon_Deploy.wav"
#pragma require "Cannon_Fire.wav"
#pragma require "Cannon_Fire2.wav"
#pragma require "AirBurst_Explosion.wav");
namespace Exoskeleton {
array<string> exoCharge = {"CHARGING...", "ACQUIRED...", "FIRING...", "EXTERMINATING..", "PROCEEDING..."};
array<jjPLAYER@> targets (32, null);
enum weapPacket {exoskeleton = 3};
void handlePresets() {
AATools::loadAssets("Exo_Gun2.png", 109, 102, 36);
AATools::loadAssets("Ares_Arm_1.png", 110, 73, 38);
AATools::loadAssets("Ares_Arm_2.png", 111, 90, 38);
AATools::loadAssets("Ares_Arm_3.png", 112, 43, 38);
AATools::loadAssets("Exo_Gun3.png", 113, 104, 62);
AATools::loadAssets("Ares_Bullet.png", 114, 36, 8);
AATools::loadAssets("Airburst_Grenade.png", 115, 44, 26);
AATools::loadAssets("Ares_Pickup.png", 120, 52, 66);
AATools::loadParticlePresets();
jjSampleLoad(SOUND::XTURTLE_SPK4TURT, "Exoskeleton_charge.wav");
jjSampleLoad(SOUND::XTURTLE_SPK3TURT, "Cannon_Deploy.wav");
jjSampleLoad(SOUND::XBILSY_THUNDER, "Cannon_Fire.wav");
jjSampleLoad(SOUND::XBILSY_FINGERSNAP, "Cannon_Fire2.wav");
jjSampleLoad(SOUND::XTURTLE_TURN, "AirBurst_Explosion.wav");
jjObjectPresets[OBJECT::CANDY].behavior = Exoskeleton();
jjObjectPresets[OBJECT::EXTRALIFE].scriptedCollisions = true;
jjObjectPresets[OBJECT::EXTRALIFE].behavior = Exo_Pickup();
jjOBJ@ preset = jjObjectPresets[OBJECT::PIZZA];
preset.determineCurAnim(ANIM::CUSTOM[115], 0);
preset.playerHandling = HANDLING::PLAYERBULLET;
preset.bulletHandling = HANDLING::IGNOREBULLET;
preset.isBlastable = preset.isFreezable = preset.isTarget = false;
preset.animSpeed = 3;
preset.behavior = AirBurst();
}
class Exo_Pickup : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
if (obj.state == STATE::START)
obj.yPos += 16;
obj.behave(BEHAVIOR::PICKUP, false);
obj.state = STATE::FLOATFALL;
obj.xSpeed = obj.ySpeed = 0;
}
bool onObjectHit(jjOBJ@ obj, jjOBJ@, jjPLAYER@ player, int) {
jjAddObject(OBJECT::CANDY, player.xPos, player.yPos, player.playerID, CREATOR::PLAYER);
obj.behavior = BEHAVIOR::EXPLOSION2;
obj.scriptedCollisions = false;
if (jjIsServer && player.isLocal) {
jjSTREAM packet;
packet.push(uint8(exoskeleton));
packet.push(player.playerID);
jjSendPacket(packet);
}
return true;
}
void onDraw(jjOBJ@ obj) {
jjDrawResizedSprite(obj.xPos + 4, obj.yPos, ANIM::CUSTOM[120], 0, 1,
0.8+((jjGameTicks%150)/220.f),
0.8+((jjGameTicks%150)/220.f),
SPRITE::BLEND_NORMAL, 150 - ((jjGameTicks%150)));
jjDrawResizedSprite(obj.xPos + 4, obj.yPos, ANIM::CUSTOM[120], 0, int((jjGameTicks%(11*7))/7), 0.8, 0.8, SPRITE::NORMAL);
}
}
class Exoskeleton : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
jjPLAYER@ play = jjPlayers[obj.creatorID];
obj.age++;
obj.counter++;
obj.xPos = play.xPos;
obj.yPos = play.yPos;
obj.isFreezable = obj.isBlastable = obj.isTarget = false;
obj.bulletHandling = HANDLING::IGNOREBULLET;
obj.playerHandling = HANDLING::PARTICLE;
if (obj.state == STATE::START) {
if (jjPlayers[obj.creatorID].isLocal)
jjSamplePriority(SOUND::XTURTLE_SPK3TURT);
for (int i = 1; i < jjObjectCount; i++) {
jjOBJ@ o = jjObjects[i];
if (o.isActive && o.eventID == obj.eventID && obj.creatorID == o.creatorID && o.objectID != obj.objectID)
o.delete();
}
obj.special = 0;
obj.lightType = LIGHT::NONE;
obj.playerHandling = HANDLING::PARTICLE;
obj.state = STATE::IDLE;
} else if (obj.state == STATE::IDLE) {
@targets[obj.creatorID] = jjPlayers[AATools::findNearestHostilePlayer(obj, 700)];
if (obj.counter%700 < 170)
obj.var[0] = obj.var[0] - 1;
else if (obj.counter%600 > 330 && obj.counter%600 < 500)
obj.var[0] = obj.var[0] + 1;
if (obj.counter%700 < 120)
obj.var[1] = obj.var[1] + 1;
else if (obj.counter%600 > 290 && obj.counter%600 < 480)
obj.var[1] = obj.var[1] - 1;
if (targets[obj.creatorID].isInGame && obj.counter > 70*3 && (jjGameState == GAME::STARTED || jjGameState == GAME::OVERTIME)) {
if (play.isLocal)
jjSamplePriority(SOUND::XTURTLE_SPK4TURT);
obj.counter = 0;
obj.state = STATE::ACTION;
if (play.isLocal)
AATools::addFloatingText("||||" + exoCharge[jjRandom()%exoCharge.length], obj.xPos, obj.yPos - 10, 185, STRING::SMALL, STRING::BOUNCE);
}
} else if (obj.state == STATE::ACTION) {
if (targets[obj.creatorID].isInGame && targets[obj.creatorID].health > 0) {
obj.var[0] = int(atan2(obj.xPos+100 - targets[obj.creatorID].xPos, obj.yPos-30 - targets[obj.creatorID].yPos)*512/3.1415926f);
obj.var[1] = int(atan2(obj.xPos-100 - targets[obj.creatorID].xPos, obj.yPos-30 - targets[obj.creatorID].yPos)*512/3.1415926f);
if (obj.counter > 3*70) {
if (obj.counter%35 == 1) {
for (int i=-1; i < 2; i++) {
int laser = jjAddObject(OBJECT::ORANGE, obj.xPos+100, obj.yPos-30, obj.creatorID, CREATOR::PLAYER);
jjObjects[laser].xSpeed = -10*jjSin(obj.var[0]+10*i);
jjObjects[laser].ySpeed = -10*jjCos(obj.var[0]+10*i);
jjObjects[laser].determineCurAnim(ANIM::CUSTOM[114], 0);
jjObjects[laser].animSpeed = 3;
jjObjects[laser].var[6] = 24;
}
jjSample(obj.xPos+100, obj.yPos-30, SOUND::XBILSY_THUNDER);
} else if (obj.counter%120 == 3) {
int grenade = jjAddObject(OBJECT::PIZZA, obj.xPos-100, obj.yPos-30, obj.creatorID, CREATOR::PLAYER);
jjObjects[grenade].xSpeed = -15*jjSin(obj.var[1]);
jjObjects[grenade].ySpeed = -15*jjCos(obj.var[1]);
jjObjects[grenade].animSpeed = 3;
jjObjects[grenade].var[6] = 2;
//jjObjects[grenade].determineCurAnim(ANIM::CUSTOM[115], 0);
jjSample(obj.xPos-100, obj.yPos-30, SOUND::XBILSY_FINGERSNAP);
}
}
} else {
obj.state = STATE::IDLE;
obj.counter == 0;
}
if (obj.counter == 10*50 || targets[obj.creatorID].health == 0) {
obj.counter = 0;
obj.state = STATE::IDLE;
AATools::addFloatingText("||" + "OVERHEAT", obj.xPos, obj.yPos - 10, 135, STRING::SMALL, STRING::BOUNCE);
}
} else if (obj.state == STATE::EXPLODE)
obj.delete();
if (jjPlayers[obj.creatorID].health == 0 || obj.age > 30*70)
obj.delete();
}
void onDraw(jjOBJ@ obj) {
jjPLAYER@ play = jjPlayers[obj.creatorID];
if (play.isLocal)
jjDrawString(obj.xPos - 6, obj.yPos - 47, "||||" + (30-obj.age/70), STRING::SMALL);
for (int i=-1; i < 2; i++)
if (i != 0) {
jjDrawRotatedSprite(play.xPos+(8*i), play.yPos, ANIM::CUSTOM[112], 0, int((jjGameTicks%(9*6))/6), 0, 0.6*i, 0.6, SPRITE::NORMAL, 0, 5);
jjDrawRotatedSprite(play.xPos+(40*i), play.yPos-5, ANIM::CUSTOM[110], 0, int((jjGameTicks%(9*6))/6), (-30+60)*i, 0.6*i, 0.6, SPRITE::NORMAL,0,4);
jjDrawRotatedSprite(play.xPos+ (80*i), play.yPos-20, ANIM::CUSTOM[111], 0, int((jjGameTicks%(9*6))/6), (50+60)*i, 0.6*i, 0.6, SPRITE::NORMAL,0,4);
}
float mag = (obj.state == STATE::ACTION && obj.counter < 3*70) ? 1 + (jjRandom()%4)/2 : 0;
if (obj.state == STATE::ACTION && obj.counter < 3*70) {
jjDrawRotatedSprite(play.xPos+(100) + mag, play.yPos-30 + mag, ANIM::CUSTOM[109], 0, int((jjGameTicks%(5*7))/7), obj.var[0]+1023/4, 0.9, 0.9, SPRITE::SINGLEHUE, obj.counter,4);
jjDrawRotatedSprite(play.xPos-(100) + mag, play.yPos-30 + mag, ANIM::CUSTOM[113], 0, int((jjGameTicks%(6*7))/7), obj.var[1]-1023/4, -0.9, 0.9, SPRITE::SINGLEHUE, obj.counter,4);
}
jjDrawRotatedSprite(play.xPos+(100) + mag, play.yPos-30 + mag, ANIM::CUSTOM[109], 0, int((jjGameTicks%(5*7))/7), obj.var[0]+1023/4, 0.8, 0.8, SPRITE::NORMAL,0,4);
jjDrawRotatedSprite(play.xPos-(100) + mag, play.yPos-30 + mag, ANIM::CUSTOM[113], 0, int((jjGameTicks%(6*7))/7), obj.var[1]-1023/4, -0.8, 0.8, SPRITE::NORMAL,0,4);
}
}
class AirBurst : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
if (obj.state == STATE::START)
obj.state = STATE::FLY;
else if (obj.state == STATE::FLY) {
obj.var[6] = 24;
obj.frameID = int((jjGameTicks%(4*7))/7);
obj.xPos += obj.xSpeed;
obj.yPos += obj.ySpeed;
obj.var[0] = int(atan2(-(obj.xSpeed), -(obj.ySpeed))*512/3.1415926f);
if (jjMaskedPixel(int(obj.xPos), int(obj.yPos))) {
obj.state = STATE::EXPLODE;
jjSample(obj.xPos, obj.yPos, SOUND::XTURTLE_TURN);
if (AATools::playerDistanceToObject(p, obj) < 200 && p.isEnemy(jjPlayers[obj.creatorID]))
p.hurt(2, false, jjPlayers[obj.creatorID]);
}
} else if (obj.state == STATE::EXPLODE) {
obj.counter++;
if (obj.counter == 43)
obj.delete();
obj.lightType = LIGHT::RING2;
obj.light = int(obj.counter*1.5);
obj.blast(70000, true);
obj.determineCurAnim(ANIM::AMMO, 3);
obj.frameID = int((obj.counter%(11*4))/4);
}
}
void onDraw(jjOBJ@ obj) {
jjDrawRotatedSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, (obj.var[0] + (1023/4)),
(obj.state == STATE::EXPLODE) ? 3 : 1, (obj.state == STATE::EXPLODE) ? 3 : 1, SPRITE::NORMAL, 4);
obj.determineCurFrame();
}
}
void handlePacket(jjSTREAM packet, int clientID) {
uint8 type;
int8 playerID;
packet.pop(type);
packet.pop(playerID);
jjPLAYER@ play = jjPlayers[playerID];
if (type == uint8(exoskeleton)) {
jjAddObject(OBJECT::CANDY, play.xPos, play.yPos, play.playerID, CREATOR::PLAYER);
}
}
}
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.