Browse Source

Allow PAZIENZIA to delet buildings with charge

master
Luna 7 years ago
parent
commit
ccb2411ecb
4 changed files with 15 additions and 3 deletions
  1. +1
    -1
      project.godot
  2. +2
    -2
      scripts/hero_select.gd
  3. +7
    -0
      scripts/heroes/4.gd
  4. +5
    -0
      scripts/placeable.gd

+ 1
- 1
project.godot View File

@ -55,7 +55,7 @@ hero_5_confirm_portal=[ Object(InputEventMouseButton,"resource_local_to_scene":f
] ]
hero_5_remove_portal=[ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null) hero_5_remove_portal=[ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null)
] ]
primary_action=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":46,"unicode":0,"echo":false,"script":null)
primary_ability=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":46,"unicode":0,"echo":false,"script":null)
] ]
hero_0_boost=[ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) hero_0_boost=[ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
] ]


+ 2
- 2
scripts/hero_select.gd View File

@ -10,11 +10,11 @@ const hero_names = [
] ]
const hero_text = [ const hero_text = [
"DILIGENCE.\n\nWallride by jumping on walls.\n\nYour speed builds immensely as your Switch Charge increases.",
"DILIGENCE.\n\nWallride by jumping on walls.\n\nHold left click to go faster (but spend switch charge).",
"WRATH.\n\nPress E and click (or just click) to build a wall.\n\nRight click to destroy one.", "WRATH.\n\nPress E and click (or just click) to build a wall.\n\nRight click to destroy one.",
"LUST.\n\nYou attract nearby heroes.\n\nPress E to switch to repelling them.", "LUST.\n\nYou attract nearby heroes.\n\nPress E to switch to repelling them.",
"GENEROSITY.\n\nMake contact with a friend to boost their speed.\n\nPress E to separate.", "GENEROSITY.\n\nMake contact with a friend to boost their speed.\n\nPress E to separate.",
"PATIENCE.\n\nHold left mouse button on an enemy to slow them down.",
"PATIENCE.\n\nHold left mouse button on an enemy to slow them down.\n\nPress E to delete someone else's building (costs charge).",
"PRIDE.\n\nClick to build portal. Click again to build its partner.\n\nYou can build multiple portal sets.", "PRIDE.\n\nClick to build portal. Click again to build its partner.\n\nYou can build multiple portal sets.",
] ]


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

@ -28,6 +28,13 @@ func _process(delta):
get_node("TPCamera").cam_view_sensitivity *= sens_factor get_node("TPCamera").cam_view_sensitivity *= sens_factor
get_node("TPCamera").cam_smooth_movement = true get_node("TPCamera").cam_smooth_movement = true
if Input.is_action_just_pressed("primary_ability"):
var look_ray = get_node("TPCamera/Camera/Ray")
var looking_at = look_ray.get_collider()
if looking_at.has_method("destroy"):
if switch_charge > looking_at.destroy_cost:
switch_charge -= looking_at.destroy()
if stun: if stun:
var players = get_node("/root/Level/Players").get_children() var players = get_node("/root/Level/Players").get_children()
var player = pick_from(players) var player = pick_from(players)


+ 5
- 0
scripts/placeable.gd View File

@ -2,6 +2,7 @@ extends StaticBody
var maker_node var maker_node
var material var material
var destroy_cost = 20
func _ready(): func _ready():
get_node("CollisionShape").disabled = true get_node("CollisionShape").disabled = true
@ -21,6 +22,10 @@ func place():
get_node("CollisionShape").disabled = false get_node("CollisionShape").disabled = false
material.flags_transparent = false material.flags_transparent = false
func destroy():
queue_free()
return destroy_cost
func make_last(): func make_last():
material.flags_transparent = true material.flags_transparent = true
material.albedo_color.a = 0.9 material.albedo_color.a = 0.9


Loading…
Cancel
Save