Advertisement
JimmyZD

Untitled

Sep 17th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.78 KB | None | 0 0
  1. str FountainAreaNames[4] = { "\cjnorth-west", "\cjnorth-east", "\cjsouth-west", "\cjsouth-east" };
  2. int FountainsOrder[4] = { 1, 1, 1, 1 };
  3.  
  4.  
  5. script "S_FountainOrder" ( void )
  6. {
  7.     // reset the order to begin with (everything at 1 (blue))
  8.     for(int i=0; i<4; i++) {
  9.         FountainsOrder[i] = 1;
  10.     }
  11.  
  12.     // set a random index to 2 (red)
  13.     int f1 = random(0,3);
  14.     FountainsOrder[f1] = 2;
  15.  
  16.     // choose another random index that's not the first
  17.     int f2 = random(0,3);
  18.     until(f2!=f1) {
  19.         f2 = random(0,3);
  20.     }
  21.  
  22.     FountainsOrder[f2] = 2;
  23.  
  24.     // change the grid symbols to the right flats
  25.     for(int k=0; k<4; k++) {
  26.         str c = "B";
  27.         if(FountainsOrder[k]==2) { c = "R"; }
  28.  
  29.         str s = StrParam(s:"TOMB", d:k+1, s:c, d:1);
  30.         ChangeFloor(80+k, s);
  31.     }
  32.  
  33.     // debug
  34.     //Print(d:FountainsOrder[0], s:" ",
  35.             //d:FountainsOrder[1], s:" ",
  36.             //d:FountainsOrder[2], s:" ",
  37.             //d:FountainsOrder[3]);
  38.  
  39.     str firstblue, secondblue, firstred, secondred;
  40.     // this doesn't work, replace
  41.     if(FountainsOrder[0]==1) { firstblue = FountainAreaNames[0]; } else { firstred = FountainAreaNames[0]; }
  42.     if(FountainsOrder[1]==1) { firstblue = FountainAreaNames[1]; } else { firstred = FountainAreaNames[1]; }
  43.     if(FountainsOrder[2]==1) { secondblue = FountainAreaNames[2]; } else { secondred = FountainAreaNames[2]; }
  44.     if(FountainsOrder[3]==1) { secondblue = FountainAreaNames[3]; } else { secondred = FountainAreaNames[3]; }
  45.  
  46.     AmbientSound("misc/chat", 127);
  47.     Print(s:"\chLet water flow at...\n\n", s:firstblue, s:"\n\n", s:secondblue);
  48.     delay(120);
  49.  
  50.     AmbientSound("misc/chat", 127);
  51.     Print(s:"\cgLet blood flow at...\n\n", s:firstred, s:"\n\n", s:secondred);
  52.     delay(120);
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement