Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bubble.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *Simulator) applyBubbleColumns(state *MovementState) {
}

func (s *Simulator) attemptRiptide(state *MovementState, touchingWater bool) bool {
if s.Equipment == nil || state.RiptideTicks > 0 || !state.RiptideReady || (!touchingWater && !state.RiptideInRain) {
if s.Equipment == nil || state.InVehicle || state.RiptideTicks > 0 || !state.RiptideReady || (!touchingWater && !state.RiptideInRain) {
return false
}
level := s.Equipment.EnchantmentLevel(EnchantmentRiptide)
Expand Down
16 changes: 16 additions & 0 deletions bubble_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,22 @@ func TestRiptideDoesNotLaunchWhileFlying(t *testing.T) {
}
}

func TestRiptideDoesNotLaunchWhileMounted(t *testing.T) {
w := environmentWorld{blocks: map[cube.Pos]world.Block{{0, 0, 0}: block.Water{Still: true, Depth: 8}}}
sim := &Simulator{World: w, Equipment: fixedEquipment{EnchantmentRiptide: 2}}
state := newBaseState()
state.Pos = mgl32.Vec3{0.5, 0, 0.5}
state.Gravity = NormalGravity
state.InVehicle = true
state.RiptideReady = true

sim.Simulate(state, InputState{StartSpinAttack: true})

if state.RiptideTicks != 0 {
t.Fatalf("expected mounted player not to start riptide, got %d ticks", state.RiptideTicks)
}
}

func TestRiptideRequiresValidatedTridentRelease(t *testing.T) {
w := environmentWorld{blocks: map[cube.Pos]world.Block{{0, 0, 0}: block.Water{Still: true, Depth: 8}}}
sim := &Simulator{World: w, Equipment: fixedEquipment{EnchantmentRiptide: 2}}
Expand Down
3 changes: 3 additions & 0 deletions movement.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ type MovementState struct {
// RiptideInRain is server-observed weather exposure that permits a
// validated Riptide release without direct block-water contact.
RiptideInRain bool
// InVehicle is server-authoritative mounted state. Riptide cannot start
// while the player is riding a vehicle.
InVehicle bool

Flying, MayFly, TrustFlyStatus bool
JustDisabledFlight bool
Expand Down