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

Comparing deliantra/server/server/monster.C (file contents):
Revision 1.90 by root, Sat May 15 23:41:06 2010 UTC vs.
Revision 1.93 by root, Sat Dec 31 06:18:01 2011 UTC

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 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011 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
255 /* This covers the situation where the monster is in the dark 255 /* This covers the situation where the monster is in the dark
256 * and has an enemy. If the enemy has no carried light (or isnt 256 * and has an enemy. If the enemy has no carried light (or isnt
257 * glowing!) then the monster has trouble finding the enemy. 257 * glowing!) then the monster has trouble finding the enemy.
258 * Remember we already checked to see if the monster can see in 258 * Remember we already checked to see if the monster can see in
259 * the dark. */ 259 * the dark. */
260 radius = min (radius, MIN_MON_RADIUS + MAX_DARKNESS - op->map->darklevel ()); 260 min_it (radius, MIN_MON_RADIUS + MAX_DARKNESS - op->map->darklevel ());
261 261
262 if (enemy->flag [FLAG_STEALTH]) 262 if (enemy->flag [FLAG_STEALTH])
263 radius = radius / 2 + 1; 263 radius = radius / 2 + 1;
264 264
265 /* enemy should already be on this map, so don't really need to check 265 /* enemy should already be on this map, so don't really need to check
1273 /* for target facing, we copy this value here for fast access */ 1273 /* for target facing, we copy this value here for fast access */
1274 if (oph->head) /* force update the head - one arch one pic */ 1274 if (oph->head) /* force update the head - one arch one pic */
1275 oph = oph->head; 1275 oph = oph->head;
1276 1276
1277 if (op->flag [FLAG_NO_ATTACK]) /* we never ever attack */ 1277 if (op->flag [FLAG_NO_ATTACK]) /* we never ever attack */
1278 enemy = op->enemy = NULL; 1278 enemy = op->enemy = 0;
1279 else if ((enemy = find_enemy (op, &rv))) 1279 else if ((enemy = find_enemy (op, &rv)))
1280 /* we have an enemy, just tell him we want him dead */ 1280 /* we have an enemy, just tell him we want him dead */
1281 enemy->attacked_by = op; /* our ptr */ 1281 enemy->attacked_by = op; /* our ptr */
1282 1282
1283 /* generate hp, if applicable */ 1283 /* generate hp, if applicable */
1764 * vector is real distance, so in theory this should be 18 to 1764 * vector is real distance, so in theory this should be 18 to
1765 * find that. 1765 * find that.
1766 */ 1766 */
1767 // note that the above reasoning was utter bullshit even at the time it was written 1767 // note that the above reasoning was utter bullshit even at the time it was written
1768 // we use 25, lets see if we have the cpu time for it 1768 // we use 25, lets see if we have the cpu time for it
1769 radius = min (25, radius); 1769 min_it (radius, 25);
1770 1770
1771 /* Enemy in range! Now test for detection */ 1771 /* Enemy in range! Now test for detection */
1772 if (rv->distance <= radius) 1772 if (rv->distance <= radius)
1773 { 1773 {
1774 /* ah, we are within range, detected? take cases */ 1774 /* ah, we are within range, detected? take cases */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines