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,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 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 |
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. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the Affero GNU General Public License |
18 | * You should have received a copy of the Affero GNU General Public License |
19 | * and the GNU General Public License along with this program. If not, see |
19 | * and the GNU General Public License along with this program. If not, see |
20 | * <http://www.gnu.org/licenses/>. |
20 | * <http://www.gnu.org/licenses/>. |
21 | * |
21 | * |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
23 | */ |
23 | */ |
24 | |
24 | |
25 | #include <global.h> |
25 | #include <global.h> |
26 | #include <object.h> |
26 | #include <object.h> |
… | |
… | |
196 | /* Can't get any money for these objects */ |
196 | /* Can't get any money for these objects */ |
197 | missile->value = 0; |
197 | missile->value = 0; |
198 | |
198 | |
199 | missile->set_flag (FLAG_IDENTIFIED); |
199 | missile->set_flag (FLAG_IDENTIFIED); |
200 | |
200 | |
201 | if (!cast_create_obj (op, caster, missile, dir) && op->type == PLAYER && !missile->destroyed ()) |
201 | cast_create_obj (op, caster, missile, dir); |
|
|
202 | |
|
|
203 | if (!dir |
|
|
204 | && op->type == PLAYER |
|
|
205 | && !missile->destroyed ()) |
202 | pick_up (op, missile); |
206 | pick_up (op, missile); |
203 | |
207 | |
204 | return 1; |
208 | return 1; |
205 | } |
209 | } |
206 | |
|
|
207 | |
210 | |
208 | /* allows the choice of what sort of food object to make. |
211 | /* allows the choice of what sort of food object to make. |
209 | * If spellparam is NULL, it will create food dependent on level --PeterM*/ |
212 | * If spellparam is NULL, it will create food dependent on level --PeterM*/ |
210 | int |
213 | int |
211 | cast_create_food (object *op, object *caster, object *spell_ob, int dir, const char *spellparam) |
214 | cast_create_food (object *op, object *caster, object *spell_ob, int dir, const char *spellparam) |
… | |
… | |
401 | |
404 | |
402 | if (spell_ob->flag [FLAG_MAKE_INVIS]) |
405 | if (spell_ob->flag [FLAG_MAKE_INVIS]) |
403 | op->contr->tmp_invis = 0; |
406 | op->contr->tmp_invis = 0; |
404 | else |
407 | else |
405 | op->contr->tmp_invis = 1; |
408 | op->contr->tmp_invis = 1; |
406 | |
|
|
407 | op->contr->hidden = 0; |
|
|
408 | } |
409 | } |
409 | |
410 | |
410 | if (makes_invisible_to (op, op)) |
411 | if (makes_invisible_to (op, op)) |
411 | new_draw_info (NDI_UNIQUE, 0, op, "You can't see your hands!"); |
412 | new_draw_info (NDI_UNIQUE, 0, op, "You can't see your hands!"); |
412 | else |
413 | else |
… | |
… | |
1257 | |
1258 | |
1258 | /* Alchemy code by Mark Wedel |
1259 | /* Alchemy code by Mark Wedel |
1259 | * |
1260 | * |
1260 | * This code adds a new spell, called alchemy. Alchemy will turn |
1261 | * This code adds a new spell, called alchemy. Alchemy will turn |
1261 | * objects to pyrite ("false gold"), henceforth called gold nuggets. |
1262 | * objects to pyrite ("false gold"), henceforth called gold nuggets. |
1262 | * |
1263 | * |
1263 | * The value of the gold nuggets being about 90% of that of the item |
1264 | * The value of the gold nuggets being about 90% of that of the item |
1264 | * itself. It uses the value of the object before charisma adjustments, |
1265 | * itself. It uses the value of the object before charisma adjustments, |
1265 | * because the nuggets themselves will be will be adjusted by charisma |
1266 | * because the nuggets themselves will be will be adjusted by charisma |
1266 | * when sold. |
1267 | * when sold. |
1267 | * |
1268 | * |