Work on pickups and multiplayer
This commit is contained in:
@@ -26,10 +26,10 @@ const hack_icons : Dictionary = {
|
||||
Hack.Type.PURGE : preload("res://external/purge-icon.png"),
|
||||
}
|
||||
|
||||
const destroy_explosion_template = preload("res://templates/explosion.tscn")
|
||||
const purge_explosion_template = preload("res://templates/explosion.tscn")
|
||||
const destroy_explosion_template = preload("res://experimental/BinbunVFX/impact_explosions/effects/explosion/vfx_explosion_01.tscn")
|
||||
const purge_explosion_template = preload("res://experimental/BinbunVFX/impact_explosions/effects/explosion/vfx_explosion_03.tscn")
|
||||
const contain_template = preload("res://templates/pitfall.tscn")
|
||||
const trigger_explosion_template = preload("res://templates/explosion.tscn")
|
||||
const trigger_explosion_template = preload("res://experimental/BinbunVFX/impact_explosions/effects/explosion/vfx_explosion_04.tscn")
|
||||
const infect_emitter_template = preload("res://templates/gas_emitter.tscn")
|
||||
const force_activate_sound = preload("res://audio/sounds/TomWinandySFX_UI_ScifiTech_Start_06.wav")
|
||||
|
||||
@@ -69,13 +69,13 @@ func _enter_tree() -> void:
|
||||
func _exit_tree() -> void:
|
||||
Game.level.remove_map_marker(self)
|
||||
|
||||
func setup(type : Type, direction : Vector3, hack_owner : int) -> void:
|
||||
self.type = type
|
||||
self.hack_owner = hack_owner
|
||||
func setup(new_type : Type, dir : Vector3, h_owner : int) -> void:
|
||||
type = new_type
|
||||
hack_owner = h_owner
|
||||
if type == Type.REDIRECT:
|
||||
var r : float = atan2(direction.z, direction.x)
|
||||
var r : float = atan2(dir.z, dir.x)
|
||||
var cardinal : float = roundi(r * 2 / PI) * PI / 2
|
||||
self.direction = Vector3(cos(cardinal), 0, sin(cardinal))
|
||||
direction = Vector3(cos(cardinal), 0, sin(cardinal))
|
||||
|
||||
func remove() -> void:
|
||||
removed.emit(type)
|
||||
@@ -127,7 +127,7 @@ func _ready() -> void:
|
||||
force_strip.rotate_y(r)
|
||||
force_strip.visible = owns_hack
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
func _process(_delta: float) -> void:
|
||||
just_revealed = false
|
||||
|
||||
func blast(body : PawnController) -> void:
|
||||
@@ -149,16 +149,16 @@ func activate() -> void:
|
||||
for body in get_overlapping_bodies():
|
||||
body.fling(direction, 5.0)
|
||||
Type.PURGE:
|
||||
var exp = purge_explosion_template.instantiate()
|
||||
Game.level.add_vfx(exp, square)
|
||||
var expl = purge_explosion_template.instantiate()
|
||||
Game.level.add_vfx(expl, square)
|
||||
explode = true
|
||||
Type.TRIGGER:
|
||||
var exp = trigger_explosion_template.instantiate()
|
||||
Game.level.add_vfx(exp, square)
|
||||
var expl = trigger_explosion_template.instantiate()
|
||||
Game.level.add_vfx(expl, square)
|
||||
explode = true
|
||||
Type.DESTROY:
|
||||
var exp = destroy_explosion_template.instantiate()
|
||||
Game.level.add_vfx(exp, square)
|
||||
var expl = destroy_explosion_template.instantiate()
|
||||
Game.level.add_vfx(expl, square)
|
||||
explode = true
|
||||
Type.INFECT:
|
||||
var emitter = infect_emitter_template.instantiate()
|
||||
@@ -181,10 +181,10 @@ func trigger_adjacent_bombs() -> void:
|
||||
if hack.type == Type.DESTROY and hack != self:
|
||||
hack.delay_trigger()
|
||||
|
||||
func generate_contain(square : Vector3i) -> void:
|
||||
func generate_contain(sq : Vector3i) -> void:
|
||||
var contain = contain_template.instantiate()
|
||||
contain.duration = 6.0
|
||||
Game.level.add_vfx(contain, square)
|
||||
Game.level.add_vfx(contain, sq)
|
||||
|
||||
func blast_players() -> void:
|
||||
for body in range_area.get_overlapping_bodies():
|
||||
@@ -206,7 +206,7 @@ func _on_body_entered(body: Node3D) -> void:
|
||||
return
|
||||
|
||||
if !decompiling or body.id != decompile_id:
|
||||
if !body.detecting:
|
||||
if !body.is_detecting():
|
||||
activate()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user