Browse Source

Tweak all heroes' switch charge settings

master
Luna 7 years ago
parent
commit
ffc5920976
4 changed files with 23 additions and 13 deletions
  1. +4
    -6
      scripts/heroes/0.gd
  2. +0
    -4
      scripts/heroes/1.gd
  3. +7
    -2
      scripts/heroes/2.gd
  4. +12
    -1
      scripts/heroes/3.gd

+ 4
- 6
scripts/heroes/0.gd View File

@ -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)


+ 0
- 4
scripts/heroes/1.gd View File

@ -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

+ 7
- 2
scripts/heroes/2.gd View File

@ -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")


+ 12
- 1
scripts/heroes/3.gd View File

@ -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)


Loading…
Cancel
Save