aboutsummaryrefslogtreecommitdiff
path: root/client/player/controllable_player.gd
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-12-25 19:37:20 +0100
committermetamuffin <metamuffin@disroot.org>2024-12-25 20:01:43 +0100
commit4083df5cfe76e42506c5356cf23d3dc9f3b6e6bf (patch)
tree5ec12de003c38f0891c215721593c7ea49ff2c16 /client/player/controllable_player.gd
parent15be00667282a253fb438fec9d6347f5af89d9a0 (diff)
downloadhurrycurry-4083df5cfe76e42506c5356cf23d3dc9f3b6e6bf.tar
hurrycurry-4083df5cfe76e42506c5356cf23d3dc9f3b6e6bf.tar.bz2
hurrycurry-4083df5cfe76e42506c5356cf23d3dc9f3b6e6bf.tar.zst
variable hand count
Diffstat (limited to 'client/player/controllable_player.gd')
-rw-r--r--client/player/controllable_player.gd12
1 files changed, 6 insertions, 6 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd
index d241bc2e..99625762 100644
--- a/client/player/controllable_player.gd
+++ b/client/player/controllable_player.gd
@@ -190,13 +190,13 @@ func _on_vibration_timeout():
Input.vibrate_handheld(100, vibration_strength)
vibration_timer.start()
-func put_item(tile: Tile, h):
+func put_item(tile: Tile, h: int):
super(tile, h)
if Global.get_setting("gameplay.vibration"):
Input.start_joy_vibration(0, 0.1, 0.0, 0.075)
Input.vibrate_handheld(75, 0.1)
-func take_item(tile: Tile, h):
+func take_item(tile: Tile, h: int):
super(tile, h)
if Global.get_setting("gameplay.vibration"):
Input.start_joy_vibration(0, 0.1, 0.0, 0.075)
@@ -210,18 +210,18 @@ func interact():
# clear last interaction if target has moved since
if last_interaction != null and not last_interaction == target:
- game.mp.send_tile_interact(game.player_id, last_interaction, false, "left")
+ game.mp.send_tile_interact(game.player_id, last_interaction, false, 0)
marker.set_interacting(false)
last_interaction = null
marker.set_interactive(game.get_tile_interactive(target))
marker_target = tile.item_base.global_position
- for h in ["left", "right"]:
- if Input.is_action_just_pressed("interact_"+h) and last_interaction == null:
+ for h in [0, 1]:
+ if Input.is_action_just_pressed("interact_"+G.index_to_hand(h)) and last_interaction == null:
last_interaction = target
game.mp.send_tile_interact(game.player_id, target, true, h)
tile.interact()
marker.set_interacting(true)
- if Input.is_action_just_released("interact_"+h):
+ if Input.is_action_just_released("interact_"+G.index_to_hand(h)):
last_interaction = null
game.mp.send_tile_interact(game.player_id, target, false, h)
marker.set_interacting(false)