Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class X2Character_SkullRipper extends X2Character_DefaultCharacters config(GameData_CharacterStats);
- static function array<X2DataTemplate> CreateTemplates()
- {
- local array<X2DataTemplate> Templates;
- Templates.AddItem(CreateSkullRipperTemplate());
- return Templates;
- }
- static function X2CharacterTemplate CreateSkullRipperTemplate()
- {
- local X2CharacterTemplate CharTemplate;
- CharTemplate = CreateSoldierTemplate('SkullRipperSoldier');
- CharTemplate.DefaultSoldierClass = 'DRAKTEN_SkullRipper';
- CharTemplate.DefaultLoadout = 'Squaddie_SkullRipper';
- CharTemplate.Abilities.AddItem('Interact_ActivateSpark'); //patching in DLC3 abilities
- CharTemplate.Abilities.AddItem('Interact_AtmosphereComputer');
- CharTemplate.Abilities.AddItem('Interact_UseElevator');
- CharTemplate.Abilities.AddItem('Interact_DLC2Transmitter');
- CharTemplate.ForceAppearance.iAttitude = 0; //to force templar pose since SkullRip is primary weapon
- CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Soldier_ANIM.Anims.AS_Soldier")));
- CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Templar_ANIM.Anims.AS_Templar")));
- CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Soldier_Unarmed_ANIM.Anims.AS_UB_Soldier")));
- CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Soldier_Unarmed_ANIM.Anims.AS_UB_Medkit")));
- CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Soldier_Unarmed_ANIM.Anims.AS_UB_Skulljack")));
- CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("Templar_ANIM.Anims.AS_UB_Grenade")));
- 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
- CharTemplate.AdditionalAnimSets.AddItem(AnimSet(`CONTENT.RequestGameArchetype("IRI_PunchAndKick.Anims.AS_Punch_Primary")));
- CharTemplate.OnCosmeticUnitCreatedFn = DroneCosmeticUnitCreated; //the fucking HOLY GRAIL
- return CharTemplate;
- }
- function DroneCosmeticUnitCreated(XComGameState_Unit CosmeticUnit, XComGameState_Unit OwnerUnit, XComGameState_Item SourceItem, XComGameState StartGameState)
- {
- local XComGameState_Item SoldierHeavyWeapon, DroneHeavyWeapon;
- SoldierHeavyWeapon = OwnerUnit.GetItemInSlot(eInvSlot_HeavyWeapon);
- if (SoldierHeavyWeapon != none)
- {
- DroneHeavyWeapon = SoldierHeavyWeapon.GetMyTemplate().CreateInstanceFromTemplate(StartGameState);
- CosmeticUnit.bIgnoreItemEquipRestrictions = true;
- CosmeticUnit.AddItemToInventory(DroneHeavyWeapon, eInvSlot_HeavyWeapon, StartGameState);
- CosmeticUnit.bIgnoreItemEquipRestrictions = false;
- XGUnit(CosmeticUnit.GetVisualizer()).ApplyLoadoutFromGameState(CosmeticUnit, StartGameState);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement