Advertisement
Faecous

EditUnitWeapon

Jul 16th, 2019
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 242.90 KB | None | 0 0
  1.  
  2. if (unit.Entity.ID == "0751142d-5f06-40c1-944d-20e8fb22df41" && handType == HoldingHandler.HandType.Right)
  3. {
  4. weapon.GetComponentInChildren<Weapon>().GetComponentInChildren<Rigidbody>().detectCollisions = false;
  5. }
  6. if (unit.Entity.ID == "c0fcecb7-63e2-430c-b361-fa7cd3d89945")
  7. {
  8. weapon.GetComponentInChildren<Weapon>().maxRange *= 5f;
  9. }
  10. UMH.comment = "________________________________________________________________________________";
  11. UMH.comment = "This is where all units individually start";
  12. UMH.comment = "________________________________________________________________________________";
  13. UMH.comment = " ";
  14. UMH.comment = " ";
  15. UMH.comment = " ";
  16. UMH.comment = " ";
  17. UMH.comment = "________________________________________________________________________________";
  18. UMH.comment = "Melee";
  19. UMH.comment = "________________________________________________________________________________";
  20. if (unit.Entity.Name == "")
  21. {
  22. UMH.comment = "MeleeUnit";
  23. UMH.comment = "Faction";
  24. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  25. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  26. {
  27. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  28. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  29. weapon.AddComponent<MeleeWeapon>();
  30. weapon.AddComponent<Holdable>();
  31. weapon.AddComponent<CollisionDamage>();
  32. weapon.AddComponent<CollisionWeapon>();
  33. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  34. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  35. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  36. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  37. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  38. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  39. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  40. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  41. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  42. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  43. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  44. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  45. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  46. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  47. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  48. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  49. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  50. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  51. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  52. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  53. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  54. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  55. weapon.GetComponentInChildren<Weapon>().isRange = false;
  56. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  57. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  58. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  59. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  60. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  61. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  62. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  63. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  64. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  65. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  66. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  67. checked
  68. {
  69. if (unit.Entity.Name == "ColourEdit")
  70. {
  71. Renderer[] componentsInChildren = weapon.GetComponentsInChildren<Renderer>();
  72. for (int i = 0; i < componentsInChildren.Length; i++)
  73. {
  74. componentsInChildren[i].material.color = new Color(1f, 1f, 1f);
  75. for (int j = 0; j < componentsInChildren[i].materials.Length; j++)
  76. {
  77. Color color;
  78. switch (j)
  79. {
  80. case 0:
  81. color = new Color(1f, 1f, 1f);
  82. break;
  83. case 1:
  84. color = new Color(1f, 0f, 0f);
  85. break;
  86. case 2:
  87. color = new Color(0f, 1f, 0f);
  88. break;
  89. default:
  90. color = new Color(0f, 0f, 1f);
  91. break;
  92. }
  93. componentsInChildren[i].materials[j].color = color;
  94. }
  95. }
  96. }
  97. }
  98. }
  99. }
  100. if (unit.Entity.Name == "")
  101. {
  102. UMH.comment = "MeleeUnit";
  103. UMH.comment = "Faction";
  104. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  105. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  106. {
  107. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  108. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  109. weapon.AddComponent<MeleeWeapon>();
  110. weapon.AddComponent<Holdable>();
  111. weapon.AddComponent<CollisionDamage>();
  112. weapon.AddComponent<CollisionWeapon>();
  113. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  114. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  115. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  116. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  117. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  118. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  119. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  120. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  121. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  122. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  123. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  124. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  125. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  126. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  127. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  128. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  129. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  130. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  131. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  132. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  133. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  134. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  135. weapon.GetComponentInChildren<Weapon>().isRange = false;
  136. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  137. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  138. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  139. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  140. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  141. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  142. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  143. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  144. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  145. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  146. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  147. checked
  148. {
  149. if (unit.Entity.Name == "ColourEdit")
  150. {
  151. Renderer[] componentsInChildren2 = weapon.GetComponentsInChildren<Renderer>();
  152. for (int k = 0; k < componentsInChildren2.Length; k++)
  153. {
  154. componentsInChildren2[k].material.color = new Color(1f, 1f, 1f);
  155. for (int l = 0; l < componentsInChildren2[k].materials.Length; l++)
  156. {
  157. Color color2;
  158. switch (l)
  159. {
  160. case 0:
  161. color2 = new Color(1f, 1f, 1f);
  162. break;
  163. case 1:
  164. color2 = new Color(1f, 0f, 0f);
  165. break;
  166. case 2:
  167. color2 = new Color(0f, 1f, 0f);
  168. break;
  169. default:
  170. color2 = new Color(0f, 0f, 1f);
  171. break;
  172. }
  173. componentsInChildren2[k].materials[l].color = color2;
  174. }
  175. }
  176. }
  177. }
  178. }
  179. }
  180. if (unit.Entity.Name == "")
  181. {
  182. UMH.comment = "MeleeUnit";
  183. UMH.comment = "Faction";
  184. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  185. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  186. {
  187. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  188. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  189. weapon.AddComponent<MeleeWeapon>();
  190. weapon.AddComponent<Holdable>();
  191. weapon.AddComponent<CollisionDamage>();
  192. weapon.AddComponent<CollisionWeapon>();
  193. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  194. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  195. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  196. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  197. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  198. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  199. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  200. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  201. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  202. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  203. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  204. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  205. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  206. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  207. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  208. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  209. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  210. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  211. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  212. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  213. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  214. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  215. weapon.GetComponentInChildren<Weapon>().isRange = false;
  216. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  217. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  218. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  219. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  220. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  221. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  222. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  223. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  224. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  225. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  226. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  227. checked
  228. {
  229. if (unit.Entity.Name == "ColourEdit")
  230. {
  231. Renderer[] componentsInChildren3 = weapon.GetComponentsInChildren<Renderer>();
  232. for (int m = 0; m < componentsInChildren3.Length; m++)
  233. {
  234. componentsInChildren3[m].material.color = new Color(1f, 1f, 1f);
  235. for (int n = 0; n < componentsInChildren3[m].materials.Length; n++)
  236. {
  237. Color color3;
  238. switch (n)
  239. {
  240. case 0:
  241. color3 = new Color(1f, 1f, 1f);
  242. break;
  243. case 1:
  244. color3 = new Color(1f, 0f, 0f);
  245. break;
  246. case 2:
  247. color3 = new Color(0f, 1f, 0f);
  248. break;
  249. default:
  250. color3 = new Color(0f, 0f, 1f);
  251. break;
  252. }
  253. componentsInChildren3[m].materials[n].color = color3;
  254. }
  255. }
  256. }
  257. }
  258. }
  259. }
  260. if (unit.Entity.Name == "")
  261. {
  262. UMH.comment = "MeleeUnit";
  263. UMH.comment = "Faction";
  264. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  265. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  266. {
  267. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  268. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  269. weapon.AddComponent<MeleeWeapon>();
  270. weapon.AddComponent<Holdable>();
  271. weapon.AddComponent<CollisionDamage>();
  272. weapon.AddComponent<CollisionWeapon>();
  273. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  274. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  275. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  276. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  277. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  278. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  279. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  280. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  281. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  282. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  283. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  284. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  285. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  286. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  287. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  288. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  289. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  290. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  291. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  292. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  293. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  294. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  295. weapon.GetComponentInChildren<Weapon>().isRange = false;
  296. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  297. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  298. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  299. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  300. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  301. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  302. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  303. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  304. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  305. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  306. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  307. checked
  308. {
  309. if (unit.Entity.Name == "ColourEdit")
  310. {
  311. Renderer[] componentsInChildren4 = weapon.GetComponentsInChildren<Renderer>();
  312. for (int i2 = 0; i2 < componentsInChildren4.Length; i2++)
  313. {
  314. componentsInChildren4[i2].material.color = new Color(1f, 1f, 1f);
  315. for (int j2 = 0; j2 < componentsInChildren4[i2].materials.Length; j2++)
  316. {
  317. Color color4;
  318. switch (j2)
  319. {
  320. case 0:
  321. color4 = new Color(1f, 1f, 1f);
  322. break;
  323. case 1:
  324. color4 = new Color(1f, 0f, 0f);
  325. break;
  326. case 2:
  327. color4 = new Color(0f, 1f, 0f);
  328. break;
  329. default:
  330. color4 = new Color(0f, 0f, 1f);
  331. break;
  332. }
  333. componentsInChildren4[i2].materials[j2].color = color4;
  334. }
  335. }
  336. }
  337. }
  338. }
  339. }
  340. if (unit.Entity.Name == "")
  341. {
  342. UMH.comment = "MeleeUnit";
  343. UMH.comment = "Faction";
  344. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  345. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  346. {
  347. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  348. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  349. weapon.AddComponent<MeleeWeapon>();
  350. weapon.AddComponent<Holdable>();
  351. weapon.AddComponent<CollisionDamage>();
  352. weapon.AddComponent<CollisionWeapon>();
  353. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  354. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  355. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  356. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  357. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  358. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  359. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  360. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  361. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  362. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  363. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  364. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  365. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  366. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  367. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  368. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  369. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  370. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  371. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  372. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  373. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  374. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  375. weapon.GetComponentInChildren<Weapon>().isRange = false;
  376. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  377. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  378. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  379. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  380. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  381. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  382. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  383. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  384. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  385. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  386. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  387. checked
  388. {
  389. if (unit.Entity.Name == "ColourEdit")
  390. {
  391. Renderer[] componentsInChildren5 = weapon.GetComponentsInChildren<Renderer>();
  392. for (int i3 = 0; i3 < componentsInChildren5.Length; i3++)
  393. {
  394. componentsInChildren5[i3].material.color = new Color(1f, 1f, 1f);
  395. for (int j3 = 0; j3 < componentsInChildren5[i3].materials.Length; j3++)
  396. {
  397. Color color5;
  398. switch (j3)
  399. {
  400. case 0:
  401. color5 = new Color(1f, 1f, 1f);
  402. break;
  403. case 1:
  404. color5 = new Color(1f, 0f, 0f);
  405. break;
  406. case 2:
  407. color5 = new Color(0f, 1f, 0f);
  408. break;
  409. default:
  410. color5 = new Color(0f, 0f, 1f);
  411. break;
  412. }
  413. componentsInChildren5[i3].materials[j3].color = color5;
  414. }
  415. }
  416. }
  417. }
  418. }
  419. }
  420. if (unit.Entity.Name == "")
  421. {
  422. UMH.comment = "MeleeUnit";
  423. UMH.comment = "Faction";
  424. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  425. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  426. {
  427. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  428. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  429. weapon.AddComponent<MeleeWeapon>();
  430. weapon.AddComponent<Holdable>();
  431. weapon.AddComponent<CollisionDamage>();
  432. weapon.AddComponent<CollisionWeapon>();
  433. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  434. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  435. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  436. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  437. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  438. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  439. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  440. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  441. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  442. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  443. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  444. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  445. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  446. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  447. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  448. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  449. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  450. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  451. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  452. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  453. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  454. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  455. weapon.GetComponentInChildren<Weapon>().isRange = false;
  456. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  457. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  458. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  459. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  460. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  461. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  462. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  463. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  464. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  465. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  466. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  467. checked
  468. {
  469. if (unit.Entity.Name == "ColourEdit")
  470. {
  471. Renderer[] componentsInChildren6 = weapon.GetComponentsInChildren<Renderer>();
  472. for (int i4 = 0; i4 < componentsInChildren6.Length; i4++)
  473. {
  474. componentsInChildren6[i4].material.color = new Color(1f, 1f, 1f);
  475. for (int j4 = 0; j4 < componentsInChildren6[i4].materials.Length; j4++)
  476. {
  477. Color color6;
  478. switch (j4)
  479. {
  480. case 0:
  481. color6 = new Color(1f, 1f, 1f);
  482. break;
  483. case 1:
  484. color6 = new Color(1f, 0f, 0f);
  485. break;
  486. case 2:
  487. color6 = new Color(0f, 1f, 0f);
  488. break;
  489. default:
  490. color6 = new Color(0f, 0f, 1f);
  491. break;
  492. }
  493. componentsInChildren6[i4].materials[j4].color = color6;
  494. }
  495. }
  496. }
  497. }
  498. }
  499. }
  500. if (unit.Entity.Name == "")
  501. {
  502. UMH.comment = "MeleeUnit";
  503. UMH.comment = "Faction";
  504. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  505. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  506. {
  507. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  508. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  509. weapon.AddComponent<MeleeWeapon>();
  510. weapon.AddComponent<Holdable>();
  511. weapon.AddComponent<CollisionDamage>();
  512. weapon.AddComponent<CollisionWeapon>();
  513. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  514. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  515. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  516. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  517. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  518. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  519. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  520. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  521. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  522. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  523. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  524. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  525. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  526. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  527. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  528. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  529. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  530. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  531. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  532. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  533. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  534. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  535. weapon.GetComponentInChildren<Weapon>().isRange = false;
  536. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  537. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  538. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  539. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  540. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  541. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  542. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  543. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  544. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  545. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  546. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  547. checked
  548. {
  549. if (unit.Entity.Name == "ColourEdit")
  550. {
  551. Renderer[] componentsInChildren7 = weapon.GetComponentsInChildren<Renderer>();
  552. for (int i5 = 0; i5 < componentsInChildren7.Length; i5++)
  553. {
  554. componentsInChildren7[i5].material.color = new Color(1f, 1f, 1f);
  555. for (int j5 = 0; j5 < componentsInChildren7[i5].materials.Length; j5++)
  556. {
  557. Color color7;
  558. switch (j5)
  559. {
  560. case 0:
  561. color7 = new Color(1f, 1f, 1f);
  562. break;
  563. case 1:
  564. color7 = new Color(1f, 0f, 0f);
  565. break;
  566. case 2:
  567. color7 = new Color(0f, 1f, 0f);
  568. break;
  569. default:
  570. color7 = new Color(0f, 0f, 1f);
  571. break;
  572. }
  573. componentsInChildren7[i5].materials[j5].color = color7;
  574. }
  575. }
  576. }
  577. }
  578. }
  579. }
  580. if (unit.Entity.Name == "")
  581. {
  582. UMH.comment = "MeleeUnit";
  583. UMH.comment = "Faction";
  584. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  585. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  586. {
  587. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  588. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  589. weapon.AddComponent<MeleeWeapon>();
  590. weapon.AddComponent<Holdable>();
  591. weapon.AddComponent<CollisionDamage>();
  592. weapon.AddComponent<CollisionWeapon>();
  593. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  594. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  595. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  596. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  597. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  598. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  599. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  600. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  601. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  602. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  603. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  604. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  605. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  606. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  607. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  608. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  609. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  610. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  611. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  612. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  613. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  614. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  615. weapon.GetComponentInChildren<Weapon>().isRange = false;
  616. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  617. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  618. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  619. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  620. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  621. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  622. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  623. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  624. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  625. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  626. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  627. checked
  628. {
  629. if (unit.Entity.Name == "ColourEdit")
  630. {
  631. Renderer[] componentsInChildren8 = weapon.GetComponentsInChildren<Renderer>();
  632. for (int i6 = 0; i6 < componentsInChildren8.Length; i6++)
  633. {
  634. componentsInChildren8[i6].material.color = new Color(1f, 1f, 1f);
  635. for (int j6 = 0; j6 < componentsInChildren8[i6].materials.Length; j6++)
  636. {
  637. Color color8;
  638. switch (j6)
  639. {
  640. case 0:
  641. color8 = new Color(1f, 1f, 1f);
  642. break;
  643. case 1:
  644. color8 = new Color(1f, 0f, 0f);
  645. break;
  646. case 2:
  647. color8 = new Color(0f, 1f, 0f);
  648. break;
  649. default:
  650. color8 = new Color(0f, 0f, 1f);
  651. break;
  652. }
  653. componentsInChildren8[i6].materials[j6].color = color8;
  654. }
  655. }
  656. }
  657. }
  658. }
  659. }
  660. if (unit.Entity.Name == "")
  661. {
  662. UMH.comment = "MeleeUnit";
  663. UMH.comment = "Faction";
  664. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  665. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  666. {
  667. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  668. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  669. weapon.AddComponent<MeleeWeapon>();
  670. weapon.AddComponent<Holdable>();
  671. weapon.AddComponent<CollisionDamage>();
  672. weapon.AddComponent<CollisionWeapon>();
  673. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  674. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  675. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  676. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  677. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  678. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  679. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  680. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  681. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  682. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  683. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  684. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  685. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  686. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  687. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  688. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  689. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  690. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  691. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  692. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  693. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  694. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  695. weapon.GetComponentInChildren<Weapon>().isRange = false;
  696. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  697. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  698. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  699. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  700. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  701. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  702. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  703. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  704. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  705. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  706. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  707. checked
  708. {
  709. if (unit.Entity.Name == "ColourEdit")
  710. {
  711. Renderer[] componentsInChildren9 = weapon.GetComponentsInChildren<Renderer>();
  712. for (int i7 = 0; i7 < componentsInChildren9.Length; i7++)
  713. {
  714. componentsInChildren9[i7].material.color = new Color(1f, 1f, 1f);
  715. for (int j7 = 0; j7 < componentsInChildren9[i7].materials.Length; j7++)
  716. {
  717. Color color9;
  718. switch (j7)
  719. {
  720. case 0:
  721. color9 = new Color(1f, 1f, 1f);
  722. break;
  723. case 1:
  724. color9 = new Color(1f, 0f, 0f);
  725. break;
  726. case 2:
  727. color9 = new Color(0f, 1f, 0f);
  728. break;
  729. default:
  730. color9 = new Color(0f, 0f, 1f);
  731. break;
  732. }
  733. componentsInChildren9[i7].materials[j7].color = color9;
  734. }
  735. }
  736. }
  737. }
  738. }
  739. }
  740. if (unit.Entity.Name == "")
  741. {
  742. UMH.comment = "MeleeUnit";
  743. UMH.comment = "Faction";
  744. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  745. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  746. {
  747. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  748. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  749. weapon.AddComponent<MeleeWeapon>();
  750. weapon.AddComponent<Holdable>();
  751. weapon.AddComponent<CollisionDamage>();
  752. weapon.AddComponent<CollisionWeapon>();
  753. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  754. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  755. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  756. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  757. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  758. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  759. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  760. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  761. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  762. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  763. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  764. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  765. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  766. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  767. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  768. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  769. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  770. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  771. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  772. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  773. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  774. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  775. weapon.GetComponentInChildren<Weapon>().isRange = false;
  776. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  777. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  778. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  779. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  780. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  781. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  782. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  783. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  784. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  785. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  786. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  787. checked
  788. {
  789. if (unit.Entity.Name == "ColourEdit")
  790. {
  791. Renderer[] componentsInChildren10 = weapon.GetComponentsInChildren<Renderer>();
  792. for (int i8 = 0; i8 < componentsInChildren10.Length; i8++)
  793. {
  794. componentsInChildren10[i8].material.color = new Color(1f, 1f, 1f);
  795. for (int j8 = 0; j8 < componentsInChildren10[i8].materials.Length; j8++)
  796. {
  797. Color color10;
  798. switch (j8)
  799. {
  800. case 0:
  801. color10 = new Color(1f, 1f, 1f);
  802. break;
  803. case 1:
  804. color10 = new Color(1f, 0f, 0f);
  805. break;
  806. case 2:
  807. color10 = new Color(0f, 1f, 0f);
  808. break;
  809. default:
  810. color10 = new Color(0f, 0f, 1f);
  811. break;
  812. }
  813. componentsInChildren10[i8].materials[j8].color = color10;
  814. }
  815. }
  816. }
  817. }
  818. }
  819. }
  820. if (unit.Entity.Name == "")
  821. {
  822. UMH.comment = "MeleeUnit";
  823. UMH.comment = "Faction";
  824. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  825. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  826. {
  827. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  828. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  829. weapon.AddComponent<MeleeWeapon>();
  830. weapon.AddComponent<Holdable>();
  831. weapon.AddComponent<CollisionDamage>();
  832. weapon.AddComponent<CollisionWeapon>();
  833. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  834. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  835. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  836. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  837. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  838. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  839. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  840. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  841. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  842. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  843. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  844. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  845. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  846. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  847. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  848. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  849. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  850. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  851. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  852. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  853. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  854. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  855. weapon.GetComponentInChildren<Weapon>().isRange = false;
  856. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  857. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  858. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  859. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  860. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  861. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  862. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  863. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  864. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  865. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  866. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  867. checked
  868. {
  869. if (unit.Entity.Name == "ColourEdit")
  870. {
  871. Renderer[] componentsInChildren11 = weapon.GetComponentsInChildren<Renderer>();
  872. for (int i9 = 0; i9 < componentsInChildren11.Length; i9++)
  873. {
  874. componentsInChildren11[i9].material.color = new Color(1f, 1f, 1f);
  875. for (int j9 = 0; j9 < componentsInChildren11[i9].materials.Length; j9++)
  876. {
  877. Color color11;
  878. switch (j9)
  879. {
  880. case 0:
  881. color11 = new Color(1f, 1f, 1f);
  882. break;
  883. case 1:
  884. color11 = new Color(1f, 0f, 0f);
  885. break;
  886. case 2:
  887. color11 = new Color(0f, 1f, 0f);
  888. break;
  889. default:
  890. color11 = new Color(0f, 0f, 1f);
  891. break;
  892. }
  893. componentsInChildren11[i9].materials[j9].color = color11;
  894. }
  895. }
  896. }
  897. }
  898. }
  899. }
  900. if (unit.Entity.Name == "")
  901. {
  902. UMH.comment = "MeleeUnit";
  903. UMH.comment = "Faction";
  904. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  905. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  906. {
  907. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  908. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  909. weapon.AddComponent<MeleeWeapon>();
  910. weapon.AddComponent<Holdable>();
  911. weapon.AddComponent<CollisionDamage>();
  912. weapon.AddComponent<CollisionWeapon>();
  913. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  914. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  915. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  916. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  917. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  918. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  919. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  920. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  921. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  922. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  923. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  924. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  925. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  926. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  927. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  928. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  929. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  930. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  931. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  932. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  933. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  934. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  935. weapon.GetComponentInChildren<Weapon>().isRange = false;
  936. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  937. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  938. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  939. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  940. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  941. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  942. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  943. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  944. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  945. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  946. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  947. checked
  948. {
  949. if (unit.Entity.Name == "ColourEdit")
  950. {
  951. Renderer[] componentsInChildren12 = weapon.GetComponentsInChildren<Renderer>();
  952. for (int i10 = 0; i10 < componentsInChildren12.Length; i10++)
  953. {
  954. componentsInChildren12[i10].material.color = new Color(1f, 1f, 1f);
  955. for (int j10 = 0; j10 < componentsInChildren12[i10].materials.Length; j10++)
  956. {
  957. Color color12;
  958. switch (j10)
  959. {
  960. case 0:
  961. color12 = new Color(1f, 1f, 1f);
  962. break;
  963. case 1:
  964. color12 = new Color(1f, 0f, 0f);
  965. break;
  966. case 2:
  967. color12 = new Color(0f, 1f, 0f);
  968. break;
  969. default:
  970. color12 = new Color(0f, 0f, 1f);
  971. break;
  972. }
  973. componentsInChildren12[i10].materials[j10].color = color12;
  974. }
  975. }
  976. }
  977. }
  978. }
  979. }
  980. if (unit.Entity.Name == "")
  981. {
  982. UMH.comment = "MeleeUnit";
  983. UMH.comment = "Faction";
  984. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  985. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  986. {
  987. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  988. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  989. weapon.AddComponent<MeleeWeapon>();
  990. weapon.AddComponent<Holdable>();
  991. weapon.AddComponent<CollisionDamage>();
  992. weapon.AddComponent<CollisionWeapon>();
  993. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  994. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  995. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  996. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  997. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  998. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  999. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1000. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1001. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1002. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1003. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1004. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1005. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1006. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1007. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1008. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1009. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1010. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1011. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1012. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1013. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1014. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1015. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1016. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1017. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1018. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1019. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1020. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1021. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1022. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1023. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1024. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1025. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1026. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1027. checked
  1028. {
  1029. if (unit.Entity.Name == "ColourEdit")
  1030. {
  1031. Renderer[] componentsInChildren13 = weapon.GetComponentsInChildren<Renderer>();
  1032. for (int i11 = 0; i11 < componentsInChildren13.Length; i11++)
  1033. {
  1034. componentsInChildren13[i11].material.color = new Color(1f, 1f, 1f);
  1035. for (int j11 = 0; j11 < componentsInChildren13[i11].materials.Length; j11++)
  1036. {
  1037. Color color13;
  1038. switch (j11)
  1039. {
  1040. case 0:
  1041. color13 = new Color(1f, 1f, 1f);
  1042. break;
  1043. case 1:
  1044. color13 = new Color(1f, 0f, 0f);
  1045. break;
  1046. case 2:
  1047. color13 = new Color(0f, 1f, 0f);
  1048. break;
  1049. default:
  1050. color13 = new Color(0f, 0f, 1f);
  1051. break;
  1052. }
  1053. componentsInChildren13[i11].materials[j11].color = color13;
  1054. }
  1055. }
  1056. }
  1057. }
  1058. }
  1059. }
  1060. if (unit.Entity.Name == "")
  1061. {
  1062. UMH.comment = "MeleeUnit";
  1063. UMH.comment = "Faction";
  1064. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1065. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1066. {
  1067. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1068. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1069. weapon.AddComponent<MeleeWeapon>();
  1070. weapon.AddComponent<Holdable>();
  1071. weapon.AddComponent<CollisionDamage>();
  1072. weapon.AddComponent<CollisionWeapon>();
  1073. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1074. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1075. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1076. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1077. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1078. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1079. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1080. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1081. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1082. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1083. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1084. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1085. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1086. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1087. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1088. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1089. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1090. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1091. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1092. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1093. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1094. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1095. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1096. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1097. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1098. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1099. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1100. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1101. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1102. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1103. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1104. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1105. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1106. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1107. checked
  1108. {
  1109. if (unit.Entity.Name == "ColourEdit")
  1110. {
  1111. Renderer[] componentsInChildren14 = weapon.GetComponentsInChildren<Renderer>();
  1112. for (int i12 = 0; i12 < componentsInChildren14.Length; i12++)
  1113. {
  1114. componentsInChildren14[i12].material.color = new Color(1f, 1f, 1f);
  1115. for (int j12 = 0; j12 < componentsInChildren14[i12].materials.Length; j12++)
  1116. {
  1117. Color color14;
  1118. switch (j12)
  1119. {
  1120. case 0:
  1121. color14 = new Color(1f, 1f, 1f);
  1122. break;
  1123. case 1:
  1124. color14 = new Color(1f, 0f, 0f);
  1125. break;
  1126. case 2:
  1127. color14 = new Color(0f, 1f, 0f);
  1128. break;
  1129. default:
  1130. color14 = new Color(0f, 0f, 1f);
  1131. break;
  1132. }
  1133. componentsInChildren14[i12].materials[j12].color = color14;
  1134. }
  1135. }
  1136. }
  1137. }
  1138. }
  1139. }
  1140. if (unit.Entity.Name == "")
  1141. {
  1142. UMH.comment = "MeleeUnit";
  1143. UMH.comment = "Faction";
  1144. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1145. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1146. {
  1147. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1148. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1149. weapon.AddComponent<MeleeWeapon>();
  1150. weapon.AddComponent<Holdable>();
  1151. weapon.AddComponent<CollisionDamage>();
  1152. weapon.AddComponent<CollisionWeapon>();
  1153. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1154. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1155. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1156. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1157. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1158. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1159. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1160. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1161. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1162. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1163. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1164. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1165. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1166. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1167. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1168. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1169. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1170. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1171. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1172. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1173. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1174. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1175. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1176. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1177. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1178. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1179. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1180. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1181. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1182. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1183. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1184. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1185. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1186. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1187. checked
  1188. {
  1189. if (unit.Entity.Name == "ColourEdit")
  1190. {
  1191. Renderer[] componentsInChildren15 = weapon.GetComponentsInChildren<Renderer>();
  1192. for (int i13 = 0; i13 < componentsInChildren15.Length; i13++)
  1193. {
  1194. componentsInChildren15[i13].material.color = new Color(1f, 1f, 1f);
  1195. for (int j13 = 0; j13 < componentsInChildren15[i13].materials.Length; j13++)
  1196. {
  1197. Color color15;
  1198. switch (j13)
  1199. {
  1200. case 0:
  1201. color15 = new Color(1f, 1f, 1f);
  1202. break;
  1203. case 1:
  1204. color15 = new Color(1f, 0f, 0f);
  1205. break;
  1206. case 2:
  1207. color15 = new Color(0f, 1f, 0f);
  1208. break;
  1209. default:
  1210. color15 = new Color(0f, 0f, 1f);
  1211. break;
  1212. }
  1213. componentsInChildren15[i13].materials[j13].color = color15;
  1214. }
  1215. }
  1216. }
  1217. }
  1218. }
  1219. }
  1220. if (unit.Entity.Name == "")
  1221. {
  1222. UMH.comment = "MeleeUnit";
  1223. UMH.comment = "Faction";
  1224. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1225. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1226. {
  1227. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1228. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1229. weapon.AddComponent<MeleeWeapon>();
  1230. weapon.AddComponent<Holdable>();
  1231. weapon.AddComponent<CollisionDamage>();
  1232. weapon.AddComponent<CollisionWeapon>();
  1233. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1234. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1235. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1236. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1237. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1238. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1239. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1240. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1241. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1242. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1243. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1244. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1245. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1246. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1247. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1248. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1249. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1250. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1251. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1252. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1253. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1254. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1255. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1256. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1257. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1258. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1259. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1260. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1261. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1262. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1263. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1264. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1265. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1266. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1267. checked
  1268. {
  1269. if (unit.Entity.Name == "ColourEdit")
  1270. {
  1271. Renderer[] componentsInChildren16 = weapon.GetComponentsInChildren<Renderer>();
  1272. for (int i14 = 0; i14 < componentsInChildren16.Length; i14++)
  1273. {
  1274. componentsInChildren16[i14].material.color = new Color(1f, 1f, 1f);
  1275. for (int j14 = 0; j14 < componentsInChildren16[i14].materials.Length; j14++)
  1276. {
  1277. Color color16;
  1278. switch (j14)
  1279. {
  1280. case 0:
  1281. color16 = new Color(1f, 1f, 1f);
  1282. break;
  1283. case 1:
  1284. color16 = new Color(1f, 0f, 0f);
  1285. break;
  1286. case 2:
  1287. color16 = new Color(0f, 1f, 0f);
  1288. break;
  1289. default:
  1290. color16 = new Color(0f, 0f, 1f);
  1291. break;
  1292. }
  1293. componentsInChildren16[i14].materials[j14].color = color16;
  1294. }
  1295. }
  1296. }
  1297. }
  1298. }
  1299. }
  1300. if (unit.Entity.Name == "")
  1301. {
  1302. UMH.comment = "MeleeUnit";
  1303. UMH.comment = "Faction";
  1304. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1305. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1306. {
  1307. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1308. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1309. weapon.AddComponent<MeleeWeapon>();
  1310. weapon.AddComponent<Holdable>();
  1311. weapon.AddComponent<CollisionDamage>();
  1312. weapon.AddComponent<CollisionWeapon>();
  1313. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1314. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1315. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1316. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1317. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1318. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1319. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1320. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1321. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1322. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1323. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1324. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1325. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1326. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1327. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1328. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1329. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1330. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1331. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1332. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1333. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1334. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1335. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1336. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1337. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1338. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1339. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1340. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1341. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1342. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1343. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1344. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1345. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1346. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1347. checked
  1348. {
  1349. if (unit.Entity.Name == "ColourEdit")
  1350. {
  1351. Renderer[] componentsInChildren17 = weapon.GetComponentsInChildren<Renderer>();
  1352. for (int i15 = 0; i15 < componentsInChildren17.Length; i15++)
  1353. {
  1354. componentsInChildren17[i15].material.color = new Color(1f, 1f, 1f);
  1355. for (int j15 = 0; j15 < componentsInChildren17[i15].materials.Length; j15++)
  1356. {
  1357. Color color17;
  1358. switch (j15)
  1359. {
  1360. case 0:
  1361. color17 = new Color(1f, 1f, 1f);
  1362. break;
  1363. case 1:
  1364. color17 = new Color(1f, 0f, 0f);
  1365. break;
  1366. case 2:
  1367. color17 = new Color(0f, 1f, 0f);
  1368. break;
  1369. default:
  1370. color17 = new Color(0f, 0f, 1f);
  1371. break;
  1372. }
  1373. componentsInChildren17[i15].materials[j15].color = color17;
  1374. }
  1375. }
  1376. }
  1377. }
  1378. }
  1379. }
  1380. if (unit.Entity.Name == "")
  1381. {
  1382. UMH.comment = "MeleeUnit";
  1383. UMH.comment = "Faction";
  1384. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1385. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1386. {
  1387. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1388. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1389. weapon.AddComponent<MeleeWeapon>();
  1390. weapon.AddComponent<Holdable>();
  1391. weapon.AddComponent<CollisionDamage>();
  1392. weapon.AddComponent<CollisionWeapon>();
  1393. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1394. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1395. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1396. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1397. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1398. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1399. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1400. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1401. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1402. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1403. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1404. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1405. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1406. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1407. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1408. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1409. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1410. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1411. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1412. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1413. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1414. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1415. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1416. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1417. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1418. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1419. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1420. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1421. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1422. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1423. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1424. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1425. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1426. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1427. checked
  1428. {
  1429. if (unit.Entity.Name == "ColourEdit")
  1430. {
  1431. Renderer[] componentsInChildren18 = weapon.GetComponentsInChildren<Renderer>();
  1432. for (int i16 = 0; i16 < componentsInChildren18.Length; i16++)
  1433. {
  1434. componentsInChildren18[i16].material.color = new Color(1f, 1f, 1f);
  1435. for (int j16 = 0; j16 < componentsInChildren18[i16].materials.Length; j16++)
  1436. {
  1437. Color color18;
  1438. switch (j16)
  1439. {
  1440. case 0:
  1441. color18 = new Color(1f, 1f, 1f);
  1442. break;
  1443. case 1:
  1444. color18 = new Color(1f, 0f, 0f);
  1445. break;
  1446. case 2:
  1447. color18 = new Color(0f, 1f, 0f);
  1448. break;
  1449. default:
  1450. color18 = new Color(0f, 0f, 1f);
  1451. break;
  1452. }
  1453. componentsInChildren18[i16].materials[j16].color = color18;
  1454. }
  1455. }
  1456. }
  1457. }
  1458. }
  1459. }
  1460. if (unit.Entity.Name == "")
  1461. {
  1462. UMH.comment = "MeleeUnit";
  1463. UMH.comment = "Faction";
  1464. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1465. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1466. {
  1467. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1468. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1469. weapon.AddComponent<MeleeWeapon>();
  1470. weapon.AddComponent<Holdable>();
  1471. weapon.AddComponent<CollisionDamage>();
  1472. weapon.AddComponent<CollisionWeapon>();
  1473. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1474. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1475. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1476. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1477. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1478. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1479. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1480. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1481. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1482. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1483. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1484. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1485. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1486. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1487. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1488. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1489. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1490. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1491. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1492. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1493. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1494. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1495. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1496. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1497. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1498. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1499. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1500. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1501. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1502. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1503. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1504. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1505. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1506. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1507. checked
  1508. {
  1509. if (unit.Entity.Name == "ColourEdit")
  1510. {
  1511. Renderer[] componentsInChildren19 = weapon.GetComponentsInChildren<Renderer>();
  1512. for (int i17 = 0; i17 < componentsInChildren19.Length; i17++)
  1513. {
  1514. componentsInChildren19[i17].material.color = new Color(1f, 1f, 1f);
  1515. for (int j17 = 0; j17 < componentsInChildren19[i17].materials.Length; j17++)
  1516. {
  1517. Color color19;
  1518. switch (j17)
  1519. {
  1520. case 0:
  1521. color19 = new Color(1f, 1f, 1f);
  1522. break;
  1523. case 1:
  1524. color19 = new Color(1f, 0f, 0f);
  1525. break;
  1526. case 2:
  1527. color19 = new Color(0f, 1f, 0f);
  1528. break;
  1529. default:
  1530. color19 = new Color(0f, 0f, 1f);
  1531. break;
  1532. }
  1533. componentsInChildren19[i17].materials[j17].color = color19;
  1534. }
  1535. }
  1536. }
  1537. }
  1538. }
  1539. }
  1540. if (unit.Entity.Name == "")
  1541. {
  1542. UMH.comment = "MeleeUnit";
  1543. UMH.comment = "Faction";
  1544. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1545. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1546. {
  1547. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1548. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1549. weapon.AddComponent<MeleeWeapon>();
  1550. weapon.AddComponent<Holdable>();
  1551. weapon.AddComponent<CollisionDamage>();
  1552. weapon.AddComponent<CollisionWeapon>();
  1553. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1554. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1555. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1556. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1557. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1558. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1559. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1560. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1561. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1562. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1563. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1564. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1565. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1566. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1567. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1568. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1569. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1570. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1571. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1572. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1573. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1574. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1575. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1576. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1577. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1578. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1579. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1580. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1581. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1582. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1583. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1584. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1585. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1586. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1587. checked
  1588. {
  1589. if (unit.Entity.Name == "ColourEdit")
  1590. {
  1591. Renderer[] componentsInChildren20 = weapon.GetComponentsInChildren<Renderer>();
  1592. for (int i18 = 0; i18 < componentsInChildren20.Length; i18++)
  1593. {
  1594. componentsInChildren20[i18].material.color = new Color(1f, 1f, 1f);
  1595. for (int j18 = 0; j18 < componentsInChildren20[i18].materials.Length; j18++)
  1596. {
  1597. Color color20;
  1598. switch (j18)
  1599. {
  1600. case 0:
  1601. color20 = new Color(1f, 1f, 1f);
  1602. break;
  1603. case 1:
  1604. color20 = new Color(1f, 0f, 0f);
  1605. break;
  1606. case 2:
  1607. color20 = new Color(0f, 1f, 0f);
  1608. break;
  1609. default:
  1610. color20 = new Color(0f, 0f, 1f);
  1611. break;
  1612. }
  1613. componentsInChildren20[i18].materials[j18].color = color20;
  1614. }
  1615. }
  1616. }
  1617. }
  1618. }
  1619. }
  1620. if (unit.Entity.Name == "")
  1621. {
  1622. UMH.comment = "MeleeUnit";
  1623. UMH.comment = "Faction";
  1624. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1625. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1626. {
  1627. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1628. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1629. weapon.AddComponent<MeleeWeapon>();
  1630. weapon.AddComponent<Holdable>();
  1631. weapon.AddComponent<CollisionDamage>();
  1632. weapon.AddComponent<CollisionWeapon>();
  1633. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1634. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1635. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1636. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1637. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1638. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1639. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1640. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1641. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1642. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1643. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1644. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1645. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1646. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1647. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1648. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1649. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1650. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1651. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1652. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1653. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1654. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1655. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1656. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1657. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1658. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1659. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1660. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1661. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1662. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1663. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1664. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1665. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1666. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1667. checked
  1668. {
  1669. if (unit.Entity.Name == "ColourEdit")
  1670. {
  1671. Renderer[] componentsInChildren21 = weapon.GetComponentsInChildren<Renderer>();
  1672. for (int i19 = 0; i19 < componentsInChildren21.Length; i19++)
  1673. {
  1674. componentsInChildren21[i19].material.color = new Color(1f, 1f, 1f);
  1675. for (int j19 = 0; j19 < componentsInChildren21[i19].materials.Length; j19++)
  1676. {
  1677. Color color21;
  1678. switch (j19)
  1679. {
  1680. case 0:
  1681. color21 = new Color(1f, 1f, 1f);
  1682. break;
  1683. case 1:
  1684. color21 = new Color(1f, 0f, 0f);
  1685. break;
  1686. case 2:
  1687. color21 = new Color(0f, 1f, 0f);
  1688. break;
  1689. default:
  1690. color21 = new Color(0f, 0f, 1f);
  1691. break;
  1692. }
  1693. componentsInChildren21[i19].materials[j19].color = color21;
  1694. }
  1695. }
  1696. }
  1697. }
  1698. }
  1699. }
  1700. if (unit.Entity.Name == "")
  1701. {
  1702. UMH.comment = "MeleeUnit";
  1703. UMH.comment = "Faction";
  1704. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1705. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1706. {
  1707. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1708. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1709. weapon.AddComponent<MeleeWeapon>();
  1710. weapon.AddComponent<Holdable>();
  1711. weapon.AddComponent<CollisionDamage>();
  1712. weapon.AddComponent<CollisionWeapon>();
  1713. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1714. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1715. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1716. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1717. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1718. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1719. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1720. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1721. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1722. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1723. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1724. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1725. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1726. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1727. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1728. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1729. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1730. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1731. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1732. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1733. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1734. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1735. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1736. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1737. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1738. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1739. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1740. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1741. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1742. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1743. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1744. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1745. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1746. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1747. checked
  1748. {
  1749. if (unit.Entity.Name == "ColourEdit")
  1750. {
  1751. Renderer[] componentsInChildren22 = weapon.GetComponentsInChildren<Renderer>();
  1752. for (int i20 = 0; i20 < componentsInChildren22.Length; i20++)
  1753. {
  1754. componentsInChildren22[i20].material.color = new Color(1f, 1f, 1f);
  1755. for (int j20 = 0; j20 < componentsInChildren22[i20].materials.Length; j20++)
  1756. {
  1757. Color color22;
  1758. switch (j20)
  1759. {
  1760. case 0:
  1761. color22 = new Color(1f, 1f, 1f);
  1762. break;
  1763. case 1:
  1764. color22 = new Color(1f, 0f, 0f);
  1765. break;
  1766. case 2:
  1767. color22 = new Color(0f, 1f, 0f);
  1768. break;
  1769. default:
  1770. color22 = new Color(0f, 0f, 1f);
  1771. break;
  1772. }
  1773. componentsInChildren22[i20].materials[j20].color = color22;
  1774. }
  1775. }
  1776. }
  1777. }
  1778. }
  1779. }
  1780. if (unit.Entity.Name == "")
  1781. {
  1782. UMH.comment = "MeleeUnit";
  1783. UMH.comment = "Faction";
  1784. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1785. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1786. {
  1787. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1788. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1789. weapon.AddComponent<MeleeWeapon>();
  1790. weapon.AddComponent<Holdable>();
  1791. weapon.AddComponent<CollisionDamage>();
  1792. weapon.AddComponent<CollisionWeapon>();
  1793. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1794. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1795. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1796. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1797. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1798. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1799. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1800. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1801. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1802. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1803. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1804. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1805. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1806. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1807. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1808. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1809. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1810. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1811. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1812. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1813. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1814. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1815. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1816. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1817. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1818. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1819. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1820. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1821. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1822. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1823. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1824. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1825. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1826. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1827. checked
  1828. {
  1829. if (unit.Entity.Name == "ColourEdit")
  1830. {
  1831. Renderer[] componentsInChildren23 = weapon.GetComponentsInChildren<Renderer>();
  1832. for (int i21 = 0; i21 < componentsInChildren23.Length; i21++)
  1833. {
  1834. componentsInChildren23[i21].material.color = new Color(1f, 1f, 1f);
  1835. for (int j21 = 0; j21 < componentsInChildren23[i21].materials.Length; j21++)
  1836. {
  1837. Color color23;
  1838. switch (j21)
  1839. {
  1840. case 0:
  1841. color23 = new Color(1f, 1f, 1f);
  1842. break;
  1843. case 1:
  1844. color23 = new Color(1f, 0f, 0f);
  1845. break;
  1846. case 2:
  1847. color23 = new Color(0f, 1f, 0f);
  1848. break;
  1849. default:
  1850. color23 = new Color(0f, 0f, 1f);
  1851. break;
  1852. }
  1853. componentsInChildren23[i21].materials[j21].color = color23;
  1854. }
  1855. }
  1856. }
  1857. }
  1858. }
  1859. }
  1860. if (unit.Entity.Name == "")
  1861. {
  1862. UMH.comment = "MeleeUnit";
  1863. UMH.comment = "Faction";
  1864. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1865. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1866. {
  1867. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1868. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1869. weapon.AddComponent<MeleeWeapon>();
  1870. weapon.AddComponent<Holdable>();
  1871. weapon.AddComponent<CollisionDamage>();
  1872. weapon.AddComponent<CollisionWeapon>();
  1873. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1874. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1875. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1876. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1877. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1878. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1879. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1880. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1881. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1882. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1883. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1884. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1885. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1886. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1887. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1888. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1889. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1890. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1891. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1892. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1893. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1894. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1895. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1896. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1897. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1898. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1899. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1900. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1901. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1902. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1903. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1904. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1905. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1906. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1907. checked
  1908. {
  1909. if (unit.Entity.Name == "ColourEdit")
  1910. {
  1911. Renderer[] componentsInChildren24 = weapon.GetComponentsInChildren<Renderer>();
  1912. for (int i22 = 0; i22 < componentsInChildren24.Length; i22++)
  1913. {
  1914. componentsInChildren24[i22].material.color = new Color(1f, 1f, 1f);
  1915. for (int j22 = 0; j22 < componentsInChildren24[i22].materials.Length; j22++)
  1916. {
  1917. Color color24;
  1918. switch (j22)
  1919. {
  1920. case 0:
  1921. color24 = new Color(1f, 1f, 1f);
  1922. break;
  1923. case 1:
  1924. color24 = new Color(1f, 0f, 0f);
  1925. break;
  1926. case 2:
  1927. color24 = new Color(0f, 1f, 0f);
  1928. break;
  1929. default:
  1930. color24 = new Color(0f, 0f, 1f);
  1931. break;
  1932. }
  1933. componentsInChildren24[i22].materials[j22].color = color24;
  1934. }
  1935. }
  1936. }
  1937. }
  1938. }
  1939. }
  1940. if (unit.Entity.Name == "")
  1941. {
  1942. UMH.comment = "MeleeUnit";
  1943. UMH.comment = "Faction";
  1944. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1945. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  1946. {
  1947. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  1948. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  1949. weapon.AddComponent<MeleeWeapon>();
  1950. weapon.AddComponent<Holdable>();
  1951. weapon.AddComponent<CollisionDamage>();
  1952. weapon.AddComponent<CollisionWeapon>();
  1953. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  1954. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  1955. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  1956. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  1957. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  1958. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  1959. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  1960. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  1961. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  1962. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  1963. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  1964. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  1965. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  1966. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  1967. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  1968. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  1969. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  1970. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  1971. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  1972. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  1973. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  1974. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  1975. weapon.GetComponentInChildren<Weapon>().isRange = false;
  1976. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  1977. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  1978. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  1979. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  1980. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  1981. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  1982. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  1983. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  1984. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  1985. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  1986. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  1987. checked
  1988. {
  1989. if (unit.Entity.Name == "ColourEdit")
  1990. {
  1991. Renderer[] componentsInChildren25 = weapon.GetComponentsInChildren<Renderer>();
  1992. for (int i23 = 0; i23 < componentsInChildren25.Length; i23++)
  1993. {
  1994. componentsInChildren25[i23].material.color = new Color(1f, 1f, 1f);
  1995. for (int j23 = 0; j23 < componentsInChildren25[i23].materials.Length; j23++)
  1996. {
  1997. Color color25;
  1998. switch (j23)
  1999. {
  2000. case 0:
  2001. color25 = new Color(1f, 1f, 1f);
  2002. break;
  2003. case 1:
  2004. color25 = new Color(1f, 0f, 0f);
  2005. break;
  2006. case 2:
  2007. color25 = new Color(0f, 1f, 0f);
  2008. break;
  2009. default:
  2010. color25 = new Color(0f, 0f, 1f);
  2011. break;
  2012. }
  2013. componentsInChildren25[i23].materials[j23].color = color25;
  2014. }
  2015. }
  2016. }
  2017. }
  2018. }
  2019. }
  2020. if (unit.Entity.Name == "")
  2021. {
  2022. UMH.comment = "MeleeUnit";
  2023. UMH.comment = "Faction";
  2024. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2025. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2026. {
  2027. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2028. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2029. weapon.AddComponent<MeleeWeapon>();
  2030. weapon.AddComponent<Holdable>();
  2031. weapon.AddComponent<CollisionDamage>();
  2032. weapon.AddComponent<CollisionWeapon>();
  2033. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  2034. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  2035. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  2036. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  2037. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  2038. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  2039. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  2040. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  2041. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  2042. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2043. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2044. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2045. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2046. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2047. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2048. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  2049. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  2050. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  2051. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  2052. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  2053. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  2054. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  2055. weapon.GetComponentInChildren<Weapon>().isRange = false;
  2056. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  2057. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  2058. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2059. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2060. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2061. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  2062. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  2063. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  2064. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  2065. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  2066. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  2067. checked
  2068. {
  2069. if (unit.Entity.Name == "ColourEdit")
  2070. {
  2071. Renderer[] componentsInChildren26 = weapon.GetComponentsInChildren<Renderer>();
  2072. for (int i24 = 0; i24 < componentsInChildren26.Length; i24++)
  2073. {
  2074. componentsInChildren26[i24].material.color = new Color(1f, 1f, 1f);
  2075. for (int j24 = 0; j24 < componentsInChildren26[i24].materials.Length; j24++)
  2076. {
  2077. Color color26;
  2078. switch (j24)
  2079. {
  2080. case 0:
  2081. color26 = new Color(1f, 1f, 1f);
  2082. break;
  2083. case 1:
  2084. color26 = new Color(1f, 0f, 0f);
  2085. break;
  2086. case 2:
  2087. color26 = new Color(0f, 1f, 0f);
  2088. break;
  2089. default:
  2090. color26 = new Color(0f, 0f, 1f);
  2091. break;
  2092. }
  2093. componentsInChildren26[i24].materials[j24].color = color26;
  2094. }
  2095. }
  2096. }
  2097. }
  2098. }
  2099. }
  2100. if (unit.Entity.Name == "")
  2101. {
  2102. UMH.comment = "MeleeUnit";
  2103. UMH.comment = "Faction";
  2104. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2105. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2106. {
  2107. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2108. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2109. weapon.AddComponent<MeleeWeapon>();
  2110. weapon.AddComponent<Holdable>();
  2111. weapon.AddComponent<CollisionDamage>();
  2112. weapon.AddComponent<CollisionWeapon>();
  2113. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  2114. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  2115. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  2116. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  2117. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  2118. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  2119. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  2120. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  2121. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  2122. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2123. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2124. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2125. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2126. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2127. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2128. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  2129. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  2130. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  2131. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  2132. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  2133. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  2134. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  2135. weapon.GetComponentInChildren<Weapon>().isRange = false;
  2136. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  2137. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  2138. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2139. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2140. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2141. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  2142. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  2143. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  2144. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  2145. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  2146. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  2147. checked
  2148. {
  2149. if (unit.Entity.Name == "ColourEdit")
  2150. {
  2151. Renderer[] componentsInChildren27 = weapon.GetComponentsInChildren<Renderer>();
  2152. for (int i25 = 0; i25 < componentsInChildren27.Length; i25++)
  2153. {
  2154. componentsInChildren27[i25].material.color = new Color(1f, 1f, 1f);
  2155. for (int j25 = 0; j25 < componentsInChildren27[i25].materials.Length; j25++)
  2156. {
  2157. Color color27;
  2158. switch (j25)
  2159. {
  2160. case 0:
  2161. color27 = new Color(1f, 1f, 1f);
  2162. break;
  2163. case 1:
  2164. color27 = new Color(1f, 0f, 0f);
  2165. break;
  2166. case 2:
  2167. color27 = new Color(0f, 1f, 0f);
  2168. break;
  2169. default:
  2170. color27 = new Color(0f, 0f, 1f);
  2171. break;
  2172. }
  2173. componentsInChildren27[i25].materials[j25].color = color27;
  2174. }
  2175. }
  2176. }
  2177. }
  2178. }
  2179. }
  2180. if (unit.Entity.Name == "")
  2181. {
  2182. UMH.comment = "MeleeUnit";
  2183. UMH.comment = "Faction";
  2184. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2185. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2186. {
  2187. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2188. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2189. weapon.AddComponent<MeleeWeapon>();
  2190. weapon.AddComponent<Holdable>();
  2191. weapon.AddComponent<CollisionDamage>();
  2192. weapon.AddComponent<CollisionWeapon>();
  2193. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  2194. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  2195. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  2196. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  2197. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  2198. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  2199. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  2200. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  2201. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  2202. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2203. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2204. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2205. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2206. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2207. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2208. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  2209. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  2210. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  2211. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  2212. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  2213. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  2214. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  2215. weapon.GetComponentInChildren<Weapon>().isRange = false;
  2216. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  2217. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  2218. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2219. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2220. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2221. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  2222. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  2223. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  2224. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  2225. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  2226. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  2227. checked
  2228. {
  2229. if (unit.Entity.Name == "ColourEdit")
  2230. {
  2231. Renderer[] componentsInChildren28 = weapon.GetComponentsInChildren<Renderer>();
  2232. for (int i26 = 0; i26 < componentsInChildren28.Length; i26++)
  2233. {
  2234. componentsInChildren28[i26].material.color = new Color(1f, 1f, 1f);
  2235. for (int j26 = 0; j26 < componentsInChildren28[i26].materials.Length; j26++)
  2236. {
  2237. Color color28;
  2238. switch (j26)
  2239. {
  2240. case 0:
  2241. color28 = new Color(1f, 1f, 1f);
  2242. break;
  2243. case 1:
  2244. color28 = new Color(1f, 0f, 0f);
  2245. break;
  2246. case 2:
  2247. color28 = new Color(0f, 1f, 0f);
  2248. break;
  2249. default:
  2250. color28 = new Color(0f, 0f, 1f);
  2251. break;
  2252. }
  2253. componentsInChildren28[i26].materials[j26].color = color28;
  2254. }
  2255. }
  2256. }
  2257. }
  2258. }
  2259. }
  2260. if (unit.Entity.Name == "")
  2261. {
  2262. UMH.comment = "MeleeUnit";
  2263. UMH.comment = "Faction";
  2264. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2265. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2266. {
  2267. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2268. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2269. weapon.AddComponent<MeleeWeapon>();
  2270. weapon.AddComponent<Holdable>();
  2271. weapon.AddComponent<CollisionDamage>();
  2272. weapon.AddComponent<CollisionWeapon>();
  2273. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  2274. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  2275. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  2276. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  2277. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  2278. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  2279. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  2280. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  2281. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  2282. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2283. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2284. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2285. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2286. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2287. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2288. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  2289. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  2290. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  2291. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  2292. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  2293. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  2294. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  2295. weapon.GetComponentInChildren<Weapon>().isRange = false;
  2296. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  2297. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  2298. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2299. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2300. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2301. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  2302. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  2303. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  2304. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  2305. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  2306. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  2307. checked
  2308. {
  2309. if (unit.Entity.Name == "ColourEdit")
  2310. {
  2311. Renderer[] componentsInChildren29 = weapon.GetComponentsInChildren<Renderer>();
  2312. for (int i27 = 0; i27 < componentsInChildren29.Length; i27++)
  2313. {
  2314. componentsInChildren29[i27].material.color = new Color(1f, 1f, 1f);
  2315. for (int j27 = 0; j27 < componentsInChildren29[i27].materials.Length; j27++)
  2316. {
  2317. Color color29;
  2318. switch (j27)
  2319. {
  2320. case 0:
  2321. color29 = new Color(1f, 1f, 1f);
  2322. break;
  2323. case 1:
  2324. color29 = new Color(1f, 0f, 0f);
  2325. break;
  2326. case 2:
  2327. color29 = new Color(0f, 1f, 0f);
  2328. break;
  2329. default:
  2330. color29 = new Color(0f, 0f, 1f);
  2331. break;
  2332. }
  2333. componentsInChildren29[i27].materials[j27].color = color29;
  2334. }
  2335. }
  2336. }
  2337. }
  2338. }
  2339. }
  2340. if (unit.Entity.Name == "")
  2341. {
  2342. UMH.comment = "MeleeUnit";
  2343. UMH.comment = "Faction";
  2344. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2345. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2346. {
  2347. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2348. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2349. weapon.AddComponent<MeleeWeapon>();
  2350. weapon.AddComponent<Holdable>();
  2351. weapon.AddComponent<CollisionDamage>();
  2352. weapon.AddComponent<CollisionWeapon>();
  2353. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  2354. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  2355. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  2356. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  2357. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  2358. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  2359. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  2360. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  2361. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  2362. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2363. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2364. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2365. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2366. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2367. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2368. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  2369. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  2370. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  2371. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  2372. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  2373. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  2374. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  2375. weapon.GetComponentInChildren<Weapon>().isRange = false;
  2376. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  2377. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  2378. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2379. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2380. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2381. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  2382. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  2383. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  2384. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  2385. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  2386. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  2387. checked
  2388. {
  2389. if (unit.Entity.Name == "ColourEdit")
  2390. {
  2391. Renderer[] componentsInChildren30 = weapon.GetComponentsInChildren<Renderer>();
  2392. for (int i28 = 0; i28 < componentsInChildren30.Length; i28++)
  2393. {
  2394. componentsInChildren30[i28].material.color = new Color(1f, 1f, 1f);
  2395. for (int j28 = 0; j28 < componentsInChildren30[i28].materials.Length; j28++)
  2396. {
  2397. Color color30;
  2398. switch (j28)
  2399. {
  2400. case 0:
  2401. color30 = new Color(1f, 1f, 1f);
  2402. break;
  2403. case 1:
  2404. color30 = new Color(1f, 0f, 0f);
  2405. break;
  2406. case 2:
  2407. color30 = new Color(0f, 1f, 0f);
  2408. break;
  2409. default:
  2410. color30 = new Color(0f, 0f, 1f);
  2411. break;
  2412. }
  2413. componentsInChildren30[i28].materials[j28].color = color30;
  2414. }
  2415. }
  2416. }
  2417. }
  2418. }
  2419. }
  2420. if (unit.Entity.Name == "")
  2421. {
  2422. UMH.comment = "MeleeUnit";
  2423. UMH.comment = "Faction";
  2424. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2425. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2426. {
  2427. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2428. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2429. weapon.AddComponent<MeleeWeapon>();
  2430. weapon.AddComponent<Holdable>();
  2431. weapon.AddComponent<CollisionDamage>();
  2432. weapon.AddComponent<CollisionWeapon>();
  2433. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  2434. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  2435. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  2436. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  2437. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  2438. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  2439. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  2440. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  2441. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  2442. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2443. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2444. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2445. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2446. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2447. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2448. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  2449. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  2450. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  2451. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  2452. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  2453. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  2454. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  2455. weapon.GetComponentInChildren<Weapon>().isRange = false;
  2456. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  2457. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  2458. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2459. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2460. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2461. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  2462. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  2463. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  2464. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  2465. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  2466. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  2467. checked
  2468. {
  2469. if (unit.Entity.Name == "ColourEdit")
  2470. {
  2471. Renderer[] componentsInChildren31 = weapon.GetComponentsInChildren<Renderer>();
  2472. for (int i29 = 0; i29 < componentsInChildren31.Length; i29++)
  2473. {
  2474. componentsInChildren31[i29].material.color = new Color(1f, 1f, 1f);
  2475. for (int j29 = 0; j29 < componentsInChildren31[i29].materials.Length; j29++)
  2476. {
  2477. Color color31;
  2478. switch (j29)
  2479. {
  2480. case 0:
  2481. color31 = new Color(1f, 1f, 1f);
  2482. break;
  2483. case 1:
  2484. color31 = new Color(1f, 0f, 0f);
  2485. break;
  2486. case 2:
  2487. color31 = new Color(0f, 1f, 0f);
  2488. break;
  2489. default:
  2490. color31 = new Color(0f, 0f, 1f);
  2491. break;
  2492. }
  2493. componentsInChildren31[i29].materials[j29].color = color31;
  2494. }
  2495. }
  2496. }
  2497. }
  2498. }
  2499. }
  2500. if (unit.Entity.Name == "")
  2501. {
  2502. UMH.comment = "MeleeUnit";
  2503. UMH.comment = "Faction";
  2504. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2505. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2506. {
  2507. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2508. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2509. weapon.AddComponent<MeleeWeapon>();
  2510. weapon.AddComponent<Holdable>();
  2511. weapon.AddComponent<CollisionDamage>();
  2512. weapon.AddComponent<CollisionWeapon>();
  2513. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  2514. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  2515. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  2516. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  2517. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  2518. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  2519. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  2520. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  2521. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  2522. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2523. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2524. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2525. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2526. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2527. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2528. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  2529. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  2530. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  2531. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  2532. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  2533. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  2534. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  2535. weapon.GetComponentInChildren<Weapon>().isRange = false;
  2536. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  2537. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  2538. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2539. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2540. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2541. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  2542. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  2543. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  2544. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  2545. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  2546. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  2547. checked
  2548. {
  2549. if (unit.Entity.Name == "ColourEdit")
  2550. {
  2551. Renderer[] componentsInChildren32 = weapon.GetComponentsInChildren<Renderer>();
  2552. for (int i30 = 0; i30 < componentsInChildren32.Length; i30++)
  2553. {
  2554. componentsInChildren32[i30].material.color = new Color(1f, 1f, 1f);
  2555. for (int j30 = 0; j30 < componentsInChildren32[i30].materials.Length; j30++)
  2556. {
  2557. Color color32;
  2558. switch (j30)
  2559. {
  2560. case 0:
  2561. color32 = new Color(1f, 1f, 1f);
  2562. break;
  2563. case 1:
  2564. color32 = new Color(1f, 0f, 0f);
  2565. break;
  2566. case 2:
  2567. color32 = new Color(0f, 1f, 0f);
  2568. break;
  2569. default:
  2570. color32 = new Color(0f, 0f, 1f);
  2571. break;
  2572. }
  2573. componentsInChildren32[i30].materials[j30].color = color32;
  2574. }
  2575. }
  2576. }
  2577. }
  2578. }
  2579. }
  2580. if (unit.Entity.Name == "")
  2581. {
  2582. UMH.comment = "MeleeUnit";
  2583. UMH.comment = "Faction";
  2584. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2585. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2586. {
  2587. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2588. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2589. weapon.AddComponent<MeleeWeapon>();
  2590. weapon.AddComponent<Holdable>();
  2591. weapon.AddComponent<CollisionDamage>();
  2592. weapon.AddComponent<CollisionWeapon>();
  2593. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  2594. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  2595. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  2596. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  2597. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  2598. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  2599. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  2600. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  2601. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  2602. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2603. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2604. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2605. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2606. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2607. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2608. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  2609. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  2610. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  2611. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  2612. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  2613. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  2614. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  2615. weapon.GetComponentInChildren<Weapon>().isRange = false;
  2616. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  2617. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  2618. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2619. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2620. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2621. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  2622. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  2623. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  2624. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  2625. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  2626. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  2627. checked
  2628. {
  2629. if (unit.Entity.Name == "ColourEdit")
  2630. {
  2631. Renderer[] componentsInChildren33 = weapon.GetComponentsInChildren<Renderer>();
  2632. for (int i31 = 0; i31 < componentsInChildren33.Length; i31++)
  2633. {
  2634. componentsInChildren33[i31].material.color = new Color(1f, 1f, 1f);
  2635. for (int j31 = 0; j31 < componentsInChildren33[i31].materials.Length; j31++)
  2636. {
  2637. Color color33;
  2638. switch (j31)
  2639. {
  2640. case 0:
  2641. color33 = new Color(1f, 1f, 1f);
  2642. break;
  2643. case 1:
  2644. color33 = new Color(1f, 0f, 0f);
  2645. break;
  2646. case 2:
  2647. color33 = new Color(0f, 1f, 0f);
  2648. break;
  2649. default:
  2650. color33 = new Color(0f, 0f, 1f);
  2651. break;
  2652. }
  2653. componentsInChildren33[i31].materials[j31].color = color33;
  2654. }
  2655. }
  2656. }
  2657. }
  2658. }
  2659. }
  2660. if (unit.Entity.Name == "")
  2661. {
  2662. UMH.comment = "MeleeUnit";
  2663. UMH.comment = "Faction";
  2664. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2665. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2666. {
  2667. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2668. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2669. weapon.AddComponent<MeleeWeapon>();
  2670. weapon.AddComponent<Holdable>();
  2671. weapon.AddComponent<CollisionDamage>();
  2672. weapon.AddComponent<CollisionWeapon>();
  2673. weapon.GetComponentInChildren<CollisionWeapon>().ignoreTeamMates = true;
  2674. weapon.GetComponentInChildren<CollisionWeapon>().impactMultiplier *= 100f;
  2675. weapon.GetComponentInChildren<CollisionWeapon>().onImpactForce = 0.1f;
  2676. weapon.GetComponentInChildren<CollisionWeapon>().dontCallEffectsOnTeam = true;
  2677. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  2678. weapon.GetComponentInChildren<CollisionWeapon>().damage *= 1f;
  2679. weapon.GetComponentInChildren<CollisionWeapon>().massCap = 1f;
  2680. weapon.GetComponentInChildren<CollisionWeapon>().onlyCollideWithRigs = false;
  2681. weapon.GetComponentInChildren<CollisionWeapon>().screenShakeMultiplier = 0f;
  2682. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2683. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2684. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2685. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2686. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2687. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2688. weapon.GetComponentInChildren<Weapon>().maxRange *= 1.1f;
  2689. weapon.GetComponentInChildren<Weapon>().startOnCooldown = false;
  2690. weapon.GetComponentInChildren<Weapon>().internalCooldown *= 1.3f;
  2691. weapon.GetComponentInChildren<Weapon>().randomCooldown = true;
  2692. weapon.GetComponentInChildren<Weapon>().callAttackEffects = true;
  2693. weapon.GetComponentInChildren<Weapon>().countSelf = false;
  2694. weapon.GetComponentInChildren<Weapon>().defaultAngularDrag *= 1f;
  2695. weapon.GetComponentInChildren<Weapon>().isRange = false;
  2696. weapon.GetComponentInChildren<Weapon>().levelMultiplier *= 1f;
  2697. weapon.GetComponentInChildren<Weapon>().useTargetingWhenPossessed = false;
  2698. weapon.GetComponentInChildren<Weapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2699. weapon.GetComponentInChildren<Weapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2700. weapon.GetComponentInChildren<Weapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2701. weapon.GetComponentInChildren<MeleeWeapon>().canDealDamageOutSideOfSwing = true;
  2702. weapon.GetComponentInChildren<MeleeWeapon>().requiredPowerToParry *= 1f;
  2703. weapon.GetComponentInChildren<MeleeWeapon>().setDirectionContinious = false;
  2704. weapon.GetComponentInChildren<MeleeWeapon>().maxAngle *= 0.5f;
  2705. weapon.GetComponentInChildren<MeleeWeapon>().yTargetOffset *= 1f;
  2706. weapon.GetComponentInChildren<MeleeWeapon>().curveForce *= 0.7f;
  2707. checked
  2708. {
  2709. if (unit.Entity.Name == "ColourEdit")
  2710. {
  2711. Renderer[] componentsInChildren34 = weapon.GetComponentsInChildren<Renderer>();
  2712. for (int i32 = 0; i32 < componentsInChildren34.Length; i32++)
  2713. {
  2714. componentsInChildren34[i32].material.color = new Color(1f, 1f, 1f);
  2715. for (int j32 = 0; j32 < componentsInChildren34[i32].materials.Length; j32++)
  2716. {
  2717. Color color34;
  2718. switch (j32)
  2719. {
  2720. case 0:
  2721. color34 = new Color(1f, 1f, 1f);
  2722. break;
  2723. case 1:
  2724. color34 = new Color(1f, 0f, 0f);
  2725. break;
  2726. case 2:
  2727. color34 = new Color(0f, 1f, 0f);
  2728. break;
  2729. default:
  2730. color34 = new Color(0f, 0f, 1f);
  2731. break;
  2732. }
  2733. componentsInChildren34[i32].materials[j32].color = color34;
  2734. }
  2735. }
  2736. }
  2737. }
  2738. }
  2739. }
  2740. UMH.comment = "Ranged";
  2741. UMH.comment = "________________________________________________________________________________";
  2742. UMH.comment = " ";
  2743. UMH.comment = " ";
  2744. UMH.comment = " ";
  2745. UMH.comment = " ";
  2746. UMH.comment = "________________________________________________________________________________";
  2747. if (unit.Entity.Name == "")
  2748. {
  2749. UMH.comment = "RangedUnit";
  2750. UMH.comment = "Faction";
  2751. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2752. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2753. {
  2754. weapon.AddComponent<RangeWeapon>();
  2755. weapon.AddComponent<Holdable>();
  2756. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2757. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2758. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2759. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2760. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2761. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2762. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2763. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2764. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  2765. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  2766. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  2767. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  2768. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  2769. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  2770. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  2771. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  2772. RangeWeapon component18 = weapon.GetComponent<RangeWeapon>();
  2773. component18.numberOfObjects = component18.numberOfObjects;
  2774. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  2775. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  2776. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  2777. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  2778. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  2779. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  2780. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  2781. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  2782. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  2783. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  2784. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  2785. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  2786. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  2787. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  2788. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  2789. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  2790. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2791. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2792. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2793. checked
  2794. {
  2795. if (unit.Entity.Name == "ColourEdit")
  2796. {
  2797. Renderer[] componentsInChildren35 = weapon.GetComponentsInChildren<Renderer>();
  2798. for (int k2 = 0; k2 < componentsInChildren35.Length; k2++)
  2799. {
  2800. componentsInChildren35[k2].material.color = new Color(1f, 1f, 1f);
  2801. for (int l2 = 0; l2 < componentsInChildren35[k2].materials.Length; l2++)
  2802. {
  2803. Color color35;
  2804. switch (l2)
  2805. {
  2806. case 0:
  2807. color35 = new Color(1f, 1f, 1f);
  2808. break;
  2809. case 1:
  2810. color35 = new Color(1f, 0f, 0f);
  2811. break;
  2812. case 2:
  2813. color35 = new Color(0f, 1f, 0f);
  2814. break;
  2815. default:
  2816. color35 = new Color(0f, 0f, 1f);
  2817. break;
  2818. }
  2819. componentsInChildren35[k2].materials[l2].color = color35;
  2820. }
  2821. }
  2822. }
  2823. }
  2824. }
  2825. }
  2826. if (unit.Entity.Name == "")
  2827. {
  2828. UMH.comment = "RangedUnit";
  2829. UMH.comment = "Faction";
  2830. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2831. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2832. {
  2833. weapon.AddComponent<RangeWeapon>();
  2834. weapon.AddComponent<Holdable>();
  2835. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2836. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2837. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2838. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2839. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2840. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2841. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2842. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2843. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  2844. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  2845. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  2846. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  2847. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  2848. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  2849. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  2850. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  2851. RangeWeapon component19 = weapon.GetComponent<RangeWeapon>();
  2852. component19.numberOfObjects = component19.numberOfObjects;
  2853. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  2854. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  2855. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  2856. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  2857. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  2858. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  2859. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  2860. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  2861. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  2862. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  2863. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  2864. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  2865. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  2866. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  2867. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  2868. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  2869. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2870. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2871. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2872. checked
  2873. {
  2874. if (unit.Entity.Name == "ColourEdit")
  2875. {
  2876. Renderer[] componentsInChildren36 = weapon.GetComponentsInChildren<Renderer>();
  2877. for (int k3 = 0; k3 < componentsInChildren36.Length; k3++)
  2878. {
  2879. componentsInChildren36[k3].material.color = new Color(1f, 1f, 1f);
  2880. for (int l3 = 0; l3 < componentsInChildren36[k3].materials.Length; l3++)
  2881. {
  2882. Color color36;
  2883. switch (l3)
  2884. {
  2885. case 0:
  2886. color36 = new Color(1f, 1f, 1f);
  2887. break;
  2888. case 1:
  2889. color36 = new Color(1f, 0f, 0f);
  2890. break;
  2891. case 2:
  2892. color36 = new Color(0f, 1f, 0f);
  2893. break;
  2894. default:
  2895. color36 = new Color(0f, 0f, 1f);
  2896. break;
  2897. }
  2898. componentsInChildren36[k3].materials[l3].color = color36;
  2899. }
  2900. }
  2901. }
  2902. }
  2903. }
  2904. }
  2905. if (unit.Entity.Name == "")
  2906. {
  2907. UMH.comment = "RangedUnit";
  2908. UMH.comment = "Faction";
  2909. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2910. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2911. {
  2912. weapon.AddComponent<RangeWeapon>();
  2913. weapon.AddComponent<Holdable>();
  2914. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2915. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2916. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2917. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2918. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2919. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2920. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  2921. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  2922. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  2923. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  2924. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  2925. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  2926. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  2927. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  2928. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  2929. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  2930. RangeWeapon component20 = weapon.GetComponent<RangeWeapon>();
  2931. component20.numberOfObjects = component20.numberOfObjects;
  2932. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  2933. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  2934. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  2935. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  2936. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  2937. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  2938. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  2939. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  2940. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  2941. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  2942. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  2943. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  2944. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  2945. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  2946. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  2947. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  2948. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  2949. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  2950. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  2951. checked
  2952. {
  2953. if (unit.Entity.Name == "ColourEdit")
  2954. {
  2955. Renderer[] componentsInChildren37 = weapon.GetComponentsInChildren<Renderer>();
  2956. for (int k4 = 0; k4 < componentsInChildren37.Length; k4++)
  2957. {
  2958. componentsInChildren37[k4].material.color = new Color(1f, 1f, 1f);
  2959. for (int l4 = 0; l4 < componentsInChildren37[k4].materials.Length; l4++)
  2960. {
  2961. Color color37;
  2962. switch (l4)
  2963. {
  2964. case 0:
  2965. color37 = new Color(1f, 1f, 1f);
  2966. break;
  2967. case 1:
  2968. color37 = new Color(1f, 0f, 0f);
  2969. break;
  2970. case 2:
  2971. color37 = new Color(0f, 1f, 0f);
  2972. break;
  2973. default:
  2974. color37 = new Color(0f, 0f, 1f);
  2975. break;
  2976. }
  2977. componentsInChildren37[k4].materials[l4].color = color37;
  2978. }
  2979. }
  2980. }
  2981. }
  2982. }
  2983. }
  2984. if (unit.Entity.Name == "")
  2985. {
  2986. UMH.comment = "RangedUnit";
  2987. UMH.comment = "Faction";
  2988. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2989. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  2990. {
  2991. weapon.AddComponent<RangeWeapon>();
  2992. weapon.AddComponent<Holdable>();
  2993. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  2994. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  2995. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  2996. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  2997. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  2998. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  2999. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation += new Vector3(0f, 0f, 0f);
  3000. weapon.GetComponentInChildren<Holdable>().holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  3001. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3002. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3003. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3004. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3005. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3006. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3007. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3008. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3009. RangeWeapon component21 = weapon.GetComponent<RangeWeapon>();
  3010. component21.numberOfObjects = component21.numberOfObjects;
  3011. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3012. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3013. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3014. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3015. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3016. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3017. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3018. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3019. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3020. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3021. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3022. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3023. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3024. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3025. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3026. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3027. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3028. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3029. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3030. checked
  3031. {
  3032. if (unit.Entity.Name == "ColourEdit")
  3033. {
  3034. Renderer[] componentsInChildren38 = weapon.GetComponentsInChildren<Renderer>();
  3035. for (int k5 = 0; k5 < componentsInChildren38.Length; k5++)
  3036. {
  3037. componentsInChildren38[k5].material.color = new Color(1f, 1f, 1f);
  3038. for (int l5 = 0; l5 < componentsInChildren38[k5].materials.Length; l5++)
  3039. {
  3040. Color color38;
  3041. switch (l5)
  3042. {
  3043. case 0:
  3044. color38 = new Color(1f, 1f, 1f);
  3045. break;
  3046. case 1:
  3047. color38 = new Color(1f, 0f, 0f);
  3048. break;
  3049. case 2:
  3050. color38 = new Color(0f, 1f, 0f);
  3051. break;
  3052. default:
  3053. color38 = new Color(0f, 0f, 1f);
  3054. break;
  3055. }
  3056. componentsInChildren38[k5].materials[l5].color = color38;
  3057. }
  3058. }
  3059. }
  3060. }
  3061. }
  3062. }
  3063. if (unit.Entity.Name == "")
  3064. {
  3065. UMH.comment = "RangedUnit";
  3066. UMH.comment = "Faction";
  3067. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3068. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3069. {
  3070. weapon.AddComponent<RangeWeapon>();
  3071. weapon.AddComponent<Holdable>();
  3072. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3073. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3074. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition += new Vector3(0f, 0f, 0f);
  3075. weapon.GetComponentInChildren<Holdable>().holdableData.relativePosition -= new Vector3(0f, 0f, 0f);
  3076. weapon.GetComponentInChildren<Holdable>().holdableData.forwardRotation += new Vector3(0f, 0f, 0f);
  3077. HoldableDataInstance holdableData = weapon.GetComponentInChildren<Holdable>().holdableData;
  3078. holdableData.forwardRotation -= new Vector3(0f, 0f, 0f);
  3079. holdableData = weapon.GetComponentInChildren<Holdable>().holdableData;
  3080. holdableData.upRotation += new Vector3(0f, 0f, 0f);
  3081. holdableData = weapon.GetComponentInChildren<Holdable>().holdableData;
  3082. holdableData.upRotation -= new Vector3(0f, 0f, 0f);
  3083. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3084. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3085. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3086. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3087. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3088. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3089. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3090. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3091. RangeWeapon component22 = weapon.GetComponent<RangeWeapon>();
  3092. component22.numberOfObjects = component22.numberOfObjects;
  3093. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3094. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3095. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3096. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3097. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3098. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3099. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3100. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3101. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3102. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3103. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3104. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3105. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3106. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3107. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3108. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3109. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3110. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3111. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3112. checked
  3113. {
  3114. if (unit.Entity.Name == "ColourEdit")
  3115. {
  3116. Renderer[] componentsInChildren39 = weapon.GetComponentsInChildren<Renderer>();
  3117. for (int k6 = 0; k6 < componentsInChildren39.Length; k6++)
  3118. {
  3119. componentsInChildren39[k6].material.color = new Color(1f, 1f, 1f);
  3120. for (int l6 = 0; l6 < componentsInChildren39[k6].materials.Length; l6++)
  3121. {
  3122. Color color39;
  3123. switch (l6)
  3124. {
  3125. case 0:
  3126. color39 = new Color(1f, 1f, 1f);
  3127. break;
  3128. case 1:
  3129. color39 = new Color(1f, 0f, 0f);
  3130. break;
  3131. case 2:
  3132. color39 = new Color(0f, 1f, 0f);
  3133. break;
  3134. default:
  3135. color39 = new Color(0f, 0f, 1f);
  3136. break;
  3137. }
  3138. componentsInChildren39[k6].materials[l6].color = color39;
  3139. }
  3140. }
  3141. }
  3142. }
  3143. }
  3144. }
  3145. if (unit.Entity.Name == "")
  3146. {
  3147. UMH.comment = "RangedUnit";
  3148. UMH.comment = "Faction";
  3149. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3150. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3151. {
  3152. weapon.AddComponent<RangeWeapon>();
  3153. weapon.AddComponent<Holdable>();
  3154. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3155. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3156. HoldableDataInstance holdableData2 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3157. holdableData2.relativePosition += new Vector3(0f, 0f, 0f);
  3158. holdableData2 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3159. holdableData2.relativePosition -= new Vector3(0f, 0f, 0f);
  3160. holdableData2 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3161. holdableData2.forwardRotation += new Vector3(0f, 0f, 0f);
  3162. holdableData2 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3163. holdableData2.forwardRotation -= new Vector3(0f, 0f, 0f);
  3164. holdableData2 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3165. holdableData2.upRotation += new Vector3(0f, 0f, 0f);
  3166. holdableData2 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3167. holdableData2.upRotation -= new Vector3(0f, 0f, 0f);
  3168. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3169. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3170. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3171. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3172. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3173. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3174. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3175. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3176. RangeWeapon component23 = weapon.GetComponent<RangeWeapon>();
  3177. component23.numberOfObjects = component23.numberOfObjects;
  3178. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3179. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3180. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3181. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3182. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3183. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3184. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3185. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3186. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3187. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3188. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3189. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3190. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3191. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3192. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3193. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3194. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3195. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3196. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3197. checked
  3198. {
  3199. if (unit.Entity.Name == "ColourEdit")
  3200. {
  3201. Renderer[] componentsInChildren40 = weapon.GetComponentsInChildren<Renderer>();
  3202. for (int k7 = 0; k7 < componentsInChildren40.Length; k7++)
  3203. {
  3204. componentsInChildren40[k7].material.color = new Color(1f, 1f, 1f);
  3205. for (int l7 = 0; l7 < componentsInChildren40[k7].materials.Length; l7++)
  3206. {
  3207. Color color40;
  3208. switch (l7)
  3209. {
  3210. case 0:
  3211. color40 = new Color(1f, 1f, 1f);
  3212. break;
  3213. case 1:
  3214. color40 = new Color(1f, 0f, 0f);
  3215. break;
  3216. case 2:
  3217. color40 = new Color(0f, 1f, 0f);
  3218. break;
  3219. default:
  3220. color40 = new Color(0f, 0f, 1f);
  3221. break;
  3222. }
  3223. componentsInChildren40[k7].materials[l7].color = color40;
  3224. }
  3225. }
  3226. }
  3227. }
  3228. }
  3229. }
  3230. if (unit.Entity.Name == "")
  3231. {
  3232. UMH.comment = "RangedUnit";
  3233. UMH.comment = "Faction";
  3234. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3235. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3236. {
  3237. weapon.AddComponent<RangeWeapon>();
  3238. weapon.AddComponent<Holdable>();
  3239. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3240. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3241. HoldableDataInstance holdableData3 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3242. holdableData3.relativePosition += new Vector3(0f, 0f, 0f);
  3243. holdableData3 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3244. holdableData3.relativePosition -= new Vector3(0f, 0f, 0f);
  3245. holdableData3 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3246. holdableData3.forwardRotation += new Vector3(0f, 0f, 0f);
  3247. holdableData3 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3248. holdableData3.forwardRotation -= new Vector3(0f, 0f, 0f);
  3249. holdableData3 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3250. holdableData3.upRotation += new Vector3(0f, 0f, 0f);
  3251. holdableData3 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3252. holdableData3.upRotation -= new Vector3(0f, 0f, 0f);
  3253. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3254. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3255. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3256. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3257. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3258. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3259. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3260. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3261. RangeWeapon component24 = weapon.GetComponent<RangeWeapon>();
  3262. component24.numberOfObjects = component24.numberOfObjects;
  3263. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3264. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3265. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3266. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3267. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3268. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3269. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3270. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3271. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3272. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3273. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3274. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3275. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3276. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3277. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3278. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3279. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3280. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3281. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3282. checked
  3283. {
  3284. if (unit.Entity.Name == "ColourEdit")
  3285. {
  3286. Renderer[] componentsInChildren41 = weapon.GetComponentsInChildren<Renderer>();
  3287. for (int k8 = 0; k8 < componentsInChildren41.Length; k8++)
  3288. {
  3289. componentsInChildren41[k8].material.color = new Color(1f, 1f, 1f);
  3290. for (int l8 = 0; l8 < componentsInChildren41[k8].materials.Length; l8++)
  3291. {
  3292. Color color41;
  3293. switch (l8)
  3294. {
  3295. case 0:
  3296. color41 = new Color(1f, 1f, 1f);
  3297. break;
  3298. case 1:
  3299. color41 = new Color(1f, 0f, 0f);
  3300. break;
  3301. case 2:
  3302. color41 = new Color(0f, 1f, 0f);
  3303. break;
  3304. default:
  3305. color41 = new Color(0f, 0f, 1f);
  3306. break;
  3307. }
  3308. componentsInChildren41[k8].materials[l8].color = color41;
  3309. }
  3310. }
  3311. }
  3312. }
  3313. }
  3314. }
  3315. if (unit.Entity.Name == "")
  3316. {
  3317. UMH.comment = "RangedUnit";
  3318. UMH.comment = "Faction";
  3319. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3320. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3321. {
  3322. weapon.AddComponent<RangeWeapon>();
  3323. weapon.AddComponent<Holdable>();
  3324. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3325. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3326. HoldableDataInstance holdableData4 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3327. holdableData4.relativePosition += new Vector3(0f, 0f, 0f);
  3328. holdableData4 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3329. holdableData4.relativePosition -= new Vector3(0f, 0f, 0f);
  3330. holdableData4 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3331. holdableData4.forwardRotation += new Vector3(0f, 0f, 0f);
  3332. holdableData4 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3333. holdableData4.forwardRotation -= new Vector3(0f, 0f, 0f);
  3334. holdableData4 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3335. holdableData4.upRotation += new Vector3(0f, 0f, 0f);
  3336. holdableData4 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3337. holdableData4.upRotation -= new Vector3(0f, 0f, 0f);
  3338. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3339. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3340. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3341. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3342. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3343. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3344. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3345. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3346. RangeWeapon component25 = weapon.GetComponent<RangeWeapon>();
  3347. component25.numberOfObjects = component25.numberOfObjects;
  3348. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3349. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3350. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3351. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3352. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3353. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3354. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3355. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3356. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3357. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3358. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3359. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3360. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3361. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3362. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3363. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3364. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3365. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3366. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3367. checked
  3368. {
  3369. if (unit.Entity.Name == "ColourEdit")
  3370. {
  3371. Renderer[] componentsInChildren42 = weapon.GetComponentsInChildren<Renderer>();
  3372. for (int k9 = 0; k9 < componentsInChildren42.Length; k9++)
  3373. {
  3374. componentsInChildren42[k9].material.color = new Color(1f, 1f, 1f);
  3375. for (int l9 = 0; l9 < componentsInChildren42[k9].materials.Length; l9++)
  3376. {
  3377. Color color42;
  3378. switch (l9)
  3379. {
  3380. case 0:
  3381. color42 = new Color(1f, 1f, 1f);
  3382. break;
  3383. case 1:
  3384. color42 = new Color(1f, 0f, 0f);
  3385. break;
  3386. case 2:
  3387. color42 = new Color(0f, 1f, 0f);
  3388. break;
  3389. default:
  3390. color42 = new Color(0f, 0f, 1f);
  3391. break;
  3392. }
  3393. componentsInChildren42[k9].materials[l9].color = color42;
  3394. }
  3395. }
  3396. }
  3397. }
  3398. }
  3399. }
  3400. if (unit.Entity.Name == "")
  3401. {
  3402. UMH.comment = "RangedUnit";
  3403. UMH.comment = "Faction";
  3404. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3405. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3406. {
  3407. weapon.AddComponent<RangeWeapon>();
  3408. weapon.AddComponent<Holdable>();
  3409. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3410. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3411. HoldableDataInstance holdableData5 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3412. holdableData5.relativePosition += new Vector3(0f, 0f, 0f);
  3413. holdableData5 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3414. holdableData5.relativePosition -= new Vector3(0f, 0f, 0f);
  3415. holdableData5 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3416. holdableData5.forwardRotation += new Vector3(0f, 0f, 0f);
  3417. holdableData5 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3418. holdableData5.forwardRotation -= new Vector3(0f, 0f, 0f);
  3419. holdableData5 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3420. holdableData5.upRotation += new Vector3(0f, 0f, 0f);
  3421. holdableData5 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3422. holdableData5.upRotation -= new Vector3(0f, 0f, 0f);
  3423. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3424. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3425. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3426. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3427. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3428. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3429. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3430. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3431. RangeWeapon component26 = weapon.GetComponent<RangeWeapon>();
  3432. component26.numberOfObjects = component26.numberOfObjects;
  3433. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3434. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3435. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3436. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3437. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3438. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3439. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3440. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3441. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3442. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3443. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3444. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3445. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3446. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3447. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3448. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3449. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3450. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3451. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3452. checked
  3453. {
  3454. if (unit.Entity.Name == "ColourEdit")
  3455. {
  3456. Renderer[] componentsInChildren43 = weapon.GetComponentsInChildren<Renderer>();
  3457. for (int k10 = 0; k10 < componentsInChildren43.Length; k10++)
  3458. {
  3459. componentsInChildren43[k10].material.color = new Color(1f, 1f, 1f);
  3460. for (int l10 = 0; l10 < componentsInChildren43[k10].materials.Length; l10++)
  3461. {
  3462. Color color43;
  3463. switch (l10)
  3464. {
  3465. case 0:
  3466. color43 = new Color(1f, 1f, 1f);
  3467. break;
  3468. case 1:
  3469. color43 = new Color(1f, 0f, 0f);
  3470. break;
  3471. case 2:
  3472. color43 = new Color(0f, 1f, 0f);
  3473. break;
  3474. default:
  3475. color43 = new Color(0f, 0f, 1f);
  3476. break;
  3477. }
  3478. componentsInChildren43[k10].materials[l10].color = color43;
  3479. }
  3480. }
  3481. }
  3482. }
  3483. }
  3484. }
  3485. if (unit.Entity.Name == "")
  3486. {
  3487. UMH.comment = "RangedUnit";
  3488. UMH.comment = "Faction";
  3489. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3490. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3491. {
  3492. weapon.AddComponent<RangeWeapon>();
  3493. weapon.AddComponent<Holdable>();
  3494. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3495. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3496. HoldableDataInstance holdableData6 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3497. holdableData6.relativePosition += new Vector3(0f, 0f, 0f);
  3498. holdableData6 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3499. holdableData6.relativePosition -= new Vector3(0f, 0f, 0f);
  3500. holdableData6 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3501. holdableData6.forwardRotation += new Vector3(0f, 0f, 0f);
  3502. holdableData6 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3503. holdableData6.forwardRotation -= new Vector3(0f, 0f, 0f);
  3504. holdableData6 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3505. holdableData6.upRotation += new Vector3(0f, 0f, 0f);
  3506. holdableData6 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3507. holdableData6.upRotation -= new Vector3(0f, 0f, 0f);
  3508. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3509. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3510. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3511. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3512. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3513. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3514. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3515. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3516. RangeWeapon component27 = weapon.GetComponent<RangeWeapon>();
  3517. component27.numberOfObjects = component27.numberOfObjects;
  3518. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3519. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3520. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3521. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3522. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3523. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3524. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3525. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3526. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3527. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3528. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3529. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3530. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3531. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3532. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3533. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3534. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3535. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3536. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3537. checked
  3538. {
  3539. if (unit.Entity.Name == "ColourEdit")
  3540. {
  3541. Renderer[] componentsInChildren44 = weapon.GetComponentsInChildren<Renderer>();
  3542. for (int k11 = 0; k11 < componentsInChildren44.Length; k11++)
  3543. {
  3544. componentsInChildren44[k11].material.color = new Color(1f, 1f, 1f);
  3545. for (int l11 = 0; l11 < componentsInChildren44[k11].materials.Length; l11++)
  3546. {
  3547. Color color44;
  3548. switch (l11)
  3549. {
  3550. case 0:
  3551. color44 = new Color(1f, 1f, 1f);
  3552. break;
  3553. case 1:
  3554. color44 = new Color(1f, 0f, 0f);
  3555. break;
  3556. case 2:
  3557. color44 = new Color(0f, 1f, 0f);
  3558. break;
  3559. default:
  3560. color44 = new Color(0f, 0f, 1f);
  3561. break;
  3562. }
  3563. componentsInChildren44[k11].materials[l11].color = color44;
  3564. }
  3565. }
  3566. }
  3567. }
  3568. }
  3569. }
  3570. if (unit.Entity.Name == "")
  3571. {
  3572. UMH.comment = "RangedUnit";
  3573. UMH.comment = "Faction";
  3574. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3575. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3576. {
  3577. weapon.AddComponent<RangeWeapon>();
  3578. weapon.AddComponent<Holdable>();
  3579. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3580. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3581. HoldableDataInstance holdableData7 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3582. holdableData7.relativePosition += new Vector3(0f, 0f, 0f);
  3583. holdableData7 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3584. HoldableDataInstance holdableDataInstance = holdableData7;
  3585. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  3586. holdableData7 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3587. holdableDataInstance = holdableData7;
  3588. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  3589. holdableData7 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3590. holdableDataInstance = holdableData7;
  3591. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  3592. holdableData7 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3593. holdableDataInstance = holdableData7;
  3594. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  3595. holdableData7 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3596. holdableDataInstance = holdableData7;
  3597. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  3598. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3599. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3600. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3601. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3602. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3603. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3604. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3605. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3606. RangeWeapon component7 = weapon.GetComponent<RangeWeapon>();
  3607. component7.numberOfObjects = component7.numberOfObjects;
  3608. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3609. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3610. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3611. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3612. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3613. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3614. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3615. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3616. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3617. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3618. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3619. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3620. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3621. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3622. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3623. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3624. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3625. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3626. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3627. checked
  3628. {
  3629. if (unit.Entity.Name == "ColourEdit")
  3630. {
  3631. Renderer[] componentsInChildren45 = weapon.GetComponentsInChildren<Renderer>();
  3632. for (int k12 = 0; k12 < componentsInChildren45.Length; k12++)
  3633. {
  3634. componentsInChildren45[k12].material.color = new Color(1f, 1f, 1f);
  3635. for (int l12 = 0; l12 < componentsInChildren45[k12].materials.Length; l12++)
  3636. {
  3637. Color color45;
  3638. switch (l12)
  3639. {
  3640. case 0:
  3641. color45 = new Color(1f, 1f, 1f);
  3642. break;
  3643. case 1:
  3644. color45 = new Color(1f, 0f, 0f);
  3645. break;
  3646. case 2:
  3647. color45 = new Color(0f, 1f, 0f);
  3648. break;
  3649. default:
  3650. color45 = new Color(0f, 0f, 1f);
  3651. break;
  3652. }
  3653. componentsInChildren45[k12].materials[l12].color = color45;
  3654. }
  3655. }
  3656. }
  3657. }
  3658. }
  3659. }
  3660. if (unit.Entity.Name == "")
  3661. {
  3662. UMH.comment = "RangedUnit";
  3663. UMH.comment = "Faction";
  3664. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3665. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3666. {
  3667. weapon.AddComponent<RangeWeapon>();
  3668. weapon.AddComponent<Holdable>();
  3669. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3670. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3671. HoldableDataInstance holdableData8 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3672. HoldableDataInstance holdableDataInstance = holdableData8;
  3673. holdableDataInstance.relativePosition += new Vector3(0f, 0f, 0f);
  3674. holdableData8 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3675. holdableDataInstance = holdableData8;
  3676. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  3677. holdableData8 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3678. holdableDataInstance = holdableData8;
  3679. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  3680. holdableData8 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3681. holdableDataInstance = holdableData8;
  3682. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  3683. holdableData8 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3684. holdableDataInstance = holdableData8;
  3685. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  3686. holdableData8 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3687. holdableDataInstance = holdableData8;
  3688. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  3689. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3690. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3691. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3692. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3693. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3694. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3695. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3696. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3697. RangeWeapon component8 = weapon.GetComponent<RangeWeapon>();
  3698. component8.numberOfObjects = component8.numberOfObjects;
  3699. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3700. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3701. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3702. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3703. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3704. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3705. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3706. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3707. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3708. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3709. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3710. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3711. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3712. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3713. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3714. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3715. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3716. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3717. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3718. checked
  3719. {
  3720. if (unit.Entity.Name == "ColourEdit")
  3721. {
  3722. Renderer[] componentsInChildren46 = weapon.GetComponentsInChildren<Renderer>();
  3723. for (int k13 = 0; k13 < componentsInChildren46.Length; k13++)
  3724. {
  3725. componentsInChildren46[k13].material.color = new Color(1f, 1f, 1f);
  3726. for (int l13 = 0; l13 < componentsInChildren46[k13].materials.Length; l13++)
  3727. {
  3728. Color color46;
  3729. switch (l13)
  3730. {
  3731. case 0:
  3732. color46 = new Color(1f, 1f, 1f);
  3733. break;
  3734. case 1:
  3735. color46 = new Color(1f, 0f, 0f);
  3736. break;
  3737. case 2:
  3738. color46 = new Color(0f, 1f, 0f);
  3739. break;
  3740. default:
  3741. color46 = new Color(0f, 0f, 1f);
  3742. break;
  3743. }
  3744. componentsInChildren46[k13].materials[l13].color = color46;
  3745. }
  3746. }
  3747. }
  3748. }
  3749. }
  3750. }
  3751. if (unit.Entity.Name == "")
  3752. {
  3753. UMH.comment = "RangedUnit";
  3754. UMH.comment = "Faction";
  3755. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3756. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3757. {
  3758. weapon.AddComponent<RangeWeapon>();
  3759. weapon.AddComponent<Holdable>();
  3760. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3761. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3762. HoldableDataInstance holdableData9 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3763. HoldableDataInstance holdableDataInstance = holdableData9;
  3764. holdableDataInstance.relativePosition += new Vector3(0f, 0f, 0f);
  3765. holdableData9 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3766. holdableDataInstance = holdableData9;
  3767. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  3768. holdableData9 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3769. holdableDataInstance = holdableData9;
  3770. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  3771. holdableData9 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3772. holdableDataInstance = holdableData9;
  3773. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  3774. holdableData9 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3775. holdableDataInstance = holdableData9;
  3776. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  3777. holdableData9 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3778. holdableDataInstance = holdableData9;
  3779. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  3780. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3781. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3782. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3783. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3784. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3785. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3786. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3787. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3788. RangeWeapon component9 = weapon.GetComponent<RangeWeapon>();
  3789. component9.numberOfObjects = component9.numberOfObjects;
  3790. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3791. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3792. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3793. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3794. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3795. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3796. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3797. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3798. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3799. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3800. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3801. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3802. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3803. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3804. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3805. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3806. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3807. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3808. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3809. checked
  3810. {
  3811. if (unit.Entity.Name == "ColourEdit")
  3812. {
  3813. Renderer[] componentsInChildren47 = weapon.GetComponentsInChildren<Renderer>();
  3814. for (int k14 = 0; k14 < componentsInChildren47.Length; k14++)
  3815. {
  3816. componentsInChildren47[k14].material.color = new Color(1f, 1f, 1f);
  3817. for (int l14 = 0; l14 < componentsInChildren47[k14].materials.Length; l14++)
  3818. {
  3819. Color color47;
  3820. switch (l14)
  3821. {
  3822. case 0:
  3823. color47 = new Color(1f, 1f, 1f);
  3824. break;
  3825. case 1:
  3826. color47 = new Color(1f, 0f, 0f);
  3827. break;
  3828. case 2:
  3829. color47 = new Color(0f, 1f, 0f);
  3830. break;
  3831. default:
  3832. color47 = new Color(0f, 0f, 1f);
  3833. break;
  3834. }
  3835. componentsInChildren47[k14].materials[l14].color = color47;
  3836. }
  3837. }
  3838. }
  3839. }
  3840. }
  3841. }
  3842. if (unit.Entity.Name == "")
  3843. {
  3844. UMH.comment = "RangedUnit";
  3845. UMH.comment = "Faction";
  3846. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3847. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3848. {
  3849. weapon.AddComponent<RangeWeapon>();
  3850. weapon.AddComponent<Holdable>();
  3851. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3852. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3853. HoldableDataInstance holdableData10 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3854. HoldableDataInstance holdableDataInstance = holdableData10;
  3855. holdableDataInstance.relativePosition += new Vector3(0f, 0f, 0f);
  3856. holdableData10 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3857. holdableDataInstance = holdableData10;
  3858. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  3859. holdableData10 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3860. holdableDataInstance = holdableData10;
  3861. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  3862. holdableData10 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3863. holdableDataInstance = holdableData10;
  3864. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  3865. holdableData10 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3866. holdableDataInstance = holdableData10;
  3867. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  3868. holdableData10 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3869. holdableDataInstance = holdableData10;
  3870. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  3871. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3872. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3873. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3874. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3875. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3876. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3877. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3878. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3879. RangeWeapon component10 = weapon.GetComponent<RangeWeapon>();
  3880. component10.numberOfObjects = component10.numberOfObjects;
  3881. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3882. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3883. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3884. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3885. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3886. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3887. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3888. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3889. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3890. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3891. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3892. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3893. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3894. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3895. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3896. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3897. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3898. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3899. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3900. checked
  3901. {
  3902. if (unit.Entity.Name == "ColourEdit")
  3903. {
  3904. Renderer[] componentsInChildren48 = weapon.GetComponentsInChildren<Renderer>();
  3905. for (int k15 = 0; k15 < componentsInChildren48.Length; k15++)
  3906. {
  3907. componentsInChildren48[k15].material.color = new Color(1f, 1f, 1f);
  3908. for (int l15 = 0; l15 < componentsInChildren48[k15].materials.Length; l15++)
  3909. {
  3910. Color color48;
  3911. switch (l15)
  3912. {
  3913. case 0:
  3914. color48 = new Color(1f, 1f, 1f);
  3915. break;
  3916. case 1:
  3917. color48 = new Color(1f, 0f, 0f);
  3918. break;
  3919. case 2:
  3920. color48 = new Color(0f, 1f, 0f);
  3921. break;
  3922. default:
  3923. color48 = new Color(0f, 0f, 1f);
  3924. break;
  3925. }
  3926. componentsInChildren48[k15].materials[l15].color = color48;
  3927. }
  3928. }
  3929. }
  3930. }
  3931. }
  3932. }
  3933. if (unit.Entity.Name == "")
  3934. {
  3935. UMH.comment = "RangedUnit";
  3936. UMH.comment = "Faction";
  3937. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3938. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  3939. {
  3940. weapon.AddComponent<RangeWeapon>();
  3941. weapon.AddComponent<Holdable>();
  3942. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  3943. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  3944. HoldableDataInstance holdableData11 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3945. HoldableDataInstance holdableDataInstance = holdableData11;
  3946. holdableDataInstance.relativePosition += new Vector3(0f, 0f, 0f);
  3947. holdableData11 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3948. holdableDataInstance = holdableData11;
  3949. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  3950. holdableData11 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3951. holdableDataInstance = holdableData11;
  3952. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  3953. holdableData11 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3954. holdableDataInstance = holdableData11;
  3955. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  3956. holdableData11 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3957. holdableDataInstance = holdableData11;
  3958. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  3959. holdableData11 = weapon.GetComponentInChildren<Holdable>().holdableData;
  3960. holdableDataInstance = holdableData11;
  3961. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  3962. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  3963. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  3964. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  3965. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  3966. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  3967. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  3968. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  3969. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  3970. RangeWeapon component11 = weapon.GetComponent<RangeWeapon>();
  3971. component11.numberOfObjects = component11.numberOfObjects;
  3972. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  3973. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  3974. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  3975. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  3976. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  3977. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  3978. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  3979. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  3980. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  3981. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  3982. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  3983. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  3984. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  3985. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  3986. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  3987. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  3988. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  3989. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  3990. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  3991. checked
  3992. {
  3993. if (unit.Entity.Name == "ColourEdit")
  3994. {
  3995. Renderer[] componentsInChildren49 = weapon.GetComponentsInChildren<Renderer>();
  3996. for (int k16 = 0; k16 < componentsInChildren49.Length; k16++)
  3997. {
  3998. componentsInChildren49[k16].material.color = new Color(1f, 1f, 1f);
  3999. for (int l16 = 0; l16 < componentsInChildren49[k16].materials.Length; l16++)
  4000. {
  4001. Color color49;
  4002. switch (l16)
  4003. {
  4004. case 0:
  4005. color49 = new Color(1f, 1f, 1f);
  4006. break;
  4007. case 1:
  4008. color49 = new Color(1f, 0f, 0f);
  4009. break;
  4010. case 2:
  4011. color49 = new Color(0f, 1f, 0f);
  4012. break;
  4013. default:
  4014. color49 = new Color(0f, 0f, 1f);
  4015. break;
  4016. }
  4017. componentsInChildren49[k16].materials[l16].color = color49;
  4018. }
  4019. }
  4020. }
  4021. }
  4022. }
  4023. }
  4024. if (unit.Entity.Name == "")
  4025. {
  4026. UMH.comment = "RangedUnit";
  4027. UMH.comment = "Faction";
  4028. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4029. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  4030. {
  4031. weapon.AddComponent<RangeWeapon>();
  4032. weapon.AddComponent<Holdable>();
  4033. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4034. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  4035. HoldableDataInstance holdableData12 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4036. HoldableDataInstance holdableDataInstance = holdableData12;
  4037. holdableDataInstance.relativePosition += new Vector3(0f, 0f, 0f);
  4038. holdableData12 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4039. holdableDataInstance = holdableData12;
  4040. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  4041. holdableData12 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4042. holdableDataInstance = holdableData12;
  4043. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  4044. holdableData12 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4045. holdableDataInstance = holdableData12;
  4046. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  4047. holdableData12 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4048. holdableDataInstance = holdableData12;
  4049. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  4050. holdableData12 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4051. holdableDataInstance = holdableData12;
  4052. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  4053. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  4054. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  4055. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  4056. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  4057. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  4058. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  4059. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  4060. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  4061. RangeWeapon component12 = weapon.GetComponent<RangeWeapon>();
  4062. component12.numberOfObjects = component12.numberOfObjects;
  4063. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  4064. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  4065. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  4066. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  4067. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  4068. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  4069. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  4070. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  4071. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  4072. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  4073. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  4074. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  4075. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  4076. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  4077. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  4078. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  4079. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  4080. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  4081. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  4082. checked
  4083. {
  4084. if (unit.Entity.Name == "ColourEdit")
  4085. {
  4086. Renderer[] componentsInChildren50 = weapon.GetComponentsInChildren<Renderer>();
  4087. for (int k17 = 0; k17 < componentsInChildren50.Length; k17++)
  4088. {
  4089. componentsInChildren50[k17].material.color = new Color(1f, 1f, 1f);
  4090. for (int l17 = 0; l17 < componentsInChildren50[k17].materials.Length; l17++)
  4091. {
  4092. Color color50;
  4093. switch (l17)
  4094. {
  4095. case 0:
  4096. color50 = new Color(1f, 1f, 1f);
  4097. break;
  4098. case 1:
  4099. color50 = new Color(1f, 0f, 0f);
  4100. break;
  4101. case 2:
  4102. color50 = new Color(0f, 1f, 0f);
  4103. break;
  4104. default:
  4105. color50 = new Color(0f, 0f, 1f);
  4106. break;
  4107. }
  4108. componentsInChildren50[k17].materials[l17].color = color50;
  4109. }
  4110. }
  4111. }
  4112. }
  4113. }
  4114. }
  4115. if (unit.Entity.Name == "")
  4116. {
  4117. UMH.comment = "RangedUnit";
  4118. UMH.comment = "Faction";
  4119. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4120. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  4121. {
  4122. weapon.AddComponent<RangeWeapon>();
  4123. weapon.AddComponent<Holdable>();
  4124. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4125. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  4126. HoldableDataInstance holdableData13 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4127. HoldableDataInstance holdableDataInstance = holdableData13;
  4128. holdableDataInstance.relativePosition += new Vector3(0f, 0f, 0f);
  4129. holdableData13 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4130. holdableDataInstance = holdableData13;
  4131. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  4132. holdableData13 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4133. holdableDataInstance = holdableData13;
  4134. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  4135. holdableData13 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4136. holdableDataInstance = holdableData13;
  4137. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  4138. holdableData13 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4139. holdableDataInstance = holdableData13;
  4140. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  4141. holdableData13 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4142. holdableDataInstance = holdableData13;
  4143. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  4144. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  4145. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  4146. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  4147. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  4148. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  4149. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  4150. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  4151. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  4152. RangeWeapon component13 = weapon.GetComponent<RangeWeapon>();
  4153. component13.numberOfObjects = component13.numberOfObjects;
  4154. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  4155. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  4156. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  4157. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  4158. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  4159. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  4160. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  4161. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  4162. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  4163. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  4164. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  4165. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  4166. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  4167. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  4168. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  4169. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  4170. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  4171. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  4172. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  4173. checked
  4174. {
  4175. if (unit.Entity.Name == "ColourEdit")
  4176. {
  4177. Renderer[] componentsInChildren51 = weapon.GetComponentsInChildren<Renderer>();
  4178. for (int k18 = 0; k18 < componentsInChildren51.Length; k18++)
  4179. {
  4180. componentsInChildren51[k18].material.color = new Color(1f, 1f, 1f);
  4181. for (int l18 = 0; l18 < componentsInChildren51[k18].materials.Length; l18++)
  4182. {
  4183. Color color51;
  4184. switch (l18)
  4185. {
  4186. case 0:
  4187. color51 = new Color(1f, 1f, 1f);
  4188. break;
  4189. case 1:
  4190. color51 = new Color(1f, 0f, 0f);
  4191. break;
  4192. case 2:
  4193. color51 = new Color(0f, 1f, 0f);
  4194. break;
  4195. default:
  4196. color51 = new Color(0f, 0f, 1f);
  4197. break;
  4198. }
  4199. componentsInChildren51[k18].materials[l18].color = color51;
  4200. }
  4201. }
  4202. }
  4203. }
  4204. }
  4205. }
  4206. if (unit.Entity.Name == "")
  4207. {
  4208. UMH.comment = "RangedUnit";
  4209. UMH.comment = "Faction";
  4210. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4211. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  4212. {
  4213. weapon.AddComponent<RangeWeapon>();
  4214. weapon.AddComponent<Holdable>();
  4215. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4216. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  4217. HoldableDataInstance holdableData14 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4218. HoldableDataInstance holdableDataInstance = holdableData14;
  4219. holdableDataInstance.relativePosition += new Vector3(0f, 0f, 0f);
  4220. holdableData14 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4221. holdableDataInstance = holdableData14;
  4222. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  4223. holdableData14 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4224. holdableDataInstance = holdableData14;
  4225. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  4226. holdableData14 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4227. holdableDataInstance = holdableData14;
  4228. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  4229. holdableData14 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4230. holdableDataInstance = holdableData14;
  4231. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  4232. holdableData14 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4233. holdableDataInstance = holdableData14;
  4234. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  4235. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  4236. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  4237. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  4238. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  4239. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  4240. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  4241. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  4242. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  4243. RangeWeapon component14 = weapon.GetComponent<RangeWeapon>();
  4244. component14.numberOfObjects = component14.numberOfObjects;
  4245. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  4246. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  4247. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  4248. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  4249. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  4250. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  4251. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  4252. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  4253. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  4254. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  4255. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  4256. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  4257. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  4258. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  4259. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  4260. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  4261. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  4262. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  4263. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  4264. checked
  4265. {
  4266. if (unit.Entity.Name == "ColourEdit")
  4267. {
  4268. Renderer[] componentsInChildren52 = weapon.GetComponentsInChildren<Renderer>();
  4269. for (int k19 = 0; k19 < componentsInChildren52.Length; k19++)
  4270. {
  4271. componentsInChildren52[k19].material.color = new Color(1f, 1f, 1f);
  4272. for (int l19 = 0; l19 < componentsInChildren52[k19].materials.Length; l19++)
  4273. {
  4274. Color color52;
  4275. switch (l19)
  4276. {
  4277. case 0:
  4278. color52 = new Color(1f, 1f, 1f);
  4279. break;
  4280. case 1:
  4281. color52 = new Color(1f, 0f, 0f);
  4282. break;
  4283. case 2:
  4284. color52 = new Color(0f, 1f, 0f);
  4285. break;
  4286. default:
  4287. color52 = new Color(0f, 0f, 1f);
  4288. break;
  4289. }
  4290. componentsInChildren52[k19].materials[l19].color = color52;
  4291. }
  4292. }
  4293. }
  4294. }
  4295. }
  4296. }
  4297. if (unit.Entity.Name == "")
  4298. {
  4299. UMH.comment = "RangedUnit";
  4300. UMH.comment = "Faction";
  4301. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4302. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  4303. {
  4304. weapon.AddComponent<RangeWeapon>();
  4305. weapon.AddComponent<Holdable>();
  4306. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4307. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  4308. HoldableDataInstance holdableData15 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4309. HoldableDataInstance holdableDataInstance = holdableData15;
  4310. holdableDataInstance.relativePosition += new Vector3(0f, 0f, 0f);
  4311. holdableData15 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4312. holdableDataInstance = holdableData15;
  4313. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  4314. holdableData15 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4315. holdableDataInstance = holdableData15;
  4316. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  4317. holdableData15 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4318. holdableDataInstance = holdableData15;
  4319. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  4320. holdableData15 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4321. holdableDataInstance = holdableData15;
  4322. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  4323. holdableData15 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4324. holdableDataInstance = holdableData15;
  4325. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  4326. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  4327. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  4328. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  4329. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  4330. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  4331. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  4332. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  4333. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  4334. RangeWeapon component15 = weapon.GetComponent<RangeWeapon>();
  4335. component15.numberOfObjects = component15.numberOfObjects;
  4336. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  4337. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  4338. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  4339. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  4340. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  4341. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  4342. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  4343. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  4344. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  4345. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  4346. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  4347. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  4348. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  4349. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  4350. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  4351. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  4352. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  4353. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  4354. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  4355. checked
  4356. {
  4357. if (unit.Entity.Name == "ColourEdit")
  4358. {
  4359. Renderer[] componentsInChildren53 = weapon.GetComponentsInChildren<Renderer>();
  4360. for (int k20 = 0; k20 < componentsInChildren53.Length; k20++)
  4361. {
  4362. componentsInChildren53[k20].material.color = new Color(1f, 1f, 1f);
  4363. for (int l20 = 0; l20 < componentsInChildren53[k20].materials.Length; l20++)
  4364. {
  4365. Color color53;
  4366. switch (l20)
  4367. {
  4368. case 0:
  4369. color53 = new Color(1f, 1f, 1f);
  4370. break;
  4371. case 1:
  4372. color53 = new Color(1f, 0f, 0f);
  4373. break;
  4374. case 2:
  4375. color53 = new Color(0f, 1f, 0f);
  4376. break;
  4377. default:
  4378. color53 = new Color(0f, 0f, 1f);
  4379. break;
  4380. }
  4381. componentsInChildren53[k20].materials[l20].color = color53;
  4382. }
  4383. }
  4384. }
  4385. }
  4386. }
  4387. }
  4388. if (unit.Entity.Name == "")
  4389. {
  4390. UMH.comment = "RangedUnit";
  4391. UMH.comment = "Faction";
  4392. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4393. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  4394. {
  4395. weapon.AddComponent<RangeWeapon>();
  4396. weapon.AddComponent<Holdable>();
  4397. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4398. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  4399. HoldableDataInstance holdableData16 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4400. HoldableDataInstance holdableDataInstance = holdableData16;
  4401. holdableDataInstance.relativePosition += new Vector3(0f, 0f, 0f);
  4402. holdableData16 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4403. holdableDataInstance = holdableData16;
  4404. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  4405. holdableData16 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4406. holdableDataInstance = holdableData16;
  4407. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  4408. holdableData16 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4409. holdableDataInstance = holdableData16;
  4410. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  4411. holdableData16 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4412. holdableDataInstance = holdableData16;
  4413. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  4414. holdableData16 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4415. holdableDataInstance = holdableData16;
  4416. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  4417. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  4418. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  4419. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  4420. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  4421. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  4422. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  4423. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  4424. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  4425. RangeWeapon component16 = weapon.GetComponent<RangeWeapon>();
  4426. component16.numberOfObjects = component16.numberOfObjects;
  4427. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  4428. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  4429. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  4430. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  4431. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  4432. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  4433. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  4434. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  4435. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  4436. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  4437. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  4438. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  4439. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  4440. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  4441. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  4442. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  4443. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  4444. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  4445. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  4446. checked
  4447. {
  4448. if (unit.Entity.Name == "ColourEdit")
  4449. {
  4450. Renderer[] componentsInChildren54 = weapon.GetComponentsInChildren<Renderer>();
  4451. for (int k21 = 0; k21 < componentsInChildren54.Length; k21++)
  4452. {
  4453. componentsInChildren54[k21].material.color = new Color(1f, 1f, 1f);
  4454. for (int l21 = 0; l21 < componentsInChildren54[k21].materials.Length; l21++)
  4455. {
  4456. Color color54;
  4457. switch (l21)
  4458. {
  4459. case 0:
  4460. color54 = new Color(1f, 1f, 1f);
  4461. break;
  4462. case 1:
  4463. color54 = new Color(1f, 0f, 0f);
  4464. break;
  4465. case 2:
  4466. color54 = new Color(0f, 1f, 0f);
  4467. break;
  4468. default:
  4469. color54 = new Color(0f, 0f, 1f);
  4470. break;
  4471. }
  4472. componentsInChildren54[k21].materials[l21].color = color54;
  4473. }
  4474. }
  4475. }
  4476. }
  4477. }
  4478. }
  4479. if (unit.Entity.Name == "")
  4480. {
  4481. UMH.comment = "RangedUnit";
  4482. UMH.comment = "Faction";
  4483. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4484. if (handType == HoldingHandler.HandType.Right || handType == HoldingHandler.HandType.Left)
  4485. {
  4486. weapon.AddComponent<RangeWeapon>();
  4487. weapon.AddComponent<Holdable>();
  4488. weapon.transform.localScale += new Vector3(0f, 0f, 0f);
  4489. weapon.transform.localScale -= new Vector3(0f, 0f, 0f);
  4490. HoldableDataInstance holdableData17 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4491. HoldableDataInstance holdableDataInstance = holdableData17;
  4492. holdableDataInstance.relativePosition += new Vector3(0f, 0f, 0f);
  4493. holdableData17 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4494. holdableDataInstance = holdableData17;
  4495. holdableDataInstance.relativePosition -= new Vector3(0f, 0f, 0f);
  4496. holdableData17 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4497. holdableDataInstance = holdableData17;
  4498. holdableDataInstance.forwardRotation += new Vector3(0f, 0f, 0f);
  4499. holdableData17 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4500. holdableDataInstance = holdableData17;
  4501. holdableDataInstance.forwardRotation -= new Vector3(0f, 0f, 0f);
  4502. holdableData17 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4503. holdableDataInstance = holdableData17;
  4504. holdableDataInstance.upRotation += new Vector3(0f, 0f, 0f);
  4505. holdableData17 = weapon.GetComponentInChildren<Holdable>().holdableData;
  4506. holdableDataInstance = holdableData17;
  4507. holdableDataInstance.upRotation -= new Vector3(0f, 0f, 0f);
  4508. weapon.GetComponentInChildren<RangeWeapon>().deleyPerSpawn *= 1f;
  4509. weapon.GetComponentInChildren<RangeWeapon>().spawnDelay *= 1f;
  4510. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ShootPosition;
  4511. weapon.GetComponentInChildren<RangeWeapon>().spawnRotation = RangeWeapon.SpawnRotation.TowardsTarget;
  4512. weapon.GetComponentInChildren<RangeWeapon>().extraCDInMelee *= 0.5f;
  4513. weapon.GetComponentInChildren<RangeWeapon>().extraSpreadInMelee *= 0f;
  4514. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  4515. weapon.GetComponentInChildren<RangeWeapon>().spread *= 1f;
  4516. RangeWeapon component17 = weapon.GetComponent<RangeWeapon>();
  4517. component17.numberOfObjects = component17.numberOfObjects;
  4518. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  4519. weapon.GetComponentInChildren<RangeWeapon>().randomX *= 0f;
  4520. weapon.GetComponentInChildren<RangeWeapon>().randomY *= 0f;
  4521. weapon.GetComponentInChildren<RangeWeapon>().randomZ *= 0f;
  4522. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  4523. weapon.GetComponentInChildren<RangeWeapon>().shootRecoil *= 1f;
  4524. weapon.GetComponentInChildren<RangeWeapon>().torsoRecoil *= 1f;
  4525. weapon.GetComponentInChildren<RangeWeapon>().maxRange *= 5f;
  4526. weapon.GetComponentInChildren<RangeWeapon>().startOnCooldown = false;
  4527. weapon.GetComponentInChildren<RangeWeapon>().internalCooldown *= 1f;
  4528. weapon.GetComponentInChildren<RangeWeapon>().randomCooldown = false;
  4529. weapon.GetComponentInChildren<RangeWeapon>().callAttackEffects = true;
  4530. weapon.GetComponentInChildren<RangeWeapon>().countSelf = false;
  4531. weapon.GetComponentInChildren<RangeWeapon>().defaultAngularDrag *= 1f;
  4532. weapon.GetComponentInChildren<RangeWeapon>().isRange = false;
  4533. weapon.GetComponentInChildren<RangeWeapon>().useTargetingWhenPossessed = false;
  4534. weapon.GetComponentInChildren<RangeWeapon>().m_weaponTargetType = Weapon.WeaponTargetType.EnemiesOnly;
  4535. weapon.GetComponentInChildren<RangeWeapon>().possessionAimingMode = Weapon.PossessionAimingMode.Forward;
  4536. weapon.GetComponentInChildren<RangeWeapon>().weaponMaterialType = Weapon.WeaponMaterialType.Metal;
  4537. checked
  4538. {
  4539. if (unit.Entity.Name == "ColourEdit")
  4540. {
  4541. Renderer[] componentsInChildren55 = weapon.GetComponentsInChildren<Renderer>();
  4542. for (int k22 = 0; k22 < componentsInChildren55.Length; k22++)
  4543. {
  4544. componentsInChildren55[k22].material.color = new Color(1f, 1f, 1f);
  4545. for (int l22 = 0; l22 < componentsInChildren55[k22].materials.Length; l22++)
  4546. {
  4547. Color color55;
  4548. switch (l22)
  4549. {
  4550. case 0:
  4551. color55 = new Color(1f, 1f, 1f);
  4552. break;
  4553. case 1:
  4554. color55 = new Color(1f, 0f, 0f);
  4555. break;
  4556. case 2:
  4557. color55 = new Color(0f, 1f, 0f);
  4558. break;
  4559. default:
  4560. color55 = new Color(0f, 0f, 1f);
  4561. break;
  4562. }
  4563. componentsInChildren55[k22].materials[l22].color = color55;
  4564. }
  4565. }
  4566. }
  4567. }
  4568. }
  4569. }
  4570. if (unit.Entity.Name == "Midas")
  4571. {
  4572. weapon.GetComponentInChildren<RangeWeapon>().spawnPosition = RangeWeapon.SpawnPosition.ownTorso;
  4573. weapon.GetComponentInChildren<RangeWeapon>().positionOffset = new Vector3(0f, 0f, 0f);
  4574. weapon.GetComponentInChildren<RangeWeapon>().spread = 0f;
  4575. weapon.GetComponent<RangeWeapon>().projectileSpeedSpread = 0f;
  4576. weapon.GetComponentInChildren<RangeWeapon>().charge *= 1f;
  4577. weapon.transform.localScale = new Vector3(0f, 0f, 0f);
  4578. SpellAnimation[] animations = weapon.GetComponentInChildren<WeaponForceAnimation>().animations;
  4579. for (int m2 = 0; m2 < animations.Length; m2 = checked(m2 + 1))
  4580. {
  4581. animations[m2].rigAnimationForce *= 0.8f;
  4582. }
  4583. }
  4584. if (unit.Entity.Name == "Placeholder")
  4585. {
  4586. weapon.GetComponent<Weapon>().maxRange *= 0.7f;
  4587. weapon.GetComponentInChildren<CollisionWeapon>().gameObject.AddComponent<MeleeWeaponAddEffect>().EffectPrefab = database.Weapons[9].GetComponent<RangeWeapon>().objectToSpawn.GetComponentInChildren<ProjectileHit>().objectsToSpawn[0].objectToSpawn.GetComponentInChildren<AddObjectEffect>().EffectPrefab;
  4588. weapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = CollisionWeapon.CallEffectsOn.Rigidbodies;
  4589. weapon.transform.localScale = new Vector3(1f, 1.2f, 0.8f);
  4590. MeshRenderer[] componentsInChildren56 = weapon.GetComponentsInChildren<MeshRenderer>();
  4591. checked
  4592. {
  4593. for (int n2 = 0; n2 < componentsInChildren56.Length; n2++)
  4594. {
  4595. componentsInChildren56[n2].materials[0].color = Color.green;
  4596. componentsInChildren56[n2].materials[1].color = Color.green;
  4597. }
  4598. weapon.GetComponent<Weapon>().internalCooldown /= 2f;
  4599. weapon.transform.localScale = new Vector3(1f, 1.2f, 0.8f);
  4600. SpellAnimation[] animations2 = weapon.GetComponentInChildren<WeaponForceAnimation>().animations;
  4601. for (int m3 = 0; m3 < animations2.Length; m3++)
  4602. {
  4603. animations2[m3].rigAnimationForce /= 1.3f;
  4604. }
  4605. }
  4606. }
  4607. }
  4608. }
  4609. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement