… | |
… | |
385 | if (ip > 2 * item_power && ip > (item_power + 3)) |
385 | if (ip > 2 * item_power && ip > (item_power + 3)) |
386 | LOG (llevDebug, "Object %s seems to have too low item power? %d > %d\n", debug_desc (), ip, item_power); |
386 | LOG (llevDebug, "Object %s seems to have too low item power? %d > %d\n", debug_desc (), ip, item_power); |
387 | #endif |
387 | #endif |
388 | } |
388 | } |
389 | |
389 | |
390 | /* Old spellcasting object - need to load in the appropiate object */ |
390 | /* old style spellcasting object (pretty common) - need to load in the appropiate object */ |
|
|
391 | /* (schmorp) old really doesn't mean old, imho, just a more compact way to store such objects */ |
391 | if ((type == ROD |
392 | if ((type == ROD |
392 | || type == WAND |
393 | || type == WAND |
393 | || type == SCROLL |
394 | || type == SCROLL |
394 | || type == HORN |
395 | || type == HORN |
395 | || type == FIREWALL |
396 | || type == FIREWALL |
396 | /* POTIONS and ALTARS don't always cast spells, but if they do, update them */ |
397 | /* POTIONS and ALTARS don't always cast spells, but if they do, update them */ |
397 | || ((type == POTION || type == ALTAR) && stats.sp)) // watchout: sp = 0 is still magic bullet. |
398 | || ((type == POTION || type == ALTAR) && stats.sp)) // watchout: sp = 0 is still magic bullet. |
398 | && !inv |
399 | && !inv |
399 | && !loading_arch |
400 | && !loading_arch |
400 | && !randomitems) // by elmex: not _any_ rod or horn we find on a map, which has randomitems is an old spellcasting |
401 | && stats.sp) // watchout: old magic bullet stuff directly on the map is going to break here! |
401 | // object. For instance lythanders pipe got it's spell in the treasurelist in the randomitems, |
402 | // TODO: at least one watchout-comments is redundant - investigate/remove |
402 | // same goes for normal rods. |
|
|
403 | { |
403 | { |
|
|
404 | // TODO: fix firewall object on map |
404 | /* Firewall is bizarre in that spell type was stored in dam. Rest are 'normal' |
405 | /* Firewall is bizarre in that spell type was stored in dam. Rest are 'normal' |
405 | * in that spell was stored in sp. |
406 | * in that spell was stored in sp. |
406 | */ |
407 | */ |
407 | LOG (llevError, "old spellcasting object found: %s", debug_desc ()); |
408 | //LOG (llevError, "old spellcasting object found: %s", debug_desc ()); |
408 | object *tmp = get_archetype (spell_mapping[type == FIREWALL ? stats.dam : stats.sp]); |
409 | object *tmp = get_archetype (spell_mapping[type == FIREWALL ? stats.dam : stats.sp]); |
409 | insert_ob_in_ob (tmp, this); |
410 | insert_ob_in_ob (tmp, this); |
|
|
411 | randomitems = 0; |
410 | } |
412 | } |
411 | |
413 | |
412 | /* spellbooks & runes use slaying. But not to arch name, but to spell name */ |
414 | /* spellbooks & runes use slaying. But not to arch name, but to spell name */ |
413 | if ((type == SPELLBOOK || type == RUNE) && slaying && !inv && !loading_arch) |
415 | if ((type == SPELLBOOK || type == RUNE) && slaying && !inv && !loading_arch) |
414 | { |
416 | { |