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

  1.  
  2. //reload delayer for AI, ie: how many shots they fire before reloading!
  3. #define    PUMPGUN_RELOADDELAY        5
  4. #define    HARPOON_RELOADDELAY        3
  5. #define    BAZOOKA_RELOADDELAY        5
  6. #define    MAIMER_RELOADDELAY        20
  7. #define    MACHGUN_RELOADDELAY        35
  8. #define    PAK_RELOADDELAY            15
  9. #define    MASER_RELOADDELAY        1
  10.  
  11.  
  12.  
  13. //make sure WeaponPos is set before calling this!!
  14. SubRoutine(Sub_WeaponTarget)
  15. {
  16.         call(wCheckWeaponTarget,EmptyVector,32767,WeaponPos);
  17. /*
  18.         if(VLockedColBone==3||VLockedColBone==4)
  19.         {
  20.             sample(SFXLowOnAmmo,-1);
  21.             //sample(SFXLowOnHealth,-1);
  22.         }
  23.  
  24.         if(VLockedColBone==2 && VSniperMode!=0 && VCoreAICon==0 && heartbeatsfx==0)
  25.         {
  26.             float(_set,heartbeatsfx,1);
  27.             //sample(SFXHeartBeat,-1);
  28.         }
  29.         elseif(heartbeatsfx==1 && VLockedColBone!=4)
  30.         {
  31.             float(_set,heartbeatsfx,0);
  32.             //samplestop(SFXHeartBeat);
  33.         }
  34. */
  35. }
  36.  
  37.  
  38.  
  39. SubRoutine(Sub_WeaponHandler,float(weaponcollision))
  40. {
  41.         if(vstate!=StateAttached)
  42.         {
  43.             call(ModelAmbient,WeaponFaderCol,WeaponFaderCol,WeaponFaderCol);
  44.  
  45.             if(vactivetime==0)
  46.             //if(VActorFlag==_AFLAGinitialize)
  47.             {
  48.                 turn(1024,0,0);
  49.             }
  50.             if(vactivetime==1)
  51.             {
  52.                 collision(0,-70,0,0,70,0);
  53.                 if(VColFlag==_DIRvercol)
  54.                 {
  55.                     turn(0,0,1024);
  56.                 }
  57.                 else
  58.                 {
  59.                     collision(0,70,0,0,-70,0);
  60.                     if(VColFlag==_DIRvercol)
  61.                     {
  62.                         turn(0,0,1024);
  63.                     }
  64.                 }
  65.             }
  66.  
  67.             if(VState!=StateDead)                //cheatflag, "dead" weapons don't rotate
  68.             {
  69.                 /*
  70.                 collision(0,-70,0,0,70,0);
  71.                 if(VColFlag==_DIRvercol)
  72.                 {
  73.                     float(_xor,weaponcollision,1);
  74.                 }
  75.                 else
  76.                 {
  77.                     collision(0,70,0,0,-70,0);
  78.                     if(VColFlag==_DIRvercol)
  79.                     {
  80.                         float(_xor,weaponcollision,1);
  81.                     }
  82.                 }
  83.  
  84.                 if(weaponcollision==1)
  85.                 {
  86.                     turn(0,0,-16);
  87.                 }
  88.                 else
  89.                 {
  90.                     turn(0,0,16);
  91.                 }
  92.                 */
  93.                 turn(0,0,16);
  94.             }
  95.         }
  96.         else
  97.         {
  98.             call(ModelAmbient,255,255,255);
  99.         }
  100. }
  101.  
  102.  
  103. SubRoutine(Sub_GunTurretHandler)
  104. {
  105.     print("side :");
  106.     if(VTrigger==_DIRshoot)
  107.     {
  108.         if(GunSamFlag==0)
  109.         {
  110.             sample(SFXMachineGunFire2,-1);
  111.             float(_set,GunSamFlag,1);
  112.         }
  113.  
  114.         if(side==0)
  115.         {
  116.             vector(_set,tmpvector,30,-10,70);
  117.             SpawnActorKFObj(BulletTurret,tmpvector,Gactorpos,Gactorine,false);
  118.             spawnparticle(fx_TurFlash,-2,Gactorpos,Gactorine,fx_gunflashhorizac);
  119.             spawnparticle(fx_TurFlash,-2,Gactorpos,Gactorine,fx_gunflashvertac);
  120.             spawnparticle(fx_TurFlash,-2,Gactorpos,Gactorine,fx_gunflashdiag1ac);
  121.             spawnparticle(fx_TurFlash,-2,Gactorpos,Gactorine,fx_gunflashdiag2ac);
  122.         }
  123.         else
  124.         {
  125.             vector(_set,tmpvector,-30,-10,70);
  126.             SpawnActorKFObj(BulletTurret,tmpvector,Gactorpos,Gactorine,false);
  127.             spawnparticle(fx_TurFlash,-2,Gactorpos,Gactorine,fx_gunflashhorizac);
  128.             spawnparticle(fx_TurFlash,-2,Gactorpos,Gactorine,fx_gunflashvertac);
  129.             spawnparticle(fx_TurFlash,-2,Gactorpos,Gactorine,fx_gunflashdiag1ac);
  130.             spawnparticle(fx_TurFlash,-2,Gactorpos,Gactorine,fx_gunflashdiag2ac);
  131.         }
  132.         float(_xor,side,1);
  133.  
  134.         //call(screenshake,4,0,4,0.8);
  135.  
  136.     }
  137.     if(VTrigger!=_DIRshoot)
  138.     {
  139.         if(GunSamFlag==1)
  140.         {
  141.             samplestop(SFXMachineGunFire2);
  142.             float(_set,GunSamFlag,0);
  143.         }
  144.     }
  145. }
  146.  
  147. Actor(WeaponAmmo)
  148. {
  149.         file(WeaponAmmoHeader);
  150.         startaction(nomove);
  151.         float(_declare,weaponcollider,0);
  152.         callsub(Sub_WeaponHandler,weaponcollider);
  153. }
  154.  
  155. Actor(WeaponAmmoGrenade)
  156. {
  157.         file(WeaponAmmoGrenadesHeader);
  158.         startaction(nomove);
  159.         float(_declare,weaponcollider,0);
  160.         callsub(Sub_WeaponHandler,weaponcollider);
  161. }
  162.  
  163. Actor(WeaponBaton)
  164. {
  165.         file(WeaponBatonHeader);
  166.         startaction(nomove);
  167.         float(_declare,weaponcollider,0);
  168.         callsub(Sub_WeaponHandler,weaponcollider);
  169.         if(VTrigger==_DIRshoot)
  170.         {
  171.         }
  172. }
  173.  
  174.  
  175.  
  176.  
  177.  
  178. Actor(WeaponFlameThrower)
  179. {
  180.         file(WeaponFlameThrowerHeader);
  181.         startaction(nomove);
  182.  
  183.         call(SetParticleSetID);
  184.  
  185.         float(_declare,weaponcollider,0);
  186.         callsub(Sub_WeaponHandler,weaponcollider);
  187.  
  188.         float(_declare,flag_ft1,0);
  189.         float(_declare,flag_ft2,0);
  190.         float(_declare,flag_ft3,0);
  191.  
  192.         if(vstate==StateAttached)
  193.         {
  194.             if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  195.             {
  196.                 vector(_set,WeaponPos,0,80,0);
  197.                 callsub(Sub_WeaponTarget);
  198.             }
  199.  
  200.             float(_declare,ft_flipflop,0);
  201.  
  202.             //empty gun sample
  203.             if(VTrigger==_DIRShoot && VInventoryLeft<=0 && VCoreAICon==0)
  204.             {
  205.                 sample(SFXWeaponEmpty,-1);
  206.             }
  207.  
  208.             //FIRING WEAPON
  209.             if(VTrigger==_DIRShoot && VInventoryLeft>0)
  210.             {
  211.                 if(flag_ft2>6)
  212.                 {
  213.                     //FIRING WEAPON
  214.                     spawnactor(BulletFlameThrower,0,80,0);
  215.  
  216.                     if(VTrigger==_DIRBulletFired)
  217.                     {
  218.                         call(ChangeInventory,0,-1);
  219.                     }
  220.  
  221.                     if(vrnd<50)
  222.                     {
  223.                         vector(_set,tmpvector,255,32,16);
  224.                         vector(_set,gactorpos,0,32,0);
  225.                         spawnlight(Lomnilight2,0,gactorpos,tmpvector,EmptyVector,400);
  226.                     }
  227.  
  228.                     float(_rnd2,tmpfloat,8);    //7
  229.                     float(_add,tmpfloat,12);    //11
  230.  
  231.                     vector(_declare,ft_pos1,0,0,0);
  232.                     vector(_declare,ft_ine1,0,0,0);
  233.                     vector(_set,ft_pos1,0,50,-10);
  234.                     vector(_set,ft_ine1,0,0,0);
  235.                     vector(_sety,ft_ine1,tmpfloat);
  236. /*
  237.                     if(VSniperMode!=0)
  238.                     {
  239.                         vector(_target,fxvector);
  240.                         vector(_copyy,fxvector,fxfloat);
  241.                         float(_mul,fxfloat,tmpfloat);
  242.                         float(_mul,fxfloat,-1);
  243.                         vector(_setz,ft_ine1,fxfloat);
  244.                         float(_add,fxfloat,-10);
  245.                         vector(_setz,ft_pos1,fxfloat);
  246.                     }
  247. */
  248.                     if(vtrigger==_DIRforward)
  249.                     {
  250.                         vector(_set,tmpvector,0,30,0);
  251.                         vector(_add,ft_pos1,tmpvector);
  252.                     }
  253.  
  254.                     if(ft_flipflop==0)
  255.                     {
  256.                         spawnparticle(fx_flamethrowerroast,0,ft_pos1,ft_ine1,fx_flipu);
  257.                         float(_set,ft_flipflop,1);
  258.                     }
  259.                     else
  260.                     {
  261.                         spawnparticle(fx_flamethrowerroast,0,ft_pos1,ft_ine1,-1);
  262.                         float(_set,ft_flipflop,0);
  263.                     }
  264.                 }
  265.                 else
  266.                 {
  267.                     if(flag_ft2==0)
  268.                     {
  269.                         //IGNITE WEAPON
  270.                         samplestop(SFXFlameThrowerIdle);
  271.                         sample(SFXFlameThrowerIgnite,-1);
  272.                     }
  273.                     elseif(flag_ft2==6)
  274.                     {
  275.                         //STOP IDLE/START ROAST
  276.                         sample(SFXFlameThrowerRoast,-1);
  277.                         float(_set,flag_ft1,1);
  278.                         float(_set,flag_ft3,0);
  279.                     }
  280.  
  281.                     float(_add,flag_ft2,1);
  282.                 }
  283.             }
  284.             else
  285.             {
  286.                 if(flag_ft1==0)
  287.                 {
  288.                     if(VInventoryLeft>0)
  289.                     {
  290.                         //IDLE WEAPON
  291.                         if(VSniperMode==0)
  292.                         {
  293.                             float(_rnd2,tmpfloat,2);
  294.                             float(_add,tmpfloat,2);
  295.  
  296.                             vector(_declare,ft_pos2,0,70,-10);
  297.                             vector(_declare,ft_ine2,0,4,0);
  298.                             vector(_set,ft_pos2,0,70,-10);
  299.                             vector(_set,ft_ine2,0,0,0);
  300.                             vector(_sety,ft_ine2,tmpfloat);
  301.                             spawnparticle(fx_flamethrowerburn,0,ft_pos2,ft_ine2,-1);
  302.                         }
  303.  
  304.                         if(flag_ft3==0)
  305.                         {
  306.                             sample(SFXFlameThrowerIdle,-1);
  307.                             float(_set,flag_ft3,1);
  308.                         }
  309.                     }
  310.                 }
  311.                 elseif(flag_ft1==1)
  312.                 {
  313.                     //AFTER FIRING WEAPON
  314.                     if(VInventoryLeft>0)
  315.                     {
  316.                         vector(_set,tmpvector,0,70,0);
  317.                         spawnparticle(fx_weaponsmoke,0,tmpvector,emptyvector,fx_flamethrowsmoke);
  318.                     }
  319.                     samplestop(SFXFlameThrowerRoast);
  320.                 }
  321.                 float(_set,flag_ft2,0);
  322.                 float(_set,flag_ft1,0);
  323.             }
  324.         }
  325.         else
  326.         {
  327.             if(flag_ft3==1)
  328.             {
  329.                 samplestop(SFXFlameThrowerIdle);
  330.                 float(_set,flag_ft3,0);
  331.             }
  332.  
  333.             if(flag_ft1==1)
  334.             {
  335.                 samplestop(SFXFlameThrowerRoast);
  336.             }
  337.  
  338.             float(_set,flag_ft2,0);
  339.             float(_set,flag_ft1,0);
  340.         }
  341. }
  342.  
  343.  
  344.  
  345. Actor(WeaponBuzzSaw)
  346. {
  347.         file(WeaponBuzzSawHeader);
  348.         startaction(WeaponBuzzSawOff);
  349.  
  350.         call(SetParticleSetID);
  351.  
  352.         float(_declare,weaponcollider,0);
  353.         callsub(Sub_WeaponHandler,weaponcollider);
  354.  
  355.         float(_declare,buzzsawinit,0);
  356.         float(_declare,buzzsawsampflag,0);
  357.  
  358.         if(vstate==StateAttached)
  359.         {
  360.             if(buzzsawinit==0)
  361.             {
  362.                 spawnaction(WeaponBuzzSawIdle);
  363.  
  364.                 sample(SFXMeatCutterIdle,-1);
  365.                 float(_set,buzzsawinit,1);
  366.             }
  367.  
  368.             if(VInventoryLeft<=0)
  369.             {
  370.                 samplestop(SFXMeatCutterIdle);
  371.                 if(VAction!=WeaponBuzzSawOff)
  372.                 {
  373.                     spawnaction(WeaponBuzzSawOff);
  374.                 }
  375.             }
  376.  
  377.  
  378.             //empty gun sample
  379.             if(VTrigger==_DIRShoot && VInventoryLeft<=0 && VCoreAICon==0)
  380.             {
  381.                 sample(SFXWeaponEmpty,-1);
  382.             }
  383.  
  384.             if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  385.             {
  386.                 vector(_set,WeaponPos,0,60,15);
  387.                 callsub(Sub_WeaponTarget);
  388.             }
  389.  
  390.             if(VTrigger==_DIRShoot && VInventoryLeft>0)
  391.             {
  392.                 spawnactor(BulletBuzzSaw,0,55,15);
  393.  
  394.                 if(VSniperMode==0)
  395.                 {
  396.                     if(vrnd<25)
  397.                     {
  398.                         vector(_set,tmpvector,0,20,0);
  399.                         spawnparticle(fx_weaponsmoke,0,tmpvector,emptyvector,fx_buzzsawsmokesub);
  400.                     }
  401.                 }
  402.  
  403.                 if(buzzsawsampflag==0)
  404.                 {
  405.                     sample(SFXMeatCutterCut,-1);
  406.                     spawnaction(WeaponBuzzSawRev);
  407.                 }
  408.                 float(_set,buzzsawsampflag,1);
  409.  
  410.  
  411.                 if(VTrigger==_DIRBulletFired)
  412.                 {
  413.                     call(ChangeInventory,0,-1);
  414.                 }
  415.             }
  416.             else
  417.             {
  418.                 if(buzzsawsampflag==1)
  419.                 {
  420.                     spawnaction(WeaponBuzzSawIdle);
  421.                     samplestop(SFXMeatCutterCut);
  422.                 }
  423.                 float(_set,buzzsawsampflag,0);
  424.  
  425.                 if(VInventoryLeft>0)
  426.                 {
  427.                     if(vrnd<0.005)
  428.                     {
  429.                         sample(SFXMeatCutterRev,-1);
  430.                     }
  431.                     elseif(vrnd<8)
  432.                     {
  433.                         if(VSniperMode==0)
  434.                         {
  435.                             vector(_set,tmpvector,0,20,0);
  436.                             spawnparticle(fx_weaponsmoke,0,tmpvector,emptyvector,fx_buzzsawsmokesub);
  437.                         }
  438.                     }
  439.                 }
  440.             }
  441.         }
  442.         else
  443.         {
  444.             if(buzzsawinit==1)
  445.             {
  446.                 spawnaction(WeaponBuzzSawOff);
  447.                 samplestop(SFXMeatCutterIdle);
  448.                 float(_set,buzzsawinit,0);
  449.             }
  450.  
  451.             if(buzzsawsampflag==1)
  452.             {
  453.                 spawnaction(WeaponBuzzSawIdle);
  454.                 samplestop(SFXMeatCutterCut);
  455.             }
  456.             float(_set,buzzsawsampflag,0);
  457.         }
  458. }
  459.  
  460.  
  461.  
  462. Actor(WeaponTorch)
  463. {
  464.         file(WeaponTorchHeader);
  465.         startaction(nomove);
  466.  
  467.         call(SetParticleSetID);
  468.  
  469.         float(_declare,weaponcollider,0);
  470.         callsub(Sub_WeaponHandler,weaponcollider);
  471.  
  472.         float(_declare,torchsampflag,0);
  473.  
  474.         if(vstate==StateAttached)
  475.         {
  476.             if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  477.             {
  478.                 vector(_set,WeaponPos,0,25,-10);
  479.                 callsub(Sub_WeaponTarget);
  480.             }
  481.  
  482.             //empty gun sample
  483.             if(VTrigger==_DIRShoot && VInventoryLeft<=0 && VCoreAICon==0)
  484.             {
  485.                 sample(SFXWeaponEmpty,-1);
  486.             }
  487.  
  488.             if(VTrigger==_DIRShoot && VInventoryLeft>0)
  489.             {
  490.                 spawnactor(BulletTorch,0,25,-10);
  491.  
  492.                 if(VTrigger==_DIRBulletFired)
  493.                 {
  494.                     call(ChangeInventory,0,-1);
  495.  
  496.                     if(VSniperMode==0)
  497.                     {
  498.                         //muzzle flash
  499.                         vector(_set,gactorpos,0,35,-12);
  500.                         spawnparticle(fx_torch,0,Gactorpos,emptyvector,-1);
  501.                         spawnparticle(fx_torch,0,Gactorpos,emptyvector,fx_gunflashvert);
  502.                         spawnparticle(fx_torch,0,Gactorpos,emptyvector,fx_gunflashdiag1);
  503.                         spawnparticle(fx_torch,0,Gactorpos,emptyvector,fx_gunflashdiag2);
  504.                         //muzzle flash
  505.  
  506.                         vector(_set,gactorpos,0,30,-12);
  507.                         spawnparticle(fx_flare,0,gactorpos,emptyvector,fx_torchflareburn);
  508.                     }
  509.                 }
  510.  
  511.                 if(torchsampflag==0)
  512.                 {
  513.                     sample(SFXweapontorch1,-1);
  514.                     sample(SFXweapontorch2,-1);
  515.                     float(_set,torchsampflag,1);
  516.                 }
  517.             }
  518.             else
  519.             {
  520.                 if(VSniperMode==0)
  521.                 {
  522.                     vector(_set,gactorpos,0,30,-12);
  523.                     spawnparticle(fx_flare,0,gactorpos,emptyvector,fx_torchflareidle);
  524.                 }
  525.  
  526.                 if(torchsampflag==1)
  527.                 {
  528.                     samplestop(SFXweapontorch2);
  529.                     float(_set,torchsampflag,0);
  530.                 }
  531.             }
  532.         }
  533.         else
  534.         {
  535.             if(torchsampflag==1)
  536.             {
  537.                 samplestop(SFXweapontorch2);
  538.                 float(_set,torchsampflag,0);
  539.             }
  540.         }
  541. }
  542.  
  543.  
  544.  
  545. Actor(WeaponPAK)
  546. {
  547.         file(WeaponPAKHeader);
  548.         startaction(WeaponPakIdle);
  549.  
  550.         call(SetParticleSetID);
  551.  
  552.         float(_declare,PAKSinAngle,0);
  553.         float(_declare,PAKCosAngle,0);
  554.         float(_declare,PAKAngle,0);
  555.         float(_declare,PAKAddAngle,1365);
  556.  
  557.         float(_declare,flying,0);
  558.         float(_declare,flyingsample,0);
  559.  
  560.         float(_declare,twirly,0);
  561.  
  562.         float(_declare,BulletCounter,PAK_RELOADDELAY);
  563.  
  564.         float(_declare,weaponcollider,0);
  565.         callsub(Sub_WeaponHandler,weaponcollider);
  566.  
  567.         float(_set,twirly,0);
  568.  
  569.         if(vstate==StateAttached)
  570.         {
  571.             if(VAction!=WeaponPakSpin)
  572.             {
  573.                 float(_set,flying,0);
  574.             }
  575.  
  576.             if(VActorFlag==_AFLAGsignalfromparent)
  577.             {
  578.                 float(_set,flying,1);
  579.                 float(_set,twirly,1);
  580.  
  581.                 //Direction(_set,_DIRshoot);
  582.  
  583.                 if(vaction!=WeaponPakSpin)
  584.                 {
  585.                     spawnaction(WeaponPakSpin);
  586.                 }
  587.                 //call(CheckConnections);
  588.             }
  589.  
  590.             if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  591.             {
  592.                 vector(_set,WeaponPos,0,80,0);
  593.                 callsub(Sub_WeaponTarget);
  594.             }
  595.  
  596.             if(flying==1)
  597.             {
  598.                 vector(_set,gactorpos,0,70,0);
  599.  
  600.                 float(_sin,PAKSinAngle,PAKAngle);
  601.                 float(_cos,PAKCosAngle,PAKAngle);
  602.                 float(_mul,PAKSinAngle,12);
  603.                 float(_mul,PAKCosAngle,12);
  604.                 float(_add,PAKAngle,PAKAddAngle);
  605.                 float(_add,PAKAddAngle,32);
  606.                 float(_and,PAKAddAngle,4095);
  607.  
  608.                 vector(_set,gactorine,0,0,0);
  609.                 vector(_setx,gactorine,PAKSinAngle);
  610.                 vector(_setz,gactorine,PAKCosAngle);
  611.  
  612.                 spawnparticle(fx_pakflash,0,gactorpos,gactorine,-1);
  613.  
  614.                 if(flyingsample==0)
  615.                 {
  616.                     sample(SFXPAKFly,-1);
  617.                     float(_set,flyingsample,1);
  618.                 }
  619.             }
  620.             else
  621.             {
  622.                 if(flyingsample==1)
  623.                 {
  624.                     samplestop(SFXPAKFly);
  625.                     float(_set,flyingsample,0);
  626.                 }
  627.  
  628.                 //empty gun sample
  629.                 if(VTrigger==_DIRShoot && VInventoryLeft<=0 && VCoreAICon==0)
  630.                 {
  631.                     sample(SFXWeaponEmpty,-1);
  632.                 }
  633.  
  634.                 if(VTrigger==_DIRShoot && VInventoryLeft>0)
  635.                 {
  636.                     spawnactor(BulletPAK,0,70,-5);
  637.  
  638.                     float(_set,twirly,1);
  639.  
  640.                     if(vaction!=WeaponPakSpin)
  641.                     {
  642.                         spawnaction(WeaponPakSpin);
  643.                     }
  644.  
  645.                     if(VSniperMode==0)
  646.                     {
  647.                         //muzzle flash
  648.                         vector(_set,gactorpos,0,70,0);
  649.  
  650.                         float(_sin,PAKSinAngle,PAKAngle);
  651.                         float(_cos,PAKCosAngle,PAKAngle);
  652.                         float(_mul,PAKSinAngle,12);
  653.                         float(_mul,PAKCosAngle,12);
  654.                         float(_add,PAKAngle,PAKAddAngle);
  655.                         float(_add,PAKAddAngle,32);
  656.                         float(_and,PAKAddAngle,4095);
  657.  
  658.                         vector(_set,gactorine,0,0,0);
  659.                         vector(_setx,gactorine,PAKSinAngle);
  660.                         vector(_setz,gactorine,PAKCosAngle);
  661.                         spawnparticle(fx_pakflash,0,gactorpos,gactorine,-1);
  662.                     }
  663.  
  664.                     if(VTrigger==_DIRBulletFired)
  665.                     {
  666.                         sample(SFXPAKFire,-1);
  667.  
  668.                         Direction(_ClrParent,_DIRshoot|_DIRTempFlag);
  669.                         call(ChangeInventory,0,-1);
  670.                         float(_sub,BulletCounter,1);
  671.                         if(BulletCounter==0&&VCoreAICon!=0)
  672.                         {
  673.                             Direction(_SetParent,_DIRTempFlag);
  674.                             float(_set,BulletCounter,PAK_RELOADDELAY);
  675.                         }
  676.                     }
  677.                 }
  678.             }
  679.         }
  680.         else
  681.         {
  682.             float(_set,flying,0);
  683.             if(flyingsample==1)
  684.             {
  685.                 samplestop(SFXPAKFly);
  686.                 float(_set,flyingsample,0);
  687.             }
  688.         }
  689.  
  690.         if(twirly==0&&vaction!=WeaponPakIdle)
  691.         {
  692.             spawnaction(WeaponPakIdle);
  693.         }
  694. }
  695.  
  696.  
  697. Actor(WeaponBatteryGrabber)
  698. {
  699.         file(WeaponBatteryHeader);
  700.         startaction(nomove);
  701.  
  702.         float(_declare,weaponcollider,0);
  703.         callsub(Sub_WeaponHandler,weaponcollider);
  704.  
  705.         if(vstate!=StateAttached)
  706.         {
  707.             call(ChangeInventory,0,-1);
  708.             call(CheckAttached,_CADropBattery);
  709.         }
  710.  
  711. }
  712.  
  713. Actor(WeaponPumpGun)
  714. {
  715.         file(WeaponPumpGunHeader);
  716.         startaction(nomove);
  717.  
  718.         call(SetParticleSetID);
  719.  
  720.         float(_declare,logoncounter,0);
  721.         float(_declare,logon,0);
  722.         float(_declare,pumpgunsampflag,-1);
  723.         float(_declare,pumpgunsmokeflag,-1);
  724.  
  725.         float(_declare,BulletCounter,PUMPGUN_RELOADDELAY);
  726.  
  727.         float(_declare,weaponcollider,0);
  728.         callsub(Sub_WeaponHandler,weaponcollider);
  729.  
  730.         if(vstate==StateAttached)
  731.         {
  732.             if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  733.             {
  734.                 vector(_set,WeaponPos,0,70,-5);
  735.                 callsub(Sub_WeaponTarget);
  736.             }
  737.  
  738.             //empty gun sample
  739.             if(VTrigger==_DIRShoot && VInventoryLeft<=0 && VCoreAICon==0)
  740.             {
  741.                 //vector(_set,gactorpos,0,50,-15);
  742.                 //vector(_set,gactorine,0,500,-15);
  743.                 //spawnparticle(fx_flare,0,gactorpos,emptyvector,fx_coplaserflarered);
  744.                 //spawnparticle(fx_coplaser,0,gactorpos,gactorine,-1);
  745.                 sample(SFXWeaponEmpty,-1);
  746.             }
  747.  
  748.             if(VActorFlag==_AFLAGlogon)
  749.             {
  750.                 float(_sub,logoncounter,1);
  751.                 if(logoncounter<0)
  752.                 {
  753.                     float(_set,logoncounter,0);
  754.                 }
  755.             }
  756.             else
  757.             {
  758.                 float(_set,logoncounter,400);
  759.             }
  760.  
  761.  
  762.             if(VTrigger==_DIRShoot && VInventoryLeft>0)
  763.             {
  764.                 call(SaveAimMatrix);
  765.                 if(VCoreAICon!=0)
  766.                 {
  767.                     float(_set,logon,90);
  768.                     call(RandomizeAimMatrix,logoncounter,logoncounter,logoncounter);
  769.                 }
  770.                 else
  771.                 {
  772.                     float(_set,logon,60);
  773.                 }
  774.                 spawnactor(BulletPumpGun,0,70,-5);        //main bullet
  775.  
  776.                 //secondary pumpgun bullets
  777.  
  778.                 call(RandomizeAimMatrix,logon,logon,logon);
  779.                 spawnactor(BulletPumpGun2,0,70,-5);
  780.                 call(RestoreAimMatrix);
  781.                 call(RandomizeAimMatrix,logon,logon,logon);
  782.                 spawnactor(BulletPumpGun2,0,70,-5);
  783.                 call(RestoreAimMatrix);
  784.                 call(RandomizeAimMatrix,logon,logon,logon);
  785.                 spawnactor(BulletPumpGun2,0,70,-5);
  786.                 call(RestoreAimMatrix);
  787.                 call(RandomizeAimMatrix,logon,logon,logon);
  788.                 spawnactor(BulletPumpGun2,0,70,-5);
  789.                 call(RestoreAimMatrix);
  790.  
  791.                 if(VTrigger==_DIRBulletFired)
  792.                 {
  793.                     if(VSniperMode==0)
  794.                     {
  795.                         //muzzle flash
  796.                         vector(_set,Gactorpos,0,85,-15);
  797.                         spawnparticle(fx_gunflashPump,0,Gactorpos,emptyvector,-1);
  798.                         spawnparticle(fx_gunflashPump,0,Gactorpos,emptyvector,fx_gunflashvert);
  799.                         spawnparticle(fx_gunflashPump,0,Gactorpos,emptyvector,fx_gunflashdiag1);
  800.                         spawnparticle(fx_gunflashPump,0,Gactorpos,emptyvector,fx_gunflashdiag2);
  801.                         vector(_set,tmpvector,255,255,255);
  802.                         spawnlight(fire_light,0,Gactorpos,tmpvector,EmptyVector,400);
  803.  
  804.                         vector(_set,Gactorpos,0,55,-15);
  805.                         spawnparticle(fx_gunstrobePump,0,Gactorpos,emptyvector,fx_gunstroberot);
  806.                         //muzzle flash
  807.                     }
  808.  
  809.                     sample(SFXPumpGunFire,-1);
  810.  
  811.                     Direction(_ClrParent,_DIRshoot|_DIRTempFlag);
  812.                     Direction(_SetParent,_DIRHeavyRecoil);
  813.                     call(ChangeInventory,0,-1);
  814.  
  815.                     float(_sub,BulletCounter,1);
  816.                     if(BulletCounter==0&&VCoreAICon!=0)
  817.                     {
  818.                         Direction(_SetParent,_DIRTempFlag);
  819.                         float(_set,BulletCounter,PUMPGUN_RELOADDELAY);
  820.                     }
  821.  
  822.                     float(_set,pumpgunsampflag,8);            //reload sample delayer
  823.                     float(_set,pumpgunsmokeflag,25);        //reload smoke delayer
  824.  
  825.                     if(VSniperMode==0)
  826.                     {
  827.                         if(VAICon==0)
  828.                         {
  829.                             float(_rnd2,tmpfloat2,10);
  830.                             float(_sub,tmpfloat2,5);
  831.                             spawnactor(PumpGunShell,tmpfloat2,tmpfloat2,tmpfloat2);            //frames 15 or 16
  832.                         }
  833.                     }
  834.                 }
  835.             }
  836.             else
  837.             {
  838.                 if(pumpgunsmokeflag>=0)
  839.                 {
  840.                     if(VSniperMode==0 && vrnd<100)
  841.                     {
  842.                         vector(_set,Gactorpos,0,75,-15);
  843.                         spawnparticle(fx_weaponsmoke,0,gactorpos,emptyvector,fx_pumpgunsmoke);
  844.                     }
  845.                     float(_sub,pumpgunsmokeflag,1);
  846.                 }
  847.  
  848.                 if(pumpgunsampflag==0)
  849.                 {
  850.                     if(VSniperMode==0)
  851.                     {
  852.                         if(VAICon==0)
  853.                         {
  854.                             float(_rnd2,tmpfloat2,10);
  855.                             float(_sub,tmpfloat2,5);
  856.                             spawnactor(PumpGunShell,tmpfloat2,tmpfloat2,tmpfloat2);            //frames 15 or 16
  857.                         }
  858.                     }
  859.                     sample(SFXreload,-1);
  860.                     float(_set,pumpgunsampflag,-1);
  861.                 }
  862.                 elseif(pumpgunsampflag>0)
  863.                 {
  864.                     float(_sub,pumpgunsampflag,1);
  865.                 }
  866.             }
  867.         }
  868.         else
  869.         {
  870.             float(_set,pumpgunsampflag,-1);
  871.             float(_set,pumpgunsmokeflag,-1);
  872.         }
  873. }
  874.  
  875.  
  876. Actor(WeaponAbeastMachineGun)
  877. {
  878.         file(WeaponFakeHeader);
  879.         startaction(nomove);
  880.  
  881.         call(SetParticleSetID);
  882.  
  883.         float(_declare,MachineGunsampflag,0);
  884.         float(_declare,MachineGunsmokeflag,-1);
  885.         float(_declare,ShootDelayCounter,-1);
  886.  
  887.         float(_declare,BulletCounter,MACHGUN_RELOADDELAY);
  888.  
  889.         if(vstate==StateAttached)
  890.         {
  891.             float(_declare,MachineGunbarrel,1);
  892. //            if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  893. //            {
  894.                 vector(_set,WeaponPos,0,140,-15);
  895.                 callsub(Sub_WeaponTarget);
  896. //            }
  897.  
  898.             //empty gun sample
  899.             if(VTrigger==_DIRshoot && VInventoryLeft<=0 && VCoreAICon==0)
  900.             {
  901.                 sample(SFXWeaponEmpty,-1);
  902.             }
  903.  
  904. /*
  905.             if(VTrigger==_DIRMove)
  906.             {
  907.                 Direction(_clr,_DIRshoot);
  908.             }
  909. */
  910.  
  911.             float(_rnd2,tmpfloat2,75);
  912.             float(_rnd2,tmpfloat3,100);
  913.             float(_sub,tmpfloat3,50);
  914.  
  915.             if(VTrigger==_DIRshoot && VInventoryLeft>0)
  916.             {
  917.                 if(ShootDelayCounter<4)
  918.                 {
  919.                     float(_add,ShootDelayCounter,1);
  920.                 }
  921.                 else
  922.                 {
  923.                     float(_set,ShootDelayCounter,0);
  924.                     if(MachineGunsampflag==0)
  925.                     {
  926.                         sample(SFXMachineGunFire,-1)
  927.                     }
  928.                     float(_set,MachineGunsampflag,1);
  929.  
  930.                     spawnactor(BulletMachineGun,0,140,-15);
  931.                     vector(_set,Gactorpos,0,140,-15);
  932.  
  933.                     if(VTrigger==_DIRBulletFired)
  934.                     {
  935.                         if(VSniperMode==0)
  936.                         {
  937.                             //muzzle flash
  938.                             spawnparticle(fx_gunflashMachineGun,0,Gactorpos,emptyvector,-1);
  939.                             spawnparticle(fx_gunflashMachineGun,0,Gactorpos,emptyvector,fx_gunflashvert);
  940.                             spawnparticle(fx_gunflashMachineGun,0,Gactorpos,emptyvector,fx_gunflashdiag1);
  941.                             spawnparticle(fx_gunflashMachineGun,0,Gactorpos,emptyvector,fx_gunflashdiag2);
  942.  
  943.                             vector(_set,Gactorine,0,30,0);
  944.                             vector(_sub,gactorpos,gactorine);
  945.                             spawnparticle(fx_gunstrobeMachineGun,0,Gactorpos,emptyvector,fx_gunstroberot);
  946.                             //muzzle flash
  947.                         }
  948.  
  949.                         vector(_set,tmpvector,255,255,255);
  950.                         spawnlight(fire_light,0,Gactorpos,tmpvector,EmptyVector,400);
  951.  
  952.                         if(VSniperMode==0)
  953.                         {
  954.                             vector(_set,gactorpos,0,0,0);
  955.                             vector(_setx,gactorpos,tmpfloat3);
  956.                             vector(_sety,gactorpos,tmpfloat2);
  957.                             if(VCoreAICon==0)
  958.                             {
  959.                                 spawnparticle(fx_machinegunshell,0,gactorpos,emptyvector,-1);
  960.                             }
  961.                             else
  962.                             {
  963.                                 spawnparticle(fx_machinegunshellAI,0,gactorpos,emptyvector,-1);
  964.                             }
  965.                         }
  966.  
  967.                         //call(ChangeInventory,0,-1);
  968.                         Direction(_ClrParent,_DIRshoot|_DIRTempFlag);
  969.                         float(_sub,BulletCounter,1);
  970.                         if(BulletCounter==0&&VCoreAICon!=0)
  971.                         {
  972.                             Direction(_SetParent,_DIRTempFlag);
  973.                             float(_set,BulletCounter,MACHGUN_RELOADDELAY);
  974.                         }
  975.  
  976.                         float(_rnd2,tmpfloat,2);
  977.                         float(_sub,tmpfloat,1);
  978.                         vector(_set,gactorine,0,0,0);
  979.                         vector(_setx,gactorine,tmpfloat);
  980.                         vector(_set,Gactorpos,0,130,-15);
  981.                         spawnparticle(fx_weaponsmoke,0,gactorpos,gactorine,fx_machinegunsmoke);
  982.                         float(_set,Machinegunsmokeflag,25);
  983.                     }
  984.                 }
  985.             }
  986.             else
  987.             {
  988.                 if(Machinegunsmokeflag>=0)
  989.                 {
  990.                     if(MachineGunsmokeflag==25)
  991.                     {
  992.                         if(VCoreAICon==0)
  993.                         {
  994.                             spawnactor(MachineGunShell,tmpfloat3,tmpfloat2,0);            //frames 15 or 16
  995.                         }
  996.                     }
  997.  
  998.                     if(VSniperMode==0)
  999.                     {
  1000.                         float(_rnd2,tmpfloat,2);
  1001.                         float(_sub,tmpfloat,1);
  1002.                         vector(_set,gactorine,0,0,0);
  1003.                         vector(_setx,gactorine,tmpfloat);
  1004.  
  1005.                         if(vrnd<50)
  1006.                         {
  1007.                             vector(_set,Gactorpos,0,160,-15);
  1008.                             spawnparticle(fx_weaponsmoke,0,gactorpos,gactorine,fx_machinegunsmoke);
  1009.                         }
  1010.                         else
  1011.                         {
  1012.                             vector(_set,Gactorpos,0,160,10);
  1013.                             spawnparticle(fx_weaponsmoke,0,gactorpos,gactorine,fx_machinegunsmoke);
  1014.                         }
  1015.                     }
  1016.                     float(_sub,MachineGunsmokeflag,1);
  1017.                     float(_set,ShootDelayCounter,-1);
  1018.                 }
  1019.  
  1020.                 if(Machinegunsampflag==1)
  1021.                 {
  1022.                     samplestop(SFXMachineGunFire);
  1023.                 }
  1024.                 float(_set,Machinegunsampflag,0);
  1025.             }
  1026.         }
  1027. }
  1028.  
  1029.  
  1030. Actor(WeaponMachineGun)
  1031. {
  1032.         file(WeaponMachineGunHeader);
  1033.         startaction(nomove);
  1034.  
  1035.         call(SetParticleSetID);
  1036.  
  1037.         float(_declare,MachineGunsampflag,0);
  1038.         float(_declare,MachineGunsmokeflag,-1);
  1039.  
  1040.         float(_declare,BulletCounter,MACHGUN_RELOADDELAY);
  1041.  
  1042.         float(_declare,weaponcollider,0);
  1043.         callsub(Sub_WeaponHandler,weaponcollider);
  1044.  
  1045.         float(_declare,MachineGunbarrel,1);
  1046.  
  1047.         if(vstate==StateAttached)
  1048.         {
  1049.             if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  1050.             {
  1051.                 if(MachineGunbarrel==0)
  1052.                 {
  1053.                     vector(_set,WeaponPos,0,80,-15);
  1054.                 }
  1055.                 else
  1056.                 {
  1057.                     vector(_set,WeaponPos,0,80,10);
  1058.                 }
  1059.                 callsub(Sub_WeaponTarget);
  1060.             }
  1061.  
  1062.             //empty gun sample
  1063.             if(VTrigger==_DIRShoot && VInventoryLeft<=0 && VCoreAICon==0)
  1064.             {
  1065.                 sample(SFXWeaponEmpty,-1);
  1066.             }
  1067.  
  1068.             float(_rnd2,tmpfloat2,75);
  1069.             float(_rnd2,tmpfloat3,100);
  1070.             float(_sub,tmpfloat3,50);
  1071.  
  1072.             if(VTrigger==_DIRShoot && VInventoryLeft>0)
  1073.             {
  1074.                 if(MachineGunsampflag==0)
  1075.                 {
  1076.                     sample(SFXMachineGunFire,-1)
  1077.                 }
  1078.                 float(_set,MachineGunsampflag,1);
  1079.  
  1080.                 if(MachineGunbarrel==0)
  1081.                 {
  1082.                     float(_set,MachineGunbarrel,1);
  1083.                     spawnactor(BulletMachineGun,0,80,-15);
  1084.                     vector(_set,Gactorpos,0,90,-15);
  1085.                 }
  1086.                 else
  1087.                 {
  1088.                     float(_set,Machinegunbarrel,0);
  1089.                     spawnactor(BulletMachineGun,0,80,10);
  1090.                     vector(_set,Gactorpos,0,90,10);
  1091.                 }
  1092.  
  1093.                 if(VTrigger==_DIRBulletFired)
  1094.                 {
  1095.                     if(VSniperMode==0)
  1096.                     {
  1097.                         //muzzle flash
  1098.                         spawnparticle(fx_gunflashMachineGun,0,Gactorpos,emptyvector,-1);
  1099.                         spawnparticle(fx_gunflashMachineGun,0,Gactorpos,emptyvector,fx_gunflashvert);
  1100.                         spawnparticle(fx_gunflashMachineGun,0,Gactorpos,emptyvector,fx_gunflashdiag1);
  1101.                         spawnparticle(fx_gunflashMachineGun,0,Gactorpos,emptyvector,fx_gunflashdiag2);
  1102.  
  1103.                         vector(_set,Gactorine,0,30,0);
  1104.                         vector(_sub,gactorpos,gactorine);
  1105.                         spawnparticle(fx_gunstrobeMachineGun,0,Gactorpos,emptyvector,fx_gunstroberot);
  1106.                         //muzzle flash
  1107.                     }
  1108.  
  1109.                     if(MachineGunbarrel==0)
  1110.                     {
  1111.                         vector(_set,tmpvector,255,255,255);
  1112.                         spawnlight(fire_light,0,Gactorpos,tmpvector,EmptyVector,400);
  1113.                         call(ChangeInventory,0,-1);
  1114.                     }
  1115.  
  1116.                     if(VSniperMode==0)
  1117.                     {
  1118.                         vector(_set,gactorpos,0,0,0);
  1119.                         vector(_setx,gactorpos,tmpfloat3);
  1120.                         vector(_sety,gactorpos,tmpfloat2);
  1121.                         if(VCoreAICon==0)
  1122.                         {
  1123.                             spawnparticle(fx_machinegunshell,0,gactorpos,emptyvector,-1);
  1124.                         }
  1125.                         else
  1126.                         {
  1127.                             spawnparticle(fx_machinegunshellAI,0,gactorpos,emptyvector,-1);
  1128.                         }
  1129.                     }
  1130.  
  1131.                     Direction(_ClrParent,_DIRshoot|_DIRTempFlag);
  1132.                     float(_sub,BulletCounter,1);
  1133.                     if(BulletCounter==0&&VCoreAICon!=0)
  1134.                     {
  1135.                         Direction(_SetParent,_DIRTempFlag);
  1136.                         float(_set,BulletCounter,MACHGUN_RELOADDELAY);
  1137.                     }
  1138.  
  1139.                     float(_set,MachineGunsmokeflag,25);        //reload smoke delayer
  1140.                 }
  1141.             }
  1142.             else
  1143.             {
  1144.                 if(Machinegunsmokeflag>=0)
  1145.                 {
  1146.                     if(MachineGunsmokeflag==25)
  1147.                     {
  1148.                         if(VCoreAICon==0)
  1149.                         {
  1150.                             spawnactor(MachineGunShell,tmpfloat3,tmpfloat2,0);            //frames 15 or 16
  1151.                         }
  1152.                     }
  1153.  
  1154.                     if(VSniperMode==0)
  1155.                     {
  1156.                         float(_rnd2,tmpfloat,2);
  1157.                         float(_sub,tmpfloat,1);
  1158.                         vector(_set,gactorine,0,0,0);
  1159.                         vector(_setx,gactorine,tmpfloat);
  1160.  
  1161.                         if(vrnd<50)
  1162.                         {
  1163.                             vector(_set,Gactorpos,0,65,-15);
  1164.                             spawnparticle(fx_weaponsmoke,0,gactorpos,gactorine,fx_machinegunsmoke);
  1165.                         }
  1166.                         else
  1167.                         {
  1168.                             vector(_set,Gactorpos,0,65,10);
  1169.                             spawnparticle(fx_weaponsmoke,0,gactorpos,gactorine,fx_machinegunsmoke);
  1170.                         }
  1171.                     }
  1172.                     float(_sub,MachineGunsmokeflag,1);
  1173.                 }
  1174.  
  1175.                 if(Machinegunsampflag==1)
  1176.                 {
  1177.                     samplestop(SFXMachineGunFire);
  1178.                 }
  1179.                 float(_set,Machinegunsampflag,0);
  1180.             }
  1181.         }
  1182.         else
  1183.         {
  1184.             if(MachineGunsampflag==1)
  1185.             {
  1186.                 samplestop(SFXMachineGunFire);
  1187.             }
  1188.             float(_set,MachineGunsampflag,0);
  1189.  
  1190.             float(_set,Machinegunsmokeflag,-1);
  1191.         }
  1192. }
  1193.  
  1194. Actor(WeaponMaimer)
  1195. {
  1196.         file(WeaponMaimerHeader);
  1197.         startaction(nomove);
  1198.  
  1199.         call(SetParticleSetID);
  1200.  
  1201.         float(_declare,BulletCounter,MAIMER_RELOADDELAY);
  1202.  
  1203.         float(_declare,weaponcollider,0);
  1204.         callsub(Sub_WeaponHandler,weaponcollider);
  1205.  
  1206.         if(vstate==StateAttached)
  1207.         {
  1208.             if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  1209.             {
  1210.                 vector(_set,WeaponPos,0,80,0);
  1211.                 callsub(Sub_WeaponTarget);
  1212.             }
  1213.  
  1214.             //empty gun sample
  1215.             if(VTrigger==_DIRShoot && VInventoryLeft<=0 && VCoreAICon==0)
  1216.             {
  1217.                 sample(SFXWeaponEmpty,-1);
  1218.             }
  1219.  
  1220.             if(VTrigger==_DIRShoot && VInventoryLeft>0)
  1221.             {
  1222.                 spawnactor(BulletMaimer,0,80,0);
  1223.  
  1224.                 if(VTrigger==_DIRBulletFired)
  1225.                 {
  1226.                     sample(SFXMaimerFire,-1);
  1227.                     if(VSniperMode==0)
  1228.                     {
  1229.                         //muzzle flash
  1230.                         vector(_set,Gactorpos,0,100,-10);
  1231.                         spawnparticle(fx_gunflashMaimer,0,Gactorpos,emptyvector,-1);
  1232.                         spawnparticle(fx_gunflashMaimer,0,Gactorpos,emptyvector,fx_gunflashvert);
  1233.                         spawnparticle(fx_gunflashMaimer,0,Gactorpos,emptyvector,fx_gunflashdiag1);
  1234.                         spawnparticle(fx_gunflashMaimer,0,Gactorpos,emptyvector,fx_gunflashdiag2);
  1235.                         vector(_set,tmpvector,255,255,255);
  1236.                         spawnlight(fire_light,0,Gactorpos,tmpvector,EmptyVector,400);
  1237.  
  1238.                         vector(_set,Gactorpos,0,70,-10);
  1239.                         spawnparticle(fx_gunstrobeMaimer,0,Gactorpos,emptyvector,fx_gunstroberot);
  1240.                         //muzzle flash
  1241.                     }
  1242.  
  1243.                     Direction(_ClrParent,_DIRshoot|_DIRTempFlag);
  1244.                     call(ChangeInventory,0,-1);
  1245.                     float(_sub,BulletCounter,1);
  1246.                     if(BulletCounter==0&&VCoreAICon!=0)
  1247.                     {
  1248.                         Direction(_SetParent,_DIRTempFlag);
  1249.                         float(_set,BulletCounter,MAIMER_RELOADDELAY);
  1250.                     }
  1251.                 }
  1252.             }
  1253.         }
  1254. }
  1255.  
  1256. Actor(WeaponHarpoon)
  1257. {
  1258.         file(WeaponHarpoonHeader);
  1259.         startaction(nomove);
  1260.  
  1261.         call(SetParticleSetID);
  1262.  
  1263.         float(_declare,BulletCounter,HARPOON_RELOADDELAY);
  1264.  
  1265.         float(_declare,harpsmokeflag,-1);
  1266.  
  1267.         float(_declare,weaponcollider,0);
  1268.         callsub(Sub_WeaponHandler,weaponcollider);
  1269.  
  1270.         if(vstate==StateAttached)
  1271.         {
  1272.             if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  1273.             {
  1274.                 vector(_set,WeaponPos,0,95,-8);
  1275.                 callsub(Sub_WeaponTarget);
  1276.             }
  1277.  
  1278.             //empty gun sample
  1279.             if(VTrigger==_DIRShoot && VInventoryLeft<=0 && VCoreAICon==0)
  1280.             {
  1281.                 sample(SFXWeaponEmpty,-1);
  1282.             }
  1283.  
  1284.             if(VTrigger==_DIRShoot && VInventoryLeft>0)
  1285.             {
  1286.                 spawnactor(BulletHarpoon,0,95,-8);
  1287.  
  1288.                 if(VTrigger==_DIRBulletFired)
  1289.                 {
  1290.                     Direction(_SetParent,_DIRHeavyRecoil);
  1291.                     Direction(_ClrParent,_DIRshoot|_DIRTempFlag);
  1292.                     call(ChangeInventory,0,-1);
  1293.                     float(_sub,BulletCounter,1);
  1294.                     if(BulletCounter==0&&VCoreAICon!=0)
  1295.                     {
  1296.                         Direction(_SetParent,_DIRTempFlag);
  1297.                         float(_set,BulletCounter,HARPOON_RELOADDELAY);
  1298.                     }
  1299.  
  1300.                     sample(SFXHarpoonLaunch,-1);
  1301.  
  1302.                     float(_set,harpsmokeflag,35);        //reload smoke delayer
  1303.                 }
  1304.             }
  1305.             else
  1306.             {
  1307.                 if(harpsmokeflag>=0)
  1308.                 {
  1309.                     if(VSniperMode==0 && vrnd<50)
  1310.                     {
  1311.                         vector(_set,Gactorpos,0,110,-8);
  1312.                         float(_rnd2,tmpfloat,2);
  1313.                         float(_sub,tmpfloat,1);
  1314.                         vector(_set,gactorine,0,0,0);
  1315.                         vector(_setx,gactorine,tmpfloat);
  1316.                         spawnparticle(fx_weaponsmoke,0,gactorpos,gactorine,fx_harpoonsmoke);
  1317.                     }
  1318.                     float(_sub,harpsmokeflag,1);
  1319.                 }
  1320.             }
  1321.         }
  1322.         else
  1323.         {
  1324.             float(_set,harpsmokeflag,-1);
  1325.         }
  1326. }
  1327.  
  1328.  
  1329.  
  1330. Actor(WeaponBazooka)
  1331. {
  1332.         file(WeaponBazookaHeader);
  1333.         startaction(nomove);
  1334.  
  1335.         call(SetParticleSetID);
  1336.  
  1337.         float(_declare,BulletCounter,BAZOOKA_RELOADDELAY);
  1338.  
  1339.         float(_declare,weaponcollider,0);
  1340.         callsub(Sub_WeaponHandler,weaponcollider);
  1341.  
  1342.         if(vstate==StateAttached)
  1343.         {
  1344.             if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  1345.             {
  1346.                 vector(_set,WeaponPos,0,100,0);
  1347.                 callsub(Sub_WeaponTarget);
  1348.             }
  1349.  
  1350.             //empty gun sample
  1351.             if(VTrigger==_DIRShoot && VInventoryLeft<=0 && VCoreAICon==0)
  1352.             {
  1353.                 sample(SFXWeaponEmpty,-1);
  1354.             }
  1355.  
  1356.             if(VTrigger==_DIRShoot && VInventoryLeft>0)
  1357.             {
  1358.                 spawnactor(BulletBazooka,0,100,0);
  1359.  
  1360.                 if(VTrigger==_DIRBulletFired)
  1361.                 {
  1362.                     Direction(_SetParent,_DIRHeavyRecoil);
  1363.                     Direction(_ClrParent,_DIRshoot|_DIRTempFlag);
  1364.                     call(ChangeInventory,0,-1);
  1365.  
  1366.                     float(_sub,BulletCounter,1);
  1367.                     if(BulletCounter==0&&VCoreAICon!=0)
  1368.                     {
  1369.                         Direction(_SetParent,_DIRTempFlag);
  1370.                         float(_set,BulletCounter,BAZOOKA_RELOADDELAY);
  1371.                     }
  1372.  
  1373.                     sample(SFXBazookaLaunch1,-1);
  1374.                 }
  1375.             }
  1376.         }
  1377. }
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384. Actor(WeaponMaser)
  1385. {
  1386.         file(WeaponMaserHeader);
  1387.         startaction(nomove);
  1388.  
  1389.         call(SetParticleSetID);
  1390.  
  1391.         float(_declare,BulletCounter,MASER_RELOADDELAY);
  1392.  
  1393.         float(_declare,weaponcollider,0);
  1394.         callsub(Sub_WeaponHandler,weaponcollider);
  1395.  
  1396.         if(vstate==StateAttached)
  1397.         {
  1398.             if(VTrigger==_DIRcombatmode && VTrigger==_DIRHaveGun)
  1399.             {
  1400.                 vector(_set,WeaponPos,0,100,0);
  1401.                 callsub(Sub_WeaponTarget);
  1402.             }
  1403.  
  1404.             //empty gun sample
  1405.             if(VTrigger==_DIRShoot && VInventoryLeft<=0 && VCoreAICon==0)
  1406.             {
  1407.                 sample(SFXWeaponEmpty,-1);
  1408.             }
  1409.  
  1410.             if(VTrigger==_DIRShoot && VInventoryLeft>0)
  1411.             {
  1412.                 spawnactor(BulletMaser,0,100,0);
  1413.  
  1414.                 if(VTrigger==_DIRBulletFired)
  1415.                 {
  1416.                     Direction(_SetParent,_DIRHeavyRecoil);
  1417.                     Direction(_ClrParent,_DIRshoot|_DIRTempFlag);
  1418.                     call(ChangeInventory,0,-1);
  1419.  
  1420.                     float(_sub,BulletCounter,1);
  1421.                     if(BulletCounter==0&&VCoreAICon!=0)
  1422.                     {
  1423.                         Direction(_SetParent,_DIRTempFlag);
  1424.                         float(_set,BulletCounter,MASER_RELOADDELAY);
  1425.                     }
  1426.  
  1427.                     sample(SFXBazookaLaunch1,-1);
  1428.                 }
  1429.                 else
  1430.                 {
  1431.                     vector(_set,gactorpos,0,100,0);
  1432.                     vector(_set,gactorine,0,0,0);
  1433.                     spawn3dflare(64,48,255,1,gactorpos,gactorine);
  1434.                 }
  1435.             }
  1436.         }
  1437. }
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443. Actor(WeaponBot)
  1444. {
  1445.         file(WeaponBotHeader);
  1446.         startaction(botidle);
  1447.  
  1448.         printi("health:  ",vhealth);
  1449.  
  1450.         if(vtrigger|=_DIRallcol)
  1451.         {
  1452.             turn(0,20,0);
  1453.             move(0,0,-1);
  1454.         }
  1455.         else
  1456.         {
  1457.             move(0,0,-3);
  1458.         }
  1459.         if(vdisttoground>150)
  1460.         {
  1461.             move(0,-1,0);
  1462.         }
  1463.         elseif(vdisttoground<100)
  1464.         {
  1465.             move(0,1,0);
  1466.         }
  1467.         if(VTrigger==_DIRactorbulletcol)
  1468.         {
  1469.             move(0,30,0);
  1470.         }
  1471.         if(Vhealth<0)
  1472.         {
  1473.             killactor();
  1474.         }
  1475. }
  1476.