diff options
Diffstat (limited to 'godot/scenes/Die.gd')
-rw-r--r-- | godot/scenes/Die.gd | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/godot/scenes/Die.gd b/godot/scenes/Die.gd index bae6c84..f09a8b0 100644 --- a/godot/scenes/Die.gd +++ b/godot/scenes/Die.gd @@ -133,7 +133,7 @@ func _physics_process(delta): dice_is_moving = true $PowerUI3D/SpriteCircles.hide() - if after_stroke && dice_still_timing == true && (OS.get_ticks_msec() - dice_is_still_since) > 200: + if after_stroke && dice_still_timing == true && (OS.get_ticks_msec() - dice_is_still_since) > 500: print("stop timing while not morbin") dice_is_moving = false after_stroke = false @@ -142,9 +142,8 @@ func _physics_process(delta): revert_current_buff() var last_buff = curr_buff curr_buff = get_buff_from_upwards_side() - if last_buff == curr_buff && curr_buff == buff.stroke: - return - apply_buff() + if not(last_buff == curr_buff && curr_buff == buff.stroke): + apply_buff() # Called every frame. 'delta' is the elapsed time since the previous frame. @@ -201,13 +200,16 @@ func get_buff_from_upwards_side(): if $Bounce1.get_overlapping_areas().size() > 0 || $Bounce2.get_overlapping_areas().size() > 0: return buff.bounce if $Phase1.get_overlapping_areas().size() > 0 || $Phase2.get_overlapping_areas().size() > 0: - return buff.phase + return buff.gravity return buff.none func low_gravity(): - gravity_scale = 0.2 + gravity_scale = 0.3 * default_gravity + +func low_gravity_revert(): + gravity_scale = default_gravity func extra_stroke(): _game.revoke_stroke() @@ -241,9 +243,20 @@ func ball_revert(): $BallShape.set_process(false) $BallShape.disabled = true - +func buff_text(): + match curr_buff: + buff.ball: + return "" + buff.bounce: + return "You're bouncy!" + buff.phase: + return "WooOOoOO you can phase through walls" + buff.gravity: + return "Warning, Low gravity!" + return "" func revert_current_buff(): + $PowerUI/LabelBuff.text = "" match curr_buff: buff.ball: ball_revert() @@ -252,11 +265,11 @@ func revert_current_buff(): buff.phase: phase_revert() buff.gravity: - gravity_scale = default_gravity + low_gravity_revert() func apply_buff(): - gravity_scale = default_gravity + $PowerUI/LabelBuff.text = buff_text() match curr_buff: buff.ball: ball() |