Downloads containing xlmexpressJB.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: Electric ExpressFeatured Download PurpleJazz Multiple 9.3 Download file

File preview

  1. // Electric Express
  2. // Created by PurpleJazz of XLM (2010-2015)
  3.  
  4. /*******************************************************************/
  5.  
  6. uint elapsed = 0;
  7. array<bool> electrocution(4, false);
  8.  
  9. void onLevelLoad() {
  10.         jjTexturedBGTexture = TEXTURE::MEDIVO;
  11.  
  12.         jjObjectPresets[OBJECT::PLASMASHIELDBULLET].counterEnd = 0; //only the particle effect required
  13.         jjObjectPresets[OBJECT::PLASMASHIELDBULLET].playerHandling = HANDLING::PARTICLE;
  14.        
  15.         jjWeapons[WEAPON::ICE].comesFromGunCrates =
  16.         jjWeapons[WEAPON::SEEKER].comesFromGunCrates = false;
  17.  
  18.         jjWeapons[WEAPON::GUN8].comesFromGunCrates =
  19.         jjWeapons[WEAPON::GUN9].comesFromGunCrates = true;
  20.        
  21.         jjUseLayer8Speeds = true;
  22. }
  23.  
  24. const array<string> DeathMessages = {
  25.         " got electrocuted",
  26.         " completed the circuit",
  27.         " was fried",
  28.         " received 10,000 volts",
  29.         " met the thunder god",
  30.         " came to a shocking conclusion",
  31.         " became welded to the overhead wire"
  32. };
  33.  
  34. void onReceive(jjSTREAM &in packet, int clientID) {
  35.         if (jjIsServer) {
  36.                 int a;
  37.                 packet.pop(a);
  38.                 jjPlayers[a].yPos > 14*32?
  39.                         jjAlert("" + jjPlayers[a].name + " fell off the train", true) :
  40.                         jjAlert("" + jjPlayers[a].name + DeathMessages[jjRandom()%7], true);                                   
  41.         }
  42. }
  43.  
  44. void onPlayer(jjPLAYER@ play) {
  45.         if (jjEventGet(int(play.xPos/32), int((play.yPos/32)+0.5)) == AREA::REVERTMORPH && play.health > 0) {
  46.                 electrocution[play.localPlayerID] = true;
  47.         }
  48.         if (electrocution[play.localPlayerID]) {
  49.                 elapsed++;
  50.  
  51.                 play.xSpeed = -8; // the train is moving afterall
  52.                 play.ySpeed = 0;
  53.  
  54.                 if (play.yPos > 14*32) { // hold still, damn it
  55.                         play.yPos = (51*32)-24;
  56.                 } else {
  57.                         play.yPos = (13*32)-24;
  58.                 }
  59.        
  60.                 if (elapsed % 7 == 0) {
  61.                         play.hurt(0, true);
  62.                         jjAddObject(OBJECT::PLASMASHIELDBULLET, play.xPos, play.yPos, 0, CREATOR::OBJECT, BEHAVIOR::DEFAULT); //shocking!
  63.                 }
  64.  
  65.                 if (elapsed >= 140) {
  66.                         elapsed = 0;
  67.                         electrocution[play.localPlayerID] = false;
  68.                         play.kill(); // Die;
  69.                         if (jjIsServer) {
  70.                                 play.yPos > 14*32?
  71.                                         jjAlert("" + play.name + " fell off the train", true) :
  72.                                         jjAlert("" + play.name + DeathMessages[jjRandom()%7], true);   
  73.                         }
  74.                         else {
  75.                                 jjSTREAM packet;
  76.                                 packet.push(play.clientID);
  77.                                 jjSendPacket(packet, 0);
  78.                         }
  79.                 }
  80.         }
  81.  
  82.         for (int i = 1; i < jjObjectCount; i++) {
  83.                 if ((jjObjects[i].eventID == OBJECT::GOLDCOIN || jjObjects[i].eventID == OBJECT::SILVERCOIN) && jjObjects[i].state == STATE::FLOATFALL) {
  84.                         jjObjects[i].state = STATE::FLOAT; // can’t shoot the coins down
  85.                 }
  86.                 if (jjObjects[i].eventID == OBJECT::BOUNCERPOWERUP) {
  87.                         jjObjects[i].yPos = 49.8*32;
  88.                         jjObjects[i].ySpeed = 0;
  89.                 }
  90.         }
  91.  
  92.         jjTriggers[1] = play.yPos > 49*32? true : false;
  93. }
  94.  
  95. void onFunction0(jjPLAYER@ play) {
  96.         play.showText("@@@@Electric Express@Created by PurpleJazz of XLM (2010-2015)@Tileset conversion by NOKA, P4ul and cooba@np: CoreTex - Home [6:10]");
  97. }