From 99d2b89a4e1c9eeac50383fc9e6084381b8a03df Mon Sep 17 00:00:00 2001 From: Eneko Nieto Date: Thu, 9 Mar 2023 19:33:43 +0100 Subject: [PATCH] Erase all references to use_from_inventory_only --- .../esc/esc_action_manager_monkey.gd | 96 ++++++++----------- .../items/inventory/caja_herramientas.tscn | 1 - gymkhana/items/inventory/wrench.tscn | 1 - .../trasera_cocina/esc/p_eneko_smoking.esc | 3 +- .../rooms/trasera_cocina/trasera_cocina.tscn | 1 - 5 files changed, 40 insertions(+), 62 deletions(-) diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/esc/esc_action_manager_monkey.gd b/gymkhana/addons/escoria-ui-return-monkey-island/esc/esc_action_manager_monkey.gd index ab2b8d08..62a38110 100644 --- a/gymkhana/addons/escoria-ui-return-monkey-island/esc/esc_action_manager_monkey.gd +++ b/gymkhana/addons/escoria-ui-return-monkey-island/esc/esc_action_manager_monkey.gd @@ -55,63 +55,50 @@ func _get_event_to_queue( or combine_with): # or (combine_with && action in combine_with.node.combine_when_selected_action_is_in)): - # Check if object must be in inventory to be used - if target.node.use_from_inventory_only: - if escoria.inventory_manager.inventory_has(target.global_id): - # Player has item in inventory, we check the element to use on - if combine_with: - var target_event = "%s %s" % [ - action, - combine_with.global_id - ] - var combine_with_event = "%s %s" % [ - action, - target.global_id - ] + # Player has item in inventory, we check the element to use on + if escoria.inventory_manager.inventory_has(target.global_id): + if combine_with: + var target_event = "%s %s" % [ + action, + combine_with.global_id + ] + var combine_with_event = "%s %s" % [ + action, + target.global_id + ] - if target.events.has(target_event): - event_to_return = target.events[target_event] - elif combine_with.events.has(combine_with_event)\ - and not combine_with.node.combine_is_one_way: + if target.events.has(target_event): + event_to_return = target.events[target_event] + elif combine_with.events.has(combine_with_event)\ + and not combine_with.node.combine_is_one_way: - event_to_return = combine_with.events[combine_with_event] + event_to_return = combine_with.events[combine_with_event] + else: + # Check to see if there isn't a "fallback" action to + # run before we declare this a failure. + if escoria.action_default_script \ + and escoria.action_default_script.events.has(action): + + event_to_return = escoria.action_default_script.events[action] else: - # Check to see if there isn't a "fallback" action to - # run before we declare this a failure. - if escoria.action_default_script \ - and escoria.action_default_script.events.has(action): - - event_to_return = escoria.action_default_script.events[action] - else: - var errors = [ - "Attempted to execute action %s between item %s and item %s" % [ - action, - target.global_id, - combine_with.global_id - ] + var errors = [ + "Attempted to execute action %s between item %s and item %s" % [ + action, + target.global_id, + combine_with.global_id ] + ] - if combine_with.node.combine_is_one_way: - errors.append( - ("Reason: %s's item interaction " + \ - "is one-way.") % combine_with.global_id - ) - - escoria.logger.warn( - self, - "Invalid action: " + str(errors) + if combine_with.node.combine_is_one_way: + errors.append( + ("Reason: %s's item interaction " + \ + "is one-way.") % combine_with.global_id ) - else: - escoria.logger.warn( - self, - "Invalid action on item: " + - "Trying to run action %s on object %s, " % - [ - action, - target.node.global_id - ] - + "but item must be in inventory." - ) + + escoria.logger.warn( + self, + "Invalid action: " + str(errors) + ) else: if target.events.has(action): event_to_return = target.events[action] @@ -221,12 +208,7 @@ func perform_inputevent_on_object( current_target ) else: - # Check if object must be in inventory to be used and update - # action state if necessary - if obj.node.use_from_inventory_only and \ - escoria.inventory_manager.inventory_has(obj.global_id) and \ - need_combine: - + if need_combine: # We're missing a target here for our tool to be used on current_tool = obj set_action_input_state( diff --git a/gymkhana/items/inventory/caja_herramientas.tscn b/gymkhana/items/inventory/caja_herramientas.tscn index 2842f795..ca766591 100644 --- a/gymkhana/items/inventory/caja_herramientas.tscn +++ b/gymkhana/items/inventory/caja_herramientas.tscn @@ -13,7 +13,6 @@ script = ExtResource( 1 ) global_id = "caja_herramientas" esc_script = "res://gymkhana/items/inventory/caja_herramientas.esc" combine_when_selected_action_is_in = [ "action4" ] -use_from_inventory_only = true inventory_texture = ExtResource( 2 ) dialog_color = Color( 1, 1, 1, 1 ) action1_text = "¿Que es esto?" diff --git a/gymkhana/items/inventory/wrench.tscn b/gymkhana/items/inventory/wrench.tscn index 903e71a5..4ae380d3 100644 --- a/gymkhana/items/inventory/wrench.tscn +++ b/gymkhana/items/inventory/wrench.tscn @@ -17,7 +17,6 @@ action2_text = "Coger" action3_text = "¿Que es esto?" action4_text = "Usar" combine_when_selected_action_is_in = [ "action4" ] -use_from_inventory_only = true inventory_texture = ExtResource( 1 ) dialog_color = Color( 1, 1, 1, 1 ) animations = null diff --git a/gymkhana/rooms/trasera_cocina/esc/p_eneko_smoking.esc b/gymkhana/rooms/trasera_cocina/esc/p_eneko_smoking.esc index 622a335b..b40ffe92 100644 --- a/gymkhana/rooms/trasera_cocina/esc/p_eneko_smoking.esc +++ b/gymkhana/rooms/trasera_cocina/esc/p_eneko_smoking.esc @@ -3,8 +3,7 @@ say current_player "Tiene pinta de que fuma" :action2 > [whatsapp_blocked] - say current_player "Hola" - say current_player "..." + say current_player "Hola..." say current_player "No me escucha, parece que me tiene bloqueado" stop diff --git a/gymkhana/rooms/trasera_cocina/trasera_cocina.tscn b/gymkhana/rooms/trasera_cocina/trasera_cocina.tscn index e980a0a7..cf99ccda 100644 --- a/gymkhana/rooms/trasera_cocina/trasera_cocina.tscn +++ b/gymkhana/rooms/trasera_cocina/trasera_cocina.tscn @@ -105,7 +105,6 @@ script = ExtResource( 28 ) global_id = "bombona2" esc_script = "res://gymkhana/items/inventory/bombona2.esc" combine_when_selected_action_is_in = [ "action3" ] -use_from_inventory_only = true inventory_texture = ExtResource( 29 ) dialog_color = Color( 1, 1, 1, 1 ) action1_text = "Mirar bombona"