Renamed _00E_Game_SkillmenuSC to _00E_AffinityControl

This commit is contained in:
Eddoursul 2023-12-19 05:47:41 +01:00
parent 162085c155
commit dee35927cb
9 changed files with 24 additions and 23 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
Scriptname _00E_Game_SkillmenuSC extends ReferenceAlias
Scriptname _00E_AffinityControl extends ReferenceAlias Hidden
;
; ATTENTION
; this script contains a new affinity system that requires FS. Therefore, many elements in this script are redundant, as
@ -138,32 +138,13 @@ Function UpdateMajorSchool()
EndIf
EndFunction
int Function GetPointsInClass(Formlist akClassPerkformlist) Global
Actor PlREF = Game.GetForm(0x14) as Actor
Form[] perkForms = akClassPerkformlist.ToArray()
int PointsSpentInClass
int iClassIndex = 0
While iClassIndex < perkForms.Length
Perk iPerk = perkForms[iClassIndex] as Perk
If iPerk && PlREF.HasPerk(iPerk)
PointsSpentInClass += 1
EndIf
iClassIndex += 1
EndWhile
Return PointsSpentInClass
EndFunction
Int[] Function GetPerkDistribution()
Int[] PerkDistribution = Utility.CreateIntArray(PerkTree_Trees.Length, 0)
Int Index = 0
While Index < PerkTree_Trees.Length
If PerkTree_Trees[Index]
PerkDistribution[Index] = GetPointsInClass(PerkTree_Trees[Index])
PerkDistribution[Index] = _00E_Func_GetPointsInClass.Run(PerkTree_Trees[Index])
EndIf
Index += 1
EndWhile

View File

@ -0,0 +1,20 @@
Scriptname _00E_Func_GetPointsInClass Hidden
int Function Run(Formlist akClassPerkformlist) Global
Actor PlayerREF = Game.GetForm(0x14) as Actor
Form[] perkForms = akClassPerkformlist.ToArray()
int PointsSpentInClass
int iClassIndex = 0
While iClassIndex < perkForms.Length
Perk iPerk = perkForms[iClassIndex] as Perk
If iPerk && PlayerREF.HasPerk(iPerk)
PointsSpentInClass += 1
EndIf
iClassIndex += 1
EndWhile
Return PointsSpentInClass
EndFunction

View File

@ -227,4 +227,4 @@ ActorValueInfo AiLockpicking ; Vanilla - Lockpicking
ActorValueInfo AiSmithing ; Vanilla - Smithing
ActorValueInfo AiSpeechcraft ; Vanilla - Speechcraft
_00E_Game_SkillmenuSC Property AffinityAlias Auto
_00E_AffinityControl Property AffinityAlias Auto

View File

@ -1041,7 +1041,7 @@ bool Function RequirementsMetMemoryBook(int iTier, Perk Perk01, Perk Perk02, Per
ClassFormList03 = ManipulationPerks
EndIf
int iTotalPointsInRequiredClass = (_00E_Game_SkillmenuSC.GetPointsInClass(ClassFormList01) + _00E_Game_SkillmenuSC.GetPointsInClass(ClassFormList02) + _00E_Game_SkillmenuSC.GetPointsInClass(ClassFormList03))
int iTotalPointsInRequiredClass = (_00E_Func_GetPointsInClass.Run(ClassFormList01) + _00E_Func_GetPointsInClass.Run(ClassFormList02) + _00E_Func_GetPointsInClass.Run(ClassFormList03))
if iTotalPointsInRequiredClass >= iRequiredPoints
Return True
Else