player: implement manual pickup and descend confirmation
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Icd8d0ffd9bdf92f5c8943590886543566a6a6964
This commit is contained in:
parent
db21bdacdd
commit
e4926a86fe
2 changed files with 108 additions and 46 deletions
19
src/player.h
19
src/player.h
|
|
@ -7,21 +7,30 @@
|
|||
void player_init(Player *p, int x, int y);
|
||||
|
||||
// Move player, return 1 if moved/attacked, 0 if blocked
|
||||
int player_move(Player *p, int dx, int dy, Map *map, Enemy *enemies, int enemy_count, Item *items, int item_count);
|
||||
int player_move(Player *p, int dx, int dy, Map *map, Enemy *enemies, int enemy_count);
|
||||
|
||||
// Player attacks enemy (deal damage)
|
||||
void player_attack(Player *p, Enemy *e);
|
||||
|
||||
// Pick up item
|
||||
void player_pickup(Player *p, Item *i);
|
||||
// Get item at floor position (x, y), returns NULL if none
|
||||
Item *get_item_at_floor(Item *items, int count, int x, int y);
|
||||
|
||||
// Use item
|
||||
// Pick up item, return 1 if successful, 0 if failed (full/invalid)
|
||||
int player_pickup(Player *p, Item *i);
|
||||
|
||||
// Use item (potions only - weapons/armor are equipped)
|
||||
void player_use_item(Player *p, Item *i);
|
||||
|
||||
// Use first available item in inventory, return 1 if used
|
||||
// Use first available potion in inventory, return 1 if used
|
||||
int player_use_first_item(Player *p);
|
||||
|
||||
// Get item at inventory index, returns NULL if invalid
|
||||
Item *player_get_inventory_item(Player *p, int index);
|
||||
|
||||
// Remove item from inventory at index (shifts remaining items)
|
||||
void player_remove_inventory_item(Player *p, int index);
|
||||
|
||||
// Equip weapon/armor from inventory, return 1 if successful
|
||||
int player_equip_item(Player *p, int inv_index);
|
||||
|
||||
#endif // PLAYER_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue