Name | Author | Game Mode | Rating | |||||
---|---|---|---|---|---|---|---|---|
Holiday Hare '17 | ShadowGPW | Single player | 8.8 |
#include "HH17Enemies.asc"
#pragma require "SExmas.j2a"
#pragma require "HH17_XmasPalette.pal"
class MusicalAirboard : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
obj.state = STATE::FLOAT;
obj.behave(BEHAVIOR::PICKUP);
}
bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
jjMusicLoad("bonus3.j2b");
player.fly = FLIGHT::AIRBOARD;
obj.behavior = BEHAVIOR::EXPLOSION2;
jjSample(obj.xPos, obj.yPos, SOUND::COMMON_PICKUP1);
return true;
}
}
class Imitation : jjBEHAVIORINTERFACE {
private uint8 eventID;
private jjBEHAVIOR behavior;
Imitation(uint8 realEventID, uint8 fakeEventID) {
jjOBJ@ obj = jjObjectPresets[realEventID];
eventID = obj.eventID;
behavior = obj.behavior;
obj.eventID = fakeEventID;
obj.behavior = this;
}
void onBehave(jjOBJ@ obj) override {
if (obj.state == STATE::DEACTIVATE)
obj.eventID = eventID;
obj.behave(behavior);
}
}
class GiftBox : jjBEHAVIORINTERFACE {
void destroy(jjOBJ@ obj) {
jjSample(obj.xPos, obj.yPos, SOUND::COMMON_WOOD1);
{
int id = jjAddObject(OBJECT::EXPLOSION, obj.xPos, obj.yPos);
if (id != 0) {
jjOBJ@ other = jjObjects[id];
other.determineCurAnim(ANIM::PICKUPS, 4);
}
}
for (int i = jjRandom() & 7 | 8; i-- != 0;) {
int id = jjAddObject(OBJECT::SHARD, obj.xPos, obj.yPos);
if (id != 0) {
jjOBJ@ other = jjObjects[id];
other.determineCurAnim(ANIM::PICKUPS, 93 + (jjRandom() & 1));
}
}
obj.yPos -= 8.f;
for (int i = obj.var[1]; i-- != 0;) {
int id = jjAddObject(obj.var[0], obj.xPos, obj.yPos);
if (id != 0) {
jjOBJ@ other = jjObjects[id];
if (other.playerHandling == HANDLING::PICKUP) {
int angle = (jjRandom() & 255) + 128;
other.xSpeed = jjCos(angle) * 5.f;
other.ySpeed = jjSin(angle) * -3.f;
} else if (other.playerHandling == HANDLING::SPECIAL) {
other.deactivates = false;
}
}
}
obj.clearPlatform();
obj.delete();
}
void onBehave(jjOBJ@ obj) override {
switch (obj.state) {
case STATE::START:
{
uint16 x = int(obj.xOrg) >>> 5;
uint16 y = int(obj.yOrg) >>> 5;
obj.var[0] = jjParameterGet(x, y, 0, 8);
obj.var[1] = jjParameterGet(x, y, 8, 4);
obj.curAnim += jjParameterGet(x, y, 12, 2);
obj.determineCurFrame();
obj.bulletHandling = HANDLING::DESTROYBULLET;
obj.scriptedCollisions = true;
}
break;
case STATE::FALL:
obj.var[2] = 1;
break;
case STATE::FREEZE:
case STATE::SLEEP:
if (obj.var[2] != 0) {
destroy(obj);
return;
}
}
obj.behave(BEHAVIOR::MONITOR);
}
bool onObjectHit(jjOBJ@, jjOBJ@, jjPLAYER@, int) {
return true;
}
bool onIsSolid(jjOBJ@) {
return true;
}
}
void onFunction0(jjPLAYER@ player) {
jjMusicLoad("Christmas-X-Core_JJ2.it");
player.fly = FLIGHT::NONE;
}
void onLevelLoad() {
HH17::setEnemy(OBJECT::MONKEY);
HH17::setEnemy(OBJECT::DRAGON);
HH17::setEnemy(OBJECT::RAVEN);
HH17::setEnemy(OBJECT::DEMON);
HH17::setEnemy(OBJECT::DOGGYDOGG);
HH17::setEnemy(OBJECT::BAT);
HH17::setEnemy(OBJECT::FLOATSUCKER);
HH17::setEnemy(OBJECT::SUCKER);
HH17::setEnemy(OBJECT::CRAB);
jjObjectPresets[OBJECT::AIRBOARD].behavior = MusicalAirboard();
jjObjectPresets[OBJECT::AIRBOARD].scriptedCollisions = true;
Imitation(OBJECT::TACO, OBJECT::MILK);
uint src = jjAnimSets[ANIM::CUSTOM[255]].load(0, "SExmas.j2a");
uint dest = jjAnimSets[ANIM::PICKUPS];
for (int i = 0; i < 95; i++) {
const jjANIMATION@ anim = jjAnimations[src + i];
if (anim.frameCount != 0)
jjAnimations[dest + i] = anim;
}
jjAnimSets[ANIM::BRIDGE].load(1, "SExmas.j2a");
jjAnimSets[ANIM::CUSTOM[0]].load(2, "SExmas.j2a");
jjObjectPresets[OBJECT::BOMBCRATE].behavior = GiftBox();
jjObjectPresets[OBJECT::BOMBCRATE].determineCurAnim(ANIM::CUSTOM[0], 0);
jjAnimSets[ANIM::SPIKEBOLL].load(3, "SExmas.j2a");
jjAnimSets[ANIM::SPIKEBOLL3D].load(3, "SExmas.j2a");
jjAnimSets[ANIM::SPIKEPLAT].load(4, "SExmas.j2a");
jjObjectPresets[OBJECT::SPIKEBOLL].killAnim = jjObjectPresets[OBJECT::SPIKEBOLL].determineCurAnim(ANIM::SPIKEBOLL, 0) + 1;
jjObjectPresets[OBJECT::SPIKEBOLL3D].killAnim = jjObjectPresets[OBJECT::SPIKEBOLL3D].determineCurAnim(ANIM::SPIKEBOLL3D, 0) + 1;
jjObjectPresets[OBJECT::SPIKEPLATFORM].killAnim = jjObjectPresets[OBJECT::SPIKEPLATFORM].determineCurAnim(ANIM::SPIKEPLAT, 0) + 1;
jjPalette.load("HH17_XmasPalette.pal");
jjPalette.apply();
}
void onLevelReload() {
HH17::processEnemyColors(); //ensure that enemy colors are still displaying correctly when the level reloads after death
jjMusicLoad("Christmas-X-Core_JJ2.it");
onLevelLoad();
}
void onMain() {
HH17::handleEnemyProjectiles(); //this is required to handle the modifications to enemy bullets from the Monkeys and Dragons
}
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.