home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Messiah / data1.cab / Program_Executable_Files / messiahscripts / Sound / soundcode.hxx < prev    next >
Text File  |  1999-11-29  |  12KB  |  583 lines

  1.  
  2.  
  3. //sample(name,position,volume,lifespan)
  4. //position= absolute if not attached to an actor
  5. //position= -1 if attached to an actor
  6.  
  7. //MISSING: Check which character. Play male/female/baby sound
  8. //MISSING: The character sounds must also check if health is positive before playing sounds.
  9. //MISSING: Perhaps it will be a good idea to have a routine to stop all charactersounds for a character before starting a death-scream.
  10.  
  11. subroutine(Sound_HitSmall)
  12. {
  13.         if(VClass==_ClassAngel)
  14.         {
  15.             sample(SFXPainMale2,-1);
  16.         }
  17.         else
  18.         {
  19.             sample(SFXPainMale3,-1);
  20.         }
  21. }
  22.  
  23. subroutine(Sound_Steamed)
  24. {
  25.         //missing other classes
  26.  
  27.         if(VClass==_ClassAngel)
  28.         {
  29.             sample(SFXBobUumph,-1);
  30.         }
  31.         else
  32.         {
  33.             sample(SFXMaleArrgh,-1);
  34.         }
  35. }
  36.  
  37.  
  38. subroutine(Sub_RandomWalkieKillSFX)
  39. {
  40.         if(vrnd<25 && LastWalkieKillSFX!=1)
  41.         {
  42.             float(_set,LastWalkieKillSFX,1);
  43.             sample(SFXKillTargetWalkie0,-1);
  44.         }
  45.         elseif(vrnd<50 && LastWalkieKillSFX!=2)
  46.         {
  47.             float(_set,LastWalkieKillSFX,2);
  48.             sample(SFXKillTargetWalkie1,-1);
  49.         }
  50.         elseif(vrnd<75 LastWalkieKillSFX!=3)
  51.         {
  52.             float(_set,LastWalkieKillSFX,3);
  53.             sample(SFXKillTargetWalkie2,-1);
  54.         }
  55.         elseif(LastWalkieKillSFX!=4)
  56.         {
  57.             float(_set,LastWalkieKillSFX,4);
  58.             sample(SFXKillTargetWalkie3,-1);
  59.         }
  60.         else
  61.         {
  62.             float(_set,LastWalkieKillSFX,0);
  63.             sample(SFXKillTargetWalkie0,-1);
  64.         }
  65. }
  66.  
  67.  
  68.  
  69.  
  70. subroutine(Sub_RandomPunchedSFX)
  71. {
  72.         //if(vframe==14 || vframe==11 || vframe==13)
  73.         if(vframe==1)
  74.         {
  75.             if(VAICon!=0)
  76.             {
  77.                 sample(SFXPunchKickReact,-1);
  78.             }
  79.             else
  80.             {
  81.                 sample(SFXShotReact,-1);
  82.             }
  83.             sample(SFXManPunch1,-1);
  84. /*            if(vrnd<25 && LastPunchedSFX!=1)
  85.             {
  86.                 float(_set,LastPunchedSFX,1);
  87.                 sample(SFXManPunch1,-1);
  88.             }
  89.             elseif(vrnd<50 && LastPunchedSFX!=2)
  90.             {
  91.                 float(_set,LastPunchedSFX,2);
  92.                 sample(SFXManPunch2,-1);
  93.             }
  94.             elseif(vrnd<75 LastPunchedSFX!=3)
  95.             {
  96.                 float(_set,LastPunchedSFX,3);
  97.                 sample(SFXManPunch3,-1);
  98.             }
  99.             elseif(LastPunchedSFX!=4)
  100.             {
  101.                 float(_set,LastPunchedSFX,4);
  102.                 sample(SFXManPunch4,-1);
  103.             }
  104.             else
  105.             {
  106.                 float(_set,LastPunchedSFX,0);
  107.                 sample(SFXManPunch1,-1);
  108.             }
  109. */
  110.         }
  111.  
  112. }
  113.  
  114.  
  115. subroutine(Sub_EatMaleSFX)
  116. {
  117.     if(VFrame==20)
  118.     {
  119.         Sample(SFXWorkerOhNo,-1);
  120.     }
  121.     elseif(vframe==100)
  122.     {
  123.         Sample(SFXWorkerScream,-1);
  124.     }
  125.     elseif(vframe==200)
  126.     {
  127.         Sample(SFXBehemothAngry,-1);
  128.     }
  129. }
  130.  
  131. subroutine(Sub_RandomStrangledSFX)
  132. {
  133.         if(vframe==41 || vframe==61)
  134.         {
  135.             sample(SFXManStrangled,-1);
  136.         }
  137. }
  138.  
  139.  
  140.  
  141. subroutine(Sub_RandomWaterSFX)
  142. {
  143.         if(vrnd<25 && LastWaterSFX!=1)
  144.         {
  145.             float(_set,LastWaterSFX,1);
  146.             sample(SFXFootStepWat1,-1);
  147.         }
  148.         elseif(vrnd<50 && LastWaterSFX!=2)
  149.         {
  150.             float(_set,LastWaterSFX,2);
  151.             sample(SFXFootStepWat2,-1);
  152.         }
  153.         elseif(vrnd<75 && LastWaterSFX!=3)
  154.         {
  155.             float(_set,LastWaterSFX,3);
  156.             sample(SFXFootStepWat3,-1);
  157.         }
  158.         elseif(LastWaterSFX!=4)
  159.         {
  160.             float(_set,LastWaterSFX,4);
  161.             sample(SFXFootStepWat4,-1);
  162.         }
  163.         else
  164.         {
  165.             float(_set,LastWaterSFX,0);
  166.             sample(SFXFootStepWat1,-1);
  167.         }
  168. }
  169.  
  170.  
  171.  
  172. subroutine(Sub_BobRollSFX)
  173. {
  174.     if (vframe==1)
  175.     {
  176.         sample(SFXBobClimb,-1);
  177.     }
  178. }
  179.  
  180. subroutine(Sub_RandomKickRollSFX)
  181. {
  182.         if(vframe==17)
  183.         {
  184.             if(vrnd<25 && LastPunchedSFX!=1)
  185.             {
  186.                 float(_set,LastPunchedSFX,1);
  187.                 sample(SFXManPunch1,-1);
  188.             }
  189.             elseif(vrnd<50 && LastPunchedSFX!=2)
  190.             {
  191.                 float(_set,LastPunchedSFX,2);
  192.                 sample(SFXManPunch2,-1);
  193.             }
  194.             elseif(vrnd<75 LastPunchedSFX!=3)
  195.             {
  196.                 float(_set,LastPunchedSFX,3);
  197.                 sample(SFXManPunch3,-1);
  198.             }
  199.             else
  200.             {
  201.                 float(_set,LastPunchedSFX,4);
  202.                 sample(SFXManPunch4,-1);
  203.             }
  204.         }
  205. }
  206.  
  207.  
  208. subroutine(Sub_RandomKickedSFX)
  209. {
  210.         if(vframe==1)
  211.         {
  212.             if(VAICon!=0)
  213.             {
  214.                 sample(SFXPunchKickReact,-1);
  215.             }
  216.             else
  217.             {
  218.                 sample(SFXShotReact,-1);
  219.             }
  220.             sample(SFXManPunch1,-1);
  221. /*            if(vrnd<25 && LastPunchedSFX!=1)
  222.             {
  223.                 float(_set,LastPunchedSFX,1);
  224.                 sample(SFXManPunch1,-1);
  225.             }
  226.             elseif(vrnd<50 && LastPunchedSFX!=2)
  227.             {
  228.                 float(_set,LastPunchedSFX,2);
  229.                 sample(SFXManPunch2,-1);
  230.             }
  231.             elseif(vrnd<75 LastPunchedSFX!=3)
  232.             {
  233.                 float(_set,LastPunchedSFX,3);
  234.                 sample(SFXManPunch3,-1);
  235.             }
  236.             elseif(LastPunchedSFX!=4)
  237.             {
  238.                 float(_set,LastPunchedSFX,4);
  239.                 sample(SFXManPunch4,-1);
  240.             }
  241.             else
  242.             {
  243.                 float(_set,LastPunchedSFX,0);
  244.                 sample(SFXManPunch1,-1);
  245.             }
  246. //------
  247.             if(vrnd<12 && LastKickedSFX!=1)
  248.             {
  249.                 float(_set,LastKickedSFX,1);
  250.                 sample(SFXManAgony1,-1);
  251.             }
  252.             elseif(vrnd<24 && LastKickedSFX!=2)
  253.             {
  254.                 float(_set,LastKickedSFX,2);
  255.                 sample(SFXManAgony2,-1);
  256.             }
  257.             elseif(vrnd<36 && LastKickedSFX!=3)
  258.             {
  259.                 float(_set,LastKickedSFX,3);
  260.                 sample(SFXManAgony3,-1);
  261.             }
  262.             elseif(vrnd<48 && LastKickedSFX!=4)
  263.             {
  264.                 float(_set,LastKickedSFX,4);
  265.                 sample(SFXManAgony4,-1);
  266.             }
  267.             elseif(vrnd<60 && LastKickedSFX!=5)
  268.             {
  269.                 float(_set,LastKickedSFX,5);
  270.                 sample(SFXManAgony5,-1);
  271.             }
  272.             elseif(vrnd<72 && LastKickedSFX!=6)
  273.             {
  274.                 float(_set,LastKickedSFX,6);
  275.                 sample(SFXManAgony6,-1);
  276.             }
  277.             elseif(vrnd<84 && LastKickedSFX!=7)
  278.             {
  279.                 float(_set,LastKickedSFX,7);
  280.                 sample(SFXManAgony7,-1);
  281.             }
  282.             elseif(LastKickedSFX!=8)
  283.             {
  284.                 float(_set,LastKickedSFX,8);
  285.                 sample(SFXManAgony8,-1);
  286.             }
  287.             else
  288.             {
  289.                 sample(SFXManAgony2,-1);
  290.                 float(_set,LastKickedSFX,0);
  291.             }
  292. */
  293.         }
  294.  
  295. }
  296.  
  297. subroutine(Sub_RandomHarpoonedSFX,const(volaroony))
  298. {
  299.         if(vrnd<16 && LastHarpoonedSFX!=1)
  300.         {
  301.             float(_set,LastHarpoonedSFX,1);
  302.             sample(SFXManHarpooned1,-1,volaroony);
  303.         }
  304.         elseif(vrnd<32 && LastHarpoonedSFX!=2)
  305.         {
  306.             float(_set,LastHarpoonedSFX,2);
  307.             sample(SFXManHarpooned2,-1,volaroony);
  308.         }
  309.         elseif(vrnd<48 && LastHarpoonedSFX!=3)
  310.         {
  311.             float(_set,LastHarpoonedSFX,3);
  312.             sample(SFXManHarpooned3,-1,volaroony);
  313.         }
  314.         elseif(vrnd<64 && LastHarpoonedSFX!=4)
  315.         {
  316.             float(_set,LastHarpoonedSFX,4);
  317.             sample(SFXManHarpooned4,-1,volaroony);
  318.         }
  319.         elseif(vrnd<80 && LastHarpoonedSFX!=5)
  320.         {
  321.             float(_set,LastHarpoonedSFX,5);
  322.             sample(SFXManHarpooned5,-1,volaroony);
  323.         }
  324.         elseif(LastHarpoonedSFX!=6)
  325.         {
  326.             float(_set,LastHarpoonedSFX,6);
  327.             sample(SFXManHarpooned6,-1,volaroony);
  328.         }
  329.         else
  330.         {
  331.             float(_set,LastHarpoonedSFX,0);
  332.             sample(SFXManHarpooned2,-1,volaroony);
  333.         }
  334. }
  335.  
  336.  
  337.  
  338.  
  339. SubRoutine(Sub_CheckFootSteps,const(Foot))
  340. {
  341.         if(vtrigger==_DIRwalking)
  342.         {
  343.             if(VClass==_ClassAngel)
  344.             {
  345.                 float(_set,tmpfloat,90);
  346.             }
  347.             else
  348.             {
  349.                 float(_set,tmpfloat,85);
  350.             }
  351.         }
  352.         else
  353.         {
  354.             if(VClass==_ClassAngel)
  355.             {
  356.                 float(_set,tmpfloat,100);
  357.             }
  358.             else
  359.             {
  360.                 float(_set,tmpfloat,95);
  361.             }
  362.         }
  363.  
  364.         call(CheckFootCollision,Foot);
  365.         if(VSpecialFlag==_sFLAGFootCollide)
  366.         {
  367.             if(vrnd<25 && LastFootstep!=1)
  368.             {
  369.                 float(_set,LastFootstep,1);
  370.  
  371.                 if(VClass==_ClassAngel)
  372.                 {
  373.                     sample(SFXFootStepBob1,-1,tmpfloat);
  374.                 }
  375.                 elseif(VColMaterialProperties==_MATstair)
  376.                 {
  377.                     sample(SFXFootStepBig1,-1,tmpfloat);
  378.                 }
  379.                 elseif(VColMaterialProperties==_MATWood)
  380.                 {
  381.                     sample(SFXFootStepWd1,-1,tmpfloat);
  382.                 }
  383.                 elseif(VColMaterialProperties==_MATMetal)
  384.                 {
  385.                     sample(SFXFootStepMet1,-1,tmpfloat);
  386.                 }
  387.                 elseif(VColMaterialProperties==_MATSheetMetal)
  388.                 {
  389.                     sample(SFXFootStepWlk1,-1,tmpfloat);
  390.                 }
  391.                 elseif(VColMaterialProperties==_MATConcrete)
  392.                 {
  393.                     sample(SFXFootStepCon1,-1,tmpfloat);
  394.                 }
  395.                 elseif(VColMaterialProperties==_MATWater)
  396.                 {
  397.                     sample(SFXFootStepWat1,-1,tmpfloat);
  398.                 }
  399.                 else
  400.                 {
  401.                     sample(SFXFootStepReg1,-1,tmpfloat);
  402.                 }
  403.             }
  404.             elseif(vrnd<50 && LastFootstep!=2)
  405.             {
  406.                 float(_set,LastFootstep,2);
  407.  
  408.                 if(VClass==_ClassAngel)
  409.                 {
  410.                     sample(SFXFootStepBob2,-1,tmpfloat);
  411.                 }
  412.                 elseif(VColMaterialProperties==_MATstair)
  413.                 {
  414.                     sample(SFXFootStepBig2,-1,tmpfloat);
  415.                 }
  416.                 elseif(VColMaterialProperties==_MATWood)
  417.                 {
  418.                     sample(SFXFootStepWd2,-1,tmpfloat);
  419.                 }
  420.                 elseif(VColMaterialProperties==_MATMetal)
  421.                 {
  422.                     sample(SFXFootStepMet2,-1,tmpfloat);
  423.                 }
  424.                 elseif(VColMaterialProperties==_MATSheetMetal)
  425.                 {
  426.                     sample(SFXFootStepWlk2,-1,tmpfloat);
  427.                 }
  428.                 elseif(VColMaterialProperties==_MATConcrete)
  429.                 {
  430.                     sample(SFXFootStepCon2,-1,tmpfloat);
  431.                 }
  432.                 elseif(VColMaterialProperties==_MATWater)
  433.                 {
  434.                     sample(SFXFootStepWat2,-1,tmpfloat);
  435.                 }
  436.                 else
  437.                 {
  438.                     sample(SFXFootStepReg2,-1,tmpfloat);
  439.                 }
  440.             }
  441.             elseif(vrnd<75 && LastFootstep!=3)
  442.             {
  443.                 float(_set,LastFootstep,3);
  444.  
  445.                 if(VClass==_ClassAngel)
  446.                 {
  447.                     sample(SFXFootStepBob3,-1,tmpfloat);
  448.                 }
  449.                 elseif(VColMaterialProperties==_MATstair)
  450.                 {
  451.                     sample(SFXFootStepBig3,-1,tmpfloat);
  452.                 }
  453.                 elseif(VColMaterialProperties==_MATWood)
  454.                 {
  455.                     sample(SFXFootStepWd3,-1,tmpfloat);
  456.                 }
  457.                 elseif(VColMaterialProperties==_MATMetal)
  458.                 {
  459.                     sample(SFXFootStepMet3,-1,tmpfloat);
  460.                 }
  461.                 elseif(VColMaterialProperties==_MATSheetMetal)
  462.                 {
  463.                     sample(SFXFootStepWlk3,-1,tmpfloat);
  464.                 }
  465.                 elseif(VColMaterialProperties==_MATConcrete)
  466.                 {
  467.                     sample(SFXFootStepCon3,-1,tmpfloat);
  468.                 }
  469.                 elseif(VColMaterialProperties==_MATWater)
  470.                 {
  471.                     sample(SFXFootStepWat3,-1,tmpfloat);
  472.                 }
  473.                 else
  474.                 {
  475.                     sample(SFXFootStepReg3,-1,tmpfloat);
  476.                 }
  477.             }
  478.             elseif(LastFootstep!=4)
  479.             {
  480.                 float(_set,LastFootstep,4);
  481.  
  482.                 if(VClass==_ClassAngel)
  483.                 {
  484.                     sample(SFXFootStepBob4,-1,tmpfloat);
  485.                 }
  486.                 elseif(VColMaterialProperties==_MATstair)
  487.                 {
  488.                     sample(SFXFootStepBig4,-1,tmpfloat);
  489.                 }
  490.                 elseif(VColMaterialProperties==_MATWood)
  491.                 {
  492.                     sample(SFXFootStepWd4,-1,tmpfloat);
  493.                 }
  494.                 elseif(VColMaterialProperties==_MATMetal)
  495.                 {
  496.                     sample(SFXFootStepMet4,-1,tmpfloat);
  497.                 }
  498.                 elseif(VColMaterialProperties==_MATSheetMetal)
  499.                 {
  500.                     sample(SFXFootStepWlk4,-1,tmpfloat);
  501.                 }
  502.                 elseif(VColMaterialProperties==_MATConcrete)
  503.                 {
  504.                     sample(SFXFootStepCon4,-1,tmpfloat);
  505.                 }
  506.                 elseif(VColMaterialProperties==_MATWater)
  507.                 {
  508.                     sample(SFXFootStepWat4,-1,tmpfloat);
  509.                 }
  510.                 else
  511.                 {
  512.                     sample(SFXFootStepReg4,-1,tmpfloat);
  513.                 }
  514.             }
  515.             else
  516.             {
  517.                 float(_set,LastFootstep,0);
  518.  
  519.                 if(VClass==_ClassAngel)
  520.                 {
  521.                     sample(SFXFootStepBob3,-1,tmpfloat);
  522.                 }
  523.                 elseif(VColMaterialProperties==_MATstair)
  524.                 {
  525.                     sample(SFXFootStepBig3,-1,tmpfloat);
  526.                 }
  527.                 elseif(VColMaterialProperties==_MATWood)
  528.                 {
  529.                     sample(SFXFootStepWd3,-1,tmpfloat);
  530.                 }
  531.                 elseif(VColMaterialProperties==_MATMetal)
  532.                 {
  533.                     sample(SFXFootStepMet3,-1,tmpfloat);
  534.                 }
  535.                 elseif(VColMaterialProperties==_MATSheetMetal)
  536.                 {
  537.                     sample(SFXFootStepWlk3,-1,tmpfloat);
  538.                 }
  539.                 elseif(VColMaterialProperties==_MATConcrete)
  540.                 {
  541.                     sample(SFXFootStepCon3,-1,tmpfloat);
  542.                 }
  543.                 elseif(VColMaterialProperties==_MATWater)
  544.                 {
  545.                     sample(SFXFootStepWat3,-1,tmpfloat);
  546.                 }
  547.                 else
  548.                 {
  549.                     sample(SFXFootStepReg3,-1,tmpfloat);
  550.                 }
  551.             }
  552.         }
  553. }
  554.  
  555. //TH added 9-99:
  556. subroutine(Sub_SFXCop_BackgroundChatter)//plugged-in
  557. {
  558.     if(VAIcon==1)//only do this for AI controlled characters
  559.     {
  560.         if(SoundDelayCounter<=0)//don't overlap sounds
  561.         {
  562.             float(_set,SoundDelayCounter,90);//set 3 second delay count-down until next sound can be triggered.
  563.             sample(SFXChat,-1);
  564.         }
  565.     }
  566. }
  567.  
  568. subroutine(Sub_RandomCopScratchesCrotch)//plugged-in
  569. { //don't overlap sounds
  570.     //if(SoundDelayCounter<=0 && vframe==28)
  571.     //{
  572.     //    float(_set,SoundDelayCounter,90);//set delay count-down until next sound can be triggered.
  573.     if(vframe==28)
  574.     {
  575.         sample(SFXCop_Scratch1,-1);
  576.     }
  577. }
  578.  
  579.  
  580.  
  581.  
  582.  
  583.