Making the new notification backend part of the build
authorMartin Read <martin@blackswordsonics.com>
Tue, 21 Jan 2014 18:17:10 +0000 (18:17 +0000)
committerMartin Read <martin@blackswordsonics.com>
Tue, 21 Jan 2014 18:17:10 +0000 (18:17 +0000)
Makefile
display-nc.cc
display.hh
victrix-abyssi.hh

index 79c251c..692bad6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # Makefile for Victrix Abyssi
 
-OBJS=combat.o display-nc.o fov.o main.o map.o misc.o monsters.o mon2.o objects.o permobj.o permons.o pmon2.o rng.o sorcery.o u.o
+OBJS=combat.o display-nc.o fov.o main.o map.o misc.o monsters.o mon2.o notify-local-tty.o objects.o permobj.o permons.o pmon2.o rng.o sorcery.o u.o
 
 include dirs.mk
 include features.mk
index 62e9eae..9ca6c31 100644 (file)
@@ -1232,211 +1232,5 @@ void touch_one_screen(Coord c)
     }
 }
 
-/* And now for the API fun that is "moving all print_msg() calls out of the
- * engine code". Which we will do one step at a time. */
-
-void notify_level_gain(void)
-{
-    status_updated = 1;
-    print_msg("You gained a level!\n");
-}
-
-void notify_agility_gain(int amount)
-{
-    status_updated = 1;
-    print_msg("You gained %d Agility.\n", amount);
-}
-
-void notify_body_gain(int amount)
-{
-    status_updated = 1;
-    print_msg("You gained %d Body.\n", amount);
-}
-
-void notify_hp_gain(int amount)
-{
-    status_updated = 1;
-    print_msg("You gained %d hit points.\n", amount);
-}
-
-void notify_player_teleport(void)
-{
-    print_msg("You are whisked away!\n");
-}
-
-
-void notify_player_telefail(void)
-{
-    print_msg("You feel briefly dislocated.\n");
-}
-
-void notify_player_regen(void)
-{
-    print_msg("Your ring pulses soothingly.\n");
-}
-
-void notify_hunger_level(int severity)
-{
-    switch (severity)
-    {
-    case 0:
-    default:
-        break;
-    case 1:
-        print_msg("You are getting quite hungry.\n");
-        break;
-    case 2:
-        print_msg("You are feeling hunger pangs, and will recover\nmore slowly from your injuries.\n");
-        break;
-    }
-}
-
-void notify_leadfoot_recovered(void)
-{
-    print_msg("You shed your feet of lead.\n");
-}
-
-void notify_armourmelt_recovered(void)
-{
-    print_msg("Your armour seems solid once more.\n");
-}
-
-void notify_wither_recovered(void)
-{
-    print_msg("Your limbs straighten.\n");
-}
-
-void notify_protection_lost(void)
-{
-    print_msg("You feel like you are no longer being helped.\n");
-}
-
-void notify_start_lavawalk(void)
-{
-    print_msg("You walk on the lava.\n");
-}
-
-void notify_blocked_lava(void)
-{
-    print_msg("The fierce heat of the molten rock repels you.\n");
-}
-
-void notify_start_waterwalk(void)
-{
-    print_msg("You walk on the water.\n");
-}
-
-void notify_blocked_water(void)
-{
-    print_msg("The idiot who raised you never taught you to swim.\n");
-}
-
-void notify_obj_at(Coord c)
-{
-    print_msg("You see here ");
-    print_obj_name(lvl.obj_at(c));
-    print_msg(".\n");
-}
-
-void debug_move_oob(Coord c)
-{
-    print_msg("NOTICE: Attempted move out of bounds (dest %d, %d)\n", c.y, c.x);
-}
-
-void debug_agility_gain(int amount)
-{
-    print_msg("BUG: Attempt to cause negative agility gain %d\n", amount);
-}
-
-void debug_body_gain(int amount)
-{
-    print_msg("BUG: Attempt to cause negative body gain %d\n", amount);
-}
-
-void notify_swing_bow(void)
-{
-    print_msg("You can't use that weapon in melee!\n");
-}
-
-void notify_cant_go(void)
-{
-    print_msg("You cannot go there.\n");
-}
-
-void notify_wasted_gain(void)
-{
-    print_msg("You feel disappointed.\n");
-}
-
-void debug_bad_monspell(int spell)
-{
-    print_msg("BUG: Attempt by monster to cast bogus/unimplemented spell %d!\n", spell);
-}
-
-void notify_summon_help(int mon, bool success)
-{
-    /* Do the summoning... */
-    print_mon_name(mon, 3);
-    print_msg(" calls for help...\n");
-    if (success)
-    {
-        print_msg("... and gets it.\n");
-    }
-    else
-    {
-        print_msg("... luckily for you, help wasn't listening.\n");
-    }
-}
-
-void notify_mon_disappear(int mon)
-{
-    print_mon_name(mon, 3);
-    print_msg(" vanishes in a puff of smoke.\n");
-}
-
-void notify_start_armourmelt(void)
-{
-    status_updated = 1;
-    print_msg("Your armour seems suddenly no stronger than dust!\n");
-}
-
-void notify_start_leadfoot(void)
-{
-    status_updated = 1;
-    print_msg("Your feet feel like lead!\n");
-}
-
-void notify_start_withering(void)
-{
-    status_updated = 1;
-    print_msg("Your limbs twist and wither!\n");
-}
-
-void notify_necrosmite_fail(void)
-{
-    print_msg("Darkness reaches towards you, but dissolves.\n");
-}
-
-void notify_necrosmite_hit(void)
-{
-    print_msg("Soul-chilling darkness engulfs you!\n");
-}
-
-void notify_moncurse_fail(void)
-{
-    print_msg("A malignant aura surrounds you briefly.\n");
-}
-
-void notify_hellfire_hit(bool resisted)
-{
-    print_msg("The fires of hell %s\n", resisted ? "lightly singe you." : "burn you!");
-}
-
-void notify_monster_cursing(int mon)
-{
-    print_mon_name(mon, 3);
-    print_msg(" points at you and curses horribly.\n");
-}
-
 /* display-nc.cc */
 // vim:cindent
index 6389df4..0a61376 100644 (file)
@@ -54,46 +54,6 @@ extern int map_updated;
 /* "Show the player the terrain only" flag. */
 extern int show_terrain;
 
-/* Notification functions */
-void notify_level_gain(void);
-void notify_agility_gain(int amount);
-void notify_body_gain(int amount);
-void notify_hp_gain(int amount);
-void notify_player_teleport(void);
-void notify_player_telefail(void);
-void notify_player_regen(void);
-void notify_hunger_level(int severity);
-void notify_leadfoot_recovered(void);
-void notify_armourmelt_recovered(void);
-void notify_wither_recovered(void);
-void notify_protection_lost(void);
-void notify_start_lavawalk(void);
-void notify_blocked_lava(void);
-void notify_start_waterwalk(void);
-void notify_blocked_water(void);
-void notify_obj_at(Coord c);
-void notify_swing_bow(void);
-void notify_cant_go(void);
-void notify_wasted_gain(void);
-
-/* Sorcery notifications */
-void notify_summon_help(int mon, bool success);
-void notify_monster_cursing(int mon);
-void notify_mon_disappear(int mon);
-void notify_moncurse_fail(void);
-void notify_start_armourmelt(void);
-void notify_start_withering(void);
-void notify_start_leadfoot(void);
-void notify_necrosmite_fail(void);
-void notify_necrosmite_hit(void);
-void notify_hellfire_hit(bool resisted);
-
-/* Debugging notifications */
-void debug_move_oob(Coord c);
-void debug_body_gain(int amount);
-void debug_agility_gain(int amount);
-void debug_bad_monspell(int spell);
-
 #endif
 
 /* display.hh */
index c861f10..0fdcdde 100644 (file)
@@ -177,6 +177,10 @@ struct Action
 #include "display.hh"
 #endif
 
+#ifndef NOTIFY_HH
+#include "notify.hh"
+#endif
+
 #ifndef MAP_HH
 #include "map.hh"
 #endif