comparison xrogue/potions.c @ 236:7c1cb43f346e

XRogue: get rid of VOID as an alias for long. Maybe some compilers in 1986 didn't handle void pointers well, but they are no longer a concern.
author John "Elwin" Edwards
date Mon, 07 Mar 2016 20:44:01 -0500
parents b67b99f6c92b
children 0250220d8cdd
comparison
equal deleted inserted replaced
235:2dcf10d45d5b 236:7c1cb43f346e
170 lengthen(nohaste, roll(hasttime,hasttime)); 170 lengthen(nohaste, roll(hasttime,hasttime));
171 } 171 }
172 else { 172 else {
173 msg("You feel yourself moving %sfaster.", blessed ? "much " : ""); 173 msg("You feel yourself moving %sfaster.", blessed ? "much " : "");
174 turn_on(player, ISHASTE); 174 turn_on(player, ISHASTE);
175 fuse(nohaste, (VOID *)NULL, roll(hasttime, hasttime), AFTER); 175 fuse(nohaste, NULL, roll(hasttime, hasttime), AFTER);
176 } 176 }
177 } 177 }
178 178
179 /* 179 /*
180 * Increase player's intelligence 180 * Increase player's intelligence
230 on(player, ISSLOW) ? "even " : ""); 230 on(player, ISSLOW) ? "even " : "");
231 if (on(player, ISSLOW)) 231 if (on(player, ISSLOW))
232 lengthen(noslow, roll(HASTETIME,HASTETIME)); 232 lengthen(noslow, roll(HASTETIME,HASTETIME));
233 else { 233 else {
234 turn_on(player, ISSLOW); 234 turn_on(player, ISSLOW);
235 fuse(noslow, (VOID *)NULL, roll(HASTETIME,HASTETIME), AFTER); 235 fuse(noslow, NULL, roll(HASTETIME,HASTETIME), AFTER);
236 } 236 }
237 } 237 }
238 } 238 }
239 239
240 /* 240 /*
351 extinguish(unclrhead); /* If we have a fuse, put it out */ 351 extinguish(unclrhead); /* If we have a fuse, put it out */
352 msg("A strong blue aura surrounds your head."); 352 msg("A strong blue aura surrounds your head.");
353 } 353 }
354 else { /* Just light a fuse for how long player is safe */ 354 else { /* Just light a fuse for how long player is safe */
355 if (off(player, ISCLEAR)) { 355 if (off(player, ISCLEAR)) {
356 fuse(unclrhead, (VOID *)NULL, CLRDURATION, AFTER); 356 fuse(unclrhead, NULL, CLRDURATION, AFTER);
357 msg("A faint blue aura surrounds your head."); 357 msg("A faint blue aura surrounds your head.");
358 } 358 }
359 else { /* If we have a fuse lengthen it, else we 359 else { /* If we have a fuse lengthen it, else we
360 * are permanently clear. 360 * are permanently clear.
361 */ 361 */
516 if (cursed) { 516 if (cursed) {
517 if (!find_slot(sight)) 517 if (!find_slot(sight))
518 { 518 {
519 msg("A cloak of darkness falls around you."); 519 msg("A cloak of darkness falls around you.");
520 turn_on(player, ISBLIND); 520 turn_on(player, ISBLIND);
521 fuse(sight, (VOID *)NULL, SEEDURATION, AFTER); 521 fuse(sight, NULL, SEEDURATION, AFTER);
522 light(&hero); 522 light(&hero);
523 } 523 }
524 else 524 else
525 msg("The darkness around you thickens. "); 525 msg("The darkness around you thickens. ");
526 lengthen(sight, SEEDURATION); 526 lengthen(sight, SEEDURATION);
527 } 527 }
528 else { 528 else {
529 if (off(player, CANSEE)) { 529 if (off(player, CANSEE)) {
530 turn_on(player, CANSEE); 530 turn_on(player, CANSEE);
531 msg("Your eyes begin to tingle."); 531 msg("Your eyes begin to tingle.");
532 fuse(unsee, (VOID *)NULL, blessed ? SEEDURATION*3 :SEEDURATION, AFTER); 532 fuse(unsee, NULL, blessed ? SEEDURATION*3 :SEEDURATION, AFTER);
533 light(&hero); 533 light(&hero);
534 } 534 }
535 else if (find_slot(unsee) != 0) { 535 else if (find_slot(unsee) != 0) {
536 msg("You eyes continue to tingle."); 536 msg("You eyes continue to tingle.");
537 lengthen(unsee, blessed ? SEEDURATION*3 : SEEDURATION); 537 lengthen(unsee, blessed ? SEEDURATION*3 : SEEDURATION);
551 else duration = 1; 551 else duration = 1;
552 552
553 if (on(player, CANINWALL)) 553 if (on(player, CANINWALL))
554 lengthen(unphase, duration*PHASEDURATION); 554 lengthen(unphase, duration*PHASEDURATION);
555 else { 555 else {
556 fuse(unphase, (VOID *)NULL, duration*PHASEDURATION, AFTER); 556 fuse(unphase, NULL, duration*PHASEDURATION, AFTER);
557 turn_on(player, CANINWALL); 557 turn_on(player, CANINWALL);
558 } 558 }
559 msg("You feel %slight-headed!", 559 msg("You feel %slight-headed!",
560 blessed ? "very " : ""); 560 blessed ? "very " : "");
561 } 561 }
575 msg("Nothing happens."); /* Flying by cloak */ 575 msg("Nothing happens."); /* Flying by cloak */
576 say_message = FALSE; 576 say_message = FALSE;
577 } 577 }
578 } 578 }
579 else { 579 else {
580 fuse(land, (VOID *)NULL, duration*FLYTIME, AFTER); 580 fuse(land, NULL, duration*FLYTIME, AFTER);
581 turn_on(player, ISFLY); 581 turn_on(player, ISFLY);
582 } 582 }
583 if (say_message) { 583 if (say_message) {
584 if (is_potion) p_know[P_FLY] = TRUE; 584 if (is_potion) p_know[P_FLY] = TRUE;
585 msg("You feel %slighter than air!", blessed ? "much " : ""); 585 msg("You feel %slighter than air!", blessed ? "much " : "");
639 } 639 }
640 when P_INVIS: 640 when P_INVIS:
641 if (off(player, ISINVIS)) { 641 if (off(player, ISINVIS)) {
642 turn_on(player, ISINVIS); 642 turn_on(player, ISINVIS);
643 msg("You have a tingling feeling all over your body"); 643 msg("You have a tingling feeling all over your body");
644 fuse(appear, (VOID *)NULL, blessed ? GONETIME*3 : GONETIME, AFTER); 644 fuse(appear, NULL, blessed ? GONETIME*3 : GONETIME, AFTER);
645 PLAYER = IPLAYER; 645 PLAYER = IPLAYER;
646 light(&hero); 646 light(&hero);
647 } 647 }
648 else { 648 else {
649 if (find_slot(appear)) { 649 if (find_slot(appear)) {
701 701
702 /* Does he currently have an artifical skill? */ 702 /* Does he currently have an artifical skill? */
703 if (!find_slot(unskill)) { /* No skill */ 703 if (!find_slot(unskill)) { /* No skill */
704 pstats.s_lvladj = -2; 704 pstats.s_lvladj = -2;
705 pstats.s_lvl += pstats.s_lvladj; 705 pstats.s_lvl += pstats.s_lvladj;
706 fuse(unskill, (VOID *)NULL, SKILLDURATION, AFTER); 706 fuse(unskill, NULL, SKILLDURATION, AFTER);
707 } 707 }
708 else { /* Has an artifical skill */ 708 else { /* Has an artifical skill */
709 /* Is the skill beneficial? */ 709 /* Is the skill beneficial? */
710 if (pstats.s_lvladj > 0) { 710 if (pstats.s_lvladj > 0) {
711 /* Decrease the previous skill advantage */ 711 /* Decrease the previous skill advantage */
757 757
758 /* Does he currently have an artifical skill? */ 758 /* Does he currently have an artifical skill? */
759 if (!find_slot(unskill)) { 759 if (!find_slot(unskill)) {
760 pstats.s_lvladj = adjust; 760 pstats.s_lvladj = adjust;
761 pstats.s_lvl += pstats.s_lvladj; 761 pstats.s_lvl += pstats.s_lvladj;
762 fuse(unskill, (VOID *)NULL, 762 fuse(unskill, NULL,
763 blessed ? SKILLDURATION*2 : SKILLDURATION, AFTER); 763 blessed ? SKILLDURATION*2 : SKILLDURATION, AFTER);
764 } 764 }
765 else { /* Has an artifical skill */ 765 else { /* Has an artifical skill */
766 /* Is the skill detrimental? */ 766 /* Is the skill detrimental? */
767 if (pstats.s_lvladj < 0) { 767 if (pstats.s_lvladj < 0) {
817 else if (cursed) { 817 else if (cursed) {
818 msg("You quench your thirst. "); 818 msg("You quench your thirst. ");
819 say_message = FALSE; 819 say_message = FALSE;
820 } 820 }
821 else { 821 else {
822 fuse(nofire, (VOID *)NULL, duration*FIRETIME, AFTER); 822 fuse(nofire, NULL, duration*FIRETIME, AFTER);
823 turn_on(player, NOFIRE); 823 turn_on(player, NOFIRE);
824 } 824 }
825 if (say_message) { 825 if (say_message) {
826 if (is_potion) p_know[P_FIRE] = TRUE; 826 if (is_potion) p_know[P_FIRE] = TRUE;
827 msg("You feel %sfire resistant", blessed ? "very " : ""); 827 msg("You feel %sfire resistant", blessed ? "very " : "");
854 else if (cursed) { 854 else if (cursed) {
855 msg("You quench your thirst. "); 855 msg("You quench your thirst. ");
856 say_message = FALSE; 856 say_message = FALSE;
857 } 857 }
858 else { 858 else {
859 fuse(nocold, (VOID *)NULL, duration*COLDTIME, AFTER); 859 fuse(nocold, NULL, duration*COLDTIME, AFTER);
860 turn_on(player, NOCOLD); 860 turn_on(player, NOCOLD);
861 } 861 }
862 if (say_message) { 862 if (say_message) {
863 if (is_potion) p_know[P_COLD] = TRUE; 863 if (is_potion) p_know[P_COLD] = TRUE;
864 msg("You feel %scold resistant", blessed ? "very " : ""); 864 msg("You feel %scold resistant", blessed ? "very " : "");
888 else if (cursed) { 888 else if (cursed) {
889 msg("You quench your thirst. "); 889 msg("You quench your thirst. ");
890 say_message = FALSE; 890 say_message = FALSE;
891 } 891 }
892 else { 892 else {
893 fuse(nobolt, (VOID *)NULL, duration*BOLTTIME, AFTER); 893 fuse(nobolt, NULL, duration*BOLTTIME, AFTER);
894 turn_on(player, NOBOLT); 894 turn_on(player, NOBOLT);
895 } 895 }
896 if (say_message) { 896 if (say_message) {
897 if (is_potion) p_know[P_LIGHTNING] = TRUE; 897 if (is_potion) p_know[P_LIGHTNING] = TRUE;
898 msg("Your skin turns %sblue!", blessed ? "very " : ""); 898 msg("Your skin turns %sblue!", blessed ? "very " : "");