home *** CD-ROM | disk | FTP | other *** search
/ Spel 4 / Spel4.iso / add-on / quake / utility / dm_stats / source / world.qc < prev   
Encoding:
Text File  |  1996-09-09  |  12.1 KB  |  438 lines

  1.  
  2. void() InitBodyQue;
  3.  
  4.  
  5. void() main =
  6. {
  7.     dprint ("main function\n");
  8.     
  9. // these are just commands the the prog compiler to copy these files
  10.  
  11.     precache_file ("progs.dat");
  12.     precache_file ("gfx.wad");
  13.     precache_file ("quake.rc");
  14.     precache_file ("default.cfg");
  15.  
  16.     precache_file ("end1.bin");
  17.     precache_file2 ("end2.bin");
  18.  
  19.     precache_file ("demo1.dem");
  20.     precache_file ("demo2.dem");
  21.     precache_file ("demo3.dem");
  22.  
  23. //
  24. // these are all of the lumps from the cached.ls files
  25. //
  26.     precache_file ("gfx/palette.lmp");
  27.     precache_file ("gfx/colormap.lmp");
  28.  
  29.     precache_file2 ("gfx/pop.lmp");
  30.  
  31.     precache_file ("gfx/complete.lmp");
  32.     precache_file ("gfx/inter.lmp");
  33.  
  34.     precache_file ("gfx/ranking.lmp");
  35.     precache_file ("gfx/vidmodes.lmp");
  36.     precache_file ("gfx/finale.lmp");
  37.     precache_file ("gfx/conback.lmp");
  38.     precache_file ("gfx/qplaque.lmp");
  39.  
  40.     precache_file ("gfx/menudot1.lmp");
  41.     precache_file ("gfx/menudot2.lmp");
  42.     precache_file ("gfx/menudot3.lmp");
  43.     precache_file ("gfx/menudot4.lmp");
  44.     precache_file ("gfx/menudot5.lmp");
  45.     precache_file ("gfx/menudot6.lmp");
  46.  
  47.     precache_file ("gfx/menuplyr.lmp");
  48.     precache_file ("gfx/bigbox.lmp");
  49.     precache_file ("gfx/dim_modm.lmp");
  50.     precache_file ("gfx/dim_drct.lmp");
  51.     precache_file ("gfx/dim_ipx.lmp");
  52.     precache_file ("gfx/dim_tcp.lmp");
  53.     precache_file ("gfx/dim_mult.lmp");
  54.     precache_file ("gfx/mainmenu.lmp");
  55.     
  56.     precache_file ("gfx/box_tl.lmp");
  57.     precache_file ("gfx/box_tm.lmp");
  58.     precache_file ("gfx/box_tr.lmp");
  59.     
  60.     precache_file ("gfx/box_ml.lmp");
  61.     precache_file ("gfx/box_mm.lmp");
  62.     precache_file ("gfx/box_mm2.lmp");
  63.     precache_file ("gfx/box_mr.lmp");
  64.     
  65.     precache_file ("gfx/box_bl.lmp");
  66.     precache_file ("gfx/box_bm.lmp");
  67.     precache_file ("gfx/box_br.lmp");
  68.     
  69.     precache_file ("gfx/sp_menu.lmp");
  70.     precache_file ("gfx/ttl_sgl.lmp");
  71.     precache_file ("gfx/ttl_main.lmp");
  72.     precache_file ("gfx/ttl_cstm.lmp");
  73.     
  74.     precache_file ("gfx/mp_menu.lmp");
  75.     
  76.     precache_file ("gfx/netmen1.lmp");
  77.     precache_file ("gfx/netmen2.lmp");
  78.     precache_file ("gfx/netmen3.lmp");
  79.     precache_file ("gfx/netmen4.lmp");
  80.     precache_file ("gfx/netmen5.lmp");
  81.     
  82.     precache_file ("gfx/sell.lmp");
  83.     
  84.     precache_file ("gfx/help0.lmp");
  85.     precache_file ("gfx/help1.lmp");
  86.     precache_file ("gfx/help2.lmp");
  87.     precache_file ("gfx/help3.lmp");
  88.     precache_file ("gfx/help4.lmp");
  89.     precache_file ("gfx/help5.lmp");
  90.  
  91.     precache_file ("gfx/pause.lmp");
  92.     precache_file ("gfx/loading.lmp");
  93.  
  94.     precache_file ("gfx/p_option.lmp");
  95.     precache_file ("gfx/p_load.lmp");
  96.     precache_file ("gfx/p_save.lmp");
  97.     precache_file ("gfx/p_multi.lmp");
  98.  
  99. // sounds loaded by C code
  100.     precache_sound ("misc/menu1.wav");
  101.     precache_sound ("misc/menu2.wav");
  102.     precache_sound ("misc/menu3.wav");
  103.  
  104.     precache_sound ("ambience/water1.wav");
  105.     precache_sound ("ambience/wind2.wav");
  106.  
  107. // shareware
  108.     precache_file ("maps/start.bsp");
  109.  
  110.     precache_file ("maps/e1m1.bsp");
  111.     precache_file ("maps/e1m2.bsp");
  112.     precache_file ("maps/e1m3.bsp");
  113.     precache_file ("maps/e1m4.bsp");
  114.     precache_file ("maps/e1m5.bsp");
  115.     precache_file ("maps/e1m6.bsp");
  116.     precache_file ("maps/e1m7.bsp");
  117.     precache_file ("maps/e1m8.bsp");
  118.  
  119. // registered
  120.     precache_file2 ("gfx/pop.lmp");
  121.  
  122.     precache_file2 ("maps/e2m1.bsp");
  123.     precache_file2 ("maps/e2m2.bsp");
  124.     precache_file2 ("maps/e2m3.bsp");
  125.     precache_file2 ("maps/e2m4.bsp");
  126.     precache_file2 ("maps/e2m5.bsp");
  127.     precache_file2 ("maps/e2m6.bsp");
  128.     precache_file2 ("maps/e2m7.bsp");
  129.  
  130.     precache_file2 ("maps/e3m1.bsp");
  131.     precache_file2 ("maps/e3m2.bsp");
  132.     precache_file2 ("maps/e3m3.bsp");
  133.     precache_file2 ("maps/e3m4.bsp");
  134.     precache_file2 ("maps/e3m5.bsp");
  135.     precache_file2 ("maps/e3m6.bsp");
  136.     precache_file2 ("maps/e3m7.bsp");
  137.  
  138.     precache_file2 ("maps/e4m1.bsp");
  139.     precache_file2 ("maps/e4m2.bsp");
  140.     precache_file2 ("maps/e4m3.bsp");
  141.     precache_file2 ("maps/e4m4.bsp");
  142.     precache_file2 ("maps/e4m5.bsp");
  143.     precache_file2 ("maps/e4m6.bsp");
  144.     precache_file2 ("maps/e4m7.bsp");
  145.     precache_file2 ("maps/e4m8.bsp");
  146.  
  147.     precache_file2 ("maps/end.bsp");
  148.  
  149.     precache_file2 ("maps/dm1.bsp");
  150.     precache_file2 ("maps/dm2.bsp");
  151.     precache_file2 ("maps/dm3.bsp");
  152.     precache_file2 ("maps/dm4.bsp");
  153.     precache_file2 ("maps/dm5.bsp");
  154.     precache_file2 ("maps/dm6.bsp");
  155.  
  156. // Initialize dm_stats variables
  157.  
  158.     self.self_frags=0;
  159.     self.player1_frags=0;
  160.     self.player2_frags=0;
  161.     self.player3_frags=0;
  162.     self.player4_frags=0;
  163.     self.player5_frags=0;
  164.     self.player6_frags=0;
  165.     self.player7_frags=0;
  166.     self.player8_frags=0;
  167.     self.player9_frags=0;
  168.     self.player10_frags=0;
  169.     self.player11_frags=0;
  170.     self.player12_frags=0;
  171.     self.player13_frags=0;
  172.     self.player14_frags=0;
  173.     self.player15_frags=0;
  174.     self.player16_frags=0;
  175.     self.player_number=0;
  176.     
  177.     p1_exists = FALSE;
  178.     p2_exists = FALSE;
  179.     p3_exists = FALSE;
  180.     p4_exists = FALSE;
  181.     p5_exists = FALSE;
  182.     p6_exists = FALSE;
  183.     p7_exists = FALSE;
  184.     p8_exists = FALSE;
  185.     p9_exists = FALSE;
  186.     p10_exists = FALSE;
  187.     p11_exists = FALSE;
  188.     p12_exists = FALSE;
  189.     p13_exists = FALSE;
  190.     p14_exists = FALSE;
  191.     p15_exists = FALSE; 
  192.     p16_exists = FALSE;
  193.  
  194. };
  195.  
  196.  
  197. entity    lastspawn;
  198.  
  199. //=======================
  200. /*QUAKED worldspawn (0 0 0) ?
  201. Only used for the world entity.
  202. Set message to the level name.
  203. Set sounds to the cd track to play.
  204.  
  205. World Types:
  206. 0: medieval
  207. 1: metal
  208. 2: base
  209. */
  210. //=======================
  211. void() worldspawn =
  212. {
  213.     lastspawn = world;
  214.     InitBodyQue ();
  215.  
  216. // custom map attributes
  217.     if (self.model == "maps/e1m8.bsp")
  218.         cvar_set ("sv_gravity", "100");
  219.     else
  220.         cvar_set ("sv_gravity", "800");
  221.  
  222. // the area based ambient sounds MUST be the first precache_sounds
  223.  
  224. // player precaches    
  225.     W_Precache ();            // get weapon precaches
  226.  
  227. // sounds used from C physics code
  228.     precache_sound ("demon/dland2.wav");        // landing thud
  229.     precache_sound ("misc/h2ohit1.wav");        // landing splash
  230.  
  231. // setup precaches allways needed
  232.     precache_sound ("items/itembk2.wav");        // item respawn sound
  233.     precache_sound ("player/plyrjmp8.wav");        // player jump
  234.     precache_sound ("player/land.wav");            // player landing
  235.     precache_sound ("player/land2.wav");        // player hurt landing
  236.     precache_sound ("player/drown1.wav");        // drowning pain
  237.     precache_sound ("player/drown2.wav");        // drowning pain
  238.     precache_sound ("player/gasp1.wav");        // gasping for air
  239.     precache_sound ("player/gasp2.wav");        // taking breath
  240.     precache_sound ("player/h2odeath.wav");        // drowning death
  241.  
  242.     precache_sound ("misc/talk.wav");            // talk
  243.     precache_sound ("player/teledth1.wav");        // telefrag
  244.     precache_sound ("misc/r_tele1.wav");        // teleport sounds
  245.     precache_sound ("misc/r_tele2.wav");
  246.     precache_sound ("misc/r_tele3.wav");
  247.     precache_sound ("misc/r_tele4.wav");
  248.     precache_sound ("misc/r_tele5.wav");
  249.     precache_sound ("weapons/lock4.wav");        // ammo pick up
  250.     precache_sound ("weapons/pkup.wav");        // weapon up
  251.     precache_sound ("items/armor1.wav");        // armor up
  252.     precache_sound ("weapons/lhit.wav");        //lightning
  253.     precache_sound ("weapons/lstart.wav");        //lightning start
  254.     precache_sound ("items/damage3.wav");
  255.  
  256.     precache_sound ("misc/power.wav");            //lightning for boss
  257.  
  258. // player gib sounds
  259.     precache_sound ("player/gib.wav");            // player gib sound
  260.     precache_sound ("player/udeath.wav");        // player gib sound
  261.     precache_sound ("player/tornoff2.wav");        // gib sound
  262.  
  263. // player pain sounds
  264.  
  265.     precache_sound ("player/pain1.wav");
  266.     precache_sound ("player/pain2.wav");
  267.     precache_sound ("player/pain3.wav");
  268.     precache_sound ("player/pain4.wav");
  269.     precache_sound ("player/pain5.wav");
  270.     precache_sound ("player/pain6.wav");
  271.  
  272. // player death sounds
  273.     precache_sound ("player/death1.wav");
  274.     precache_sound ("player/death2.wav");
  275.     precache_sound ("player/death3.wav");
  276.     precache_sound ("player/death4.wav");
  277.     precache_sound ("player/death5.wav");
  278.  
  279. // ax sounds    
  280.     precache_sound ("weapons/ax1.wav");            // ax swoosh
  281.     precache_sound ("player/axhit1.wav");        // ax hit meat
  282.     precache_sound ("player/axhit2.wav");        // ax hit world
  283.  
  284.     precache_sound ("player/h2ojump.wav");        // player jumping into water
  285.     precache_sound ("player/slimbrn2.wav");        // player enter slime
  286.     precache_sound ("player/inh2o.wav");        // player enter water
  287.     precache_sound ("player/inlava.wav");        // player enter lava
  288.     precache_sound ("misc/outwater.wav");        // leaving water sound
  289.  
  290.     precache_sound ("player/lburn1.wav");        // lava burn
  291.     precache_sound ("player/lburn2.wav");        // lava burn
  292.  
  293.     precache_sound ("misc/water1.wav");            // swimming
  294.     precache_sound ("misc/water2.wav");            // swimming
  295.  
  296.     precache_model ("progs/player.mdl");
  297.     precache_model ("progs/eyes.mdl");
  298.     precache_model ("progs/h_player.mdl");
  299.     precache_model ("progs/gib1.mdl");
  300.     precache_model ("progs/gib2.mdl");
  301.     precache_model ("progs/gib3.mdl");
  302.  
  303.     precache_model ("progs/s_bubble.spr");    // drowning bubbles
  304.     precache_model ("progs/s_explod.spr");    // sprite explosion
  305.  
  306.     precache_model ("progs/v_axe.mdl");
  307.     precache_model ("progs/v_shot.mdl");
  308.     precache_model ("progs/v_nail.mdl");
  309.     precache_model ("progs/v_rock.mdl");
  310.     precache_model ("progs/v_shot2.mdl");
  311.     precache_model ("progs/v_nail2.mdl");
  312.     precache_model ("progs/v_rock2.mdl");
  313.  
  314.     precache_model ("progs/bolt.mdl");        // for lightning gun
  315.     precache_model ("progs/bolt2.mdl");        // for lightning gun
  316.     precache_model ("progs/bolt3.mdl");        // for boss shock
  317.     precache_model ("progs/lavaball.mdl");    // for testing
  318.     
  319.     precache_model ("progs/missile.mdl");
  320.     precache_model ("progs/grenade.mdl");
  321.     precache_model ("progs/spike.mdl");
  322.     precache_model ("progs/s_spike.mdl");
  323.  
  324.     precache_model ("progs/backpack.mdl");
  325.  
  326.     precache_model ("progs/zom_gib.mdl");
  327.  
  328.     precache_model ("progs/v_light.mdl");
  329.     
  330.  
  331. //
  332. // Setup light animation tables. 'a' is total darkness, 'z' is maxbright.
  333. //
  334.  
  335.     // 0 normal
  336.     lightstyle(0, "m");
  337.     
  338.     // 1 FLICKER (first variety)
  339.     lightstyle(1, "mmnmmommommnonmmonqnmmo");
  340.     
  341.     // 2 SLOW STRONG PULSE
  342.     lightstyle(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba");
  343.     
  344.     // 3 CANDLE (first variety)
  345.     lightstyle(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg");
  346.     
  347.     // 4 FAST STROBE
  348.     lightstyle(4, "mamamamamama");
  349.     
  350.     // 5 GENTLE PULSE 1
  351.     lightstyle(5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj");
  352.     
  353.     // 6 FLICKER (second variety)
  354.     lightstyle(6, "nmonqnmomnmomomno");
  355.     
  356.     // 7 CANDLE (second variety)
  357.     lightstyle(7, "mmmaaaabcdefgmmmmaaaammmaamm");
  358.     
  359.     // 8 CANDLE (third variety)
  360.     lightstyle(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa");
  361.     
  362.     // 9 SLOW STROBE (fourth variety)
  363.     lightstyle(9, "aaaaaaaazzzzzzzz");
  364.     
  365.     // 10 FLUORESCENT FLICKER
  366.     lightstyle(10, "mmamammmmammamamaaamammma");
  367.  
  368.     // 11 SLOW PULSE NOT FADE TO BLACK
  369.     lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba");
  370.     
  371.     // styles 32-62 are assigned by the light program for switchable lights
  372.  
  373.     // 63 testing
  374.     lightstyle(63, "a");
  375. };
  376.  
  377. void() StartFrame =
  378. {
  379.     teamplay = cvar("teamplay");
  380.     skill = cvar("skill");
  381.     framecount = framecount + 1;
  382. };
  383.  
  384. /*
  385. ==============================================================================
  386.  
  387. BODY QUE
  388.  
  389. ==============================================================================
  390. */
  391.  
  392. entity    bodyque_head;
  393.  
  394. void() bodyque =
  395. {    // just here so spawn functions don't complain after the world
  396.     // creates bodyques
  397. };
  398.  
  399. void() InitBodyQue =
  400. {
  401.     local entity    e;
  402.     
  403.     bodyque_head = spawn();
  404.     bodyque_head.classname = "bodyque";
  405.     bodyque_head.owner = spawn();
  406.     bodyque_head.owner.classname = "bodyque";
  407.     bodyque_head.owner.owner = spawn();
  408.     bodyque_head.owner.owner.classname = "bodyque";
  409.     bodyque_head.owner.owner.owner = spawn();
  410.     bodyque_head.owner.owner.owner.classname = "bodyque";
  411.     bodyque_head.owner.owner.owner.owner = bodyque_head;
  412. };
  413.  
  414.  
  415. // make a body que entry for the given ent so the ent can be
  416. // respawned elsewhere
  417. void(entity ent) CopyToBodyQue =
  418. {
  419. // MULTISKIN Addition begin
  420. // set the corpse's skin to be the same as the player's skin.
  421.     bodyque_head.skin = ent.skin;
  422. // MULTISKIN Addition end
  423.  
  424.     bodyque_head.angles = ent.angles;
  425.     bodyque_head.model = ent.model;
  426.     bodyque_head.modelindex = ent.modelindex;
  427.     bodyque_head.frame = ent.frame;
  428.     bodyque_head.colormap = ent.colormap;
  429.     bodyque_head.movetype = ent.movetype;
  430.     bodyque_head.velocity = ent.velocity;
  431.     bodyque_head.flags = 0;
  432.     setorigin (bodyque_head, ent.origin);
  433.     setsize (bodyque_head, ent.mins, ent.maxs);
  434.     bodyque_head = bodyque_head.owner;
  435. };
  436.  
  437.  
  438.