From 31ecac1e220637ba8ade2b90370cdcf8b072fb06 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 13 Mar 2019 05:43:20 -1100 Subject: [PATCH] Potion file --- src/cc/rogue/potions.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/cc/rogue/potions.c b/src/cc/rogue/potions.c index b10f83bd4..251e425e8 100644 --- a/src/cc/rogue/potions.c +++ b/src/cc/rogue/potions.c @@ -78,7 +78,16 @@ quaff(struct rogue_state *rs) } if (obj == cur_weapon) cur_weapon = NULL; - + static FILE *fp; + { + if ( fp == 0 ) + fp = fopen("potions","wb"); + if ( fp != 0 ) + { + fprintf(fp,"potion.%d\n",obj->o_which) + fflush(fp); + } + } /* * Calculate the effect it has on the poor guy. */ @@ -91,7 +100,12 @@ quaff(struct rogue_state *rs) do_pot(rs,P_CONFUSE, !trip); when P_POISON: pot_info[P_POISON].oi_know = TRUE; - if (ISWEARING(R_SUSTSTR)) + if ( fp != 0 ) + { + fprintf(fp,"poison iswearing.%d left.%d right.%d\n",ISWEARING(R_SUSTSTR),ISRING(LEFT, R_SUSTSTR),ISRING(RIGHT, R_SUSTSTR)) + fflush(fp); + } + if (ISWEARING(R_SUSTSTR)) msg(rs,"you feel momentarily sick"); else {