home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 89 / CDPowerplay89Disc1.iso / Demos / ui_hulk_demo_en.exe / Disk1 / data1.cab / App_Levels / scripts / damage.lua next >
Encoding:
Text File  |  2003-05-09  |  7.8 KB  |  153 lines

  1. ---------------------------------------
  2. --   Set up the explosion profiles   --
  3. ---------------------------------------
  4. --
  5. -- exp_DefineProfile(type, effectName, speed);
  6. -- type: 0 = small, 1 = medium, 2 = large : these correspond to the smartprop callback explosion_small etc...
  7. -- type: 3 to 12 correspond to the smartprop callback explosion_1 to explosion_10
  8. --
  9. -- after defining the explosion characteristics, then define the amount of force and damage it does
  10. -- for each of the four zones (index 0 to 3) using the function:
  11. -- exp_DefineProfileDamage(type, zone, radius, force, damage);
  12. -- note:  the radius for zone 3 is irrelevant, since it's assumed to be anything outside of zone2
  13. --
  14. -- you can call exp_Trigger(type, position); from the Lua console to test...
  15. --
  16.  
  17. -- small explosion (no damage just force)
  18. -- Only 2 radii of influence
  19. exp_DefineProfile(0, "", "", 20.0);
  20. exp_DefineProfileDamage(0, 0, 6.0, 1.0, 0.0);
  21. exp_DefineProfileDamage(0, 1, 12.0, 0.0, 0.0);
  22. exp_DefineProfileDamage(0, 2, 24.0, 0.0, 0.0);
  23. exp_DefineProfileDamage(0, 3, 30.0, 0.0, 0.0);
  24. --exp_DefineProfile(0, "missile_hit_local_missile_hit_expl_loc", "missile_hit_world_missile_hit_expl_world", 20.0);
  25. --exp_DefineProfileDamage(0, 0, 6.0, 1.0, 0.0);
  26. --exp_DefineProfileDamage(0, 1, 12.0, 0.7, 0.0);
  27. --exp_DefineProfileDamage(0, 2, 24.0, 0.0, 0.0);
  28. --exp_DefineProfileDamage(0, 3, 30.0, 0.0, 0.0);
  29.  
  30. -- medium explosion (close: no damage just force): rockets
  31. exp_DefineProfile(1, "missile_hit_local_missile_hit_expl_loc", "missile_hit_world_missile_hit_expl_world", 25.0);
  32. exp_DefineProfileDamage(1, 0, 2, 100.0, 50.0);
  33. exp_DefineProfileDamage(1, 1, 4.0, 50.0, 20.0);
  34. exp_DefineProfileDamage(1, 2, 8.0, 12.0, 0.0);
  35. exp_DefineProfileDamage(1, 3, 37.5, 0.0, 0.0);
  36.  
  37. -- large explosion (no damage just force)
  38. exp_DefineProfile(2, "missile_hit_local_missile_hit_expl_loc", "missile_hit_world_missile_hit_expl_world", 30.0);
  39. exp_DefineProfileDamage(2, 0, 3, 100.0, 75.0);
  40. exp_DefineProfileDamage(2, 1, 7.0, 50.0, 40.0);
  41. exp_DefineProfileDamage(2, 2, 24.0, 10.0, 0.0);
  42. exp_DefineProfileDamage(2, 3, 45.0, 0.0, 0.0);
  43.  
  44. -- Explosion 3 (Force, Damage, and Knockdown): explosive barrels
  45. exp_DefineProfile(3, "missile_hit_local_missile_hit_expl_loc", "missile_hit_world_missile_hit_expl_world", 20.0);
  46. exp_DefineProfileDamage(3, 0, 2.5, 100.0, 50.0);
  47. exp_DefineProfileDamage(3, 1, 4.0, 50.0, 25.0);
  48. exp_DefineProfileDamage(3, 2, 8.0, 12.0, 0.0);
  49. exp_DefineProfileDamage(3, 3, 30.0, 0.0, 0.0);
  50.  
  51. -- Explosion 4 (Force and Damage)
  52. exp_DefineProfile(4, "missile_hit_local_missile_hit_expl_loc", "missile_hit_world_missile_hit_expl_world", 20.0);
  53. exp_DefineProfileDamage(4, 0, 6.0, 50.0, 40.0);
  54. exp_DefineProfileDamage(4, 1, 12.0, 30.0, 20.0);
  55. exp_DefineProfileDamage(4, 2, 24.0, 10.0, 6.0);
  56. exp_DefineProfileDamage(4, 3, 30.0, 0.0, 0.0);
  57.  
  58. -- THIS EXPLOSION DEFINITION HAS A TYPO - IT'S REDEFINING EXPLOSION 4
  59. -- Currently this is used by C4_ledgedata.p3d, which therefore has no force, damage,
  60. -- and will be deleted the second frame which may affect the visuals...
  61. -- Explosion 5 (Force and Damage)
  62. exp_DefineProfile(5, "missile_hit_local_missile_hit_expl_loc", "missile_hit_world_missile_hit_expl_world", 20.0);
  63. exp_DefineProfileDamage(4, 0, 6.0, 50.0, 40.0);
  64. exp_DefineProfileDamage(4, 1, 12.0, 30.0, 20.0);
  65. exp_DefineProfileDamage(4, 2, 24.0, 10.0, 6.0);
  66. exp_DefineProfileDamage(4, 3, 40.0, 0.0, 0.0);
  67.  
  68. -- FLUX Grenade explosion profile  (EXPLOSION_4 in the smart prop) 
  69. exp_DefineProfile(6, "missile_hit_local_missile_hit_expl_loc", "grenade_hit_world_grenade_hit_expl_world", 25.0);
  70. exp_DefineProfileDamage(6, 0, 2, 100.0, 50.0);
  71. exp_DefineProfileDamage(6, 1, 4.0, 60.0, 25.0);
  72. exp_DefineProfileDamage(6, 2, 8.0, 0.0, 10.0);
  73. exp_DefineProfileDamage(6, 3, 37.5, 0.0, 0.0);
  74.  
  75. -- Explosion_7 (Force and Damage) -- for train -- created by Derek
  76. exp_DefineProfile(9, "missile_hit_local_missile_hit_expl_loc", "missile_hit_world_missile_hit_expl_world", 25.0);
  77. exp_DefineProfileDamage(9, 0, 2, 100.0, 0.0);
  78. exp_DefineProfileDamage(9, 1, 4.0, 50.0, 0.0);
  79. exp_DefineProfileDamage(9, 2, 8.0, 12.0, 0.0);
  80. exp_DefineProfileDamage(9, 3, 37.5, 0.0, 0.0);
  81.  
  82. -- Explosion_8 new explosion profile for missile soldiers
  83. -- Tuning this with Tim - DO NOT ALTER
  84. exp_DefineProfile(10, "missile_hit_local_missile_hit_expl_loc", "missile_hit_world_missile_hit_expl_world", 25.0);
  85. exp_DefineProfileDamage(10, 0, 2, 100.0, 75.0);
  86. exp_DefineProfileDamage(10, 1, 4.0, 50.0, 20.0);
  87. exp_DefineProfileDamage(10, 2, 8.0, 12.0, 0.0);
  88. exp_DefineProfileDamage(10, 3, 37.5, 0.0, 0.0);
  89.  
  90. -- Explosion_9 new explosion profile for gamma elite missiles
  91. -- Tuning this with Tim - DO NOT ALTER
  92. exp_DefineProfile(11, "missile_hit_local_missile_hit_expl_loc", "missile_hit_world_missile_hit_expl_world", 20.0);
  93. exp_DefineProfileDamage(11, 0, 2, 60.0, 30.0);
  94. exp_DefineProfileDamage(11, 1, 3.0, 25.0, 10.0);
  95. exp_DefineProfileDamage(11, 2, 8.0, 0.0, 0.0);
  96. exp_DefineProfileDamage(11, 3, 37.5, 0.0, 0.0);
  97.  
  98. -- Explosion 12 (Force and Damage) -- BRIAN S IS USING THIS FOR ICE .. TALK TO HIM BEFORE YOU TWEAK
  99. exp_DefineProfile(12, "", "", 20.0);
  100. exp_DefineProfileDamage(12, 0, 2, 60.0, 80.0);
  101. exp_DefineProfileDamage(12, 1, 4, 40.0, 40.0);
  102. exp_DefineProfileDamage(12, 2, 5, 0, 0);
  103. exp_DefineProfileDamage(12, 3, 5.0, 0.0, 0.0);
  104.  
  105. -- Explosions 3 - 12 (corresponding to Explosion_1 to Explosion_10) are defaulted in code
  106. -- to the same parameters as Explosions 0 (small explosion)... you can add the tuning calls as you see fit.
  107.  
  108. -------------------------------------------------------
  109. --   Set up the character damage reaction profiles   --
  110. -------------------------------------------------------
  111. -- char_DefineDamageProfile(int size, maxForce, maxVelocity, maxHitReactionTime, maxPushBackDistance, maxPushBackTime, maxStunTime);
  112. -- size: 0 = small, 1 = large, 2 = quadruped
  113.  
  114. -- 0-14%: No reaction | 15-24: pause reaction (based on stuntime) | 25-49: Hit reaction No Pushback | -- 50-74: Pushback No Float | 75+: Float
  115.  
  116. -- small character
  117. char_DefineForceReactionProfile(0, 34.0, 5.0, 1.0, 3.0, 3.0, 0.8);
  118.  
  119. -- large character
  120. char_DefineForceReactionProfile(1, 100.0, 10.0, 1, 5.0, 2.0, 0.0);
  121.  
  122. -- quadruped character
  123. char_DefineForceReactionProfile(2, 100.0, 2.0, 0.8, 3.0, 3.0, 0.8);
  124.  
  125. ------------------------------------------------------
  126. --   Set up cannon and missile autogun parameters   --
  127. ------------------------------------------------------
  128. -- The following two function set the attributes (default or specific) for the cannon autoguns
  129. -- am_CannonAutoGunSetDefaults(trackingLagFactor, firingLagFactor, reloadTime, deactivateTimeout, activationRadius, wakeupTime);
  130. -- am_CannonAutoGunSetParams(autogunName, trackingLagFactor, firingLagFactor, reloadTime, deactivateTimeout, activationRadius, wakeupTime);
  131. --
  132. -- The following functions set the attributes (default or specific) for the autoguns and the tank
  133. -- am_MissileAutoGunSetParams(trackingLagFactor, reloadTime, deactivateTimeout, activationRadius, wakeupTime);
  134. -- am_MissileAutoGunSetParams(autoGunName, trackingLagFactor, reloadTime, deactivateTimeout, activationRadius, wakeupTime);
  135. -- am_TankSetParams(trackingLag, reloadTime, activeRadius, speed, movementForce, movementDamage);
  136. --
  137. -- The "lag factors" affect how fast the gun will rotate around and stay on target...
  138. -- The higher the factor, the less lag (the more accurate) the gun will be.
  139.  
  140. am_CannonAutoGunSetDefaults(50, 45, 0.1, 3.0, 20.0, 0.1);
  141. am_MissileAutoGunSetDefaults(45, 3.0, 4.0, 20.0, 0.0);
  142. am_TankSetDefaults(20, 3.0, 30.0, 8, 150.0, 25.0);
  143.  
  144. ------------------------------------------------------
  145. --         Other damage related parameters          --
  146. ------------------------------------------------------
  147. -- Energy doors apply force and damage when the hulk collides with them...
  148. -- am_EnergyDoorSetParams(force, damage);
  149.  
  150. am_EnergyDoorSetParams(100.0, 5.0);
  151.  
  152.  
  153.