… | |
… | |
23 | |
23 | |
24 | /* March 96 - Laid down original code. -b.t. thomas@astro.psu.edu */ |
24 | /* March 96 - Laid down original code. -b.t. thomas@astro.psu.edu */ |
25 | |
25 | |
26 | #include <global.h> |
26 | #include <global.h> |
27 | #include <object.h> |
27 | #include <object.h> |
28 | #ifndef __CEXTRACT__ |
|
|
29 | # include <sproto.h> |
28 | #include <sproto.h> |
30 | #endif |
|
|
31 | #include <skills.h> |
29 | #include <skills.h> |
32 | #include <spells.h> |
30 | #include <spells.h> |
33 | |
31 | |
34 | /** define this for some helpful debuging information */ |
32 | /** define this for some helpful debuging information */ |
35 | #if 0 |
33 | #if 0 |
… | |
… | |
595 | object *tmp; |
593 | object *tmp; |
596 | |
594 | |
597 | remove_contents (cauldron->inv, NULL); |
595 | remove_contents (cauldron->inv, NULL); |
598 | switch (rndm (0, 2)) |
596 | switch (rndm (0, 2)) |
599 | { |
597 | { |
600 | case 0: |
598 | case 0: |
601 | tmp = get_archetype ("bomb"); |
599 | tmp = get_archetype ("bomb"); |
602 | tmp->stats.dam = random_roll (1, level, op, PREFER_LOW); |
600 | tmp->stats.dam = random_roll (1, level, op, PREFER_LOW); |
603 | tmp->stats.hp = random_roll (1, level, op, PREFER_LOW); |
601 | tmp->stats.hp = random_roll (1, level, op, PREFER_LOW); |
604 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s creates a bomb!", &cauldron->name); |
602 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s creates a bomb!", &cauldron->name); |
605 | break; |
603 | break; |
606 | |
604 | |
607 | default: |
605 | default: |
608 | tmp = get_archetype ("fireball"); |
606 | tmp = get_archetype ("fireball"); |
609 | tmp->stats.dam = random_roll (1, level, op, PREFER_LOW) / 5 + 1; |
607 | tmp->stats.dam = random_roll (1, level, op, PREFER_LOW) / 5 + 1; |
610 | tmp->stats.hp = random_roll (1, level, op, PREFER_LOW) / 10 + 2; |
608 | tmp->stats.hp = random_roll (1, level, op, PREFER_LOW) / 10 + 2; |
611 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
609 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
612 | break; |
610 | break; |
613 | } |
611 | } |
614 | tmp->x = cauldron->x, tmp->y = cauldron->y; |
612 | |
615 | insert_ob_in_map (tmp, op->map, NULL, 0); |
613 | op->insert_at (cauldron); |
616 | return; |
614 | return; |
617 | |
615 | |
618 | } |
616 | } |
619 | else if (level < 60) |
617 | else if (level < 60) |
620 | { /* CREATE MONSTER */ |
618 | { /* CREATE MONSTER */ |
… | |
… | |
626 | { /* MAJOR FIRE */ |
624 | { /* MAJOR FIRE */ |
627 | object *fb = get_archetype (SP_MED_FIREBALL); |
625 | object *fb = get_archetype (SP_MED_FIREBALL); |
628 | |
626 | |
629 | remove_contents (cauldron->inv, NULL); |
627 | remove_contents (cauldron->inv, NULL); |
630 | fire_arch_from_position (cauldron, cauldron, cauldron->x, cauldron->y, 0, fb); |
628 | fire_arch_from_position (cauldron, cauldron, cauldron->x, cauldron->y, 0, fb); |
631 | fb->destroy (0); |
629 | fb->destroy (); |
632 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
630 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
633 | return; |
631 | return; |
634 | |
632 | |
635 | } |
633 | } |
636 | else if (level < 100) |
634 | else if (level < 100) |
… | |
… | |
704 | return; |
702 | return; |
705 | } |
703 | } |
706 | } |
704 | } |
707 | |
705 | |
708 | |
706 | |
709 | /**
|
707 | /* |
710 | * All but object "save_item" are elimentated from |
708 | * All but object "save_item" are elimentated from |
711 | * the container list. Note we have to becareful to remove the inventories |
709 | * the container list. Note we have to becareful to remove the inventories |
712 | * of objects in the cauldron inventory (ex icecube has stuff in it). |
710 | * of objects in the cauldron inventory (ex icecube has stuff in it). |
713 | */ |
711 | */ |
714 | |
712 | |
… | |
… | |
718 | object *next, *tmp = first_ob; |
716 | object *next, *tmp = first_ob; |
719 | |
717 | |
720 | while (tmp) |
718 | while (tmp) |
721 | { |
719 | { |
722 | next = tmp->below; |
720 | next = tmp->below; |
|
|
721 | |
723 | if (tmp == save_item) |
722 | if (tmp == save_item) |
724 | { |
723 | { |
725 | if (!(tmp = next)) |
724 | if (!(tmp = next)) |
726 | break; |
725 | break; |
727 | else |
726 | else |
728 | next = next->below; |
727 | next = next->below; |
729 | } |
728 | } |
|
|
729 | |
730 | if (tmp->inv) |
730 | if (tmp->inv) |
731 | remove_contents (tmp->inv, NULL); |
731 | remove_contents (tmp->inv, NULL); |
732 | tmp->remove (); |
732 | |
733 | tmp->destroy (0); |
733 | tmp->destroy (); |
734 | tmp = next; |
734 | tmp = next; |
735 | } |
735 | } |
736 | } |
736 | } |
737 | |
737 | |
738 | /**
|
738 | /**
|