Downloads containing xlmexpress.j2as

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