… | |
… | |
318 | return 0; |
318 | return 0; |
319 | |
319 | |
320 | /* no xp for stealing from pets (of players) */ |
320 | /* no xp for stealing from pets (of players) */ |
321 | if (QUERY_FLAG (tmp, FLAG_FRIENDLY) && tmp->attack_movement == PETMOVE) |
321 | if (QUERY_FLAG (tmp, FLAG_FRIENDLY) && tmp->attack_movement == PETMOVE) |
322 | { |
322 | { |
323 | object *owner = get_owner (tmp); |
323 | object *owner = tmp->owner; |
324 | |
324 | |
325 | if (owner != NULL && owner->type == PLAYER) |
325 | if (owner != NULL && owner->type == PLAYER) |
326 | return 0; |
326 | return 0; |
327 | } |
327 | } |
328 | |
328 | |
… | |
… | |
877 | } |
877 | } |
878 | |
878 | |
879 | /* it's already allied! */ |
879 | /* it's already allied! */ |
880 | if (QUERY_FLAG (tmp, FLAG_FRIENDLY) && (tmp->attack_movement == PETMOVE)) |
880 | if (QUERY_FLAG (tmp, FLAG_FRIENDLY) && (tmp->attack_movement == PETMOVE)) |
881 | { |
881 | { |
882 | if (get_owner (tmp) == pl) |
882 | if (tmp->owner == pl) |
883 | { |
883 | { |
884 | new_draw_info (NDI_UNIQUE, 0, pl, "Your follower loves your speech.\n"); |
884 | new_draw_info (NDI_UNIQUE, 0, pl, "Your follower loves your speech.\n"); |
885 | return 0; |
885 | return 0; |
886 | } |
886 | } |
887 | else if (skill->level > tmp->level) |
887 | else if (skill->level > tmp->level) |
888 | { |
888 | { |
889 | /* you steal the follower. Perhaps we should really look at the |
889 | /* you steal the follower. Perhaps we should really look at the |
890 | * level of the owner above? |
890 | * level of the owner above? |
891 | */ |
891 | */ |
892 | set_owner (tmp, pl); |
892 | tmp->set_owner (pl); |
893 | new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to follow you instead!\n", query_name (tmp)); |
893 | new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to follow you instead!\n", query_name (tmp)); |
894 | /* Abuse fix - don't give exp since this can otherwise |
894 | /* Abuse fix - don't give exp since this can otherwise |
895 | * be used by a couple players to gets lots of exp. |
895 | * be used by a couple players to gets lots of exp. |
896 | */ |
896 | */ |
897 | return 0; |
897 | return 0; |
… | |
… | |
908 | /* Ok, got a 'sucker' lets try to make them a follower */ |
908 | /* Ok, got a 'sucker' lets try to make them a follower */ |
909 | if (chance > 0 && tmp->level < (random_roll (0, chance - 1, pl, PREFER_HIGH) - 1)) |
909 | if (chance > 0 && tmp->level < (random_roll (0, chance - 1, pl, PREFER_HIGH) - 1)) |
910 | { |
910 | { |
911 | new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to become your follower.\n", query_name (tmp)); |
911 | new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to become your follower.\n", query_name (tmp)); |
912 | |
912 | |
913 | set_owner (tmp, pl); |
913 | tmp->set_owner (pl); |
914 | tmp->stats.exp = 0; |
914 | tmp->stats.exp = 0; |
915 | add_friendly_object (tmp); |
915 | add_friendly_object (tmp); |
916 | SET_FLAG (tmp, FLAG_FRIENDLY); |
916 | SET_FLAG (tmp, FLAG_FRIENDLY); |
917 | tmp->attack_movement = PETMOVE; |
917 | tmp->attack_movement = PETMOVE; |
918 | return calc_skill_exp (pl, tmp, skill); |
918 | return calc_skill_exp (pl, tmp, skill); |
… | |
… | |
1754 | { |
1754 | { |
1755 | insert_ob_in_ob (throw_ob, op); |
1755 | insert_ob_in_ob (throw_ob, op); |
1756 | return 0; |
1756 | return 0; |
1757 | } |
1757 | } |
1758 | |
1758 | |
1759 | set_owner (throw_ob, op); |
1759 | throw_ob->set_owner (op); |
1760 | /* At some point in the attack code, the actual real object (op->inv) |
1760 | /* At some point in the attack code, the actual real object (op->inv) |
1761 | * becomes the hitter. As such, we need to make sure that has a proper |
1761 | * becomes the hitter. As such, we need to make sure that has a proper |
1762 | * owner value so exp goes to the right place. |
1762 | * owner value so exp goes to the right place. |
1763 | */ |
1763 | */ |
1764 | set_owner (throw_ob->inv, op); |
1764 | throw_ob->inv->set_owner (op); |
1765 | throw_ob->direction = dir; |
1765 | throw_ob->direction = dir; |
1766 | throw_ob->x = part->x; |
1766 | throw_ob->x = part->x; |
1767 | throw_ob->y = part->y; |
1767 | throw_ob->y = part->y; |
1768 | |
1768 | |
1769 | /* the damage bonus from the force of the throw */ |
1769 | /* the damage bonus from the force of the throw */ |