1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
… | |
… | |
239 | { /* 1 = going down, 0 = going up */ |
239 | { /* 1 = going down, 0 = going up */ |
240 | object *tmp; |
240 | object *tmp; |
241 | |
241 | |
242 | if (op->stats.wc < 0 || (int) op->stats.wc >= NUM_ANIMATIONS (op)) |
242 | if (op->stats.wc < 0 || (int) op->stats.wc >= NUM_ANIMATIONS (op)) |
243 | { |
243 | { |
244 | LOG (llevError, "Gate error: animation was %d, max=%d\n", op->stats.wc, NUM_ANIMATIONS (op)); |
244 | LOG (llevError, "%s: gate error: animation was %d, max=%d\n", op->debug_desc (), op->stats.wc, NUM_ANIMATIONS (op)); |
245 | op->stats.wc = 0; |
245 | op->stats.wc = 0; |
246 | } |
246 | } |
247 | |
247 | |
248 | /* We're going down */ |
248 | /* We're going down */ |
249 | if (op->value) |
249 | if (op->value) |
… | |
… | |
272 | /* We're going up */ |
272 | /* We're going up */ |
273 | |
273 | |
274 | /* First, lets see if we are already at the top */ |
274 | /* First, lets see if we are already at the top */ |
275 | if ((unsigned char) op->stats.wc == (NUM_ANIMATIONS (op) - 1)) |
275 | if ((unsigned char) op->stats.wc == (NUM_ANIMATIONS (op) - 1)) |
276 | { |
276 | { |
277 | |
|
|
278 | /* Check to make sure that only non pickable and non rollable |
277 | /* Check to make sure that only non pickable and non rollable |
279 | * objects are above the gate. If so, we finish closing the gate, |
278 | * objects are above the gate. If so, we finish closing the gate, |
280 | * otherwise, we fall through to the code below which should lower |
279 | * otherwise, we fall through to the code below which should lower |
281 | * the gate slightly. |
280 | * the gate slightly. |
282 | */ |
281 | */ |
… | |
… | |
729 | * as below. (Note that for living creatures there is a small |
728 | * as below. (Note that for living creatures there is a small |
730 | * chance that reflect_missile fails.) |
729 | * chance that reflect_missile fails.) |
731 | */ |
730 | */ |
732 | if (tmp->flag [FLAG_REFL_MISSILE] && (rndm (0, 99)) < (90 - op->level / 10)) |
731 | if (tmp->flag [FLAG_REFL_MISSILE] && (rndm (0, 99)) < (90 - op->level / 10)) |
733 | { |
732 | { |
734 | int number = op->face; |
|
|
735 | |
|
|
736 | op->direction = absdir (op->direction + 4); |
733 | op->direction = absdir (op->direction + 4); |
737 | update_turn_face (op); |
734 | update_turn_face (op); |
738 | was_reflected = 1; /* skip normal movement calculations */ |
735 | was_reflected = 1; /* skip normal movement calculations */ |
739 | } |
736 | } |
740 | else |
737 | else |
… | |
… | |
1484 | |
1481 | |
1485 | case LAMP: |
1482 | case LAMP: |
1486 | case TORCH: |
1483 | case TORCH: |
1487 | move_lamp (op); |
1484 | move_lamp (op); |
1488 | break; |
1485 | break; |
1489 | } |
|
|
1490 | } |
|
|
1491 | |
1486 | |
|
|
1487 | case PHYSICS: // hmm, bad naming |
|
|
1488 | move_physics (op); |
|
|
1489 | break; |
|
|
1490 | } |
|
|
1491 | } |
|
|
1492 | |