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

Comparing deliantra/server/server/gods.C (file contents):
Revision 1.64 by root, Fri Apr 30 21:00:40 2010 UTC vs.
Revision 1.65 by root, Thu Jun 10 06:03:18 2010 UTC

651 * attacktype, slaying and such. 651 * attacktype, slaying and such.
652 */ 652 */
653static int 653static int
654god_enchants_weapon (object *op, object *god, object *tr, object *skill) 654god_enchants_weapon (object *op, object *god, object *tr, object *skill)
655{ 655{
656 object *weapon; 656 if (!op->contr)
657 uint32 attacktype; 657 return 0;
658 int tmp;
659 658
660 for (weapon = op->inv; weapon; weapon = weapon->below) 659 object *weapon = op->contr->combat_ob;
661 if ((weapon->type == WEAPON || weapon->type == BOW) && weapon->flag [FLAG_APPLIED])
662 break;
663 660
661 if (weapon->type != WEAPON && weapon->type != BOW)
662 return 0;
663
664 if (!weapon || god_examines_item (god, weapon) <= 0) 664 if (god_examines_item (god, weapon) <= 0)
665 return 0; 665 return 0;
666 666
667 /* First give it a title, so other gods won't touch it */ 667 /* First give it a title, so other gods won't touch it */
668 if (!weapon->title) 668 if (!weapon->title)
669 { 669 {
682 new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s now hungers to slay enemies of your god!", &weapon->name); 682 new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s now hungers to slay enemies of your god!", &weapon->name);
683 return 1; 683 return 1;
684 } 684 }
685 685
686 /* Add the gods attacktype */ 686 /* Add the gods attacktype */
687 attacktype = (weapon->attacktype == 0) ? AT_PHYSICAL : weapon->attacktype; 687 uint32 attacktype = (weapon->attacktype == 0) ? AT_PHYSICAL : weapon->attacktype;
688
688 if ((attacktype & god->attacktype) != god->attacktype) 689 if ((attacktype & god->attacktype) != god->attacktype)
689 { 690 {
690 new_draw_info (NDI_UNIQUE, 0, op, "Your weapon suddenly glows!"); 691 new_draw_info (NDI_UNIQUE, 0, op, "Your weapon suddenly glows!");
691 weapon->attacktype = attacktype | god->attacktype; 692 weapon->attacktype = attacktype | god->attacktype;
692 return 1; 693 return 1;
693 } 694 }
694 695
695 /* Higher magic value */ 696 /* Higher magic value */
696 tmp = follower_level_to_enchantments (skill->level, tr->level); 697 if (weapon->magic < follower_level_to_enchantments (skill->level, tr->level))
697 if (weapon->magic < tmp)
698 { 698 {
699 new_draw_info (NDI_UNIQUE, 0, op, "A phosphorescent glow envelops your weapon!"); 699 new_draw_info (NDI_UNIQUE, 0, op, "A phosphorescent glow envelops your weapon!");
700 weapon->magic++; 700 weapon->magic++;
701 701
702 if (object *pl = weapon->visible_to ()) 702 if (object *pl = weapon->visible_to ())

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines