* Attempting to descend while not on stairs will no longer trigger a bug notification.
* Putting on and removing rings is now correctly notified to the player.
* Log is now stored in data directory.
* Title screen centering has been improved.
/* Static funcs */
static void draw_main_menu(void)
{
- mvwprintw(fullscreen_window, 1, 24, "----====< Victrix Abyssi >====----\n");
- mvwprintw(fullscreen_window, 3, 26, "A roguelike game by Martin Read\n");
+ mvwprintw(fullscreen_window, 1, 23, "----====< Victrix Abyssi >====----\n");
+ mvwprintw(fullscreen_window, 3, 25, "A roguelike game by Martin Read\n");
mvwprintw(fullscreen_window, 10, 25, "S)tart new game\n");
mvwprintw(fullscreen_window, 11, 25, "R)esume existing game\n");
mvwprintw(fullscreen_window, 12, 25, "Q)uit\n");
print_help();
break;
case '>':
- act->cmd = GO_DOWN_STAIRS;
+ if (lvl->terrain_at(u.pos) == STAIRS)
+ {
+ act->cmd = GO_DOWN_STAIRS;
+ }
+ else
+ {
+ print_msg("There are no stairs here.\n");
+ }
return;
case '5':
case '.':
mvwprintw(fullscreen_window, 10, 1, "\n");
mvwprintw(fullscreen_window, 11, 1, "\n");
mvwprintw(fullscreen_window, 12, 1, "\n");
- mvwprintw(fullscreen_window, 13, 15, "Welcome, Princess. Remind me of your name?\n");
+ mvwprintw(fullscreen_window, 13, 19, "Welcome, Princess. Remind me of your name?\n");
mvwprintw(fullscreen_window, 14, 1, "\n");
wmove(fullscreen_window, 14, 30);
update_panels();
void log_death(Death d, char const *what)
{
FILE *fp;
- fp = fopen("victrix-abyssi.log", "a");
+ int fd;
+ fd = openat(datadir_fd, "victrix-abyssi.log", O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR);
+ if (fd == -1)
+ {
+ return;
+ }
+ fp = fdopen(fd, "a");
if (fp)
{
switch (d)
}
fprintf(fp, " %s died after %d ticks, with %d XP, on dungeon level %d.\n\n", u.name, game_tick, u.experience, depth);
fflush(fp);
+ fsync(fd);
fclose(fp);
}
+ else
+ {
+ close(fd);
+ }
}
void wrapped_system(char const *cmd)
status_updated = 1;
map_updated = 1;
hard_redraw = 1;
- unlink("victrix-abyssi.sav");
+ int i = unlinkat(datadir_fd, "victrix-abyssi.sav", 0);
+ if (i == -1)
+ {
+ debug_save_unlink_failed();
+ }
return 0;
}
print_msg("Your current weapon seems to have no magic powers to activate.\n");
}
-void notify_armour_equip(void)
+void notify_armour_equip(int obj)
{
- Permobj *pobj = permobjs + objects[u.armour].obj_id;
+ Permobj *pobj = permobjs + objects[obj].obj_id;
if (pobj->flags[0] & POF_NOTIFY_EQUIP)
{
switch (objects[u.armour].obj_id)
void notify_armour_unequip(int obj)
{
+ Permobj *pobj = permobjs + objects[obj].obj_id;
// TODO add unequip messages for NOTIFY_EQUIP armours.
- print_msg("You take off your armour.\n");
+ if (pobj->flags[0] & POF_NOTIFY_EQUIP)
+ {
+ switch (objects[obj].obj_id)
+ {
+ case PO_SET_OF_RIBBONS:
+ if (u.sybaritic())
+ {
+ print_msg("Reluctantly, you peel off the web of ribbons.\n");
+ }
+ else
+ {
+ print_msg("With a sigh of relief you peel off the uncanny web of ribbons.\n");
+ }
+ break;
+ default:
+ print_msg("BUG: object '%s' has POF_NOTIFY_EQUIP defined but no special message written.\n", pobj->name);
+ break;
+ }
+ }
+ else
+ {
+ print_msg("You take off your %s.\n", (pobj->flags[0] & POF_DRESS) ? "dress" : "armour");
+ }
+}
+
+void notify_ring_equip(int obj)
+{
+ print_msg("You put on ");
+ print_obj_name(obj);
+ print_msg(".\n");
+}
+
+void notify_ring_unequip(int obj)
+{
+ print_msg("You remove your ring.\n");
}
void notify_lava_blocks_unequip(void)
print_msg("FATAL: attempt to use unimplemented radiance evaluation order %d\n", order);
}
+void debug_save_unlink_failed(void)
+{
+ print_msg("NOTICE: savefile unlink() failed - are you trying to savescum?\n");
+}
+
/* notify-local-tty.cc */
// vim:cindent
void notify_magic_powerless_ring(void);
void notify_emanate_powerless_armour(void);
void notify_zap_powerless_weapon(void);
-void notify_armour_equip(void);
+void notify_ring_equip(int obj);
+void notify_ring_unequip(int obj);
+void notify_armour_equip(int obj);
void notify_armour_unequip(int obj);
void notify_lava_blocks_unequip(void);
void notify_water_blocks_unequip(void);
void debug_unimplemented_activation(int po);
void debug_unimplemented_break_reaction(int po);
void debug_unimplemented_radiance_order(int order);
+void debug_save_unlink_failed(void);
// Provisional object designs
class Notify_uattkm
}
u.armour = obj;
recalc_defence();
- notify_armour_equip();
+ notify_armour_equip(u.armour);
return Cost_std;
}
return Cost_none;
}
u.ring = obj;
+ notify_ring_equip(u.ring);
recalc_defence();
return Cost_std;
}
Action_cost remove_ring(void)
{
+ int saved_ring = u.ring;
if (u.ring == NO_OBJ)
{
debug_remove_no_ring();
}
u.ring = NO_OBJ;
recalc_defence();
+ notify_ring_unequip(saved_ring);
return Cost_std;
}