From 0d98319f8e315fed45513a9f4eb465fa0e677729 Mon Sep 17 00:00:00 2001 From: ryo_saeba Date: Sat, 14 Apr 2007 18:54:43 +0000 Subject: [PATCH] Python tests. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@6017 282e977c-c81d-0410-88c4-b93c2d0d6712 --- test/python | 3 +++ test/python.py | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/test/python b/test/python index 9fe329520..65b4d0c0a 100644 --- a/test/python +++ b/test/python @@ -66,6 +66,9 @@ y 2 arch event_say title Python slaying /test/python.py +msg +Message de test +endmsg end arch event_timer title Python diff --git a/test/python.py b/test/python.py index 7c33c5db4..1783b9891 100644 --- a/test/python.py +++ b/test/python.py @@ -31,6 +31,8 @@ def do_help(): whoami.Say(' - friendlylist') whoami.Say(' - create') whoami.Say(' - directory') + whoami.Say(' - event') + whoami.Say(' - light') def do_arch(): archs = Crossfire.GetArchetypes() @@ -222,6 +224,8 @@ def do_const(): whoami.Say("%s => %d"%(Crossfire.DirectionName[Crossfire.Direction.NORTH],Crossfire.Direction.NORTH)) whoami.Say("Player type => %d"%Crossfire.Type.PLAYER) whoami.Say("Move Fly High => %d"%Crossfire.Move.FLY_HIGH) + whoami.Say("MessageFlag NDI_BLUE => %d"%Crossfire.MessageFlag.NDI_BLUE) + whoami.Say("CostFlag F_NO_BARGAIN => %d"%Crossfire.CostFlag.NOBARGAIN) def dump_move(title, move): moves = [ @@ -304,6 +308,17 @@ def do_directory(): whoami.Say('data = %s'%Crossfire.DataDirectory()); whoami.Say('scriptname = %s'%Crossfire.ScriptName()); +def do_event(): + whoami.Say('event title = %s' %Crossfire.WhatIsEvent().Title) + whoami.Say('event slaying = %s' %Crossfire.WhatIsEvent().Slaying) + whoami.Say('event msg = %s' %Crossfire.WhatIsEvent().Message) + +def do_light(): + whoami.Say('current light: %d'%whoami.Map.Light) + if (len(topic) > 1): + chg = int(topic[1]) + whoami.Map.ChangeLight(chg) + whoami.Say('new light: %d'%whoami.Map.Light) topic = Crossfire.WhatIsMessage().split() #whoami.Say('topic = %s'%topic) @@ -358,5 +373,9 @@ elif topic[0] == 'create': do_create() elif topic[0] == 'directory': do_directory() +elif topic[0] == 'event': + do_event() +elif topic[0] == 'light': + do_light() else: do_help()