From ffc592097696d6cd9d537dfbed6d35622e292fbe Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 17 Feb 2018 18:02:48 -0500 Subject: [PATCH] Tweak all heroes' switch charge settings --- scripts/heroes/0.gd | 10 ++++------ scripts/heroes/1.gd | 4 ---- scripts/heroes/2.gd | 9 +++++++-- scripts/heroes/3.gd | 13 ++++++++++++- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/scripts/heroes/0.gd b/scripts/heroes/0.gd index d8501d0..80d0ec0 100644 --- a/scripts/heroes/0.gd +++ b/scripts/heroes/0.gd @@ -3,7 +3,7 @@ extends "res://scripts/player.gd" const wallride_speed_necessary = 1.5 const wallride_leap_height = 45 const wallride_leap_side = 6 -const wallride_leap_build = 0.01 +const wallride_leap_build = 0 var since_on_wall = 0 var last_wall_normal = Vector3() @@ -11,11 +11,10 @@ var wallride_forgiveness = .3 func _ready(): ._ready() - walk_speed *= 1.2 - air_accel *= 3 + walk_speed *= 0.8 + air_accel *= 2 jump_speed *= 1 - walk_speed_build *= 2 - air_speed_build *= 3 + air_speed_build *= 2 func control_player(state): .control_player(state) @@ -35,7 +34,6 @@ func wallride(state): else: since_on_wall += state.get_step() - debug_node.set_text(str(since_on_wall < wallride_forgiveness)) if since_on_wall < wallride_forgiveness: # Add zero gravity set_gravity_scale(0) diff --git a/scripts/heroes/1.gd b/scripts/heroes/1.gd index 8217ff3..5215359 100644 --- a/scripts/heroes/1.gd +++ b/scripts/heroes/1.gd @@ -121,7 +121,3 @@ func check_wall_count(): if walls.size() >= max_walls: walls[0].make_last() -func sigmoid(x): - var margin = 0.2 - return 0 if abs(x) < margin else x - diff --git a/scripts/heroes/2.gd b/scripts/heroes/2.gd index c4266c7..60a35ed 100644 --- a/scripts/heroes/2.gd +++ b/scripts/heroes/2.gd @@ -1,6 +1,7 @@ extends "res://scripts/player.gd" var is_repelling = false +var overlap_charge = 2 func _process(delta): if is_network_master(): @@ -9,9 +10,13 @@ func _process(delta): rpc("switch_gravity") is_repelling = !is_repelling if is_repelling: - get_node("MasterOnly/RepellingHUD").set_text("/\\") + get_node("MasterOnly/Crosshair").set_text("/\\") else: - get_node("MasterOnly/RepellingHUD").set_text("\\/") + get_node("MasterOnly/Crosshair").set_text("\\/") + + print(get_node("Area").get_overlapping_bodies()) + var overlapping = get_node("Area").get_overlapping_bodies().size() + switch_charge += delta * overlap_charge * overlapping sync func switch_gravity(): var area = get_node("Area") diff --git a/scripts/heroes/3.gd b/scripts/heroes/3.gd index c9739f8..8112291 100644 --- a/scripts/heroes/3.gd +++ b/scripts/heroes/3.gd @@ -9,6 +9,9 @@ var old_mask var allow_merge_time = 0 var allow_merge_threshold = 0.4 +var original_charge +var boost_charge = 0 + func _ready(): # Called every time the node is added to the scene. # Initialization here @@ -29,7 +32,12 @@ func _process(delta): rpc("merge", col.get_name()) if merged and Input.is_action_just_pressed("hero_3_unmerge"): - rpc("unmerge") + rpc("unmerge") + if merged: + # Subtract and then add, so we can continously add this + switch_charge -= boost_charge + boost_charge = merged.switch_charge - original_charge + switch_charge += boost_charge func control_player(state): if !merged: @@ -74,6 +82,9 @@ func set_boosted(node, is_boosted): ratio = 1/ratio # Undo the effect node.walk_speed *= ratio node.air_accel *= ratio + if is_boosted: + original_charge = node.switch_charge + boost_charge = 0 sync func merge(node_name): set_boosting(true)