home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Messiah / data1.cab / Program_Executable_Files / messiahscripts / CharMain.hxx < prev    next >
Text File  |  1999-11-29  |  39KB  |  1,791 lines

  1.  
  2. #define    SCRIPT_DEBUG_INFO    0
  3.  
  4. #include    "messiahscripts\defines.h"
  5. #include    "messiahscripts\objdefines.h"
  6. #include    "messiahscripts\weapons\WeaponDamage.h"
  7.  
  8. #include    "messiahscripts\defvals.hxx"
  9. #include    "messiahscripts\keysall.hxx"
  10.  
  11. #include    "messiahscripts\lights.hxx"
  12.  
  13. //SoundInterface.hxx must be the 1st sound file included, see file for why!
  14. #include    "messiahscripts\sound\soundinterface.hxx"
  15. #include    "messiahscripts\sound\soundactors.hxx"
  16. #include    "messiahscripts\sound\soundambient.hxx"
  17. #include    "messiahscripts\sound\soundbackground.hxx"
  18. #include    "messiahscripts\sound\soundweapon.hxx"
  19. #include    "messiahscripts\sound\soundvoices.hxx"
  20.  
  21.  
  22.  
  23.  
  24. Game(Messiah)
  25. {
  26.         if(VGameCounter==1)            //Pre-game
  27.         {
  28.  
  29.      //INSERT TESTVARS HERE
  30.             float(_declare,GlobalVar0,47);
  31.             float(_declare,GlobalVar1,47);
  32.             float(_declare,GlobalVar2,47);
  33.             float(_declare,GlobalVar3,47);
  34.             float(_declare,GlobalVar4,47);
  35.             float(_declare,GlobalVar5,47);
  36.  
  37.     //INPUT VARIABLES HERE
  38.  
  39.             float(_declare,DirClr,0);
  40.             float(_declare,DirHold,0);
  41.             float(_declare,DirOld,0);
  42.  
  43.     //Bob Flying Globals
  44.             float(_declare,BobJumpSpeed,15);                //15    Start velocity upwards when jumping
  45.             float(_declare,BobJumpGravity,1.0);                //1.0    Downwardpull when flying straight
  46.             float(_declare,BobJumpGravityNoMove,0.4);        //0.4    Higher gravity that character is pulled down
  47.             float(_declare,BobJumpNoMoveExtraYMovement,7);    //7        Extra movement upwards when not moving
  48.             float(_declare,BobGravityGlide,0.2);        //0.2    Gravity when gliding 
  49.             float(_declare,BobGravityFlap,0.1);        //0.2    Gravity when gliding 
  50.  
  51.     //Global variables regarding the Level
  52.         float(_declare,BobFlappingEnabled,1);        //1= Bob can flap
  53.         float(_declare,LightsOut,0);                //1= Lights are dimmed (ambient light reduced)
  54.  
  55.         //Misc Global variables
  56.  
  57.             vector(_declare,Gactorpos,0,0,0);
  58.             vector(_declare,Gactorangle,0,3500,0);
  59.             vector(_declare,Gactorine,0,3500,0);
  60.  
  61.     //Global vars regarding currently playercontrolled character
  62.             vector(_declare,PlayerPos,0,0,0);
  63.             float(_declare,PlayerHeadBone,0);
  64.  
  65.  
  66.     //Global character variables used for subroutines
  67.             float(_declare,ColAngleTmp,0);
  68.             float(_declare,ColAngleTmpFace,0);
  69.             float(_declare,ColMaterial,0);
  70.  
  71.  
  72.     //Generic variables
  73.             vector(_declare,EmptyVector,0,0,0);        //Always (0,0,0)
  74.             float(_declare,EmptyFloat,0);            //Always 0
  75.  
  76.             float(_declare,SubVar1,0);
  77.             float(_declare,SubVar2,0);
  78.             float(_declare,SubVar3,0);
  79.             float(_declare,SubVar4,0);
  80.  
  81.             vector(_declare,SubVector1,0,0,0);
  82.             vector(_declare,SubVector2,0,0,0);
  83.             vector(_declare,SubVector3,0,0,0);
  84.  
  85.             float(_declare,SubSubParm1,0);
  86.             float(_declare,SubSubParm2,0);
  87.             float(_declare,SubSubParm3,0);
  88.             float(_declare,SubSubParm4,0);
  89.             float(_declare,SubSubParm5,0);
  90.             float(_declare,SubSubParm6,0);
  91.             float(_declare,SubSubParm7,0);
  92.             float(_declare,SubSubParm8,0);
  93.     /*
  94.             float(_declare,Parm1,0);
  95.             float(_declare,Parm2,0);
  96.             float(_declare,Parm3,0);
  97.             float(_declare,Parm4,0);
  98.             float(_declare,Parm5,0);
  99.             float(_declare,Parm6,0);
  100.             float(_declare,Parm7,0);
  101.             float(_declare,Parm8,0);
  102.  
  103.             float(_declare,Result,0);
  104.     */
  105.             vector(_declare,TmpVector,0,0,0);
  106.             vector(_declare,TmpVector1,0,0,0);
  107.             vector(_declare,TmpVector2,0,0,0);
  108.             vector(_declare,TmpVector3,0,0,0);
  109.             vector(_declare,TmpVector4,0,0,0);
  110.  
  111.             float(_declare,TmpFloat,0);
  112.             float(_declare,TmpFloat1,0);
  113.             float(_declare,TmpFloat2,0);
  114.             float(_declare,TmpFloat3,0);
  115.             float(_declare,TmpFloat4,0);
  116.  
  117.             float(_declare,Var1,0);
  118.             float(_declare,Var2,0);
  119.             float(_declare,Var3,0);
  120.  
  121.  
  122.             //float(_Declare,DebugOnlyOneEnemy,0)
  123.             //float(_Declare,DebugOnlyOneWeapon,0)
  124.  
  125.     //        float(_declare,keytouched,0); // for keyboard control
  126.  
  127.     //Stage global variables
  128.  
  129.  
  130.     //Mission Objective Text
  131.     
  132.             float(_declare,MissionLevel1,0);
  133.             float(_declare,MissionLevel2,0);
  134.             float(_declare,MissionLevel3,0);
  135.             float(_declare,MissionLevel4,0);
  136.             float(_declare,MissionLevel5,0);
  137.             float(_declare,MissionLevel6,0);
  138.             float(_declare,MissionLevel7,0);
  139.             float(_declare,MissionLevel8,0);
  140.             float(_declare,MissionLevel9,0);
  141.  
  142.  
  143.     //c1_s1 (Shipment sector)
  144.             float(_declare,VarKey1,0);
  145.             float(_declare,VarKey2,0);
  146.             float(_declare,VarKey3,0);
  147.             float(_declare,VarKey4,0);
  148.             float(_declare,VarKey5,0);
  149.             float(_declare,VarKey6,0);
  150.             float(_declare,VarKey7,0);
  151.             float(_declare,VarKey8,0);
  152.             float(_declare,VarKey9,0);
  153.             float(_declare,VarKey10,0);
  154.             float(_declare,LiteCounter,250);
  155.  
  156.     //c1_s2 (OldTown)
  157.             float(_declare,VarKey11,0);
  158.             float(_declare,VarKey12,0);
  159.             float(_declare,VarKey13,0);
  160.             float(_declare,VarKey14,0);
  161.             float(_declare,VarKey15,0);
  162.             float(_declare,VarKey16,0);
  163.             float(_declare,VarKey17,0);
  164.             float(_declare,VarKey18,0);
  165.             float(_declare,VarKey19,0);
  166.             float(_declare,VarKey20,0);
  167.  
  168.     //c2 (Warehouse - Annex)
  169.             float(_declare,VarKey21,0);
  170.             float(_declare,VarKey22,0);
  171.             float(_declare,VarKey23,0);
  172.             float(_declare,VarKey24,0);
  173.             float(_declare,VarKey25,0);
  174.             float(_declare,VarKey26,0);
  175.             float(_declare,VarKey27,0);
  176.             float(_declare,VarKey28,0);
  177.             float(_declare,VarKey29,0);
  178.             float(_declare,VarKey30,0);
  179.  
  180.     //c2 (Weapon Factory)
  181.             float(_declare,VarKey31,0);
  182.             float(_declare,VarKey32,0);
  183.             float(_declare,VarKey33,0);
  184.             float(_declare,VarKey34,0);
  185.             float(_declare,VarKey35,0);
  186.             float(_declare,VarKey36,0);
  187.             float(_declare,VarKey37,0);
  188.             float(_declare,VarKey38,0);
  189.             float(_declare,VarKey39,0);
  190.             float(_declare,VarKey40,0);
  191.             //For Flame Effects in Fact_2
  192.             float(_declare,FurnaceTimer1,0);
  193.             float(_declare,FurnaceTimer2,0);
  194.             float(_declare,FurnaceTimer3,0);
  195.             float(_declare,FurnaceTimer4,0);
  196.             float(_declare,WepConstructionTimer,0);
  197.             float(_declare,GunTurretKey,0);
  198.             float(_declare,MaserKey,0);
  199.  
  200.     //c2 (Conveyer - Streets)
  201.             float(_declare,VarKey41,0);
  202.             float(_declare,VarKey42,0);
  203.             float(_declare,VarKey43,0);
  204.             float(_declare,VarKey44,0);
  205.             float(_declare,VarKey45,0);
  206.             float(_declare,VarKey46,0);
  207.             float(_declare,VarKey47,0);
  208.             float(_declare,VarKey48,0);
  209.             float(_declare,VarKey49,0);
  210.             float(_declare,VarKey50,0);
  211.     
  212.     //c3 (Redlite - CLub Perimeter)
  213.             float(_declare,VarKey51,0);
  214.             float(_declare,VarKey52,0);
  215.             float(_declare,VarKey53,0);
  216.             float(_declare,VarKey54,0);
  217.             float(_declare,VarKey55,0);
  218.             float(_declare,VarKey56,0);
  219.             float(_declare,VarKey57,0);
  220.             float(_declare,VarKey58,0);
  221.             float(_declare,VarKey59,0);
  222.             float(_declare,VarKey60,0);
  223.             float(_declare,VarKey61,0);
  224.             float(_declare,VarKey62,0);
  225.             float(_declare,VarKey63,0);
  226.             float(_declare,VarKey64,0);
  227.             float(_declare,VarKey65,0);
  228.             float(_declare,VarKey66,0);
  229.             float(_declare,VarKey67,0);
  230.             float(_declare,VarKey68,0);
  231.             float(_declare,VarKey69,0);
  232.             float(_declare,VarKey70,0);
  233.  
  234.     //c3 (Club Kyd)
  235.             float(_declare,VarKey71,0);
  236.             float(_declare,VarKey72,0);
  237.             float(_declare,VarKey73,0);
  238.             float(_declare,VarKey74,0);
  239.             float(_declare,VarKey75,0);
  240.             float(_declare,VarKey76,0);
  241.             float(_declare,VarKey77,0);
  242.             float(_declare,VarKey78,0);
  243.             float(_declare,VarKey79,0);
  244.             float(_declare,VarKey80,0);
  245.             float(_declare,LaserAngle1,0);
  246.             float(_declare,LaserAngle2,0);
  247.             float(_declare,DiscColor,0);
  248.             float(_declare,ColorStage,0);
  249.  
  250.     //c3 (Military Zone)
  251.             float(_declare,VarKey81,0);
  252.             float(_declare,VarKey82,0);
  253.             float(_declare,VarKey83,0);
  254.             float(_declare,VarKey84,0);
  255.             float(_declare,VarKey85,0);
  256.             float(_declare,VarKey86,0);
  257.             float(_declare,VarKey87,0);
  258.             float(_declare,VarKey88,0);
  259.             float(_declare,VarKey89,0);
  260.             float(_declare,VarKey90,0);
  261.  
  262.     //Boss Areas (Priest - Satan)
  263.             float(_declare,VarKey91,0);
  264.             float(_declare,VarKey92,0);
  265.             float(_declare,VarKey93,0);
  266.             float(_declare,VarKey94,0);
  267.             float(_declare,VarKey95,0);
  268.             float(_declare,VarKey96,0);
  269.             float(_declare,VarKey97,0);
  270.             float(_declare,VarKey98,0);
  271.             float(_declare,VarKey99,0);
  272.  
  273.     //c1_s3 Sewer - Outskirts - Laboratory)
  274.             float(_declare,VarKey101,0);
  275.             float(_declare,VarKey102,0);
  276.             float(_declare,VarKey103,0);
  277.             float(_declare,VarKey104,0);
  278.             float(_declare,VarKey105,0);
  279.             float(_declare,VarKey106,0);
  280.             float(_declare,VarKey107,0);
  281.             float(_declare,VarKey108,0);
  282.             float(_declare,VarKey109,0);
  283.             float(_declare,VarKey110,0);
  284.             float(_declare,OpenDoor,0);
  285.             float(_declare,WeaponDelay01,0);
  286.             float(_declare,WeaponDelay02,0);
  287.             float(_declare,WeaponDelay03,0);
  288.             float(_declare,LabAlarm,0);
  289.             float(_declare,LabSecBeams,0);
  290.             
  291.         //Cryo
  292.             float(_declare,CryoKey1,0);
  293.             float(_declare,CryoKey2,0);
  294.             float(_declare,CryoKey3,0);
  295.             
  296.         //c2 (Wasteplant)
  297.             float(_declare,WorkerPushingObject,0);        //Whether or not worker is pushing object
  298.             float(_declare,BarrelTimer,0);
  299.  
  300.             float(_declare,PlatformTimer,0);    //Used for platform scripting in wast5
  301.             float(_declare,PlatformLevel1,0);
  302.             float(_declare,PlatformLevel2,0);
  303.             
  304.             float(_declare,VarKey111,0);
  305.             float(_declare,VarKey112,0);
  306.             float(_declare,VarKey113,0);
  307.             float(_declare,VarKey114,0);
  308.             float(_declare,VarKey115,0);
  309.             float(_declare,VarKey116,0);
  310.             float(_declare,VarKey117,0);
  311.             float(_declare,VarKey118,0);
  312.             float(_declare,VarKey119,0);
  313.             float(_declare,VarKey120,0);
  314.  
  315.             float(_declare,aitoggle,0);
  316.             float(_declare,aivisiontoggle,0);
  317.             float(_declare,DepossesionAbilityActive,0);
  318.             float(_declare,tutorialtoggle,1);
  319.             float(_declare,LastTuturialChange,0);
  320.  
  321.             float(_declare,ListenerSource,1);
  322.             float(_declare,GodMode,0);
  323.  
  324.             float(_declare,SniperMode,0);
  325.             //TH
  326.             float(_declare,PreCopStateBits,0);
  327.             float(_declare,CopStateBits,0);
  328.             float(_declare,PreCopActionBits,0);
  329.             float(_declare,CopActionBits,0);
  330.             float(_declare,SoundDelayCounter,0);//to make sure that sounds don't overlap, set to positive value when sound started & counts-down to zero
  331.  
  332.             float(_declare,NrActorsInSet,0);
  333.             float(_declare,NrCopsInSet,0);
  334.             //
  335.  
  336.             //Msika's variables for levels
  337.             #include    "messiahscripts\stages\DavidGlobals.hxx"
  338.  
  339.             //my vectors/floats for specialFX and soundFX,etc...
  340.             #include    "messiahscripts\particles\TonyGlobals.hxx"
  341.  
  342.             ClrPaths();
  343.             InstallPath("c:\mesinst");
  344.             AddPath("pc");
  345.             AddPath("pc\3dxprj");
  346.             LevelFile("messiah.spt");
  347.  
  348.  
  349.             //set key to be non repeat
  350.             call(ToggleKey,KEY_9);
  351.             call(ToggleKey,KEY_T);
  352.  
  353.  
  354.  
  355.  
  356.             if(VCurScene==1)
  357.             {
  358.                 callsub(InitScene1)
  359.             }
  360.             elseif(VCurScene==2)
  361.             {
  362.                 callsub(InitScene2)
  363.             }
  364.             elseif(VCurScene==3)
  365.             {
  366.                 callsub(InitScene3);
  367.             }
  368.             elseif(VCurScene==4)
  369.             {
  370.                 callsub(InitScene4);
  371.             }
  372.             elseif(VCurScene==5)
  373.             {
  374.                 callsub(InitScene5);
  375.             }
  376.             elseif(VCurScene==6)
  377.             {
  378.                 callsub(InitScene6);
  379.             }
  380.             elseif(VCurScene==7)
  381.             {
  382.                 callsub(InitScene7);
  383.             }
  384.             elseif(VCurScene==8)
  385.             {
  386.                 callsub(InitScene8);
  387.             }
  388.             elseif(VCurScene==9)
  389.             {
  390.                 callsub(InitScene9);
  391.             }
  392.             elseif(VCurScene==10)
  393.             {
  394.                 callsub(InitScene10);
  395.             }
  396.             elseif(VCurScene==11)
  397.             {
  398.                 callsub(InitScene11);
  399.             }
  400.             elseif(VCurScene==12)
  401.             {
  402.                 callsub(InitScene12);
  403.             }
  404.             elseif(VCurScene==13)
  405.             {
  406.                 callsub(InitScene13);
  407.             }
  408.             elseif(VCurScene==14)
  409.             {
  410.                 callsub(InitScene14);
  411.             }
  412.             elseif(VCurScene==15)
  413.             {
  414.                 callsub(InitScene15);
  415.             }
  416.             elseif(VCurScene==16)
  417.             {
  418.                 callsub(InitScene16);
  419.             }
  420.             elseif(VCurScene==17)
  421.             {
  422.                 callsub(InitScene17);
  423.             }
  424.             elseif(VCurScene==18)
  425.             {
  426.                 callsub(InitScene18);
  427.             }
  428.             elseif(VCurScene==19)
  429.             {
  430.                 callsub(InitScene19);
  431.             }
  432.         }
  433.  
  434.         if(VInitSceneSounds==1)
  435.         {
  436.             if(VCurScene==1)
  437.             {
  438.                 callsub(InitSceneSound1)
  439.             }
  440.             elseif(VCurScene==2)
  441.             {
  442.                 callsub(InitSceneSound2)
  443.             }
  444.             elseif(VCurScene==3)
  445.             {
  446.                 callsub(InitSceneSound3);
  447.             }
  448.             elseif(VCurScene==4)
  449.             {
  450.                 callsub(InitSceneSound4);
  451.             }
  452.             elseif(VCurScene==5)
  453.             {
  454.                 callsub(InitSceneSound5);
  455.             }
  456.             elseif(VCurScene==6)
  457.             {
  458.                 callsub(InitSceneSound6);
  459.             }
  460.             elseif(VCurScene==7)
  461.             {
  462.                 callsub(InitSceneSound7);
  463.             }
  464.             elseif(VCurScene==8)
  465.             {
  466.                 callsub(InitSceneSound8);
  467.             }
  468.             elseif(VCurScene==9)
  469.             {
  470.                 callsub(InitSceneSound9);
  471.             }
  472.             elseif(VCurScene==10)
  473.             {
  474.                 callsub(InitSceneSound10);
  475.             }
  476.             elseif(VCurScene==11)
  477.             {
  478.                 callsub(InitSceneSound11);
  479.             }
  480.             elseif(VCurScene==12)
  481.             {
  482.                 callsub(InitSceneSound12);
  483.             }
  484.             elseif(VCurScene==13)
  485.             {
  486.                 callsub(InitSceneSound13);
  487.             }
  488.             elseif(VCurScene==14)
  489.             {
  490.                 callsub(InitSceneSound14);
  491.             }
  492.             elseif(VCurScene==15)
  493.             {
  494.                 callsub(InitSceneSound15);
  495.             }
  496.             elseif(VCurScene==16)
  497.             {
  498.                 callsub(InitSceneSound16);
  499.             }
  500.             elseif(VCurScene==17)
  501.             {
  502.                 callsub(InitSceneSound17);
  503.             }
  504.             elseif(VCurScene==18)
  505.             {
  506.                 callsub(InitSceneSound18);
  507.             }
  508.         }
  509.  
  510.  
  511.         if(VGameCounter>=1)
  512.         {
  513.             ///////////
  514.             //MAIN LOOP
  515.             ///////////
  516.  
  517.             call(GetNumbActorsInCurrentSet,NrActorsInSet,_AIClassCop|_AIClassWorker|_AIclassprost|_AIclasspimp|_AIclasspriest|_AIclassdweller|_AIclassscientist|_AIclassbarpeople|_AIclassmale|_AIclassfemale|_AIclassmedic|_AIclasssubgirl);
  518.             call(GetNumbActorsInCurrentSet,NrCopsInSet,_AIClassCop);
  519.  
  520.  
  521.             if(VCurScene==1)
  522.             {
  523.                 callsub(MainScene1)
  524.             }
  525.             elseif(VCurScene==2)
  526.             {
  527.                 callsub(MainScene2)
  528.             }
  529.             elseif(VCurScene==3)
  530.             {
  531.                 callsub(MainScene3);
  532.             }
  533.             elseif(VCurScene==4)
  534.             {
  535.                 callsub(MainScene4);
  536.             }
  537.             elseif(VCurScene==5)
  538.             {
  539.                 callsub(MainScene5);
  540.             }
  541.             elseif(VCurScene==6)
  542.             {
  543.                 callsub(MainScene6);
  544.             }
  545.             elseif(VCurScene==7)
  546.             {
  547.                 callsub(MainScene7);
  548.             }
  549.             elseif(VCurScene==8)
  550.             {
  551.                 callsub(MainScene8);
  552.             }
  553.             elseif(VCurScene==9)
  554.             {
  555.                 callsub(MainScene9);
  556.             }
  557.             elseif(VCurScene==10)
  558.             {
  559.                 callsub(MainScene10);
  560.             }
  561.             elseif(VCurScene==11)
  562.             {
  563.                 callsub(MainScene11);
  564.             }
  565.             elseif(VCurScene==12)
  566.             {
  567.                 callsub(MainScene12);
  568.             }
  569.             elseif(VCurScene==13)
  570.             {
  571.                 callsub(MainScene13);
  572.             }
  573.             elseif(VCurScene==14)
  574.             {
  575.                 callsub(MainScene14);
  576.             }
  577.             elseif(VCurScene==15)
  578.             {
  579.                 callsub(MainScene15);
  580.             }
  581.             elseif(VCurScene==16)
  582.             {
  583.                 callsub(MainScene16);
  584.             }
  585.             elseif(VCurScene==17)
  586.             {
  587.                 callsub(MainScene17);
  588.             }
  589.             elseif(VCurScene==18)
  590.             {
  591.                 callsub(MainScene18);
  592.             }
  593.             elseif(VCurScene==19)
  594.             {
  595.                 callsub(MainScene19);
  596.             }
  597.         }
  598.  
  599.         callsub(ReadKeyJoy);
  600.  
  601.         if(VAICon==0)
  602.         {
  603.             float(_seti,DirHold,VTrigger);
  604.             float(_set,DirClr,DirHold);
  605.             float(_xor,DirClr,DirOld);
  606.             float(_and,DirClr,DirOld);        //DirClr=(OldDirection^NewDirection)&OldDirection
  607.             float(_and,DirHold,DirOld);        //DirHold=OldDirection&NewDirection
  608.             float(_seti,DirOld,VTrigger);
  609.         }
  610.  
  611.  
  612.         printi("AI Nr Attackers:      ",VAInrattackingplayer);
  613.         printi("AI Attack Strenght:   ",VAIenemiesattackingplayerstrenght);
  614.  
  615. /////FF loop attacks...
  616. /*
  617.         if(VAInrattackingplayer>=2 && VAIenemiesattackingplayerstrenght>30 && FFplaying==0)
  618.         {
  619.             if(vrnd<33 && LastCombatSFX!=1)
  620.             {
  621.                 float(_set,LastCombatSFX,1);
  622.                 sample(SFXFF1,-1,100);
  623.             }
  624.             elseif(vrnd<66 && LastCombatSFX!=2)
  625.             {
  626.                 float(_set,LastCombatSFX,2);
  627.                 sample(SFXFF2,-1,100);
  628.             }
  629.             elseif(LastCombatSFX!=3)
  630.             {
  631.                 float(_set,LastCombatSFX,3);
  632.                 sample(SFXFF3,-1,100);
  633.             }
  634.             else
  635.             {
  636.                 float(_set,LastCombatSFX,1);
  637.                 sample(SFXFF1,-1,100);
  638.             }
  639.  
  640.             float(_set,FFplaying,1);        //playing
  641.             float(_set,FFfader,100);        //max volume
  642.         }
  643.         elseif(VAInrattackingplayer==1 && VAIenemiesattackingplayerstrenght>30 && FFplaying==0)
  644.         {
  645.             if(vrnd<33 && LastCombatSFX!=4)
  646.             {
  647.                 float(_set,LastCombatSFX,4);
  648.                 sample(SFXFF4,-1,50);
  649.             }
  650.             elseif(vrnd<66 && LastCombatSFX!=5)
  651.             {
  652.                 float(_set,LastCombatSFX,5);
  653.                 sample(SFXFF5,-1,50);
  654.             }
  655.             elseif(LastCombatSFX!=6)
  656.             {
  657.                 float(_set,LastCombatSFX,6);
  658.                 sample(SFXFF6,-1,50);
  659.             }
  660.             else
  661.             {
  662.                 float(_set,LastCombatSFX,4);
  663.                 sample(SFXFF4,-1,50);
  664.             }
  665.  
  666.             float(_set,FFplaying,1);        //playing
  667.             float(_set,FFfader,50);            //half volume
  668.         }
  669.         elseif(VAInrattackingplayer>=2 && VAIenemiesattackingplayerstrenght>30 && FFplaying==1)
  670.         {
  671.             float(_set,FFfader,100);        //max volume
  672.         }
  673.         elseif(VAInrattackingplayer==1 && VAIenemiesattackingplayerstrenght>30 && FFplaying==1)
  674.         {
  675.             float(_set,FFfader,50);            //half volume
  676.         }
  677.         elseif(VAInrattackingplayer==0 && FFplaying==1)
  678.         {
  679.             float(_set,FFfader,0);            //min volume
  680.         }
  681.  
  682.         if(FFplaying==1)
  683.         {
  684.             float(_sub,FFcurvolume,0.5);        //always try to fade...(2 sec fade out)
  685.             if(FFcurvolume<=FFfader)            //...to this level
  686.             {
  687.                 float(_set,FFcurvolume,FFfader);
  688.             }
  689.  
  690.             if(LastCombatSFX==1)
  691.             {
  692.                 samplevolume(SFXFF1,FFcurvolume);
  693.             }
  694.             elseif(LastCombatSFX==2)
  695.             {
  696.                 samplevolume(SFXFF2,FFcurvolume);
  697.             }
  698.             elseif(LastCombatSFX==3)
  699.             {
  700.                 samplevolume(SFXFF3,FFcurvolume);
  701.             }
  702.             elseif(LastCombatSFX==4)
  703.             {
  704.                 samplevolume(SFXFF4,FFcurvolume);
  705.             }
  706.             elseif(LastCombatSFX==5)
  707.             {
  708.                 samplevolume(SFXFF5,FFcurvolume);
  709.             }
  710.             elseif(LastCombatSFX==6)
  711.             {
  712.                 samplevolume(SFXFF6,FFcurvolume);
  713.             }
  714.  
  715.             if(FFcurvolume==0)
  716.             {
  717.                 float(_set,FFplaying,0);
  718.             }
  719.         }
  720. */
  721.         float(_xor,EveryOtherFrame,1);
  722.         if(SoundDelayCounter>0)
  723.         {
  724.             float(_sub,SoundDelayCounter,1);
  725.         }
  726.  
  727.         float(_add,WeaponFaderCol,WeaponFaderDir);
  728.         if(WeaponFaderCol<128)
  729.         {
  730.             float(_set,WeaponFaderDir,64);
  731.         }
  732.         elseif(WeaponFaderCol>4096)
  733.         {
  734.             float(_set,WeaponFaderDir,-64);
  735.         }
  736.  
  737. }
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744. SubRoutine(Sub_SpawnCharacters)
  745. {
  746.         if(VAICon==0)
  747.         {
  748.             if(vkey==KEY_TAB)
  749.             {
  750.                 move(0,0,-50);
  751.             }
  752.         }
  753.  
  754.  
  755. //        if(VActiveTime==5&&VGameCounter<8)
  756. //        {
  757. //            spawnactor(Weapon11,-30,100,-200);
  758. //            spawnactor(Copl,0,150,-100);
  759. //        }
  760. //        if(VActiveTime==27&&VGameCounter<30)
  761. //        {
  762.     //        spawnactor(Copl,100,100,-400);
  763. //        }
  764. //weapon1
  765. //weapon11
  766. //weapon12
  767. //weapon13
  768.  
  769. }
  770.  
  771.  
  772.  
  773. SubRoutine(Sub_SpawnActors)
  774. {
  775.     if(VAICon==0)
  776.     {
  777.         if(VKey==KEY_8 && VKey==KEY_RSHIFT)
  778.         {
  779.             float(_add,CurrentActor,0.5);
  780.             if(CurrentActor>=48)
  781.             {
  782.                 float(_set,CurrentActor,48);
  783.             }
  784.         }
  785.         elseif(VKey==KEY_7 && VKey==KEY_RSHIFT)
  786.         {
  787.             float(_sub,CurrentActor,0.5);
  788.             if(CurrentActor<0)
  789.             {
  790.                 float(_set,CurrentActor,0);
  791.             }
  792.         }
  793.  
  794.  
  795.         if(CurrentActor<=0)
  796.         {
  797.             dmessage("NEXT ACTOR: (1) COP LIGHT",300,10);
  798.         }
  799.         elseif(CurrentActor<=1)
  800.         {
  801.             dmessage("NEXT ACTOR: (2) COP MEDIUM",300,10);
  802.         }
  803.         elseif(CurrentActor<=2)
  804.         {
  805.             dmessage("NEXT ACTOR: (3) COP HEAVY",300,10);
  806.         }
  807.         elseif(CurrentActor<=3)
  808.         {
  809.             dmessage("NEXT ACTOR: (4) WORKER",300,10);
  810.         }
  811.         elseif(CurrentActor<=4)
  812.         {
  813.             dmessage("NEXT ACTOR: (5) MEDIC",300,10);
  814.         }
  815.         elseif(CurrentActor<=5)
  816.         {
  817.             dmessage("NEXT ACTOR: (6) ARMOUR BEAST",300,10);
  818.         }
  819.         elseif(CurrentActor<=6)
  820.         {
  821.             dmessage("NEXT ACTOR: (7) NUKE TEK",300,10);
  822.         }
  823.         elseif(CurrentActor<=7)
  824.         {
  825.             dmessage("NEXT ACTOR: (8) LAYYA",300,10);
  826.         }
  827.         elseif(CurrentActor<=8)
  828.         {
  829.             dmessage("NEXT ACTOR: (9) PROZZIE",300,10);
  830.         }
  831.         elseif(CurrentActor<=9)
  832.         {
  833.             dmessage("NEXT ACTOR: (10) MALE PROZ",300,10);
  834.         }
  835.         elseif(CurrentActor<=10)
  836.         {
  837.             dmessage("NEXT ACTOR: (11) CHOT",300,10);
  838.         }
  839.         elseif(CurrentActor<=11)
  840.         {
  841.             dmessage("NEXT ACTOR: (12) CHOT CT",300,10);
  842.         }
  843.         elseif(CurrentActor<=12)
  844.         {
  845.             dmessage("NEXT ACTOR: (13) CHOT OT",300,10);
  846.         }
  847.         elseif(CurrentActor<=13)
  848.         {
  849.             dmessage("NEXT ACTOR: (14) DOMINA",300,10);
  850.         }
  851.         elseif(CurrentActor<=14)
  852.         {
  853.             dmessage("NEXT ACTOR: (15) DWELLER 1",300,10);
  854.         }
  855.         elseif(CurrentActor<=15)
  856.         {
  857.             dmessage("NEXT ACTOR: (16) DWELLER 3",300,10);
  858.         }
  859.         elseif(CurrentActor<=16)
  860.         {
  861.             dmessage("NEXT ACTOR: (17) SUBGIRL 1",300,10);
  862.         }
  863.         elseif(CurrentActor<=17)
  864.         {
  865.             dmessage("NEXT ACTOR: (18) SUBGIRL 2",300,10);
  866.         }
  867.         elseif(CurrentActor<=18)
  868.         {
  869.             dmessage("NEXT ACTOR: (19) DROID 1",300,10);
  870.         }
  871.         elseif(CurrentActor<=19)
  872.         {
  873.             dmessage("NEXT ACTOR: (20) DROID 2",300,10);
  874.         }
  875.         elseif(CurrentActor<=20)
  876.         {
  877.             dmessage("NEXT ACTOR: (21) RAT",300,10);
  878.         }
  879.         elseif(CurrentActor<=21)
  880.         {
  881.             dmessage("NEXT ACTOR: (22) CANDY",300,10);
  882.         }
  883.         elseif(CurrentActor<=22)
  884.         {
  885.             dmessage("NEXT ACTOR: (23) BARMAN",300,10);
  886.         }
  887.         elseif(CurrentActor<=23)
  888.         {
  889.             dmessage("NEXT ACTOR: (24) SCIENTIST",300,10);
  890.         }
  891.         elseif(CurrentActor<=24)
  892.         {
  893.             dmessage("NEXT ACTOR: (25) PRIEST",300,10);
  894.         }
  895.         elseif(CurrentActor<=25)
  896.         {
  897.             dmessage("NEXT ACTOR: (26) CHOT BEAST",300,10);
  898.         }
  899.         elseif(CurrentActor<=26)
  900.         {
  901.             dmessage("NEXT ACTOR: (27) GUN TURRET",300,10);
  902.         }
  903.         elseif(CurrentActor<=27)
  904.         {
  905.             dmessage("NEXT ACTOR: (28) ROCKET LAUNCHER",300,10);
  906.         }
  907.         elseif(CurrentActor<=28)
  908.         {
  909.             dmessage("NEXT ACTOR: (29) PIMP DADDY",300,10);
  910.         }
  911.         elseif(CurrentActor<=29)
  912.         {
  913.             dmessage("NEXT ACTOR: (30) CHOT 2",300,10);
  914.         }
  915.         elseif(CurrentActor<=30)
  916.         {
  917.             dmessage("NEXT ACTOR: (31) BOUNCER",300,10);
  918.         }
  919.         elseif(CurrentActor<=31)
  920.         {
  921.             dmessage("NEXT ACTOR: (32) EVIL BOB",300,10);
  922.         }
  923.         elseif(CurrentActor<=32)
  924.         {
  925.             dmessage("NEXT ACTOR: (33) DJ KYD",300,10);
  926.         }
  927.         elseif(CurrentActor<=33)
  928.         {
  929.             dmessage("NEXT ACTOR: (34) YO MOMMA",300,10);    //dick
  930.         }
  931.         elseif(CurrentActor<=34)
  932.         {
  933.             dmessage("NEXT ACTOR: (35) DEFENSE BOT",300,10);
  934.         }
  935.         elseif(CurrentActor<=35)
  936.         {
  937.             dmessage("NEXT ACTOR: (36) COMPANION BOT",300,10);
  938.         }
  939.         elseif(CurrentActor<=36)
  940.         {
  941.             dmessage("NEXT ACTOR: (37) TRANSPORT BOT",300,10);
  942.         }
  943.         elseif(CurrentActor<=37)
  944.         {
  945.             dmessage("NEXT ACTOR: (38) OFFENSE BOT",300,10);
  946.         }
  947.         elseif(CurrentActor<=38)
  948.         {
  949.             dmessage("NEXT ACTOR: (39) DWELLER 2",300,10);
  950.         }
  951.         elseif(CurrentActor<=39)
  952.         {
  953.             dmessage("NEXT ACTOR: (40) VICTIM MALE",300,10);
  954.         }
  955.         elseif(CurrentActor<=40)
  956.         {
  957.             dmessage("NEXT ACTOR: (41) VICTIM FEMALE",300,10);
  958.         }
  959.         elseif(CurrentActor<=41)
  960.         {
  961.             dmessage("NEXT ACTOR: (42) FEMALE DWELLER 1",300,10);
  962.         }
  963.         elseif(CurrentActor<=42)
  964.         {
  965.             dmessage("NEXT ACTOR: (43) FEMALE DWELLER 2",300,10);
  966.         }
  967.         elseif(CurrentActor<=43)
  968.         {
  969.             dmessage("NEXT ACTOR: (44) XTC",300,10);
  970.         }
  971.         elseif(CurrentActor<=44)
  972.         {
  973.             dmessage("NEXT ACTOR: (45) RIOT COP",300,10);
  974.         }
  975.         elseif(CurrentActor<=45)
  976.         {
  977.             dmessage("NEXT ACTOR: (46) GUN COMMANDER",300,10);
  978.         }
  979.         elseif(CurrentActor<=46)
  980.         {
  981.             dmessage("NEXT ACTOR: (47) NUN",300,10);
  982.         }
  983.         elseif(CurrentActor<=47)
  984.         {
  985.             dmessage("NEXT ACTOR: (48) CHOT DWARF",300,10);
  986.         }
  987.         elseif(CurrentActor<=48)
  988.         {
  989.             dmessage("NEXT ACTOR: (49) SHELL TURRET",300,10);
  990.         }
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.         
  1003.  
  1004.  
  1005.         //if(DebugOnlyOneEnemy==0)
  1006.         //{
  1007.             //float(_set,DebugOnlyOneEnemy,3)
  1008.  
  1009.             if(VKey==KEY_9 && VKey==KEY_RSHIFT)
  1010.             {
  1011.                 if(CurrentActor<=0)
  1012.                 {
  1013.                     spawnactor(copl,0,150,-200);
  1014.                     //spawnactor(MDroid1,0,150,-200);
  1015.                 }
  1016.                 elseif(CurrentActor<=1)
  1017.                 {
  1018.                     spawnactor(copm,0,150,-200);
  1019.                     //spawnactor(MDroid2,0,150,-200);
  1020.                 }
  1021.                 elseif(CurrentActor<=2)
  1022.                 {
  1023.                     spawnactor(coph,0,150,-200);
  1024.                     //spawnactor(AutoCannon,0,150,-200);
  1025.                 }
  1026.                 elseif(CurrentActor<=3)
  1027.                 {
  1028.                     spawnactor(worker,0,150,-200);
  1029.                     //spawnactor(WeaponBot,0,150,-200);
  1030.                 }
  1031.                 elseif(CurrentActor<=4)
  1032.                 {
  1033.                     spawnactor(medic,0,150,-200);
  1034.                 }
  1035.                 elseif(CurrentActor<=5)
  1036.                 {
  1037.                     spawnactor(abeast,0,150,-200);
  1038.                 }
  1039.                 elseif(CurrentActor<=6)
  1040.                 {
  1041.                     spawnactor(RadiationWorker,0,150,-200);
  1042.                 }
  1043.                 elseif(CurrentActor<=7)
  1044.                 {
  1045.                     spawnactor(Layya,0,150,-200);
  1046.                 }
  1047.                 elseif(CurrentActor<=8)
  1048.                 {
  1049.                     spawnactor(prost1,0,150,-200);
  1050.                 }
  1051.                 elseif(CurrentActor<=9)
  1052.                 {
  1053.                     spawnactor(hung,0,150,-200);
  1054.                 }
  1055.                 elseif(CurrentActor<=10)
  1056.                 {
  1057.                     spawnactor(chot,0,150,-200);
  1058.                 }
  1059.                 elseif(CurrentActor<=11)
  1060.                 {
  1061.                     spawnactor(chotct,0,150,-200);
  1062.                 }
  1063.                 elseif(CurrentActor<=12)
  1064.                 {
  1065.                     spawnactor(chotmot,0,150,-200);
  1066.                 }
  1067.                 elseif(CurrentActor<=13)
  1068.                 {
  1069.                     spawnactor(domina,0,150,-200);
  1070.                 }
  1071.                 elseif(CurrentActor<=14)
  1072.                 {
  1073.                     spawnactor(Dweller1,0,150,-200);
  1074.                 }
  1075.                 elseif(CurrentActor<=15)
  1076.                 {
  1077.                     spawnactor(Dweller3,0,150,-200);
  1078.                 }
  1079.                 elseif(CurrentActor<=16)
  1080.                 {
  1081.                     spawnactor(subgirl1,0,150,-200);
  1082.                 }
  1083.                 elseif(CurrentActor<=17)
  1084.                 {
  1085.                     spawnactor(subgirl2,0,150,-200);
  1086.                 }
  1087.                 elseif(CurrentActor<=18)
  1088.                 {
  1089.                     spawnactor(MDroid1,0,150,-200);
  1090.                 }
  1091.                 elseif(CurrentActor<=19)
  1092.                 {
  1093.                     spawnactor(MDroid2,0,150,-200);
  1094.                 }
  1095.                 elseif(CurrentActor<=20)
  1096.                 {
  1097.                     spawnactor(rat,0,150,-200);
  1098.                 }
  1099.                 elseif(CurrentActor<=21)
  1100.                 {
  1101.                     spawnactor(Candy,0,150,-200);
  1102.                 }
  1103.                 elseif(CurrentActor<=22)
  1104.                 {
  1105.                     spawnactor(barman,0,150,-200);
  1106.                 }
  1107.                 elseif(CurrentActor<=23)
  1108.                 {
  1109.                     spawnactor(scientist,0,150,-200);
  1110.                 }
  1111.                 elseif(CurrentActor<=24)
  1112.                 {
  1113.                     spawnactor(priest,0,150,-200);
  1114.                 }
  1115.                 elseif(CurrentActor<=25)
  1116.                 {
  1117.                     spawnactor(chotbeast,0,150,-200);
  1118.                 }
  1119.                 elseif(CurrentActor<=26)
  1120.                 {
  1121.                     spawnactor(GunTurret,0,-35,-200);
  1122.                 }
  1123.                 elseif(CurrentActor<=27)
  1124.                 {
  1125.                     spawnactor(RocketLauncher,0,-54,-200);
  1126.                 }
  1127.                 elseif(CurrentActor<=28)
  1128.                 { 
  1129.                     spawnactor(Pimp,0,150,-200);
  1130.                 }
  1131.                 elseif(CurrentActor<=29)
  1132.                 { 
  1133.                     spawnactor(chot2,0,150,-200);
  1134.                 }
  1135.                 elseif(CurrentActor<=30)
  1136.                 { 
  1137.                     spawnactor(bouncer,0,150,-200);
  1138.                 }
  1139.                 elseif(CurrentActor<=31)
  1140.                 { 
  1141.                     spawnactor(evilbob,0,150,-200);
  1142.                 }
  1143.                 elseif(CurrentActor<=32)
  1144.                 { 
  1145.                     spawnactor(djkyd,0,150,-200);
  1146.                 }
  1147.                 elseif(CurrentActor<=33)
  1148.                 { 
  1149.                     spawnactor(satan,0,150,-200);
  1150.                 }
  1151.                 elseif(CurrentActor<=34)
  1152.                 { 
  1153.                     spawnactor(DefensiveBot,0,150,-200);
  1154.                 }
  1155.                 elseif(CurrentActor<=35)
  1156.                 { 
  1157.                     spawnactor(CompanionBot,0,150,-200);
  1158.                 }
  1159.                 elseif(CurrentActor<=36)
  1160.                 { 
  1161.                     spawnactor(TransportBot,0,150,-200);
  1162.                 }
  1163.                 elseif(CurrentActor<=37)
  1164.                 { 
  1165.                     spawnactor(OffensiveBot,0,150,-200);
  1166.                 }
  1167.                 elseif(CurrentActor<=38)
  1168.                 { 
  1169.                     spawnactor(Dweller2,0,150,-200);
  1170.                 }
  1171.                 elseif(CurrentActor<=39)
  1172.                 { 
  1173.                     spawnactor(victimmale,0,150,-200);
  1174.                 }
  1175.                 elseif(CurrentActor<=40)
  1176.                 { 
  1177.                     spawnactor(VictimFeMale,0,150,-200);
  1178.                 }
  1179.                 elseif(CurrentActor<=41)
  1180.                 { 
  1181.                     spawnactor(FemDweller1,0,150,-200);
  1182.                 }
  1183.                 elseif(CurrentActor<=42)
  1184.                 { 
  1185.                     spawnactor(FemDweller2,0,150,-200);
  1186.                 }
  1187.                 elseif(CurrentActor<=43)
  1188.                 { 
  1189.                     spawnactor(prost2,0,150,-200);
  1190.                 }
  1191.                 elseif(CurrentActor<=44)
  1192.                 { 
  1193.                     spawnactor(copr,0,150,-200);
  1194.                 }
  1195.                 elseif(CurrentActor<=45)
  1196.                 { 
  1197.                     spawnactor(GunCommander,0,150,-200);
  1198.                 }
  1199.                 elseif(CurrentActor<=46)
  1200.                 { 
  1201.                     spawnactor(nun,0,150,-200);
  1202.                 }
  1203.                 elseif(CurrentActor<=47)
  1204.                 { 
  1205.                     spawnactor(chotdwarf,0,150,-200);
  1206.                 }
  1207.                 elseif(CurrentActor<=48)
  1208.                 { 
  1209.                     spawnactor(shellturret,0,150,-200);
  1210.                 }
  1211.  
  1212.                 
  1213.  
  1214.  
  1215.  
  1216.                 //else
  1217.                 //{
  1218.                 //    float(_set,DebugOnlyOneEnemy,0)
  1219.                 //}
  1220.             }
  1221.         //}
  1222.         //else
  1223.         //{
  1224.         //    float(_sub,DebugOnlyOneEnemy,1)
  1225.         //}
  1226.     }
  1227. }
  1228.  
  1229. SubRoutine(Sub_SpawnWeapons)
  1230. {
  1231.     if(VAICon==0)
  1232.     {
  1233.         if(VKey==KEY_8 && VKey!=KEY_RSHIFT)
  1234.         {
  1235.             float(_add,CurrentWeapon,0.5);
  1236.             if(CurrentWeapon>=13)
  1237.             {
  1238.                 float(_set,CurrentWeapon,13);
  1239.             }
  1240.         }
  1241.         elseif(VKey==KEY_7 && VKey!=KEY_RSHIFT)
  1242.         {
  1243.             float(_sub,CurrentWeapon,0.5);
  1244.             if(CurrentWeapon<0)
  1245.             {
  1246.                 float(_set,CurrentWeapon,0);
  1247.             }
  1248.         }
  1249.  
  1250.  
  1251.         if(CurrentWeapon<=0)
  1252.         {
  1253.             dmessage("NEXT WEAPON: (1) PUMPGUN",310,10);
  1254.         }
  1255.         elseif(CurrentWeapon<=1)
  1256.         {
  1257.             dmessage("NEXT WEAPON: (2) HARPOON",310,10);
  1258.         }
  1259.         elseif(CurrentWeapon<=2)
  1260.         {
  1261.             dmessage("NEXT WEAPON: (3) FLAMETHROWER",310,10);
  1262.         }
  1263.         elseif(CurrentWeapon<=3)
  1264.         {
  1265.             dmessage("NEXT WEAPON: (4) BAZOOKA",310,10);
  1266.         }
  1267.         elseif(CurrentWeapon<=4)
  1268.         {
  1269.             dmessage("NEXT WEAPON: (5) TORCH",310,10);
  1270.         }
  1271.         elseif(CurrentWeapon<=5)
  1272.         {
  1273.             dmessage("NEXT WEAPON: (6) MAIMER",310,10);
  1274.         }
  1275.         elseif(CurrentWeapon<=6)
  1276.         {
  1277.             dmessage("NEXT WEAPON: (7) MACHINE GUN",310,10);
  1278.         }
  1279.         elseif(CurrentWeapon<=7)
  1280.         {
  1281.             dmessage("NEXT WEAPON: (8) PAK / ICE GUN",310,10);
  1282.         }
  1283.         elseif(CurrentWeapon<=8)
  1284.         {
  1285.             dmessage("NEXT WEAPON: (9) BUZZ SAW",310,10);
  1286.         }
  1287.         elseif(CurrentWeapon<=9)
  1288.         {
  1289.             dmessage("NEXT WEAPON: (10) AMMO WEAPONS",310,10);
  1290.         }
  1291.         elseif(CurrentWeapon<=10)
  1292.         {
  1293.             dmessage("NEXT WEAPON: (11) AMMO GRENADES",310,10);
  1294.         }
  1295.         elseif(CurrentWeapon<=11)
  1296.         {
  1297.             dmessage("NEXT WEAPON: (12) BATTERY GRABBER",310,10);
  1298.         }
  1299.         elseif(CurrentWeapon<=12)
  1300.         {
  1301.             dmessage("NEXT WEAPON: (13) BATTERY",310,10);
  1302.         }
  1303.         elseif(CurrentWeapon<=13)
  1304.         {
  1305.             dmessage("NEXT WEAPON: (14) MASER",310,10);
  1306.         }
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312. //        if(DebugOnlyOneWeapon==0)
  1313. //        {
  1314.             //float(_set,DebugOnlyOneWeapon,3)
  1315.  
  1316.             if(VKey==KEY_9 && VKey!=KEY_RSHIFT)
  1317.             {
  1318.                 if(CurrentWeapon<=0)
  1319.                 {
  1320.                     spawnactor(WeaponPumpGun,0,150,-200);
  1321.                 }
  1322.                 elseif(CurrentWeapon<=1)
  1323.                 {
  1324.                     spawnactor(WeaponHarpoon,0,150,-200);
  1325.                 }
  1326.                 elseif(CurrentWeapon<=2)
  1327.                 {
  1328.                     spawnactor(WeaponFlameThrower,0,150,-200);
  1329.                 }
  1330.                 elseif(CurrentWeapon<=3)
  1331.                 {
  1332.                     spawnactor(WeaponBazooka,0,150,-200);
  1333.                 }
  1334.                 elseif(CurrentWeapon<=4)
  1335.                 {
  1336.                     spawnactor(WeaponTorch,0,150,-200);
  1337.                 }
  1338.                 elseif(CurrentWeapon<=5)
  1339.                 {
  1340.                     spawnactor(WeaponMaimer,0,150,-200);
  1341.                 }
  1342.                 elseif(CurrentWeapon<=6)
  1343.                 {
  1344.                     spawnactor(WeaponMachineGun,0,150,-200);
  1345.                 }
  1346.                 elseif(CurrentWeapon<=7)
  1347.                 {
  1348.                     spawnactor(WeaponPAK,0,150,-200);
  1349.                 }
  1350.                 elseif(CurrentWeapon<=8)
  1351.                 {
  1352.                     spawnactor(WeaponBuzzSaw,0,150,-200);
  1353.                 }
  1354.                 elseif(CurrentWeapon<=9)
  1355.                 {
  1356.                     spawnactor(WeaponAmmo,0,150,-200);
  1357.                 }
  1358.                 elseif(CurrentWeapon<=10)
  1359.                 {
  1360.                     spawnactor(WeaponAmmoGrenade,0,150,-200);
  1361.                 }
  1362.                 elseif(CurrentWeapon<=11)
  1363.                 {
  1364.                     spawnactor(WeaponBatteryGrabber,0,150,-200);
  1365.                 }
  1366.                 elseif(CurrentWeapon<=12)
  1367.                 {
  1368.                     spawnactor(BulletBattery,0,150,-200);
  1369.                 }
  1370.                 elseif(CurrentWeapon<=13)
  1371.                 {
  1372.                     spawnactor(WeaponMaser,0,150,-200);
  1373.                 }
  1374.  
  1375.  
  1376.                 //else
  1377.                 //{
  1378.                 //    float(_set,DebugOnlyOneWeapon,0)
  1379.                 //}
  1380.             }
  1381. //        }
  1382. //        else
  1383. //        {
  1384. //            float(_sub,DebugOnlyOneWeapon,1)
  1385. //        }
  1386.     }
  1387. }
  1388.  
  1389.  
  1390.  
  1391. SubRoutine(BackGroundTriggerChecks)
  1392. {
  1393.         //printi("Health:",VHealth);
  1394.         float(_seti,ColAngleTmp,VColAngle);
  1395.         float(_seti,ColAngleTmpFace,VColAngleFace);
  1396.         float(_seti,ColMaterial,VColMaterialProperties);
  1397.  
  1398.         if(VCheatKeys==1)
  1399.         {
  1400.             callsub(Sub_SpawnCharacters);    //DEBUG
  1401.             callsub(Sub_SpawnWeapons);        //DEBUG
  1402.             callsub(Sub_SpawnActors);        //DEBUG
  1403.  
  1404.             if(vkey!=KEY_LSHIFT && vkey!=KEY_RSHIFT)
  1405.             {
  1406.                 if(vkey==KEY_G)
  1407.                 {
  1408.                     float(_set,aitoggle,0);        //ai on, ie: proc. copgen/femgen
  1409.                     dmessage("-- AI ENABLED --",30,150);
  1410.                 }
  1411.                 elseif(vkey==KEY_H)
  1412.                 {
  1413.                     float(_set,aitoggle,1);        //ai off
  1414.                     dmessage("-- AI DISABLED --",30,150);
  1415.                 }
  1416.             }
  1417.             else
  1418.             {
  1419.                 if(vkey==KEY_G)
  1420.                 {
  1421.                     float(_set,aivisiontoggle,0);        //ai on, ie: proc. copgen/femgen
  1422.                     dmessage("-- AI VISION ENABLED --",30,150);
  1423.                 }
  1424.                 elseif(vkey==KEY_H)
  1425.                 {
  1426.                     float(_set,aivisiontoggle,1);        //ai off
  1427.                     dmessage("-- AI VISION DISABLED --",30,150);
  1428.                 }
  1429.             }
  1430.  
  1431.             if(VKey==KEY_B && VKey==KEY_RSHIFT)
  1432.             {
  1433.                 if(VAIClass==_AIClassAngel)
  1434.                 {
  1435.                     call(ModelAmbient,255,255,255);
  1436.                 }
  1437.                 else
  1438.                 {
  1439.                     call(ModelAmbient,255,255,255);
  1440.                 }
  1441.             }                
  1442.             if(VKey==KEY_B)
  1443.             {
  1444.                 if(CrankAmbient<=30000)
  1445.                 {
  1446.                     float(_add,CrankAmbient,100);
  1447.                 }
  1448.                 if(VAIClass==_AIClassAngel)
  1449.                 {
  1450.                     call(ModelAmbient,CrankAmbient,CrankAmbient,CrankAmbient);
  1451.                 }
  1452.                 else
  1453.                 {
  1454.                     call(ModelAmbient,CrankAmbient,CrankAmbient,CrankAmbient);
  1455.                 }
  1456.             }
  1457.             if(VKey==KEY_N)
  1458.             {
  1459.                 if(CrankAmbient>0)
  1460.                 {
  1461.                     float(_sub,CrankAmbient,100);
  1462.                 }
  1463.                 if(VAIClass==_AIClassAngel)
  1464.                 {
  1465.                     call(ModelAmbient,CrankAmbient,CrankAmbient,CrankAmbient);
  1466.                 }
  1467.                 else
  1468.                 {
  1469.                     call(ModelAmbient,CrankAmbient,CrankAmbient,CrankAmbient);
  1470.                 }
  1471.             }
  1472.  
  1473.             if(VKey==KEY_RBRACKET)
  1474.             {
  1475.                 call(GodModeStatus,true);
  1476.                 dmessage("GOD MODE",30,150);
  1477.             }
  1478.             elseif(VKey==KEY_LBRACKET)
  1479.             {
  1480.                 call(GodModeStatus,false);
  1481.                 dmessage("MORTAL MODE",30,150);
  1482.             }
  1483.         }
  1484.  
  1485.  
  1486.         if(VKey==KEY_RSHIFT && VKey==KEY_T)
  1487.         {
  1488.             float(_seti,TmpFloat,VGameCounter);
  1489.             float(_sub,TmpFloat,LastTuturialChange);
  1490.             if(TmpFloat>4)
  1491.             {
  1492.                 float(_seti,LastTuturialChange,VGameCounter);
  1493.  
  1494.                 if(tutorialtoggle==0)
  1495.                 {
  1496.                     float(_set,tutorialtoggle,1);
  1497.                     message("Tutorial On",200,10);
  1498.                 }
  1499.                 elseif(tutorialtoggle==1)
  1500.                 {
  1501.                     float(_set,tutorialtoggle,0);
  1502.                     message("Tutorial Off",200,10);
  1503.                 }
  1504.             }
  1505.         }
  1506.  
  1507.  
  1508.         direction(_clr,_DIRTempFlag);
  1509.  
  1510.         call(CheckTriggers);
  1511.         
  1512.         if(vAICon==0)
  1513.         {
  1514.             if(VClass==_ClassAngel)
  1515.             {
  1516.                 call(CheckForPickup,4,_ClassPickup);    //pickups only
  1517.             }
  1518.             else
  1519.             {
  1520.                 call(CheckForPickup,8,_ClassAmmoPickup);    //Both ammo and pickups
  1521.             }
  1522.             vector(_settoactorpos,PlayerPos);
  1523.         }
  1524.  
  1525.         if(VCurScene==1)
  1526.         {    
  1527.             CallSub(BackGroundTriggerChecksScene1)
  1528.         }
  1529.         elseif(VCurScene==2)
  1530.         {
  1531.             CallSub(BackGroundTriggerChecksScene2)
  1532.         }
  1533.         elseif(VCurScene==3)
  1534.         {
  1535.             CallSub(BackGroundTriggerChecksScene3)
  1536.         }
  1537.         elseif(VCurScene==4)
  1538.         {
  1539.             CallSub(BackGroundTriggerChecksScene4)
  1540.         }
  1541.         elseif(VCurScene==5)
  1542.         {
  1543.             CallSub(BackGroundTriggerChecksScene5)
  1544.         }
  1545.         elseif(VCurScene==6)
  1546.         {
  1547.             CallSub(BackGroundTriggerChecksScene6)
  1548.         }
  1549.         elseif(VCurScene==7)
  1550.         {
  1551.             CallSub(BackGroundTriggerChecksScene7)
  1552.         }
  1553.         elseif(VCurScene==8)
  1554.         {
  1555.             CallSub(BackGroundTriggerChecksScene8)
  1556.         }
  1557.         elseif(VCurScene==9)
  1558.         {
  1559.             CallSub(BackGroundTriggerChecksScene9)
  1560.         }
  1561.         elseif(VCurScene==10)
  1562.         {
  1563.             CallSub(BackGroundTriggerChecksScene10)
  1564.         }
  1565.         elseif(VCurScene==11)
  1566.         {
  1567.             CallSub(BackGroundTriggerChecksScene11)
  1568.         }
  1569.         elseif(VCurScene==12)
  1570.         {
  1571.             CallSub(BackGroundTriggerChecksScene12)
  1572.         }
  1573.         elseif(VCurScene==13)
  1574.         {
  1575.             CallSub(BackGroundTriggerChecksScene13)
  1576.         }
  1577.         elseif(VCurScene==14)
  1578.         {
  1579.             CallSub(BackGroundTriggerChecksScene14)
  1580.         }
  1581.         elseif(VCurScene==15)
  1582.         {
  1583.             CallSub(BackGroundTriggerChecksScene15)
  1584.         }
  1585.         elseif(VCurScene==16)
  1586.         {
  1587.             CallSub(BackGroundTriggerChecksScene16)
  1588.         }
  1589.         elseif(VCurScene==17)
  1590.         {
  1591.             CallSub(BackGroundTriggerChecksScene17)
  1592.         }
  1593.         elseif(VCurScene==18)
  1594.         {
  1595.             CallSub(BackGroundTriggerChecksScene18)
  1596.         }
  1597.         elseif(VCurScene==19)
  1598.         {
  1599.             CallSub(BackGroundTriggerChecksScene19)
  1600.         }
  1601. }
  1602.  
  1603. SubRoutine(ReadKeyJoy)
  1604. {
  1605.         Direction(_clr,_DIRairemoveflags);
  1606.         Direction(_clr,_DIRdepossesion);
  1607.         Direction(_clr,_DIRcrouch);
  1608.  
  1609.         if(VAnalog2<-0.7||VAnalog2>0.7||VAnalog3>0.7||VAnalog3<-0.7)
  1610.         {
  1611.             Direction(_clr,_DIRwalking);
  1612. //Running (The 0.6 and 0.7 barriers are selected to ease diagonal movement. Do not set to the same value!)
  1613.             if(VAnalog2<=-0.6)            //Threshold here must be higher than when walking
  1614.             {
  1615.                 Direction(_set,_DIRbackward);
  1616.             }
  1617.             elseif(VAnalog2>=0.6)
  1618.             {
  1619.                 Direction(_set,_DIRforward);
  1620.             }
  1621.             if(VAnalog3<=-0.6)
  1622.             {
  1623.                 Direction(_set,_DIRsideleft);
  1624.             }
  1625.             elseif(VAnalog3>=0.6)
  1626.             {
  1627.                 Direction(_set,_DIRsideright);
  1628.             }
  1629.         }
  1630.         elseif(VAnalog2<-0.3||VAnalog2>0.3||VAnalog3>0.3||VAnalog3<-0.3)    //This comparison must be here for easing diagonal walking.
  1631.         {
  1632. //walking
  1633.             Direction(_set,_DIRwalking);
  1634.             if(VAnalog2<=-0.20)
  1635.             {
  1636.                 Direction(_set,_DIRbackward);
  1637.             }
  1638.             elseif(VAnalog2>=0.20)
  1639.             {
  1640.                 Direction(_set,_DIRforward);
  1641.             }
  1642.             if(VAnalog3<=-0.20)
  1643.             {
  1644.                 Direction(_set,_DIRsideleft);
  1645.             }
  1646.             elseif(VAnalog3>=0.20)
  1647.             {
  1648.                 Direction(_set,_DIRsideright);
  1649.             }
  1650.         }
  1651.  
  1652.         if(VAnalog1>0)
  1653.         {
  1654.             Direction(_set,_DIRright)
  1655.         }
  1656.         elseif(VAnalog1<0)
  1657.         {
  1658.             Direction(_set,_DIRleft)
  1659.         }
  1660.  
  1661.         if(VInput==_SXIbutton1)
  1662.         {
  1663.             Direction(_set,_DIRjump);
  1664.         }
  1665.         if(VInput==_SXIbutton2)
  1666.         {
  1667.  
  1668.             Direction(_set,_DIRaction);
  1669.  
  1670.         }
  1671.  
  1672.         if(VInput==_SXIbutton6)
  1673.         {
  1674.             Direction(_set,_DIRdepossesion)
  1675.         }
  1676.         if(VInput==_SXIbutton7)
  1677.         {
  1678.             Direction(_set,_DIRcrouch);
  1679.         }
  1680.  
  1681.         if(VInput==_SXIbutton8 && VOInput!=_SXIbutton8)
  1682.         {
  1683.             if(SniperMode==0)
  1684.             {
  1685.                 call(ChangeSniperMode,1,0);
  1686.             }
  1687.             else
  1688.             {
  1689.                 call(ChangeSniperMode,1,1);
  1690.             }
  1691.         }
  1692.         if(VInput==_SXIbutton9 && VOInput!=_SXIbutton9)
  1693.         {
  1694.             if(SniperMode==0)
  1695.             {
  1696.                 call(ChangeSniperMode,-1,0);
  1697.             }
  1698.             else
  1699.             {
  1700.                 call(ChangeSniperMode,-1,1);
  1701.             }
  1702.         }
  1703.  
  1704.         if(VInput==_SXIbutton10 && VOInput==_SXIbutton10)
  1705.         {
  1706.             if(VFreeLook==0)
  1707.             {
  1708.                 call(FreeLook,TRUE);
  1709.             }
  1710.         }
  1711.         elseif(VFreeLook!=0)
  1712.         {
  1713.             call(FreeLook,FALSE);
  1714.         }
  1715.  
  1716.         if(VInput==_SXIbutton11)
  1717.         {
  1718.             call(DisplayObjectives);
  1719.         }
  1720.  
  1721.         if(VInput==_SXIbutton12 && VOInput!=_SXIbutton12)
  1722.         {
  1723.             call(ChangeSniperMode,-2,0);                        //zoom all the way out of snipermode
  1724.         }
  1725.  
  1726.         if(VInput==_SXIbutton3)
  1727.         {
  1728.             Direction(_set,_DIRshoot);
  1729.         }
  1730.         if(VInput==_SXIbutton4)
  1731.         {
  1732.             Direction(_set,_DIRgrenade);
  1733.         }
  1734. /*
  1735.         if(VInput==_SXIbutton5)
  1736.         {
  1737.             Direction(_set,_DIRlaser);
  1738.         }
  1739. */
  1740.         if(VTrigger|=_DIRMoveBits)
  1741.         {
  1742.             Direction(_set,_DIRMove);
  1743.         }
  1744.         else
  1745.         {
  1746.             Direction(_set,_noDIR);
  1747.         }
  1748.  
  1749. }
  1750.  
  1751.  
  1752. #include    "messiahscripts\particles\FlicHeaders.hxx"
  1753. #include    "messiahscripts\particles\ParticleSubs.hxx"
  1754. #include    "messiahscripts\particles\particle.hxx"
  1755.  
  1756. #include    "messiahscripts\enemies\EnemyHeaders.hxx"
  1757. #include    "messiahscripts\weapons\BulletHeaders.hxx"
  1758. #include    "messiahscripts\weapons\WeaponHeaders.hxx"
  1759.  
  1760. #include    "messiahscripts\sound\soundcode.hxx"
  1761.  
  1762. #include    "messiahscripts\enemies\SharedFXCode.hxx"
  1763.  
  1764. #include    "messiahscripts\weapons\BulletWeaponActions.hxx"
  1765. #include    "messiahscripts\weapons\Bullets.hxx"
  1766. #include    "messiahscripts\weapons\Weapons.hxx"
  1767.  
  1768. #include    "messiahscripts\enemies\SharedAnimCode.hxx"
  1769.  
  1770. #include    "messiahscripts\enemies\GenActions.hxx"
  1771.  
  1772. #include    "messiahscripts\bobactions.hxx"
  1773. #include    "messiahscripts\enemies\copactions.hxx"        //Action for Cops and Various Character
  1774. #include    "messiahscripts\enemies\chot1.hxx"            //Specific Actions For Chots
  1775. #include    "messiahscripts\enemies\femactions.hxx"
  1776. //#include    "messiahscripts\enemies\SubGirlActions.hxx"    //obsolete
  1777. //#include    "messiahscripts\enemies\domactions.hxx"        //obsolete
  1778. #include    "messiahscripts\enemies\abeastactions.hxx"
  1779. #include    "messiahscripts\enemies\beastactions.hxx"
  1780. #include    "messiahscripts\enemies\satanactions.hxx"
  1781.  
  1782. #include    "messiahscripts\enemies\shared.hxx"            //shared subroutines
  1783. #include    "messiahscripts\enemies\sharedMove.hxx"        //more shared subroutines
  1784. #include    "messiahscripts\enemies\SharedAIMove.hxx"    //shared subroutines for AI control
  1785.  
  1786. #include    "messiahscripts\enemies\sharedPain.hxx"        //more shared subroutines
  1787.  
  1788. #include    "messiahscripts\bob5.hxx"
  1789.  
  1790. #include    "messiahscripts\StagesEnemies.hxx"
  1791.