home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 February / Gamestar_81_2006-02_dvd.iso / Red Shark / Common / CountryMill.script < prev    next >
Encoding:
Text File  |  2001-12-21  |  1.9 KB  |  75 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 CCountryMillMesh_1
  11. {
  12.   string MeshFile = "Models/B_Country_Mill_1.mesh";
  13.   string SkinFile = "Models/B_Country_Mill_1.skin";
  14.   string AnimFile = "Models/B_Country_Mill_1.anim";
  15. }
  16.  
  17. class CCountryMillMesh_2
  18. {
  19.   string MeshFile = "Models/B_Country_Mill_2.mesh";
  20.   string SkinFile = "Models/B_Country_Mill_2.skin";
  21.   string AnimFile = "Models/B_Country_Mill_2.anim";
  22. }
  23.  
  24. class CCountryMillStateControl extends CUnitLifeControl
  25. {
  26.   void CCountryMillStateControl()
  27.   {
  28.     CUnitLifeControl(3500.0);
  29.     m_DestroyPause = 20.0;
  30.     m_ExplosionId  = "EXPLID_BuildingExplosion";
  31.   }
  32. }
  33.  
  34. class CCountryMillRotorAnimator
  35. {
  36.   string AnimationName = "rotor";
  37.   float  SpeedFactor   = 0.1;
  38.  
  39.   void CCountryMillRotorAnimator()
  40.   {
  41.     SpeedFactor = rand(0.05, 0.15);
  42.   }
  43. }
  44.  
  45. // Building without ground control (for use in villages)
  46. class CBaseCountryMill extends CBuilding, CUnitWithStateControl
  47. {
  48.   array m_MeshClassNames = array(
  49.       "CCountryMillMesh_1",
  50.       "CCountryMillMesh_2"
  51.     );
  52.  
  53.   void CBaseCountryMill()
  54.   {
  55.     int MeshNumber = rand_int(m_MeshClassNames.size());
  56.     InitializeModelAsAnimated(m_MeshClassNames[MeshNumber]);
  57.     CUnitWithStateControl("CCountryMillStateControl");
  58.  
  59.     CreateComponent("Rotor", "CircledAnimator", "CCountryMillRotorAnimator");
  60.     SetComponentSlaveObject("Rotor", "Mesh");
  61.   }
  62. }
  63.  
  64. // Single game object
  65. class CMountedCountryMill extends CBaseCountryMill
  66. {
  67.   void CMountedCountryMill()
  68.   {
  69.     InitializeGroundControl();
  70.   }
  71. }
  72.  
  73.  
  74.  
  75.