diff scripts/npc-test @ 302:78220c989e6a

Add supporting for flicking between speaking NPCs.
author Simon Cross <hodgestar@gmail.com>
date Fri, 08 Apr 2011 23:27:43 +0200
parents 9e6ff3eb63d6
children fbae2da0c3c0
line wrap: on
line diff
--- a/scripts/npc-test	Fri Apr 08 23:16:11 2011 +0200
+++ b/scripts/npc-test	Fri Apr 08 23:27:43 2011 +0200
@@ -57,8 +57,17 @@
     dsm = DSM(npc_name, game.world, npc.dsm, npc.state)
     print "  Loaded %s." % (npc.dsm)
 
-    my_locals = { "world": dsm.world, "state": dsm.states, "npcs": dsm.world.npcs }
+    def test_switch_to(npc_name):
+        assert npc_name in game.world.npcs
+
+    my_locals = {
+        "world": dsm.world,
+        "state": dsm.states,
+        "npcs": dsm.world.npcs,
+        "switch_to": test_switch_to,
+    }
     my_locals.update(DsmEvent().items)
+
     for state_name, state in dsm.states.items():
         print "  Testing triggers for state %s" % state_name
         for trigger in state.triggers: