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 |
… | |
… | |
157 | { |
157 | { |
158 | walk->level = disease->level; |
158 | walk->level = disease->level; |
159 | return 1; /* just update the existing immunity. */ |
159 | return 1; /* just update the existing immunity. */ |
160 | } |
160 | } |
161 | |
161 | |
162 | immunity = get_archetype (shstr_immunity); |
162 | immunity = archetype::get (shstr_immunity); |
163 | |
163 | |
164 | immunity->name = disease->name; |
164 | immunity->name = disease->name; |
165 | immunity->level = disease->level; |
165 | immunity->level = disease->level; |
166 | immunity->move_block = 0; |
166 | immunity->move_block = 0; |
167 | |
167 | |
… | |
… | |
293 | for (tmp = victim->head_ ()->inv; tmp; tmp = tmp->below) |
293 | for (tmp = victim->head_ ()->inv; tmp; tmp = tmp->below) |
294 | if (tmp->name == disease->name && tmp->is_immunity ()) /* possibly an immunity, or diseased */ |
294 | if (tmp->name == disease->name && tmp->is_immunity ()) /* possibly an immunity, or diseased */ |
295 | if (tmp->level >= disease->level) |
295 | if (tmp->level >= disease->level) |
296 | return 0; /* Immune! */ |
296 | return 0; /* Immune! */ |
297 | |
297 | |
298 | object *new_symptom = get_archetype (shstr_symptom); |
298 | object *new_symptom = archetype::get (shstr_symptom); |
299 | |
299 | |
300 | /* Something special done with dam. We want diseases to be more |
300 | /* Something special done with dam. We want diseases to be more |
301 | * random in what they'll kill, so we'll make the damage they |
301 | * random in what they'll kill, so we'll make the damage they |
302 | * do random, note, this has a weird effect with progressive diseases. |
302 | * do random, note, this has a weird effect with progressive diseases. |
303 | */ |
303 | */ |
… | |
… | |
318 | new_symptom->stats.food = new_symptom->stats.maxgrace; |
318 | new_symptom->stats.food = new_symptom->stats.maxgrace; |
319 | |
319 | |
320 | new_symptom->name = new_symptom->name_pl = disease->name; |
320 | new_symptom->name = new_symptom->name_pl = disease->name; |
321 | |
321 | |
322 | new_symptom->level = disease->level; |
322 | new_symptom->level = disease->level; |
323 | new_symptom->speed = disease->speed; |
|
|
324 | new_symptom->value = 0; |
323 | new_symptom->value = 0; |
|
|
324 | |
|
|
325 | new_symptom->set_speed (disease->speed); |
325 | |
326 | |
326 | for (int i = 0; i < NUM_STATS; ++i) |
327 | for (int i = 0; i < NUM_STATS; ++i) |
327 | new_symptom->stats.stat (i) = disease->stats.stat (i); |
328 | new_symptom->stats.stat (i) = disease->stats.stat (i); |
328 | |
329 | |
329 | new_symptom->stats.sp = disease->stats.sp; |
330 | new_symptom->stats.sp = disease->stats.sp; |