2.0
09 Apr 2015 18:35
int blasterOption = 0;
enum blasterOptionEnum {simple, advanced};
const int Q = 0x51;
const int E = 0x45;
bool qKeyHeld;
bool eKeyHeld;
void onLevelLoad() {
jjWeapons[WEAPON::BLASTER].infinite = false;
jjWeapons[WEAPON::BLASTER].maximum = 50;
blasterOption = advanced;
}
bool wasPoweredUp = false;
void onPlayer(jjPLAYER@ p) {
if (p.ammo[WEAPON::BLASTER] < jjWeapons[WEAPON::BLASTER].maximum) {
if (jjGameTicks % 140 == 0) p.ammo[WEAPON::BLASTER] = p.ammo[WEAPON::BLASTER] + 1;
}
if (p.ammo[WEAPON::BLASTER] == 1 && p.powerup[WEAPON::BLASTER]) wasPoweredUp = true;
if (wasPoweredUp) p.powerup[WEAPON::BLASTER] = true;
if (qKeyHeld) blasterOption = advanced;
if (eKeyHeld) blasterOption = simple;
qKeyHeld = jjKey[Q];
eKeyHeld = jjKey[E];
}
int hudWidth = jjSubscreenWidth-20;
bool onDrawAmmo(jjPLAYER@ p, jjCANVAS@ canvas) {
if (p.currWeapon == WEAPON::BLASTER && blasterOption == advanced) {
if (!p.powerup[WEAPON::BLASTER]) {
if (p.charCurr == CHAR::SPAZ || p.charCurr == CHAR::JAZZ)
canvas.drawSprite(jjSubscreenWidth-20, jjSubscreenHeight-25, ANIM::AMMO, p.charCurr == CHAR::SPAZ ? 19 : 18, 0, 0, SPRITE::NORMAL, 0);
if (jjIsTSF) {
if (p.charCurr == CHAR::LORI)
canvas.drawSprite(jjSubscreenWidth-20, jjSubscreenHeight-25, ANIM::PLUS_AMMO, 5, 0, 0, SPRITE::NORMAL, 0);
}
} else {
if (p.charCurr == CHAR::SPAZ || p.charCurr == CHAR::JAZZ)
canvas.drawSprite(jjSubscreenWidth-20, jjSubscreenHeight-25, ANIM::AMMO, p.charCurr == CHAR::SPAZ ? 19 : 18, 3, 0, SPRITE::NORMAL, 0);
if (jjIsTSF) {
if (p.charCurr == CHAR::LORI)
canvas.drawSprite(jjSubscreenWidth-20, jjSubscreenHeight-25, ANIM::PLUS_AMMO, 6, 2, 0, SPRITE::NORMAL, 0);
}
}
for (int i = 0; i < (p.ammo[WEAPON::BLASTER] / 2); i++) {
canvas.drawString((hudWidth - (i * 10)), jjSubscreenHeight-5, "/", STRING::SMALL, STRING::NORMAL);
}
return true;
} else return false;
}
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.