ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/random_maps/exit.C
(Generate patch)

Comparing deliantra/server/random_maps/exit.C (file contents):
Revision 1.14 by root, Sun Dec 31 10:28:36 2006 UTC vs.
Revision 1.15 by root, Sun Dec 31 17:17:23 2006 UTC

23 23
24#include <global.h> 24#include <global.h>
25#include <random_map.h> 25#include <random_map.h>
26#include <sproto.h> 26#include <sproto.h>
27#include <rproto.h> 27#include <rproto.h>
28
29 28
30/* find a character in the layout. fx and fy are pointers to 29/* find a character in the layout. fx and fy are pointers to
31 where to find the char. fx,fy = -1 if not found. */ 30 where to find the char. fx,fy = -1 if not found. */
32void 31void
33find_in_layout (int mode, char target, int *fx, int *fy, char **layout, random_map_params * RP) 32find_in_layout (int mode, char target, int *fx, int *fy, char **layout, random_map_params * RP)
140 if (orientation == 0) 139 if (orientation == 0)
141 orientation = RANDOM () % 6 + 1; 140 orientation = RANDOM () % 6 + 1;
142 141
143 switch (orientation) 142 switch (orientation)
144 { 143 {
145 case 1: 144 case 1:
146 { 145 {
147 sprintf (styledirname, "/styles/exitstyles/up"); 146 sprintf (styledirname, "/styles/exitstyles/up");
148 style_map_up = find_style (styledirname, exitstyle, -1); 147 style_map_up = find_style (styledirname, exitstyle, -1);
149 sprintf (styledirname, "/styles/exitstyles/down"); 148 sprintf (styledirname, "/styles/exitstyles/down");
150 style_map_down = find_style (styledirname, exitstyle, -1); 149 style_map_down = find_style (styledirname, exitstyle, -1);
151 break; 150 break;
152 } 151 }
152
153 case 2: 153 case 2:
154 { 154 {
155 sprintf (styledirname, "/styles/exitstyles/down"); 155 sprintf (styledirname, "/styles/exitstyles/down");
156 style_map_up = find_style (styledirname, exitstyle, -1); 156 style_map_up = find_style (styledirname, exitstyle, -1);
157 sprintf (styledirname, "/styles/exitstyles/up"); 157 sprintf (styledirname, "/styles/exitstyles/up");
158 style_map_down = find_style (styledirname, exitstyle, -1); 158 style_map_down = find_style (styledirname, exitstyle, -1);
159 break; 159 break;
160 } 160 }
161
161 default: 162 default:
162 { 163 {
163 sprintf (styledirname, "/styles/exitstyles/generic"); 164 sprintf (styledirname, "/styles/exitstyles/generic");
164 style_map_up = find_style (styledirname, exitstyle, -1); 165 style_map_up = find_style (styledirname, exitstyle, -1);
165 style_map_down = style_map_up; 166 style_map_down = style_map_up;
166 break; 167 break;
167 } 168 }
168 } 169 }
170
169 if (style_map_up == 0) 171 if (style_map_up == 0)
170 the_exit_up = arch_to_object (archetype::find ("exit")); 172 the_exit_up = arch_to_object (archetype::find ("exit"));
171 else 173 else
172 { 174 {
173 object *tmp; 175 object *tmp;
191 the_exit_down = 0; 193 the_exit_down = 0;
192 194
193 /* set up the up exit */ 195 /* set up the up exit */
194 the_exit_up->stats.hp = RP->origin_x; 196 the_exit_up->stats.hp = RP->origin_x;
195 the_exit_up->stats.sp = RP->origin_y; 197 the_exit_up->stats.sp = RP->origin_y;
196 the_exit_up->slaying = RP->origin_map; 198 the_exit_up->slaying = RP->origin_map;
197 199
198 /* figure out where to put the entrance */ 200 /* figure out where to put the entrance */
199 /* begin a logical block */ 201 /* begin a logical block */
200 { 202 {
201 int i, j; 203 int i, j;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines