1 /*
2     XorGramana Copyright 2009 James W. Morris, james@jwm-art.net
3 
4     This file is part of XorGramana.
5 
6     XorGramana is free software: you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation, either version 3 of the License, or
9     (at your option) any later version.
10 
11     XorGramana is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15 
16     You should have received a copy of the GNU General Public License
17     along with XorGramana.  If not, see <http://www.gnu.org/licenses/>.
18 */
19 #ifndef _MOVES_H
20 #define _MOVES_H
21 
22 #include "movelist.h"
23 #include "player.h"
24 
25 
26 /* init_unsupported to be called after map loads, and before    *
27  * player takes control. it checks the map for gravitating      *
28  * objects which are not 'resting' against (ie are unsupported) *
29  * anything. essentially this causes them to gravitate.         */
30 void init_unsupported();
31 
32 /* determines if movement of object (not player) is possible */
33 
34 ct_t move_object_init(struct xor_move* move);
35 
36 /* move_gravity_process
37     processes the movement of an object, how this object comes
38     to be moving is decided by player_process_old_pos, and
39     pushed_process_new_pos. the xor_move* xmv is the object
40     (decided by the previous two functions) which is to move.
41     this function checks if other objects need to move because
42     this object is moving, and moves them also.
43 */
44 void move_gravity_process();
45 
46 
47 /* move_unchain_blocked_bomb
48     when a chain of objects has gravitated and the path blocked,
49     look to see if there is a bomb in the chain. if so, remove
50     it and let the remaining chain continue to be processed -
51     returns TRUE if this is to happen
52 */
53 struct xor_move* move_unchain_blocked_bomb(struct xmv_link* lnk);
54 
55 void move_hard_push(struct xor_move* xmv);
56 
57 su_t flip(su_t obj, su_t dir);
58 
59 #endif
60