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 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 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 |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * option) any later version. |
11 | * option) any later version. |
… | |
… | |
838 | dir = absdir (4 + rv.direction); |
838 | dir = absdir (4 + rv.direction); |
839 | for (diff = 0; diff < 3; diff++) |
839 | for (diff = 0; diff < 3; diff++) |
840 | { |
840 | { |
841 | int m = 1 - rndm (2) * 2; |
841 | int m = 1 - rndm (2) * 2; |
842 | |
842 | |
843 | if (move_ob (op, absdir (dir + diff * m), op) || (diff == 0 && move_ob (op, absdir (dir - diff * m), op))) |
843 | if (op->move (absdir (dir + diff * m)) || (diff == 0 && op->move (absdir (dir - diff * m)))) |
844 | return; |
844 | return; |
845 | } |
845 | } |
846 | |
846 | |
847 | /* Cornered, get rid of scared */ |
847 | /* Cornered, get rid of scared */ |
848 | CLEAR_FLAG (op, FLAG_SCARED); |
848 | CLEAR_FLAG (op, FLAG_SCARED); |
… | |
… | |
1856 | * going to try and move (not fire weapons). |
1856 | * going to try and move (not fire weapons). |
1857 | */ |
1857 | */ |
1858 | bool |
1858 | bool |
1859 | move_player_attack (object *op, int dir) |
1859 | move_player_attack (object *op, int dir) |
1860 | { |
1860 | { |
1861 | if (!op->contr->braced && op->speed_left > 0.f && move_ob (op, dir, op)) |
1861 | if (!op->contr->braced && op->speed_left > 0.f && op->move (dir)) |
1862 | { |
1862 | { |
1863 | --op->speed_left; |
1863 | --op->speed_left; |
1864 | return true; |
1864 | return true; |
1865 | } |
1865 | } |
1866 | |
1866 | |