midori-school/levels/Ceres/L20.gd

55 lines
1.7 KiB
GDScript3
Raw Normal View History

2024-04-17 20:33:27 +02:00
extends Node2D
var talk = load("res://levels/ui/talk.tscn").instantiate()
var boss
var player
# Called when the node enters the scene tree for the first time.
func _ready():
boss = $Kimberly
player = $Player
boss.add_to_group("boss")
Global.cdialog = [[tr("DIALOG_CERES_L20_0"), true, 0, 0], [tr("DIALOG_CERES_L20_1"), false, 3], [tr("DIALOG_CERES_L20_2"), true, 0, 0]]
Global.live = 0
get_tree().root.add_child.call(talk)
2024-09-25 13:35:43 +02:00
if !Global.debug:
Global.quest[0] = 1
2024-04-17 20:33:27 +02:00
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _physics_process(delta):
2024-07-16 02:22:33 +02:00
if Global.debug:
if Global.dstats[Global.dparty[0][0]][0] <= 0 && Global.live == 1:
_winner()
else:
if Global.cstats[Global.party[0][0]][0] <= 0 && Global.live == 1:
_winner()
2024-04-17 20:33:27 +02:00
func _input(event):
2024-06-17 23:08:25 +02:00
if Global.cdialog.size() != 0 && Global.live == 1:
2024-04-17 20:33:27 +02:00
get_tree().root.remove_child(talk)
2024-06-17 23:08:25 +02:00
Global.cdialog = []
2024-04-17 20:33:27 +02:00
2024-07-16 02:22:33 +02:00
func _winner():
2024-09-25 13:35:43 +02:00
Global.quest[0] = 3
Global.quest[1] = 1
2024-07-16 02:22:33 +02:00
Global.cdialog = [[tr("DIALOG_CERES_L20_3"), true, 0, 0], [tr("DIALOG_CERES_L20_4"), false, 3], [tr("DIALOG_CERES_L20_5"), true, 0, 0]]
Global.live = 3
2024-08-05 00:33:57 +02:00
Global.ccutscene = 6
2024-07-16 02:22:33 +02:00
#talk.queue_free()
talk = load("res://levels/ui/talk.tscn").instantiate()
get_tree().root.add_child.call(talk)
2024-08-05 00:33:57 +02:00
func _statrebase():
if Global.debug:
for i in 4:
if Global.dparty[i][0] != null:
for j in 7:
Global.mstats[Global.dparty[i][0]][j] = Global.basestats[Global.dparty[i][0]][j] * Global.dlevel[Global.dparty[i][0]]
else:
for i in 4:
if Global.party[i][0] != null:
for j in 7:
Global.mstats[Global.party[i][0]][j] = Global.basestats[Global.party[i][0]][j] * Global.level[Global.dparty[i][0]]