1 | |
|
|
2 | /* |
|
|
3 | * static char *rcsid_standalone_c = |
|
|
4 | * "$Id: standalone.C,v 1.3 2006/09/10 16:06:37 root Exp $"; |
|
|
5 | */ |
|
|
6 | |
|
|
7 | /* |
1 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
9 | |
3 | |
10 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
4 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
11 | Copyright (C) 1992 Frank Tore Johansen |
5 | Copyright (C) 1992 Frank Tore Johansen |
… | |
… | |
22 | |
16 | |
23 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
24 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
25 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | |
20 | |
27 | The authors can be reached via e-mail at crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail at <crossfire@schmorp.de> |
28 | */ |
22 | */ |
29 | |
23 | |
30 | #define LO_NEWFILE 2 |
24 | #define LO_NEWFILE 2 |
31 | |
25 | |
32 | /* the main routine for making a standalone version. */ |
26 | /* the main routine for making a standalone version. */ |
… | |
… | |
41 | |
35 | |
42 | int |
36 | int |
43 | main (int argc, char *argv[]) |
37 | main (int argc, char *argv[]) |
44 | { |
38 | { |
45 | char InFileName[1024], OutFileName[1024]; |
39 | char InFileName[1024], OutFileName[1024]; |
46 | mapstruct *newMap; |
40 | maptile *newMap; |
47 | RMParms rp; |
41 | RMParms rp; |
48 | FILE *fp; |
42 | FILE *fp; |
49 | |
43 | |
50 | if (argc < 3) |
44 | if (argc < 3) |
51 | { |
45 | { |
… | |
… | |
77 | new_save_map (newMap, 1); |
71 | new_save_map (newMap, 1); |
78 | exit (0); |
72 | exit (0); |
79 | } |
73 | } |
80 | |
74 | |
81 | void |
75 | void |
82 | set_map_timeout (mapstruct *) |
76 | set_map_timeout (maptile *) |
83 | { |
77 | { |
84 | } /* doesn't need to do anything */ |
78 | } /* doesn't need to do anything */ |
85 | |
79 | |
86 | #include <global.h> |
80 | #include <global.h> |
87 | |
81 | |
… | |
… | |
105 | while ((tmp = generate_treasure (op->randomitems, op->stats.exp ? op->stats.exp : 5)) == NULL && --i); |
99 | while ((tmp = generate_treasure (op->randomitems, op->stats.exp ? op->stats.exp : 5)) == NULL && --i); |
106 | if (tmp == NULL) |
100 | if (tmp == NULL) |
107 | return 0; |
101 | return 0; |
108 | if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) |
102 | if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) |
109 | { |
103 | { |
110 | free_object (tmp); |
104 | tmp->destroy (0); |
111 | tmp = NULL; |
105 | tmp = NULL; |
112 | } |
106 | } |
113 | } |
107 | } |
114 | while (!tmp); |
108 | while (!tmp); |
115 | |
109 | |
… | |
… | |
123 | case TREASURE: |
117 | case TREASURE: |
124 | if (HAS_RANDOM_ITEMS (op)) |
118 | if (HAS_RANDOM_ITEMS (op)) |
125 | while ((op->stats.hp--) > 0) |
119 | while ((op->stats.hp--) > 0) |
126 | create_treasure (op->randomitems, op, GT_ENVIRONMENT, |
120 | create_treasure (op->randomitems, op, GT_ENVIRONMENT, |
127 | op->stats.exp ? op->stats.exp : op->map == NULL ? 14 : op->map->difficulty, 0); |
121 | op->stats.exp ? op->stats.exp : op->map == NULL ? 14 : op->map->difficulty, 0); |
128 | remove_ob (op); |
122 | op->remove (); |
129 | free_object (op); |
123 | op->destroy (0); |
130 | break; |
124 | break; |
131 | } |
125 | } |
132 | |
126 | |
133 | return tmp ? 1 : 0; |
127 | return tmp ? 1 : 0; |
134 | } |
128 | } |
… | |
… | |
138 | * certain objects (most initialization of chests and creation of |
132 | * certain objects (most initialization of chests and creation of |
139 | * treasures and stuff). Calls auto_apply if appropriate. |
133 | * treasures and stuff). Calls auto_apply if appropriate. |
140 | */ |
134 | */ |
141 | |
135 | |
142 | void |
136 | void |
143 | fix_auto_apply (mapstruct *m) |
137 | fix_auto_apply (maptile *m) |
144 | { |
138 | { |
145 | object *tmp, *above = NULL; |
139 | object *tmp, *above = NULL; |
146 | int x, y; |
140 | int x, y; |
147 | |
141 | |
148 | for (x = 0; x < MAP_WIDTH (m); x++) |
142 | for (x = 0; x < MAP_WIDTH (m); x++) |
… | |
… | |
189 | { |
183 | { |
190 | fprintf (logfile, "%s\n", txt); |
184 | fprintf (logfile, "%s\n", txt); |
191 | } |
185 | } |
192 | |
186 | |
193 | void |
187 | void |
194 | new_info_map (int color, mapstruct *map, const char *str) |
188 | new_info_map (int color, maptile *map, const char *str) |
195 | { |
189 | { |
196 | fprintf (logfile, "new_info_map: %s\n", str); |
190 | fprintf (logfile, "new_info_map: %s\n", str); |
197 | } |
191 | } |
198 | |
192 | |
199 | void |
193 | void |
… | |
… | |
245 | weather_effect (const char *c) |
239 | weather_effect (const char *c) |
246 | { |
240 | { |
247 | } |
241 | } |
248 | |
242 | |
249 | void |
243 | void |
250 | set_darkness_map (mapstruct *m) |
244 | set_darkness_map (maptile *m) |
251 | { |
245 | { |
252 | } |
246 | } |
253 | |
247 | |
254 | void |
248 | void |
255 | move_apply (object *ob, object *obt, object *obx) |
249 | move_apply (object *ob, object *obt, object *obx) |