Skip to content

Commit

Permalink
feat(Scaffold/GodBridge): random sneak time (#5664)
Browse files Browse the repository at this point in the history
  • Loading branch information
MukjepScarlet authored Feb 20, 2025
1 parent dd9506d commit eb6a2bf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ object ScaffoldGodBridgeTechnique : ScaffoldTechnique("GodBridge"), ScaffoldLedg

private var mode by enumChoice("Mode", Mode.JUMP)
private var forceSneakBelowCount by int("ForceSneakBelowCount", 3, 0..10)
private var sneakTime by int("SneakTime", 1, 1..10)
private val sneakTime by intRange("SneakTime", 1..1, 1..10)

override fun ledge(
target: BlockPlacementTarget?,
Expand Down Expand Up @@ -103,16 +103,16 @@ object ScaffoldGodBridgeTechnique : ScaffoldTechnique("GodBridge"), ScaffoldLedg
// we need to prevent the player from falling off the ledge e.g by jumping or sneaking.
when {
ModuleScaffold.blockCount < forceSneakBelowCount -> {
LedgeAction(sneakTime = this@ScaffoldGodBridgeTechnique.sneakTime)
LedgeAction(sneakTime = sneakTime.random())
}
mode == Mode.JUMP -> LedgeAction(jump = true)
mode == Mode.SNEAK -> LedgeAction(sneakTime = this@ScaffoldGodBridgeTechnique.sneakTime)
mode == Mode.SNEAK -> LedgeAction(sneakTime = sneakTime.random())
mode == Mode.STOP_INPUT -> LedgeAction(stopInput = true)
mode == Mode.BACKWARDS -> LedgeAction(stepBack = true)
mode == Mode.RANDOM -> if (Random.nextBoolean()) {
LedgeAction(jump = true, sneakTime = 0)
} else {
LedgeAction(jump = false, sneakTime = this@ScaffoldGodBridgeTechnique.sneakTime)
LedgeAction(jump = false, sneakTime = sneakTime.random())
}
else -> LedgeAction.NO_LEDGE
}
Expand Down

0 comments on commit eb6a2bf

Please sign in to comment.