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 (©) 2003 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2003 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 <sproto.h> |
26 | #include <sproto.h> |
… | |
… | |
142 | /* already proper rune. Note this should only be the case if other_arch was set */ |
142 | /* already proper rune. Note this should only be the case if other_arch was set */ |
143 | if (rune_spell->type == RUNE) |
143 | if (rune_spell->type == RUNE) |
144 | rune = rune_spell; |
144 | rune = rune_spell; |
145 | else |
145 | else |
146 | { |
146 | { |
147 | rune = get_archetype (GENERIC_RUNE); |
147 | rune = archetype::get (GENERIC_RUNE); |
148 | rune->msg = format ("You set off a rune of %s\n", &rune_spell->name); |
148 | rune->msg = format ("You set off a rune of %s\n", &rune_spell->name); |
149 | rune->insert (rune_spell->clone ()); |
149 | rune->insert (rune_spell->clone ()); |
150 | |
150 | |
151 | if (spell->face != blank_face) |
151 | if (spell->face != blank_face) |
152 | rune->face = spell->face; |
152 | rune->face = spell->face; |
… | |
… | |
181 | if (!op->level) |
181 | if (!op->level) |
182 | return; |
182 | return; |
183 | |
183 | |
184 | int det = op->invisible; |
184 | int det = op->invisible; |
185 | |
185 | |
186 | if (!(rndm (0, max (1, (op->stats.Cha)) - 1))) |
186 | if (!(rndm (0, max (0, op->stats.Cha - 1)))) |
187 | { |
187 | { |
188 | op->invisible = 0; |
188 | op->invisible = 0; |
189 | op->speed_left -= 1; |
189 | op->speed_left -= 1; |
190 | } |
190 | } |
191 | else |
191 | else |
… | |
… | |
407 | trap_show (object *trap, object *where) |
407 | trap_show (object *trap, object *where) |
408 | { |
408 | { |
409 | if (where == NULL) |
409 | if (where == NULL) |
410 | return 0; |
410 | return 0; |
411 | |
411 | |
412 | object *tmp = get_archetype (shstr_runedet); |
412 | object *tmp = archetype::get (shstr_runedet); |
413 | tmp->face = trap->get_anim_frame (0); |
413 | tmp->face = trap->get_anim_frame (0); |
414 | tmp->insert_at (where, 0); |
414 | tmp->insert_at (where, 0); |
415 | |
415 | |
416 | return 1; |
416 | return 1; |
417 | } |
417 | } |