Fixed bat not having stamina causing hp to overflow
add hl, de ; hl = attr table ptr
ld a, [hl+]
- ld c, [hl]
- ld b, a
-
+ ld b, [hl]
+ ld c, a
; bc = attribute table
ret
attrdef 0, 0, 0, 0, 0
attr_bat:
-attrdef 1, 0, 0, 0, 0
+attrdef 1, 1, 1, 1, 0
; gets the max hp for an actor
; hp formula:
; bc: damage value
act_attr_take_weapon_damage:
push de
-
; TODO: apply resistances to bc
m16_write_bc m16_b
pop de
call act_attr_write_hp
- BREAK
; if m16_flags carry is set
; -> die
ld a, [m16_flags]
#endmacro
; same as dw but
- ; stores in big endian
-#macro dwb
+ ; stores in little endian
+#macro dwl
.db ($1 >> 8) & 0xFF
.db $1 & 0xFF
#endmacro
m16_sub:
xor a, a
ldh [m16_flags], a
-
+
ldh a, [m16_b]
ld b, a
ldh a, [m16_a]
ld [player+act_mp], a
; set player attribute table
- ld a, player_attr HI
- ld [player+act_attr], a
ld a, player_attr LO
+ ld [player+act_attr], a
+ ld a, player_attr HI
ld [player+act_attr+1], a
; set default stats