diff options
| author | radiohotline <radoihotline@disroot.rg> | 2026-08-25 16:33:56 +0300 |
|---|---|---|
| committer | radiohotline <radoihotline@disroot.rg> | 2026-08-25 16:33:56 +0300 |
| commit | a89e744ed0e8c759caf041a580112365bbfe4303 (patch) | |
| tree | dd61e320904176995727e86a857d00c90d4933ba /addons/escoria-core/game/core-scripts/esc/commands | |
| parent | 6d53d8cac78250dc888aa49d5f9d4175c6652feb (diff) | |
Diffstat (limited to 'addons/escoria-core/game/core-scripts/esc/commands')
63 files changed, 128 insertions, 97 deletions
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/accept_input.gd b/addons/escoria-core/game/core-scripts/esc/commands/accept_input.gd index f29f9c7..18a6228 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/accept_input.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/accept_input.gd @@ -10,8 +10,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name AcceptInputCommand +extends ESCBaseCommand ## The list of supported input types diff --git a/addons/escoria-core/game/core-scripts/esc/commands/anim.gd b/addons/escoria-core/game/core-scripts/esc/commands/anim.gd index 6525654..5711707 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/anim.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/anim.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name AnimCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/anim_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/anim_block.gd index b64b166..f564a94 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/anim_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/anim_block.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name AnimBlockCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/block_say.gd b/addons/escoria-core/game/core-scripts/esc/commands/block_say.gd index d2b7dd2..6ebb0c1 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/block_say.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/block_say.gd @@ -8,8 +8,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name BlockSayCommand +extends ESCBaseCommand ## Constructor[br] @@ -48,7 +48,7 @@ func configure() -> ESCCommandArgumentDescriptor: ## #### Returns[br] ## [br] ## Returns True if the arguments are valid, false otherwise. (`bool`) -func validate(arguments: Array): +func validate(_arguments: Array): return true @@ -63,7 +63,7 @@ func validate(arguments: Array): ## #### Returns[br] ## [br] ## Returns the execution result code. (`int`) -func run(command_params: Array) -> int: +func run(_command_params: Array) -> int: escoria.dialog_player.enable_preserve_dialog_box() return ESCExecution.RC_OK diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd index 37f99dd..710a195 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd @@ -26,8 +26,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraPushCommand +extends ESCCameraBaseCommand ## The list of supported transitions as per the link mentioned above const SUPPORTED_TRANSITIONS = ["LINEAR","SINE","QUINT","QUART","QUAD" ,"EXPO","ELASTIC","CUBIC", diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_push_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_push_block.gd index 289cfc7..52db676 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_push_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_push_block.gd @@ -26,8 +26,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraPushBlockCommand +extends ESCCameraBaseCommand ## The list of supported transitions as per the link mentioned above diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd index 79dc992..b468e7d 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd @@ -15,8 +15,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraSetLimitsCommand +extends ESCCameraBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos.gd index 5403bcf..365b668 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos.gd @@ -12,8 +12,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraSetPosCommand +extends ESCCameraBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos_block.gd index 2fe7dc0..8833c24 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos_block.gd @@ -15,8 +15,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraSetPosBlockCommand +extends ESCCameraBaseCommand # Tween for blocking diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target.gd index 8d5e3e0..485dd28 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target.gd @@ -13,8 +13,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraSetTargetCommand +extends ESCCameraBaseCommand ## Provides the argument descriptor that defines the command signature.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target_block.gd index e071dec..07841fd 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target_block.gd @@ -17,8 +17,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraSetTargetBlockCommand +extends ESCCameraBaseCommand # Tween for blocking diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom.gd index 515aa44..4be55ee 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom.gd @@ -16,8 +16,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraSetZoomCommand +extends ESCCameraBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_block.gd index 07ea05f..4ae84b8 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_block.gd @@ -20,8 +20,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraSetZoomBlockCommand +extends ESCCameraBaseCommand var _camera_tween: Tween3 diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height.gd index 5ffa7c0..dba9ad5 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name CameraSetZoomHeightCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height_block.gd index b526d9c..429be97 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height_block.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name CameraSetZoomHeightBlockCommand +extends ESCBaseCommand ## Tween for blocking diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_shift.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_shift.gd index fb95bb0..379b4f3 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_shift.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_shift.gd @@ -20,8 +20,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraShiftCommand +extends ESCCameraBaseCommand ## The list of supported transitions as per the link mentioned above const SUPPORTED_TRANSITIONS = ["LINEAR","SINE","QUINT","QUART","QUAD" ,"EXPO","ELASTIC","CUBIC", diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_shift_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_shift_block.gd index a06a8db..c7294a3 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/camera_shift_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/camera_shift_block.gd @@ -23,8 +23,8 @@ ## ## @ASHES ## @COMMAND -extends ESCCameraBaseCommand class_name CameraShiftBlockCommand +extends ESCCameraBaseCommand # The list of supported transitions as per the link mentioned above diff --git a/addons/escoria-core/game/core-scripts/esc/commands/change_scene.gd b/addons/escoria-core/game/core-scripts/esc/commands/change_scene.gd index 2ae6e23..b1ff671 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/change_scene.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/change_scene.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name ChangeSceneCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/change_scene_godot.gd b/addons/escoria-core/game/core-scripts/esc/commands/change_scene_godot.gd index 9be93a8..e7b8b70 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/change_scene_godot.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/change_scene_godot.gd @@ -10,8 +10,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name ChangeSceneGodotCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/custom.gd b/addons/escoria-core/game/core-scripts/esc/commands/custom.gd index afacce8..c2fe35f 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/custom.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/custom.gd @@ -13,8 +13,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name CustomCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -54,7 +54,7 @@ func validate(arguments: Array): if not escoria.object_manager.has(arguments[0]): raise_invalid_object_error(self, arguments[0]) return false - elif not escoria.object_manager.get_object(arguments[0]).node.has_node( + if not escoria.object_manager.get_object(arguments[0]).node.has_node( arguments[1] ): raise_error(self, "Invalid node. Object with global id %s has no child node called %s." @@ -63,7 +63,7 @@ func validate(arguments: Array): arguments[1], ]) return false - elif not escoria.object_manager.get_object(arguments[0]).node\ + if not escoria.object_manager.get_object(arguments[0]).node\ .get_node( arguments[1] )\ diff --git a/addons/escoria-core/game/core-scripts/esc/commands/dec_global.gd b/addons/escoria-core/game/core-scripts/esc/commands/dec_global.gd index 8f91433..33aa173 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/dec_global.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/dec_global.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name DecGlobalCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd b/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd index 106c297..76b3fe9 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd @@ -10,8 +10,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name EnableTerrainCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -52,9 +52,8 @@ func run(command_params: Array) -> int: new_active_navigation_instance escoria.room_terrain.current_active_navigation_instance.enabled = true return ESCExecution.RC_OK - else: - raise_error(self, "Can not find terrain node. Terrain node %s could not be found." % name) - return ESCExecution.RC_ERROR + raise_error(self, "Can not find terrain node. Terrain node %s could not be found." % name) + return ESCExecution.RC_ERROR ## Function called when the command is interrupted.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/end_block_say.gd b/addons/escoria-core/game/core-scripts/esc/commands/end_block_say.gd index 9a68f4f..d940ce9 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/end_block_say.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/end_block_say.gd @@ -8,8 +8,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name EndBlockSayCommand +extends ESCBaseCommand ## Constructor (bypasses the default constructor to avoid)[br] @@ -49,7 +49,7 @@ func configure() -> ESCCommandArgumentDescriptor: ## #### Returns[br] ## [br] ## Returns True if the arguments are valid, false otherwise. (`bool`) -func validate(arguments: Array): +func validate(_arguments: Array): return true @@ -64,7 +64,7 @@ func validate(arguments: Array): ## #### Returns[br] ## [br] ## Returns the execution result code. (`int`) -func run(command_params: Array) -> int: +func run(_command_params: Array) -> int: escoria.dialog_player.disable_preserve_dialog_box() return ESCExecution.RC_OK diff --git a/addons/escoria-core/game/core-scripts/esc/commands/hide_menu.gd b/addons/escoria-core/game/core-scripts/esc/commands/hide_menu.gd index 65567d7..da23186 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/hide_menu.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/hide_menu.gd @@ -10,8 +10,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name HideMenuCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -69,7 +69,7 @@ func run(command_params: Array) -> int: # Transition out from menu transition_id = escoria.main.scene_transition.transition( "", - ESCTransitionPlayer.TRANSITION_MODE.OUT + ESCTransitionPlayer.TransitionMode.OUT ) if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT: diff --git a/addons/escoria-core/game/core-scripts/esc/commands/inc_global.gd b/addons/escoria-core/game/core-scripts/esc/commands/inc_global.gd index 2bacd61..2452dcc 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/inc_global.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/inc_global.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name IncGlobalCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/inventory_add.gd b/addons/escoria-core/game/core-scripts/esc/commands/inventory_add.gd index d715dea..ba59d17 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/inventory_add.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/inventory_add.gd @@ -10,8 +10,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name InventoryAddCommand +extends ESCBaseCommand ## List of illegal strings that cannot be used in item names. diff --git a/addons/escoria-core/game/core-scripts/esc/commands/inventory_remove.gd b/addons/escoria-core/game/core-scripts/esc/commands/inventory_remove.gd index bd45f66..93e4bab 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/inventory_remove.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/inventory_remove.gd @@ -10,8 +10,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name InventoryRemoveCommand +extends ESCBaseCommand ## List of illegal strings that cannot be used in item names. const ILLEGAL_STRINGS = ["/"] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd b/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd index 90dcc94..41321d8 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd @@ -12,14 +12,27 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name PlaySndCommand +extends ESCBaseCommand ## The specified sound player var _snd_player: String +## Constructor of this command.[br] +## [br] +## #### Parameters[br] +## [br] +## None. +## [br] +## #### Returns[br] +## [br] +## Returns nothing. +func _init() -> void: + run_in_ready_allowed_during_savegame_loading = false + + ## The descriptor of the arguments of this command.[br] ## [br] ## #### Parameters[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/print_internal.gd b/addons/escoria-core/game/core-scripts/esc/commands/print_internal.gd index 56a601f..418cc72 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/print_internal.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/print_internal.gd @@ -10,8 +10,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name PrintCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/queue_event.gd b/addons/escoria-core/game/core-scripts/esc/commands/queue_event.gd index f676fda..bad3a19 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/queue_event.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/queue_event.gd @@ -13,8 +13,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name QueueEventCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -64,7 +64,7 @@ func validate(arguments: Array): var esc_script = escoria.esc_compiler.load_esc_file(node.esc_script) - if not arguments[1] in esc_script.events: + if not esc_script.has_event_with_target(arguments[1]): raise_error( self, "Event with name '%s' not found." % arguments[1] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/queue_resource.gd b/addons/escoria-core/game/core-scripts/esc/commands/queue_resource.gd index 845ae1c..c0598d2 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/queue_resource.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/queue_resource.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name QueueResourceCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/rand_global.gd b/addons/escoria-core/game/core-scripts/esc/commands/rand_global.gd index a165f8d..9db0c20 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/rand_global.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/rand_global.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name RandGlobalCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/repeat.gd b/addons/escoria-core/game/core-scripts/esc/commands/repeat.gd index 0c0e4b6..db891bf 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/repeat.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/repeat.gd @@ -8,8 +8,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name RepeatCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -40,7 +40,7 @@ func configure() -> ESCCommandArgumentDescriptor: ## #### Returns[br] ## [br] ## Returns the execution result code. (`int`) -func run(command_params: Array) -> int: +func run(_command_params: Array) -> int: return ESCExecution.RC_CANCEL diff --git a/addons/escoria-core/game/core-scripts/esc/commands/save_game.gd b/addons/escoria-core/game/core-scripts/esc/commands/save_game.gd index e830c49..9f66993 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/save_game.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/save_game.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SaveGameCommand +extends ESCBaseCommand ## Constructor[br] 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 8c043c2..75115c5 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/say.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/say.gd @@ -13,8 +13,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SayCommand +extends ESCBaseCommand ## The keyword used to refer to the current player const CURRENT_PLAYER_KEYWORD = "CURRENT_PLAYER" @@ -103,14 +103,14 @@ func validate(arguments: Array): func run(command_params: Array) -> int: var dict: Dictionary - escoria.current_state = escoria.GAME_STATE.DIALOG + escoria.current_state = escoria.GameState.DIALOG if !escoria.dialog_player: raise_error( self, "No dialog player was registered and the 'say' command was encountered." ) - escoria.current_state = escoria.GAME_STATE.DEFAULT + escoria.current_state = escoria.GameState.DEFAULT return ESCExecution.RC_ERROR if not escoria.main.current_scene.player: @@ -119,7 +119,7 @@ func run(command_params: Array) -> int: "[%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 + escoria.current_state = escoria.GameState.DEFAULT return ESCExecution.RC_CANCEL # Replace the names of any globals in "{ }" with their value @@ -136,7 +136,7 @@ func run(command_params: Array) -> int: command_params[2] ) await escoria.dialog_player.say_finished - escoria.current_state = escoria.GAME_STATE.DEFAULT + escoria.current_state = escoria.GameState.DEFAULT return ESCExecution.RC_OK diff --git a/addons/escoria-core/game/core-scripts/esc/commands/sched_event.gd b/addons/escoria-core/game/core-scripts/esc/commands/sched_event.gd index 5b57dca..3fb2029 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/sched_event.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/sched_event.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SchedEventCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -63,7 +63,7 @@ func validate(arguments: Array): var esc_script = escoria.esc_compiler.load_esc_file(node.esc_script) - if not arguments[2] in esc_script.events: + if not esc_script.has_event_with_target(arguments[2]): raise_error( self, "Event with name '%s' not found." % arguments[2] @@ -104,7 +104,7 @@ func run(command_params: Array) -> int: var esc_script = escoria.esc_compiler.load_esc_file(node.esc_script) escoria.event_manager.schedule_event( - esc_script.events[command_params[2]], # ESCGrammarStmts.Event + esc_script.get_event_with_target(command_params[2]), # ESCGrammarStmts.Event command_params[0], # timeout float command_params[1] # object string ) diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_active.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_active.gd index 90846e5..97ebee5 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_active.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_active.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetActiveCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_active_if_exists.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_active_if_exists.gd index ebb02cb..a2303fb 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_active_if_exists.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_active_if_exists.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetActiveIfExistsCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_angle.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_angle.gd index ef503c4..936b03a 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_angle.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_angle.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetAngleCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd index 7ae818f..9c22c02 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetAnimationsCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -57,7 +57,7 @@ func validate(arguments: Array): ) return false - (escoria.object_manager.get_object(arguments[0]).node as ESCPlayer).validate_animations(load(arguments[1])) + (escoria.object_manager.get_object(arguments[0]).node as ESCItem).validate_animations(load(arguments[1])) return true @@ -74,7 +74,7 @@ func validate(arguments: Array): ## [br] ## Returns the execution result code. (`int`) func run(command_params: Array) -> int: - (escoria.object_manager.get_object(command_params[0]).node as ESCPlayer)\ + (escoria.object_manager.get_object(command_params[0]).node as ESCItem)\ .animations = load(command_params[1]) if not escoria.globals_manager.has( escoria.room_manager.GLOBAL_ANIMATION_RESOURCES @@ -89,7 +89,7 @@ func run(command_params: Array) -> int: ) if animations.is_empty(): animations = {} - animations[command_params[0]] = command_params[1] + animations[command_params[0]] = command_params[1] escoria.globals_manager.set_global( escoria.room_manager.GLOBAL_ANIMATION_RESOURCES, animations, diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_direction.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_direction.gd index 43bfd70..fde2cf0 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_direction.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_direction.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetDirectionCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -55,14 +55,14 @@ func validate(arguments: Array): % [get_command_name(), arguments[0]] ) return false - elif not escoria.object_manager.get_object(arguments[0]).node.is_movable: + if not escoria.object_manager.get_object(arguments[0]).node.is_movable: escoria.logger.error( self, "[%s]: invalid object. Object with global id %s is not movable." % [get_command_name(), arguments[0]] ) return false - elif arguments[1] < 0 or arguments[1] > escoria.object_manager.get_object(arguments[0]).node \ + if arguments[1] < 0 or arguments[1] > escoria.object_manager.get_object(arguments[0]).node \ .get_directions_quantity() - 1: escoria.logger.error( self, diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_global.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_global.gd index 687fe16..f37751a 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_global.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_global.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetGlobalCommand +extends ESCBaseCommand ## The list of illegal strings that cannot be used in global names. const ILLEGAL_STRINGS = ["/"] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_globals.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_globals.gd index 3107057..6122940 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_globals.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_globals.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetGlobalsCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_gui_visible.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_gui_visible.gd index ec83445..d04f10c 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_gui_visible.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_gui_visible.gd @@ -10,8 +10,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetGuiVisibleCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_interactive.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_interactive.gd index 007e23a..45a8cfb 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_interactive.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_interactive.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetInteractiveCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_item_custom_data.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_item_custom_data.gd index 2e90ce3..6985c36 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_item_custom_data.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_item_custom_data.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetItemCustomDataCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_speed.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_speed.gd index cd8f2df..8b05814 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_speed.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_speed.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetSpeedCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -49,6 +49,13 @@ func validate(arguments: Array): if not escoria.object_manager.has(arguments[0]): raise_invalid_object_error(self, arguments[0]) return false + + if arguments[1] < 0: + raise_error( + self, + "Invalid speed. Speed cannot be negative (%d)." % arguments[1] + ) + return false return true ## Runs the command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_state.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_state.gd index 597751f..4efd6c5 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/set_state.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/set_state.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SetStateCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/show_menu.gd b/addons/escoria-core/game/core-scripts/esc/commands/show_menu.gd index 3ee2935..32d971b 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/show_menu.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/show_menu.gd @@ -10,8 +10,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name ShowMenuCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -73,7 +73,7 @@ func run(command_params: Array) -> int: # Transition out from current scene var transition_id = escoria.main.scene_transition.transition( "", - ESCTransitionPlayer.TRANSITION_MODE.OUT + ESCTransitionPlayer.TransitionMode.OUT ) if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT: diff --git a/addons/escoria-core/game/core-scripts/esc/commands/slide.gd b/addons/escoria-core/game/core-scripts/esc/commands/slide.gd index d168dfe..b3b56ab 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/slide.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/slide.gd @@ -14,8 +14,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SlideCommand +extends ESCBaseCommand ## A hash of tweens currently active for animated items diff --git a/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd index 59fa186..397b5d3 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd @@ -13,8 +13,8 @@ ## ## @ASHES ## @COMMAND -extends SlideCommand class_name SlideBlockCommand +extends SlideCommand ## Runs the command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/spawn.gd b/addons/escoria-core/game/core-scripts/esc/commands/spawn.gd index b0f01ba..b699816 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/spawn.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/spawn.gd @@ -13,8 +13,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name SpawnCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/stop.gd b/addons/escoria-core/game/core-scripts/esc/commands/stop.gd index b53183f..578bb3e 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/stop.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/stop.gd @@ -8,8 +8,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name StopCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -40,7 +40,7 @@ func configure() -> ESCCommandArgumentDescriptor: ## #### Returns[br] ## [br] ## Returns the execution result code. (`int`) -func run(command_params: Array) -> int: +func run(_command_params: Array) -> int: return ESCExecution.RC_CANCEL diff --git a/addons/escoria-core/game/core-scripts/esc/commands/stop_snd.gd b/addons/escoria-core/game/core-scripts/esc/commands/stop_snd.gd index ae0fc62..5218d3a 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/stop_snd.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/stop_snd.gd @@ -10,15 +10,27 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name StopSndCommand +extends ESCBaseCommand +## The previous sound state, saved for interrupting +var previous_snd_state: String ## The specified sound player var _snd_player: String -## The previous sound state, saved for interrupting -var previous_snd_state: String + +## Constructor of this command.[br] +## [br] +## #### Parameters[br] +## [br] +## None. +## [br] +## #### Returns[br] +## [br] +## Returns nothing. +func _init() -> void: + run_in_ready_allowed_during_savegame_loading = false ## The descriptor of the arguments of this command.[br] @@ -93,20 +105,20 @@ func run(command_params: Array) -> int: ## [br] ## Returns nothing. func interrupt(): - var _sound_players = [] + var sound_players = [] if previous_snd_state.is_empty(): previous_snd_state = "off" if _snd_player.is_empty(): - _sound_players = [ + sound_players = [ ESCObjectManager.MUSIC, ESCObjectManager.SOUND, ESCObjectManager.SPEECH ] else: - _sound_players = [_snd_player] + sound_players = [_snd_player] - for snd_player in _sound_players: + for snd_player in sound_players: if escoria.object_manager.get_object(snd_player).node: escoria.object_manager.get_object(snd_player).node.set_state( previous_snd_state diff --git a/addons/escoria-core/game/core-scripts/esc/commands/teleport.gd b/addons/escoria-core/game/core-scripts/esc/commands/teleport.gd index ae41393..f0d7895 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/teleport.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/teleport.gd @@ -11,8 +11,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name TeleportCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/teleport_pos.gd b/addons/escoria-core/game/core-scripts/esc/commands/teleport_pos.gd index bf7a4fe..c561dfc 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/teleport_pos.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/teleport_pos.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name TeleportPosCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/transition.gd b/addons/escoria-core/game/core-scripts/esc/commands/transition.gd index ff2c562..192fcdc 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/transition.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/transition.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name TransitionCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] @@ -78,8 +78,8 @@ func validate(arguments: Array): func run(command_params: Array) -> int: var transition_id = escoria.main.scene_transition.transition( command_params[0], - ESCTransitionPlayer.TRANSITION_MODE.OUT if command_params[1] == "out" \ - else ESCTransitionPlayer.TRANSITION_MODE.IN, + ESCTransitionPlayer.TransitionMode.OUT if command_params[1] == "out" \ + else ESCTransitionPlayer.TransitionMode.IN, command_params[2] ) diff --git a/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd b/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd index 6cf6fc4..efb5e7a 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name TurnToCommand +extends ESCBaseCommand ## The descriptor of the arguments of this command.[br] diff --git a/addons/escoria-core/game/core-scripts/esc/commands/wait.gd b/addons/escoria-core/game/core-scripts/esc/commands/wait.gd index 1775452..1032a55 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/wait.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/wait.gd @@ -10,8 +10,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name WaitCommand +extends ESCBaseCommand ## Timer to wait for var timer: Timer diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk.gd index 735e199..b38d816 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/walk.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/walk.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name WalkCommand +extends ESCBaseCommand ## Walking object diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd index d144a6d..7218b87 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd @@ -12,8 +12,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name WalkBlockCommand +extends ESCBaseCommand ## Walking object diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd index fcbe673..f8303dc 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd @@ -13,8 +13,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name WalkToPosCommand +extends ESCBaseCommand ## Walking object @@ -56,7 +56,7 @@ func validate(arguments: Array): if not escoria.object_manager.has(arguments[0]): raise_error( self, - "Invalid first object. The object to make walk with global id '%s' was not found." % arguments[0] + "Invalid first object. The object to make walk with global id '%s' was not found." % arguments[0] ) return false diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd index 6800522..7ff1a15 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd @@ -13,8 +13,8 @@ ## [br] ## @ASHES ## @COMMAND -extends ESCBaseCommand class_name WalkToPosBlockCommand +extends ESCBaseCommand ## Walking object |
