Items - drops, drop table, floor items, base items, inventory items, move to pick up item, shift-move-to-pick-up-item, item spawner, item in container, item inspect, item use, dropping from inv


four representations

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.


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.


Merchandise appears in store windows.


item pickup

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 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 item.find_distance(player) > the player's intimate distance,

If the item is outside the player's intimate space,