Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is an Unreal Script
- class X2Ability_LW_TechnicalHeavyWeaponReload extends X2Ability
- dependson (XComGameStateContext_Ability) config(LW_TechnicalHeavyWeaponReload);
- var config int ROCKET_RELOAD_STAGES;
- var config int FLAMETHROWER_RELOAD_STAGES;
- var config int AUTOLOADER_ARMAMENTS_BONUS;
- static function array<X2DataTemplate> CreateTemplates()
- {
- local array<X2DataTemplate> Templates;
- Templates.AddItem(LWReloadFlameThrower());
- //Templates.AddItem(LWReloadRocketLauncher());
- Templates.AddItem(PurePassive('AutoloaderArmaments', "img:///UILibrary_LW_Overhaul.LW_AbilityFireandSteel"))
- }
- static function X2AbilityTemplate LWReloadFlameThrowerAbility()
- {
- local X2AbilityTemplate Template;
- local X2AbilityTemplate FlameThrowerTemplate;
- local X2AbilityCost_ActionPoints ActionPointCost;
- local X2Condition_UnitProperty ShooterPropertyCondition;
- local X2Condition_AbilitySourceWeapon WeaponCondition;
- local X2AbilityTrigger_PlayerInput InputTrigger;
- local array<name> SkipExclusions;
- `CREATE_X2ABILITY_TEMPLATE(Template, 'LW_ReloadFlamethrower');
- Template.bDontDisplayInAbilitySummary = true;
- ActionPointCost = new class'X2AbilityCost_ActionPoints';
- Template.AbilityCosts.AddItem(ActionPointCost);
- ShooterPropertyCondition = new class'X2Condition_UnitProperty';
- ShooterPropertyCondition.ExcludeDead = true; //Can't reload while dead
- Template.AbilityShooterConditions.AddItem(ShooterPropertyCondition);
- //add condition (must have less than max flamethrower ammo)
- SkipExclusions.AddItem(class'X2AbilityTemplateManager'.default.DisorientedName);
- Template.AddShooterEffectExclusions(SkipExclusions);
- InputTrigger = new class'X2AbilityTrigger_PlayerInput';
- Template.AbilityTriggers.AddItem(InputTrigger);
- Charges = new class'X2AbilityCharges_BonusCharges';
- Charges.InitialCharges = default.FLAMETHROWER_RELOAD_STAGES;
- if (XComGameState_Unit(AffectState).HasSoldierAbility('AutoloaderArmaments'))
- {
- Charges.InitialCharges = default.FLAMETHROWER_RELOAD_STAGES - default.AUTOLOADER_ARMAMENTS_BONUS;
- }
- ChargeCost = new class'X2AbilityCost_Charges';
- ChargeCost.NumCharges = 1;
- Template.AbilityCosts.AddItem(ChargeCost);
- if(Charges == 1){
- if (XComGameState_Unit(AffectState).HasSoldierAbility('AutoloaderArmaments'))
- {
- AddCharges(Template, default.FLAMETHROWER_RELOAD_STAGES - default.AUTOLOADER_ARMAMENTS_BONUS);
- } else{
- AddCharges(Template, default.FLAMETHROWER_RELOAD_STAGES);
- }
- FlameThowerTemplate = class'LWFlamethrower';
- AddCharges(FlameThrowerTemplate,1);
- }
- Template.AbilityToHitCalc = default.DeadEye;
- Template.AbilityTargetStyle = default.SelfTarget;
- Template.AbilitySourceName = 'eAbilitySource_Standard';
- Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_ShowIfAvailable;
- Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_reload";
- Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.ARMOR_ACTIVE_PRIORITY;
- Template.bNoConfirmationWithHotKey = true;
- Template.bDisplayInUITooltip = false;
- Template.bDisplayInUITacticalText = false;
- Template.DisplayTargetHitChance = false;
- Template.ActivationSpeech = 'Reloading';
- Template.BuildNewGameStateFn = ReloadAbility_BuildGameState;
- Template.BuildVisualizationFn = ReloadAbility_BuildVisualization;
- ActionPointCost.iNumPoints = 1;
- Template.Hostility = eHostility_Neutral;
- Template.CinescriptCameraType="GenericAccentCam";
- return Template;
- }
Add Comment
Please, Sign In to add comment