… | |
… | |
27 | |
27 | |
28 | /* some monsters are multisquare, and these guys require special |
28 | /* some monsters are multisquare, and these guys require special |
29 | handling. */ |
29 | handling. */ |
30 | |
30 | |
31 | void |
31 | void |
32 | insert_multisquare_ob_in_map (object *new_obj, mapstruct *map) |
32 | insert_multisquare_ob_in_map (object *new_obj, maptile *map) |
33 | { |
33 | { |
34 | int x, y; |
34 | int x, y; |
35 | archetype *at; |
35 | archetype *at; |
36 | object *old_seg; |
36 | object *old_seg; |
37 | object *head; |
37 | object *head; |
… | |
… | |
41 | |
41 | |
42 | x = new_obj->x; |
42 | x = new_obj->x; |
43 | y = new_obj->y; |
43 | y = new_obj->y; |
44 | old_seg = new_obj; |
44 | old_seg = new_obj; |
45 | head = new_obj; |
45 | head = new_obj; |
|
|
46 | |
46 | for (at = new_obj->arch->more; at != NULL; at = at->more) |
47 | for (at = new_obj->arch->more; at != NULL; at = at->more) |
47 | { |
48 | { |
48 | object *new_seg; |
49 | object *new_seg; |
49 | |
50 | |
50 | new_seg = arch_to_object (at); |
51 | new_seg = arch_to_object (at); |
… | |
… | |
54 | insert_ob_in_map (new_seg, new_seg->map, new_seg, INS_NO_MERGE | INS_NO_WALK_ON); |
55 | insert_ob_in_map (new_seg, new_seg->map, new_seg, INS_NO_MERGE | INS_NO_WALK_ON); |
55 | new_seg->head = head; |
56 | new_seg->head = head; |
56 | old_seg->more = new_seg; |
57 | old_seg->more = new_seg; |
57 | old_seg = new_seg; |
58 | old_seg = new_seg; |
58 | } |
59 | } |
|
|
60 | |
59 | old_seg->more = NULL; |
61 | old_seg->more = NULL; |
60 | |
|
|
61 | |
|
|
62 | } |
62 | } |
63 | |
|
|
64 | |
63 | |
65 | /* place some monsters into the map. */ |
64 | /* place some monsters into the map. */ |
66 | void |
65 | void |
67 | place_monsters (mapstruct *map, char *monsterstyle, int difficulty, RMParms * RP) |
66 | place_monsters (maptile *map, char *monsterstyle, int difficulty, random_map_params * RP) |
68 | { |
67 | { |
69 | char styledirname[256]; |
68 | char styledirname[256]; |
70 | mapstruct *style_map = 0; |
69 | maptile *style_map = 0; |
71 | int failed_placements; |
70 | int failed_placements; |
72 | sint64 exp_per_sq, total_experience; |
71 | sint64 exp_per_sq, total_experience; |
73 | int number_monsters = 0; |
72 | int number_monsters = 0; |
74 | archetype *at; |
73 | archetype *at; |
75 | |
74 | |
… | |
… | |
107 | for (at = new_monster->arch; at != NULL; at = at->more) |
106 | for (at = new_monster->arch; at != NULL; at = at->more) |
108 | number_monsters++; |
107 | number_monsters++; |
109 | RP->total_map_hp += new_monster->stats.hp; /* a global count */ |
108 | RP->total_map_hp += new_monster->stats.hp; /* a global count */ |
110 | } |
109 | } |
111 | else |
110 | else |
112 | { |
|
|
113 | failed_placements++; |
111 | failed_placements++; |
114 | } |
112 | |
115 | exp_per_sq = (sint64) (((double) 1000 * total_experience) / (MAP_WIDTH (map) * MAP_HEIGHT (map) + 1)); |
113 | exp_per_sq = (sint64) (((double) 1000 * total_experience) / (map->width * map->height + 1)); |
116 | } |
114 | } |
117 | } |
115 | } |