… | |
… | |
1758 | archetype *at = archetype::find (shstr_poisoning); |
1758 | archetype *at = archetype::find (shstr_poisoning); |
1759 | object *tmp = present_arch_in_ob (at, op); |
1759 | object *tmp = present_arch_in_ob (at, op); |
1760 | |
1760 | |
1761 | if (tmp == NULL) |
1761 | if (tmp == NULL) |
1762 | { |
1762 | { |
1763 | if ((tmp = at->instance ()) == NULL) |
1763 | tmp = insert_ob_in_ob (at->instance (), op); |
1764 | LOG (llevError, "Failed to clone arch poisoning.\n"); |
1764 | /* peterm: give poisoning some teeth. It should |
|
|
1765 | * be able to kill things better than it does: |
|
|
1766 | * damage should be dependent something--I choose to |
|
|
1767 | * do this: if it's a monster, the damage from the |
|
|
1768 | * poisoning goes as the level of the monster/2. |
|
|
1769 | * If anything else, goes as damage. |
|
|
1770 | */ |
|
|
1771 | |
|
|
1772 | if (QUERY_FLAG (hitter, FLAG_ALIVE)) |
|
|
1773 | tmp->stats.dam += hitter->level / 2; |
1765 | else |
1774 | else |
1766 | { |
|
|
1767 | tmp = insert_ob_in_ob (tmp, op); |
|
|
1768 | /* peterm: give poisoning some teeth. It should |
|
|
1769 | * be able to kill things better than it does: |
|
|
1770 | * damage should be dependent something--I choose to |
|
|
1771 | * do this: if it's a monster, the damage from the |
|
|
1772 | * poisoning goes as the level of the monster/2. |
|
|
1773 | * If anything else, goes as damage. |
|
|
1774 | */ |
|
|
1775 | |
|
|
1776 | if (QUERY_FLAG (hitter, FLAG_ALIVE)) |
|
|
1777 | tmp->stats.dam += hitter->level / 2; |
|
|
1778 | else |
|
|
1779 | tmp->stats.dam = dam; |
1775 | tmp->stats.dam = dam; |
1780 | |
1776 | |
1781 | tmp->set_owner (hitter); /* so we get credit for poisoning kills */ |
1777 | tmp->set_owner (hitter); /* so we get credit for poisoning kills */ |
1782 | if (hitter->skill && hitter->skill != tmp->skill) |
1778 | if (hitter->skill && hitter->skill != tmp->skill) |
1783 | { |
|
|
1784 | tmp->skill = hitter->skill; |
1779 | tmp->skill = hitter->skill; |
1785 | } |
|
|
1786 | |
1780 | |
1787 | tmp->stats.food += dam; /* more damage, longer poisoning */ |
1781 | tmp->stats.food += dam; /* more damage, longer poisoning */ |
1788 | |
1782 | |
1789 | if (op->type == PLAYER) |
1783 | if (op->type == PLAYER) |
1790 | { |
1784 | { |
1791 | /* player looses stats, maximum is -10 of each */ |
1785 | /* player looses stats, maximum is -10 of each */ |
1792 | tmp->stats.Con = max (-(dam / 4 + 1), -10); |
1786 | tmp->stats.Con = max (-(dam / 4 + 1), -10); |
1793 | tmp->stats.Str = max (-(dam / 3 + 2), -10); |
1787 | tmp->stats.Str = max (-(dam / 3 + 2), -10); |
1794 | tmp->stats.Dex = max (-(dam / 6 + 1), -10); |
1788 | tmp->stats.Dex = max (-(dam / 6 + 1), -10); |
1795 | tmp->stats.Int = max (-(dam / 7 ), -10); |
1789 | tmp->stats.Int = max (-(dam / 7 ), -10); |
1796 | SET_FLAG (tmp, FLAG_APPLIED); |
1790 | SET_FLAG (tmp, FLAG_APPLIED); |
1797 | op->update_stats (); |
1791 | op->update_stats (); |
1798 | new_draw_info (NDI_UNIQUE, 0, op, "You suddenly feel very ill."); |
1792 | new_draw_info (NDI_UNIQUE, 0, op, "You suddenly feel very ill."); |
1799 | op->play_sound (tmp->sound); |
1793 | op->play_sound (tmp->sound); |
1800 | } |
1794 | } |
1801 | |
1795 | |
1802 | if (hitter->type == PLAYER) |
1796 | if (hitter->type == PLAYER) |
1803 | new_draw_info_format (NDI_UNIQUE, 0, hitter, "You poison %s.", &op->name); |
1797 | new_draw_info_format (NDI_UNIQUE, 0, hitter, "You poison %s.", &op->name); |
1804 | else if (hitter->owner != NULL && hitter->owner->type == PLAYER) |
1798 | else if (hitter->owner != NULL && hitter->owner->type == PLAYER) |
1805 | new_draw_info_format (NDI_UNIQUE, 0, hitter->owner, "Your %s poisons %s.", &hitter->name, &op->name); |
1799 | new_draw_info_format (NDI_UNIQUE, 0, hitter->owner, "Your %s poisons %s.", &hitter->name, &op->name); |
1806 | } |
|
|
1807 | |
1800 | |
1808 | tmp->speed_left = 0; |
1801 | tmp->speed_left = 0; |
1809 | } |
1802 | } |
1810 | else |
1803 | else |
1811 | tmp->stats.food++; |
1804 | tmp->stats.food++; |