Skip to content

Commit

Permalink
Example banish
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackDog86 committed Jan 6, 2025
1 parent 3ce4635 commit 7b9427d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,11 @@ simulated function UpdateReaperHUD()

SuperConcealedModifier += UnitState.SuperConcealmentLoss;

if (SelectedAbilityState.GetMyTemplate().ConcealmentRule == eConceal_Never)
{
SuperConcealedModifier = 100;
}

if (SuperConcealedModifier > 100)
SuperConcealedModifier = 100;
if (SuperConcealedModifier < 0)
Expand All @@ -1499,7 +1504,7 @@ simulated function UpdateReaperHUD()
if (!class'Helpers'.static.IsObjectiveTarget(CurrentTargetID))
{
WeaponState = SelectedAbilityState.GetSourceWeapon();
if (WeaponState != none && WeaponState.InventorySlot == eInvSlot_PrimaryWeapon)
if (WeaponState != none && WeaponState.InventorySlot == eInvSlot_PrimaryWeapon && SelectedAbilityState.GetMyTemplate().ConcealmentRule != eConceal_Never)
{
if (SuperConcealedModifier > class'X2AbilityTemplateManager'.default.SuperConcealShotMax)
SuperConcealedModifier = class'X2AbilityTemplateManager'.default.SuperConcealShotMax;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1153,14 +1153,15 @@ static function X2AbilityTemplate SoulReaper()
Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;
Template.BuildInterruptGameStateFn = TypicalAbility_BuildInterruptGameState;
Template.SuperConcealmentLoss = 0;
//Template.SuperConcealmentLoss = 0;

Template.AdditionalAbilities.AddItem('SoulReaperContinue');
Template.PostActivationEvents.AddItem('SoulReaperContinue');

// this ability will always break concealment at the end and we don't want to roll on it
Template.ConcealmentRule = eConceal_Always;
Template.SuperConcealmentLoss = 0;
// We now want to roll on this
Template.ConcealmentRule = eConceal_Never;
//Template.SuperConcealmentLoss = 0;
Template.ChosenActivationIncreasePerUse = class'X2AbilityTemplateManager'.default.StandardShotChosenActivationIncreasePerUse;
Template.LostSpawnIncreasePerUse = class'X2AbilityTemplateManager'.default.StandardShotLostSpawnIncreasePerUse;
//BEGIN AUTOGENERATED CODE: Template Overrides 'SoulReaper'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3367,10 +3367,10 @@ function EventListenerReturn SoulReaperListener(Object EventData, Object EventSo
bAbilityContinues = AbilityTriggerAgainstSingleTarget(BestTargetRef, false);
}
}
if (!bAbilityContinues)
{
SourceUnit.BreakConcealment();
}
//if (!bAbilityContinues)
//{
// SourceUnit.BreakConcealment();
//}
}
return ELR_NoInterrupt;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9658,7 +9658,11 @@ function EventListenerReturn OnAbilityActivated(Object EventData, Object EventSo
// handle changing the existing modifier if necessary
SourceUnitState = XComGameState_Unit(History.GetGameStateForObjectID(ActivatedAbilityStateContext.InputContext.SourceObject.ObjectID));
SuperConcealedModifier = SourceUnitState.GetSuperConcealedModifier( ActivatedAbilityState, GameState );

// Over-ride for never conceal abilities so they can still use the HUD
if (ActivatedAbilityState.GetMyTemplate().ConcealmentRule == eConceal_Never)
{
SuperConcealedModifier = 100;
}
if (SuperConcealedModifier > 0)
{
SuperConcealedState = class'XComGameStateContext_ChangeContainer'.static.CreateChangeState("SuperConcealmentLossChance Modified");
Expand All @@ -9671,7 +9675,8 @@ function EventListenerReturn OnAbilityActivated(Object EventData, Object EventSo
if (!class'Helpers'.static.IsObjectiveTarget(ActivatedAbilityStateContext.InputContext.PrimaryTarget.ObjectID, GameState))
{
WeaponState = ActivatedAbilityState.GetSourceWeapon();
if (WeaponState != none && WeaponState.InventorySlot == eInvSlot_PrimaryWeapon && ActivatedAbilityState.IsAbilityInputTriggered())
// Don't cap the HUD if the ability is explicity set to eConceal_Never
if (WeaponState != none && WeaponState.InventorySlot == eInvSlot_PrimaryWeapon && ActivatedAbilityState.IsAbilityInputTriggered() && ActivatedAbilityState.GetMyTemplate().ConcealmentRule != eConceal_Never)
{


Expand Down

0 comments on commit 7b9427d

Please sign in to comment.