From ba5e14a8588db213fd55cbba9510f781fad8a701 Mon Sep 17 00:00:00 2001 From: Raxki Date: Wed, 9 Oct 2024 11:39:56 -0400 Subject: [PATCH] Add portrait support for cutscene dialogues and show character's name --- Cutscenes/prototype_defeated.tres | 16 +++++++-- Cutscenes/prototype_start.tres | 32 ++++------------- Portraits/hiro_default_normal.png | 3 ++ Portraits/hiro_default_normal.png.import | 34 ++++++++++++++++++ Portraits/hiro_naked_embarrased.png | 3 ++ Portraits/hiro_naked_embarrased.png.import | 34 ++++++++++++++++++ Portraits/hiro_normal_normal.png.import | 34 ++++++++++++++++++ Portraits/reed_default_normal.png | 3 ++ Portraits/reed_default_normal.png.import | 34 ++++++++++++++++++ Portraits/reed_normal_normal.png.import | 34 ++++++++++++++++++ Scripts/Cutscenes/Commands/show_dialogue.gd | 2 ++ Scripts/Levels/arena_level.gd | 19 +++++------ Scripts/UI/textbox.gd | 21 ++++++++++-- UI/textbox_ui.tscn | 7 ++-- project.godot | 8 +++++ world/world.tscn | 38 +++++++-------------- 16 files changed, 252 insertions(+), 70 deletions(-) create mode 100644 Portraits/hiro_default_normal.png create mode 100644 Portraits/hiro_default_normal.png.import create mode 100644 Portraits/hiro_naked_embarrased.png create mode 100644 Portraits/hiro_naked_embarrased.png.import create mode 100644 Portraits/hiro_normal_normal.png.import create mode 100644 Portraits/reed_default_normal.png create mode 100644 Portraits/reed_default_normal.png.import create mode 100644 Portraits/reed_normal_normal.png.import diff --git a/Cutscenes/prototype_defeated.tres b/Cutscenes/prototype_defeated.tres index e92ad90..d9ae4a7 100644 --- a/Cutscenes/prototype_defeated.tres +++ b/Cutscenes/prototype_defeated.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" script_class="Cutscene" load_steps=6 format=3 uid="uid://cwfayxsvfvfp3"] +[gd_resource type="Resource" script_class="Cutscene" load_steps=7 format=3 uid="uid://cwfayxsvfvfp3"] [ext_resource type="Script" path="res://Scripts/Cutscenes/cutscene.gd" id="1_5oimi"] [ext_resource type="Script" path="res://Scripts/Cutscenes/Commands/wait.gd" id="1_b7jis"] @@ -11,9 +11,19 @@ time = 2.01667 [sub_resource type="Resource" id="Resource_eeatu"] script = ExtResource("1_m28bn") character = 0 -messages = Array[String](["Ha! I won! Told you I kill you!"]) +portrait_set = "naked" +portrait_emotion = "embarrased" +messages = Array[String](["AAH! What happened!?", "You ripped my clothes off!!"]) textbox_direction = 0 +[sub_resource type="Resource" id="Resource_cw5jl"] +script = ExtResource("1_m28bn") +character = 1 +portrait_set = "default" +portrait_emotion = "normal" +messages = Array[String](["Heh, told you I'd kill you!", "Of embarrasment!!"]) +textbox_direction = 1 + [resource] script = ExtResource("1_5oimi") -commands = Array[Resource("res://Scripts/Cutscenes/Commands/base.gd")]([SubResource("Resource_j0qrl"), SubResource("Resource_eeatu")]) +commands = Array[Resource("res://Scripts/Cutscenes/Commands/base.gd")]([SubResource("Resource_j0qrl"), SubResource("Resource_eeatu"), SubResource("Resource_cw5jl")]) diff --git a/Cutscenes/prototype_start.tres b/Cutscenes/prototype_start.tres index 83bb592..620eec9 100644 --- a/Cutscenes/prototype_start.tres +++ b/Cutscenes/prototype_start.tres @@ -1,13 +1,10 @@ -[gd_resource type="Resource" script_class="Cutscene" load_steps=18 format=3 uid="uid://bj3rm1r1ouq0r"] +[gd_resource type="Resource" script_class="Cutscene" load_steps=12 format=3 uid="uid://bj3rm1r1ouq0r"] [ext_resource type="Script" path="res://Scripts/Cutscenes/cutscene.gd" id="1_ejncn"] -[ext_resource type="Script" path="res://Scripts/Cutscenes/Commands/wait.gd" id="1_mrqg0"] [ext_resource type="Script" path="res://Scripts/Cutscenes/Commands/show_dialogue.gd" id="1_r5tuj"] [ext_resource type="AudioStream" uid="uid://osasql3x1b8q" path="res://Audio/BGM/olympus_overworld.mp3" id="1_wnm4j"] [ext_resource type="Script" path="res://Scripts/Cutscenes/Commands/turn_character.gd" id="2_eqfp1"] [ext_resource type="Script" path="res://Scripts/Cutscenes/Commands/cue_bgm.gd" id="2_fbljl"] -[ext_resource type="Script" path="res://Scripts/Cutscenes/Commands/move_character.gd" id="3_rxd5p"] -[ext_resource type="Script" path="res://Scripts/Cutscenes/Commands/lookat_character.gd" id="4_dcsx8"] [ext_resource type="AudioStream" uid="uid://jlr3b1nye15g" path="res://Audio/BGM/olympus_combat.mp3" id="8_o2rwe"] [sub_resource type="Resource" id="Resource_xw6ah"] @@ -15,28 +12,11 @@ script = ExtResource("2_fbljl") music = ExtResource("1_wnm4j") crossfade = false -[sub_resource type="Resource" id="Resource_h6w6u"] -script = ExtResource("1_mrqg0") -time = 1.0 - -[sub_resource type="Resource" id="Resource_22owj"] -script = ExtResource("3_rxd5p") -target_character = NodePath("../HiroAI") -target_type = "Node" -use_character_speed = false -speed = 75.0 -animation_state = "cut_walk" -target_vector = Vector2(0, 0) -target_node = NodePath("../PositionMarkers/Marker1") - -[sub_resource type="Resource" id="Resource_rtvbh"] -script = ExtResource("4_dcsx8") -character = NodePath("../HiroAI") -lookat_target = NodePath("../HiroPlayer") - [sub_resource type="Resource" id="Resource_r2p8t"] script = ExtResource("1_r5tuj") -character = 0 +character = 1 +portrait_set = "default" +portrait_emotion = "normal" messages = Array[String](["This is a test for the cutscene!", "Now I'm going to kill you!"]) textbox_direction = 1 @@ -48,6 +28,8 @@ facing_direction = 3 [sub_resource type="Resource" id="Resource_x3xc6"] script = ExtResource("1_r5tuj") character = 0 +portrait_set = "default" +portrait_emotion = "normal" messages = Array[String](["Whaaat? Who are you!?", "You have no chance against me!!"]) textbox_direction = 0 @@ -59,4 +41,4 @@ crossfade = true [resource] resource_name = "prototype_start" script = ExtResource("1_ejncn") -commands = Array[Resource("res://Scripts/Cutscenes/Commands/base.gd")]([SubResource("Resource_xw6ah"), SubResource("Resource_h6w6u"), SubResource("Resource_22owj"), SubResource("Resource_rtvbh"), SubResource("Resource_r2p8t"), SubResource("Resource_fuu2y"), SubResource("Resource_x3xc6"), SubResource("Resource_1sjaa")]) +commands = Array[Resource("res://Scripts/Cutscenes/Commands/base.gd")]([SubResource("Resource_xw6ah"), SubResource("Resource_r2p8t"), SubResource("Resource_fuu2y"), SubResource("Resource_x3xc6"), SubResource("Resource_1sjaa")]) diff --git a/Portraits/hiro_default_normal.png b/Portraits/hiro_default_normal.png new file mode 100644 index 0000000..21f5c73 --- /dev/null +++ b/Portraits/hiro_default_normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ced19d9f3b9af8438600798bf75c11b03895f20a1e4a69a591d962267b27e861 +size 139053 diff --git a/Portraits/hiro_default_normal.png.import b/Portraits/hiro_default_normal.png.import new file mode 100644 index 0000000..bdabb15 --- /dev/null +++ b/Portraits/hiro_default_normal.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://du2iwu36y3l5p" +path="res://.godot/imported/hiro_default_normal.png-578cd4ef955936832fc2508f7d1803f7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Portraits/hiro_default_normal.png" +dest_files=["res://.godot/imported/hiro_default_normal.png-578cd4ef955936832fc2508f7d1803f7.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Portraits/hiro_naked_embarrased.png b/Portraits/hiro_naked_embarrased.png new file mode 100644 index 0000000..0d3dda9 --- /dev/null +++ b/Portraits/hiro_naked_embarrased.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6bb389b92271426bd92966240f8fe1263cc4e8cc32d3df48862a32489f634f8 +size 155927 diff --git a/Portraits/hiro_naked_embarrased.png.import b/Portraits/hiro_naked_embarrased.png.import new file mode 100644 index 0000000..a316ff3 --- /dev/null +++ b/Portraits/hiro_naked_embarrased.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ji1goitqlmof" +path="res://.godot/imported/hiro_naked_embarrased.png-57e955a40ef55564128a120870de8a12.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Portraits/hiro_naked_embarrased.png" +dest_files=["res://.godot/imported/hiro_naked_embarrased.png-57e955a40ef55564128a120870de8a12.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Portraits/hiro_normal_normal.png.import b/Portraits/hiro_normal_normal.png.import new file mode 100644 index 0000000..01d4ecc --- /dev/null +++ b/Portraits/hiro_normal_normal.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cr2vv873lb5o3" +path="res://.godot/imported/hiro_normal_normal.png-bf7814a8691e38a8d33d42cf2e1b491e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Hiro/Portraits/hiro_normal_normal.png" +dest_files=["res://.godot/imported/hiro_normal_normal.png-bf7814a8691e38a8d33d42cf2e1b491e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Portraits/reed_default_normal.png b/Portraits/reed_default_normal.png new file mode 100644 index 0000000..703eec9 --- /dev/null +++ b/Portraits/reed_default_normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8abee782eb769bb214bce3e77b52d2e63fde34633920708c3634c59564954655 +size 177629 diff --git a/Portraits/reed_default_normal.png.import b/Portraits/reed_default_normal.png.import new file mode 100644 index 0000000..741dfec --- /dev/null +++ b/Portraits/reed_default_normal.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://crjnnxlwsu4li" +path="res://.godot/imported/reed_default_normal.png-2019bfcf44c1030a3bfcdc2140f77ada.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Portraits/reed_default_normal.png" +dest_files=["res://.godot/imported/reed_default_normal.png-2019bfcf44c1030a3bfcdc2140f77ada.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Portraits/reed_normal_normal.png.import b/Portraits/reed_normal_normal.png.import new file mode 100644 index 0000000..fdcf281 --- /dev/null +++ b/Portraits/reed_normal_normal.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://pqmiuyjp3u63" +path="res://.godot/imported/reed_normal_normal.png-8b7da774cabeac2b2170950e8bb9e3e5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Reed/Portraits/reed_normal_normal.png" +dest_files=["res://.godot/imported/reed_normal_normal.png-8b7da774cabeac2b2170950e8bb9e3e5.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Scripts/Cutscenes/Commands/show_dialogue.gd b/Scripts/Cutscenes/Commands/show_dialogue.gd index f214559..f27c704 100644 --- a/Scripts/Cutscenes/Commands/show_dialogue.gd +++ b/Scripts/Cutscenes/Commands/show_dialogue.gd @@ -7,5 +7,7 @@ enum TextboxDirection { } @export var character: Util.CastCharacter +@export var portrait_set: String = "default" +@export var portrait_emotion: String = "normal" @export var messages: Array[String] = [] @export var textbox_direction = TextboxDirection.LEFT diff --git a/Scripts/Levels/arena_level.gd b/Scripts/Levels/arena_level.gd index ce92c9a..c5d31b0 100644 --- a/Scripts/Levels/arena_level.gd +++ b/Scripts/Levels/arena_level.gd @@ -1,9 +1,10 @@ extends Node2D +@onready var game_state = $GameState @onready var explosion_generator = $ExplosionGenerator @onready var battle_ui = $CanvasLayer/BattleUI @onready var player = $HiroPlayer -@onready var ai = $HiroAI +@onready var ai = $ReedAI @onready var cutscene_manager = $CutsceneManager @onready var sound_manager = $SoundManager @@ -11,7 +12,7 @@ func _ready(): battle_ui.initialize(player.health, ai.health) battle_ui.set_player_health(player.health) battle_ui.set_enemy_health(ai.health) - # cutscene_manager.step() + cutscene_manager.step() func _on_player_defeated(): if Globals.nsfw == true: @@ -22,19 +23,17 @@ func _on_player_defeated(): cutscene_manager.step() func _on_cutscene_started(cutscene_name): - $HiroPlayer.can_move = false - $GameState.can_pause = false + player.can_move = false + game_state.can_pause = false if cutscene_name == "prototype_start": - $HiroAI.set_ai_enabled(false) - $ReedAI.set_ai_enabled(false) + ai.set_ai_enabled(false) func _on_cutscene_finished(cutscene_name: String): print("Cutscene " + cutscene_name + " finished") - $HiroPlayer.can_move = true - $GameState.can_pause = true + player.can_move = true + game_state.can_pause = true if cutscene_name == "prototype_start": - $HiroAI.set_ai_enabled(true) - $ReedAI.set_ai_enabled(true) + ai.set_ai_enabled(true) func _on_cutscene_manager_issued_command(command: CutsceneCommand, manager: CutsceneManager): diff --git a/Scripts/UI/textbox.gd b/Scripts/UI/textbox.gd index 3886d45..c49532c 100644 --- a/Scripts/UI/textbox.gd +++ b/Scripts/UI/textbox.gd @@ -22,6 +22,18 @@ enum TextboxDirection { $RightTextbox/ChatboxContainer/Chatbox/PlacementContainer/NextIndicator ] +const CAST_PORTRAITS = [ + "hiro", + "reed", + "nem" +] + +const CAST_NAMES = [ + "HIRO", + "REED", + "NEM" +] + signal dialogue_started signal dialogue_opened signal display_completed @@ -67,12 +79,15 @@ func _input(event): get_viewport().set_input_as_handled() dialogue_continued.emit() -func _dialogue_start(_who: Util.CastCharacter, dialogue: Array[String], direction: TextboxDirection): +func _dialogue_start(who: Util.CastCharacter, portrait_set: String, portrait_emotion: String, dialogue: Array[String], direction: TextboxDirection): _next = 0 _direction = direction _dialogue = dialogue - _text = _dialogue[_next] + _text = "{name}: {text}".format({"name": CAST_NAMES[who], "text": _dialogue[_next]}) _display_text = "" + var portrait_texture = load("res://Portraits/{0}_{1}_{2}.png".format([CAST_PORTRAITS[who], portrait_set, portrait_emotion])) + for portrait in _portraits: + portrait.texture = portrait_texture animation_player.play("show_" + _directions[_direction]) dialogue_started.emit() @@ -101,4 +116,4 @@ func _on_animation_finished(anim_name: StringName): func _on_cutscene_command_issued(command: CutsceneCommand, _manager: CutsceneManager): if command is ShowDialogueCommand: - _dialogue_start(command.character, command.messages, command.textbox_direction) + _dialogue_start(command.character, command.portrait_set, command.portrait_emotion, command.messages, command.textbox_direction) diff --git a/UI/textbox_ui.tscn b/UI/textbox_ui.tscn index fba752d..156db63 100644 --- a/UI/textbox_ui.tscn +++ b/UI/textbox_ui.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://Scripts/UI/textbox.gd" id="1_nbji8"] [ext_resource type="FontFile" uid="uid://bgqotudi6bifk" path="res://UI/Gundam 00 font gaufont.ttf" id="1_p6ypw"] -[ext_resource type="Texture2D" uid="uid://b7opep16uyb5r" path="res://Hiro/testportrait.png" id="2_6wmjm"] +[ext_resource type="Texture2D" uid="uid://du2iwu36y3l5p" path="res://Portraits/hiro_default_normal.png" id="3_cbor4"] [sub_resource type="LabelSettings" id="LabelSettings_ydgvr"] font = ExtResource("1_p6ypw") @@ -184,9 +184,10 @@ anchors_preset = -1 anchor_right = 0.286 anchor_bottom = 1.0 grow_vertical = 0 -texture = ExtResource("2_6wmjm") +texture = ExtResource("3_cbor4") expand_mode = 1 stretch_mode = 5 +flip_h = true [node name="RightTextbox" type="Control" parent="."] layout_mode = 3 @@ -268,7 +269,7 @@ anchor_left = 0.65 anchor_right = 1.0 anchor_bottom = 1.0 grow_vertical = 0 -texture = ExtResource("2_6wmjm") +texture = ExtResource("3_cbor4") expand_mode = 1 stretch_mode = 5 diff --git a/project.godot b/project.godot index 08581b7..6e383d7 100644 --- a/project.godot +++ b/project.godot @@ -36,6 +36,14 @@ enabled=PackedStringArray("res://addons/godot_state_charts/plugin.cfg") [input] +ui_accept={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194309,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194310,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":32,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null) +] +} ui_left={ "deadzone": 0.5, "events": [null, null] diff --git a/world/world.tscn b/world/world.tscn index 0035174..41764de 100644 --- a/world/world.tscn +++ b/world/world.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=30 format=3 uid="uid://bxuxjqxxqy7ce"] +[gd_scene load_steps=28 format=3 uid="uid://bxuxjqxxqy7ce"] [ext_resource type="PackedScene" uid="uid://di21xheryhp0k" path="res://Hiro/hiro_player.tscn" id="1_c1gpq"] [ext_resource type="PackedScene" uid="uid://b8sfype1vx5ad" path="res://Nem/nem_npc.tscn" id="1_sqt7d"] @@ -7,8 +7,6 @@ [ext_resource type="Script" path="res://Scripts/UI/pause_menu.gd" id="2_nw73f"] [ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="2_o5str"] [ext_resource type="Texture2D" uid="uid://b40la2vyf4rn6" path="res://world/Fighting Dojo BG.png" id="4_elb6q"] -[ext_resource type="PackedScene" uid="uid://dd2km6qhpdicx" path="res://Hiro/hiro_ai.tscn" id="5_r7nw4"] -[ext_resource type="PackedScene" uid="uid://bakb5a7xe4qby" path="res://Reed/reed_player.tscn" id="6_cn8e2"] [ext_resource type="Texture2D" uid="uid://dc12iaho4b8yl" path="res://world/walls.png" id="7_pp5dn"] [ext_resource type="PackedScene" uid="uid://c503u0i421w34" path="res://world/pillar.tscn" id="8_mxq55"] [ext_resource type="Script" path="res://Scripts/explosion_generator.gd" id="9_df2wo"] @@ -99,7 +97,6 @@ offset_bottom = 155.0 scale = Vector2(0.75, 0.75) size_flags_horizontal = 0 enabled = false -initial_node_to_watch = NodePath("../../../HiroAI") [node name="MapElements" type="Node2D" parent="."] y_sort_enabled = true @@ -165,9 +162,6 @@ zoom = Vector2(2, 2) position_smoothing_enabled = true position_smoothing_speed = 3.0 -[node name="ReedPlayer" parent="." instance=ExtResource("6_cn8e2")] -position = Vector2(40, -12) - [node name="NemNPC" parent="." instance=ExtResource("1_sqt7d")] position = Vector2(2, -78) @@ -182,14 +176,6 @@ position = Vector2(-1341, -243) scale = Vector2(8.83789, 4.22585) polygon = PackedVector2Array(158.522, 76.9076, 161.916, 75.961, 172.213, 75.961, 175.834, 76.671, 177.757, 78.5641, 179.341, 82.8236, 180.134, 85.8999, 180.134, 93.9456, 180.134, 114.06, 179.341, 117.373, 177.871, 119.739, 174.929, 120.922, 169.497, 120.922, 169.497, 123.525, 164.745, 123.525, 164.632, 120.922, 159.201, 120.922, 156.372, 120.213, 154.901, 117.373, 154.109, 113.587, 154.109, 94.1822, 154.109, 86.1365, 152.186, 83.0602, 152.412, 80.9304, 146.181, 70.3743, 139.513, 85.4266, 135.779, 90.8692, 147.66, 124.945, 187.367, 125.038, 195.514, 91.4351, 192.232, 66.1148, 173.676, 53.3363, 157.382, 53.8096, 152.404, 63.2751, 153.317, 81.6403, 154.109, 85.8999, 154.901, 83.2969, 156.485, 78.5641) -[node name="HiroAI" parent="." node_paths=PackedStringArray("player_character") instance=ExtResource("5_r7nw4")] -position = Vector2(-1, 67) -player_character = NodePath("../HiroPlayer") -KNOCKBACK_REPOSITION_POWER = 90 -MELEE_RADIUS = 300 -health = 400 -attack_power = 10 - [node name="ExplosionGenerator" type="Node" parent="."] script = ExtResource("9_df2wo") @@ -235,14 +221,20 @@ script = ExtResource("19_5yvrq") cutscene = ExtResource("20_elypl") [node name="ReedAI" parent="." node_paths=PackedStringArray("player_character") instance=ExtResource("21_dioix")] -process_mode = 4 -position = Vector2(64, -16) +position = Vector2(44, -12) player_character = NodePath("../HiroPlayer") KNOCKBACK_REPOSITION_POWER = 90 MELEE_RADIUS = 300 +chase_speed = 65 +approach_speed = 40 +min_recoil_time = 0.05 +max_recoil_time = 1.0 reduce_recoil_time_threshold = 0.75 +max_health = 400 health = 400 attack_power = 10 +KNOCKBACK_POWER = 40.0 +KNOCKBACK_RANDOMNESS = 50.0 [node name="MusicManager" parent="." instance=ExtResource("24_03wyf")] @@ -256,28 +248,22 @@ script = ExtResource("24_6ypry") [connection signal="dialogue_completed" from="TextboxUI" to="CutsceneManager" method="_on_ui_dialogue_completed"] [connection signal="dialogue_continued" from="TextboxUI" to="SoundManager" method="_on_ui_dialogue_continued"] [connection signal="dialogue_opened" from="TextboxUI" to="SoundManager" method="_on_ui_dialogue_opened"] -[connection signal="attack_did_hit" from="HiroPlayer" to="HiroAI" method="_on_player_attack_did_hit"] +[connection signal="attack_did_hit" from="HiroPlayer" to="ReedAI" method="_on_player_attack_did_hit"] [connection signal="attacked" from="HiroPlayer" to="SoundManager" method="_on_humanoid_character_attacked"] [connection signal="defeated" from="HiroPlayer" to="." method="_on_player_defeated"] -[connection signal="defeated" from="HiroPlayer" to="HiroAI" method="_on_player_been_defeated"] [connection signal="defeated" from="HiroPlayer" to="ReedAI" method="_on_player_been_defeated"] [connection signal="got_hurt" from="HiroPlayer" to="CanvasLayer/BattleUI" method="_on_player_got_hurt"] [connection signal="got_hurt" from="HiroPlayer" to="SoundManager" method="_on_character_got_hurt"] -[connection signal="attack_did_hit" from="HiroAI" to="HiroPlayer" method="_on_enemy_attack_did_hit"] -[connection signal="attacked" from="HiroAI" to="SoundManager" method="_on_humanoid_character_attacked"] -[connection signal="defeated" from="HiroAI" to="." method="_on_ai_defeated"] -[connection signal="got_hurt" from="HiroAI" to="CanvasLayer/BattleUI" method="_on_enemy_got_hurt"] -[connection signal="got_hurt" from="HiroAI" to="SoundManager" method="_on_character_got_hurt"] [connection signal="finished" from="CutsceneManager" to="." method="_on_cutscene_finished"] [connection signal="issued_command" from="CutsceneManager" to="." method="_on_cutscene_manager_issued_command"] [connection signal="issued_command" from="CutsceneManager" to="TextboxUI" method="_on_cutscene_command_issued"] -[connection signal="issued_command" from="CutsceneManager" to="HiroAI" method="_on_cutscene_issued_command"] [connection signal="issued_command" from="CutsceneManager" to="CutsceneManager" method="_on_issued_command"] [connection signal="issued_command" from="CutsceneManager" to="MusicManager" method="_on_cutscene_issued_command"] [connection signal="started" from="CutsceneManager" to="." method="_on_cutscene_started"] [connection signal="attack_did_hit" from="ReedAI" to="HiroPlayer" method="_on_enemy_attack_did_hit"] -[connection signal="defeated" from="ReedAI" to="." method="_on_ai_defeated"] +[connection signal="attacked" from="ReedAI" to="SoundManager" method="_on_humanoid_character_attacked"] [connection signal="got_hurt" from="ReedAI" to="CanvasLayer/BattleUI" method="_on_enemy_got_hurt"] +[connection signal="got_hurt" from="ReedAI" to="SoundManager" method="_on_character_got_hurt"] [connection signal="game_pause_toggled" from="GameState" to="PauseMenu" method="_on_game_pause_toggled"] [connection signal="game_pause_toggled" from="GameState" to="MusicManager" method="_on_game_pause_toggled"] [connection signal="game_pause_toggled" from="GameState" to="SoundManager" method="_on_game_pause_toggled"]