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,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 |
… | |
… | |
42 | int power_space = crystal->stats.maxsp - crystal->stats.sp; |
42 | int power_space = crystal->stats.maxsp - crystal->stats.sp; |
43 | int power_grab; |
43 | int power_grab; |
44 | |
44 | |
45 | if (available_power >= 0 && power_space > 0) |
45 | if (available_power >= 0 && power_space > 0) |
46 | { |
46 | { |
47 | power_grab = min (power_space, 0.5 * op->stats.sp); |
47 | power_grab = min (power_space, op->stats.sp / 2); |
48 | op->statusmsg (format ("The %s takes some of your mana.", query_name (crystal))); |
48 | op->statusmsg (format ("The %s takes some of your mana.", query_name (crystal))); |
49 | } |
49 | } |
50 | else if (available_power < 0 && crystal->stats.sp > 0) |
50 | else if (available_power < 0 && crystal->stats.sp > 0) |
51 | { |
51 | { |
52 | power_grab = -min (-available_power, crystal->stats.sp); |
52 | power_grab = -min (-available_power, crystal->stats.sp); |