Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class X2Item_DroneWeapons extends X2Item_HeavyWeapons config(DronesSetup);
- 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;
- var config int SKULLBIT_WPN_CHARGES;
- static function array<X2DataTemplate> CreateTemplates()
- {
- local array<X2DataTemplate> Weapons;
- Weapons.AddItem(SkullBITWpn_CV());
- return Weapons;
- }
- // **************************************************************************
- // *** Heavy Weapons Slot ***
- // **************************************************************************
- //SetUIStatMarkup(String InLabel, optional ECharStatType InStatType = eStat_Invalid, optional int Amount = 0, optional bool ForceShow = false, optional delegate<X2StrategyGameRulesetDataStructures.SpecialRequirementsDelegate> ShowUIStatFn, optional String InUnit)
- 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:///DrakNetRun.InventoryIcons.Inv_SBWPN_CV";
- Template.Tier = 0;
- Template.EquipSound = "StrategyUI_Heavy_Weapon_Equip";
- Template.OnEquippedFn = SBWpnEquipped;
- Template.Aim = 0;
- 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.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 = "DrakNetRun.Weapons.WP_HWslot_SkullBIT_CV";
- GameArch.UseGameArchetypeFn = SoldierHeavyWeaponCheck;
- GameArch.ArchetypeString = "DrakNetRun.Weapons.WP_Empty";
- AddAltGameArchetype(GameArch, 'SoldierEmpty') ;
- Template.bMergeAmmo = true;
- 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 bool SparkHeavyWeaponCheck(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