diff --git a/addons/escoria-core/game/core-scripts/esc/commands/say.gd b/addons/escoria-core/game/core-scripts/esc/commands/say.gd index f634d256..5e1407e9 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/say.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/say.gd @@ -100,7 +100,17 @@ func run(command_params: Array) -> int: "[%s]: No dialog player was registered and the say command was encountered." % get_command_name() ) + escoria.current_state = escoria.GAME_STATE.DEFAULT return ESCExecution.RC_ERROR + + if not escoria.main.current_scene.player: + escoria.logger.warn( + self, + "[%s]: No player item in the current scene was registered and the say command was encountered." + % get_command_name() + ) + escoria.current_state = escoria.GAME_STATE.DEFAULT + return ESCExecution.RC_CANCEL # Replace the names of any globals in "{ }" with their value command_params[1] = escoria.globals_manager.replace_globals(command_params[1]) diff --git a/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd b/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd index ae6ca609..65de762a 100644 --- a/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd +++ b/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd @@ -748,13 +748,13 @@ func _is_object_actionable(obj: ESCObject) -> bool: return false if not obj.active: - escoria.logger.debug( + escoria.logger.trace( self, "Item %s is not active." % obj.global_id ) object_is_actionable = false elif not obj.interactive: - escoria.logger.debug( + escoria.logger.trace( self, "Item %s is not interactive." % obj.global_id ) diff --git a/addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd b/addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd index e738e88f..7e39137a 100644 --- a/addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd +++ b/addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd @@ -89,7 +89,7 @@ func change_scene(room_path: String, enable_automatic_transitions: bool) -> void if escoria.dialog_player: escoria.dialog_player.interrupt() - escoria.inputs_manager.clear_stack() + escoria.inputs_manager.hover_stack_clear() # Check if game scene was loaded if not escoria.game_scene: diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_object.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_object.gd index 7f81da69..3ad66d9f 100644 --- a/addons/escoria-core/game/core-scripts/esc/types/esc_object.gd +++ b/addons/escoria-core/game/core-scripts/esc/types/esc_object.gd @@ -97,6 +97,9 @@ func _get_interactive() -> bool: func _set_interactive(value: bool): if "is_interactive" in self.node: self.node.is_interactive = value + if not value: + escoria.game_scene.clear_tooltip() + escoria.inputs_manager.on_item_non_interactive(self.node) # Return the data of the object to be inserted in a savegame file. diff --git a/addons/escoria-core/game/core-scripts/esc_game.gd b/addons/escoria-core/game/core-scripts/esc_game.gd index b9074a50..dde467bc 100644 --- a/addons/escoria-core/game/core-scripts/esc_game.gd +++ b/addons/escoria-core/game/core-scripts/esc_game.gd @@ -111,6 +111,12 @@ func _draw(): draw_rect(mouse_limits, ColorN("red"), false, 10.0) +# Clears the tooltip content (if an ESCTooltip node exists in UI) +func clear_tooltip(): + if tooltip_node != null: + (tooltip_node as ESCTooltip).clear() + + # Sets up and performs default walking action # # #### Parameters diff --git a/addons/escoria-core/game/core-scripts/esc_item.gd b/addons/escoria-core/game/core-scripts/esc_item.gd index 44fdaafd..eeab2378 100644 --- a/addons/escoria-core/game/core-scripts/esc_item.gd +++ b/addons/escoria-core/game/core-scripts/esc_item.gd @@ -188,8 +188,8 @@ func _ready(): validate_animations(animations) - if not self.is_connected("mouse_entered", self, "_on_mouse_entered"): - connect("mouse_entered", self, "_on_mouse_entered") + if not self.is_connected("input_event", self, "_on_input_event"): + connect("input_event", self, "_on_input_event") if not self.is_connected("mouse_exited", self, "_on_mouse_exited"): connect("mouse_exited", self, "_on_mouse_exited") @@ -294,6 +294,47 @@ func _ready(): _movable.last_scale = scale _movable.update_terrain() + +# Mouse exited happens on any item that mouse cursor exited, even those UNDER +# the top level of overlapping stack. +func _on_mouse_exited(): + if escoria.inputs_manager.hover_stack.has(self): + escoria.inputs_manager.hover_stack_erase_item(self) + escoria.inputs_manager.unset_hovered_node(self) + + +class HoverStackSorter: + static func sort_ascending_z_index(a, b): + if a.z_index < b.z_index: + return true + return false + + +# Manage input events on the item +# +# #### Parameters +# +# - _viewport: the viewport node the event entered +# - event: the input event +# - _shape_idx is the child index of the clicked Shape2D. +func _on_input_event(_viewport: Object, event: InputEvent, _shape_idx: int): + if event is InputEventMouseMotion: + var physics2d_dss: Physics2DDirectSpaceState = get_world_2d().direct_space_state + var colliding: Array = physics2d_dss.intersect_point(event.global_position, 32, [], 0x7FFFFFFF, true, true) + var colliding_nodes = [] + for c in colliding: + if c.collider.get("global_id") \ + and escoria.action_manager.is_object_actionable(c.collider.global_id): + colliding_nodes.push_back(c.collider) + + if colliding_nodes.empty(): + return + colliding_nodes.sort_custom(HoverStackSorter, "sort_ascending_z_index") + escoria.inputs_manager.hover_stack_clear() + escoria.inputs_manager.hover_stack_add_items(colliding_nodes) + escoria.inputs_manager.set_hovered_node(colliding_nodes.back()) + + # Manage mouse button clicks on this item by sending out signals # # #### Parameters @@ -334,7 +375,7 @@ func _unhandled_input(input_event: InputEvent) -> void: ) return var p = get_global_mouse_position() - if _is_in_shape(p): + if _is_in_shape(p) and escoria.action_manager.is_object_actionable(global_id): if event.doubleclick and event.button_index == BUTTON_LEFT: emit_signal("mouse_double_left_clicked_item", self, event) get_tree().set_input_as_handled() @@ -472,12 +513,13 @@ func get_interact_position() -> Vector2: # React to the mouse entering the item by emitting the respective signal -func _on_mouse_entered(): - emit_signal("mouse_entered_item", self) +func mouse_entered(): + if escoria.action_manager.is_object_actionable(global_id): + emit_signal("mouse_entered_item", self) # React to the mouse exiting the item by emitting the respective signal -func _on_mouse_exited(): +func mouse_exited(): emit_signal("mouse_exited_item", self) diff --git a/addons/escoria-core/game/core-scripts/esc_player.gd b/addons/escoria-core/game/core-scripts/esc_player.gd index fb97dbb3..31371bad 100644 --- a/addons/escoria-core/game/core-scripts/esc_player.gd +++ b/addons/escoria-core/game/core-scripts/esc_player.gd @@ -22,5 +22,3 @@ func _ready(): ._ready() else: tooltip_name = "" - if is_connected("input_event", self, "manage_input"): - disconnect("input_event", self, "manage_input") diff --git a/addons/escoria-core/game/esc_inputs_manager.gd b/addons/escoria-core/game/esc_inputs_manager.gd index 896b1c5f..6b0116c6 100644 --- a/addons/escoria-core/game/esc_inputs_manager.gd +++ b/addons/escoria-core/game/esc_inputs_manager.gd @@ -48,6 +48,27 @@ var hotspot_focused: String = "" # **Returns** Whether the function processed the event. var custom_input_handler = null +# The currently hovered element. Usually the one on top of the hover stack. +var _hovered_element = null + + +# Constructor +func _init(): + escoria.event_manager.connect("event_finished", self, "_on_event_finished") + + +# Called when an event is finished, so that the current hotspot is reset +# +# #### Parameters +# +# - return_code: The return code of the event +# - event_name: the name of the event +# +func _on_event_finished(return_code: int, event_name: String): + if _hovered_element == null: + hotspot_focused = "" + + # Register core signals (from escoria.gd) func register_core(): escoria.game_scene.connect( @@ -154,9 +175,44 @@ func try_custom_input_handler(event: InputEvent, is_default_state: bool) -> bool return false -# Clear the stack of hovered items -func clear_stack(): - hover_stack = [] + +# Unsets the hovered node. +# +# **Parameters** +# +# - item: the item that was unfocused (mouse_exited) +func unset_hovered_node(item: ESCItem): + if _hovered_element == item: + _hovered_element.mouse_exited() + _hovered_element = null + hotspot_focused = "" + + +# Sets the hovered node and calls its mouse_entered() method if it was the top +# most item in hover_stack. +# +# #### Parameters +# +# - item: the item that was focused (mouse_entered) +# +# **Returns** +# True if item is the new top hovered object +func set_hovered_node(item: ESCItem) -> bool: + # If tested item was already hovered + # or is not actionable (not selectable for ESCPlayer) then do nothing + if _hovered_element == item \ + or not escoria.action_manager.is_object_actionable(item.global_id) \ + or (item is ESCPlayer and not (item as ESCPlayer).selectable): + return true + # Else if the tested item is on top of hover stack (or null) + # Set that item as hovered and call that item's mouse_entered() + if _hovered_element == null or hover_stack.back() != item: + _hovered_element = item + _hovered_element.mouse_entered() + return true + # Else, the tested item is currently on top of hover stack, then do nothing + else: + return false # The background was clicked with the LMB @@ -165,7 +221,8 @@ func clear_stack(): # # - position: Position of the click func _on_left_click_on_bg(position: Vector2) -> void: - if input_mode == INPUT_ALL and hotspot_focused.empty(): + if input_mode == INPUT_ALL: # and hotspot_focused.empty(): + hotspot_focused = "" escoria.logger.info( self, "Left click on background at %s." % str(position) @@ -179,7 +236,8 @@ func _on_left_click_on_bg(position: Vector2) -> void: # # - position: Position of the click func _on_double_left_click_on_bg(position: Vector2) -> void: - if input_mode == INPUT_ALL and hotspot_focused.empty(): + if input_mode == INPUT_ALL: # and hotspot_focused.empty(): + hotspot_focused = "" escoria.logger.info( self, "Double left click on background at %s." % str(position) @@ -295,31 +353,32 @@ func _on_mouse_exited_inventory_item() -> void: # - item: The Escoria item hovered func _on_mouse_entered_item(item: ESCItem) -> void: if item as ESCPlayer and not (item as ESCPlayer).selectable: - escoria.logger.debug( - self, - "Ignoring mouse entering player %s: Player not selectable." % [item.global_id] - ) - return - + escoria.logger.trace( + self, + "Ignoring mouse entering player %s: Player not selectable." % [item.global_id] + ) + if hover_stack.empty(): + hotspot_focused = "" + escoria.main.current_scene.game.element_unfocused() + else: + hotspot_focused = hover_stack.back().global_id + escoria.main.current_scene.game.element_focused(hotspot_focused) + return + if not escoria.action_manager.is_object_actionable(item.global_id): escoria.logger.debug( self, "Ignoring mouse entering item %s." % [item.global_id] ) - return escoria.logger.info( self, "Item focused: %s" % item.global_id ) - _clean_hover_stack() - hover_stack.push_back(item) - hover_stack.sort_custom(HoverStackSorter, "sort_ascending_z_index") - - hotspot_focused = hover_stack.back().global_id - escoria.main.current_scene.game.element_focused(hotspot_focused) + hotspot_focused = item.global_id + escoria.main.current_scene.game.element_focused(item.global_id) # The mouse exited an Escoria item @@ -328,11 +387,23 @@ func _on_mouse_entered_item(item: ESCItem) -> void: # # - item: The Escoria item hovered func _on_mouse_exited_item(item: ESCItem) -> void: + var object: ESCObject = escoria.object_manager.get_object(item.global_id) + if object and not object.interactive: + hover_stack_erase_item(item) + escoria.main.current_scene.game.element_unfocused() + return + + if object and not object.interactive: + return + if object and object.node is ESCPlayer and not (object.node as ESCPlayer).selectable: + hotspot_focused = "" + return + escoria.logger.info( self, - "Item unfocused: %s" % item.global_id + "Item unfocused: %s" % hotspot_focused ) - _hover_stack_erase_item(item) + if hover_stack.empty(): hotspot_focused = "" escoria.main.current_scene.game.element_unfocused() @@ -341,6 +412,25 @@ func _on_mouse_exited_item(item: ESCItem) -> void: escoria.main.current_scene.game.element_focused(hotspot_focused) +# Function called when the item is set interactive, to re-trigger an input on +# underlying item. +# +# #### Parameters +# +# - item: The ESCCItem that was set non-interactive +func on_item_non_interactive(item: ESCItem) -> void: + var object: ESCObject = escoria.object_manager.get_object(item.global_id) + if object and not object.interactive: + hover_stack_erase_item(item) + escoria.main.current_scene.game.element_unfocused() + hover_stack.sort_custom(HoverStackSorter, "sort_ascending_z_index") + if hover_stack.empty(): + return + else: + var new_item = hover_stack.back() + escoria.action_manager.set_action_input_state(ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM) + new_item.mouse_entered() + # An Escoria item was clicked with the LMB # # #### Parameters @@ -349,39 +439,37 @@ func _on_mouse_exited_item(item: ESCItem) -> void: # - event: The input event from the click func _on_mouse_left_clicked_item(item: ESCItem, event: InputEvent) -> void: if input_mode == INPUT_ALL: + # Manage clicking through ESCPlayer (if ESCPlayer.selectable is false) if item as ESCPlayer and not (item as ESCPlayer).selectable: - escoria.logger.debug( + escoria.logger.trace( self, - "Ignoring left click on player %s: Player not selectable." % [item.global_id] + "Ignoring left click on player %s: Player not selectable." + % [item.global_id] ) - + + # Get next object in hover stack and forward event to it if not hover_stack.empty(): var next_item = hover_stack.pop_back() _on_mouse_left_clicked_item(next_item, event) - + else: # if no next object, consider this click as background click + hotspot_focused = "" + _on_left_click_on_bg(event.position) return - if not escoria.action_manager.is_object_actionable(item.global_id): - escoria.logger.debug( - self, - "Ignoring left click on %s with event %s." % [item.global_id, event] - ) - - # Treat this as a background click now + # Clicked object can't be actioned and there is no other object behind + # We consider this click as a background click + if not escoria.action_manager.is_object_actionable(item.global_id) \ + and hover_stack.empty(): + hotspot_focused = "" _on_left_click_on_bg(event.position) - return - - if hover_stack.empty() or hover_stack.back() == item: - escoria.logger.info( - self, - "Item %s left clicked with event %s." % [item.global_id, event] - ) - hotspot_focused = item.global_id - escoria.main.current_scene.game.left_click_on_item( - item.global_id, - event - ) + + # Finally, execute the action on the ESCItem + hotspot_focused = item.global_id + escoria.main.current_scene.game.left_click_on_item( + item.global_id, + event + ) # An Escoria item was double-clicked with the LMB @@ -395,33 +483,32 @@ func _on_mouse_left_double_clicked_item( event: InputEvent ) -> void: if input_mode == INPUT_ALL: + # Manage clicking through ESCPlayer (if ESCPlayer.selectable is false) if item as ESCPlayer and not (item as ESCPlayer).selectable: - escoria.logger.debug( + escoria.logger.trace( self, - "Ignoring double-left click on player %s: Player not selectable." % [item.global_id] + "Ignoring double left click on player %s: Player not selectable." + % [item.global_id] ) - + + # Get next object in hover stack and forward event to it if not hover_stack.empty(): var next_item = hover_stack.pop_back() _on_mouse_left_double_clicked_item(next_item, event) - + else: # if no next object, consider this click as background click + hotspot_focused = "" + _on_double_left_click_on_bg(event.position) return - if not escoria.action_manager.is_object_actionable(item.global_id): - escoria.logger.debug( - self, - "Ignoring double-left click on %s with event %s." % [item.global_id, event] - ) - - # Treat this as a background click now + # Clicked object can't be actioned and there is no other object behind + # We consider this click as a background click + if not escoria.action_manager.is_object_actionable(item.global_id) \ + and hover_stack.empty(): + hotspot_focused = "" _on_double_left_click_on_bg(event.position) - return - - escoria.logger.info( - self, - "Item %s left double clicked with event %s." % [item.global_id, event] - ) + + # Finally, execute the action on the ESCItem hotspot_focused = item.global_id escoria.main.current_scene.game.left_double_click_on_item( item.global_id, @@ -446,29 +533,46 @@ func _on_mouse_right_clicked_item(item: ESCItem, event: InputEvent) -> void: if not hover_stack.empty(): var next_item = hover_stack.pop_back() _on_mouse_right_clicked_item(next_item, event) - return - if not escoria.action_manager.is_object_actionable(item.global_id): - escoria.logger.debug( + if not escoria.action_manager.is_object_actionable(item.global_id) \ + and hover_stack.empty(): + # Treat this as a background click now + hotspot_focused = "" + _on_right_click_on_bg(event.position) + return + + var actual_item + + # We check if the clicked object is ESCPlayer and not selectable. If so + # we consider we clicked through it. + var object: ESCObject = escoria.object_manager.get_object(item.global_id) + if object.node is ESCPlayer and not (object.node as ESCPlayer).selectable: + actual_item = hover_stack.back() + else: + actual_item = item + + if actual_item == null: + if event.position: + (escoria.main.current_scene.game as ESCGame).right_click_on_bg(event.position) + else: + escoria.logger.info( + self, + "Clicked item %s with event %s cannot be activated (player not selectable or not interactive).\n" + % [item.global_id, event] + + "No valid item found in the items stack. Action cancelled." + ) + else: + escoria.logger.info( self, - "Ignoring right click on %s with event %s." % [item.global_id, event] + "Item %s right clicked with event %s." % [actual_item.global_id, event] + ) + hotspot_focused = actual_item.global_id + escoria.main.current_scene.game.right_click_on_item( + actual_item.global_id, + event ) - # Treat this as a background click now - _on_right_click_on_bg(event.position) - - return - - escoria.logger.info( - self, - "Item %s right clicked with event %s." % [item.global_id, event] - ) - hotspot_focused = item.global_id - escoria.main.current_scene.game.right_click_on_item( - item.global_id, - event - ) # The mousewheel was turned @@ -485,6 +589,27 @@ func _on_pause_menu_requested(): escoria.main.current_scene.game.pause_game() +# Add the given item to the stack if not already in it. +# +# #### Parameters +# - item: the item to add to the hover stack +func hover_stack_add_item(item): + if item is ESCPlayer and not (item as ESCPlayer).selectable: + return + if not hover_stack.has(item): + hover_stack.push_back(item) + hover_stack.sort_custom(HoverStackSorter, "sort_ascending_z_index") + + +# Add the items contained in given list to the stack if not already in it. +# +# #### Parameters +# - items: the items list (array) to add to the hover stack +func hover_stack_add_items(items: Array): + for item in items: + hover_stack_add_item(item) + + # Clean the hover stack func _clean_hover_stack(): for e in hover_stack: @@ -496,8 +621,14 @@ func _clean_hover_stack(): # # #### Parameters # - item: the item to remove from the hover stack -func _hover_stack_erase_item(item): +func hover_stack_erase_item(item): hover_stack.erase(item) + hover_stack.sort_custom(HoverStackSorter, "sort_ascending_z_index") + + +# Clear the stack of hovered items +func hover_stack_clear(): + hover_stack = [] class HoverStackSorter: diff --git a/addons/escoria-ui-9verbs/game.gd b/addons/escoria-ui-9verbs/game.gd index e3e9e47a..0b9ec126 100644 --- a/addons/escoria-ui-9verbs/game.gd +++ b/addons/escoria-ui-9verbs/game.gd @@ -357,7 +357,7 @@ func _on_MenuButton_pressed() -> void: func _on_action_finished() -> void: verbs_menu.unselect_actions() - tooltip.clear() + func _on_event_done(_return_code: int, _event_name: String): if _return_code == ESCExecution.RC_OK: diff --git a/game/characters/mark/mark.tscn b/game/characters/mark/mark.tscn index 08cd4d6c..4db13821 100644 --- a/game/characters/mark/mark.tscn +++ b/game/characters/mark/mark.tscn @@ -10,27 +10,57 @@ [ext_resource path="res://game/characters/mark/mark_animations.tres" type="Resource" id=8] [ext_resource path="res://game/characters/mark/png/markjester_talk.png" type="Texture" id=9] -[sub_resource type="AtlasTexture" id=71] -atlas = ExtResource( 3 ) -region = Rect2( 408, 0, 24, 70 ) +[sub_resource type="AtlasTexture" id=18] +atlas = ExtResource( 4 ) +region = Rect2( 0, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=72] +[sub_resource type="AtlasTexture" id=67] +flags = 4 atlas = ExtResource( 3 ) -region = Rect2( 432, 0, 24, 70 ) +region = Rect2( 0, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=73] -atlas = ExtResource( 3 ) -region = Rect2( 456, 0, 24, 70 ) +[sub_resource type="AtlasTexture" id=4] +atlas = ExtResource( 4 ) +region = Rect2( 120, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=74] +[sub_resource type="AtlasTexture" id=66] +flags = 4 atlas = ExtResource( 3 ) -region = Rect2( 480, 0, 24, 70 ) +region = Rect2( 120, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=75] +[sub_resource type="AtlasTexture" id=11] +atlas = ExtResource( 4 ) +region = Rect2( 24, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=69] +flags = 4 atlas = ExtResource( 3 ) -region = Rect2( 504, 0, 24, 70 ) +region = Rect2( 24, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=17] +atlas = ExtResource( 4 ) +region = Rect2( 96, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=70] +flags = 4 +atlas = ExtResource( 3 ) +region = Rect2( 96, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=27] +atlas = ExtResource( 4 ) +region = Rect2( 48, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=65] +flags = 4 +atlas = ExtResource( 3 ) +region = Rect2( 48, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=5] +atlas = ExtResource( 4 ) +region = Rect2( 72, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=68] +flags = 4 atlas = ExtResource( 3 ) region = Rect2( 72, 0, 24, 70 ) @@ -46,102 +76,88 @@ region = Rect2( 24, 0, 24, 70 ) atlas = ExtResource( 2 ) region = Rect2( 48, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=17] -atlas = ExtResource( 4 ) -region = Rect2( 96, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=67] -atlas = ExtResource( 3 ) -region = Rect2( 0, 0, 24, 70 ) - [sub_resource type="AtlasTexture" id=56] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 0, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=57] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 24, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=58] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 48, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=70] -atlas = ExtResource( 3 ) -region = Rect2( 96, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=17] -atlas = ExtResource( 4 ) -region = Rect2( 96, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=22] -atlas = ExtResource( 4 ) -region = Rect2( 216, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=23] -atlas = ExtResource( 4 ) -region = Rect2( 240, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=24] -atlas = ExtResource( 4 ) -region = Rect2( 264, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=25] -atlas = ExtResource( 4 ) -region = Rect2( 288, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=26] -atlas = ExtResource( 4 ) -region = Rect2( 312, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=53] -atlas = ExtResource( 3 ) -region = Rect2( 144, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=54] -atlas = ExtResource( 3 ) -region = Rect2( 168, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=55] -atlas = ExtResource( 3 ) -region = Rect2( 192, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=33] +[sub_resource type="AtlasTexture" id=59] +flags = 4 atlas = ExtResource( 9 ) -region = Rect2( 264, 0, 24, 70 ) +region = Rect2( 432, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=34] +[sub_resource type="AtlasTexture" id=60] +flags = 4 atlas = ExtResource( 9 ) -region = Rect2( 288, 0, 24, 70 ) +region = Rect2( 456, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=35] -atlas = ExtResource( 3 ) -region = Rect2( 336, 0, 24, 70 ) +[sub_resource type="AtlasTexture" id=61] +flags = 4 +atlas = ExtResource( 9 ) +region = Rect2( 480, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=36] -atlas = ExtResource( 3 ) -region = Rect2( 360, 0, 24, 70 ) +[sub_resource type="AtlasTexture" id=28] +atlas = ExtResource( 5 ) +region = Rect2( 0, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=37] -atlas = ExtResource( 3 ) -region = Rect2( 384, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=69] -atlas = ExtResource( 3 ) +[sub_resource type="AtlasTexture" id=29] +atlas = ExtResource( 5 ) region = Rect2( 24, 0, 24, 70 ) +[sub_resource type="AtlasTexture" id=30] +atlas = ExtResource( 5 ) +region = Rect2( 48, 0, 24, 70 ) + [sub_resource type="AtlasTexture" id=62] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 72, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=63] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 96, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=64] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 120, 0, 24, 70 ) +[sub_resource type="AtlasTexture" id=48] +flags = 4 +atlas = ExtResource( 9 ) +region = Rect2( 312, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=49] +flags = 4 +atlas = ExtResource( 9 ) +region = Rect2( 336, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=50] +flags = 4 +atlas = ExtResource( 9 ) +region = Rect2( 360, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=51] +flags = 4 +atlas = ExtResource( 9 ) +region = Rect2( 384, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=52] +flags = 4 +atlas = ExtResource( 9 ) +region = Rect2( 408, 0, 24, 70 ) + [sub_resource type="AtlasTexture" id=6] atlas = ExtResource( 7 ) region = Rect2( 0, 0, 24, 70 ) @@ -163,37 +179,30 @@ atlas = ExtResource( 7 ) region = Rect2( 96, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=38] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 144, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=39] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 168, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=40] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 192, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=41] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 216, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=42] +flags = 4 atlas = ExtResource( 9 ) region = Rect2( 240, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=59] -atlas = ExtResource( 9 ) -region = Rect2( 432, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=60] -atlas = ExtResource( 9 ) -region = Rect2( 456, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=61] -atlas = ExtResource( 9 ) -region = Rect2( 480, 0, 24, 70 ) - [sub_resource type="AtlasTexture" id=12] atlas = ExtResource( 6 ) region = Rect2( 0, 0, 24, 70 ) @@ -202,13 +211,15 @@ region = Rect2( 0, 0, 24, 70 ) atlas = ExtResource( 6 ) region = Rect2( 24, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=66] -atlas = ExtResource( 3 ) -region = Rect2( 120, 0, 24, 70 ) +[sub_resource type="AtlasTexture" id=33] +flags = 4 +atlas = ExtResource( 9 ) +region = Rect2( 264, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=11] -atlas = ExtResource( 4 ) -region = Rect2( 24, 0, 24, 70 ) +[sub_resource type="AtlasTexture" id=34] +flags = 4 +atlas = ExtResource( 9 ) +region = Rect2( 288, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=19] atlas = ExtResource( 4 ) @@ -222,54 +233,91 @@ region = Rect2( 168, 0, 24, 70 ) atlas = ExtResource( 4 ) region = Rect2( 192, 0, 24, 70 ) +[sub_resource type="AtlasTexture" id=53] +flags = 4 +atlas = ExtResource( 3 ) +region = Rect2( 144, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=54] +flags = 4 +atlas = ExtResource( 3 ) +region = Rect2( 168, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=55] +flags = 4 +atlas = ExtResource( 3 ) +region = Rect2( 192, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=71] +flags = 4 +atlas = ExtResource( 3 ) +region = Rect2( 408, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=72] +flags = 4 +atlas = ExtResource( 3 ) +region = Rect2( 432, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=73] +flags = 4 +atlas = ExtResource( 3 ) +region = Rect2( 456, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=74] +flags = 4 +atlas = ExtResource( 3 ) +region = Rect2( 480, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=75] +flags = 4 +atlas = ExtResource( 3 ) +region = Rect2( 504, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=22] +atlas = ExtResource( 4 ) +region = Rect2( 216, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=23] +atlas = ExtResource( 4 ) +region = Rect2( 240, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=24] +atlas = ExtResource( 4 ) +region = Rect2( 264, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=25] +atlas = ExtResource( 4 ) +region = Rect2( 288, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=26] +atlas = ExtResource( 4 ) +region = Rect2( 312, 0, 24, 70 ) + [sub_resource type="AtlasTexture" id=43] +flags = 4 atlas = ExtResource( 3 ) region = Rect2( 216, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=44] +flags = 4 atlas = ExtResource( 3 ) region = Rect2( 240, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=45] +flags = 4 atlas = ExtResource( 3 ) region = Rect2( 264, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=46] +flags = 4 atlas = ExtResource( 3 ) region = Rect2( 288, 0, 24, 70 ) [sub_resource type="AtlasTexture" id=47] +flags = 4 atlas = ExtResource( 3 ) region = Rect2( 312, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=27] -atlas = ExtResource( 4 ) -region = Rect2( 48, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=5] -atlas = ExtResource( 4 ) -region = Rect2( 72, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=65] -atlas = ExtResource( 3 ) -region = Rect2( 48, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=28] -atlas = ExtResource( 5 ) -region = Rect2( 0, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=29] -atlas = ExtResource( 5 ) -region = Rect2( 24, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=30] -atlas = ExtResource( 5 ) -region = Rect2( 48, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=4] -atlas = ExtResource( 4 ) -region = Rect2( 120, 0, 24, 70 ) - [sub_resource type="AtlasTexture" id=14] atlas = ExtResource( 4 ) region = Rect2( 336, 0, 24, 70 ) @@ -282,35 +330,76 @@ region = Rect2( 360, 0, 24, 70 ) atlas = ExtResource( 4 ) region = Rect2( 384, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=48] -atlas = ExtResource( 9 ) -region = Rect2( 312, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=49] -atlas = ExtResource( 9 ) +[sub_resource type="AtlasTexture" id=35] +flags = 4 +atlas = ExtResource( 3 ) region = Rect2( 336, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=50] -atlas = ExtResource( 9 ) +[sub_resource type="AtlasTexture" id=36] +flags = 4 +atlas = ExtResource( 3 ) region = Rect2( 360, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=51] -atlas = ExtResource( 9 ) +[sub_resource type="AtlasTexture" id=37] +flags = 4 +atlas = ExtResource( 3 ) region = Rect2( 384, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=52] -atlas = ExtResource( 9 ) -region = Rect2( 408, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=18] -atlas = ExtResource( 4 ) -region = Rect2( 0, 0, 24, 70 ) - [sub_resource type="SpriteFrames" id=31] animations = [ { -"frames": [ SubResource( 71 ), SubResource( 72 ), SubResource( 73 ), SubResource( 74 ), SubResource( 75 ) ], +"frames": [ SubResource( 18 ) ], "loop": true, -"name": "walk_left_jester", +"name": "idle_down", +"speed": 5.0 +}, { +"frames": [ SubResource( 67 ) ], +"loop": true, +"name": "idle_down_jester", +"speed": 5.0 +}, { +"frames": [ SubResource( 4 ) ], +"loop": true, +"name": "idle_down_left", +"speed": 5.0 +}, { +"frames": [ SubResource( 66 ) ], +"loop": true, +"name": "idle_down_left_jester", +"speed": 5.0 +}, { +"frames": [ SubResource( 11 ) ], +"loop": true, +"name": "idle_down_right", +"speed": 5.0 +}, { +"frames": [ SubResource( 69 ) ], +"loop": true, +"name": "idle_down_right_jester", +"speed": 5.0 +}, { +"frames": [ SubResource( 17 ) ], +"loop": true, +"name": "idle_left", +"speed": 5.0 +}, { +"frames": [ SubResource( 70 ) ], +"loop": true, +"name": "idle_left_jester", +"speed": 5.0 +}, { +"frames": [ SubResource( 27 ) ], +"loop": true, +"name": "idle_right", +"speed": 5.0 +}, { +"frames": [ SubResource( 65 ) ], +"loop": true, +"name": "idle_right_jester", +"speed": 5.0 +}, { +"frames": [ SubResource( 5 ) ], +"loop": true, +"name": "idle_up", "speed": 5.0 }, { "frames": [ SubResource( 68 ) ], @@ -323,56 +412,31 @@ animations = [ { "name": "speak_down", "speed": 6.0 }, { -"frames": [ SubResource( 17 ) ], -"loop": true, -"name": "idle_left", -"speed": 5.0 -}, { -"frames": [ SubResource( 67 ) ], -"loop": true, -"name": "idle_down_jester", -"speed": 5.0 -}, { "frames": [ SubResource( 56 ), SubResource( 57 ), SubResource( 58 ) ], "loop": true, "name": "speak_down_jester", "speed": 5.0 }, { -"frames": [ SubResource( 70 ) ], +"frames": [ SubResource( 59 ), SubResource( 60 ), SubResource( 61 ) ], "loop": true, -"name": "idle_left_jester", +"name": "speak_down_left_jester", "speed": 5.0 }, { -"frames": [ SubResource( 22 ), SubResource( 23 ), SubResource( 24 ), SubResource( 25 ), SubResource( 26 ) ], +"frames": [ SubResource( 28 ), SubResource( 29 ), SubResource( 30 ) ], "loop": true, -"name": "walk_right", +"name": "speak_down_right", "speed": 6.0 }, { -"frames": [ SubResource( 53 ), SubResource( 54 ), SubResource( 55 ), SubResource( 54 ) ], -"loop": true, -"name": "walk_down_jester", -"speed": 5.0 -}, { -"frames": [ SubResource( 33 ), SubResource( 34 ) ], -"loop": true, -"name": "speak_up_jester", -"speed": 5.0 -}, { -"frames": [ SubResource( 35 ), SubResource( 36 ), SubResource( 37 ), SubResource( 36 ) ], -"loop": true, -"name": "walk_up_jester", -"speed": 5.0 -}, { -"frames": [ SubResource( 69 ) ], -"loop": true, -"name": "idle_down_right_jester", -"speed": 5.0 -}, { "frames": [ SubResource( 62 ), SubResource( 63 ), SubResource( 64 ) ], "loop": true, "name": "speak_down_right_jester", "speed": 5.0 }, { +"frames": [ SubResource( 48 ), SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ) ], +"loop": true, +"name": "speak_left_jester", +"speed": 5.0 +}, { "frames": [ SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ) ], "loop": true, "name": "speak_right", @@ -383,24 +447,14 @@ animations = [ { "name": "speak_right_jester", "speed": 5.0 }, { -"frames": [ SubResource( 59 ), SubResource( 60 ), SubResource( 61 ) ], -"loop": true, -"name": "speak_down_left_jester", -"speed": 5.0 -}, { "frames": [ SubResource( 12 ), SubResource( 13 ), SubResource( 12 ), SubResource( 13 ), SubResource( 13 ) ], "loop": true, "name": "speak_up", "speed": 3.0 }, { -"frames": [ SubResource( 66 ) ], +"frames": [ SubResource( 33 ), SubResource( 34 ) ], "loop": true, -"name": "idle_down_left_jester", -"speed": 5.0 -}, { -"frames": [ SubResource( 11 ) ], -"loop": true, -"name": "idle_down_right", +"name": "speak_up_jester", "speed": 5.0 }, { "frames": [ SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 20 ) ], @@ -408,6 +462,21 @@ animations = [ { "name": "walk_down", "speed": 6.0 }, { +"frames": [ SubResource( 53 ), SubResource( 54 ), SubResource( 55 ), SubResource( 54 ) ], +"loop": true, +"name": "walk_down_jester", +"speed": 5.0 +}, { +"frames": [ SubResource( 71 ), SubResource( 72 ), SubResource( 73 ), SubResource( 74 ), SubResource( 75 ) ], +"loop": true, +"name": "walk_left_jester", +"speed": 5.0 +}, { +"frames": [ SubResource( 22 ), SubResource( 23 ), SubResource( 24 ), SubResource( 25 ), SubResource( 26 ) ], +"loop": true, +"name": "walk_right", +"speed": 6.0 +}, { "frames": [ SubResource( 43 ), SubResource( 44 ), SubResource( 45 ), SubResource( 46 ), SubResource( 47 ) ], "loop": true, "name": "walk_right_jester", @@ -418,44 +487,9 @@ animations = [ { "name": "walk_up", "speed": 6.0 }, { -"frames": [ SubResource( 27 ) ], +"frames": [ SubResource( 35 ), SubResource( 36 ), SubResource( 37 ), SubResource( 36 ) ], "loop": true, -"name": "idle_right", -"speed": 5.0 -}, { -"frames": [ SubResource( 5 ) ], -"loop": true, -"name": "idle_up", -"speed": 5.0 -}, { -"frames": [ SubResource( 65 ) ], -"loop": true, -"name": "idle_right_jester", -"speed": 5.0 -}, { -"frames": [ SubResource( 28 ), SubResource( 29 ), SubResource( 30 ) ], -"loop": true, -"name": "speak_down_right", -"speed": 6.0 -}, { -"frames": [ SubResource( 4 ) ], -"loop": true, -"name": "idle_down_left", -"speed": 5.0 -}, { -"frames": [ SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 15 ) ], -"loop": true, -"name": "walk_up", -"speed": 6.0 -}, { -"frames": [ SubResource( 48 ), SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ) ], -"loop": true, -"name": "speak_left_jester", -"speed": 5.0 -}, { -"frames": [ SubResource( 18 ) ], -"loop": true, -"name": "idle_down", +"name": "walk_up_jester", "speed": 5.0 } ] @@ -470,6 +504,8 @@ global_id = "player" esc_script = "res://game/characters/mark/mark.esc" is_movable = true tooltip_name = "Me" +default_action = "look" +combine_when_selected_action_is_in = [ ] dialog_color = Color( 1, 1, 1, 1 ) selectable = true animations = ExtResource( 8 ) diff --git a/game/characters/worker/worker.tscn b/game/characters/worker/worker.tscn index a81b20b6..3a3d8c64 100644 --- a/game/characters/worker/worker.tscn +++ b/game/characters/worker/worker.tscn @@ -8,6 +8,22 @@ [ext_resource path="res://game/characters/worker/png/worker_talk_down.png" type="Texture" id=6] [ext_resource path="res://game/characters/worker/png/worker_talk_right.png" type="Texture" id=7] +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 4 ) +region = Rect2( 0, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=29] +atlas = ExtResource( 3 ) +region = Rect2( 0, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=28] +atlas = ExtResource( 4 ) +region = Rect2( 48, 0, 24, 70 ) + +[sub_resource type="AtlasTexture" id=14] +atlas = ExtResource( 4 ) +region = Rect2( 384, 0, 24, 70 ) + [sub_resource type="AtlasTexture" id=4] atlas = ExtResource( 6 ) region = Rect2( 0, 0, 24, 70 ) @@ -20,14 +36,6 @@ region = Rect2( 24, 0, 24, 70 ) atlas = ExtResource( 6 ) region = Rect2( 48, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=7] -atlas = ExtResource( 5 ) -region = Rect2( 0, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=8] -atlas = ExtResource( 5 ) -region = Rect2( 24, 0, 24, 70 ) - [sub_resource type="AtlasTexture" id=9] atlas = ExtResource( 7 ) region = Rect2( 0, 0, 24, 70 ) @@ -48,14 +56,14 @@ region = Rect2( 72, 0, 24, 70 ) atlas = ExtResource( 7 ) region = Rect2( 96, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=14] -atlas = ExtResource( 4 ) -region = Rect2( 384, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=1] -atlas = ExtResource( 4 ) +[sub_resource type="AtlasTexture" id=7] +atlas = ExtResource( 5 ) region = Rect2( 0, 0, 24, 70 ) +[sub_resource type="AtlasTexture" id=8] +atlas = ExtResource( 5 ) +region = Rect2( 24, 0, 24, 70 ) + [sub_resource type="AtlasTexture" id=15] atlas = ExtResource( 4 ) region = Rect2( 144, 0, 24, 70 ) @@ -108,29 +116,21 @@ region = Rect2( 408, 0, 24, 70 ) atlas = ExtResource( 4 ) region = Rect2( 432, 0, 24, 70 ) -[sub_resource type="AtlasTexture" id=28] -atlas = ExtResource( 4 ) -region = Rect2( 48, 0, 24, 70 ) - -[sub_resource type="AtlasTexture" id=29] -atlas = ExtResource( 3 ) -region = Rect2( 0, 0, 24, 70 ) - [sub_resource type="SpriteFrames" id=2] animations = [ { -"frames": [ SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 5 ) ], +"frames": [ SubResource( 1 ) ], "loop": true, -"name": "speak_down", +"name": "idle_down", "speed": 5.0 }, { -"frames": [ SubResource( 7 ), SubResource( 8 ) ], +"frames": [ SubResource( 29 ) ], "loop": true, -"name": "speak_up", +"name": "idle_down_right", "speed": 5.0 }, { -"frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ) ], +"frames": [ SubResource( 28 ) ], "loop": true, -"name": "speak_right", +"name": "idle_right", "speed": 5.0 }, { "frames": [ SubResource( 14 ) ], @@ -138,9 +138,19 @@ animations = [ { "name": "idle_up", "speed": 5.0 }, { -"frames": [ SubResource( 1 ) ], +"frames": [ SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 5 ) ], "loop": true, -"name": "idle_down", +"name": "speak_down", +"speed": 5.0 +}, { +"frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ) ], +"loop": true, +"name": "speak_right", +"speed": 5.0 +}, { +"frames": [ SubResource( 7 ), SubResource( 8 ) ], +"loop": true, +"name": "speak_up", "speed": 5.0 }, { "frames": [ SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ) ], @@ -157,16 +167,6 @@ animations = [ { "loop": true, "name": "walk_up", "speed": 5.0 -}, { -"frames": [ SubResource( 28 ) ], -"loop": true, -"name": "idle_right", -"speed": 5.0 -}, { -"frames": [ SubResource( 29 ) ], -"loop": true, -"name": "idle_down_right", -"speed": 5.0 } ] [sub_resource type="RectangleShape2D" id=3] @@ -180,6 +180,7 @@ esc_script = "res://game/rooms/room6/esc/worker.esc" is_movable = true tooltip_name = "Worker" default_action = "look" +combine_when_selected_action_is_in = [ ] dialog_color = Color( 0.501961, 0.882353, 1, 1 ) animations = ExtResource( 2 ) diff --git a/game/rooms/room01/room01.tscn b/game/rooms/room01/room01.tscn index 4a100898..7fc13804 100644 --- a/game/rooms/room01/room01.tscn +++ b/game/rooms/room01/room01.tscn @@ -93,6 +93,7 @@ esc_script = "res://game/rooms/room01/esc/right_exit.esc" is_exit = true tooltip_name = "Exit to room 2" default_action = "walk" +combine_when_selected_action_is_in = [ ] dialog_color = Color( 1, 1, 1, 1 ) animations = null @@ -110,6 +111,7 @@ global_id = "r1_wall_item1" esc_script = "res://game/rooms/room01/esc/wall_item.esc" tooltip_name = "Artwork" default_action = "look" +combine_when_selected_action_is_in = [ ] inventory_texture = ExtResource( 10 ) dialog_color = Color( 1, 1, 1, 1 ) animations = null @@ -146,6 +148,7 @@ global_id = "r1_wall_item2" esc_script = "res://game/rooms/room01/esc/wall_item_popupdialog.esc" tooltip_name = "Artwork 2" default_action = "look" +combine_when_selected_action_is_in = [ ] inventory_texture = ExtResource( 9 ) dialog_color = Color( 1, 1, 1, 1 ) animations = null @@ -182,6 +185,7 @@ global_id = "trigger_talk" esc_script = "res://game/rooms/room01/esc/trigger.esc" is_trigger = true player_orients_on_arrival = false +combine_when_selected_action_is_in = [ ] dialog_color = Color( 1, 1, 1, 1 ) animations = null diff --git a/game/rooms/room06/room06.tscn b/game/rooms/room06/room06.tscn index 3e522f74..90acf16a 100644 --- a/game/rooms/room06/room06.tscn +++ b/game/rooms/room06/room06.tscn @@ -63,6 +63,13 @@ esc_script = "res://game/rooms/room06/esc/room06.esc" player_scene = ExtResource( 4 ) camera_limits = [ Rect2( 0, 0, 1280, 555 ) ] +[node name="ESCBackground" type="TextureRect" parent="."] +margin_right = 1280.0 +margin_bottom = 550.0 +mouse_filter = 2 +texture = ExtResource( 12 ) +script = ExtResource( 2 ) + [node name="walkable_area" type="Navigation2D" parent="."] script = ExtResource( 1 ) scale_min = 0.7 @@ -186,13 +193,6 @@ position = Vector2( 640, 427 ) z_index = 400 texture = ExtResource( 11 ) -[node name="ESCBackground" type="TextureRect" parent="."] -margin_right = 1280.0 -margin_bottom = 550.0 -mouse_filter = 2 -texture = ExtResource( 12 ) -script = ExtResource( 2 ) - [node name="Text" type="Node2D" parent="."] [node name="Polygon2D" type="Polygon2D" parent="Text"] diff --git a/game/rooms/room18/esc/middle_item.esc b/game/rooms/room18/esc/middle_item.esc new file mode 100644 index 00000000..e27716bb --- /dev/null +++ b/game/rooms/room18/esc/middle_item.esc @@ -0,0 +1,4 @@ +:use +set_interactive middle_item false +set_state middle_item folded + diff --git a/game/rooms/room18/esc/upper_item.esc b/game/rooms/room18/esc/upper_item.esc new file mode 100644 index 00000000..099908b3 --- /dev/null +++ b/game/rooms/room18/esc/upper_item.esc @@ -0,0 +1,4 @@ +:use +set_interactive upper_item false +set_state upper_item folded + diff --git a/game/rooms/room18/room18.tscn b/game/rooms/room18/room18.tscn new file mode 100644 index 00000000..b4f27ad7 --- /dev/null +++ b/game/rooms/room18/room18.tscn @@ -0,0 +1,135 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=1] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=3] + +[sub_resource type="Animation" id=3] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("Polygon2D:polygon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 ) ] +} + +[sub_resource type="Animation" id=4] +resource_name = "folded" +tracks/0/type = "value" +tracks/0/path = NodePath("Polygon2D:polygon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 ), PoolVector2Array( 950, 337, 988, 484, 962, 639, 1002, 667, 1020, 517, 986, 258, 967, 277 ) ] +} + +[sub_resource type="Animation" id=1] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("Polygon2D:polygon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 ) ] +} + +[sub_resource type="Animation" id=2] +resource_name = "folded" +tracks/0/type = "value" +tracks/0/path = NodePath("Polygon2D:polygon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 ), PoolVector2Array( 191, 80, 159, 753, 213, 755, 203, 570, 222, 489, 272, 223, 246, 99 ) ] +} + +[node name="room18" type="Node2D"] +script = ExtResource( 1 ) +global_id = "room18" + +[node name="ESCBackground" type="TextureRect" parent="."] +mouse_filter = 2 +script = ExtResource( 2 ) + +[node name="items" type="Node2D" parent="."] + +[node name="bottom_item" type="Area2D" parent="items"] +pause_mode = 1 +script = ExtResource( 3 ) +global_id = "bottom_item" +tooltip_name = "Bottom item" +default_action = "use" +dialog_color = Color( 1, 1, 1, 1 ) +animations = null + +[node name="Polygon2D" type="Polygon2D" parent="items/bottom_item"] +color = Color( 0.552941, 0, 0, 1 ) +polygon = PoolVector2Array( 460, 418, 413, 568, 672, 693, 906, 484, 679, 346 ) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/bottom_item"] +polygon = PoolVector2Array( 466, 424, 418, 570, 679, 701, 904, 485, 682, 347 ) + +[node name="middle_item" type="Area2D" parent="items"] +pause_mode = 1 +z_index = 2 +script = ExtResource( 3 ) +global_id = "middle_item" +esc_script = "res://game/rooms/room18/esc/middle_item.esc" +tooltip_name = "Middle item" +default_action = "use" +dialog_color = Color( 1, 1, 1, 1 ) +animations = null + +[node name="Polygon2D" type="Polygon2D" parent="items/middle_item"] +color = Color( 0.254902, 0.388235, 0, 1 ) +polygon = PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 ) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/middle_item"] +polygon = PoolVector2Array( 396, 336, 239, 565, 466, 680, 948, 592, 1024, 514, 802, 282, 603, 246 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="items/middle_item"] +anims/RESET = SubResource( 3 ) +anims/folded = SubResource( 4 ) + +[node name="upper_item" type="Area2D" parent="items"] +pause_mode = 1 +z_index = 4 +script = ExtResource( 3 ) +global_id = "upper_item" +esc_script = "res://game/rooms/room18/esc/upper_item.esc" +tooltip_name = "Upper item" +default_action = "use" +dialog_color = Color( 1, 1, 1, 1 ) +animations = null + +[node name="Polygon2D" type="Polygon2D" parent="items/upper_item"] +color = Color( 0.0666667, 0, 0.541176, 1 ) +polygon = PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 ) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/upper_item"] +polygon = PoolVector2Array( 190, 73, 156, 763, 420, 751, 1064, 818, 1144, 630, 1177, 318, 833, 123 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="items/upper_item"] +anims/RESET = SubResource( 1 ) +anims/folded = SubResource( 2 ) diff --git a/game/rooms/room19/esc/bottom_item.esc b/game/rooms/room19/esc/bottom_item.esc new file mode 100644 index 00000000..82543489 --- /dev/null +++ b/game/rooms/room19/esc/bottom_item.esc @@ -0,0 +1,4 @@ +:use +set_interactive bottom_item false +set_state bottom_item folded + diff --git a/game/rooms/room19/esc/middle_item.esc b/game/rooms/room19/esc/middle_item.esc new file mode 100644 index 00000000..e27716bb --- /dev/null +++ b/game/rooms/room19/esc/middle_item.esc @@ -0,0 +1,4 @@ +:use +set_interactive middle_item false +set_state middle_item folded + diff --git a/game/rooms/room19/esc/upper_item.esc b/game/rooms/room19/esc/upper_item.esc new file mode 100644 index 00000000..099908b3 --- /dev/null +++ b/game/rooms/room19/esc/upper_item.esc @@ -0,0 +1,4 @@ +:use +set_interactive upper_item false +set_state upper_item folded + diff --git a/game/rooms/room19/room19.tscn b/game/rooms/room19/room19.tscn new file mode 100644 index 00000000..11b4d26a --- /dev/null +++ b/game/rooms/room19/room19.tscn @@ -0,0 +1,173 @@ +[gd_scene load_steps=10 format=2] + +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=1] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2] +[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=3] + +[sub_resource type="Animation" id=1] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("Polygon2D:polygon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 ) ] +} + +[sub_resource type="Animation" id=2] +resource_name = "folded" +tracks/0/type = "value" +tracks/0/path = NodePath("Polygon2D:polygon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 ), PoolVector2Array( 191, 80, 159, 753, 213, 755, 203, 570, 222, 489, 272, 223, 246, 99 ) ] +} + +[sub_resource type="Animation" id=3] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("Polygon2D:polygon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 ) ] +} + +[sub_resource type="Animation" id=4] +resource_name = "folded" +tracks/0/type = "value" +tracks/0/path = NodePath("Polygon2D:polygon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 ), PoolVector2Array( 950, 337, 988, 484, 962, 639, 1002, 667, 1020, 517, 986, 258, 967, 277 ) ] +} + +[sub_resource type="Animation" id=5] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("Polygon2D:polygon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ PoolVector2Array( 460, 418, 413, 568, 672, 693, 906, 484, 679, 346 ) ] +} + +[sub_resource type="Animation" id=6] +resource_name = "folded" +tracks/0/type = "value" +tracks/0/path = NodePath("Polygon2D:polygon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ PoolVector2Array( 460, 418, 413, 568, 672, 693, 906, 484, 679, 346 ), PoolVector2Array( 646, 366, 665, 382, 684, 377, 697, 367, 679, 346 ) ] +} + +[node name="room19" type="Node2D"] +script = ExtResource( 1 ) +global_id = "room19" + +[node name="ESCBackground" type="TextureRect" parent="."] +mouse_filter = 2 +script = ExtResource( 2 ) + +[node name="items" type="Node2D" parent="."] + +[node name="bottom_item" type="Area2D" parent="items"] +pause_mode = 1 +script = ExtResource( 3 ) +global_id = "bottom_item" +esc_script = "res://game/rooms/room19/esc/bottom_item.esc" +tooltip_name = "Bottom item" +default_action = "use" +combine_when_selected_action_is_in = [ ] +dialog_color = Color( 1, 1, 1, 1 ) +animations = null + +[node name="Polygon2D" type="Polygon2D" parent="items/bottom_item"] +color = Color( 0.0666667, 0, 0.541176, 1 ) +polygon = PoolVector2Array( 191, 80, 159, 753, 405, 751, 1066, 815, 1143, 637, 1180, 314, 827, 126 ) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/bottom_item"] +polygon = PoolVector2Array( 190, 73, 156, 763, 420, 751, 1064, 818, 1144, 630, 1177, 318, 833, 123 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="items/bottom_item"] +anims/RESET = SubResource( 1 ) +anims/folded = SubResource( 2 ) + +[node name="middle_item" type="Area2D" parent="items"] +pause_mode = 1 +z_index = 2 +script = ExtResource( 3 ) +global_id = "middle_item" +esc_script = "res://game/rooms/room19/esc/middle_item.esc" +tooltip_name = "Middle item" +default_action = "use" +combine_when_selected_action_is_in = [ ] +dialog_color = Color( 1, 1, 1, 1 ) +animations = null + +[node name="Polygon2D" type="Polygon2D" parent="items/middle_item"] +color = Color( 0.254902, 0.388235, 0, 1 ) +polygon = PoolVector2Array( 393, 334, 243, 564, 460, 682, 948, 598, 1020, 517, 802, 285, 608, 245 ) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/middle_item"] +polygon = PoolVector2Array( 396, 336, 239, 565, 466, 680, 948, 592, 1024, 514, 802, 282, 603, 246 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="items/middle_item"] +anims/RESET = SubResource( 3 ) +anims/folded = SubResource( 4 ) + +[node name="upper_item" type="Area2D" parent="items"] +pause_mode = 1 +z_index = 3 +script = ExtResource( 3 ) +global_id = "upper_item" +esc_script = "res://game/rooms/room19/esc/upper_item.esc" +tooltip_name = "Upper item" +default_action = "use" +combine_when_selected_action_is_in = [ ] +dialog_color = Color( 1, 1, 1, 1 ) +animations = null + +[node name="Polygon2D" type="Polygon2D" parent="items/upper_item"] +color = Color( 0.552941, 0, 0, 1 ) +polygon = PoolVector2Array( 460, 418, 413, 568, 672, 693, 906, 484, 679, 346 ) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="items/upper_item"] +polygon = PoolVector2Array( 466, 424, 418, 570, 679, 701, 904, 485, 682, 347 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="items/upper_item"] +anims/RESET = SubResource( 5 ) +anims/folded = SubResource( 6 ) diff --git a/project.godot b/project.godot index 72bab792..6b48cbd7 100644 --- a/project.godot +++ b/project.godot @@ -25,6 +25,11 @@ _global_script_classes=[ { "path": "res://addons/escoria-core/game/core-scripts/esc/commands/anim.gd" }, { "base": "ESCCameraBaseCommand", +"class": "CameraPushBlockCommand", +"language": "GDScript", +"path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_push_block.gd" +}, { +"base": "ESCCameraBaseCommand", "class": "CameraPushCommand", "language": "GDScript", "path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd" @@ -35,26 +40,51 @@ _global_script_classes=[ { "path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd" }, { "base": "ESCCameraBaseCommand", +"class": "CameraSetPosBlockCommand", +"language": "GDScript", +"path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos_block.gd" +}, { +"base": "ESCCameraBaseCommand", "class": "CameraSetPosCommand", "language": "GDScript", "path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos.gd" }, { "base": "ESCCameraBaseCommand", +"class": "CameraSetTargetBlockCommand", +"language": "GDScript", +"path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_set_target_block.gd" +}, { +"base": "ESCCameraBaseCommand", "class": "CameraSetTargetCommand", "language": "GDScript", "path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_set_target.gd" }, { "base": "ESCCameraBaseCommand", +"class": "CameraSetZoomBlockCommand", +"language": "GDScript", +"path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_block.gd" +}, { +"base": "ESCCameraBaseCommand", "class": "CameraSetZoomCommand", "language": "GDScript", "path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom.gd" }, { "base": "ESCBaseCommand", +"class": "CameraSetZoomHeightBlockCommand", +"language": "GDScript", +"path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height_block.gd" +}, { +"base": "ESCBaseCommand", "class": "CameraSetZoomHeightCommand", "language": "GDScript", "path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height.gd" }, { "base": "ESCCameraBaseCommand", +"class": "CameraShiftBlockCommand", +"language": "GDScript", +"path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_shift_block.gd" +}, { +"base": "ESCCameraBaseCommand", "class": "CameraShiftCommand", "language": "GDScript", "path": "res://addons/escoria-core/game/core-scripts/esc/commands/camera_shift.gd" @@ -603,12 +633,18 @@ _global_script_class_icons={ "AcceptInputCommand": "", "AnimBlockCommand": "", "AnimCommand": "", +"CameraPushBlockCommand": "", "CameraPushCommand": "", "CameraSetLimitsCommand": "", +"CameraSetPosBlockCommand": "", "CameraSetPosCommand": "", +"CameraSetTargetBlockCommand": "", "CameraSetTargetCommand": "", +"CameraSetZoomBlockCommand": "", "CameraSetZoomCommand": "", +"CameraSetZoomHeightBlockCommand": "", "CameraSetZoomHeightCommand": "", +"CameraShiftBlockCommand": "", "CameraShiftCommand": "", "ChangeSceneCommand": "", "CustomCommand": "",