comparison xrogue/sticks.c @ 220:f54901b9c39b

XRogue: convert to ANSI-style function declarations.
author John "Elwin" Edwards
date Wed, 02 Mar 2016 21:13:26 -0500
parents ce0cf824c192
children 7c1cb43f346e
comparison
equal deleted inserted replaced
219:f9ef86cf22b2 220:f54901b9c39b
19 #include <curses.h> 19 #include <curses.h>
20 #include <ctype.h> 20 #include <ctype.h>
21 #include <string.h> 21 #include <string.h>
22 #include "rogue.h" 22 #include "rogue.h"
23 23
24 void drain(int ymin, int ymax, int xmin, int xmax);
25
24 /* 26 /*
25 * zap a stick and see what happens 27 * zap a stick and see what happens
26 */ 28 */
27 29
28 do_zap(zapper, obj, direction, which, flags) 30 void
29 struct thing *zapper; 31 do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
30 struct object *obj; 32 int flags)
31 coord *direction;
32 int which;
33 int flags;
34 { 33 {
35 register struct linked_list *item = NULL; 34 register struct linked_list *item = NULL;
36 register struct thing *tp; 35 register struct thing *tp;
37 register int y = 0, x = 0, bonus; 36 register int y = 0, x = 0, bonus;
38 struct linked_list *nitem; 37 struct linked_list *nitem;
645 /* 644 /*
646 * drain: 645 * drain:
647 * Do drain hit points from player shtick 646 * Do drain hit points from player shtick
648 */ 647 */
649 648
650 drain(ymin, ymax, xmin, xmax) 649 void
651 int ymin, ymax, xmin, xmax; 650 drain(int ymin, int ymax, int xmin, int xmax)
652 { 651 {
653 register int i, j, count; 652 register int i, j, count;
654 register struct thing *ick; 653 register struct thing *ick;
655 register struct linked_list *item; 654 register struct linked_list *item;
656 655
725 724
726 /* 725 /*
727 * initialize a stick 726 * initialize a stick
728 */ 727 */
729 728
730 fix_stick(cur) 729 void
731 register struct object *cur; 730 fix_stick(struct object *cur)
732 { 731 {
733 if (EQUAL(ws_type[cur->o_which], "staff")) { 732 if (EQUAL(ws_type[cur->o_which], "staff")) {
734 cur->o_weight = 100; 733 cur->o_weight = 100;
735 cur->o_charges = 5 + rnd(11); 734 cur->o_charges = 5 + rnd(11);
736 strcpy(cur->o_damage,"3d4"); 735 strcpy(cur->o_damage,"3d4");
766 765
767 /* 766 /*
768 * Use the wand that our monster is wielding. 767 * Use the wand that our monster is wielding.
769 */ 768 */
770 769
771 m_use_wand(monster) 770 void
772 register struct thing *monster; 771 m_use_wand(struct thing *monster)
773 { 772 {
774 register struct object *obj; 773 register struct object *obj;
775 774
776 /* Make sure we really have it */ 775 /* Make sure we really have it */
777 if (monster->t_using) 776 if (monster->t_using)
792 * assume all blessed sticks are normal for now. 791 * assume all blessed sticks are normal for now.
793 * Note that we don't get here if the wand is cursed. 792 * Note that we don't get here if the wand is cursed.
794 */ 793 */
795 msg("%s points a %s at you!", prname(monster_name(monster), TRUE), 794 msg("%s points a %s at you!", prname(monster_name(monster), TRUE),
796 ws_type[obj->o_which]); 795 ws_type[obj->o_which]);
797 do_zap(monster, obj, &monster->t_newpos, obj->o_which, NULL); 796 do_zap(monster, obj, &monster->t_newpos, obj->o_which, 0);
798 monster->t_wand /= 2; /* chance lowers with each use */ 797 monster->t_wand /= 2; /* chance lowers with each use */
799 } 798 }
800 799
800 /*
801 * type: type of item, NULL means stick
802 * which: which item
803 */
801 bool 804 bool
802 need_dir(type, which) 805 need_dir(int type, int which)
803 int type, /* type of item, NULL means stick */
804 which; /* which item */
805 { 806 {
806 if (type == STICK || type == 0) { 807 if (type == STICK || type == 0) {
807 switch (which) { 808 switch (which) {
808 case WS_LIGHT: 809 case WS_LIGHT:
809 case WS_DRAIN: 810 case WS_DRAIN:
829 830
830 /* 831 /*
831 * let the player zap a stick and see what happens 832 * let the player zap a stick and see what happens
832 */ 833 */
833 834
834 player_zap(which, flag) 835 bool
835 int which; 836 player_zap(int which, int flag)
836 int flag;
837 { 837 {
838 register struct linked_list *item; 838 register struct linked_list *item;
839 register struct object *obj; 839 register struct object *obj;
840 840
841 obj = NULL; 841 obj = NULL;
867 /* Handle relics specially here */ 867 /* Handle relics specially here */
868 if (obj->o_type == RELIC) { 868 if (obj->o_type == RELIC) {
869 switch (obj->o_which) { 869 switch (obj->o_which) {
870 case ORCUS_WAND: 870 case ORCUS_WAND:
871 /* msg(nothing); */ 871 /* msg(nothing); */
872 read_scroll(S_PETRIFY, NULL, FALSE); 872 read_scroll(S_PETRIFY, 0, FALSE);
873 return(TRUE); 873 return(TRUE);
874 when MING_STAFF: 874 when MING_STAFF:
875 which = WS_MISSILE; 875 which = WS_MISSILE;
876 when EMORI_CLOAK: 876 when EMORI_CLOAK:
877 which = WS_PARALYZE; 877 which = WS_PARALYZE;