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

Comparing deliantra/server/server/apply.C (file contents):
Revision 1.165 by root, Tue Jul 15 00:00:37 2008 UTC vs.
Revision 1.169 by root, Sun Sep 7 21:31:23 2008 UTC

53 * subtype 5: arch or race 53 * subtype 5: arch or race
54 * subtype 7: all three 54 * subtype 7: all three
55 */ 55 */
56 if (op->subtype) 56 if (op->subtype)
57 { 57 {
58 arch_flag = (op->subtype & 1); 58 arch_flag = op->subtype & 1;
59 name_flag = (op->subtype & 2); 59 name_flag = op->subtype & 2;
60 race_flag = (op->subtype & 4); 60 race_flag = op->subtype & 4;
61 } 61 }
62 else 62 else
63 { 63 {
64 arch_flag = 1; 64 arch_flag = 1;
65 name_flag = 1; 65 name_flag = 1;
113 { 113 {
114 if (operate_altar (altar, &money)) 114 if (operate_altar (altar, &money))
115 { 115 {
116 identify (marked); 116 identify (marked);
117 117
118 buf.printf ("You have %s.\n\n", long_desc (marked, pl)); 118 buf.printf ("You have %s.\r", long_desc (marked, pl));
119 if (marked->msg) 119 if (marked->msg)
120 buf << "The item has a story:\n\n" << marked->msg << "\n\n"; 120 buf << "The item has a story:\r" << marked->msg << "\n\n";
121 121
122 return !money; 122 return !money;
123 } 123 }
124 } 124 }
125 125
129 { 129 {
130 if (operate_altar (altar, &money)) 130 if (operate_altar (altar, &money))
131 { 131 {
132 identify (id); 132 identify (id);
133 133
134 buf.printf ("You have %s.\n\n", long_desc (id, pl)); 134 buf.printf ("You have %s.\r", long_desc (id, pl));
135 if (id->msg) 135 if (id->msg)
136 buf << "The item has a story:\n\n" << id->msg << "\n\n"; 136 buf << "The item has a story:\r" << id->msg << "\n\n";
137 137
138 /* If no more money, might as well quit now */ 138 /* If no more money, might as well quit now */
139 if (!money || !check_altar_sacrifice (altar, money)) 139 if (!money || !check_altar_sacrifice (altar, money))
140 break; 140 break;
141 } 141 }
1316 draw_ext_info (NDI_UNIQUE | NDI_NAVY, 0, op, msgType->message_type, msgType->message_subtype, somemsg, &sign->msg); 1316 draw_ext_info (NDI_UNIQUE | NDI_NAVY, 0, op, msgType->message_type, msgType->message_subtype, somemsg, &sign->msg);
1317 } 1317 }
1318 } 1318 }
1319} 1319}
1320 1320
1321static void
1322move_apply_hole (object *trap, object *victim)
1323{
1324 /* Hole not open? */
1325 if (trap->stats.wc > 0)
1326 return;
1327
1328 /* Is this a multipart monster and not the head? If so, return.
1329 * Processing will happen if the head runs into the pit
1330 */
1331 if (victim->head)
1332 return;
1333
1334 // now find all possible locations and randomly pick one
1335 int dir = find_free_spot (victim, trap->map, EXIT_X (trap), EXIT_Y (trap), 0,
1336 trap->range >= 3 ? SIZEOFFREE3 + 1
1337 : trap->range >= 2 ? SIZEOFFREE2 + 1
1338 : trap->range >= 1 ? SIZEOFFREE1 + 1
1339 : SIZEOFFREE0 + 1);
1340
1341 if (dir < 0)
1342 return;
1343
1344 victim->play_sound (trap->sound ? trap->sound : sound_find ("fall_hole"));
1345 victim->statusmsg ("You fall through the hole!", NDI_RED);
1346
1347 transfer_ob (victim,
1348 EXIT_X (trap) + freearr_x[dir],
1349 EXIT_Y (trap) + freearr_y[dir],
1350 0, victim);
1351}
1352
1321/** 1353/**
1322 * 'victim' moves onto 'trap' 1354 * 'victim' moves onto 'trap'
1323 * 'victim' leaves 'trap' 1355 * 'victim' leaves 'trap'
1324 * effect is determined by move_on/move_off of trap and move_type of victime. 1356 * effect is determined by move_on/move_off of trap and move_type of victime.
1325 * 1357 *
1492 case CHECK_INV: 1524 case CHECK_INV:
1493 check_inv (victim, trap); 1525 check_inv (victim, trap);
1494 goto leave; 1526 goto leave;
1495 1527
1496 case HOLE: 1528 case HOLE:
1497 /* Hole not open? */ 1529 move_apply_hole (trap, victim);
1498 if (trap->stats.wc > 0)
1499 goto leave;
1500
1501 /* Is this a multipart monster and not the head? If so, return.
1502 * Processing will happen if the head runs into the pit
1503 */
1504 if (victim->head)
1505 goto leave;
1506
1507 victim->play_sound (trap->sound ? trap->sound : sound_find ("fall_hole"));
1508 victim->statusmsg ("You fall through the hole!", NDI_RED);
1509 transfer_ob (victim, EXIT_X (trap), EXIT_Y (trap), 1, victim);
1510 goto leave; 1530 goto leave;
1511 1531
1512 case EXIT: 1532 case EXIT:
1513 if (victim->type == PLAYER && EXIT_PATH (trap)) 1533 if (victim->type == PLAYER && EXIT_PATH (trap))
1514 { 1534 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines