Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 6th, 2011  |  syntax: Lua  |  size: 3.26 KB  |  views: 66  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. -- Artillery - Light Howitzers
  2.  
  3. -- Howitzer Base Class
  4. local HowitzerClass = Weapon:New{
  5.   collisionSize      = 4,
  6.   edgeEffectiveness  = 0.15,
  7.   explosionGenerator = [[custom:HE_Large]],
  8.   explosionSpeed     = 30,
  9.   gravityAffected    = true,
  10.   impulseFactor      = 0,
  11.   intensity          = 0.1,
  12.   leadLimit          = 0.05,
  13.   myGravity          = 1/3,
  14.   noSelfDamage       = true,
  15.   rgbColor           = [[0.5 0.5 0.0]],
  16.   separation         = 2,
  17.   size               = 1,
  18.   soundStart         = [[GEN_105mm]],
  19.   soundHit           = [[GEN_Explo_4]],
  20.   stages             = 50,
  21.   targetMoveError    = 0.75,
  22.   tolerance          = 3000,
  23.   turret             = true,
  24.   weaponType         = [[Cannon]],
  25.   weaponVelocity     = 1200,
  26.   customparams = {
  27.     damagetype         = [[explosive]],
  28.     howitzer           = 1,
  29.   },
  30. }
  31.  
  32. -- HE Round Class
  33. local HowitzerHEClass = HowitzerClass:New{
  34.   name               = [[HE Shell]],
  35.   customparams = {
  36.     fearaoe            = 210,
  37.     fearid             = 501,
  38.   },
  39. }
  40.  
  41. -- Smoke Round Class
  42. local HowitzerSmokeClass = HowitzerClass:New{
  43.   areaOfEffect       = 30,
  44.   name               = [[Smoke Shell]],
  45.   customparams = {
  46.         smokeradius        = 250,
  47.         smokeduration      = 40,
  48.         smokeceg           = [[SMOKESHELL_Medium]],
  49.   },
  50.   damage = {
  51.     default = 100,
  52.   } ,
  53. }
  54.  
  55. -- Implementations
  56.  
  57. -- QF 25pdr Gun (GBR)
  58. local QF25Pdr = HowitzerClass:New{
  59.   accuracy           = 720,
  60.   areaOfEffect       = 94,
  61.   edgeEffectiveness  = 0.2, -- overrides default
  62.   name               = [[Ordnance QF 25pdr Gun Mk. II]],
  63.   range              = 7780,
  64.   reloadtime         = 7.2,
  65.   damage = {
  66.     default            = 1088,
  67.   },
  68. }
  69. local QF25PdrHE = QF25Pdr:Inherit(HowitzerHEClass)
  70. local QF25PdrSmoke = QF25Pdr:Inherit(HowitzerSmokeClass)
  71.  
  72. -- 10.5cm LeFH 18/40 (GER)
  73. local LeFH18 = HowitzerClass:New{
  74.   accuracy           = 1050,
  75.   areaOfEffect       = 129,
  76.   name               = [[10.5cm LeFH 18/40]],
  77.   range              = 7200,
  78.   reloadtime         = 11.25,
  79.   damage = {
  80.     default            = 4200,
  81.   },
  82. }
  83. local LeFH18HE = LeFH18:Inherit(HowitzerHEClass)
  84. local LeFH18Smoke = LeFH18:Inherit(HowitzerSmokeClass)
  85.  
  86. -- M2 105mm Howitzer (USA)
  87. local M2 = HowitzerClass:New{
  88.   accuracy           = 1050,
  89.   areaOfEffect       = 131,
  90.   name               = [[10.5cm LeFH 18/40]],
  91.   range              = 7200,
  92.   reloadtime         = 11.25,
  93.   damage = {
  94.     default            = 4360,
  95.   },
  96. }
  97. local M2HE = M2:Inherit(HowitzerHEClass)
  98. local M2Smoke = M2:Inherit(HowitzerSmokeClass)
  99.  
  100. -- M-30 122mm Howitzer (RUS)
  101. local M30122mm = HowitzerClass:New{
  102.   accuracy           = 1150,
  103.   areaOfEffect       = 154,
  104.   name               = [[M-30 122mm Howitzer]],
  105.   range              = 6965,
  106.   reloadtime         = 15,
  107.   damage = {
  108.     default            = 7200,
  109.   },
  110. }
  111. local M30122mmHE = M30122mm:Inherit(HowitzerHEClass):New{
  112.   customparams = {
  113.     fearaoe            = 250,
  114.   }
  115. }
  116. local M30122mmSmoke = M30122mm:Inherit(HowitzerSmokeClass)
  117.  
  118. -- Return only the full weapons
  119. return lowerkeys({
  120.   QF25PdrHE = QF25PdrHE,
  121.   QF25PdrSmoke = QF25PdrSmoke,
  122.   LeFH18HE = LeFH18HE,
  123.   LeFH18Smoke = LeFH18Smoke,
  124.   M2HE = M2HE,
  125.   M2Smoke = M2Smoke,
  126.   M30122mmHE = M30122mmHE,
  127.   M30122mmSmoke = M30122mmSmoke,
  128. })