Browse Source

Give losing or non-possessing team more charge!

Nice! I love this balance tweak! And it can be changed depending on how
strong we want it to be.
master
Luna 7 years ago
parent
commit
d6a158a1ae
9 changed files with 23 additions and 11 deletions
  1. +0
    -2
      plans.md
  2. +0
    -1
      scenes/level.tscn
  3. +1
    -1
      scripts/heroes/1_wall.gd
  4. +1
    -1
      scripts/heroes/2.gd
  5. +1
    -1
      scripts/heroes/3.gd
  6. +2
    -2
      scripts/heroes/4.gd
  7. +1
    -1
      scripts/heroes/5.gd
  8. +1
    -1
      scripts/heroes/5_portal.gd
  9. +16
    -1
      scripts/player.gd

+ 0
- 2
plans.md View File

@ -25,8 +25,6 @@ Smaller TODOs:
- Ira is OP?
- Nerfed - 5 walls
- Make motion more reactive?
- Grab someone and draw an impulse on them
- Combine with SUPERBIA, use charge to build portals
Bugs:


+ 0
- 1
scenes/level.tscn View File

@ -155,7 +155,6 @@ directional_shadow_max_distance = 200.0
[node name="Players" type="Spatial" parent="." index="1"]
[node name="Ball" type="RigidBody" parent="." index="2"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -14.4344, 6.09969, 4.40885 )


+ 1
- 1
scripts/heroes/1_wall.gd View File

@ -5,7 +5,7 @@ var being_touched = 0
func _process(delta):
if being_touched > 0:
maker_node.switch_charge += touch_charge * delta
maker_node.build_charge(touch_charge * delta)
func init(maker):


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

@ -15,7 +15,7 @@ func _process(delta):
get_node("MasterOnly/Crosshair").set_text("\\/")
var overlapping = get_node("Area").get_overlapping_bodies().size()
switch_charge += delta * overlap_charge * overlapping
build_charge(delta * overlap_charge * overlapping)
sync func switch_gravity():
var area = get_node("Area")


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

@ -39,7 +39,7 @@ func _process(delta):
# 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
build_charge(boost_charge)
func control_player(state):
if !merged:


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

@ -46,8 +46,8 @@ func _process(delta):
var player = pick_from(players)
if player != -1:
# We get charge for just stunning, plus charge for how much linear velocity we cut out
switch_charge += stun_charge * delta
switch_charge += velocity_charge * players[player].get_linear_velocity().length() * delta
build_charge(stun_charge * delta)
build_charge(velocity_charge * players[player].linear_velocity.length() * delta)
rpc("stun", players[player].get_name(), get_node("TPCamera/Camera/Ray").get_collision_point())
is_stunning = true


+ 1
- 1
scripts/heroes/5.gd View File

@ -63,7 +63,7 @@ func flick_input():
towards -= gravity
rpc("flick", flicking.get_name(), towards)
flicking = null
switch_charge += flick_charge
build_charge(flick_charge)
sync func flick(player_id, towards):
var who = $"/root/Level/Players".get_node(player_id)


+ 1
- 1
scripts/heroes/5_portal.gd View File

@ -65,5 +65,5 @@ func portal(player):
# With both axes, gravity could never bring us to hit the portal
var to = other.to_global(Vector3(spawn_distance,0,-spawn_distance))
player.set_translation(to)
maker_node.switch_charge += portal_charge
maker_node.build_charge(portal_charge)

+ 16
- 1
scripts/player.gd View File

@ -83,7 +83,7 @@ func _process(delta):
var vel = get_linear_velocity()
if translation.y < switch_height:
vel.y = 0 # Don't gain charge from falling when below switch_height
switch_charge += movement_charge * vel.length() * delta
build_charge(movement_charge * vel.length() * delta)
switch_text.set_text("%d%%" % int(switch_charge)) # We truncate, rather than round, so that switch is displayed AT 100%
if switch_charge >= 100:
switch_hero_action.show()
@ -118,6 +118,21 @@ func _exit_tree():
# Functions
# =========
# Build all charge with a multiplier for ~~balance~~
func build_charge(amount):
# If we used build_charge to cost charge, don't mess with it!
if amount > 0:
var losing_advantage = 1.2
var uncapped_advantage = 1.3
var obj = get_node("/root/Level/FullObjective/Objective")
if (obj.left > obj.right) == player_info.is_right_team:
# Is losing (left winning, we're on right or vice versa)
amount *= losing_advantage
if obj.right_active != player_info.is_right_team and obj.active:
# Point against us (right active and left, or vice versa)
amount *= uncapped_advantage
switch_charge += amount
sync func spawn():
emit_signal("spawn")
if "record" in player_info:


Loading…
Cancel
Save