Skip to content

Commit

Permalink
augs allow boosting past max level by moving boosting functionality i…
Browse files Browse the repository at this point in the history
…nto Augmentation class instead of AugmentationManager
  • Loading branch information
Die4Ever committed Jul 19, 2024
1 parent b75009f commit cea7b90
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 39 deletions.
11 changes: 11 additions & 0 deletions DXRBalance/DeusEx/Classes/AugMuscle.uc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ function PostPostBeginPlay()
Description = default.Description;
}

simulated function int GetClassLevel()
{
if (bHasIt && bIsActive)
{
// we squished the AugMuscle levels to make it more useful, and some things use the level instead of the strength
return CurrentLevel * 3;// aug levels start with 0
}
else
return -1;
}

// LevelValues only affect throwing velocity in vanilla, and in DXRando also DoJump
// otherwise vanilla uses GetClassLevel() + 2
defaultproperties
Expand Down
43 changes: 5 additions & 38 deletions DXRBalance/DeusEx/Classes/AugmentationManager.uc
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,7 @@ simulated function float GetAugLevelValue(class<Augmentation> AugClass)
{
if (anAug.Class == augClass)
{
if (anAug.bHasIt && anAug.bIsActive) {
anAug.TickUse();
if(Player.Energy <= 0 && anAug.bAutomatic) {
return -1.0;
} else {
return anAug.LevelValues[anAug.CurrentLevel];
}
}
else
return -1.0;
return anAug.GetAugLevelValue();
}

anAug = anAug.next;
Expand All @@ -131,15 +122,7 @@ simulated function int GetClassLevel(class<Augmentation> augClass)
{
if (anAug.Class == augClass)
{
if (anAug.bHasIt && anAug.bIsActive)
{
// we squished the AugMuscle levels to make it more useful, and some things use the level instead of the strength
if(AugMuscle(anAug) != None)
return anAug.CurrentLevel * 3;// aug levels start with 0
return anAug.CurrentLevel;
}
else
return -1;
return anAug.GetClassLevel();
}

anAug = anAug.next;
Expand Down Expand Up @@ -171,9 +154,9 @@ simulated function Float CalcEnergyUse(float deltaTime)
while(anAug != None)
{
if (AugPower(anAug) != None && anAug.bHasIt && anAug.bIsActive)
energyMult = anAug.LevelValues[anAug.CurrentLevel];
energyMult = anAug.GetAugLevelValue();
if (AugHeartLung(anAug) != None && anAug.bHasIt && anAug.bIsActive)
boostMult = anAug.LevelValues[anAug.CurrentLevel];
boostMult = anAug.GetAugLevelValue();

if (anAug.bHasIt && anAug.bIsActive)
{
Expand Down Expand Up @@ -208,22 +191,6 @@ function BoostAugs(bool bBoostEnabled, Augmentation augBoosting)
{
// Don't boost the augmentation causing the boosting!
if (anAug == augBoosting) continue;

// DXRando: don't boost free augs because (0 * synth_heart_strength) == 0
if (bBoostEnabled && anAug.energyRate > 0)
{
if (anAug.bIsActive && !anAug.bBoosted && (anAug.CurrentLevel < anAug.MaxLevel))
{
anAug.CurrentLevel++;
anAug.bBoosted = True;
anAug.Reset();
}
}
else if (anAug.bBoosted)
{
anAug.CurrentLevel--;
anAug.bBoosted = False;
anAug.Reset();
}
anAug.BoostAug(bBoostEnabled);
}
}
44 changes: 43 additions & 1 deletion DXRVanilla/DeusEx/Classes/Augmentation.uc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,48 @@ simulated function SetAutomatic()
}
}

simulated function float GetAugLevelValue()
{
if (bHasIt && bIsActive) {
TickUse();
if(Player.Energy <= 0 && bAutomatic) {
return -1.0;
} else {
return LevelValues[CurrentLevel];
}
}
else
return -1.0;
}

simulated function int GetClassLevel()
{
if (bHasIt && bIsActive)
return CurrentLevel;
else
return -1;
}

function BoostAug(bool bBoostEnabled)
{
// DXRando: don't boost free augs because (0 * synth_heart_strength) == 0
if (bBoostEnabled && energyRate > 0)
{
if (bIsActive && !bBoosted && CurrentLevel < MaxLevel)
{
CurrentLevel++;
bBoosted = True;
Reset();
}
}
else if (bBoosted && !bBoostEnabled)
{
CurrentLevel--;
bBoosted = False;
Reset();
}
}

simulated function bool IsTicked()
{
return (bAutomatic==false && bIsActive)
Expand All @@ -46,7 +88,7 @@ simulated function TickUse()
if(bAutomatic && !IsTicked()) {
// don't punish the player for auto aug turning off and immediately turning on again within the same one-second cycle
if(LastUsed < Level.TimeSeconds-1) {
Player.Energy -= energyRate/60.0;
Player.Energy -= energyRate/60.0;
}
if(Player.Energy <= 0) {
Player.Energy = 0;
Expand Down

1 comment on commit cea7b90

@Die4Ever
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.