Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Include "Zcommon.acs"
- //With the definitions, it is always best to add a number everytime you add something new in, I have had that glitch out before back when I was still
- //Learning, for example if you add in 1 barricade, you should add 1 number to DEF_COUNTBARRICADES
- //Game definitons
- #define DEF_COUNT_BARRICADES 13
- #define DEF_COUNT_PERKS 5
- #define DEF_COUNT_WALLITEMS 10
- #define DEF_COUNT_DOORS 4
- #define DEF_COUNT_TRAPS 2
- #define DEF_COUNT_BOXITEMS 30
- #define DEF_COUNT_ZOMBIESPAWNS 14
- #define DEF_COUNT_DOGSPAWNS 1
- //Spawn definitions
- #define DEF_round_safetime 70
- #define DEF_round_intermission 200
- #define DEF_round_enddelay 35
- #define DEF_zombies_initialzombies 5
- #define DEF_zombies_increaseamount 5
- #define DEF_zombies_maxonmap 24
- #define DEF_zombies_initialhp 50
- #define DEF_zombies_increasehp 23
- #define DEF_zombies_initialspeed 1.8
- #define DEF_zombies_increasespeed 0.2
- #define DEF_zombies_spawnrate 28
- #define DEF_dogs_exist 0
- #define DEF_dogs_minround 4
- #define DEF_dogs_maxround 8
- #define DEF_dogs_initialdogs 1
- #define DEF_dogs_increaseamount 2
- #define DEF_dogs_maxonmap 4
- #define DEF_dogs_initialhp 50
- #define DEF_dogs_increasehp 5
- #define DEF_dogs_spawnrate 40
- //First of all, most of these are controlled by alternate scripts, however you are able to tweak some of the stuff here pretty much without knowing a hell
- //Of a lot about programming and it's going to be explained to you if you don't get it let me (WhiteAce) know and I'll try my best to explain it a bit more
- //In detail
- //Startup and game event variables, text that pops up during the start, you can disable them by just using replacing the text with ""
- str GAME_startuptext[4] ={ "Berlin, Germany", //First line (By default) is used to specify a country location
- "Verruckt", //Second line (By default) is used to specify a specific location or map name
- "July 14th, 1946", //Third line (By default) as you can see is usually used to specify a date
- "Created by: TankDempsey" }; //Fourth line (By default) is used to specify who created the map
- int DEBUG_enabled =0;
- int DEBUG_round =19;
- int GAME_musicenabled=0; //(Debug purposes) When the variable reaches a certain limit (3 I think) music plays
- str GAME_songname="Music2"; //Choose which song plays with this, just make sure to define it in soundsequence
- int GAME_gameover=0; //(Debug purposes) Setting this to 1 will take away certain elements of the hud (Is used so that way the game over screen
- //Appears with no hud but rather just player score)
- int GAME_power=0; //Setting this to 1 will ofcourse allow you to purchase everything in the game that requires power pretty much without turning
- //the power on in game
- int GAME_powertid=27; //(Unused currently) Will be used to pop up text on the screen when the player is standing on a sector that turns on power
- int GAME_RandomNumber=2; //(Unused currently) Was used to pick what luck the player would have with dogs spawning so they would spawn different rounds
- //will put it back in later, just need to re-write it and make it randomize 2 = Dogs at round 6, 1 = dogs at round 5, etc
- //Variables for rounds (mostly debug)
- int GAME_round_number =1; //I think you know what this is, it's the round number the player starts on (Debug purposes)
- int GAME_round_doground =0; //So basically if you wanted to start a doground at the start, change the 0 to a 1 (Debug purposes)
- int GAME_round_dogs =1;
- int GAME_round_untildogs =DEF_dogs_minround; //External script controlled no need to worry about this one (Yet)
- int GAME_round_zombiesleft =DEF_zombies_initialzombies; //Or this
- int GAME_round_zombiescount =DEF_zombies_initialzombies; //Or this
- int GAME_round_dogscount =DEF_dogs_initialdogs; //Or this
- int GAME_round_tics =0; //Or this
- int GAME_round_secs =0; //(Hell on earth only) Controls the amount of seconds that have passed
- int GAME_round_mins =0; //(Hell on earth only) Controls the amount of minutes that have passed
- str GAME_round_startsound="game/ROUND"; //The sound that plays when a round starts
- str GAME_round_endsound="game/END"; //The sound that plays when a round ends
- //Player variables
- int PLAYER_heal_time =35; //The time it takes for the player to heal (pretty self explainatory)
- int PLAYER_money[4] ={ 500, 500, 500, 500 }; //Mainly for debugging purposes but you can change the amount of money the player starts with here
- int PLAYER_kills[4] ={ 0, 0, 0, 0 }; //Again, usually for debugging but this is the total amount of kills the player has
- int PLAYER_dead[4] ={ 0, 0, 0, 0 }; //If somehow the player is dead mark as 1 (Actually, might have to double check that one later
- //This slightly gives me a headache I don't know if it counts the amount of times died or if it
- //Simply tells the game, the player is dead)
- int PLAYER_downed[4] ={ 0, 0, 0, 0 }; //If somehow the player is dead, this is marked as 1 (Same as above though, headaches man)
- //Purchasable weapon variables (Wallitems)
- str WALLITEM_names[10] ={ "Gewehr 43",
- "Kar98k",
- "M1 Garand",
- "MP40",
- "Double Barrel",
- "Bouncing Betties",
- "M1897 Trench Gun",
- "STG-44",
- "Sawn-off Shotgun",
- "BAR" }; //The name of the weapon the player is purchasing, shows up on hud
- //For the names of each weapon, refer to the PK3.
- str WALLITEM_actors[2][10] ={{ "Gewehr43",
- "Kar98k",
- "M1Garand",
- "MP40",
- "DoubleBarrel",
- "BouncingBettyAmmo",
- "TrenchGun",
- "STG-44",
- "SawnOffShotgun",
- "BAR" },
- { "Reserve_Gewehr",
- "Reserve_Kar",
- "Reserve_M1",
- "Reserve_MP40",
- "Reserve_Double",
- "BouncingBettyAmmo",
- "Reserve_Trenchgun",
- "Reserve_STG",
- "Reserve_SawnOff",
- "Reserve_BAR" }}; //These are the actors, it's what the player receives when purchasing them
- int WALLITEM_prices[10] ={ 600, 200, 600, 1000, 1200, 1000, 1500, 1200, 1200, 1200 }; //Pretty self explainatory, this is the prices for the weapons
- int WALLITEM_tids[10] ={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; //The sector tag in which the player stands on in order to purchase the weapons
- //Zombie/Dog spawns, spawn in via a map spot with following tags
- int ZOMBIESPAWN_spawn[2] ={ "Zombie_Normal", //This makes it much easier for someone to replace the zombies with something else
- "Zombie_Sprinter" };
- int ZOMBIESPAWN_tids[14] ={ 1,2,3,4, 5,6, 7,8, 9,10, 11,12,13,14 };
- int DOGSPAWN_spawn[3] ={ "DogSpawn_", //DogSpawn_ is a special effect
- "Dog_Normal", //you can also replace the dogs
- "Dog_Flamer" };
- int DOGSPAWN_tids[1] ={};
- //Zombie/Dog room spawn id's, these control which room they spawn in if it's open, 0 is starting room
- int ZOMBIESPAWN_roomid[14] ={ 0,0,0,0, 1,1, 2,2, 3,3, 4, 5,5,5 };
- int DOGSPAWN_roomid[1] ={};
- //Door variables
- int DOOR_opened[4] ={0,0,0,0}; //0 means door not opened, 1 means door opened (Doesn't count first room because first is always open)
- int DOOR_tids[4] ={80,81,82,83}; //These are the sector tags where the player can purchase the door
- int DOOR_type[4] ={0,1,1,1}; //Affects the text appear on screen when player is in the sector
- //0 (By default): "hold USE to lower the gate"
- //1 (By default): "hold USE to open the door"
- //2 (By default): "hold USE to clear the debris" (Not yet implemented, remember to implement future NachtIntellect)
- int DOOR_prices[4] ={1000, 750, 1000, 1000}; //Controls how much money the player has to pay to open the door
- int DOOR_roomid[4][2] ={{0,1},
- {1,2},
- {2,3},
- {3,4}}; //Say for example you were in the start room, 0 is the number of the start room, the player buys the door to the east
- //You should put 0,1 1 being the second room now if the player was to buy another room after that in 1 (Not start)
- //Then put 1,2, likewise if there was a room to the west and the player was in the starting room, put 0,2 it is a
- //Little confusing at first, might need better explaination
- int DOOR_scriptno =200; //First door uses script 200 (By default) anything more add 1 onto the script number, try not to put traps and doors
- //With the same script number and leave room for other scripts
- int ROOM_opened[5] ={1,0,0,0,0}; //ROOM_opened always has 1 extra digit that's because it counts the start room, if the player is in the start room put
- //1 then 0 for every other room that isn't open yet
- //Barricade variables, will eventually be adding in more variables for this to increase maxhealth and etc.
- int BARRICADE_texture[7] ={ "NBAR1", "NBAR2", "NBAR3", "NBAR4", "NBAR5", "NBAR6", "" }; //Change the barricade textures here, the "" is when there is
- //no texture
- int BARRICADE_health[13] ={ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }; //This might be obvious but this is the amount of health the barricades have, for now you can only have a max of
- //6 but I am hoping to add more variables in order to change that
- int BARRICADE_lineid[13] ={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }; //This is the line identification for the barricades, if you don't put this on where your barricades are, it
- //The barricade won't show any damage and zombies can just waltz through, you can set this by using the
- //Line Identification action in the map editor you use (I use GZDoomBuilder and this is built on Hexen format)
- int BARRICADE_sectorid[13] ={ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132 }; //This sector tag goes on the side that you repair from
- int BARRICADE_attackid[13] ={ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172 }; //This sector tag goes on the side that the zombies attack from when at a barricade
- int BARRICADE_updatetime[13] ={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; //(Debug purposes) Makes the barricades repair themselves
- //Box control variables, a little complex
- str BOX_items[30] ={ "Kar98k", //Self explanatory, these are the actors (Spawn names) that the player can receive from the box
- "Springfield",
- "M1A1Carbine",
- "M1Garand",
- "TrenchGun",
- "Gewehr43",
- "SawnOffShotgun",
- "MP40",
- "STG-44",
- "357Magnum",
- "Thompson",
- "BAR",
- "Colt45",
- "DualColt45s",
- "Panzerschreck",
- "MG42",
- "M2Flamethrower",
- "FG42",
- "PPSh41",
- "Browningm1919",
- "Luger",
- "Nailgun",
- "Thundergun",
- "Raygun",
- "Glock18",
- "Sterlingl2a3",
- "DoubleBarrel",
- "Nambu",
- "DP-28",
- "SpringfieldScoped" };
- str BOX_itemnames[30] ={ "Kar98k", //These are used for the text that pops up when the player is at the mystery box for example
- "Springfield", //"hold USE to pick up the M1A1 Carbine" and etc you could even make it say "hold use to pick up the
- "M1A1 Carbine", //stick" in place instead of M1A1 Carbine
- "M1 Garand",
- "M1897 Trench Gun",
- "Gewehr 43",
- "Sawn-Off Shotgun",
- "MP40",
- "StG-44",
- ".357 Magnum",
- "Thompson",
- "BAR",
- "Colt M1911",
- "Dual M1911s",
- "Panzerschreck",
- "MG42",
- "M2 Flamethrower",
- "FG42",
- "PPSh 41",
- "Browning M1919",
- "Luger",
- "Nailgun",
- "Thundergun",
- "Raygun",
- "Glock 18",
- "Sterling L2A3",
- "Double-Barrel shotgun",
- "Type 14 Nambu",
- "DP-28",
- "Springfield W/ Scope" };
- int BOX_active =0; //(Debug purposes) If the number is 1, the box is rolling
- int BOX_activator =0; //(Debug purposes) Basically, the TID of the player who rolled the box, activator is set via an
- //External script however, the TID for players is 1000 + 1 for each player
- int BOX_itemtaken =0; //(Debug purposes) Determines if someone has taken the item they rolled from the box, if so is set
- //To 1 then the mystery box returns back to it's normal position
- int BOX_tag =220; //The sector tag where the box can be activated
- int BOX_weaponstid =200; //The TID where the weapons will show up
- int BOX_spinsound ="game/MYSTERY"; //The sound that is played when the box is activated
- int BOX_currentitem =1; //The current item is set to one, so it always rolls 1 first then cycles through other things
- //Perk variables
- str PERK_names[5] ={ "Juggernog", //The names that pop up on the hud when you walk into the sector tag they are assigned to
- "Speed Cola",
- "Double Tap Root Beer",
- "Quick Revive",
- "Machete" };
- str PERK_actors[5] ={ "Jugg", //What actors (Rather perk bottles) the player receives when purchasing a perk
- "SpdCola",
- "DoubTap",
- "QckRvve",
- "Machete" };
- int PERK_prices[5] ={ 2500, //Self explainatory, the prices of each perk
- 3000,
- 2000,
- 500,
- 3000 };
- str PERK_Inventory[5] ={ "PowerJuggernog", //These check to see if the player has the perks in their inventory, if they do they won't be able to
- "SpeedCola", //Purchase the perks they already have
- "DoubleTap",
- "PowerQuickRevive",
- "Machete" };
- int PERK_tids[5] ={ 40, 41, 42, 43, 44 }; //The sector tags for each perk which are what the player stands on to buy the perk
- //Trap variables
- int TRAP_active[2] ={ 0, 0 }; //(Debug purposes) If a trap is active, is set to 1, external scripts make the traps reset after a while
- int TRAP_tids[2] ={ 47, 48 }; //The sector tags for each trap which allow the player to purchase a trap
- int TRAP_prices[2] ={ 1000, 2000 }; //Self explainatory, the prices for each trap
- int TRAP_type[2] ={ 0, 1 };
- int TRAP_scriptno =220; //Allows you to set the first script number for a trap, controlled by external scripts for each trap will add 1
- //Onto this number which means the script for the next trap will be 211, next 212 and so on (pretty much
- //Same with doors)
- SCRIPT 1 OPEN
- {
- if(PlayerCount()==0) { delay(35); restart; }
- int OPEN_zombie_speed;
- int OPEN_zombie_health;
- int OPEN_dog_health;
- int TEMP_round_delay;
- int TEMP_draw_delay;
- OPEN_zombie_speed=DEF_zombies_initialspeed;
- OPEN_zombie_health=DEF_zombies_initialhp;
- OPEN_dog_health=DEF_dogs_initialhp;
- TEMP_round_delay=DEF_round_safetime;
- TEMP_draw_delay=204;
- ACS_Execute(10,0,0,0,0); // Handle how the game begins
- ACS_Execute(12,0,0,0,0); // Control barricades
- while(true)
- {
- if(TEMP_draw_delay<1 && GAME_gameover==0)
- {
- SetFont("BIGFONT");
- SetHudSize(320,240,0);
- if(GameSkill()<4)
- {
- HudMessage(d:GAME_round_number;HUDMSG_PLAIN,1,CR_RED,32.0,216.0,0.1);
- }
- else
- {
- HudMessage(d:GAME_round_mins,s:":",d:GAME_round_secs;HUDMSG_PLAIN,1,CR_RED,32.0,216.0,0.1);
- }
- SetHudSize(0,0,0);
- }
- else
- {
- TEMP_draw_delay-=1;
- }
- /*
- ** Control spawning
- */
- if(TEMP_round_delay>0) {TEMP_round_delay-=1;}
- else
- {
- if(!GAME_round_doground)
- {
- if(GAME_round_zombiesleft>0 && random(1,DEF_zombies_spawnrate)==1
- && (ThingCountName(ZOMBIESPAWN_spawn[0],0)+ThingCountName(ZOMBIESPAWN_spawn[1],0)<DEF_zombies_maxonmap))
- {
- int whileA;
- whileA=random(0,DEF_COUNT_ZOMBIESPAWNS);
- if(ROOM_opened[ZOMBIESPAWN_roomid[whileA]])
- {
- if(OPEN_zombie_speed==4.0) {SpawnSpot(ZOMBIESPAWN_spawn[1],ZOMBIESPAWN_tids[whileA],667,random(0,360));}
- else
- {
- if(OPEN_zombie_speed>=3.0)
- {
- if(random(0,2)==0) {SpawnSpot(ZOMBIESPAWN_spawn[1],ZOMBIESPAWN_tids[whileA],667,random(0,360));}
- else {SpawnSpot(ZOMBIESPAWN_spawn[0],ZOMBIESPAWN_tids[whileA],667,random(0,360));}
- }
- else
- {
- SpawnSpot(ZOMBIESPAWN_spawn[0],ZOMBIESPAWN_tids[whileA],667,random(0,360));
- }
- }
- //SpawnSpot("Zombie",ZOMBIESPAWN_tids[whileA],667,random(0,360));
- //print(s:"spawned zombie, spawn id ",d:whileA);
- SetActorProperty(667,APROP_HEALTH,OPEN_zombie_health);
- //Thing_Hate(667,1000+random(1,PlayerCount()),3);
- if(OPEN_zombie_speed<4.0) {SetActorProperty(667,APROP_SPEED,random(DEF_zombies_initialspeed,OPEN_zombie_speed));}
- else {SetActorProperty(667,APROP_SPEED,OPEN_zombie_speed);}
- Thing_ChangeTID(667,1500+GAME_round_zombiesleft);
- GAME_round_zombiesleft-=1;
- TEMP_round_delay=10;
- }
- }
- }
- else
- {
- if(GAME_round_zombiesleft>0 && random(1,DEF_dogs_spawnrate)==1
- && (ThingCountName(DOGSPAWN_spawn[1],0)+ThingCountName(DOGSPAWN_spawn[2],0)<DEF_dogs_maxonmap))
- {
- int whileB;
- whileB=random(0,DEF_COUNT_DOGSPAWNS);
- if(ROOM_opened[DOGSPAWN_roomid[whileB]])
- {
- SpawnSpot(DOGSPAWN_spawn[0],DOGSPAWN_tids[whileB],0,random(0,360));
- if(random(0,4)==0) { SpawnSpot(DOGSPAWN_spawn[2],DOGSPAWN_tids[whileB],667,random(0,360)); }
- else { SpawnSpot(DOGSPAWN_spawn[1],DOGSPAWN_tids[whileB],667,random(0,360)); }
- SetActorProperty(667,APROP_HEALTH,OPEN_dog_health);
- //Thing_Hate(667,1000+random(1,PlayerCount()),3);
- Thing_ChangeTID(667,1500+GAME_round_zombiesleft);
- GAME_round_zombiesleft-=1;
- TEMP_round_delay=10;
- }
- }
- }
- }
- if(((ThingCountName(ZOMBIESPAWN_spawn[0],0)==0 && ThingCountName(ZOMBIESPAWN_spawn[1],0)==0)
- && (ThingCountName(DOGSPAWN_spawn[1],0)==0 && ThingCountName(DOGSPAWN_spawn[2],0)==0)
- && GAME_round_zombiesleft==0) && GameSkill()<4)
- {
- delay(35);
- if(!GAME_round_doground)
- {
- SetFont("SMALLFONT");
- SetHudSize(320,240,0);
- HudMessage(s:"round";HUDMSG_FADEINOUT,0,CR_WHITE,160.0,120.0,2.0,1.0,1.0);
- HudMessage(s:"complete";HUDMSG_FADEINOUT,0,CR_WHITE,160.0,128.0,2.0,1.0,1.0);
- SetHudSize(0,0,0);
- }
- for(int F1_dead=0;F1_dead<4;F1_dead++)
- {
- PLAYER_dead[F1_dead]=0;
- }
- ACS_ExecuteAlways(502,0,GAME_round_number*10,1000,0);
- ACS_ExecuteAlways(502,0,GAME_round_number*10,1001,0);
- ACS_ExecuteAlways(502,0,GAME_round_number*10,1002,0);
- ACS_ExecuteAlways(502,0,GAME_round_number*10,1003,0);
- ACS_ExecuteAlways(502,0,GAME_round_number*10,1004,0);
- delay(DEF_round_enddelay);
- ACS_Execute(11,0,0,0,0);
- delay(DEF_round_intermission);
- if(OPEN_zombie_speed<4.0) {OPEN_zombie_speed+=DEF_zombies_increasespeed;}
- OPEN_zombie_health+=DEF_zombies_increasehp*PlayerCount();
- OPEN_dog_health+=DEF_dogs_increasehp*PlayerCount();
- TEMP_round_delay=DEF_round_safetime;
- }
- /*
- ** Control Hell On Earth mode
- */
- if(GameSkill()==4 || GameSkill()==5)
- {
- GAME_round_tics+=1;
- if(GAME_round_tics>=35) {GAME_round_tics-=35; GAME_round_secs+=1;}
- if(GAME_round_secs>=60)
- {
- GAME_round_secs-=60;
- GAME_round_mins+=1;
- ACS_ExecuteAlways(502,0,GAME_round_number*5,1000,0);
- ACS_ExecuteAlways(502,0,GAME_round_number*5,1001,0);
- ACS_ExecuteAlways(502,0,GAME_round_number*5,1002,0);
- ACS_ExecuteAlways(502,0,GAME_round_number*5,1003,0);
- ACS_ExecuteAlways(502,0,GAME_round_number*5,1004,0);
- if(OPEN_zombie_speed<4.0) {OPEN_zombie_speed+=DEF_zombies_increasespeed*2;}
- OPEN_zombie_health+=(DEF_zombies_increasehp*PlayerCount())*2;
- for(int FOR1_a=0;FOR1_a<4;FOR1_a++) { GiveActorInventory(1000+FOR1_a,"GrenadeAmmo",1); GiveActorInventory(1000+FOR1_a,"Bouncingbettyammo",1); ACS_ExecuteAlways(502,0,GAME_round_mins*10,0,0); }
- }
- if(GAME_round_zombiesleft<1) {GAME_round_zombiesleft+=256;}
- }
- delay(1);
- }
- }
- SCRIPT 2 ENTER
- {
- if(PLAYER_dead[PlayerNumber()]==1)
- {
- if(GetActorProperty(ActivatorTID(),APROP_HEALTH)>0)
- {
- SetHudSize(320,240,0);
- SetFont("SMALLFONT");
- HudMessage(s:"you are dead.";HUDMSG_FADEINOUT,0,CR_RED,160.0,16.1,5.0,0.1,1.0);
- HudMessage(s:"you cannot spawn\nuntil the round is over.";HUDMSG_FADEINOUT,0,CR_RED,160.0,32.1,4.0,1.0,1.0);
- SetHudSize(0,0,0);
- Thing_Damage2(ActivatorTID(),999,"AlreadyDead");
- }
- if((ThingCountName(ZOMBIESPAWN_spawn[0],0)==0 && ThingCountName(ZOMBIESPAWN_spawn[1],0)==0)
- && (ThingCountName(DOGSPAWN_spawn[1],0)==0 && ThingCountName(DOGSPAWN_spawn[2],0)==0)
- && GAME_round_zombiesleft==0)
- {
- SetFont("SMALLFONT");
- HudMessage(s:"Round is over.\nYou can now rejoin.";HUDMSG_PLAIN,21,CR_BLUE,1.5,0.2,2.0);
- }
- }
- int TEMP_player_voicetime;
- int TEMP_player_footsteptime;
- int TEMP_player_killstreak;
- int TEMP_player_input;
- int TEMP_player_buytime;
- int TEMP_player_health;
- int TEMP_player_checktime;
- int TEMP_player_revivetime;
- int TEMP_player_revivewho;
- int TEMP_for_mode;
- TEMP_player_voicetime=100;
- TEMP_player_footsteptime=24;
- TEMP_player_killstreak=1;
- TEMP_player_buytime=0;
- TEMP_player_health=100;
- TEMP_player_checktime=0;
- TEMP_player_revivetime=0;
- TEMP_player_revivewho=-1;
- TEMP_for_mode=0;
- ClearInventory();
- Thing_ChangeTID(0,1000+PlayerNumber());
- GiveInventory("Points",500);
- GiveInventory("Colt45",1);
- TakeInventory("Reserve_M1911",80);
- GiveInventory("Reserve_M1911",32);
- GiveInventory("GrenadeAmmo",2);
- GiveInventory("WeaponsInInventory",1);
- while(true)
- {
- SetActorProperty(0,APROP_INVULNERABLE,0);
- TEMP_player_input=GetPlayerInput(PlayerNumber(),INPUT_BUTTONS);
- /*&SetFont("FOV");
- SetHudSize(256,256,0);
- HudMessage(s:"A";HUDMSG_PLAIN,99,CR_UNTRANSLATED,0.1,0.1,0.1);
- SetHudSize(0,0,0);*/
- if(CheckInventory("money")>0) {PLAYER_money[PlayerNumber()]+=CheckInventory("money");TakeInventory("money",CheckInventory("money"));}
- SetFont("CONFONT");
- SetHudSize(800,600,0);
- if(GAME_gameover==0)
- {
- HudMessage(d:PLAYER_money[0];HUDMSG_PLAIN,0,CR_WHITE,680.0,500.0,0.1);
- Hudmessage(n:1;HUDMSG_PLAIN,0,CR_WHITE,600.0,500.0,0.1);
- if(PlayerInGame(1))
- {
- HudMessage(d:PLAYER_money[1];HUDMSG_PLAIN,0,CR_WHITE,680.0,480.0,0.1);
- HudMessage(n:2;HUDMSG_PLAIN,0,CR_WHITE,600.0,480.0,0.1);
- }
- if(PlayerInGame(2))
- {
- HudMessage(d:PLAYER_money[2];HUDMSG_PLAIN,0,CR_WHITE,680.0,460.0,0.1);
- HudMessage(n:3;HUDMSG_PLAIN,0,CR_WHITE,600.0,460.0,0.1);
- }
- if(PlayerInGame(3))
- {
- HudMessage(d:PLAYER_money[3];HUDMSG_PLAIN,0,CR_WHITE,680.0,440.0,0.1);
- HudMessage(n:4;HUDMSG_PLAIN,0,CR_WHITE,600.0,440.0,0.1);
- }
- }
- /*
- ** Health regeneration and the like.
- */
- if(TEMP_player_checktime>0) {TEMP_player_checktime-=1;}
- else
- {
- if(GAME_gameover==0)
- {
- SetActorProperty(0,APROP_HEALTH,GetActorProperty(0,APROP_HEALTH)+3);
- if(GetActorProperty(0,APROP_HEALTH)>100) {SetActorProperty(0,APROP_HEALTH,100);}
- TEMP_player_health=GetActorProperty(0,APROP_HEALTH);
- TEMP_player_checktime=35;
- if(TEMP_player_health>30 && TEMP_player_health<70)
- {
- if(random(0,2)==0) {ActivatorSound("playersnds/hurt",127);}
- ACS_ExecuteAlways(20,0,0,0,0);
- TEMP_player_checktime=25;
- }
- if(GetActorProperty(0,APROP_HEALTH)<30)
- {
- ActivatorSound("playersnds/injured",127);
- ACS_ExecuteAlways(20,0,1,0,0);
- TEMP_player_checktime=53;
- }
- }
- }
- If(CheckInventory("Kills")>=8){TEMP_player_killstreak-=1;}
- if(TEMP_player_killstreak<=0)
- {
- TakeInventory("Kills",999);
- TEMP_player_Killstreak=1;
- ActivatorSound(Random(" ","playersnds/kill"),127);
- }
- if((TEMP_player_input & BT_FORWARD) || (TEMP_player_input & BT_BACK) ||
- (TEMP_player_input & BT_MOVELEFT) || (TEMP_player_input & BT_MOVERIGHT)) {if(TEMP_player_input & BT_SPEED){TEMP_player_footsteptime-=1;}else{TEMP_player_footsteptime-=2;}}
- if(TEMP_player_footsteptime<=0)
- {
- if(CheckInventory("ColtZoomed")==1
- || CheckInventory("NambuZoomed")==1
- || CheckInventory("G43Zoomed")==1
- || CheckInventory("K98KZoomed")==1
- || CheckInventory("SpriZoomed")==1
- || CheckInventory("STGZoomed")==1
- || CheckInventory("MP40Zoomed"))
- {
- TEMP_player_footsteptime=32;
- }
- else
- {
- TEMP_player_footsteptime=24;
- }
- if(GetActorZ(0)<=GetActorFloorZ(0) && !PLAYER_downed[PlayerNumber()] && !PLAYER_dead[PlayerNumber()])
- {
- If(TEMP_player_input & BT_CROUCH)
- {
- TEMP_player_footsteptime=32;
- ActivatorSound("player/footstep",40);
- if(random(0,1)==0) {ActivatorSound("player/gear",40);}
- }
- else
- {
- ActivatorSound("player/footstep",80);
- if(random(0,1)==0) {ActivatorSound("player/gear",80);}
- }
- }
- }
- //WallItems and Mystery Box
- if(PLAYER_downed[PlayerNumber()]==0 && PLAYER_dead[PlayerNumber()]==0) //Disallows downed or dead players from activating anything
- {
- if(TEMP_for_mode==0)
- {
- for(int forA=0;forA<DEF_COUNT_WALLITEMS;forA++)
- {
- if(ThingCountSector(T_NONE,ActivatorTID(),BOX_tag)==1)
- {
- if(!DEBUG_enabled)
- {
- SetFont("SMALLFONT");
- SetHudSize(800,600,0);
- if(BOX_active==0) {HudMessage(s:"hold \cfUSE \c-for a random weapon [price: 950]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- else if(BOX_active==2 && BOX_activator==ActivatorTID())
- {
- HudMessage(s:"hold \cfUSE \c-to trade for ",s:BOX_itemnames[BOX_currentitem];HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);
- }
- }
- if(TEMP_player_input & BT_USE)
- {
- TEMP_player_buytime+=1;
- if(TEMP_player_buytime>10)
- {
- TEMP_player_buytime=0;
- ACS_ExecuteAlways(350,0,0,0,0);
- }
- }
- }
- if(ThingCountSector(T_NONE,ActivatorTID(),WALLITEM_tids[forA])==1)
- {
- if(!DEBUG_enabled)
- {
- SetFont("SMALLFONT");
- if(!(WALLITEM_actors[0][forA]=="GrenadeAmmo"
- || WALLITEM_actors[0][forA]=="N74STAmmo"
- || WALLITEM_actors[0][forA]=="MolotovAmmo"
- || WALLITEM_actors[0][forA]=="BouncingBettyAmmo"))
- {
- SetHudSize(800,600,0);
- if(CheckInventory(WALLITEM_actors[0][forA])) {HudMessage(s:"hold \cfUSE \c-to buy ammo [price: ",d:WALLITEM_prices[forA]/2,s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- else {HudMessage(s:"hold \cfUSE \c-to buy ",s:WALLITEM_names[forA],s:" [price: ",d:WALLITEM_prices[forA],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- }
- else
- {
- SetHudSize(800,600,0);
- if(WALLITEM_actors[0][forA]=="GrenadeAmmo") {HudMessage(s:"hold \cfUSE \c-to buy frag grenades [price: ",d:WALLITEM_prices[forA],s:"]";
- HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- else if(WALLITEM_actors[0][forA]=="N74STAmmo") {HudMessage(s:"hold \cfUSE \c-to buy sticky grenades [price: ",d:WALLITEM_prices[forA],s:"]";
- HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- else if(WALLITEM_actors[0][forA]=="MolotovAmmo") {HudMessage(s:"hold \cfUSE \c-to buy molotov cocktails [price: ",d:WALLITEM_prices[forA],s:"]";
- HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- else if(WALLITEM_actors[0][forA]=="BouncingBettyAmmo") {HudMessage(s:"hold \cfUSE \c-to buy bouncing betties [one-time buy] [price: ",d:WALLITEM_prices[forA],s:"]";
- HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- }
- }
- if(TEMP_player_input & BT_USE)
- {
- TEMP_player_buytime+=1;
- if(TEMP_player_buytime>10)
- {
- TEMP_player_buytime=0;
- if(!(WALLITEM_actors[0][forA]=="GrenadeAmmo"
- || WALLITEM_actors[0][forA]=="N74STAmmo"
- || WALLITEM_actors[0][forA]=="MolotovAmmo"
- || WALLITEM_actors[0][forA]=="BouncingBettyAmmo"))
- {
- if(CheckInventory(WALLITEM_actors[0][forA]))
- {
- if(PLAYER_money[PlayerNumber()]>=(WALLITEM_prices[forA]/2))
- {
- ACS_ExecuteAlways(502,0,5,0,0);
- ACS_ExecuteAlways(502,0,1,0,2);
- PLAYER_money[PlayerNumber()]-=WALLITEM_prices[forA]/2;
- ActivatorSound("game/PURCHASE",127);
- GiveInventory(WALLITEM_actors[0][forA],1);
- }
- }
- else
- {
- if(PLAYER_money[PlayerNumber()]>=WALLITEM_prices[forA])
- {
- ActivatorSound("game/PURCHASE",127);
- ACS_ExecuteAlways(502,0,10,0,0);
- ACS_ExecuteAlways(502,0,1,0,2);
- PLAYER_money[PlayerNumber()]-=WALLITEM_prices[forA];
- if(CheckInventory("WeaponsInInventory")<2)
- {
- GiveInventory(WALLITEM_actors[0][forA],1);
- SetWeapon(WALLITEM_actors[0][forA]);
- GiveInventory("WeaponsInInventory",1);
- }
- else
- {
- TakeInventory(ACS_ExecuteWithResult(450,0,0,0),1);
- GiveInventory(WALLITEM_actors[0][forA],1);
- SetWeapon(WALLITEM_actors[0][forA]);
- }
- }
- }
- }
- else
- {
- if(PLAYER_money[PlayerNumber()]>=WALLITEM_prices[forA])
- {
- if(!WALLITEM_actors[0][forA]=="BouncingBettyAmmo")
- {
- ActivatorSound("game/PURCHASE",127);
- ACS_ExecuteAlways(502,0,10,0,0);
- PLAYER_money[PlayerNumber()]-=WALLITEM_prices[forA];
- if(!WALLITEM_actors[0][forA]=="GrenadeAmmo")
- {
- GiveInventory(WALLITEM_actors[0][forA],4);
- }
- }
- else
- {
- if(!CheckInventory("SpecGrenade_BouncingBetty"))
- {
- ActivatorSound("game/PURCHASE",127);
- ACS_ExecuteAlways(502,0,10,0,0);
- PLAYER_money[PlayerNumber()]-=WALLITEM_prices[forA];
- TakeInventory("SpecGrenade_N74ST",1);
- TakeInventory("N74STAmmo",4);
- TakeInventory("SpecGrenade_Molotov",1);
- TakeInventory("MolotovAmmo",4);
- GiveInventory("SpecGrenade_BouncingBetty",1);
- GiveInventory(WALLITEM_actors[0][forA],2);
- }
- }
- }
- }
- }
- }
- }
- }
- //Doors
- TEMP_for_mode=1;
- }
- else if(TEMP_for_mode==1)
- {
- for(int forB=0;forB<DEF_COUNT_DOORS;forB++)
- {
- if(ThingCountSector(T_NONE,ActivatorTID(),DOOR_tids[forB])==1 && DOOR_opened[forB]==0)
- {
- if(!DEBUG_enabled)
- {
- SetFont("SMALLFONT");
- SetHudSize(800,600,0);
- //WhiteAce here, this should stop the hud from bugging out in mutliplayer, I hope
- if(DOOR_type[forB]==0) {HudMessage(s:"hold \cfUSE \c-to lower the gate [price: ",d:DOOR_prices[forB],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- else {HudMessage(s:"hold \cfUSE \c-to open the door [price: ",d:DOOR_prices[forB],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- }
- if(TEMP_player_input & BT_USE)
- {
- TEMP_player_buytime+=1;
- if(TEMP_player_buytime>10)
- {
- TEMP_player_buytime=0;
- if(PLAYER_money[PlayerNumber()]>=DOOR_prices[forB])
- {
- ACS_Execute(forB+DOOR_scriptno,0,0,0,0); // create your own scripts for handling how doors/debris is removed.
- ACS_ExecuteAlways(502,0,20,0,0);
- DOOR_opened[forB]=1;
- ROOM_opened[DOOR_roomid[forB][0]]=1;
- ROOM_opened[DOOR_roomid[forB][1]]=1;
- ROOM_opened[DOOR_roomid[forB][2]]=1;
- PLAYER_money[PlayerNumber()]-=DOOR_prices[forB];
- }
- }
- }
- }
- }
- //Barricades
- TEMP_for_mode=2;
- }
- else if(TEMP_for_mode==2)
- {
- for(int forC=0;forC<DEF_COUNT_BARRICADES;forC++)
- {
- if(ThingCountSector(T_NONE,ActivatorTID(),BARRICADE_sectorid[forC])==1 && BARRICADE_health[forC]<6)
- {
- SetFont("SMALLFONT");
- if(TEMP_player_input & BT_USE)
- {
- TEMP_player_buytime+=2;
- if(TEMP_player_buytime>4)
- {
- TEMP_player_buytime=0;
- If(BARRICADE_updatetime[forC]<1)
- {
- BARRICADE_updatetime[forC]=25;
- BARRICADE_health[forC]+=1;
- ACS_ExecuteAlways(667,0,10,0,0);
- ACS_ExecuteAlways(502,0,1,0,0);
- ACS_ExecuteAlways(502,0,1,0,4);
- ActivatorSound("game/barpnt",127);
- }
- }
- }
- else
- {
- if(!DEBUG_enabled)
- {
- SetHudSize(800,600,0);
- HudMessage(s:"hold \cfUSE \c-to rebuild barrier";
- HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);
- }
- }
- }
- }
- TEMP_for_mode=3; //Perks
- }
- else if(TEMP_for_mode==3)
- {
- for(int forD=0;forD<DEF_COUNT_PERKS;forD++)
- {
- if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && GAME_power==1 && CheckInventory(PERK_Inventory[forD])==0)
- {
- SetFont("SmallFont");
- SetHudSize(800,600,0);
- if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:"hold \cfUSE \c-to buy ",s:PERK_names[forD],s:" [price: ",d:PERK_prices[forD],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- if(TEMP_player_input & BT_USE)
- {
- TEMP_player_buytime+=1;
- if(TEMP_player_buytime>10)
- {
- TEMP_player_buytime=0;
- if(PLAYER_money[PlayerNumber()]>=PERK_prices[forD])
- {
- ActivatorSound("game/PURCHASE",127);
- ACS_ExecuteAlways(502,0,10,0,0);
- PLAYER_money[PlayerNumber()]-=PERK_prices[forD];
- GiveInventory(PERK_actors[forD],1);
- SetWeapon(PERK_actors[forD]);
- }
- }
- }
- }
- else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="Jugg" && GAME_power==0)
- {
- SetFont("SmallFont");
- SetHudSize(800,600,0);
- if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:" You must turn on the power first!";
- HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- }
- else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="SpdCola" && GAME_power==0)
- {
- SetFont("SmallFont");
- SetHudSize(800,600,0);
- if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:" You must turn on the power first!";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- }
- else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="DoubTap" && GAME_power==0)
- {
- SetFont("SmallFont");
- SetHudSize(800,600,0);
- if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:" You must turn on the power first!";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- }
- else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="StamUp" && GAME_power==0)
- {
- SetFont("SmallFont");
- SetHudSize(800,600,0);
- if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:" You must turn on the power first!";
- HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- }
- else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="Machete" && CheckInventory(PERK_Inventory[forD])==0)
- {
- SetFont("SmallFont");
- SetHudSize(800,600,0);
- if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:"hold \cfUSE \c-to buy ",s:PERK_names[forD],s:" [price: ",d:PERK_prices[forD],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- if(TEMP_player_input & BT_USE)
- {
- TEMP_player_buytime+=1;
- if(TEMP_player_buytime>10)
- {
- TEMP_player_buytime=0;
- if(PLAYER_money[PlayerNumber()]>=PERK_prices[forD])
- {
- ActivatorSound("game/PURCHASE",127);
- ACS_ExecuteAlways(502,0,10,0,0);
- PLAYER_money[PlayerNumber()]-=PERK_prices[forD];
- GiveInventory(PERK_actors[forD],1);
- SetWeapon(PERK_actors[forD]);
- }
- }
- }
- }
- else if(ThingCountSector(T_NONE,ActivatorTID(),PERK_tids[forD])==1 && PERK_actors[forD]=="QckRvve" && PlayerCount()==1 && CheckInventory(PERK_Inventory[forD])==0)
- {
- SetFont("SmallFont");
- SetHudSize(800,600,0);
- if(!CheckInventory(PERK_actors[forD])) {HudMessage(s:"hold \cfUSE \c-to buy ",s:PERK_names[forD],s:" [price: ",d:PERK_prices[forD],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- if(TEMP_player_input & BT_USE)
- {
- TEMP_player_buytime+=1;
- if(TEMP_player_buytime>10)
- {
- TEMP_player_buytime=0;
- if(PLAYER_money[PlayerNumber()]>=PERK_prices[forD])
- {
- ActivatorSound("game/PURCHASE",127);
- ACS_ExecuteAlways(502,0,10,0,0);
- PLAYER_money[PlayerNumber()]-=PERK_prices[forD];
- GiveInventory(PERK_actors[forD],1);
- SetWeapon(PERK_actors[forD]);
- }
- }
- }
- }
- }
- TEMP_for_mode=4; //Traps
- }
- else if(TEMP_for_mode==4)
- {
- for(int forE=0;forE<DEF_COUNT_TRAPS;forE++)
- {
- If(ThingCountSector(T_NONE,ActivatorTID(),TRAP_tids[forE])==1 && GAME_power==0)
- {
- if(!DEBUG_enabled)
- {
- SetFont("SMALLFONT");
- SetHudSize(800,600,0);
- if(TRAP_tids[forE]) {HudMessage(s:" You must turn on the power first!";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- }
- }
- Else if(ThingCountSector(T_NONE,ActivatorTID(),TRAP_tids[forE])==1 && GAME_power==1 && TRAP_active[forE]==0)
- {
- if(!DEBUG_enabled)
- {
- SetFont("SMALLFONT");
- SetHudSize(800,600,0);
- if(TRAP_type[forE]==0) {HudMessage(s:"hold \cfUSE \c-to activate lockdown [price: ",d:TRAP_prices[forE],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- else {HudMessage(s:"hold \cfUSE \c-to activate turrets [price: ",d:TRAP_prices[forE],s:"]";HUDMSG_FADEOUT,5,CR_WHITE,400.0,300.0,1.0,0.2);}
- }
- if(TEMP_player_input & BT_USE)
- {
- TEMP_player_buytime+=1;
- if(TEMP_player_buytime>10)
- {
- TEMP_player_buytime=0;
- if(PLAYER_money[PlayerNumber()]>=TRAP_prices[forE])
- {
- ACS_Execute(forE+TRAP_scriptno,0,0,0,0); // create your own scripts for activating traps
- TRAP_active[forE]=1;
- ActivatorSound("game/PURCHASE",127);
- PLAYER_money[PlayerNumber()]-=TRAP_prices[forE];
- }
- }
- }
- }
- }
- TEMP_for_mode=0;
- }
- }
- if(PlayerNumber()==0)
- {
- if(PlayerCount()>1) {DrawPlayerName(1001,768.0,2,768);}
- if(PlayerCount()>2) {DrawPlayerName(1002,768.0,3,769);}
- if(PlayerCount()>3) {DrawPlayerName(1003,768.0,4,770);}
- }
- else if(PlayerNumber()==1)
- {
- if(PlayerCount()>1) {DrawPlayerName(1000,768.0,1,768);}
- if(PlayerCount()>2) {DrawPlayerName(1002,768.0,3,769);}
- if(PlayerCount()>3) {DrawPlayerName(1003,768.0,4,770);}
- }
- else if(PlayerNumber()==2)
- {
- if(PlayerCount()>1) {DrawPlayerName(1000,768.0,1,768);}
- if(PlayerCount()>2) {DrawPlayerName(1001,768.0,2,769);}
- if(PlayerCount()>3) {DrawPlayerName(1003,768.0,4,770);}
- }
- else if(PlayerNumber()==3)
- {
- if(PlayerCount()>1) {DrawPlayerName(1000,768.0,1,768);}
- if(PlayerCount()>2) {DrawPlayerName(1001,768.0,2,769);}
- if(PlayerCount()>3) {DrawPlayerName(1002,768.0,3,770);}
- }
- Delay(1);
- }
- }
- SCRIPT 5 (int ID) DISCONNECT { if(!GAME_round_number==1 && !GAME_round_mins<1) {PLAYER_dead[PlayerNumber()]=1;} PLAYER_downed[PlayerNumber()]=0; }
- SCRIPT 10 (void)
- {
- int x;
- int y;
- x=0.0;
- y=0.0;
- SetLineBlocking(80,BLOCKF_PLAYERS);
- SetLineBlocking(120,BLOCKF_MONSTERS);
- Thing_Deactivate(2);
- Thing_Activate(6);
- if(GameSkill()==4)
- {
- }
- SetPlayerProperty(1,1,PROP_TOTALLYFROZEN);
- SetMusic("",0);
- FadeTo(0.0,0.0,0.0,1.0,0.1);
- delay(35);
- if(GameSkill()<4)
- {
- AmbientSound("game/HORDE",127);
- SetMusic("music/HOR2",0);}
- else
- {
- SetMusic("music/HORI1",0);
- }
- FadeTo(0.0,0.0,0.0,0.0,2.0);
- delay(35*1);
- SetFont("CONFONT");
- HudMessage(s:GAME_startuptext[0];HUDMSG_FADEINOUT,0,CR_WHITE,0.05,0.5,6.0,3.0,1.0);
- HudMessage(s:GAME_startuptext[1];HUDMSG_FADEINOUT,0,CR_WHITE,0.05,0.55,6.0,4.0,1.0);
- HudMessage(s:GAME_startuptext[2];HUDMSG_FADEINOUT,0,CR_WHITE,0.05,0.6,6.0,5.0,1.0);
- HudMessage(s:GAME_startuptext[3];HUDMSG_FADEINOUT,0,CR_WHITE,0.05,0.65,6.0,6.0,1.0);
- AmbientSound(GAME_round_startsound,127);
- SetPlayerProperty(1,0,PROP_TOTALLYFROZEN);
- SetPlayerProperty(1,0,PROP_FROZEN);
- SetFont("BIGFONT");
- if(GameSkill()<4)
- {
- HudMessage(s:"round";HUDMSG_FADEOUT,0,CR_WHITE,1.5,0.4,3.0,1.0);
- SetHudSize(320,240,0);
- HudMessage(s:"1";HUDMSG_PLAIN,0,CR_RED,160.0,120.0,3.0);
- delay(35*3);
- while(x<196.0)
- {
- SetFont("BIGFONT");
- SetHudSize(320,240,0);
- HudMessage(s:"1";HUDMSG_PLAIN,1,CR_RED,160.0-x,120.0+y,0.1);
- x+=4.0;
- y+=3.0;
- delay(1);
- }
- }
- else
- {
- SetHudSize(320,240,0);
- HudMessage(d:GAME_round_mins,s:":",d:GAME_round_secs;HUDMSG_PLAIN,0,CR_RED,160.0,120.0,3.0);
- delay(35*3);
- while(x<196.0)
- {
- SetFont("BIGFONT");
- SetHudSize(320,240,0);
- HudMessage(d:GAME_round_mins,s:":",d:GAME_round_secs;HUDMSG_PLAIN,1,CR_RED,160.0-x,120.0+y,0.1);
- x+=4.0;
- y+=3.0;
- delay(1);
- }
- }
- }
- SCRIPT 11 (void)
- {
- if(GAME_round_doground)
- {
- AmbientSound("game/DOGEND",127);
- GAME_round_doground=0;
- }
- else
- {
- AmbientSound(GAME_round_endsound,127);
- GAME_round_untildogs-=1;
- }
- delay(DEF_round_intermission);
- if(GAME_randomNumber==1)
- {
- if(GAME_Round_dogs==4)
- {
- GAME_round_doground=1;
- AmbientSound("game/DOGROUND",127);
- delay(35*4);
- AmbientSound("game/DOGSOULS",127);
- GAME_round_dogs=0;
- GAME_randomNumber=Random(1,2);
- }
- }
- Else if(GAME_randomNumber==2)
- {
- if(GAME_Round_dogs==5)
- {
- GAME_round_doground=1;
- AmbientSound("game/DOGROUND",127);
- delay(35*4);
- AmbientSound("game/DOGSOULS",127);
- GAME_round_dogs=0;
- GAME_randomNumber=Random(1,2);
- }
- }
- else { AmbientSound(GAME_round_startsound,127); }
- AmbientSound(GAME_round_startsound,127);
- GAME_round_number+=1;
- GAME_round_dogs+=1;
- GAME_round_zombiescount+=random(DEF_zombies_increaseamount*PlayerCount(),(DEF_zombies_increaseamount*2)*PlayerCount());
- GAME_round_dogscount+=random(DEF_dogs_increaseamount*PlayerCount(),(DEF_dogs_increaseamount*2)*PlayerCount());
- if(GAME_round_doground) { GAME_round_zombiesleft=GAME_round_dogscount; }
- else { GAME_round_zombiesleft=GAME_round_zombiescount; }
- for(int FOR11_a=0;FOR11_a<4;FOR11_a++)
- {
- GiveActorInventory(1000+FOR11_a,"GrenadeAmmo",2);
- if(CheckActorInventory(1000+FOR11_a,"SpecGrenade_N74ST")) { GiveActorInventory(1000+FOR11_a,"N74STAmmo",2); }
- if(CheckActorInventory(1000+FOR11_a,"SpecGrenade_Molotov")) { GiveActorInventory(1000+FOR11_a,"MolotovAmmo",2); }
- if(CheckActorInventory(1000+FOR11_a,"SpecGrenade_BouncingBetty")) { GiveActorInventory(1000+FOR11_a,"BouncingBettyAmmo",2); }
- }
- if(!GAME_round_doground)
- {
- SetHudSize(320,240,0);
- SetFont("SMALLFONT");
- HudMessage(s:"round";HUDMSG_FADEINOUT,0,CR_WHITE,160.0,116.2,5.0,1.0,1.0);
- SetFont("BIGFONT");
- HudMessage(d:GAME_round_number;HUDMSG_FADEINOUT,0,CR_RED,160.0,120.1,5.0,1.0,1.0);
- SetHudSize(0,0,0);
- }
- delay(35);
- for(int F11_dead=0;F11_dead<4;F11_dead++)
- {
- if(ClassifyActor(1000+F11_dead)==ACTOR_DEAD) {PLAYER_dead[F11_dead]=1;}
- }
- }
- SCRIPT 12 (void)
- {
- while(true)
- {
- for(int FOR12_a=0;FOR12_a<DEF_COUNT_BARRICADES;FOR12_a++)
- {
- if(BARRICADE_health[FOR12_a]==6) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[0]);
- SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[0]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
- else if(BARRICADE_health[FOR12_a]==5) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[1]);
- SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[1]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
- else if(BARRICADE_health[FOR12_a]==4) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[2]);
- SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[2]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
- else if(BARRICADE_health[FOR12_a]==3) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[3]);
- SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[3]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
- else if(BARRICADE_health[FOR12_a]==2) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[4]);
- SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[4]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
- else if(BARRICADE_health[FOR12_a]==1) {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[5]);
- SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[5]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_CREATURES,BLOCKF_PLAYERS);}
- else {SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_FRONT,TEXTURE_MIDDLE,BARRICADE_texture[6]);
- SetLineTexture((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],SIDE_BACK,TEXTURE_MIDDLE,BARRICADE_texture[6]);Line_SetBlocking((BARRICADE_lineid[FOR12_a]*256)+BARRICADE_lineid[FOR12_a],BLOCKF_PLAYERS,BLOCKF_CREATURES);}
- if(BARRICADE_updatetime[FOR12_a]>0) {BARRICADE_updatetime[FOR12_a]-=1;}
- }
- delay(1);
- }
- }
- SCRIPT 20 (int mode)
- {
- if(mode==0)
- {
- FadeTo(255,55,55,0.2,0.1);
- delay(4);
- FadeTo(0.0,0.0,0.0,0.0,0.8);
- }
- else
- {
- FadeTo(255,55,55,0.5,0.1);
- delay(4);
- FadeTo(0.0,0.0,0.0,0.0,2.0);
- }
- }
- SCRIPT 50 (int mode)
- {
- if(mode==2 && !(ClassifyActor(0) & ACTOR_DEAD))
- {
- delay(35*20);
- SetActorState(0,"CheckTarget",1);
- }
- else if(mode==3)
- {
- GAME_round_zombiesleft+=1;
- Thing_Remove(0);
- }
- else
- {
- for(int FOR50_a=0;FOR50_a<DEF_COUNT_BARRICADES;FOR50_a++)
- {
- if(ThingCountSector(T_NONE,ActivatorTID(),BARRICADE_attackid[FOR50_a])==1)
- {
- if(mode==0 && BARRICADE_health[FOR50_a]>0)
- {
- SetActorState(ActivatorTID(),"AtBarricade",1);
- }
- else
- {
- if(BARRICADE_health[FOR50_a]<1)
- {
- SetActorState(ActivatorTID(),"See",1);
- }
- else
- {
- BARRICADE_health[FOR50_a]-=1;
- ActivatorSound("game/barhit",127);
- }
- }
- }
- }
- }
- }
- Script 200 (Void)
- {
- ActivatorSound("game/DOOR",127);
- Floor_LowerByValue(200,16,152);
- }
- Script 201 (Void)
- {
- ActivatorSound("game/DOOR",127);
- PolyObj_RotateLeft(1,8,64);
- }
- Script 202 (Void)
- {
- ActivatorSound("game/DOOR",127);
- Polyobj_Move(2,16,192,64);
- }
- Script 203 (Void)
- {
- ActivatorSound("game/DOOR",127);
- Polyobj_Move(2,16,192,64);
- }
- script 230 (VOID)
- {
- if(GAME_musicenabled<3) //If there is more than 3 lines, script won't do anything
- {
- GAME_musicenabled = GAME_musicenabled + 1; //Add 1 everytime script 230 is activated
- ActivatorSound("game/MeteorAffirm",127); //Probably know what this is
- }
- if(GAME_musicenabled==3) {SoundSequence(GAME_songname);}//If variable reaches 3, plays the string variable if defined in soundsequence
- }
- Script 232 (void)
- {
- GAME_Power=1;
- }
- Script 246 OPEN //Gameover script
- {
- While(True)
- {
- if(GAME_round_doground==1 && GAME_round_dogscount<=2)
- {
- }
- if(!PlayerCount()==0)
- {
- if(!PlayerInGame(0)) {PLAYER_dead[0]=1;}
- if(!PlayerInGame(1)) {PLAYER_dead[1]=1;}
- if(!PlayerInGame(2)) {PLAYER_dead[2]=1;}
- if(!PlayerInGame(3)) {PLAYER_dead[3]=1;}
- }
- else {PLAYER_dead[0]=0; PLAYER_dead[1]=0; PLAYER_dead[2]=0; PLAYER_dead[3]=0;}
- if((PLAYER_dead[0]==1)
- && (PLAYER_dead[1]==1)
- && (PLAYER_dead[2]==1)
- && (PLAYER_dead[3]==1))
- {
- GAME_gameover=1;
- Delay(35*1);
- SetHudSize(320,240,0);
- SetMusic("",0);
- Delay(35*1);
- AmbientSound("game/GAMEOVER",127);
- Thing_Activate(28);
- ChangeCamera(28,1,0);
- SetHudSize(320,240,0);
- SetFont("SMALLFONT");
- If(GameSkill()>=4)
- {HudMessage(s:"game over";HUDMSG_FADEINOUT,0,CR_RED,160.0,24.1,27.0,1.0,1.0);
- HudMessage(s:"you survived \cj",d:GAME_round_mins,s:":",d:GAME_round_secs;
- HUDMSG_FADEINOUT,0,CR_RED,160.0,34.1,27.0,1.0,1.0);}
- Else
- {HudMessage(s:"game over";HUDMSG_FADEINOUT,0,CR_RED,160.0,24.1,27.0,1.0,1.0);
- if(GAME_round_number==1)
- {HudMessage(s:"you survived \cj",d:GAME_round_number,s:"\c- round";
- HUDMSG_FADEINOUT,0,CR_RED,160.0,34.1,27.0,1.0,1.0);}
- else
- {HudMessage(s:"you survived \cj",d:GAME_round_number,s:"\c- rounds";
- HUDMSG_FADEINOUT,0,CR_RED,160.0,34.1,27.0,1.0,1.0);}}
- HudMessage(s:"name";HUDMSG_FADEINOUT,0,CR_WHITE,32.1,48.1,27.0,1.0,1.0);
- HudMessage(s:"points";HUDMSG_FADEINOUT,0,CR_WHITE,136.1,48.1,27.0,1.0,1.0);
- HudMessage(s:"kills";HUDMSG_FADEINOUT,0,CR_WHITE,240.1,48.1,27.0,1.0,1.0);
- if(PlayerCount()>0) {HudMessage(n:1;HUDMSG_FADEINOUT,0,CR_WHITE,32.1,63.1,27.0,1.0,1.0);
- HudMessage(d:CheckActorInventory(1000,"Killcount");HUDMSG_FADEINOUT,0,CR_WHITE,240.1,63.1,27.0,1.0,1.0);
- HudMessage(d:CheckActorInventory(1000,"Points");HUDMSG_FADEINOUT,0,CR_WHITE,136.1,63.1,27.0,1.0,1.0);}
- if(PlayerCount()>1) {HudMessage(n:2;HUDMSG_FADEINOUT,0,CR_WHITE,32.1,78.1,27.0,1.0,1.0);
- HudMessage(d:CheckActorInventory(1001,"Killcount");HUDMSG_FADEINOUT,0,CR_WHITE,240.1,78.1,27.0,1.0,1.0);
- HudMessage(d:CheckActorInventory(1001,"Points");HUDMSG_FADEINOUT,0,CR_WHITE,136.1,78.1,27.0,1.0,1.0);}
- if(PlayerCount()>2) {HudMessage(n:3;HUDMSG_FADEINOUT,0,CR_WHITE,32.1,93.1,27.0,1.0,1.0);
- HudMessage(d:CheckActorInventory(1002,"Killcount");HUDMSG_FADEINOUT,0,CR_WHITE,240.1,93.1,27.0,1.0,1.0);
- HudMessage(d:CheckActorInventory(1002,"Points");HUDMSG_FADEINOUT,0,CR_WHITE,136.1,93.1,27.0,1.0,1.0);}
- if(PlayerCount()>3) {HudMessage(n:4;HUDMSG_FADEINOUT,0,CR_WHITE,32.1,108.1,27.0,1.0,1.0);
- HudMessage(d:CheckActorInventory(1003,"Killcount");HUDMSG_FADEINOUT,0,CR_WHITE,240.1,108.1,27.0,1.0,1.0);
- HudMessage(d:CheckActorInventory(1003,"Points");HUDMSG_FADEINOUT,0,CR_WHITE,136.1,108.1,27.0,1.0,1.0);}
- SetHudSize(0,0,0);
- delay(35*30);
- ChangeLevel("MAP04", 0, CHANGELEVEL_NOINTERMISSION, -1);
- }
- Delay(1);
- }
- }
- SCRIPT 270 (void) {Thing_Remove(0);}
- SCRIPT 350 (void) //Actual Mystery box script
- {
- if(BOX_active==0 && PLAYER_money[PlayerNumber()]>949)
- {
- int X350;
- X350=0;
- BOX_active=1;
- BOX_activator=ActivatorTID();
- BOX_itemtaken=0;
- ACS_ExecuteAlways(502,0,1,BOX_activator,1);
- PLAYER_money[PlayerNumber()]-=950;
- ACS_ExecuteAlways(502,0,5,0,0);
- Floor_LowerByValue(26,8,12);
- Ceiling_LowerByValue(26,8,12);
- delay(20);
- SetActivator(BOX_weaponstid);
- ActivatorSound(BOX_spinsound,127);
- while(X350<48)
- {
- Thing_Remove(196);
- BOX_currentitem=random(0,DEF_COUNT_BOXITEMS);
- SpawnSpotForced(BOX_items[BOX_currentitem],BOX_weaponstid,196,0);
- X350+=1;
- delay(4);
- }
- X350=0;
- BOX_active=2;
- while(BOX_itemtaken==0 && X350<(35*6))
- {
- X350+=1;
- delay(1);
- }
- BOX_active=1;
- BOX_itemtaken=0;
- BOX_currentitem=0;
- Thing_Remove(196);
- Floor_RaiseByValue(26,8,12);
- Ceiling_RaiseByValue(26,8,12);
- delay(35);
- BOX_active=0;
- }
- if(BOX_active==2)
- {
- if(BOX_activator==ActivatorTID())
- {
- ActivatorSound("game/PURCHASE",127);
- ACS_ExecuteAlways(502,0,10,0,0);
- BOX_itemtaken=1;
- if(CheckInventory(BOX_items[BOX_currentitem])) {GiveInventory(BOX_items[BOX_currentitem],1);}
- else
- {
- if(CheckInventory("WeaponsInInventory")<2)
- {
- GiveInventory(BOX_items[BOX_currentitem],1);
- GiveInventory("WeaponsInInventory",1);
- SetWeapon(BOX_items[BOX_currentitem]);
- }
- else
- {
- TakeInventory(ACS_ExecuteWithResult(450,0,0,0),1);
- GiveInventory(BOX_items[BOX_currentitem],1);
- SetWeapon(BOX_items[BOX_currentitem]);
- }
- }
- }
- }
- }
- function void DrawPlayerName(int tid, int range, int playerid, int id)
- {
- int dist, ang, vang, pitch, x, y;
- int HUDX = 1024;
- int HUDY = 768;
- int offset = 0;
- SetFont("BIGFONT");
- offset = 0.1;
- sethudsize(HUDX, HUDY, 1);
- x = getactorx(tid) - getactorx(0);
- y = getactory(tid) - getactory(0);
- vang = vectorangle(x,y);
- ang = (vang - GetActorAngle(0) + 1.0) % 1.0;
- if(((vang+0.125)%0.5) > 0.25) dist = fixeddiv(y, sin(vang));
- else dist = fixeddiv(x, cos(vang));
- if ((ang < 0.2 || ang > 0.8) && dist < range)
- {
- pitch = vectorangle(dist, getactorz(tid) - (getactorz(0) + 41.0));
- pitch = (pitch + GetActorPitch(0) + 1.0) % 1.0;
- x = HUDX/2 - ((HUDX/2) * sin(ang) / cos(ang));
- y = HUDY/2 - ((HUDX/2) * sin(pitch) / cos(pitch));
- hudmessage(n:playerid; HUDMSG_PLAIN, id, CR_UNTRANSLATED, (x<<16)+0.1, (y<<16)+offset, 0);
- }
- else
- hudmessage(s:" "; HUDMSG_PLAIN, id, CR_UNTRANSLATED, 0, 0, 0);
- }
- function int fdistance (int tid1, int tid2)
- {
- int len;
- int y = getactory(tid1) - getactory(tid2);
- int x = getactorx(tid1) - getactorx(tid2);
- int z = getactorz(tid1) - getactorz(tid2);
- int ang = vectorangle(x,y);
- if(((ang+0.125)%0.5) > 0.25) len = fixeddiv(y, sin(ang));
- else len = fixeddiv(x, cos(ang));
- ang = vectorangle(len, z);
- if(((ang+0.125)%0.5) > 0.25) len = fixeddiv(z, sin(ang));
- else len = fixeddiv(len, cos(ang));
- return len;
- }
- SCRIPT 450 (void)
- {
- if(CheckWeapon("Colt45")) {SetResultValue("Colt45");}
- else if(CheckWeapon("357Magnum")) {SetResultValue("357Magnum");}
- else if(CheckWeapon("M1A1Carbine")) {SetResultValue("M1A1Carbine");}
- else if(CheckWeapon("M1Garand")) {SetResultValue("M1Garand");}
- else if(CheckWeapon("Kar98k")) {SetResultValue("Kar98k");}
- else if(CheckWeapon("Springfield")) {SetResultValue("Springfield");}
- else if(CheckWeapon("Thompson")) {SetResultValue("Thompson");}
- else if(CheckWeapon("MP40")) {SetResultValue("MP40");}
- else if(CheckWeapon("STG-44")) {SetResultValue("STG-44");}
- else if(CheckWeapon("TrenchGun")) {SetResultValue("TrenchGun");}
- else if(CheckWeapon("DoubleBarrel")) {SetResultValue("DoubleBarrel");}
- else if(CheckWeapon("SawnOffShotgun")) {SetResultValue("SawnOffShotgun");}
- else if(CheckWeapon("BAR")) {SetResultValue("BAR");}
- else if(CheckWeapon("BrowningM1919")) {SetResultValue("BrowningM1919");}
- else if(CheckWeapon("Panzerschreck")) {SetResultValue("Panzerschreck");}
- else if(CheckWeapon("M2Flamethrower")) {SetResultValue("M2Flamethrower");}
- else if(CheckWeapon("FG42")) {SetResultValue("FG42");}
- else if(CheckWeapon("Gewehr43")) {SetResultValue("Gewehr43");}
- else if(CheckWeapon("PPSh41")) {SetResultValue("PPSh41");}
- else if(CheckWeapon("DP-28")) {SetResultValue("DP-28");}
- else if(CheckWeapon("MG42")) {SetResultValue("MG42");}
- else if(CheckWeapon("Dualcolt45s")) {SetResultValue("Dualcolt45s");}
- else if(CheckWeapon("Luger")) {SetResultValue("Luger");}
- else if(Checkweapon("Thundergun")) {SetResultValue("Thundergun");}
- else if(Checkweapon("Nailgun")) {SetResultValue("Nailgun");}
- else if(Checkweapon("Raygun")) {SetResultValue("Raygun");}
- else if(Checkweapon("Glock18")) {SetResultValue("Glock18");}
- else if(checkweapon("Sterlingl2a3")) {setResultValue("Sterlingl2a3");}
- else if(Checkweapon("Nambu")) {SetResultValue("Nambu");}
- else if(Checkweapon("SpringfieldScoped")) {SetResultValue("SpringfieldScoped");}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement