-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Potion of Oblivion (1st Attempt)
Remove FE flags from a character when they drink Potion of Oblivion, so that if they re-take the FE Perk, they will be able to refund the point again.
- Loading branch information
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
mod_legends_favoured_enemy_refund/hooks/entity/tactical/actor/actor.nut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
::mods_hookExactClass("entity/tactical/actor", function(o) { | ||
|
||
local old_resetPerks = o.resetPerks; | ||
|
||
o.resetPerks = function(){ | ||
|
||
old_resetPerks(); | ||
|
||
// Remove all flags related to Favoured Enemy Perks | ||
local flags = this.getFlags(); | ||
foreach (flag in flags.m) { | ||
if (flag.Key.find("favoured_enemy") != null) { | ||
::LegendsFavouredEnemyRefund.Mod.Debug.printLog("Removing flag \"" + flag.Key + "\" for " + this.getName()); | ||
flags.remove(flag.Key); | ||
} | ||
} | ||
|
||
}; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters