Skip to content

Commit

Permalink
Rework abilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Danice123 committed Dec 18, 2017
1 parent 68cfbc4 commit df5c270
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 176 deletions.
17 changes: 5 additions & 12 deletions LWOTC_WeaponPack/Config/XComLongWar_WeaponPack_Abilities.ini
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
[LWOTC_WeaponPack.X2Ability_SMGAbilities]
SMG_CONVENTIONAL_MOBILITY_BONUS = 3
SMG_LASER_MOBILITY_BONUS=3
SMG_MAGNETIC_MOBILITY_BONUS = 3
SMG_COIL_MOBILITY_BONUS = 3
SMG_BEAM_MOBILITY_BONUS = 3

SMG_CONVENTIONAL_DETECTIONRADIUSMODIFER = 0.2f
SMG_LASER_DETECTIONRADIUSMODIFER=0.2f
SMG_MAGNETIC_DETECTIONRADIUSMODIFER = 0.2f
SMG_COIL_DETECTIONRADIUSMODIFER = 0.2f
SMG_BEAM_DETECTIONRADIUSMODIFER = 0.2f
SMG_Mobility_Bonus = 3
SMG_Detection_Radius_Modifier = 0.2f
SMG_Mobility_Bonus_Icon = "gfxXComIcons.NanofiberVest"

[LWOTC_WeaponPack.X2Ability_BattleRifleAbilities]
BattleRifle_MobilityBonus= -1
BattleRifle_MobilityBonus_ImagePath="gfxXComIcons.NanofiberVest"

[LWOTC_WeaponPack.X2Ability_LMGAbilities]
LMG_AIM_BONUS_WHEN_NOT_SET_UP = -20
LMG_Aim_Bonus_When_Mounted = 20
Mount_LMG_Ability_Icon = "UILibrary_PerkIcons.UIPerk_pistoloverwatch"

[LWOTC_WeaponPack.X2Ability_SAWAbilities]
SAW_Mobility_Bonus = 1
Expand Down
3 changes: 3 additions & 0 deletions LWOTC_WeaponPack/LWOTC_WeaponPack.x2proj
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,9 @@
<Content Include="Src\LWOTC_WeaponPack\Classes\X2Ability_SMGAbilities.uc">
<SubType>Content</SubType>
</Content>
<Content Include="Src\LWOTC_WeaponPack\Classes\X2Ability_SAWAbilities.uc">
<SubType>Content</SubType>
</Content>
<Content Include="Src\LWOTC_WeaponPack\Classes\X2DownloadableContentInfo_LWOTCWeaponPack.uc">
<SubType>Content</SubType>
</Content>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
class X2Ability_LMGAbilities extends X2Ability_DefaultAbilitySet
dependson (XComGameStateContext_Ability) config(LongWar_WeaponPack_Abilities);

var config int LMG_AIM_BONUS_WHEN_NOT_SET_UP;
var config int LMG_Aim_Bonus_When_Mounted;
var config string Mount_LMG_Ability_Icon;

var name MountedEffectName;
var name MountLMGAbility;

DefaultProperties
{
MountLMGAbility="MountLMGAbility"
MountedEffectName="MountLMG"
}

Expand All @@ -30,13 +33,13 @@ static function X2AbilityTemplate AddLMG_MountAbility()
local X2Condition_UnitEffects MountedCondition;
local X2Effect_Squadsight Squadsight;

`CREATE_X2ABILITY_TEMPLATE(Template, default.MountedEffectName);
`CREATE_X2ABILITY_TEMPLATE(Template, default.MountLMGAbility);

Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilitySourceName = 'eAbilitySource_Item';
Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_ShowIfAvailable;
Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_pistoloverwatch";
Template.IconImage = "img:///" $ default.Mount_LMG_Ability_Icon;
Template.ShotHUDPriority = 150;
Template.bDisplayInUITooltip = false;
Template.bDisplayInUITacticalText = false;
Expand Down Expand Up @@ -64,7 +67,7 @@ static function X2AbilityTemplate AddLMG_MountAbility()
PersistentStatChangeEffect = new class'X2Effect_PersistentStatChange';
PersistentStatChangeEffect.EffectName = default.MountedEffectName;
PersistentStatChangeEffect.BuildPersistentEffect(1, true, true, false);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_Offense, 20);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_Offense, default.LMG_Aim_Bonus_When_Mounted);
PersistentStatChangeEffect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage,,,Template.AbilitySourceName);
Template.AddTargetEffect(PersistentStatChangeEffect);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ class X2Ability_LongWatchAbilities extends X2Ability_DefaultAbilitySet
var name ToggleLongWatchEffect;
var name LongOverwatchReserveActionPoint;

var name ToggleLongWatchAbility;
var name ToggleLongWatchShotAbility;

DefaultProperties
{
ToggleLongWatchAbility="ToggleLongWatchAbility"
ToggleLongWatchShotAbility="ToggleLongWatchShotAbility"
ToggleLongWatchEffect="ToggleLongWatch"
LongOverwatchReserveActionPoint="ToggleLongWatchShot"
}
Expand Down Expand Up @@ -34,8 +39,7 @@ static function X2AbilityTemplate ToggleLongWatch()
local X2Condition_UnitEffects SuppressedCondition;
local X2Condition_UnitEffects RequireToggleCondition;

// `CREATE_X2ABILITY_TEMPLATE(Template, 'ToggleLongWatch');
`CREATE_X2ABILITY_TEMPLATE(Template, default.ToggleLongWatchEffect);
`CREATE_X2ABILITY_TEMPLATE(Template, default.ToggleLongWatchAbility);

AmmoCost = new class'X2AbilityCost_Ammo';
AmmoCost.iAmmo = 1;
Expand Down Expand Up @@ -129,8 +133,7 @@ static function X2AbilityTemplate ToggleLongWatchShot()
local X2Condition_Visibility TargetVisibilityCondition;


//`CREATE_X2ABILITY_TEMPLATE(Template, 'ToggleLongWatchShot');
`CREATE_X2ABILITY_TEMPLATE(Template, default.LongOverwatchReserveActionPoint);
`CREATE_X2ABILITY_TEMPLATE(Template, default.ToggleLongWatchShotAbility);

AmmoCost = new class'X2AbilityCost_Ammo';
AmmoCost.iAmmo = 1;
Expand Down
165 changes: 15 additions & 150 deletions LWOTC_WeaponPack/Src/LWOTC_WeaponPack/Classes/X2Ability_SMGAbilities.uc
Original file line number Diff line number Diff line change
@@ -1,165 +1,31 @@
class X2Ability_SMGAbilities extends X2Ability
dependson (XComGameStateContext_Ability) config(LongWar_WeaponPack_Abilities);

// ***** Mobility bonuses for SMGs
var config int SMG_CONVENTIONAL_MOBILITY_BONUS;
var config int SMG_LASER_MOBILITY_BONUS;
var config int SMG_MAGNETIC_MOBILITY_BONUS;
var config int SMG_COIL_MOBILITY_BONUS;
var config int SMG_BEAM_MOBILITY_BONUS;
var config int SMG_Mobility_Bonus;
var config float SMG_Detection_Radius_Modifier;
var config string SMG_Mobility_Bonus_Icon;

// *****DetectionRadius bonuses for SMGs
var config float SMG_CONVENTIONAL_DETECTIONRADIUSMODIFER;
var config float SMG_LASER_DETECTIONRADIUSMODIFER;
var config float SMG_MAGNETIC_DETECTIONRADIUSMODIFER;
var config float SMG_COIL_DETECTIONRADIUSMODIFER;
var config float SMG_BEAM_DETECTIONRADIUSMODIFER;
var name SMGBonusAbility;

/// <summary>
/// Creates the abilities that add passive Mobility for SMGs
/// </summary>
static function array<X2DataTemplate> CreateTemplates()
{
local array<X2DataTemplate> Templates;

Templates.AddItem(AddSMGConventionalBonusAbility());
Templates.AddItem(AddSMGMagneticBonusAbility());
Templates.AddItem(AddSMGCoilBonusAbility());
Templates.AddItem(AddSMGBeamBonusAbility());
Templates.AddItem(AddSMGLaserBonusAbility());

return Templates;
}

// ******************* Stat Bonuses **********************

static function X2AbilityTemplate AddSMGConventionalBonusAbility()
{
local X2AbilityTemplate Template;
local X2Effect_PersistentStatChange PersistentStatChangeEffect;

`CREATE_X2ABILITY_TEMPLATE(Template, 'SMG_CV_StatBonus');
Template.IconImage = "img:///gfxXComIcons.NanofiberVest"; // TODO : replace with SMG Bonus HP icon? may not need, since icon is hidden

Template.AbilitySourceName = 'eAbilitySource_Item';
Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;
Template.bDisplayInUITacticalText = false;

Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);

// Bonus to Mobility and DetectionRange stat effects
PersistentStatChangeEffect = new class'X2Effect_PersistentStatChange';
PersistentStatChangeEffect.BuildPersistentEffect(1, true, false, false);
PersistentStatChangeEffect.SetDisplayInfo(ePerkBuff_Passive, "", "", Template.IconImage, false,,Template.AbilitySourceName);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_Mobility, default.SMG_CONVENTIONAL_MOBILITY_BONUS);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_DetectionModifier, default.SMG_CONVENTIONAL_DETECTIONRADIUSMODIFER);
Template.AddTargetEffect(PersistentStatChangeEffect);

Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;

return Template;
}

static function X2AbilityTemplate AddSMGLaserBonusAbility()
{
local X2AbilityTemplate Template;
local X2Effect_PersistentStatChange PersistentStatChangeEffect;

`CREATE_X2ABILITY_TEMPLATE(Template, 'SMG_LS_StatBonus');
Template.IconImage = "img:///gfxXComIcons.NanofiberVest"; // TODO : replace with SMG Bonus HP icon? may not need, since icon is hidden

Template.AbilitySourceName = 'eAbilitySource_Item';
Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;
Template.bDisplayInUITacticalText = false;

Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);

// Bonus to Mobility and DetectionRange stat effects
PersistentStatChangeEffect = new class'X2Effect_PersistentStatChange';
PersistentStatChangeEffect.BuildPersistentEffect(1, true, false, false);
PersistentStatChangeEffect.SetDisplayInfo(ePerkBuff_Passive, "", "", Template.IconImage, false,,Template.AbilitySourceName);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_Mobility, default.SMG_LASER_MOBILITY_BONUS);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_DetectionModifier, default.SMG_LASER_DETECTIONRADIUSMODIFER);
Template.AddTargetEffect(PersistentStatChangeEffect);

Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;

return Template;
}

static function X2AbilityTemplate AddSMGMagneticBonusAbility()
DefaultProperties
{
local X2AbilityTemplate Template;
local X2Effect_PersistentStatChange PersistentStatChangeEffect;

`CREATE_X2ABILITY_TEMPLATE(Template, 'SMG_MG_StatBonus');
Template.IconImage = "img:///gfxXComIcons.NanofiberVest"; // TODO : replace with SMG Bonus HP icon? may not need, since icon is hidden

Template.AbilitySourceName = 'eAbilitySource_Item';
Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;
Template.bDisplayInUITacticalText = false;

Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);

// Bonus to Mobility and DetectionRange stat effects
PersistentStatChangeEffect = new class'X2Effect_PersistentStatChange';
PersistentStatChangeEffect.BuildPersistentEffect(1, true, false, false);
PersistentStatChangeEffect.SetDisplayInfo(ePerkBuff_Passive, "", "", Template.IconImage, false,,Template.AbilitySourceName);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_Mobility, default.SMG_MAGNETIC_MOBILITY_BONUS);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_DetectionModifier, default.SMG_MAGNETIC_DETECTIONRADIUSMODIFER);
Template.AddTargetEffect(PersistentStatChangeEffect);

Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;

return Template;
SMGBonusAbility="SMGBonusAbility"
}

static function X2AbilityTemplate AddSMGCoilBonusAbility()
static function array<X2DataTemplate> CreateTemplates()
{
local X2AbilityTemplate Template;
local X2Effect_PersistentStatChange PersistentStatChangeEffect;

`CREATE_X2ABILITY_TEMPLATE(Template, 'SMG_CG_StatBonus');
Template.IconImage = "img:///gfxXComIcons.NanofiberVest";

Template.AbilitySourceName = 'eAbilitySource_Item';
Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
Template.Hostility = eHostility_Neutral;
Template.bDisplayInUITacticalText = false;

Template.AbilityToHitCalc = default.DeadEye;
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);

// Bonus to Mobility and DetectionRange stat effects
PersistentStatChangeEffect = new class'X2Effect_PersistentStatChange';
PersistentStatChangeEffect.BuildPersistentEffect(1, true, false, false);
PersistentStatChangeEffect.SetDisplayInfo(ePerkBuff_Passive, "", "", Template.IconImage, false,,Template.AbilitySourceName);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_Mobility, default.SMG_COIL_MOBILITY_BONUS);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_DetectionModifier, default.SMG_COIL_DETECTIONRADIUSMODIFER);
Template.AddTargetEffect(PersistentStatChangeEffect);

Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;

return Template;
local array<X2DataTemplate> Templates;
Templates.AddItem(AddSMGBonusAbility());
return Templates;
}

static function X2AbilityTemplate AddSMGBeamBonusAbility()
static function X2AbilityTemplate AddSMGBonusAbility()
{
local X2AbilityTemplate Template;
local X2Effect_PersistentStatChange PersistentStatChangeEffect;

`CREATE_X2ABILITY_TEMPLATE(Template, 'SMG_BM_StatBonus');
Template.IconImage = "img:///gfxXComIcons.NanofiberVest"; // TODO : replace with SMG Bonus HP icon? may not need, since icon is hidden
`CREATE_X2ABILITY_TEMPLATE(Template, default.SMGBonusAbility);
Template.IconImage = "img:///" $ default.SMG_Mobility_Bonus_Icon;

Template.AbilitySourceName = 'eAbilitySource_Item';
Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
Expand All @@ -170,12 +36,11 @@ static function X2AbilityTemplate AddSMGBeamBonusAbility()
Template.AbilityTargetStyle = default.SelfTarget;
Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);

// Bonus to Mobility and DetectionRange stat effects
PersistentStatChangeEffect = new class'X2Effect_PersistentStatChange';
PersistentStatChangeEffect.BuildPersistentEffect(1, true, false, false);
PersistentStatChangeEffect.SetDisplayInfo(ePerkBuff_Passive, "", "", Template.IconImage, false,,Template.AbilitySourceName);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_Mobility, default.SMG_BEAM_MOBILITY_BONUS);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_DetectionModifier, default.SMG_BEAM_DETECTIONRADIUSMODIFER);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_Mobility, default.SMG_Mobility_Bonus);
PersistentStatChangeEffect.AddPersistentStatChange(eStat_DetectionModifier, default.SMG_Detection_Radius_Modifier);
Template.AddTargetEffect(PersistentStatChangeEffect);

Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ static function Create_LMG_Template(out X2WeaponTemplate Template, int tier)
Template.Abilities.AddItem('OverwatchShot');
Template.Abilities.AddItem('Reload');
Template.Abilities.AddItem('HotLoadAmmo');
Template.Abilities.AddItem(class'X2Ability_LMGAbilities'.default.MountedEffectName);
Template.Abilities.AddItem(class'X2Ability_LongWatchAbilities'.default.LongOverwatchReserveActionPoint);
Template.Abilities.AddItem(class'X2Ability_LongWatchAbilities'.default.ToggleLongWatchEffect);
Template.Abilities.AddItem(class'X2Ability_LMGAbilities'.default.MountLMGAbility);
Template.Abilities.AddItem(class'X2Ability_LongWatchAbilities'.default.ToggleLongWatchAbility);
Template.Abilities.AddItem(class'X2Ability_LongWatchAbilities'.default.ToggleLongWatchShotAbility);

//Stats
Template.BaseDamage = default.LMG_Damage[tier];
Template.Aim = default.LMG_Aim[tier] + class'X2Ability_LMGAbilities'.default.LMG_AIM_BONUS_WHEN_NOT_SET_UP;
Template.Aim = default.LMG_Aim[tier] - class'X2Ability_LMGAbilities'.default.LMG_Aim_Bonus_When_Mounted;
Template.CritChance = default.LMG_CritChance[tier];
Template.iClipSize = default.LMG_ClipSize[tier];
Template.iSoundRange = default.LMG_SoundRange[tier];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ static function Create_SMG_Template(out X2WeaponTemplate Template, int tier)
Template.Abilities.AddItem('OverwatchShot');
Template.Abilities.AddItem('Reload');
Template.Abilities.AddItem('HotLoadAmmo');
Template.Abilities.AddItem('SMG_CV_StatBonus');
Template.SetUIStatMarkup(class'XLocalizedData'.default.MobilityLabel, eStat_Mobility, class'X2Ability_SMGAbilities'.default.SMG_CONVENTIONAL_MOBILITY_BONUS);
Template.Abilities.AddItem(class'X2Ability_SMGAbilities'.default.SMGBonusAbility);
Template.SetUIStatMarkup(class'XLocalizedData'.default.MobilityLabel, eStat_Mobility, class'X2Ability_SMGAbilities'.default.SMG_Mobility_Bonus);

//Stats
Template.BaseDamage = default.SMG_Damage[tier];
Expand Down

0 comments on commit df5c270

Please sign in to comment.