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.34 by root, Tue Apr 22 23:53:12 2008 UTC vs.
Revision 1.35 by root, Sun May 4 18:46:01 2008 UTC

656/* if (!(QUERY_FLAG(&(exp_ob->arch->clone),flag)))*/ 656/* if (!(QUERY_FLAG(&(exp_ob->arch->clone),flag)))*/
657 CLEAR_FLAG (exp_ob, flag); 657 CLEAR_FLAG (exp_ob, flag);
658 }; 658 };
659} 659}
660 660
661
662
663archetype * 661archetype *
664determine_holy_arch (object *god, const char *type) 662determine_holy_arch (object *god, const char *type)
665{ 663{
666 treasure *tr; 664 treasure *tr;
667 665
668 if (!god || !god->randomitems) 666 if (!god || !god->randomitems)
669 { 667 {
670 LOG (llevError, "BUG: determine_holy_arch(): no god or god without " "randomitems\n"); 668 LOG (llevError, "BUG: determine_holy_arch(): no god or god without " "randomitems\n");
671 return NULL; 669 return 0;
672 } 670 }
673 671
674 for (tr = god->randomitems->items; tr; tr = tr->next) 672 for (tr = god->randomitems->items; tr; tr = tr->next)
675 { 673 {
676 if (!tr->item) 674 if (!tr->item)
679 object *item = tr->item; 677 object *item = tr->item;
680 678
681 if (item->type == BOOK && item->invisible && strcmp (item->name, type) == 0) 679 if (item->type == BOOK && item->invisible && strcmp (item->name, type) == 0)
682 return item->other_arch; 680 return item->other_arch;
683 } 681 }
682
684 return NULL; 683 return 0;
685} 684}
686 685
687/** 686/**
688 * God helps player by removing curse and/or damnation. 687 * God helps player by removing curse and/or damnation.
689 */ 688 */
727 return 0; 726 return 0;
728 } 727 }
729 728
730 if (level <= 20) 729 if (level <= 20)
731 return level / difficulty; 730 return level / difficulty;
731
732 if (level <= 40) 732 if (level <= 40)
733 return (20 + (level - 20) / 2) / difficulty; 733 return (20 + (level - 20) / 2) / difficulty;
734 734
735 return (30 + (level - 40) / 4) / difficulty; 735 return (30 + (level - 40) / 4) / difficulty;
736} 736}
742 * attacktype, slaying and such. 742 * attacktype, slaying and such.
743 */ 743 */
744static int 744static int
745god_enchants_weapon (object *op, object *god, object *tr, object *skill) 745god_enchants_weapon (object *op, object *god, object *tr, object *skill)
746{ 746{
747 char buf[MAX_BUF];
748 object *weapon; 747 object *weapon;
749 uint32 attacktype; 748 uint32 attacktype;
750 int tmp; 749 int tmp;
751 750
752 for (weapon = op->inv; weapon; weapon = weapon->below) 751 for (weapon = op->inv; weapon; weapon = weapon->below)
753 if ((weapon->type == WEAPON || weapon->type == BOW) && QUERY_FLAG (weapon, FLAG_APPLIED)) 752 if ((weapon->type == WEAPON || weapon->type == BOW) && QUERY_FLAG (weapon, FLAG_APPLIED))
754 break; 753 break;
755 754
756 if (weapon == NULL || god_examines_item (god, weapon) <= 0) 755 if (!weapon || god_examines_item (god, weapon) <= 0)
757 return 0; 756 return 0;
758 757
759 /* First give it a title, so other gods won't touch it */ 758 /* First give it a title, so other gods won't touch it */
760 if (!weapon->title) 759 if (!weapon->title)
761 { 760 {
762 sprintf (buf, "of %s", &god->name); 761 weapon->title = format ("of %s", &god->name);
763 weapon->title = buf;
764 762
765 if (object *pl = weapon->visible_to ()) 763 if (object *pl = weapon->visible_to ())
766 esrv_update_item (UPD_NAME, pl, weapon); 764 esrv_update_item (UPD_NAME, pl, weapon);
767 765
768 new_draw_info (NDI_UNIQUE, 0, op, "Your weapon quivers as if struck!"); 766 new_draw_info (NDI_UNIQUE, 0, op, "Your weapon quivers as if struck!");
900 /* Restore to 50 .. 100%, if sp < 50% */ 898 /* Restore to 50 .. 100%, if sp < 50% */
901 int new_sp = (int) (random_roll (1000, 1999, op, PREFER_HIGH) / 2000.0 * max); 899 int new_sp = (int) (random_roll (1000, 1999, op, PREFER_HIGH) / 2000.0 * max);
902 900
903 if (op->stats.sp >= max / 2) 901 if (op->stats.sp >= max / 2)
904 continue; 902 continue;
903
905 new_draw_info (NDI_UNIQUE, 0, op, "A blue lightning strikes " "your head but doesn't hurt you!"); 904 new_draw_info (NDI_UNIQUE, 0, op, "A blue lightning strikes your head but doesn't hurt you!");
906 op->stats.sp = new_sp; 905 op->stats.sp = new_sp;
907 } 906 }
908 907
909 /* Various heal spells */ 908 /* Various heal spells */
910 if (item->type == BOOK && item->invisible && strcmp (item->name, "heal spell") == 0) 909 if (item->type == BOOK && item->invisible && strcmp (item->name, "heal spell") == 0)
911 { 910 {
912 object *tmp;
913 int success;
914
915 tmp = get_archetype_by_object_name (item->slaying); 911 object *tmp = archetype::get (item->slaying);
916
917 success = cast_heal (op, op, tmp, 0); 912 int success = cast_heal (op, op, tmp, 0);
918 tmp->destroy (); 913 tmp->destroy ();
914
919 if (success) 915 if (success)
920 return; 916 return;
921 else 917 else
922 continue; 918 continue;
923 } 919 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines