Advertisement
Guest User

X2Effect_BlastPadding

a guest
Jul 21st, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. // This is an Unreal Script
  2.  
  3. class X2Effect_BlastPadding extends X2Effect_PersistentStatChange config (LW_ScalingDefensivePerks);
  4.  
  5. var config int CERAMIC_PLATING_HP;
  6. var config int ALLOY_PLATING_HP;
  7. var config int CARAPACE_PLATING_HP;
  8. var config int CHITIN_PLATING_HP;
  9.  
  10. var XComGameState_Unit TargetUnit;
  11.  
  12. simulated function AddPersistentStatChange(ECharStatType StatType, float StatAmount, optional EStatModOp InModOp=MODOP_Addition )
  13. {
  14. local StatChange NewChange;
  15. local int BonusAmount;
  16. local array<XComGameState_Item> Items;
  17. local XComGameState_Item Item;
  18. local XComGameState_Item Plating;
  19.  
  20. Items = TargetUnit.GetAllInventoryItems();
  21.  
  22. foreach Items(Item)
  23. {
  24. if(Item.GetMyTemplate().ItemCat == 'plating'){
  25. Plating = Item;
  26. }
  27. }
  28.  
  29. switch(Plating.GetMyTemplateName()){
  30. case 'CeramicPlating':
  31. BonusAmount = 2;
  32. break;
  33. case 'AlloyPlating':
  34. BonusAmount = 3;
  35. break;
  36. case 'ChitinPlating':
  37. BonusAmount = 4;
  38. break;
  39. case 'CarapacePlating':
  40. BonusAmount = 5;
  41. break;
  42. default:
  43. }
  44.  
  45. if(BonusAmount < StatAmount){
  46. BonusAmount = StatAmount;
  47. }
  48.  
  49. NewChange.StatType = StatType;
  50. NewChange.StatAmount = BonusAmount;
  51. NewChange.ModOp = InModOp;
  52.  
  53. m_aStatChanges.AddItem(NewChange);
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement