EDIT: Please post your feedback on this concept. The more the merrier.
EDIT2: Fixed the whole dying and health and shielding still being at 100...
EDIT3: Implemented SFX for shielding system, giving warnings for low shields, shielding down, and shielding recharging!
EDIT4: Got the SFX to work in multiplayer, and re-did the display routine.
EDIT5: After much strugle with ACS's fixed numbers system... I finally got the graphical shielding bar to work they way i wanted it to! Hurray!
EDIT6: Got the graphical shield bar to work in multiplayer.... Now all i have to do is get it to work for 8 players instead of 2
EDIT7: Oh jeez, I forgot to implement the overshield. Gimmie a little bit for that.
EDIT8: Okay, crude overshield display is implemented. Special thanks to solarsnowfall for the help with the new Shielding bar and related GFX. webspace is updated so download and check out the new version! Note: Right now, since i havent implemented a new drawing routine, it will only work in 800 x 600 resolution... Sorry!
EDIT9: Yay! Got the overshielding to display properly.. Last thing on the todo list is to get this working on all resolutions. Wish me luck
EDIT10: Wow, after all this work, it's finally done and is 100% functional for player 1. All that's left is multiplayer compadibility... Which is easy as pie since i set it all up with arrays! So all it's gonna take a is a quick copy - paste 6 times and fix it all up. Thanks to everyone for their support!
EDIT11: Just added a poll, out of curiousity sake, to see how many people want the source code to this project for their own use.
EDIT12: This project is complete. Thanks to solarsnowfall for the shieldbar gfx and to everyone else for their interest with this project.
And as promised, here's the source code:
Spoiler:that's 1768 lines of code right there.... It's a lot.Code: Select all
#include "zcommon.acs" int a[8]; int b[8]; int e[8]; int schk[8]; int soldhp[8]; int oldhp[8]; int sdmg[8]; int shielddamaged[8]; int shieldhp[8]; int shielddmg[8]; int Atmprechrg[8]; int oshield[8]; Script 1 ENTER { Thing_ChangeTID (0, 1337+Playernumber()); if (playernumber() == 0) { shieldhp[1] = 100; soldhp[1] = GetActorProperty(1337, APROP_Health); acs_execute(101,0,0,0,0); acs_execute(90,0,0,0,0); acs_execute(80,0,0,0,0); } if (playernumber() == 1) { shieldhp[2] = 100; soldhp[2] = GetActorProperty(1338, APROP_Health); acs_execute(104,0,0,0,0); acs_execute(91,0,0,0,0); acs_execute(81,0,0,0,0); } if (playernumber() == 2) { shieldhp[3] = 100; soldhp[3] = GetActorProperty(1339, APROP_Health); acs_execute(107,0,0,0,0); acs_execute(92,0,0,0,0); acs_execute(82,0,0,0,0); } if (playernumber() == 3) { shieldhp[4] = 100; soldhp[4] = GetActorProperty(1340, APROP_Health); acs_execute(110,0,0,0,0); acs_execute(93,0,0,0,0); acs_execute(83,0,0,0,0); } if (playernumber() == 4) { shieldhp[5] = 100; soldhp[5] = GetActorProperty(1341, APROP_Health); acs_execute(113,0,0,0,0); acs_execute(94,0,0,0,0); acs_execute(84,0,0,0,0); } if (playernumber() == 5) { shieldhp[6] = 100; soldhp[6] = GetActorProperty(1342, APROP_Health); acs_execute(116,0,0,0,0); acs_execute(95,0,0,0,0); acs_execute(85,0,0,0,0); } if (playernumber() == 6) { shieldhp[7] = 100; soldhp[7] = GetActorProperty(1343, APROP_Health); acs_execute(119,0,0,0,0); acs_execute(96,0,0,0,0); acs_execute(86,0,0,0,0); } if (playernumber() == 7) { shieldhp[8] = 100; soldhp[8] = GetActorProperty(1344, APROP_Health); acs_execute(122,0,0,0,0); acs_execute(97,0,0,0,0); acs_execute(87,0,0,0,0); } } Script 2 (void) { Damagething(20); } Script 3 RESPAWN { if (playernumber() == 7 ) { Thing_ChangeTID (0, 1337+Playernumber()); acs_terminate(121,0); acs_terminate(122,0); acs_terminate(123,0); acs_terminate(87,0); delay(5); shieldhp[8] = 100; oldhp[8] = GetActorProperty(1344, APROP_Health); acs_execute(122,0,0,0,0); acs_execute(97,0,0,0,0); acs_execute(87,0,0,0,0); } if (playernumber() == 6 ) { Thing_ChangeTID (0, 1337+Playernumber()); acs_terminate(118,0); acs_terminate(119,0); acs_terminate(120,0); acs_terminate(86,0); delay(5); shieldhp[7] = 100; oldhp[7] = GetActorProperty(1343, APROP_Health); acs_execute(119,0,0,0,0); acs_execute(96,0,0,0,0); acs_execute(86,0,0,0,0); } if (playernumber() == 5 ) { Thing_ChangeTID (0, 1337+Playernumber()); acs_terminate(115,0); acs_terminate(116,0); acs_terminate(117,0); acs_terminate(85,0); delay(5); shieldhp[6] = 100; oldhp[6] = GetActorProperty(1342, APROP_Health); acs_execute(116,0,0,0,0); acs_execute(95,0,0,0,0); acs_execute(85,0,0,0,0); } if (playernumber() == 4 ) { Thing_ChangeTID (0, 1337+Playernumber()); acs_terminate(112,0); acs_terminate(113,0); acs_terminate(114,0); acs_terminate(84,0); delay(5); shieldhp[5] = 100; oldhp[5] = GetActorProperty(1341, APROP_Health); acs_execute(113,0,0,0,0); acs_execute(94,0,0,0,0); acs_execute(84,0,0,0,0); } if (playernumber() == 3 ) { Thing_ChangeTID (0, 1337+Playernumber()); acs_terminate(109,0); acs_terminate(110,0); acs_terminate(111,0); acs_terminate(83,0); delay(5); shieldhp[4] = 100; oldhp[4] = GetActorProperty(1340, APROP_Health); acs_execute(110,0,0,0,0); acs_execute(93,0,0,0,0); acs_execute(83,0,0,0,0); } if (playernumber() == 2 ) { Thing_ChangeTID (0, 1337+Playernumber()); acs_terminate(106,0); acs_terminate(107,0); acs_terminate(108,0); acs_terminate(82,0); delay(5); shieldhp[3] = 100; oldhp[3] = GetActorProperty(1339, APROP_Health); acs_execute(107,0,0,0,0); acs_execute(92,0,0,0,0); acs_execute(82,0,0,0,0); } if (playernumber() == 1 ) { Thing_ChangeTID (0, 1337+Playernumber()); acs_terminate(103,0); acs_terminate(104,0); acs_terminate(105,0); acs_terminate(81,0); delay(5); shieldhp[2] = 100; oldhp[2] = GetActorProperty(1338, APROP_Health); acs_execute(104,0,0,0,0); acs_execute(91,0,0,0,0); acs_execute(81,0,0,0,0); } if (playernumber() == 0) { Thing_ChangeTID (0, 1337+Playernumber()); acs_terminate(100,0); acs_terminate(101,0); acs_terminate(102,0); acs_terminate(80,0); delay(5); shieldhp[1] = 100; oldhp[1] = GetActorProperty(1337, APROP_Health); acs_execute(101,0,0,0,0); acs_execute(90,0,0,0,0); acs_execute(80,0,0,0,0); } } Script 80 (void) { if (shieldhp[1] <= 30 && shieldhp[1] != 0 && Atmprechrg[1] != 1) { LocalAmbientSound("shieldlow", 127); delay(2); } if (shieldhp[1] == 0) { LocalAmbientSound("shielddead", 127); delay(2); } delay(3); restart; } script 81(void) { if (shieldhp[2] <= 30 && shieldhp[2] != 0 && Atmprechrg[2] != 1) { LocalAmbientSound("shieldlow", 127); delay(2); } if (shieldhp[2] == 0) { LocalAmbientSound("shielddead", 127); delay(2); } delay(3); restart; } script 82(void) { if (shieldhp[3] <= 30 && shieldhp[3] != 0 && Atmprechrg[3] != 1) { LocalAmbientSound("shieldlow", 127); delay(2); } if (shieldhp[3] == 0) { LocalAmbientSound("shielddead", 127); delay(2); } delay(3); restart; } script 83(void) { if (shieldhp[4] <= 30 && shieldhp[4] != 0 && Atmprechrg[4] != 1) { LocalAmbientSound("shieldlow", 127); delay(2); } if (shieldhp[4] == 0) { LocalAmbientSound("shielddead", 127); delay(2); } delay(3); restart; } script 84(void) { if (shieldhp[5] <= 30 && shieldhp[5] != 0 && Atmprechrg[5] != 1) { LocalAmbientSound("shieldlow", 127); delay(2); } if (shieldhp[5] == 0) { LocalAmbientSound("shielddead", 127); delay(2); } delay(3); restart; } script 85(void) { if (shieldhp[6] <= 30 && shieldhp[6] != 0 && Atmprechrg[6] != 1) { LocalAmbientSound("shieldlow", 127); delay(2); } if (shieldhp[6] == 0) { LocalAmbientSound("shielddead", 127); delay(2); } delay(3); restart; } script 86(void) { if (shieldhp[7] <= 30 && shieldhp[7] != 0 && Atmprechrg[7] != 1) { LocalAmbientSound("shieldlow", 127); delay(2); } if (shieldhp[7] == 0) { LocalAmbientSound("shielddead", 127); delay(2); } delay(3); restart; } script 87(void) { if (shieldhp[8] <= 30 && shieldhp[8] != 0 && Atmprechrg[8] != 1) { LocalAmbientSound("shieldlow", 127); delay(2); } if (shieldhp[8] == 0) { LocalAmbientSound("shielddead", 127); delay(2); } delay(3); restart; } Script 90 (void) { sethudsize(800,600,0); int acounter; int bcounter; int ccounter; ccounter = shieldhp[1]; if (shieldhp[1] > 100) ccounter = 100; for (acounter = 0; acounter < ccounter; acounter++) { bcounter = bcounter + 1.0; setfont ("SHIELDFI"); if (shieldhp[1] - acounter > 100) setfont ("REDBAR"); if (shieldhp[1] - acounter > 200) setfont ("GREENBAR"); hudmessage(s:"a"; 1, acounter, CR_GREEN, 37.1 + bcounter, 520.0, 1); } bcounter = 0; setfont ("REGULAR"); if (shieldhp[1] > 100) setfont ("OSHIELDB"); if (shieldhp[1] > 200) setfont ("OSHIELDA"); if (shieldhp[1] == 0) setfont ("SHIELDED"); hudmessage(s:"a"; 1, 101, CR_GREEN, 0.1, 520.0, 1); } Script 91 (void) { sethudsize(800,600,0); int acounter; int bcounter; int ccounter; ccounter = shieldhp[2]; if (shieldhp[2] > 100) ccounter = 100; for (acounter = 0; acounter < ccounter; acounter++) { bcounter = bcounter + 1.0; setfont ("SHIELDFI"); if (shieldhp[2] - acounter > 100) setfont ("REDBAR"); if (shieldhp[2] - acounter > 200) setfont ("GREENBAR"); hudmessage(s:"a"; 1, acounter, CR_GREEN, 37.1 + bcounter, 520.0, 1); } bcounter = 0; setfont ("REGULAR"); if (shieldhp[2] > 100) setfont ("OSHIELDB"); if (shieldhp[2] > 200) setfont ("OSHIELDA"); if (shieldhp[2] == 0) setfont ("SHIELDED"); hudmessage(s:"a"; 1, 102, CR_GREEN, 0.1, 520.0, 1); } Script 92 (void) { sethudsize(800,600,0); int acounter; int bcounter; int ccounter; ccounter = shieldhp[3]; if (shieldhp[3] > 100) ccounter = 100; for (acounter = 0; acounter < ccounter; acounter++) { bcounter = bcounter + 1.0; setfont ("SHIELDFI"); if (shieldhp[3] - acounter > 100) setfont ("REDBAR"); if (shieldhp[3] - acounter > 200) setfont ("GREENBAR"); hudmessage(s:"a"; 1, acounter, CR_GREEN, 37.1 + bcounter, 520.0, 1); } bcounter = 0; setfont ("REGULAR"); if (shieldhp[3] > 100) setfont ("OSHIELDB"); if (shieldhp[3] > 200) setfont ("OSHIELDA"); if (shieldhp[3] == 0) setfont ("SHIELDED"); hudmessage(s:"a"; 1, 101, CR_GREEN, 0.1, 520.0, 1); } Script 93 (void) { sethudsize(800,600,0); int acounter; int bcounter; int ccounter; ccounter = shieldhp[4]; if (shieldhp[4] > 100) ccounter = 100; for (acounter = 0; acounter < ccounter; acounter++) { bcounter = bcounter + 1.0; setfont ("SHIELDFI"); if (shieldhp[4] - acounter > 100) setfont ("REDBAR"); if (shieldhp[4] - acounter > 200) setfont ("GREENBAR"); hudmessage(s:"a"; 1, acounter, CR_GREEN, 37.1 + bcounter, 520.0, 1); } bcounter = 0; setfont ("REGULAR"); if (shieldhp[4] > 100) setfont ("OSHIELDB"); if (shieldhp[4] > 200) setfont ("OSHIELDA"); if (shieldhp[4] == 0) setfont ("SHIELDED"); hudmessage(s:"a"; 1, 101, CR_GREEN, 0.1, 520.0, 1); } Script 94 (void) { sethudsize(800,600,0); int acounter; int bcounter; int ccounter; ccounter = shieldhp[5]; if (shieldhp[5] > 100) ccounter = 100; for (acounter = 0; acounter < ccounter; acounter++) { bcounter = bcounter + 1.0; setfont ("SHIELDFI"); if (shieldhp[5] - acounter > 100) setfont ("REDBAR"); if (shieldhp[5] - acounter > 200) setfont ("GREENBAR"); hudmessage(s:"a"; 1, acounter, CR_GREEN, 37.1 + bcounter, 520.0, 1); } bcounter = 0; setfont ("REGULAR"); if (shieldhp[5] > 100) setfont ("OSHIELDB"); if (shieldhp[5] > 200) setfont ("OSHIELDA"); if (shieldhp[5] == 0) setfont ("SHIELDED"); hudmessage(s:"a"; 1, 101, CR_GREEN, 0.1, 520.0, 1); } Script 95 (void) { sethudsize(800,600,0); int acounter; int bcounter; int ccounter; ccounter = shieldhp[6]; if (shieldhp[6] > 100) ccounter = 100; for (acounter = 0; acounter < ccounter; acounter++) { bcounter = bcounter + 1.0; setfont ("SHIELDFI"); if (shieldhp[6] - acounter > 100) setfont ("REDBAR"); if (shieldhp[6] - acounter > 200) setfont ("GREENBAR"); hudmessage(s:"a"; 1, acounter, CR_GREEN, 37.1 + bcounter, 520.0, 1); } bcounter = 0; setfont ("REGULAR"); if (shieldhp[6] > 100) setfont ("OSHIELDB"); if (shieldhp[6] > 200) setfont ("OSHIELDA"); if (shieldhp[6] == 0) setfont ("SHIELDED"); hudmessage(s:"a"; 1, 101, CR_GREEN, 0.1, 520.0, 1); } Script 96 (void) { sethudsize(800,600,0); int acounter; int bcounter; int ccounter; ccounter = shieldhp[7]; if (shieldhp[7] > 100) ccounter = 100; for (acounter = 0; acounter < ccounter; acounter++) { bcounter = bcounter + 1.0; setfont ("SHIELDFI"); if (shieldhp[7] - acounter > 100) setfont ("REDBAR"); if (shieldhp[7] - acounter > 200) setfont ("GREENBAR"); hudmessage(s:"a"; 1, acounter, CR_GREEN, 37.1 + bcounter, 520.0, 1); } bcounter = 0; setfont ("REGULAR"); if (shieldhp[7] > 100) setfont ("OSHIELDB"); if (shieldhp[7] > 200) setfont ("OSHIELDA"); if (shieldhp[7] == 0) setfont ("SHIELDED"); hudmessage(s:"a"; 1, 101, CR_GREEN, 0.1, 520.0, 1); } Script 97 (void) { sethudsize(800,600,0); int acounter; int bcounter; int ccounter; ccounter = shieldhp[8]; if (shieldhp[8] > 100) ccounter = 100; for (acounter = 0; acounter < ccounter; acounter++) { bcounter = bcounter + 1.0; setfont ("SHIELDFI"); if (shieldhp[8] - acounter > 100) setfont ("REDBAR"); if (shieldhp[8] - acounter > 200) setfont ("GREENBAR"); hudmessage(s:"a"; 1, acounter, CR_GREEN, 37.1 + bcounter, 520.0, 1); } bcounter = 0; setfont ("REGULAR"); if (shieldhp[8] > 100) setfont ("OSHIELDB"); if (shieldhp[8] > 200) setfont ("OSHIELDA"); if (shieldhp[8] == 0) setfont ("SHIELDED"); hudmessage(s:"a"; 1, 101, CR_GREEN, 0.1, 520.0, 1); } Script 100 (void) { schk[1] = GetActorProperty(1337, APROP_Health); LocalAmbientSound("shieldregen", 127); for (a[1] = 1; a[1] < 101; a[1]++) { if(shielddamaged[1] == 1) { shielddamaged[1] = 0; Atmprechrg[1] = 1; delay(70); acs_execute(102,0,0,0,0); acs_terminate(100,0); } delay(2); shieldhp[1]++; schk[1]++; if (shieldhp[1] >= 100) break; } Atmprechrg[1] = 0; } Script 101 (void) { shielddmg[1] = soldhp[1] - GetActorProperty(1337, APROP_Health); if (getactorproperty(1337, APROP_Health) <= 0) { shieldhp[1] = 0; acs_terminate(80,0); acs_terminate(101,0); } if (GetActorProperty(1337, APROP_Health) < soldhp[1]) { if (Getactorproperty(1337, APROP_Health) == 0) { shieldhp[1] = 0; acs_terminate(101,0); } if ( shieldhp[1] - shielddmg[1] > -1 && shieldhp[1] - shielddmg[1] < 101) { shieldhp[1] = shieldhp[1] - shielddmg[1]; Setactorproperty(1337, APROP_Health, GetActorproperty(1337, APROP_Health) + shielddmg[1]); acs_execute(102,0,0,0,0); shielddamaged[1] = 1; Atmprechrg[1] = 1; } if ( shieldhp[1] - shielddmg[1] < 0 && shieldhp[1] > 0 && shielddamaged[1] == 0) { b[1] = shielddmg[1] - shieldhp[1]; Setactorproperty(1337, APROP_Health, GetActorproperty(1337, APROP_Health) + (shielddmg[1] - b[1])); shieldhp[1] = 0; acs_execute(102,0,0,0,0); shielddamaged[1] = 1; Atmprechrg[1] = 1; } shielddamaged[1] = 1; soldhp[1] = GetActorProperty(1337, APROP_Health); acs_execute(102,0,0,0,0); if (shieldhp[1] - shielddmg[1] > 100) { shieldhp[1] = shieldhp[1] - shielddmg[1]; Setactorproperty(1337, APROP_Health, GetActorproperty(1337, APROP_Health) + shielddmg[1]); acs_terminate(102,0); } if (shieldhp[1] != 0) LocalAmbientSound("shieldhit", 127); } if (GetActorProperty(1337, APROP_Health) > 100) { oshield[1] = GetActorProperty(1337, APROP_Health) - 100; oshield[1] = (oshield[1] * 2); shieldhp[1] = oshield[1] + shieldhp[1]; SetActorProperty(1337, APROP_Health, 100); if (shieldhp[1] > 100) { acs_terminate(102,0); acs_terminate(100,0); Atmprechrg[1] = 0; } } if (shieldhp[1] > 300) { shieldhp[1] = 300; } soldhp[1] = GetActorProperty(1337, APROP_Health); acs_execute(90,0,0,0,0); delay(2); restart; } Script 102 (void) { for(e[1] = 1; e[1] < 16; e[1]++) { delay(10); Atmprechrg[1] = 0; if (shielddamaged[1] == 1) { shielddamaged[1] = 0; e[1] = 0; //LocalAmbientSound("shieldhit", 127); } /*if (Atmprechrg[1] == 0) { acs_terminate(102,0); }*/ } Atmprechrg[1] = 1; delay(35); acs_execute(100,0,0,0,0); } Script 103 (void) { schk[2] = GetActorProperty(1338, APROP_Health); LocalAmbientSound("shieldregen", 127); for (a[2] = 1; a[2] < 101; a[2]++) { if(shielddamaged[2] == 1) { shielddamaged[2] = 0; Atmprechrg[2] = 1; delay(70); acs_execute(105,0,0,0,0); acs_terminate(103,0); } delay(2); shieldhp[2]++; schk[2]++; if (shieldhp[2] >= 100) break; } Atmprechrg[2] = 0; } Script 104 (void) { setfont ("BigFont"); shielddmg[2] = soldhp[2] - GetActorProperty(1338, APROP_Health); if (getactorproperty(1338, APROP_Health) <= 0) { shieldhp[2] = 0; acs_terminate(81,0); acs_terminate(104,0); } if (GetActorProperty(1338, APROP_Health) < soldhp[2]) { if (Getactorproperty(1338, APROP_Health) == 0) { shieldhp[2] = 0; acs_terminate(104,0); } if ( shieldhp[2] - shielddmg[2] > -1 && shieldhp[2] - shielddmg[2] < 101) { shieldhp[2] = shieldhp[2] - shielddmg[2]; Setactorproperty(1338, APROP_Health, GetActorproperty(1338, APROP_Health) + shielddmg[2]); acs_execute(105,0,0,0,0); shielddamaged[2] = 1; //Atmprechrg[2] = 1; } if ( shieldhp[2] - shielddmg[2] < 0 && shieldhp[2] > 0 && shielddamaged[2] == 0) { b[2] = shielddmg[2] - shieldhp[2]; Setactorproperty(1338, APROP_Health, GetActorproperty(1338, APROP_Health) + (shielddmg[2] - b[2])); shieldhp[2] = 0; acs_execute(105,0,0,0,0); shielddamaged[2] = 1; //Atmprechrg[2] = 1; } shielddamaged[2] = 1; soldhp[2] = GetActorProperty(1338, APROP_Health); acs_execute(105,0,0,0,0); if (shieldhp[2] - shielddmg[2] > 100) { shieldhp[2] = shieldhp[2] - shielddmg[2]; Setactorproperty(1338, APROP_Health, GetActorproperty(1338, APROP_Health) + shielddmg[2]); acs_terminate(105,0); } if (shieldhp[2] != 0) LocalAmbientSound("shieldhit", 127); } if (GetActorProperty(1338, APROP_Health) > 100) { oshield[2] = GetActorProperty(1338, APROP_Health) - 100; oshield[2] = (oshield[2] * 2); shieldhp[2] = oshield[2] + shieldhp[2]; SetActorProperty(1338, APROP_Health, 100); if (shieldhp[2] > 100) { acs_terminate(105,0); acs_terminate(103,0); Atmprechrg[2] = 0; } } if (shieldhp[2] > 300) { shieldhp[2] = 300; } soldhp[2] = GetActorProperty(1338, APROP_Health); acs_execute(91,0,0,0,0); delay(2); restart; } Script 105 (void) { for(e[2] = 1; e[2] < 16; e[2]++) { delay(10); if (shielddamaged[2] == 1) { shielddamaged[2] = 0; e[2] = 0; } /*if (Atmprechrg[2] == 0) { acs_terminate(105,0); }*/ } Atmprechrg[2] = 1; delay(35); acs_execute(103,0,0,0,0); } Script 106 (void) { schk[3] = GetActorProperty(1339, APROP_Health); LocalAmbientSound("shieldregen", 127); for (a[3] = 1; a[3] < 101; a[3]++) { if(shielddamaged[3] == 1) { shielddamaged[3] = 0; Atmprechrg[3] = 1; delay(70); acs_execute(108,0,0,0,0); acs_terminate(106,0); } delay(2); shieldhp[3]++; schk[3]++; if (shieldhp[3] >= 100) break; } Atmprechrg[3] = 0; } Script 107 (void) { setfont ("BigFont"); shielddmg[3] = soldhp[3] - GetActorProperty(1339, APROP_Health); if (getactorproperty(1339, APROP_Health) <= 0) { shieldhp[3] = 0; acs_terminate(82,0); acs_terminate(107,0); } if (GetActorProperty(1339, APROP_Health) < soldhp[3]) { if (Getactorproperty(1339, APROP_Health) == 0) { shieldhp[3] = 0; acs_terminate(104,0); } if ( shieldhp[3] - shielddmg[3] > -1 && shieldhp[3] - shielddmg[3] < 101) { shieldhp[3] = shieldhp[3] - shielddmg[3]; Setactorproperty(1339, APROP_Health, GetActorproperty(1339, APROP_Health) + shielddmg[3]); acs_execute(108,0,0,0,0); shielddamaged[3] = 1; } if ( shieldhp[3] - shielddmg[3] < 0 && shieldhp[3] > 0 && shielddamaged[3] == 0) { b[3] = shielddmg[3] - shieldhp[3]; Setactorproperty(1339, APROP_Health, GetActorproperty(1339, APROP_Health) + (shielddmg[3] - b[3])); shieldhp[3] = 0; acs_execute(108,0,0,0,0); shielddamaged[3] = 1; } shielddamaged[3] = 1; soldhp[3] = GetActorProperty(1339, APROP_Health); acs_execute(108,0,0,0,0); if (shieldhp[3] - shielddmg[3] > 100) { shieldhp[3] = shieldhp[3] - shielddmg[3]; Setactorproperty(1339, APROP_Health, GetActorproperty(1339, APROP_Health) + shielddmg[3]); acs_terminate(108,0); } if (shieldhp[3] != 0) LocalAmbientSound("shieldhit", 127); } if (GetActorProperty(1339, APROP_Health) > 100) { oshield[3] = GetActorProperty(1339, APROP_Health) - 100; oshield[3] = (oshield[3] * 2); shieldhp[3] = oshield[3] + shieldhp[3]; SetActorProperty(1339, APROP_Health, 100); if (shieldhp[3] > 100) { acs_terminate(108,0); acs_terminate(106,0); Atmprechrg[3] = 0; } } if (shieldhp[3] > 300) { shieldhp[3] = 300; } soldhp[3] = GetActorProperty(1339, APROP_Health); acs_execute(92,0,0,0,0); delay(2); restart; } Script 108 (void) { for(e[3] = 1; e[3] < 16; e[3]++) { delay(10); if (shielddamaged[3] == 1) { shielddamaged[3] = 0; e[3] = 0; } } Atmprechrg[3] = 1; delay(35); acs_execute(106,0,0,0,0); } Script 109 (void) { schk[4] = GetActorProperty(1440, APROP_Health); LocalAmbientSound("shieldregen", 127); for (a[4] = 1; a[4] < 101; a[4]++) { if(shielddamaged[4] == 1) { shielddamaged[4] = 0; Atmprechrg[4] = 1; delay(70); acs_execute(111,0,0,0,0); acs_terminate(109,0); } delay(2); shieldhp[4]++; schk[4]++; if (shieldhp[4] >= 100) break; } Atmprechrg[4] = 0; } Script 110 (void) { setfont ("BigFont"); shielddmg[4] = soldhp[4] - GetActorProperty(1440, APROP_Health); if (getactorproperty(1440, APROP_Health) <= 0) { shieldhp[4] = 0; acs_terminate(83,0); acs_terminate(110,0); } if (GetActorProperty(1440, APROP_Health) < soldhp[4]) { if (Getactorproperty(1440, APROP_Health) == 0) { shieldhp[4] = 0; acs_terminate(104,0); } if ( shieldhp[4] - shielddmg[4] > -1 && shieldhp[4] - shielddmg[4] < 101) { shieldhp[4] = shieldhp[4] - shielddmg[4]; Setactorproperty(1440, APROP_Health, GetActorproperty(1440, APROP_Health) + shielddmg[4]); acs_execute(111,0,0,0,0); shielddamaged[4] = 1; } if ( shieldhp[4] - shielddmg[4] < 0 && shieldhp[4] > 0 && shielddamaged[4] == 0) { b[4] = shielddmg[4] - shieldhp[4]; Setactorproperty(1440, APROP_Health, GetActorproperty(1440, APROP_Health) + (shielddmg[4] - b[4])); shieldhp[4] = 0; acs_execute(111,0,0,0,0); shielddamaged[4] = 1; } shielddamaged[4] = 1; soldhp[4] = GetActorProperty(1440, APROP_Health); acs_execute(111,0,0,0,0); if (shieldhp[4] - shielddmg[4] > 100) { shieldhp[4] = shieldhp[4] - shielddmg[4]; Setactorproperty(1440, APROP_Health, GetActorproperty(1440, APROP_Health) + shielddmg[4]); acs_terminate(111,0); } if (shieldhp[4] != 0) LocalAmbientSound("shieldhit", 127); } if (GetActorProperty(1440, APROP_Health) > 100) { oshield[4] = GetActorProperty(1440, APROP_Health) - 100; oshield[4] = (oshield[4] * 2); shieldhp[4] = oshield[4] + shieldhp[4]; SetActorProperty(1440, APROP_Health, 100); if (shieldhp[4] > 100) { acs_terminate(111,0); acs_terminate(109,0); Atmprechrg[4] = 0; } } if (shieldhp[4] > 300) { shieldhp[4] = 300; } soldhp[4] = GetActorProperty(1440, APROP_Health); acs_execute(92,0,0,0,0); delay(2); restart; } Script 111 (void) { for(e[4] = 1; e[4] < 16; e[4]++) { delay(10); if (shielddamaged[4] == 1) { shielddamaged[4] = 0; e[4] = 0; } } Atmprechrg[4] = 1; delay(35); acs_execute(109,0,0,0,0); } Script 112 (void) { schk[5] = GetActorProperty(1441, APROP_Health); LocalAmbientSound("shieldregen", 127); for (a[5] = 1; a[5] < 101; a[5]++) { if(shielddamaged[5] == 1) { shielddamaged[5] = 0; Atmprechrg[5] = 1; delay(70); acs_execute(114,0,0,0,0); acs_terminate(112,0); } delay(2); shieldhp[5]++; schk[5]++; if (shieldhp[5] >= 100) break; } Atmprechrg[5] = 0; } Script 113 (void) { shielddmg[5] = soldhp[5] - GetActorProperty(1441, APROP_Health); if (getactorproperty(1441, APROP_Health) <= 0) { shieldhp[5] = 0; acs_terminate(80,0); acs_terminate(113,0); } if (GetActorProperty(1441, APROP_Health) < soldhp[5]) { if (Getactorproperty(1441, APROP_Health) == 0) { shieldhp[5] = 0; acs_terminate(113,0); } if ( shieldhp[5] - shielddmg[5] > -1 && shieldhp[5] - shielddmg[5] < 101) { shieldhp[5] = shieldhp[5] - shielddmg[5]; Setactorproperty(1441, APROP_Health, GetActorproperty(1441, APROP_Health) + shielddmg[5]); acs_execute(114,0,0,0,0); shielddamaged[5] = 1; Atmprechrg[5] = 1; } if ( shieldhp[5] - shielddmg[5] < 0 && shieldhp[5] > 0 && shielddamaged[5] == 0) { b[5] = shielddmg[5] - shieldhp[5]; Setactorproperty(1441, APROP_Health, GetActorproperty(1441, APROP_Health) + (shielddmg[5] - b[5])); shieldhp[5] = 0; acs_execute(114,0,0,0,0); shielddamaged[5] = 1; Atmprechrg[5] = 1; } shielddamaged[5] = 1; soldhp[5] = GetActorProperty(1441, APROP_Health); acs_execute(114,0,0,0,0); if (shieldhp[5] - shielddmg[5] > 100) { shieldhp[5] = shieldhp[5] - shielddmg[5]; Setactorproperty(1441, APROP_Health, GetActorproperty(1441, APROP_Health) + shielddmg[5]); acs_terminate(114,0); } if (shieldhp[5] != 0) LocalAmbientSound("shieldhit", 127); } if (GetActorProperty(1441, APROP_Health) > 100) { oshield[5] = GetActorProperty(1441, APROP_Health) - 100; oshield[5] = (oshield[5] * 2); shieldhp[5] = oshield[5] + shieldhp[5]; SetActorProperty(1441, APROP_Health, 100); if (shieldhp[5] > 100) { acs_terminate(114,0); acs_terminate(112,0); Atmprechrg[5] = 0; } } if (shieldhp[5] > 300) { shieldhp[5] = 300; } soldhp[5] = GetActorProperty(1441, APROP_Health); acs_execute(94,0,0,0,0); delay(2); restart; } Script 114 (void) { for(e[5] = 1; e[5] < 16; e[5]++) { delay(10); Atmprechrg[5] = 0; if (shielddamaged[5] == 1) { shielddamaged[5] = 0; e[5] = 0; //LocalAmbientSound("shieldhit", 127); } /*if (Atmprechrg[5] == 0) { acs_terminate(114,0); }*/ } Atmprechrg[5] = 1; delay(35); acs_execute(112,0,0,0,0); } Script 115 (void) { schk[6] = GetActorProperty(1442, APROP_Health); LocalAmbientSound("shieldregen", 127); for (a[6] = 1; a[6] < 101; a[6]++) { if(shielddamaged[6] == 1) { shielddamaged[6] = 0; Atmprechrg[6] = 1; delay(70); acs_execute(117,0,0,0,0); acs_terminate(115,0); } delay(2); shieldhp[6]++; schk[6]++; if (shieldhp[6] >= 100) break; } Atmprechrg[6] = 0; } Script 116 (void) { setfont ("BigFont"); shielddmg[6] = soldhp[6] - GetActorProperty(1442, APROP_Health); if (getactorproperty(1442, APROP_Health) <= 0) { shieldhp[6] = 0; acs_terminate(81,0); acs_terminate(116,0); } if (GetActorProperty(1442, APROP_Health) < soldhp[6]) { if (Getactorproperty(1442, APROP_Health) == 0) { shieldhp[6] = 0; acs_terminate(116,0); } if ( shieldhp[6] - shielddmg[6] > -1 && shieldhp[6] - shielddmg[6] < 101) { shieldhp[6] = shieldhp[6] - shielddmg[6]; Setactorproperty(1442, APROP_Health, GetActorproperty(1442, APROP_Health) + shielddmg[6]); acs_execute(117,0,0,0,0); shielddamaged[6] = 1; //Atmprechrg[6] = 1; } if ( shieldhp[6] - shielddmg[6] < 0 && shieldhp[6] > 0 && shielddamaged[6] == 0) { b[6] = shielddmg[6] - shieldhp[6]; Setactorproperty(1442, APROP_Health, GetActorproperty(1442, APROP_Health) + (shielddmg[6] - b[6])); shieldhp[6] = 0; acs_execute(117,0,0,0,0); shielddamaged[6] = 1; //Atmprechrg[6] = 1; } shielddamaged[6] = 1; soldhp[6] = GetActorProperty(1442, APROP_Health); acs_execute(117,0,0,0,0); if (shieldhp[6] - shielddmg[6] > 100) { shieldhp[6] = shieldhp[6] - shielddmg[6]; Setactorproperty(1442, APROP_Health, GetActorproperty(1442, APROP_Health) + shielddmg[6]); acs_terminate(117,0); } if (shieldhp[6] != 0) LocalAmbientSound("shieldhit", 127); } if (GetActorProperty(1442, APROP_Health) > 100) { oshield[6] = GetActorProperty(1442, APROP_Health) - 100; oshield[6] = (oshield[6] * 2); shieldhp[6] = oshield[6] + shieldhp[6]; SetActorProperty(1442, APROP_Health, 100); if (shieldhp[6] > 100) { acs_terminate(117,0); acs_terminate(115,0); Atmprechrg[6] = 0; } } if (shieldhp[6] > 300) { shieldhp[6] = 300; } soldhp[6] = GetActorProperty(1442, APROP_Health); acs_execute(91,0,0,0,0); delay(2); restart; } Script 117 (void) { for(e[6] = 1; e[6] < 16; e[6]++) { delay(10); if (shielddamaged[6] == 1) { shielddamaged[6] = 0; e[6] = 0; } /*if (Atmprechrg[6] == 0) { acs_terminate(117,0); }*/ } Atmprechrg[6] = 1; delay(35); acs_execute(115,0,0,0,0); } Script 118 (void) { schk[7] = GetActorProperty(1443, APROP_Health); LocalAmbientSound("shieldregen", 127); for (a[7] = 1; a[7] < 101; a[7]++) { if(shielddamaged[7] == 1) { shielddamaged[7] = 0; Atmprechrg[7] = 1; delay(70); acs_execute(120,0,0,0,0); acs_terminate(118,0); } delay(2); shieldhp[7]++; schk[7]++; if (shieldhp[7] >= 100) break; } Atmprechrg[7] = 0; } Script 119 (void) { setfont ("BigFont"); shielddmg[7] = soldhp[7] - GetActorProperty(1443, APROP_Health); if (getactorproperty(1443, APROP_Health) <= 0) { shieldhp[7] = 0; acs_terminate(82,0); acs_terminate(119,0); } if (GetActorProperty(1443, APROP_Health) < soldhp[7]) { if (Getactorproperty(1443, APROP_Health) == 0) { shieldhp[7] = 0; acs_terminate(116,0); } if ( shieldhp[7] - shielddmg[7] > -1 && shieldhp[7] - shielddmg[7] < 101) { shieldhp[7] = shieldhp[7] - shielddmg[7]; Setactorproperty(1443, APROP_Health, GetActorproperty(1443, APROP_Health) + shielddmg[7]); acs_execute(120,0,0,0,0); shielddamaged[7] = 1; } if ( shieldhp[7] - shielddmg[7] < 0 && shieldhp[7] > 0 && shielddamaged[7] == 0) { b[7] = shielddmg[7] - shieldhp[7]; Setactorproperty(1443, APROP_Health, GetActorproperty(1443, APROP_Health) + (shielddmg[7] - b[7])); shieldhp[7] = 0; acs_execute(120,0,0,0,0); shielddamaged[7] = 1; } shielddamaged[7] = 1; soldhp[7] = GetActorProperty(1443, APROP_Health); acs_execute(120,0,0,0,0); if (shieldhp[7] - shielddmg[7] > 100) { shieldhp[7] = shieldhp[7] - shielddmg[7]; Setactorproperty(1443, APROP_Health, GetActorproperty(1443, APROP_Health) + shielddmg[7]); acs_terminate(120,0); } if (shieldhp[7] != 0) LocalAmbientSound("shieldhit", 127); } if (GetActorProperty(1443, APROP_Health) > 100) { oshield[7] = GetActorProperty(1443, APROP_Health) - 100; oshield[7] = (oshield[7] * 2); shieldhp[7] = oshield[7] + shieldhp[7]; SetActorProperty(1443, APROP_Health, 100); if (shieldhp[7] > 100) { acs_terminate(120,0); acs_terminate(118,0); Atmprechrg[7] = 0; } } if (shieldhp[7] > 300) { shieldhp[7] = 300; } soldhp[7] = GetActorProperty(1443, APROP_Health); acs_execute(92,0,0,0,0); delay(2); restart; } Script 120 (void) { for(e[7] = 1; e[7] < 16; e[7]++) { delay(10); if (shielddamaged[7] == 1) { shielddamaged[7] = 0; e[7] = 0; } } Atmprechrg[7] = 1; delay(35); acs_execute(118,0,0,0,0); } Script 121 (void) { schk[8] = GetActorProperty(1440, APROP_Health); LocalAmbientSound("shieldregen", 127); for (a[8] = 1; a[8] < 101; a[8]++) { if(shielddamaged[8] == 1) { shielddamaged[8] = 0; Atmprechrg[8] = 1; delay(70); acs_execute(123,0,0,0,0); acs_terminate(121,0); } delay(2); shieldhp[8]++; schk[8]++; if (shieldhp[8] >= 100) break; } Atmprechrg[8] = 0; } Script 122 (void) { setfont ("BigFont"); shielddmg[8] = soldhp[8] - GetActorProperty(1440, APROP_Health); if (getactorproperty(1440, APROP_Health) <= 0) { shieldhp[8] = 0; acs_terminate(83,0); acs_terminate(122,0); } if (GetActorProperty(1440, APROP_Health) < soldhp[8]) { if (Getactorproperty(1440, APROP_Health) == 0) { shieldhp[8] = 0; acs_terminate(116,0); } if ( shieldhp[8] - shielddmg[8] > -1 && shieldhp[8] - shielddmg[8] < 101) { shieldhp[8] = shieldhp[8] - shielddmg[8]; Setactorproperty(1440, APROP_Health, GetActorproperty(1440, APROP_Health) + shielddmg[8]); acs_execute(123,0,0,0,0); shielddamaged[8] = 1; } if ( shieldhp[8] - shielddmg[8] < 0 && shieldhp[8] > 0 && shielddamaged[8] == 0) { b[8] = shielddmg[8] - shieldhp[8]; Setactorproperty(1440, APROP_Health, GetActorproperty(1440, APROP_Health) + (shielddmg[8] - b[8])); shieldhp[8] = 0; acs_execute(123,0,0,0,0); shielddamaged[8] = 1; } shielddamaged[8] = 1; soldhp[8] = GetActorProperty(1440, APROP_Health); acs_execute(123,0,0,0,0); if (shieldhp[8] - shielddmg[8] > 100) { shieldhp[8] = shieldhp[8] - shielddmg[8]; Setactorproperty(1440, APROP_Health, GetActorproperty(1440, APROP_Health) + shielddmg[8]); acs_terminate(111,0); } if (shieldhp[8] != 0) LocalAmbientSound("shieldhit", 127); } if (GetActorProperty(1440, APROP_Health) > 100) { oshield[8] = GetActorProperty(1440, APROP_Health) - 100; oshield[8] = (oshield[8] * 2); shieldhp[8] = oshield[8] + shieldhp[8]; SetActorProperty(1440, APROP_Health, 100); if (shieldhp[8] > 100) { acs_terminate(111,0); acs_terminate(121,0); Atmprechrg[8] = 0; } } if (shieldhp[8] > 300) { shieldhp[8] = 300; } soldhp[8] = GetActorProperty(1440, APROP_Health); acs_execute(92,0,0,0,0); delay(2); restart; } Script 123 (void) { for(e[8] = 1; e[8] < 16; e[8]++) { delay(10); if (shielddamaged[8] == 1) { shielddamaged[8] = 0; e[8] = 0; } } Atmprechrg[8] = 1; delay(35); acs_execute(121,0,0,0,0); }
And as always, Please make sure to put credit for my work inside your txt files when you do go to use this in your own wads Thanks
http://apothem.theomniverse.com/shielding