Add opening heroine orbit with Serafina voice and delayed controls
This commit is contained in:
+25
-4
@@ -49,6 +49,7 @@ var flames: Array = []
|
||||
var moving_gears: Array = []
|
||||
var wisps: Array = []
|
||||
var architecture = preload("res://endless.gd").new()
|
||||
var intro = preload("res://intro_cinematic.gd").new()
|
||||
var orbit = preload("res://orbit.gd").new()
|
||||
var dungeon = preload("res://dungeon.gd").new()
|
||||
var audio_player: AudioStreamPlayer
|
||||
@@ -85,7 +86,7 @@ var quips = ["Ещё один. Наверху сегодня скидки на
|
||||
|
||||
func _ready():
|
||||
var args=OS.get_cmdline_user_args()
|
||||
test_mode="--test-room-decor" in args or "--test-camera-controls" in args or "--test-rubies" in args or "--test-runtime-burn" in args or "--test-single-punishment" in args or "--test-expansion" in args or "--test-imps" in args or "--test-flight-camera" in args or "--test-maintenance" in args or "--test-castle" in args or "--test-building" in args or "--test-workflow" in args or "--test-roster" in args or "--test-priority" in args or "--test-mesh" in args or "--test-economy" in args or "--test-posture" in args or "--test-gait" in args or "--test-visuals" in args or "--test-mode" in args or "--test-exit" in args or "--test-ui" in args or "--test-audio" in args or "--test-sentences" in args or "--test-hud" in args
|
||||
test_mode="--test-intro" in args or "--test-room-decor" in args or "--test-camera-controls" in args or "--test-rubies" in args or "--test-runtime-burn" in args or "--test-single-punishment" in args or "--test-expansion" in args or "--test-imps" in args or "--test-flight-camera" in args or "--test-maintenance" in args or "--test-castle" in args or "--test-building" in args or "--test-workflow" in args or "--test-roster" in args or "--test-priority" in args or "--test-mesh" in args or "--test-economy" in args or "--test-posture" in args or "--test-gait" in args or "--test-visuals" in args or "--test-mode" in args or "--test-exit" in args or "--test-ui" in args or "--test-audio" in args or "--test-sentences" in args or "--test-hud" in args
|
||||
capture_mode="--capture-workflow" in args or "--capture-roster" in args or "--capture-economy" in args or "--capture-posture" in args or "--capture-gait" in args or "--capture" in args or "--capture-workshop" in args
|
||||
if FileAccess.file_exists("res://build_info.json"):
|
||||
var stamp=JSON.parse_string(FileAccess.get_file_as_string("res://build_info.json"))
|
||||
@@ -135,13 +136,16 @@ func _ready():
|
||||
workshop=preload("res://workshop.gd").new()
|
||||
add_child(workshop)
|
||||
workshop.setup(self)
|
||||
add_child(intro)
|
||||
intro.setup(self)
|
||||
if not test_mode and not capture_mode: ambience_player.play()
|
||||
paused=true
|
||||
hud.visible=false
|
||||
say("Первый день. Последняя надежда на отпуск.")
|
||||
refresh_ui()
|
||||
if automatic: build_auto_arm()
|
||||
if "--test-exit" in args: call_deferred("test_exit")
|
||||
if "--test-intro" in args:call_deferred("run_intro_tests")
|
||||
elif "--test-exit" in args: call_deferred("test_exit")
|
||||
elif "--test-audio" in args: call_deferred("run_audio_tests")
|
||||
elif "--test-ui" in args: call_deferred("run_ui_tests")
|
||||
elif "--test-room-decor" in args:call_deferred("run_room_decor_tests")
|
||||
@@ -304,6 +308,7 @@ func set_pause(value: bool):
|
||||
else: menu.show_page("")
|
||||
|
||||
func start_game():
|
||||
var new_shift=menu.current_page=="main" or not game_started
|
||||
if menu.current_page=="main":reset_shift()
|
||||
if not game_started:
|
||||
game_started=true
|
||||
@@ -313,9 +318,11 @@ func start_game():
|
||||
hud.visible=true
|
||||
set_pause(false)
|
||||
if workshop:workshop.message("240 золота на обустройство. [B] — строительство, [T] — развитие.");workshop.refresh()
|
||||
say("Новая смена. Обустрой свой цех.")
|
||||
if new_shift and not test_mode and not capture_mode:intro.begin()
|
||||
else:say("Новая смена. Обустрой свой цех.")
|
||||
|
||||
func reset_shift():
|
||||
intro.cancel()
|
||||
if workshop:workshop.reset()
|
||||
for soul in souls:
|
||||
if is_instance_valid(soul.node):soul.node.queue_free()
|
||||
@@ -341,6 +348,7 @@ func reset_shift():
|
||||
refresh_ui()
|
||||
|
||||
func return_to_main_menu():
|
||||
intro.cancel()
|
||||
set_pause(true)
|
||||
hud.visible=false
|
||||
menu.show_main()
|
||||
@@ -513,10 +521,14 @@ func floating(text: String, p: Vector3, c: Color):
|
||||
popups.append({"node":l,"ttl":1.15})
|
||||
|
||||
func _input(event):
|
||||
if intro.active:
|
||||
get_viewport().set_input_as_handled()
|
||||
return
|
||||
if workshop:workshop.track_pointer(event)
|
||||
orbit.input(event)
|
||||
|
||||
func _unhandled_input(event):
|
||||
if intro.active:return
|
||||
if workshop and workshop.input(event):return
|
||||
if event is InputEventKey and event.pressed and not event.echo:
|
||||
if event.keycode==KEY_F5 or event.physical_keycode==KEY_F5:
|
||||
@@ -554,6 +566,9 @@ func _process(delta):
|
||||
var dt=minf(delta,0.05)
|
||||
ambience_fade=minf(1.0,ambience_fade+delta/1.5)
|
||||
update_audio_levels()
|
||||
if intro.active:
|
||||
intro.update(delta)
|
||||
return
|
||||
time+=dt
|
||||
for gear in moving_gears: gear.rotation.z+=dt*0.65
|
||||
if workshop:
|
||||
@@ -689,6 +704,9 @@ func build_auto_arm():
|
||||
cylinder(self,STATION+Vector3(1.1,0.9,-0.5),0.15,1.8,Color("8c7186"))
|
||||
|
||||
func _notification(what):
|
||||
if is_instance_valid(intro) and intro.active and not test_mode and not capture_mode:
|
||||
if what==NOTIFICATION_APPLICATION_FOCUS_OUT:intro.suspend(true)
|
||||
elif what==NOTIFICATION_APPLICATION_FOCUS_IN:intro.suspend(false)
|
||||
if what==NOTIFICATION_APPLICATION_FOCUS_OUT:
|
||||
orbit.stop();orbit.keys.clear()
|
||||
if workshop and workshop.build_mode and (workshop.drag.active or workshop.drag.index>=0):workshop.cancel_placement()
|
||||
@@ -742,7 +760,7 @@ func update_audio_levels():
|
||||
if dialogue:dialogue.update()
|
||||
if voice_player:voice_player.volume_db=linear_to_db(maxf(voice_volume,0.0001))
|
||||
if audio_player: audio_player.volume_db=-3.0+linear_to_db(maxf(whip_volume,0.0001))
|
||||
if ambience_player: ambience_player.volume_db=linear_to_db(maxf(ambience_volume*ambience_fade,0.0001))
|
||||
if ambience_player: ambience_player.volume_db=linear_to_db(maxf(ambience_volume*ambience_fade*(.25 if intro.active else 1.0),0.0001))
|
||||
|
||||
func save_settings():
|
||||
if test_mode or capture_mode: return
|
||||
@@ -990,3 +1008,6 @@ func run_camera_controls_tests():
|
||||
|
||||
func run_room_decor_tests():
|
||||
await preload("res://room_decor_tests.gd").new().run(self)
|
||||
|
||||
func run_intro_tests():
|
||||
await preload("res://intro_tests.gd").new().run(self)
|
||||
|
||||
Reference in New Issue
Block a user