Advertisement
Drakten

Untitled

Sep 30th, 2020
1,582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class X2Character_SkullRipper extends X2Character_DefaultCharacters config(GameData_CharacterStats);
  2.  
  3. static function array<X2DataTemplate> CreateTemplates()
  4. {
  5.     local array<X2DataTemplate> Templates;
  6.  
  7.     Templates.AddItem(CreateSkullRipperTemplate());
  8.    
  9.     return Templates;
  10. }
  11.  
  12. static function X2CharacterTemplate CreateSkullRipperTemplate()
  13. {
  14.     local X2CharacterTemplate CharTemplate;
  15.  
  16.     CharTemplate = CreateSoldierTemplate('SkullRipperSoldier');
  17.     CharTemplate.DefaultSoldierClass = 'DRAKTEN_SkullRipper';
  18.     CharTemplate.DefaultLoadout = 'Squaddie_SkullRipper';
  19.    
  20.     CharTemplate.Abilities.AddItem('Interact_ActivateSpark');       //patching in DLC3 abilities
  21.     CharTemplate.Abilities.AddItem('Interact_AtmosphereComputer');
  22.     CharTemplate.Abilities.AddItem('Interact_UseElevator');
  23.     CharTemplate.Abilities.AddItem('Interact_DLC2Transmitter');
  24.  
  25.     CharTemplate.ForceAppearance.iAttitude = 0; //to force templar pose since SkullRip is primary weapon
  26.  
  27.     CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Soldier_ANIM.Anims.AS_Soldier")));
  28.     CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Templar_ANIM.Anims.AS_Templar")));
  29.     CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Soldier_Unarmed_ANIM.Anims.AS_UB_Soldier")));
  30.     CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Soldier_Unarmed_ANIM.Anims.AS_UB_Medkit")));
  31.     CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Soldier_Unarmed_ANIM.Anims.AS_UB_Skulljack")));
  32.     CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Templar_ANIM.Anims.AS_UB_Grenade")));
  33.  
  34.     CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("IRI_PunchAndKick.Anims.AS_Unarmed_Idle"))); //Iridar's unarmed mod required since we make use of some punching animations
  35.     CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("IRI_PunchAndKick.Anims.AS_Punch_Primary")));
  36.  
  37.     CharTemplate.OnCosmeticUnitCreatedFn = DroneCosmeticUnitCreated; //the fucking HOLY GRAIL
  38.  
  39.     return CharTemplate;
  40. }
  41.  
  42. function DroneCosmeticUnitCreated(XComGameState_Unit CosmeticUnit, XComGameState_Unit OwnerUnit, XComGameState_Item SourceItem, XComGameState StartGameState)
  43. {
  44.     local XComGameState_Item SoldierHeavyWeapon, DroneHeavyWeapon;
  45.  
  46.     SoldierHeavyWeapon = OwnerUnit.GetItemInSlot(eInvSlot_HeavyWeapon);
  47.     if (SoldierHeavyWeapon != none)
  48.     {
  49.         DroneHeavyWeapon = SoldierHeavyWeapon.GetMyTemplate().CreateInstanceFromTemplate(StartGameState);
  50.         CosmeticUnit.bIgnoreItemEquipRestrictions = true;
  51.         CosmeticUnit.AddItemToInventory(DroneHeavyWeapon, eInvSlot_HeavyWeapon, StartGameState);
  52.         CosmeticUnit.bIgnoreItemEquipRestrictions = false;
  53.  
  54.         XGUnit(CosmeticUnit.GetVisualizer()).ApplyLoadoutFromGameState(CosmeticUnit, StartGameState);
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement