home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 February / Gamestar_81_2006-02_dvd.iso / Red Shark / Common / SovietKatusha.script < prev    next >
Encoding:
Text File  |  2001-11-20  |  5.2 KB  |  200 lines

  1. //-------------------------------------------------------------------
  2. //
  3. //  This code is copyright 2001 by G5 Software.
  4. //  Any unauthorized usage, either in part or in whole of this code
  5. //  is strictly prohibited. Violators WILL be prosecuted to the
  6. //  maximum extent allowed by law.
  7. //
  8. //-------------------------------------------------------------------
  9.  
  10. class CSovietKatushaMesh
  11. {
  12.   string MeshFile = "Models/S_Katusha.mesh";
  13.   string SkinFile = "Models/S_Katusha.skin";
  14.   string AnimFile = "Models/S_Katusha.anim";
  15. }
  16.  
  17. class CSovietKatushaStateControl extends CMobileGroundUnitStateControl
  18. {
  19.   void CSovietKatushaStateControl()
  20.   {
  21.     CMobileGroundUnitStateControl(1000.0);
  22.     m_DestroyPause = 7.5;
  23.     m_ExplosionId  = "EXPLID_SovietKatushaExplosion";
  24.   }
  25. }
  26.  
  27. class CSovietKatushaTargetingAnimator
  28. {
  29.   string HorAnimName    = "tower";
  30.   string VerAnimName    = "gun";
  31.  
  32.   float  LeftEndAngle   = -180.0;
  33.   float  RightEndAngle  =  180.0;
  34.   float  TopEndAngle    =  0.0;
  35.   float  BottomEndAngle =  20.0;
  36.  
  37.   float  MaxAngleSpeed  = 30.0;
  38. }
  39.  
  40. class CSovietKatushaGun extends CWorldPhysics, CBaseWeaponDescriptor
  41. {
  42.   int    AmmoQuantity      = -1;
  43.   float  BulletSpeed       = 150.0;
  44.   vector GravityVector     = g_Gravity;
  45.   float  FireDeviation     = 0.05;
  46.   string BulletPatternId   = "BULLETID_SovietKatushaRocket";
  47.   string EffectOnFire      = "";
  48.   string FireCloudEffect   = "EFFECTID_KatushaRocketFireCloudEffect";
  49.   string SoundOnFire       = "SOUNDID_KatushaRocketFireSound";
  50.  
  51.   string WeaponName        = "Gun";
  52.   float  FireWeaponDelay   = 0.8;
  53.   bool   IsAutotargeting   = false;
  54.   int    AttachSlotNumber  = 1;
  55. }
  56.  
  57. class CSovietKatushaGun_01 extends CSovietKatushaGun
  58. {
  59.   string LinkJointName = "_Gun_Fire_01";
  60. }
  61.  
  62. class CSovietKatushaGun_02 extends CSovietKatushaGun
  63. {
  64.   string LinkJointName = "_Gun_Fire_02";
  65. }
  66.  
  67. class CSovietKatushaGun_03 extends CSovietKatushaGun
  68. {
  69.   string LinkJointName = "_Gun_Fire_03";
  70. }
  71.  
  72. class CSovietKatushaGun_04 extends CSovietKatushaGun
  73. {
  74.   string LinkJointName = "_Gun_Fire_04";
  75. }
  76.  
  77. class CSovietKatushaGun_05 extends CSovietKatushaGun
  78. {
  79.   string LinkJointName = "_Gun_Fire_05";
  80. }
  81.  
  82. class CSovietKatushaGun_06 extends CSovietKatushaGun
  83. {
  84.   string LinkJointName = "_Gun_Fire_06";
  85. }
  86.  
  87. class CSovietKatushaGun_07 extends CSovietKatushaGun
  88. {
  89.   string LinkJointName = "_Gun_Fire_07";
  90. }
  91.  
  92. class CSovietKatushaGun_08 extends CSovietKatushaGun
  93. {
  94.   string LinkJointName = "_Gun_Fire_08";
  95. }
  96.  
  97. class CSovietKatushaGun_09 extends CSovietKatushaGun
  98. {
  99.   string LinkJointName = "_Gun_Fire_09";
  100. }
  101.  
  102. class CSovietKatushaGun_10 extends CSovietKatushaGun
  103. {
  104.   string LinkJointName = "_Gun_Fire_10";
  105. }
  106.  
  107. class CSovietKatushaBehavior extends
  108.     CBaseBehavior, CSovietKatushaMoveParameters, CSovietKatushaFireParameters
  109. {
  110.   void CSovietKatushaBehavior()
  111.   {
  112.     CBaseBehavior();
  113.   }
  114. }
  115.  
  116. class CSovietKatushaMoveParameters
  117. {
  118.   boolean  CanMove = true;
  119.  
  120.   float  MaxSpeed              = 14;   // m/s
  121.   float  MaxAngleSpeed         = 3;    // rad/s
  122.   float  MaxAccelleration      = 15;   // m/(s*s)
  123.   float  MaxAngleAccelleration = 10;   // rad/(s*s)
  124.  
  125.   float  MoveBank     = 0.0; // tank has no banking
  126.   float  RotationBank = 0.0; // tank has no banking
  127. }
  128.  
  129. class CSovietKatushaFireParameters
  130. {
  131.   bool  CanFire = true;
  132.  
  133.   int   FirePeriod        = 300; // ms
  134.   int   FirePeriodRandAdd = 0; // ms
  135.  
  136.   int   ShootGunNum = 1;
  137.  
  138.   bool  BurstFire         = true;
  139.   int   BurstTime         = 3000; // ms
  140.   int   BurstTimeRandAdd  = 0; // ms
  141.  
  142.   int   BurstDelay        = 9000; // ms
  143.   int   BurstDelayRandAdd = 5000; // ms
  144.  
  145. // radar
  146.  
  147.   bool  HasRadar = true;
  148.  
  149.   float MaxRadarDistance = 100; // m
  150.   float MinRadarDistance = 100;   // m
  151.  
  152.   int   UpdateRadarPeriod        = 3000; // ms
  153.   int   UpdateRadarPeriodRandAdd = 1000; // ms
  154.  
  155.   bool  FireFlying = false;
  156.   bool  FireGround = true;
  157. };
  158.  
  159. class CSovietKatusha extends
  160.   CGroundUnit,
  161.   CArmedUnit,
  162.   CUnitWithSound,
  163.   CUnitWithCamera,
  164.   CUnitWithStateControl,
  165.   CUnitWithBehavior
  166. {
  167.   void CSovietKatusha()
  168.   {
  169.     InitializeModelAsAnimated("CSovietKatushaMesh");
  170.     CUnitWithStateControl("CSovietKatushaStateControl");
  171.     InitializeSound("CSovietKatushaEngineSound");
  172.  
  173.     CreateAnimatedWeapon("Slot_01", "CSovietKatushaGun_01", "CSovietKatushaTargetingAnimator");
  174.     CreateStaticWeapon("Slot_02", "CSovietKatushaGun_02");
  175.     CreateStaticWeapon("Slot_03", "CSovietKatushaGun_03");
  176.     CreateStaticWeapon("Slot_04", "CSovietKatushaGun_04");
  177.     CreateStaticWeapon("Slot_05", "CSovietKatushaGun_05");
  178.     CreateStaticWeapon("Slot_06", "CSovietKatushaGun_06");
  179.     CreateStaticWeapon("Slot_07", "CSovietKatushaGun_07");
  180.     CreateStaticWeapon("Slot_08", "CSovietKatushaGun_08");
  181.     CreateStaticWeapon("Slot_09", "CSovietKatushaGun_09");
  182.     CreateStaticWeapon("Slot_10", "CSovietKatushaGun_10");
  183.  
  184.     InitializeVehicleBehavior("CSovietKatushaBehavior");
  185.  
  186.     Core_AddClassificator("Russian");
  187.     Core_AddClassificator("Katusha");       // for cockpit identification
  188.     Core_AddClassificator("GroundUnit"); // for behavior fire logic
  189.   }
  190. }
  191.  
  192. class CCapturedSovietKatusha extends CSovietKatusha
  193. {
  194.   void CCapturedSovietKatusha()
  195.   {
  196.     Core_RemoveClassificator("Russian");
  197.     Core_AddClassificator("German");
  198.   }
  199. }
  200.