… | |
… | |
694 | |
694 | |
695 | // make some noise with given item into direction dir, |
695 | // make some noise with given item into direction dir, |
696 | // currently only used for players to make them temporarily visible |
696 | // currently only used for players to make them temporarily visible |
697 | // when they are invisible. |
697 | // when they are invisible. |
698 | MTH void make_noise (); |
698 | MTH void make_noise (); |
|
|
699 | |
|
|
700 | /* animation */ |
|
|
701 | bool has_anim () { return animation_id; } |
|
|
702 | const animation &anim () const { return animations [animation_id]; } |
|
|
703 | faceidx get_anim_frame (int frame) const { return anim ().faces [frame]; } |
|
|
704 | void set_anim_frame (int frame) { face = get_anim_frame (frame); } |
|
|
705 | /* anim_frames () returns the number of animations allocated. The last |
|
|
706 | * usuable animation will be anim_frames () - 1 (for example, if an object |
|
|
707 | * has 8 animations, anim_frames () will return 8, but the values will |
|
|
708 | * range from 0 through 7. |
|
|
709 | */ |
|
|
710 | int anim_frames () const { return anim ().num_animations; } |
|
|
711 | int anim_facings () const { return anim ().facings; } |
699 | |
712 | |
700 | protected: |
713 | protected: |
701 | void link (); |
714 | void link (); |
702 | void unlink (); |
715 | void unlink (); |
703 | |
716 | |