Advertisement
FireWolf3000

Lockpicky Final

Oct 25th, 2020 (edited)
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.56 KB | None | 0 0
  1. scn bonfireLockOnCrosshairUDF
  2.  
  3. ref rMaybeLocked
  4.  
  5. int iPlayerLockpick
  6. int iLockDifficulty
  7. float fDifficultyMult
  8. int iResultMult
  9. float fBonusHealth
  10. float fConcentric
  11.  
  12. begin Function {rMaybeLocked}
  13. if rMaybeLocked.GetLocked == 1
  14.  
  15. let iPlayerLockpick := Player.GetAV Lockpick
  16. let iLockDifficulty := rMaybeLocked.GetLockLevel
  17. print "Started script"
  18.  
  19. ;;; ! BELOW IS THE CODE FOR THE BASIC SCALING DIFFICULTY !
  20. ;;; In summary, for every POINT of Skill the Player misses the Lock check by, the difficulty scales linearly
  21.  
  22. set iResultMult to iPlayerLockpick - iLockDifficulty
  23.  
  24. set fDifficultyMult to iResultMult / 100
  25.  
  26. print "scaling is done"
  27.  
  28. ;;; Max that this can reach in regular gameplay appears to be -0.99 to 0.99
  29. ;;; Negative also means harder, which might need to be swapped so equations make sense(?)
  30.  
  31. ;;; ! BELOW IS THE CODE FOR THE STEPPING DIFFICULTY !
  32. ;;; Basically means that for every LEVEL of Skill the Player misses a Lock by, the difficulty increases more than the formula alone
  33.  
  34. if iLockDifficulty > iPlayerLockpick
  35. if ( (iPlayerLockpick - iLockDifficulty) <= -25 ) && ( (iPlayerLockpick - iLockDifficulty) > -50 )
  36. let fDifficultyMult *= 0.75 ;(25% harder)
  37.  
  38. elseif ( (iPlayerLockpick - iLockDifficulty) <= -50 ) && ( (iPlayerLockpick - iLockDifficulty) > -75 )
  39. let fDifficultyMult *= 0.50 ;(50% harder)
  40.  
  41. elseif ( (iPlayerLockpick - iLockDifficulty) <= -75 ) && ( (iPlayerLockpick - iLockDifficulty) > -100 )
  42. let fDifficultyMult *= 0.25 ;(75% harder)
  43. endif
  44.  
  45. elseif iPlayerLockpick > iLockDifficulty
  46. if ( (iPlayerLockpick - iLockDifficulty) >= 25 ) && ( (iPlayerLockpick - iLockDifficulty) < 50 )
  47. let fDifficultyMult *= 1.15 ;(15% easier)
  48.  
  49. elseif ( (iPlayerLockpick - iLockDifficulty) >= 50 ) && ( (iPlayerLockpick - iLockDifficulty) < 75 )
  50. let fDifficultyMult *= 1.35 ;(35% easier)
  51.  
  52. elseif ( (iPlayerLockpick - iLockDifficulty) >= 75 ) && ( (iPlayerLockpick - iLockDifficulty) < 100 )
  53. let fDifficultyMult *= 1.50 ;(50% easier)
  54. endif
  55.  
  56. endif
  57.  
  58. print "leveled scaling is done"
  59.  
  60. ;;; ! BELOW LIES SPECIAL DIRECTIONS FOR EACH LOCK LEVEL !
  61. ;;; To be frank, no idea what this will do yet... will update in the future if anything is done here
  62. ;; Idea is that this would handle basic balancing of each Lock's general level (say if the Player meets the req nearly exactly)
  63.  
  64. if iLockDifficulty == 0 ;very easy
  65. ;code
  66.  
  67. elseif iLockDifficulty == 25 ;easy
  68. ;code
  69.  
  70. elseif iLockDifficulty == 50 ;average
  71. ;code
  72.  
  73. elseif iLockDifficulty == 75 ;hard
  74. ;code
  75.  
  76. elseif iLockDifficulty == 100 ;very hard
  77. ;code
  78.  
  79. elseif iLockDifficulty > 100 ;impossible
  80. ;code
  81.  
  82. endif
  83.  
  84. ;;; ! BELOW LIES THE FINAL TALLY GAMEPLAY MULTS !
  85.  
  86. let fBonusHealth := (GetNumericGameSetting fLockpickBonusHealth)
  87. let fBonusHealth *= (fDifficultyMult * 1)
  88. SetNumericGameSetting fLockpickBonusHealth fBonusHealth
  89. print "Gave the lockpick bonus health!"
  90.  
  91. let fConcentric := (200 * (fDifficultyMult * 2.25) )
  92. if fConcentric < 150
  93. let fConcentric := 150
  94. endif
  95.  
  96. SetNumericINISetting iConcentricLengthMaxVeryEasy fConcentric
  97. SetNumericINISetting iConcentricLengthMaxEasy fConcentric
  98. SetNumericINISetting iConcentricLengthMaxAverage fConcentric
  99. SetNumericINISetting iConcentricLengthMaxHard fConcentric
  100. SetNumericINISetting iConcentricLengthMaxVeryHard fConcentric
  101.  
  102. SetNumericINISetting iConcentricLengthMinVeryEasy fConcentric
  103. SetNumericINISetting iConcentricLengthMinEasy fConcentric
  104. SetNumericINISetting iConcentricLengthMinAverage fConcentric
  105. SetNumericINISetting iConcentricLengthMinHard fConcentric
  106. SetNumericINISetting iConcentricLengthMinVeryHard fConcentric
  107. print "Adjusted the concentrics!"
  108.  
  109. ;iLockDifficulty will look like this:
  110. ;0 = very easy
  111. ;25 = easy
  112. ;50 = average
  113. ;75 = hard
  114. ;100 = very hard
  115. ;255 = impossible
  116.  
  117. ;;;;;;LIST OF GAMESETTINGS YOU MAY WANT TO TWEAK HERE, BASED OFF SKILL + LOCKPICK DIFFICULTY (some may be unused)
  118.  
  119. ;Note that some settings may not update properly while in this menu; you may have to switch implementation entirely.
  120.  
  121. ;SetNumericGameSetting fLockpickBonusHealth ;??? ;default value = 0.01 ;seems to be used
  122. ;SetNumericGameSetting fLockPickBreakBase ;??? ;default = 0.05
  123. ;SetNumericGameSetting fLockPickBreakMult ;??? ;default = -0.001
  124. ;fLockPickQualityBase
  125. ;fLockPickQualityMult
  126. ;fLockLevelBase - unused
  127. ;fLockLevelMult - unused
  128. ;fLockSkillBase
  129. ;fLockSkillMult - unused
  130. ;fLockpickBonusHealth
  131. ;fLockPickBreakBase - unused
  132. ;fLockPickBreakMult - unused
  133. ;fLockPickQualityBase - unused
  134. ;fLockPickQualityMult - unused
  135. ;fLockTrapGoOffBase - unused
  136. ;fLockTrapGoOffMult - unused
  137.  
  138. ;fPickBreakSecs ;default = 1.00
  139.  
  140. ;;;;;;LIST OF INI SETTINGS, MUST USE GET/ SETINI STRING/ FLOAT
  141.  
  142. ;iSweetSpotLengthMinVeryEasy - 400
  143. ;iSweetSpotLengthMinEasy - 200
  144. ;iSweetSpotLengthMinAverage - 100
  145. ;iSweetSpotLengthMinHard - 50
  146. ;iSweetSpotLengthMinVeryHard - 25
  147.  
  148. ;iSweetSpotLengthMaxVeryEasy - 400
  149. ;iSweetSpotLengthMaxEasy - 200
  150. ;iSweetSpotLengthMaxAverage - 100
  151. ;iSweetSpotLengthMaxHard - 50
  152. ;iSweetSpotLengthMaxVeryHard - 25
  153.  
  154. ;iConcentricLengthMinVeryEasy - 200
  155. ;iConcentricLengthMinEasy - 200
  156. ;iConcentricLengthMinAverage - 200
  157. ;iConcentricLengthMinHard - 200
  158. ;iConcentricLengthMinVeryHard - 200
  159.  
  160. ;iConcentricLengthMaxVeryEasy - 200
  161. ;iConcentricLengthMaxEasy - 200
  162. ;iConcentricLengthMaxAverage - 200
  163. ;iConcentricLengthMaxHard - 200
  164. ;iConcentricLengthMaxVeryHard - 200
  165.  
  166. endif
  167. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement