Advertisement
Drakten

Untitled

Sep 13th, 2020
1,429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static function bool CanAddItemToInventory_CH_Improved(out int bCanAddItem, const EInventorySlot Slot, const X2ItemTemplate ItemTemplate, int Quantity, XComGameState_Unit UnitState, optional XComGameState CheckGameState, optional out string DisabledReason, optional XComGameState_Item ItemState)
  2. {
  3.     local X2WeaponTemplate                  WeaponTemplate;
  4.     local XGParamTag                            LocTag;
  5.     local name                              ClassName;
  6.     local X2SoldierClassTemplateManager     Manager;
  7.     local bool                              OverrideNormalBehavior;
  8.     local bool                              DoNotOverrideNormalBehavior;
  9.  
  10.     OverrideNormalBehavior = CheckGameState != none;
  11.     DoNotOverrideNormalBehavior = CheckGameState == none;
  12.  
  13.     if(DisabledReason != "")
  14.     return DoNotOverrideNormalBehavior;
  15.  
  16.     WeaponTemplate = X2WeaponTemplate(ItemTemplate);
  17.  
  18.     if(WeaponTemplate != none && UnitState.GetSoldierClassTemplateName() == 'DRAKTEN_SkullRipper' && WeaponTemplate.WeaponCat == 'droneweapon' && Slot == eInvSlot_HeavyWeapon )
  19.     return DoNotOverrideNormalBehavior;
  20.  
  21.     if(WeaponTemplate != none && UnitState.GetSoldierClassTemplateName() != 'DRAKTEN_SkullRipper' && WeaponTemplate.WeaponCat == 'droneweapon' && Slot == eInvSlot_HeavyWeapon || WeaponTemplate != none && UnitState.GetSoldierClassTemplateName() == 'DRAKTEN_SkullRipper' && WeaponTemplate.WeaponCat != 'droneweapon' && Slot == eInvSlot_HeavyWeapon )
  22.     {
  23.         Manager = class'X2SoldierClassTemplateManager'.static.GetSoldierClassTemplateManager();
  24.  
  25.         LocTag = XGParamTag(`XEXPANDCONTEXT.FindTag("XGParam"));
  26.  
  27.         LocTag.StrValue0 = Manager.FindSoldierClassTemplate(ClassName).DisplayName;
  28.  
  29.         DisabledReason = class'UIUtilities_Text'.static.CapsCheckForGermanScharfesS(`XEXPAND.ExpandString(class'UIArmory_Loadout'.default.m_strNeedsSoldierClass));
  30.  
  31.         bCanAddItem = 0;
  32.  
  33.         return OverrideNormalBehavior;
  34.  
  35.     }
  36.     return DoNotOverrideNormalBehavior;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement