; returns:
; a: damage value
act_attr_get_attack_damage:
- ld hl, act_weapon
+ ; if not player do not use weapon
+ ld a, [hl]
+ cp a, ACT_T_PLAYER
+ jp nz, @unarmed
+
+ ; if player use right hand weapon
+ ld hl, player_eq+eq_handr
add hl, de
ld a, [hl] ; load weapon type
cp a, 0 ; if 0 -> unarmed
; NNNN0000: debuff status
; 0000NNNN: debuff type
.de act_debuff, 1
- ; item ids for each slot
- ; each slot type has its own table
- ; of items
-.de act_armor, 1
-.de act_ring, 1
-.de act_weapon, 1
; ptr to attribute table
.de act_attr, 2
.de act_size, 0
+ ; equipment struct
+ ; list of ptrs to items
+.se 0
+.de eq_head, 2
+.de eq_armor, 2
+.de eq_neck, 2
+.de eq_ringl, 2
+.de eq_ringr, 2
+.de eq_handl, 2
+.de eq_handr, 2
+.de eq_size, 0
+
; map flags
.se 1
.de MAP_F_DO_FULL_REDRAW, 1
; l1 actor table
l1_acts:
- actdef ACT_T_BAT, 0, 9, 10, 2, 1, ITEM_NONE, ITEM_NONE, ITEM_NONE, attr_bat
- actdef ACT_T_BAT, 0, 1, 2, 2, 1, ITEM_NONE, ITEM_NONE, ITEM_NONE, attr_bat
+ actdef ACT_T_BAT, 0, 9, 10, 2, 1, attr_bat
+ actdef ACT_T_BAT, 0, 1, 2, 2, 1, attr_bat
.db 0 ; terminate
tile_banks_default:
player_attr: .adv attr_size
player_exp: .adv 2
player_level: .adv 1
+ ; player equipment
+player_eq: .adv eq_size
; player view distance radius
player_viewradius: .adv 1