… | |
… | |
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 | && stats.sp) // watchout: old magic bullet stuff directly on the map is going to break here! |
401 | && stats.sp) // watchout: old magic bullet stuff directly on the map is going to break here! |
|
|
402 | // TODO: at least one watchout-comments is redundant - investigate/remove |
401 | { |
403 | { |
|
|
404 | // TODO: fix firewall object on map |
402 | /* 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' |
403 | * in that spell was stored in sp. |
406 | * in that spell was stored in sp. |
404 | */ |
407 | */ |
405 | LOG (llevError, "old spellcasting object found: %s", debug_desc ()); |
408 | //LOG (llevError, "old spellcasting object found: %s", debug_desc ()); |
406 | 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]); |
407 | insert_ob_in_ob (tmp, this); |
410 | insert_ob_in_ob (tmp, this); |
408 | randomitems = 0; |
411 | randomitems = 0; |
409 | } |
412 | } |
410 | |
413 | |
… | |
… | |
557 | case KW_race: f.get_ornull (race); break; |
560 | case KW_race: f.get_ornull (race); break; |
558 | case KW_slaying: f.get_ornull (slaying); break; |
561 | case KW_slaying: f.get_ornull (slaying); break; |
559 | case KW_tag: f.get_ornull (tag); break; |
562 | case KW_tag: f.get_ornull (tag); break; |
560 | |
563 | |
561 | case KW_arch: |
564 | case KW_arch: |
562 | { |
|
|
563 | object *tmp = object::read (f); |
565 | if (object *tmp = object::read (f)) |
564 | tmp->deactivate (); |
|
|
565 | |
|
|
566 | { |
566 | { |
|
|
567 | tmp->deactivate (); |
|
|
568 | |
567 | // was: insert_ob_in_ob (tmp, op); |
569 | // was: insert_ob_in_ob (tmp, op); |
568 | // but manually adding it can improve map loading times a lot |
570 | // but manually adding it can improve map loading times a lot |
569 | // also, appending instead of prepending keeps the |
571 | // also, appending instead of prepending keeps the |
570 | // save ordering the same between repeated load/saves. |
572 | // save ordering the same between repeated load/saves. |
571 | // and finally we do not want any funny effects |
573 | // and finally we do not want any funny effects |
… | |
… | |
588 | |
590 | |
589 | tmp->below = 0; |
591 | tmp->below = 0; |
590 | tmp->env = this; |
592 | tmp->env = this; |
591 | op_inv = tmp; |
593 | op_inv = tmp; |
592 | } |
594 | } |
593 | } |
|
|
594 | continue; |
595 | continue; |
595 | |
596 | |
596 | case KW_other_arch: |
597 | case KW_other_arch: |
597 | if (loading_arch == this) |
598 | if (loading_arch == this) |
598 | archetype::postpone_arch_ref (loading_arch->other_arch, f.get_str ()); |
599 | archetype::postpone_arch_ref (loading_arch->other_arch, f.get_str ()); |