Advertisement
ijontichy

durrmap.c

Jul 22nd, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 7.87 KB | None | 0 0
  1. #include "zcommon.acs"
  2. // ~ #include "hangman.c"
  3.  
  4. int ejectStrs[5] = {
  5.     "\chBLUE TEAM\c- has been ejected",
  6.     "\cgRED TEAM\c- has been ejected",
  7.     "\cdGREEN TEAM\c- has been ejected",
  8.     "\cfGOLD TEAM\c- has been ejected",
  9.     "\cgEVERYONE\c- has been ejected! >:D"};
  10.  
  11. int ejected[5];
  12.  
  13. int winStrs[5] = {
  14.     "\chBLUE TEAM\c- wins!",
  15.     "\cgRED TEAM\c- wins!",
  16.     "\cdGREEN TEAM\c- wins!",
  17.     "\cfGOLD TEAM\c- wins!",
  18.     "Fuck it, go kill each other!"};
  19.  
  20. int spawnItem[12] = {"SuperShotgun", "Minigun", "RocketLauncher",
  21.                     "GrenadeLauncher", "Railgun", "CellPack", "RocketBox",
  22.                     "ShellBox", "ClipBox", "StrengthRune", "RageRune", "SpreadRune"};
  23.  
  24. int acsToExecute[5];
  25.  
  26. int tColors[4][3]  = { {64, 64, 255}, {255, 0, 0}, {0, 255, 0}, {255, 224, 0} };
  27. int tColors2[4][3] = { {160, 160, 255}, {255, 128, 128}, {128, 255, 128}, {255, 240, 128} };
  28.  
  29. function int sectorTeam(int team)
  30. {
  31.     switch (team)
  32.     {
  33.         case 0:
  34.             return 0;
  35.             break;
  36.  
  37.         case 1:
  38.             return 1;
  39.             break;
  40.  
  41.         case 2:
  42.             return 3;
  43.             break;
  44.  
  45.         case 3:
  46.             return 4;
  47.             break;
  48.     }
  49.  
  50.     return -1;
  51. }
  52.  
  53.  
  54. script 11 (int whichTeam)
  55. {
  56.     int adjusted;
  57.     int i;
  58.  
  59.     SetFont("BIGFONT");
  60.     HudMessageBold(s:ejectStrs[whichTeam]; HUDMSG_FADEOUT, 21, CR_WHITE, 1.5, 0.7, 5.0);
  61.  
  62.     if (whichTeam == 4)
  63.     {
  64.         for (i = 0; i < 5; i++)
  65.         {
  66.             if (ejected[i] == 1)
  67.             {
  68.                 continue;
  69.             }
  70.  
  71.             if (i != 2)
  72.             {
  73.                 Ceiling_RaiseByValue(5080+i, 32, 96);
  74.                 FloorAndCeiling_LowerRaise(5180+i, 32, 8);
  75.             }
  76.  
  77.             ejected[i] = 1;
  78.         }
  79.  
  80.         Delay(18);
  81.         for (i = 0; i < 5; i++)
  82.         {
  83.  
  84.             if (i != 2)
  85.             {
  86.                 Sector_SetGravity(5080+i, 0, 0);
  87.                 Sector_SetGravity(5180+i, 0, 0);
  88.                 Sector_SetGravity(5280+i, 0, 0);
  89.                 ACS_ExecuteAlways(122, 0, 5080+i, 1, 0);
  90.                 ACS_ExecuteAlways(122, 0, 5180+i, 1, 0);
  91.                 ACS_ExecuteAlways(122, 0, 5280+i, 1, 0);
  92.             }
  93.  
  94.             ACS_ExecuteAlways(383, 0, i, 184, 0);
  95.         }
  96.     }
  97.     else
  98.     {
  99.         adjusted = sectorTeam(whichTeam);
  100.  
  101.         if (ejected[whichTeam] == 0)
  102.         {
  103.             Ceiling_MoveToValue(5080+adjusted, 32, 96);
  104.             FloorAndCeiling_LowerRaise(5180+adjusted, 32, 8);
  105.         }
  106.  
  107.         ejected[whichTeam] = 1;
  108.  
  109.         Delay(18);
  110.  
  111.         Sector_SetGravity(5080+adjusted, 0, 0);
  112.         Sector_SetGravity(5180+adjusted, 0, 0);
  113.         Sector_SetGravity(5280+adjusted, 0, 0);
  114.         ACS_ExecuteAlways(122, 0, 5080+adjusted, 1, 0);
  115.         ACS_ExecuteAlways(122, 0, 5180+adjusted, 1, 0);
  116.         ACS_ExecuteAlways(122, 0, 5280+adjusted, 1, 0);
  117.  
  118.         ACS_ExecuteAlways(383, 0, whichTeam, 184, 0);
  119.     }
  120. }
  121.  
  122. script 12 (int whichTeam)
  123. {
  124.     int adjusted;
  125.     int i; int j;
  126.  
  127.     SetFont("BIGFONT");
  128.     HudMessageBold(s:winStrs[whichTeam]; HUDMSG_FADEOUT, 22, CR_WHITE, 1.5, 0.6, 5.0);
  129.  
  130.     for (i = 0; i < 6; i++)
  131.     {
  132.         for (j = 0; j < 5; j++)
  133.         {
  134.             if (i != 2)
  135.             {
  136.                 Ceiling_LowerAndCrush(5080+i, 32, 100);
  137.                 Floor_MoveToValue(5180+i, 32, 16);
  138.                 Ceiling_MoveToValue(5180+i, 32, 80);
  139.             }
  140.         }
  141.         Delay(5);
  142.     }
  143.  
  144.     Delay(105);
  145.  
  146.     Generic_Door(1337, 32, 1, 0, 0);
  147.  
  148.     for (i = 0; i < 5; i++)
  149.     {
  150.         ejected[i] = 0;
  151.  
  152.         if (i != 2)
  153.         {
  154.  
  155.             Sector_SetGravity(5080+i, 1, 0);
  156.             Sector_SetGravity(5180+i, 1, 0);
  157.             Sector_SetGravity(5280+i, 1, 0);
  158.             ACS_ExecuteAlways(122, 0, 5080+i, 0, 0);
  159.             ACS_ExecuteAlways(122, 0, 5180+i, 0, 0);
  160.             ACS_ExecuteAlways(122, 0, 5280+i, 0, 0);
  161.             Ceiling_MoveToValue(5080+i, 2, 0);
  162.         }
  163.  
  164.         if ( (i == whichTeam) && (whichTeam != 4) )
  165.         {
  166.             ACS_ExecuteAlways(383, 0, i, 185, 0);
  167.         }
  168.         else
  169.         {
  170.             ACS_ExecuteAlways(383, 0, i, 186, 0);
  171.         }
  172.  
  173.         if ( (i == whichTeam) || (whichTeam == 4) )
  174.         {
  175.             Door_Open(6080+sectorTeam(i), 64);
  176.         }
  177.     }
  178. }
  179.  
  180.  
  181. script 13 (int whichTeam)
  182. {
  183.     int adjusted = sectorTeam(whichTeam);
  184.  
  185.     if (LineSide() == LINE_BACK)
  186.     {
  187.         Door_Close(6080 + adjusted, 64);
  188.         Delay(18);
  189.  
  190.         if (whichTeam == PlayerTeam())
  191.         {
  192.             Door_Open(6180 + adjusted, 64);
  193.             Delay(35);
  194.             Door_Close(6180 + adjusted, 64);
  195.             Delay(18);
  196.             Door_Open(6080 + adjusted, 64);
  197.         }
  198.         else
  199.         {
  200.             Delay(17);
  201.             FadeTo(255, 0, 0, 0.8, 0.5);
  202.             Delay(18);
  203.             GiveInventory("NoGodMode", 1);
  204.             DamageThing(0);
  205.             Delay(17);
  206.             Door_Open(6080 + adjusted, 64);
  207.             FadeTo(255, 0, 0, 0.0, 0.5);
  208.         }
  209.     }
  210. }
  211.  
  212.  
  213.  
  214. script 51 OPEN
  215. {
  216.     int i; int j;
  217.  
  218.     ACS_ExecuteAlways(122, 0, 2, 1, 0);
  219.     Sector_SetGravity(2, 0, 0);
  220.     ACS_ExecuteAlways(122, 0, 22, 1, 0);
  221.     Sector_SetGravity(22, 0, 0);
  222.  
  223.     for (i = 0; i < 5; i++)
  224.     {
  225.         j = sectorTeam(i);
  226.  
  227.         Sector_SetColor(5580 + j, tColors[i][0], tColors[i][1], tColors[i][2], 0);
  228.         Sector_SetColor(5580 + j, tColors[i][0], tColors[i][1], tColors[i][2], 0);
  229.  
  230.         Sector_SetGravity(5080+j, 1, 0);
  231.         Sector_SetGravity(5180+j, 1, 0);
  232.         Sector_SetGravity(5280+j, 1, 0);
  233.         ACS_ExecuteAlways(122, 0, 5080+j, 0, 0);
  234.         ACS_ExecuteAlways(122, 0, 5180+j, 0, 0);
  235.         ACS_ExecuteAlways(122, 0, 5280+j, 0, 0);
  236.     }
  237.  
  238.     for (i = 0; i < 5; i++)
  239.     {
  240.         j = sectorTeam(i);
  241.  
  242.         Sector_SetColor(5680 + j, tColors2[i][0], tColors2[i][1], tColors2[i][2], 0);
  243.         Sector_SetColor(5680 + j, tColors2[i][0], tColors2[i][1], tColors2[i][2], 0);
  244.     }
  245. }
  246.  
  247. script 52 ENTER
  248. {
  249.     int i; int j;
  250.  
  251.     for (i = 1; i < 13; i++)
  252.     {
  253.         for (j = 0; j < 4; j++)
  254.         {
  255.             SpawnSpot(spawnItem[i-1], 4000+i, 0, 0);
  256.         }
  257.     }
  258. }
  259.  
  260.  
  261. script 53 ENTER
  262. {
  263.     int myTeam;
  264.     int lastScript;
  265.  
  266.     int pln = PlayerNumber();
  267.  
  268.  
  269.     ClearInventory();
  270.     GiveInventory("Fist", 1);
  271.     GiveInventory("NoPull", 1);
  272.     GiveInventory("YesGodMode", 1);
  273.     SetActorProperty(0, APROP_Health, 100);
  274.  
  275.     while (PlayerInGame(pln) )
  276.     {
  277.         myTeam = PlayerTeam();
  278.  
  279.         if (acsToExecute[myTeam] != lastScript)
  280.         {
  281.             if (acsToExecute[myTeam] % 1000 != 0)
  282.             {
  283.                 ACS_ExecuteAlways(acsToExecute[myTeam] % 1000, 0, myTeam, 0, 0);
  284.             }
  285.             lastScript = acsToExecute[myTeam];
  286.         }
  287.         Delay(1);
  288.     }
  289. }
  290.  
  291. script 54 RESPAWN
  292. {
  293.     ClearInventory();
  294.     GiveInventory("Fist", 1);
  295.     GiveInventory("NoPull", 1);
  296. }
  297.  
  298.  
  299. script 383 (int whichTeam, int whichScript)
  300. {
  301.     acsToExecute[whichTeam] = whichScript;
  302.     Delay(1);
  303.     acsToExecute[whichTeam] = 0;
  304. }
  305.  
  306.  
  307. script 184 (int yourTeam)
  308. {
  309.     LocalSetMusic("D_RINGIN");
  310.  
  311.     GiveInventory("YesPull", 1);
  312.     GiveInventory("NoGodMode", 1);
  313.  
  314.     Delay(35);
  315.  
  316.     GiveInventory("NoPull", 1);
  317.  
  318.     Delay(235);
  319.  
  320.     int i;
  321.  
  322.     for (i = 1; i < 400; i += 1)
  323.     {
  324.         DamageThing(i, MOD_ICE);
  325.  
  326.         if (GetActorProperty(0, APROP_Health) < 1)
  327.         {
  328.             LocalSetMusic("D_SILENT");
  329.             break;
  330.         }
  331.  
  332.         if (!ejected[yourTeam] && !CheckActorFloorTexture(0, "F_SKY1"))
  333.         {
  334.             LocalSetMusic("*");
  335.             break;
  336.         }
  337.  
  338.         Delay(35);
  339.     }
  340. }
  341.  
  342. script 185 (int yourTeam)
  343. {
  344.     GiveInventory("NoPull", 1);
  345.     GiveInventory("YesGodMode", 1);
  346. }
  347.  
  348. script 186 (int yourTeam)
  349. {
  350.     GiveInventory("NoPull", 1);
  351.     GiveInventory("NoGodMode", 1);
  352. }
  353.  
  354.  
  355. script 122 (int whichSector, int flag)
  356. {
  357.     ACS_ExecuteAlways(123, 0, whichSector, flag);
  358.     Sector_ChangeFlags(whichSector, SECF_SILENT * (flag != 0), SECF_SILENT * (flag == 0) );
  359. }
  360.  
  361.  
  362. script 123 (int whichSector, int flag) clientside
  363. {
  364.     Sector_ChangeFlags(whichSector, SECF_SILENT * (flag != 0), SECF_SILENT * (flag == 0) );
  365. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement