From 904ecb76dad52d7377342f0e09442d5718aeb459 Mon Sep 17 00:00:00 2001
From: chimchooree Floor items are the representation of an item that spawns in the environment, drops from opponents, and can be picked up. They are technically tangible entities. description
+
+ structure
+
+
+
+
+
+
An item changes its form depending on its context.
Base items are the purest form of an item, maintaining its continuity and containing its essential data. Other items hold the base item as a child or generates one if one doesn't already exist.
Base items are the purest form of an item, maintaining its continuity and containing its essential data. Other items hold the base item as a child or generates one if one doesn't already exist.
Floor items are the representation of an item that spawns in the environment, drops from opponents, and can be picked up. They are technically tangible entities.
Floor items are the representation of an item that spawns in the environment, drops from opponents, and can be picked up. They are technically tangible entities.
Inventory items appear in the inventory window. They are technically control nodes.
Items can only be picked up by the player. They can be picked up via item targeting or through selecting 'pick up' on the inspect menu.
Item pickup is triggered when a floor item is targeted, that is, a 'target' (left-click) triggers a $Item/Body/Sprite/Sprite.gd/_on_input_event. If 'no_move_to_target' (shift) is held while targeting, the item will be targeted without initiating pickup. Otherwise, floor_item.gd/target_event(viewport,event,shape_idx) is called to set the target and handle the input before prompting the player to consider pickup.
Item pickup is triggered when a floor item is targeted, that is, a 'target' (left-click) triggers a $Item/Body/Sprite/Sprite.gd/_on_input_event. If 'no_move_to_target' (shift) is held while targeting, the item will be targeted without initiating pickup. Otherwise, floor_item.gd/target_event(viewport,event,shape_idx) is called to set the target and handle the input before prompting the player to consider pickup.
Item pickup is also an option on the floor items' inspect menu. Choosing it triggers that floor item's id_pressed(id), which calls the associated method from its inspect_options dictionary: floor_item.gd/move_player_then_pickup(), prompting the player to consider pickup.
Item pickup is also an option on the floor items' inspect menu. Choosing it triggers that floor item's id_pressed(id), which calls the associated method from its inspect_options dictionary: floor_item.gd/move_player_then_pickup(), prompting the player to consider pickup.
Character.gd/consider_pickup(item) passes to UserControl/pickup(item). The next branch depends on a distance check.
If the item is within the player's intimate distance, the character will be prompted to pick up the item.
-
Otherwise, pathfinding begins towards the floor item. Upon arrival, it calls floor_item.pick_up().pick_up(). The floor item's pick_up removes itself from the room and returns the base item, then the inventory system takes care of the rest.
Otherwise, pathfinding begins towards the floor item. Upon arrival, it calls floor_item.pick_up().pick_up(). The floor item's pick_up removes itself from the room and returns the base item, then the inventory system takes care of the rest.
The vision for Blessfrey