Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class X2Item_DroneWeapons extends X2Item_HeavyWeapons config(DronesSetup);
- var config int SKULLBIT_WPN_CHARGES;
- var config array<int> SB_WPN_RANGE_CV;
- var config WeaponDamageValue SB_WPN_DMG_CV;
- var config int SB_WPN_CRIT_CV;
- var config int SB_WPN_WORLD_DMG_CV;
- static function array<X2DataTemplate> CreateTemplates()
- {
- local array<X2DataTemplate> Weapons;
- Weapons.AddItem(SkullBITWpn_CV());
- return Weapons;
- }
- // **************************************************************************
- // *** Heavy Weapons Slot ***
- // **************************************************************************
- static function X2WeaponTemplate SkullBITWpn_CV()
- {
- local X2WeaponTemplate Template;
- local AltGameArchetypeUse GameArch;
- `CREATE_X2TEMPLATE(class'X2WeaponTemplate', Template, 'SkullBITWpn_CV');
- Template.ItemCat = 'weapon';
- Template.WeaponCat = 'droneweapon';
- Template.WeaponTech = 'conventional';
- Template.strImage = "img:///DraktenSkullRipper.InventoryIcons.Inv_SBWPN_CV";
- Template.Tier = 0;
- Template.EquipSound = "StrategyUI_Heavy_Weapon_Equip";
- Template.OnEquippedFn = SBWpnEquipped;
- Template.Aim = 0;
- Template.iPhysicsImpulse = 5;
- Template.BaseDamage = default.SB_WPN_DMG_CV; //modeled after the bullpup
- Template.RangeAccuracy = default.SB_WPN_RANGE_CV; //modeled after the shotgun array more or less
- Template.CritChance = default.SB_WPN_CRIT_CV; //modeled after the shotgun
- Template.iClipSize = 99;
- Template.InfiniteAmmo = true;
- Template.bMergeAmmo = true;
- Template.bHideClipSizeStat = true;
- Template.iSoundRange = 15;
- Template.iEnvironmentDamage = default.SB_WPN_WORLD_DMG_CV;
- Template.PointsToComplete = 0;
- Template.InventorySlot = eInvSlot_HeavyWeapon;
- Template.StowedLocation = eSlot_HeavyWeapon;
- Template.GameArchetype = "DraktenSkullRipper.Archetypes.WP_HWslot_SkullBIT_CV";
- GameArch.UseGameArchetypeFn = SoldierHeavyWeaponCheck;
- GameArch.ArchetypeString = "DraktenSkullRipper.Archetypes.WP_Empty";
- AddAltGameArchetype(GameArch, 'SkullBITWpn_CV') ;
- Template.DamageTypeTemplateName = 'Electrical';
- Template.Abilities.AddItem('SbWpnAbility');
- Template.Abilities.AddItem('HotLoadAmmo');
- Template.Abilities.AddItem('Reload');
- Template.CanBeBuilt = false;
- Template.StartingItem = true;
- Template.bInfiniteItem = true;
- Template.SetUIStatMarkup(class'XLocalizedData'.default.ChargesLabel, , default.SKULLBIT_WPN_CHARGES);
- return Template;
- }
- function SBWpnEquipped(XComGameState_Item ItemState, XComGameState_Unit UnitState, XComGameState NewGameState)
- {
- local XComGameState_Item DroneHeavyWeapon;
- local array<XComGameState_Unit> AttachedUnits;
- UnitState.GetAttachedUnits(AttachedUnits);
- if (AttachedUnits.Length > 0)
- {
- DroneHeavyWeapon = ItemState.GetMyTemplate().CreateInstanceFromTemplate(NewGameState);
- AttachedUnits[0].bIgnoreItemEquipRestrictions = true;
- AttachedUnits[0].AddItemToInventory(DroneHeavyWeapon, eInvSlot_HeavyWeapon, NewGameState);
- AttachedUnits[0].bIgnoreItemEquipRestrictions = false;
- XGUnit(AttachedUnits[0].GetVisualizer()).ApplyLoadoutFromGameState(AttachedUnits[0], NewGameState);
- }
- }
- static function AddAltGameArchetype(AltGameArchetypeUse GameArch, Name BaseTemplateName)
- {
- local X2ItemTemplateManager ItemMgr;
- local X2WeaponTemplate WeaponTemplate;
- local array<X2DataTemplate> DataTemplates;
- local int i;
- ItemMgr = class'X2ItemTemplateManager'.static.GetItemTemplateManager();
- ItemMgr.FindDataTemplateAllDifficulties(BaseTemplateName, DataTemplates);
- for (i = 0; i < DataTemplates.Length; ++i)
- {
- WeaponTemplate = X2WeaponTemplate(DataTemplates[i]);
- if (WeaponTemplate != none)
- {
- WeaponTemplate.AltGameArchetypeArray.AddItem(GameArch);
- }
- }
- }
- static function bool SoldierHeavyWeaponCheck(XComGameState_Item ItemState, XComGameState_Unit UnitState, string ConsiderArchetype)
- {
- switch(UnitState.GetMyTemplateName())
- {
- case 'DRAKTEN_SkullRipper':
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement