@@ -22,6 +22,13 @@
|
||||
*/
|
||||
void rogue_restoreobject(THING *o,struct rogue_packitem *item);
|
||||
|
||||
int32_t rogue_total(THING *o)
|
||||
{
|
||||
if ( (o->o_flags & ISMANY) != 0 )
|
||||
return(1);
|
||||
else return(o->o_count);
|
||||
}
|
||||
|
||||
void restore_player(struct rogue_state *rs)
|
||||
{
|
||||
int32_t i,total = 0; THING *obj;
|
||||
@@ -38,8 +45,8 @@ void restore_player(struct rogue_state *rs)
|
||||
{
|
||||
obj = new_item();
|
||||
rogue_restoreobject(obj,&rs->P.roguepack[i]);
|
||||
total += obj->o_count;
|
||||
if ( total > pstats.s_str*3 )
|
||||
total += rogue_total(obj);
|
||||
if ( total > ROGUE_MAXTOTAL )
|
||||
break;
|
||||
add_pack(rs,obj,TRUE);
|
||||
}
|
||||
|
||||
@@ -166,16 +166,16 @@ int32_t num_packitems(struct rogue_state *rs)
|
||||
if ( list->o_packch != 0 )
|
||||
{
|
||||
n++;
|
||||
total += list->o_count;
|
||||
total += rogue_total(list);
|
||||
}
|
||||
}
|
||||
if ( rs->guiflag != 0 )
|
||||
{
|
||||
char str[MAXSTR];
|
||||
sprintf(str,"strength*3 %d vs total.%d vs %d inventory letters\n",pstats.s_str*3,total,n);
|
||||
sprintf(str,"strength*2 %d vs total.%d vs %d inventory letters\n",ROGUE_MAXTOTAL,total,n);
|
||||
add_line(rs,"%s",str);
|
||||
}
|
||||
if ( total > pstats.s_str*3 )
|
||||
if ( total > ROGUE_MAXTOTAL )
|
||||
return(MAXPACK);
|
||||
return(n);
|
||||
}
|
||||
|
||||
@@ -381,6 +381,8 @@ void restore_player(struct rogue_state *rs);
|
||||
int32_t rogue_replay2(uint8_t *newdata,uint64_t seed,char *keystrokes,int32_t num,struct rogue_player *player,int32_t sleepmillis);
|
||||
void rogue_bailout(struct rogue_state *rs);
|
||||
|
||||
#define ROGUE_MAXTOTAL (pstats.s_str*2)
|
||||
|
||||
/*
|
||||
* Help list
|
||||
*/
|
||||
@@ -803,6 +805,7 @@ THING *new_item(void);
|
||||
THING *new_thing(struct rogue_state *rs);
|
||||
void end_line(struct rogue_state *rs);
|
||||
int32_t num_packitems(struct rogue_state *rs);
|
||||
int32_t rogue_total(THING *o);
|
||||
|
||||
void runners(struct rogue_state *rs,int);
|
||||
void land(struct rogue_state *rs,int);
|
||||
|
||||
@@ -25,7 +25,7 @@ struct rogue_packitem
|
||||
};
|
||||
struct rogue_player
|
||||
{
|
||||
int32_t gold,hitpoints,strength,level,experience,packsize,dungeonlevel,pad;
|
||||
int32_t gold,hitpoints,strength,level,experience,packsize,dungeonlevel,amulet;
|
||||
struct rogue_packitem roguepack[MAXPACK];
|
||||
};
|
||||
int32_t rogue_replay2(uint8_t *newdata,uint64_t seed,char *keystrokes,int32_t num,struct rogue_player *player,int32_t sleepmillis);
|
||||
|
||||
@@ -1452,6 +1452,7 @@ rs_write_object(struct rogue_state *rs,FILE *savef, THING *o)
|
||||
rs->P.level = pstats.s_lvl;
|
||||
rs->P.experience = pstats.s_exp;
|
||||
rs->P.dungeonlevel = level;
|
||||
rs->P.amulet = amulet;
|
||||
//fprintf(stderr,"%ld gold.%d hp.%d strength.%d/%d level.%d exp.%d %d\n",ftell(savef),purse,max_hp,pstats.s_str,max_stats.s_str,pstats.s_lvl,pstats.s_exp,level);
|
||||
}
|
||||
//fprintf(stderr,"object (%s) x.%d y.%d type.%d pack.(%c:%d)\n",inv_name(o,FALSE),o->_o._o_pos.x,o->_o._o_pos.y,o->_o._o_type,o->_o._o_packch,o->_o._o_packch);
|
||||
|
||||
Reference in New Issue
Block a user