allow another monster + refactor
This commit is contained in:
parent
209e100be7
commit
192119eea2
19
w/w.c
19
w/w.c
|
@ -482,6 +482,18 @@ void freerounds()
|
|||
currentround = NULL;
|
||||
}
|
||||
|
||||
void gotomonster()
|
||||
{
|
||||
int index = dice() == 6 ? 1 : 0;
|
||||
memcpy(&state.monster, &(monsters[index]), sizeof(Character));
|
||||
state.screen = SC_MONSTER;
|
||||
}
|
||||
|
||||
void gotostation()
|
||||
{
|
||||
state.screen = SC_STATION;
|
||||
}
|
||||
|
||||
void update(char* command)
|
||||
{
|
||||
char c = command[0];
|
||||
|
@ -496,8 +508,7 @@ void update(char* command)
|
|||
forward();
|
||||
if ( (x != state.position.x || y != state.position.y) && dice() > 4)
|
||||
{
|
||||
memcpy(&state.monster, &(monsters[0]), sizeof(Character));
|
||||
state.screen = SC_MONSTER;
|
||||
gotomonster();
|
||||
}
|
||||
break;
|
||||
case CMD_RIGHT:
|
||||
|
@ -509,7 +520,7 @@ void update(char* command)
|
|||
case CMD_BACKTOSTATION:
|
||||
if (currentchar() == TILE_START)
|
||||
{
|
||||
state.screen = SC_STATION;
|
||||
gotostation();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -529,7 +540,7 @@ void update(char* command)
|
|||
if (strlen(command) > 0)
|
||||
{
|
||||
createhero(command);
|
||||
state.screen = SC_STATION;
|
||||
gotostation();
|
||||
}
|
||||
}
|
||||
else if (state.screen == SC_STATION)
|
||||
|
|
Loading…
Reference in New Issue