ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/skills.C
(Generate patch)

Comparing deliantra/server/server/skills.C (file contents):
Revision 1.27 by root, Tue Apr 24 12:32:16 2007 UTC vs.
Revision 1.35 by root, Sat May 19 00:31:08 2007 UTC

1/* 1/*
2 * CrossFire, A Multiplayer game for X-windows 2 * CrossFire, A Multiplayer game
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team 4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
5 * Copyright (C) 2003 Mark Wedel & Crossfire Development Team 5 * Copyright (C) 2003 Mark Wedel & Crossfire Development Team
6 * Copyright (C) 1992 Frank Tore Johansen 6 * Copyright (C) 1992 Frank Tore Johansen
7 * 7 *
40 return -1; 40 return -1;
41 41
42 /* Only prohibit stealing if the player does not have a free 42 /* Only prohibit stealing if the player does not have a free
43 * hand available and in fact does have hands. 43 * hand available and in fact does have hands.
44 */ 44 */
45 if (op->type == PLAYER && op->body_used[BODY_ARMS] <= 0 && op->body_info[BODY_ARMS]) 45 if (op->type == PLAYER && op->slot[body_arm].used <= 0 && op->slot[body_arm].info)
46 { 46 {
47 new_draw_info (NDI_UNIQUE, 0, op, "But you have no free hands to steal with!"); 47 new_draw_info (NDI_UNIQUE, 0, op, "But you have no free hands to steal with!");
48 return -1; 48 return -1;
49 } 49 }
50 50
93 * or not. 93 * or not.
94 * op is the target (person being pilfered) 94 * op is the target (person being pilfered)
95 * who is the person doing the stealing. 95 * who is the person doing the stealing.
96 * skill is the skill object (stealing). 96 * skill is the skill object (stealing).
97 */ 97 */
98
99static int 98static int
100attempt_steal (object *op, object *who, object *skill) 99attempt_steal (object *op, object *who, object *skill)
101{ 100{
102 object *success = NULL, *tmp = NULL, *next; 101 object *success = NULL, *tmp = NULL, *next;
103 int roll = 0, chance = 0, stats_value; 102 int roll = 0, chance = 0, stats_value;
121 else /* help npc to detect thief next time by raising its wisdom */ 120 else /* help npc to detect thief next time by raising its wisdom */
122 op->stats.Wis += (op->stats.Int / 5) + 1; 121 op->stats.Wis += (op->stats.Int / 5) + 1;
123 if (op->stats.Wis > MAX_STAT) 122 if (op->stats.Wis > MAX_STAT)
124 op->stats.Wis = MAX_STAT; 123 op->stats.Wis = MAX_STAT;
125 } 124 }
125
126 if (op->type == PLAYER && QUERY_FLAG (op, FLAG_WIZ)) 126 if (op->type == PLAYER && QUERY_FLAG (op, FLAG_WIZ))
127 { 127 {
128 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from the dungeon master!\n"); 128 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from the dungeon master!\n");
129 return 0; 129 return 0;
130 } 130 }
131#ifdef PROHIBIT_PLAYERKILL 131
132 // only allow stealing between hostile players (TODO: probably should change)
132 if (op->type == PLAYER && who->type == PLAYER && (who->contr->peaceful || op->contr->peaceful)) 133 if (op->type == PLAYER && who->type == PLAYER && (who->contr->peaceful || op->contr->peaceful))
133 { 134 {
134 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from other players!\n"); 135 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from other players!\n");
135 return 0; 136 return 0;
136 } 137 }
137#else
138 if (op->type == PLAYER && who->type == PLAYER && settings.no_player_stealing)
139 {
140 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from other players!\n");
141 return 0;
142 }
143#endif
144
145 138
146 /* Ok then, go thru their inventory, stealing */ 139 /* Ok then, go thru their inventory, stealing */
147 for (tmp = op->inv; tmp != NULL; tmp = next) 140 for (tmp = op->inv; tmp; tmp = next)
148 { 141 {
149 next = tmp->below; 142 next = tmp->below;
150 143
151 /* you can't steal worn items, starting items, wiz stuff, 144 /* you can't steal worn items, starting items, wiz stuff,
152 * innate abilities, or items w/o a type. Generally 145 * innate abilities, or items w/o a type. Generally
156 * future possible problems. -b.t. 149 * future possible problems. -b.t.
157 * Flesh items generated w/ fix_flesh_item should have FLAG_NO_STEAL 150 * Flesh items generated w/ fix_flesh_item should have FLAG_NO_STEAL
158 * already -b.t. 151 * already -b.t.
159 */ 152 */
160 153
161 if (QUERY_FLAG (tmp, FLAG_WAS_WIZ) || QUERY_FLAG (tmp, FLAG_APPLIED) 154 if (QUERY_FLAG (tmp, FLAG_APPLIED)
162 || !(tmp->type) 155 || !tmp->type
163 || tmp->type == SPELL 156 || tmp->type == SPELL
164 || QUERY_FLAG (tmp, FLAG_STARTEQUIP) || QUERY_FLAG (tmp, FLAG_NO_STEAL) || tmp->invisible) 157 || QUERY_FLAG (tmp, FLAG_STARTEQUIP)
158 || QUERY_FLAG (tmp, FLAG_NO_STEAL)
159 || tmp->invisible)
165 continue; 160 continue;
166 161
167 /* Okay, try stealing this item. Dependent on dexterity of thief, 162 /* Okay, try stealing this item. Dependent on dexterity of thief,
168 * skill level, see the adj_stealroll fctn for more detail. 163 * skill level, see the adj_stealroll fctn for more detail.
169 */ 164 */
260 /* play_sound("stop! thief!"); kindofthing */ 255 /* play_sound("stop! thief!"); kindofthing */
261 } /* if you weren't 100% successful */ 256 } /* if you weren't 100% successful */
262 return success ? 1 : 0; 257 return success ? 1 : 0;
263} 258}
264 259
265
266int 260int
267steal (object *op, int dir, object *skill) 261steal (object *op, int dir, object *skill)
268{ 262{
269 object *tmp, *next; 263 object *tmp, *next;
270 sint16 x, y; 264 sint16 x, y;
414 { 408 {
415 new_draw_info (NDI_UNIQUE, 0, pl, "You fail to pick the lock."); 409 new_draw_info (NDI_UNIQUE, 0, pl, "You fail to pick the lock.");
416 return 0; 410 return 0;
417 } 411 }
418} 412}
419
420 413
421/* HIDE CODE. The user becomes undetectable (not just 'invisible') for 414/* HIDE CODE. The user becomes undetectable (not just 'invisible') for
422 * a short while (success and duration dependant on player SK_level, 415 * a short while (success and duration dependant on player SK_level,
423 * dexterity, charisma, and map difficulty). 416 * dexterity, charisma, and map difficulty).
424 * Players have a good chance of becoming 'unhidden' if they move 417 * Players have a good chance of becoming 'unhidden' if they move
425 * and like invisiblity will be come visible if they attack 418 * and like invisiblity will be come visible if they attack
426 * Implemented by b.t. (thomas@astro.psu.edu) 419 * Implemented by b.t. (thomas@astro.psu.edu)
427 * July 7, 1995 - made hiding possible for monsters. -b.t. 420 * July 7, 1995 - made hiding possible for monsters. -b.t.
428 */ 421 */
429
430static int 422static int
431attempt_hide (object *op, object *skill) 423attempt_hide (object *op, object *skill)
432{ 424{
433 int number, difficulty = op->map->difficulty; 425 int number, difficulty = op->map->difficulty;
434 int terrain = hideability (op); 426 int terrain = hideability (op);
437 return 0; 429 return 0;
438 430
439 /* Hiding success and duration dependant on skill level, 431 /* Hiding success and duration dependant on skill level,
440 * op->stats.Dex, map difficulty and terrain. 432 * op->stats.Dex, map difficulty and terrain.
441 */ 433 */
442
443 number = (die_roll (2, 25, op, PREFER_LOW) - 2) / 2; 434 number = (die_roll (2, 25, op, PREFER_LOW) - 2) / 2;
435
444 if (!stand_near_hostile (op) && (number < (op->stats.Dex + skill->level + terrain - difficulty))) 436 if (!stand_near_hostile (op) && (number < (op->stats.Dex + skill->level + terrain - difficulty)))
445 { 437 {
446 op->invisible += 100; /* set the level of 'hiddeness' */ 438 op->invisible += 100; /* set the level of 'hiddeness' */
439
447 if (op->type == PLAYER) 440 if (op->type == PLAYER)
448 op->contr->tmp_invis = 1; 441 op->contr->tmp_invis = 1;
442
449 op->hide = 1; 443 op->hide = 1;
450 return 1; 444 return 1;
451 } 445 }
446
452 return 0; 447 return 0;
453} 448}
454 449
455/* patched this to take terrain into consideration */ 450/* patched this to take terrain into consideration */
456int 451int
457hide (object *op, object *skill) 452hide (object *op, object *skill)
458{ 453{
459
460 /* the preliminaries -- Can we really hide now? */ 454 /* the preliminaries -- Can we really hide now? */
461 /* this keeps monsters from using invisibilty spells and hiding */ 455 /* this keeps monsters from using invisibilty spells and hiding */
462 456
463 if (QUERY_FLAG (op, FLAG_MAKE_INVIS)) 457 if (QUERY_FLAG (op, FLAG_MAKE_INVIS))
464 { 458 {
469 { 463 {
470 new_draw_info (NDI_UNIQUE, 0, op, "Your attempt to hide breaks the invisibility spell!"); 464 new_draw_info (NDI_UNIQUE, 0, op, "Your attempt to hide breaks the invisibility spell!");
471 make_visible (op); 465 make_visible (op);
472 } 466 }
473 467
474 if (op->invisible > (50 * skill->level)) 468 if (op->invisible > 50 * skill->level)
475 { 469 {
476 new_draw_info (NDI_UNIQUE, 0, op, "You are as hidden as you can get."); 470 new_draw_info (NDI_UNIQUE, 0, op, "You are as hidden as you can get.");
477 return 0; 471 return 0;
478 } 472 }
479 473
481 { 475 {
482 new_draw_info (NDI_UNIQUE, 0, op, "You hide in the shadows."); 476 new_draw_info (NDI_UNIQUE, 0, op, "You hide in the shadows.");
483 update_object (op, UP_OBJ_FACE); 477 update_object (op, UP_OBJ_FACE);
484 return calc_skill_exp (op, NULL, skill); 478 return calc_skill_exp (op, NULL, skill);
485 } 479 }
480
486 new_draw_info (NDI_UNIQUE, 0, op, "You fail to conceal yourself."); 481 new_draw_info (NDI_UNIQUE, 0, op, "You fail to conceal yourself.");
487 return 0; 482 return 0;
488} 483}
489
490 484
491/* stop_jump() - End of jump. Clear flags, restore the map, and 485/* stop_jump() - End of jump. Clear flags, restore the map, and
492 * freeze the jumper a while to simulate the exhaustion 486 * freeze the jumper a while to simulate the exhaustion
493 * of jumping. 487 * of jumping.
494 */ 488 */
814 * -b.t. (thomas@astro.psu.edu) 808 * -b.t. (thomas@astro.psu.edu)
815 */ 809 */
816int 810int
817use_oratory (object *pl, int dir, object *skill) 811use_oratory (object *pl, int dir, object *skill)
818{ 812{
819 sint16 x = pl->x + freearr_x[dir], y = pl->y + freearr_y[dir];
820 int mflags, chance;
821 object *tmp;
822 maptile *m;
823
824 if (pl->type != PLAYER) 813 if (pl->type != PLAYER)
825 return 0; /* only players use this skill */ 814 return 0; /* only players use this skill */
815
816 sint16 x = pl->x + freearr_x[dir],
817 y = pl->y + freearr_y[dir];
826 m = pl->map; 818 maptile *m = pl->map;
819
827 mflags = get_map_flags (m, &m, x, y, &x, &y); 820 int mflags = get_map_flags (m, &m, x, y, &x, &y);
828 if (mflags & P_OUT_OF_MAP) 821 if (mflags & P_OUT_OF_MAP)
829 return 0; 822 return 0;
830 823
831 /* Save some processing - we have the flag already anyways 824 /* Save some processing - we have the flag already anyways
832 */ 825 */
834 { 827 {
835 new_draw_info (NDI_UNIQUE, 0, pl, "There is nothing to orate to."); 828 new_draw_info (NDI_UNIQUE, 0, pl, "There is nothing to orate to.");
836 return 0; 829 return 0;
837 } 830 }
838 831
832 object *tmp;
839 for (tmp = GET_MAP_OB (m, x, y); tmp; tmp = tmp->above) 833 for (tmp = GET_MAP_OB (m, x, y); tmp; tmp = tmp->above)
840 { 834 {
841 /* can't persuade players - return because there is nothing else 835 /* can't persuade players - return because there is nothing else
842 * on that space to charm. Same for multi space monsters and 836 * on that space to charm. Same for multi space monsters and
843 * special monsters - we don't allow them to be charmed, and there 837 * special monsters - we don't allow them to be charmed, and there
844 * is no reason to do further processing since they should be the 838 * is no reason to do further processing since they should be the
845 * only monster on the space. 839 * only monster on the space.
846 */ 840 */
847 if (tmp->type == PLAYER) 841 if (tmp->type == PLAYER
848 return 0; 842 || tmp->more || tmp->head_ () != tmp
849 if (tmp->more || tmp->head) 843 || tmp->msg)
850 return 0;
851 if (tmp->msg)
852 return 0; 844 return 0;
853 845
854 if (QUERY_FLAG (tmp, FLAG_MONSTER)) 846 if (QUERY_FLAG (tmp, FLAG_MONSTER))
855 break; 847 break;
856 } 848 }
871 new_draw_info_format (NDI_UNIQUE, 0, pl, "Too bad the %s isn't listening!\n", query_name (tmp)); 863 new_draw_info_format (NDI_UNIQUE, 0, pl, "Too bad the %s isn't listening!\n", query_name (tmp));
872 return 0; 864 return 0;
873 } 865 }
874 866
875 /* it's already allied! */ 867 /* it's already allied! */
876 if (QUERY_FLAG (tmp, FLAG_FRIENDLY) && (tmp->attack_movement == PETMOVE)) 868 if (QUERY_FLAG (tmp, FLAG_FRIENDLY) && tmp->attack_movement == PETMOVE)
877 { 869 {
878 if (tmp->owner == pl) 870 if (tmp->owner == pl)
879 { 871 {
880 new_draw_info (NDI_UNIQUE, 0, pl, "Your follower loves your speech.\n"); 872 new_draw_info (NDI_UNIQUE, 0, pl, "Your follower loves your speech.\n");
881 return 0; 873 return 0;
884 { 876 {
885 /* you steal the follower. Perhaps we should really look at the 877 /* you steal the follower. Perhaps we should really look at the
886 * level of the owner above? 878 * level of the owner above?
887 */ 879 */
888 tmp->set_owner (pl); 880 tmp->set_owner (pl);
881 tmp->skill = skill->skill;
882
889 new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to follow you instead!\n", query_name (tmp)); 883 new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to follow you instead!\n", query_name (tmp));
890 /* Abuse fix - don't give exp since this can otherwise 884 /* Abuse fix - don't give exp since this can otherwise
891 * be used by a couple players to gets lots of exp. 885 * be used by a couple players to gets lots of exp.
892 */ 886 */
893 return 0; 887 return 0;
897 /* In this case, you can't steal it from the other player */ 891 /* In this case, you can't steal it from the other player */
898 return 0; 892 return 0;
899 } 893 }
900 } /* Creature was already a pet of someone */ 894 } /* Creature was already a pet of someone */
901 895
902 chance = skill->level * 2 + (pl->stats.Cha - 2 * tmp->stats.Int) / 2; 896 int level = skill->level + (pl->stats.Cha - tmp->stats.Int) / 2;
903 897
904 /* Ok, got a 'sucker' lets try to make them a follower */ 898 /* Ok, got a 'sucker' lets try to make them a follower */
905 if (chance > 0 && tmp->level < (random_roll (0, chance - 1, pl, PREFER_HIGH) - 1)) 899 if (level > 0 && tmp->level < (random_roll (0, level - 1, pl, PREFER_HIGH) - 1))
906 { 900 {
907 new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to become your follower.\n", query_name (tmp)); 901 new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to become your follower.\n", query_name (tmp));
908 902
909 tmp->set_owner (pl); 903 tmp->set_owner (pl);
904 tmp->skill = skill->skill;
910 tmp->stats.exp = 0; 905 tmp->stats.exp = 0;
911 add_friendly_object (tmp); 906 add_friendly_object (tmp);
912 tmp->attack_movement = PETMOVE; 907 tmp->attack_movement = PETMOVE;
913 return calc_skill_exp (pl, tmp, skill); 908 return calc_skill_exp (pl, tmp, skill);
914 } 909 }
915
916 /* Charm failed. Creature may be angry now */ 910 /* Charm failed. Creature may be angry now */
917 else if ((skill->level + ((pl->stats.Cha - 10) / 2)) < random_roll (1, 2 * tmp->level, pl, PREFER_LOW)) 911 else if ((skill->level + ((pl->stats.Cha - 10) / 2)) < random_roll (1, 2 * tmp->level, pl, PREFER_LOW))
918 { 912 {
919 new_draw_info_format (NDI_UNIQUE, 0, pl, "Your speech angers the %s!\n", query_name (tmp)); 913 new_draw_info_format (NDI_UNIQUE, 0, pl, "Your speech angers the %s!\n", query_name (tmp));
920 if (QUERY_FLAG (tmp, FLAG_FRIENDLY)) 914 if (QUERY_FLAG (tmp, FLAG_FRIENDLY))
937 * successfully pacified the creature gets Int=1. Thus, a player 931 * successfully pacified the creature gets Int=1. Thus, a player
938 * may only pacify a creature once. 932 * may only pacify a creature once.
939 * BTW, I appologize for the naming of the skill, I couldnt think 933 * BTW, I appologize for the naming of the skill, I couldnt think
940 * of anything better! -b.t. 934 * of anything better! -b.t.
941 */ 935 */
942
943int 936int
944singing (object *pl, int dir, object *skill) 937singing (object *pl, int dir, object *skill)
945{ 938{
946 int i, exp = 0, chance, mflags; 939 int i, exp = 0;
947 object *tmp; 940 object *tmp;
948 maptile *m; 941 maptile *m;
949 sint16 x, y; 942 sint16 x, y;
950 943
951 if (pl->type != PLAYER) 944 if (pl->type != PLAYER)
956 { 949 {
957 x = pl->x + freearr_x[i]; 950 x = pl->x + freearr_x[i];
958 y = pl->y + freearr_y[i]; 951 y = pl->y + freearr_y[i];
959 m = pl->map; 952 m = pl->map;
960 953
961 mflags = get_map_flags (m, &m, x, y, &x, &y); 954 int mflags = get_map_flags (m, &m, x, y, &x, &y);
962 if (mflags & P_OUT_OF_MAP) 955 if (mflags & P_OUT_OF_MAP)
963 continue; 956 continue;
964 if (!(mflags & P_IS_ALIVE)) 957 if (!(mflags & P_IS_ALIVE))
965 continue; 958 continue;
966 959
985 978
986 /* stealing isn't really related (although, maybe it should 979 /* stealing isn't really related (although, maybe it should
987 * be). This is mainly to prevent singing to the same monster 980 * be). This is mainly to prevent singing to the same monster
988 * over and over again and getting exp for it. 981 * over and over again and getting exp for it.
989 */ 982 */
990 chance = skill->level * 2 + (pl->stats.Cha - 5 - tmp->stats.Int) / 2; 983 int level = skill->level + (pl->stats.Cha - 5 - tmp->stats.Int) / 2;
984
991 if (chance && tmp->level * 2 < random_roll (0, chance - 1, pl, PREFER_HIGH)) 985 if (level && tmp->level < random_roll (0, level - 1, pl, PREFER_HIGH))
992 { 986 {
993 SET_FLAG (tmp, FLAG_UNAGGRESSIVE); 987 SET_FLAG (tmp, FLAG_UNAGGRESSIVE);
994 new_draw_info_format (NDI_UNIQUE, 0, pl, "You calm down the %s\n", query_name (tmp)); 988 new_draw_info_format (NDI_UNIQUE, 0, pl, "You calm down the %s\n", query_name (tmp));
995 /* Give exp only if they are not aware */ 989 /* Give exp only if they are not aware */
990
996 if (!QUERY_FLAG (tmp, FLAG_NO_STEAL)) 991 if (!QUERY_FLAG (tmp, FLAG_NO_STEAL))
997 exp += calc_skill_exp (pl, tmp, skill); 992 exp += calc_skill_exp (pl, tmp, skill);
993
998 SET_FLAG (tmp, FLAG_NO_STEAL); 994 SET_FLAG (tmp, FLAG_NO_STEAL);
999 } 995 }
1000 else 996 else
1001 { 997 {
1002 new_draw_info_format (NDI_UNIQUE, 0, pl, "Too bad the %s isn't listening!\n", query_name (tmp)); 998 new_draw_info_format (NDI_UNIQUE, 0, pl, "Too bad the %s isn't listening!\n", query_name (tmp));
1199 return; 1195 return;
1200 } 1196 }
1201 else 1197 else
1202 { 1198 {
1203 for (tmp = pl->inv; tmp; tmp = tmp->below) 1199 for (tmp = pl->inv; tmp; tmp = tmp->below)
1204 if (((tmp->type == ARMOUR && skill->level < 12) 1200 if (((tmp->type == ARMOUR && skill->level < 12)
1205 || (tmp->type == HELMET && skill->level < 10) 1201 || (tmp->type == HELMET && skill->level < 10)
1206 || (tmp->type == SHIELD && skill->level < 6) 1202 || (tmp->type == SHIELD && skill->level < 6)
1207 || (tmp->type == BOOTS && skill->level < 4) || (tmp->type == GLOVES && skill->level < 2)) && QUERY_FLAG (tmp, FLAG_APPLIED)) 1203 || (tmp->type == BOOTS && skill->level < 4)
1204 || (tmp->type == GLOVES && skill->level < 2))
1205 && QUERY_FLAG (tmp, FLAG_APPLIED))
1208 { 1206 {
1209 new_draw_info (NDI_UNIQUE, 0, pl, "You can't concentrate while wearing so much armour!\n"); 1207 new_draw_info (NDI_UNIQUE, 0, pl, "You can't concentrate while wearing so much armour!\n");
1210 return; 1208 return;
1211 } 1209 }
1212 } 1210 }
1316 new_draw_info (NDI_UNIQUE, 0, pl, "A spell can only be inscribed into a scroll!"); 1314 new_draw_info (NDI_UNIQUE, 0, pl, "A spell can only be inscribed into a scroll!");
1317 return 0; 1315 return 0;
1318 } 1316 }
1319 1317
1320 /* Check if we are ready to attempt inscription */ 1318 /* Check if we are ready to attempt inscription */
1321 chosen_spell = pl->contr->ranges[range_magic]; 1319 chosen_spell = pl->contr->ranged_ob;
1322 if (!chosen_spell) 1320 if (!chosen_spell || chosen_spell->type != SPELL)
1323 { 1321 {
1324 new_draw_info (NDI_UNIQUE, 0, pl, "You need a spell readied in order to inscribe!"); 1322 new_draw_info (NDI_UNIQUE, 0, pl, "You need a spell readied in order to inscribe!");
1325 return 0; 1323 return 0;
1326 } 1324 }
1327 1325
1582 1580
1583/* make_throw_ob() We construct the 'carrier' object in 1581/* make_throw_ob() We construct the 'carrier' object in
1584 * which we will insert the object that is being thrown. 1582 * which we will insert the object that is being thrown.
1585 * This combination becomes the 'thrown object'. -b.t. 1583 * This combination becomes the 'thrown object'. -b.t.
1586 */ 1584 */
1587
1588static object * 1585static object *
1589make_throw_ob (object *orig) 1586make_throw_ob (object *orig)
1590{ 1587{
1591 if (!orig) 1588 if (!orig)
1592 return NULL; 1589 return NULL;
1605 toss_item->stats.dam = 0; /* default damage */ 1602 toss_item->stats.dam = 0; /* default damage */
1606 insert_ob_in_ob (orig, toss_item); 1603 insert_ob_in_ob (orig, toss_item);
1607 return toss_item; 1604 return toss_item;
1608} 1605}
1609 1606
1610
1611/* do_throw() - op throws any object toss_item. This code 1607/* do_throw() - op throws any object toss_item. This code
1612 * was borrowed from fire_bow. 1608 * was borrowed from fire_bow.
1613 * Returns 1 if skill was successfully used, 0 if not 1609 * Returns 1 if skill was successfully used, 0 if not
1614 */ 1610 */
1615
1616static int 1611static int
1617do_throw (object *op, object *part, object *toss_item, int dir, object *skill) 1612do_throw (object *op, object *part, object *toss_item, int dir, object *skill)
1618{ 1613{
1619 object *throw_ob = toss_item, *left = NULL; 1614 object *throw_ob = toss_item, *left = NULL;
1620 int eff_str = 0, maxc, str = op->stats.Str, dam = 0; 1615 int eff_str = 0, maxc, str = op->stats.Str, dam = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines