anim_ent 1, 0, 0x8E, OAM_FXFLIP
anim_ent 0, 0, 0x00, 0
+ ; table that maps actor type to
+ ; a list of animations
+anim_actor_table:
+ dw anim_list_player
+ dw anim_list_guard
+ dw anim_list_dog
+ dw anim_list_hazmat
+
+
+anim_list_player:
+ ; TDLE_NEUTRAL
+ dw player_anim_table
+ ; ATTACK LEFT
+ dw player_anim_table
+ ; ATTACK RIGHT
+ dw player_anim_table
+ ; ATTACK_UP
+ dw player_anim_table
+ ; ATTACK_DOWN
+ dw player_anim_table
+
+anim_list_guard:
+anim_list_dog:
+anim_list_hazmat:
+
+
; translates tile to screen
; inputs:
; $1: Y/X offset
sub a, $2
#endmacro
+ ; loads an animation for the current acotr
+ ; based on its type
+ ; and the requested animation entry
+ ; inputs:
+ ; de: actor
+ ; b: the animation
+ ; writes:
+ ; new animation into selected actor
+anim_load_type:
+ ; TODO:
+ ; 1) load animation list based on type
+
+ ; 2) load animation table based on requested animation
+
+ ; 3) write animation to animation entry
+ ret
+
; performs no drawing
unit_nop_draw:
ldnull bc
; actor type enum
.se 0
.de ACT_T_NULL, 1
-.de ACT_T_CURSOR, 1
-.de ACT_T_DEMO_1, 1
+.de ACT_T_PLAYER, 1
+.de ACT_T_GUARD, 1
+.de ACT_T_DOG, 1
+.de ACT_T_HAZMAT, 1
; actor struct (unit's are instances of actors)
; actor structs are basically just states
.de anim_ent_oam_flags, 1
.de anim_ent_size, 0
+; animation types
+.se 0
+.de ANIM_T_IDLE_NEUTRAL, 1
+.de ANIM_T_ATTACK_LEFT, 1
+.de ANIM_T_ATTACK_RIGHT, 1
+.de ANIM_T_ATTACK_UP, 1
+.de ANIM_T_ATTACK_DOWN, 1
+
+
; special text commands
; consumes the command
unit_player:
st_def 0x00, unit_player_init, st_unit_idle
- act_def ACT_T_DEMO_1, 0, 2, 2, 0
+ act_def ACT_T_PLAYER, 0, 2, 2, 0
act_stat_def1 1, 3, 1, 1
act_stat_def2 1, 1, 90, 1
act_st_def st_unit_player_update, st_unit_idle
unit_demo_guard:
st_def 0x00, unit_demo_1_init, st_unit_demo_1_cpu_update
- act_def ACT_T_DEMO_1, 0, 9, 9, 0
+ act_def ACT_T_GUARD, 0, 9, 9, 0
act_stat_def1 1, 3, 1, 1
act_stat_def2 1, 1, 32, 1
act_st_def st_unit_demo_1_cpu_update, st_unit_idle
unit_demo_dog:
st_def 0x00, unit_demo_1_init, st_unit_demo_1_cpu_update
- act_def ACT_T_DEMO_1, 0, 9, 9, 0
+ act_def ACT_T_DOG, 0, 9, 9, 0
act_stat_def1 1, 2, 1, 1
act_stat_def2 1, 1, 32, 1
act_st_def st_unit_demo_1_cpu_update, st_unit_idle
unit_demo_hazmat:
st_def 0x00, unit_demo_1_init, st_unit_demo_1_cpu_update
- act_def ACT_T_DEMO_1, 0, 9, 9, 0
+ act_def ACT_T_HAZMAT, 0, 9, 9, 0
act_stat_def1 1, 1, 1, 1
act_stat_def2 1, 1, 32, 1
act_st_def st_unit_demo_1_cpu_update, st_unit_idle