… | |
… | |
662 | { |
662 | { |
663 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
663 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
664 | LOG (llevError, "object::create failed (force in cast_create_town_portal for %s!\n", &op->name); |
664 | LOG (llevError, "object::create failed (force in cast_create_town_portal for %s!\n", &op->name); |
665 | return 0; |
665 | return 0; |
666 | } |
666 | } |
|
|
667 | |
667 | force = check_inv_recursive (op, dummy); |
668 | force = check_inv_recursive (op, dummy); |
668 | |
669 | |
669 | if (force == NULL) |
670 | if (force == NULL) |
670 | { |
671 | { |
671 | /* Here we know there is no destination marked up. |
672 | /* Here we know there is no destination marked up. |
… | |
… | |
705 | { |
706 | { |
706 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
707 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
707 | LOG (llevError, "object::create failed (force) in cast_create_town_portal for %s!\n", &op->name); |
708 | LOG (llevError, "object::create failed (force) in cast_create_town_portal for %s!\n", &op->name); |
708 | return 0; |
709 | return 0; |
709 | } |
710 | } |
|
|
711 | |
710 | perm_portal = archetype::find (spell->slaying); |
712 | perm_portal = archetype::find (spell->slaying); |
711 | |
713 | |
712 | /* To kill a town portal, we go trough the player's inventory, |
714 | /* To kill a town portal, we go trough the player's inventory, |
713 | * for each marked portal in player's inventory, |
715 | * for each marked portal in player's inventory, |
714 | * -We try load the associated map (if impossible, consider the portal destructed) |
716 | * -We try load the associated map (if impossible, consider the portal destructed) |
… | |
… | |
797 | { |
799 | { |
798 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
800 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
799 | LOG (llevError, "object::create failed (perm_magic_portal) in cast_create_town_portal for %s!\n", &op->name); |
801 | LOG (llevError, "object::create failed (perm_magic_portal) in cast_create_town_portal for %s!\n", &op->name); |
800 | return 0; |
802 | return 0; |
801 | } |
803 | } |
|
|
804 | |
802 | EXIT_PATH (dummy) = force->name; |
805 | EXIT_PATH (dummy) = force->name; |
803 | EXIT_X (dummy) = EXIT_X (force); |
806 | EXIT_X (dummy) = EXIT_X (force); |
804 | EXIT_Y (dummy) = EXIT_Y (force); |
807 | EXIT_Y (dummy) = EXIT_Y (force); |
805 | dummy->name = dummy->name_pl = portal_name; |
808 | dummy->name = dummy->name_pl = portal_name; |
806 | dummy->msg = portal_message; |
809 | dummy->msg = portal_message; |
… | |
… | |
816 | { |
819 | { |
817 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
820 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
818 | LOG (llevError, "object::create failed (force) in cast_create_town_portal for %s!\n", &op->name); |
821 | LOG (llevError, "object::create failed (force) in cast_create_town_portal for %s!\n", &op->name); |
819 | return 0; |
822 | return 0; |
820 | } |
823 | } |
|
|
824 | |
821 | tmp->race = op->map->path; |
825 | tmp->race = op->map->path; |
822 | tmp->name = portal_name; |
826 | tmp->name = portal_name; |
823 | EXIT_X (tmp) = dummy->x; |
827 | EXIT_X (tmp) = dummy->x; |
824 | EXIT_Y (tmp) = dummy->y; |
828 | EXIT_Y (tmp) = dummy->y; |
825 | insert_ob_in_ob (tmp, op); |
829 | insert_ob_in_ob (tmp, op); |
… | |
… | |
836 | { |
840 | { |
837 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
841 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
838 | LOG (llevError, "object::create failed (perm_magic_portal) in cast_create_town_portal for %s!\n", &op->name); |
842 | LOG (llevError, "object::create failed (perm_magic_portal) in cast_create_town_portal for %s!\n", &op->name); |
839 | return 0; |
843 | return 0; |
840 | } |
844 | } |
|
|
845 | |
841 | EXIT_PATH (dummy) = op->map->path; |
846 | EXIT_PATH (dummy) = op->map->path; |
842 | EXIT_X (dummy) = op->x; |
847 | EXIT_X (dummy) = op->x; |
843 | EXIT_Y (dummy) = op->y; |
848 | EXIT_Y (dummy) = op->y; |
844 | dummy->name = dummy->name_pl = portal_name; |
849 | dummy->name = dummy->name_pl = portal_name; |
845 | dummy->msg = portal_message; |
850 | dummy->msg = portal_message; |
… | |
… | |
856 | { |
861 | { |
857 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
862 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
858 | LOG (llevError, "object::create failed (force) in cast_create_town_portal for %s!\n", &op->name); |
863 | LOG (llevError, "object::create failed (force) in cast_create_town_portal for %s!\n", &op->name); |
859 | return 0; |
864 | return 0; |
860 | } |
865 | } |
|
|
866 | |
861 | tmp->race = force->name; |
867 | tmp->race = force->name; |
862 | tmp->name = portal_name; |
868 | tmp->name = portal_name; |
863 | EXIT_X (tmp) = dummy->x; |
869 | EXIT_X (tmp) = dummy->x; |
864 | EXIT_Y (tmp) = dummy->y; |
870 | EXIT_Y (tmp) = dummy->y; |
865 | insert_ob_in_ob (tmp, op); |
871 | insert_ob_in_ob (tmp, op); |
… | |
… | |
940 | } |
946 | } |
941 | else if (QUERY_FLAG (tmp, FLAG_ALIVE)) |
947 | else if (QUERY_FLAG (tmp, FLAG_ALIVE)) |
942 | { |
948 | { |
943 | tmp->stats.hp = spell_ob->duration + SP_level_duration_adjust (caster, spell_ob); |
949 | tmp->stats.hp = spell_ob->duration + SP_level_duration_adjust (caster, spell_ob); |
944 | tmp->stats.maxhp = tmp->stats.hp; |
950 | tmp->stats.maxhp = tmp->stats.hp; |
945 | set_owner (tmp, op); |
951 | tmp->set_owner (op); |
946 | set_spell_skill (op, caster, spell_ob, tmp); |
952 | set_spell_skill (op, caster, spell_ob, tmp); |
947 | } |
953 | } |
948 | if (QUERY_FLAG (spell_ob, FLAG_IS_USED_UP) || QUERY_FLAG (tmp, FLAG_IS_USED_UP)) |
954 | if (QUERY_FLAG (spell_ob, FLAG_IS_USED_UP) || QUERY_FLAG (tmp, FLAG_IS_USED_UP)) |
949 | { |
955 | { |
950 | tmp->stats.food = spell_ob->duration + SP_level_duration_adjust (caster, spell_ob); |
956 | tmp->stats.food = spell_ob->duration + SP_level_duration_adjust (caster, spell_ob); |
… | |
… | |
959 | } |
965 | } |
960 | |
966 | |
961 | /* This can't really hurt - if the object doesn't kill anything, |
967 | /* This can't really hurt - if the object doesn't kill anything, |
962 | * these fields just won't be used. |
968 | * these fields just won't be used. |
963 | */ |
969 | */ |
964 | set_owner (tmp, op); |
970 | tmp->set_owner (op); |
965 | set_spell_skill (op, caster, spell_ob, tmp); |
971 | set_spell_skill (op, caster, spell_ob, tmp); |
966 | tmp->x = x; |
972 | tmp->x = x; |
967 | tmp->y = y; |
973 | tmp->y = y; |
968 | tmp->level = caster_level (caster, spell_ob) / 2; |
974 | tmp->level = caster_level (caster, spell_ob) / 2; |
969 | |
975 | |
… | |
… | |
998 | m = tmp->map; |
1004 | m = tmp->map; |
999 | |
1005 | |
1000 | if (!(get_map_flags (m, &m, x, y, &x, &y) & (P_OUT_OF_MAP | P_IS_ALIVE)) && |
1006 | if (!(get_map_flags (m, &m, x, y, &x, &y) & (P_OUT_OF_MAP | P_IS_ALIVE)) && |
1001 | ((spell_ob->move_block & GET_MAP_MOVE_BLOCK (m, x, y)) != spell_ob->move_block) && !posblocked) |
1007 | ((spell_ob->move_block & GET_MAP_MOVE_BLOCK (m, x, y)) != spell_ob->move_block) && !posblocked) |
1002 | { |
1008 | { |
1003 | tmp2 = object::create (); |
1009 | tmp2 = tmp->clone (); |
1004 | tmp->copy_to (tmp2); |
|
|
1005 | tmp2->x = x; |
1010 | tmp2->x = x; |
1006 | tmp2->y = y; |
1011 | tmp2->y = y; |
1007 | insert_ob_in_map (tmp2, m, op, 0); |
1012 | insert_ob_in_map (tmp2, m, op, 0); |
1008 | /* If this is a spellcasting wall, need to insert the spell object */ |
1013 | /* If this is a spellcasting wall, need to insert the spell object */ |
1009 | if (tmp2->other_arch && tmp2->other_arch->clone.type == SPELL) |
1014 | if (tmp2->other_arch && tmp2->other_arch->clone.type == SPELL) |
… | |
… | |
1018 | m = tmp->map; |
1023 | m = tmp->map; |
1019 | |
1024 | |
1020 | if (!(get_map_flags (m, &m, x, y, &x, &y) & (P_OUT_OF_MAP | P_IS_ALIVE)) && |
1025 | if (!(get_map_flags (m, &m, x, y, &x, &y) & (P_OUT_OF_MAP | P_IS_ALIVE)) && |
1021 | ((spell_ob->move_block & GET_MAP_MOVE_BLOCK (m, x, y)) != spell_ob->move_block) && !negblocked) |
1026 | ((spell_ob->move_block & GET_MAP_MOVE_BLOCK (m, x, y)) != spell_ob->move_block) && !negblocked) |
1022 | { |
1027 | { |
1023 | tmp2 = object::create (); |
1028 | tmp2 = tmp->clone (); |
1024 | tmp->copy_to (tmp2); |
|
|
1025 | tmp2->x = x; |
1029 | tmp2->x = x; |
1026 | tmp2->y = y; |
1030 | tmp2->y = y; |
1027 | insert_ob_in_map (tmp2, m, op, 0); |
1031 | insert_ob_in_map (tmp2, m, op, 0); |
1028 | if (tmp2->other_arch && tmp2->other_arch->clone.type == SPELL) |
1032 | if (tmp2->other_arch && tmp2->other_arch->clone.type == SPELL) |
1029 | insert_ob_in_ob (arch_to_object (tmp2->other_arch), tmp2); |
1033 | insert_ob_in_ob (arch_to_object (tmp2->other_arch), tmp2); |
… | |
… | |
1634 | if (x == op->x && y == op->y && op->map == m) |
1638 | if (x == op->x && y == op->y && op->map == m) |
1635 | flag = INS_BELOW_ORIGINATOR; |
1639 | flag = INS_BELOW_ORIGINATOR; |
1636 | |
1640 | |
1637 | if (small_nuggets) |
1641 | if (small_nuggets) |
1638 | { |
1642 | { |
1639 | tmp = object::create (); |
1643 | tmp = small->clone (); |
1640 | small->copy_to (tmp); |
|
|
1641 | tmp->nrof = small_nuggets; |
1644 | tmp->nrof = small_nuggets; |
1642 | tmp->x = x; |
1645 | tmp->x = x; |
1643 | tmp->y = y; |
1646 | tmp->y = y; |
1644 | insert_ob_in_map (tmp, m, op, flag); |
1647 | insert_ob_in_map (tmp, m, op, flag); |
1645 | } |
1648 | } |
|
|
1649 | |
1646 | if (large_nuggets) |
1650 | if (large_nuggets) |
1647 | { |
1651 | { |
1648 | tmp = object::create (); |
1652 | tmp = large->clone (); |
1649 | large->copy_to (tmp); |
|
|
1650 | tmp->nrof = large_nuggets; |
1653 | tmp->nrof = large_nuggets; |
1651 | tmp->x = x; |
1654 | tmp->x = x; |
1652 | tmp->y = y; |
1655 | tmp->y = y; |
1653 | insert_ob_in_map (tmp, m, op, flag); |
1656 | insert_ob_in_map (tmp, m, op, flag); |
1654 | } |
1657 | } |
… | |
… | |
1739 | large->destroy (); |
1742 | large->destroy (); |
1740 | small->destroy (); |
1743 | small->destroy (); |
1741 | /* reset this so that if player standing on a big pile of stuff, |
1744 | /* reset this so that if player standing on a big pile of stuff, |
1742 | * it is redrawn properly. |
1745 | * it is redrawn properly. |
1743 | */ |
1746 | */ |
1744 | op->contr->socket.look_position = 0; |
1747 | op->contr->socket->look_position = 0; |
1745 | return 1; |
1748 | return 1; |
1746 | } |
1749 | } |
1747 | |
1750 | |
1748 | |
1751 | |
1749 | /* This function removes the cursed/damned status on equipped |
1752 | /* This function removes the cursed/damned status on equipped |
… | |
… | |
1758 | for (tmp = op->inv; tmp; tmp = tmp->below) |
1761 | for (tmp = op->inv; tmp; tmp = tmp->below) |
1759 | if (QUERY_FLAG (tmp, FLAG_APPLIED) && |
1762 | if (QUERY_FLAG (tmp, FLAG_APPLIED) && |
1760 | ((QUERY_FLAG (tmp, FLAG_CURSED) && QUERY_FLAG (spell, FLAG_CURSED)) || |
1763 | ((QUERY_FLAG (tmp, FLAG_CURSED) && QUERY_FLAG (spell, FLAG_CURSED)) || |
1761 | (QUERY_FLAG (tmp, FLAG_DAMNED) && QUERY_FLAG (spell, FLAG_DAMNED)))) |
1764 | (QUERY_FLAG (tmp, FLAG_DAMNED) && QUERY_FLAG (spell, FLAG_DAMNED)))) |
1762 | { |
1765 | { |
1763 | |
|
|
1764 | was_one++; |
1766 | was_one++; |
1765 | if (tmp->level <= caster_level (caster, spell)) |
1767 | if (tmp->level <= caster_level (caster, spell)) |
1766 | { |
1768 | { |
1767 | success++; |
1769 | success++; |
1768 | if (QUERY_FLAG (spell, FLAG_DAMNED)) |
1770 | if (QUERY_FLAG (spell, FLAG_DAMNED)) |
… | |
… | |
1788 | new_draw_info (NDI_UNIQUE, 0, op, "You failed to remove the curse."); |
1790 | new_draw_info (NDI_UNIQUE, 0, op, "You failed to remove the curse."); |
1789 | else |
1791 | else |
1790 | new_draw_info (NDI_UNIQUE, 0, op, "You are not using any cursed items."); |
1792 | new_draw_info (NDI_UNIQUE, 0, op, "You are not using any cursed items."); |
1791 | } |
1793 | } |
1792 | } |
1794 | } |
|
|
1795 | |
1793 | return success; |
1796 | return success; |
1794 | } |
1797 | } |
1795 | |
1798 | |
1796 | /* Identifies objects in the players inventory/on the ground */ |
1799 | /* Identifies objects in the players inventory/on the ground */ |
1797 | |
1800 | |
… | |
… | |
1804 | num_ident = spell->stats.dam + SP_level_dam_adjust (caster, spell); |
1807 | num_ident = spell->stats.dam + SP_level_dam_adjust (caster, spell); |
1805 | |
1808 | |
1806 | if (num_ident < 1) |
1809 | if (num_ident < 1) |
1807 | num_ident = 1; |
1810 | num_ident = 1; |
1808 | |
1811 | |
1809 | |
|
|
1810 | for (tmp = op->inv; tmp; tmp = tmp->below) |
1812 | for (tmp = op->inv; tmp; tmp = tmp->below) |
1811 | { |
1813 | { |
1812 | if (!QUERY_FLAG (tmp, FLAG_IDENTIFIED) && !tmp->invisible && need_identify (tmp)) |
1814 | if (!QUERY_FLAG (tmp, FLAG_IDENTIFIED) && !tmp->invisible && need_identify (tmp)) |
1813 | { |
1815 | { |
1814 | identify (tmp); |
1816 | identify (tmp); |
|
|
1817 | |
1815 | if (op->type == PLAYER) |
1818 | if (op->type == PLAYER) |
1816 | { |
1819 | { |
1817 | new_draw_info_format (NDI_UNIQUE, 0, op, "You have %s.", long_desc (tmp, op)); |
1820 | new_draw_info_format (NDI_UNIQUE, 0, op, "You have %s.", long_desc (tmp, op)); |
|
|
1821 | |
1818 | if (tmp->msg) |
1822 | if (tmp->msg) |
1819 | { |
1823 | { |
1820 | new_draw_info (NDI_UNIQUE, 0, op, "The item has a story:"); |
1824 | new_draw_info (NDI_UNIQUE, 0, op, "The item has a story:"); |
1821 | new_draw_info (NDI_UNIQUE, 0, op, tmp->msg); |
1825 | new_draw_info (NDI_UNIQUE, 0, op, tmp->msg); |
1822 | } |
1826 | } |
1823 | } |
1827 | } |
|
|
1828 | |
1824 | num_ident--; |
1829 | num_ident--; |
1825 | success = 1; |
1830 | success = 1; |
1826 | if (!num_ident) |
1831 | if (!num_ident) |
1827 | break; |
1832 | break; |
1828 | } |
1833 | } |
1829 | } |
1834 | } |
|
|
1835 | |
1830 | /* If all the power of the spell has been used up, don't go and identify |
1836 | /* If all the power of the spell has been used up, don't go and identify |
1831 | * stuff on the floor. Only identify stuff on the floor if the spell |
1837 | * stuff on the floor. Only identify stuff on the floor if the spell |
1832 | * was not fully used. |
1838 | * was not fully used. |
1833 | */ |
1839 | */ |
1834 | if (num_ident) |
1840 | if (num_ident) |
1835 | { |
1841 | { |
1836 | for (tmp = get_map_ob (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) |
1842 | for (tmp = get_map_ob (op->map, op->x, op->y); tmp != NULL; tmp = tmp->above) |
1837 | if (!QUERY_FLAG (tmp, FLAG_IDENTIFIED) && !tmp->invisible && need_identify (tmp)) |
1843 | if (!QUERY_FLAG (tmp, FLAG_IDENTIFIED) && !tmp->invisible && need_identify (tmp)) |
1838 | { |
1844 | { |
1839 | |
|
|
1840 | identify (tmp); |
1845 | identify (tmp); |
|
|
1846 | |
1841 | if (op->type == PLAYER) |
1847 | if (op->type == PLAYER) |
1842 | { |
1848 | { |
1843 | new_draw_info_format (NDI_UNIQUE, 0, op, "On the ground is %s.", long_desc (tmp, op)); |
1849 | new_draw_info_format (NDI_UNIQUE, 0, op, "On the ground is %s.", long_desc (tmp, op)); |
|
|
1850 | |
1844 | if (tmp->msg) |
1851 | if (tmp->msg) |
1845 | { |
1852 | { |
1846 | new_draw_info (NDI_UNIQUE, 0, op, "The item has a story:"); |
1853 | new_draw_info (NDI_UNIQUE, 0, op, "The item has a story:"); |
1847 | new_draw_info (NDI_UNIQUE, 0, op, tmp->msg); |
1854 | new_draw_info (NDI_UNIQUE, 0, op, tmp->msg); |
1848 | } |
1855 | } |
|
|
1856 | |
1849 | esrv_send_item (op, tmp); |
1857 | esrv_send_item (op, tmp); |
1850 | } |
1858 | } |
|
|
1859 | |
1851 | num_ident--; |
1860 | num_ident--; |
1852 | success = 1; |
1861 | success = 1; |
1853 | if (!num_ident) |
1862 | if (!num_ident) |
1854 | break; |
1863 | break; |
1855 | } |
1864 | } |
1856 | } |
1865 | } |
|
|
1866 | |
1857 | if (!success) |
1867 | if (!success) |
1858 | new_draw_info (NDI_UNIQUE, 0, op, "You can't reach anything unidentified."); |
1868 | new_draw_info (NDI_UNIQUE, 0, op, "You can't reach anything unidentified."); |
1859 | else |
1869 | else |
1860 | { |
|
|
1861 | spell_effect (spell, op->x, op->y, op->map, op); |
1870 | spell_effect (spell, op->x, op->y, op->map, op); |
1862 | } |
1871 | |
1863 | return success; |
1872 | return success; |
1864 | } |
1873 | } |
1865 | |
|
|
1866 | |
1874 | |
1867 | int |
1875 | int |
1868 | cast_detection (object *op, object *caster, object *spell, object *skill) |
1876 | cast_detection (object *op, object *caster, object *spell, object *skill) |
1869 | { |
1877 | { |
1870 | object *tmp, *last, *god, *detect; |
1878 | object *tmp, *last, *god, *detect; |
… | |
… | |
1883 | skill = caster; |
1891 | skill = caster; |
1884 | |
1892 | |
1885 | for (x = op->x - range; x <= op->x + range; x++) |
1893 | for (x = op->x - range; x <= op->x + range; x++) |
1886 | for (y = op->y - range; y <= op->y + range; y++) |
1894 | for (y = op->y - range; y <= op->y + range; y++) |
1887 | { |
1895 | { |
1888 | |
|
|
1889 | m = op->map; |
1896 | m = op->map; |
1890 | mflags = get_map_flags (m, &m, x, y, &nx, &ny); |
1897 | mflags = get_map_flags (m, &m, x, y, &nx, &ny); |
1891 | if (mflags & P_OUT_OF_MAP) |
1898 | if (mflags & P_OUT_OF_MAP) |
1892 | continue; |
1899 | continue; |
1893 | |
1900 | |
… | |
… | |
1897 | * down - that is easier than working up. |
1904 | * down - that is easier than working up. |
1898 | */ |
1905 | */ |
1899 | |
1906 | |
1900 | for (last = NULL, tmp = get_map_ob (m, nx, ny); tmp; tmp = tmp->above) |
1907 | for (last = NULL, tmp = get_map_ob (m, nx, ny); tmp; tmp = tmp->above) |
1901 | last = tmp; |
1908 | last = tmp; |
|
|
1909 | |
1902 | /* Shouldn't happen, but if there are no objects on a space, this |
1910 | /* Shouldn't happen, but if there are no objects on a space, this |
1903 | * would happen. |
1911 | * would happen. |
1904 | */ |
1912 | */ |
1905 | if (!last) |
1913 | if (!last) |
1906 | continue; |
1914 | continue; |
… | |
… | |
1908 | done_one = 0; |
1916 | done_one = 0; |
1909 | floor = 0; |
1917 | floor = 0; |
1910 | detect = NULL; |
1918 | detect = NULL; |
1911 | for (tmp = last; tmp; tmp = tmp->below) |
1919 | for (tmp = last; tmp; tmp = tmp->below) |
1912 | { |
1920 | { |
1913 | |
|
|
1914 | /* show invisible */ |
1921 | /* show invisible */ |
1915 | if (QUERY_FLAG (spell, FLAG_MAKE_INVIS) && |
1922 | if (QUERY_FLAG (spell, FLAG_MAKE_INVIS) && |
1916 | /* Might there be other objects that we can make visibile? */ |
1923 | /* Might there be other objects that we can make visible? */ |
1917 | (tmp->invisible && (QUERY_FLAG (tmp, FLAG_MONSTER) || |
1924 | (tmp->invisible && (QUERY_FLAG (tmp, FLAG_MONSTER) || |
1918 | (tmp->type == PLAYER && !QUERY_FLAG (tmp, FLAG_WIZ)) || |
1925 | (tmp->type == PLAYER && !QUERY_FLAG (tmp, FLAG_WIZ)) || |
1919 | tmp->type == CF_HANDLE || |
1926 | tmp->type == CF_HANDLE || |
1920 | tmp->type == TRAPDOOR || tmp->type == EXIT || tmp->type == HOLE || |
1927 | tmp->type == TRAPDOOR || tmp->type == EXIT || tmp->type == HOLE || |
1921 | tmp->type == BUTTON || tmp->type == TELEPORTER || |
1928 | tmp->type == BUTTON || tmp->type == TELEPORTER || |
… | |
… | |
1928 | { |
1935 | { |
1929 | tmp->invisible = 0; |
1936 | tmp->invisible = 0; |
1930 | done_one = 1; |
1937 | done_one = 1; |
1931 | } |
1938 | } |
1932 | } |
1939 | } |
|
|
1940 | |
1933 | if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) |
1941 | if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) |
1934 | floor = 1; |
1942 | floor = 1; |
1935 | |
1943 | |
1936 | /* All detections below this point don't descend beneath the floor, |
1944 | /* All detections below this point don't descend beneath the floor, |
1937 | * so just continue on. We could be clever and look at the type of |
1945 | * so just continue on. We could be clever and look at the type of |
… | |
… | |
2371 | CLEAR_FLAG (tmp, FLAG_MONSTER); |
2379 | CLEAR_FLAG (tmp, FLAG_MONSTER); |
2372 | SET_FLAG (tmp, FLAG_FRIENDLY); |
2380 | SET_FLAG (tmp, FLAG_FRIENDLY); |
2373 | tmp->stats.exp = 0; |
2381 | tmp->stats.exp = 0; |
2374 | add_friendly_object (tmp); |
2382 | add_friendly_object (tmp); |
2375 | tmp->type = GOLEM; |
2383 | tmp->type = GOLEM; |
2376 | set_owner (tmp, op); |
2384 | tmp->set_owner (op); |
2377 | set_spell_skill (op, caster, spell, tmp); |
2385 | set_spell_skill (op, caster, spell, tmp); |
2378 | op->contr->ranges[range_golem] = tmp; |
2386 | op->contr->ranges[range_golem] = tmp; |
2379 | op->contr->shoottype = range_golem; |
2387 | op->contr->shoottype = range_golem; |
2380 | |
2388 | |
2381 | /* Give the weapon to the golem now. A bit of a hack to check the |
2389 | /* Give the weapon to the golem now. A bit of a hack to check the |
… | |
… | |
2538 | |
2546 | |
2539 | new_aura->duration = spell->duration + 10 * SP_level_duration_adjust (caster, spell); |
2547 | new_aura->duration = spell->duration + 10 * SP_level_duration_adjust (caster, spell); |
2540 | |
2548 | |
2541 | new_aura->stats.dam = spell->stats.dam + SP_level_dam_adjust (caster, spell); |
2549 | new_aura->stats.dam = spell->stats.dam + SP_level_dam_adjust (caster, spell); |
2542 | |
2550 | |
2543 | set_owner (new_aura, op); |
2551 | new_aura->set_owner (op); |
2544 | set_spell_skill (op, caster, spell, new_aura); |
2552 | set_spell_skill (op, caster, spell, new_aura); |
2545 | new_aura->attacktype = spell->attacktype; |
2553 | new_aura->attacktype = spell->attacktype; |
2546 | |
2554 | |
2547 | new_aura->level = caster_level (caster, spell); |
2555 | new_aura->level = caster_level (caster, spell); |
2548 | if (refresh) |
2556 | if (refresh) |
… | |
… | |
2660 | |
2668 | |
2661 | if (rndm (0, atk_lev - 1) > def_lev) |
2669 | if (rndm (0, atk_lev - 1) > def_lev) |
2662 | { |
2670 | { |
2663 | /* make this sucker peaceful. */ |
2671 | /* make this sucker peaceful. */ |
2664 | |
2672 | |
2665 | change_exp (get_owner (op), victim->stats.exp, op->skill, 0); |
2673 | change_exp (op->owner, victim->stats.exp, op->skill, 0); |
2666 | victim->stats.exp = 0; |
2674 | victim->stats.exp = 0; |
2667 | #if 0 |
2675 | #if 0 |
2668 | /* No idea why these were all set to zero - if something |
2676 | /* No idea why these were all set to zero - if something |
2669 | * makes this creature agressive, he should still do damage. |
2677 | * makes this creature agressive, he should still do damage. |
2670 | */ |
2678 | */ |