Fronter/RectangleReturn.gd

59 lines
1.6 KiB
GDScript3
Raw Normal View History

extends "res://Bad.gd"
signal flash
signal boss_health
2018-11-13 20:53:07 -05:00
var right_laser_alive = true
var left_laser_alive = true
func _ready():
speed = 0
starting_health = 3000
health = starting_health
$RightArm/Laser/BadLaser.independent = false
#$RightArm/BadLaser.health_multi = 3
$LeftArm/Laser/BadLaser.independent = false
#$LeftArm/BadLaser.health_multi = 3
2018-11-13 20:53:07 -05:00
$RightArm/Laser/BadLaser.fire_speed = 25
$LeftArm/Laser/BadLaser.fire_speed = 25
$RightArm/Laser/BadLaser/Rotatable.rotation_degrees = -45
pass
func _process(delta):
2018-11-13 20:53:07 -05:00
#$RightArm/Forearm.rotate(delta/10)
if right_laser_alive:
if $RightArm/Laser/BadLaser:
#$RightArm/Laser/BadLaser.health -= delta*30
2018-11-13 20:53:07 -05:00
if $RightArm/Laser/BadLaser.health <= 100:
$RightArm/Laser/BadLaser.fire_speed = 150
else:
$RightArm/Laser/BadLaser/AnimatedSprite.frame = 1
$RightArm/Laser/BadLaser.fire_speed = 0
$RightArm/Laser/BadLaser/Line2D.visible = false
2018-11-13 20:53:07 -05:00
if left_laser_alive:
if $LeftArm/Laser/BadLaser:
#$LeftArm/Laser/BadLaser.health -= delta*30
2018-11-13 20:53:07 -05:00
if $LeftArm/Laser/BadLaser.health <= 100:
$LeftArm/Laser/BadLaser.fire_speed = 150
else:
$LeftArm/Laser/BadLaser.fire_speed = 0
$LeftArm/Laser/BadLaser/AnimatedSprite.frame = 1
$LeftArm/Laser/BadLaser/Line2D.visible = false
2018-11-13 20:53:07 -05:00
func hit(who):
health -= who.damage/(health_multi*3.5)
print(health)
if get_tree().is_network_server():
rpc("bossHealth", health)
emit_signal("boss_health", health, starting_health)
2018-11-13 20:53:07 -05:00
func _on_LeftBadLaser_dead(money):
left_laser_alive = false
func _on_RightBadLaser_dead(money):
right_laser_alive = false
func _exit_tree():
$LeftArm/Laser/BadLaser.queue_free()
$RightArm/Laser/BadLaser.queue_free()