Skip to content

Commit

Permalink
minor tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
mort65 committed Jul 11, 2024
1 parent dd65651 commit 8ae7224
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 6 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ function PlayerLoadsGame(Bool bForce = False)
bChecked = True
endfunction

Int Function iAddRandomKeyToActor(ObjectReference akRef, Int aiNum = 1)
Int Function iAddRandomDDKeyToRef(ObjectReference akRef, Int aiNum = 1)
return 0
endfunction

state Installed
Int Function iAddRandomKeyToActor(ObjectReference akRef, Int aiNum = 1)
return zzzmrt_sp_int_ddi._iAddRandomKeyToActor(akRef, ddkeys, aiNum)
Int Function iAddRandomDDKeyToRef(ObjectReference akRef, Int aiNum = 1)
return zzzmrt_sp_int_ddi._iAddRandomKeyToRef(akRef, ddkeys, aiNum)
endfunction
endState
2 changes: 1 addition & 1 deletion Simple Prostitution/Scripts/Source/zzzmrt_sp_int_ddi.psc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Scriptname zzzmrt_sp_int_ddi Hidden


Int function _iAddRandomKeyToActor(ObjectReference akRef, Form[] akeyArr, Int aiNum = 1) Global
Int function _iAddRandomKeyToRef(ObjectReference akRef, Form[] akeyArr, Int aiNum = 1) Global
if (aiNum < 1) || (akeyArr.Length < 1)
return 0
endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ Float function getBaseVersion()
endfunction

Float function getCurrentVersion()
return getBaseVersion() + 0.21
return getBaseVersion() + 0.22
endfunction

Function persuade(Float fSpeechSkillMult)
Expand Down Expand Up @@ -1895,7 +1895,7 @@ Bool function GetDibellanRewards(Int aiMessage=0, Int aiButton=0)
DibelOfferMenu_InsufficientMark.Show(fDDKeyCost as Int, iMarkCount)
aiMessage = 0
elseif DibelOfferMenu_Confirm_DDKey.Show(fDDKeyCost as Int, fDDKeyIncrement as Int) == 0
int iTotal = DDI_Interface.iAddRandomKeyToActor(player, fDDKeyIncrement as Int)
int iTotal = DDI_Interface.iAddRandomDDKeyToRef(player, fDDKeyIncrement as Int)
if iTotal > 0
MCMScript.iTotalDDKeyRecieved += iTotal
player.removeItem(dibelMark, fDDKeyCost as Int)
Expand Down
28 changes: 28 additions & 0 deletions Simple Prostitution/Scripts/Source/zzzmrt_sp_utility.psc
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,31 @@ Bool Function bSucessCalculator(float fSuccessPercent, int iRounds = 1) Global
endWhile
return False
EndFunction


Int function iAddRandomItemToRef(ObjectReference akRef, Form[] akItemArr, Int aiTotalToAdd = 1) Global
{Adds random forms from an array to an objectreference and returns how many added.}
if (aiTotalToAdd < 1) || (akItemArr.Length < 1)
return 0
endif
Int iResult = 0
Int iTotalItems = akItemArr.Length
Int[] itemNumToAdd = utility.createIntArray(iTotalItems, 0)
Int jIndex
Int iIndex = 0
while iIndex < aiTotalToAdd
jIndex = Utility.RandomInt(0, iTotalItems - 1)
itemNumToAdd[jIndex] = itemNumToAdd[jIndex] + 1
iIndex += 1
endWhile
iIndex = iTotalItems
While iIndex > 0
iIndex -= 1
jIndex = itemNumToAdd[iIndex]
if akItemArr[iIndex] && jIndex > 0
akRef.Additem(akItemArr[iIndex], jIndex)
iResult += jIndex
endif
EndWhile
return iResult
EndFunction
Binary file modified Simple Prostitution/Scripts/zzzmrt_sp_ddi_interface.pex
Binary file not shown.
Binary file modified Simple Prostitution/Scripts/zzzmrt_sp_int_ddi.pex
Binary file not shown.
Binary file modified Simple Prostitution/Scripts/zzzmrt_sp_main_qst_script.pex
Binary file not shown.
Binary file modified Simple Prostitution/Scripts/zzzmrt_sp_mcm_qst_script.pex
Binary file not shown.
Binary file modified Simple Prostitution/Scripts/zzzmrt_sp_utility.pex
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 8ae7224

Please sign in to comment.