From 712dda80fc08ccd00601ec01ceab1c2c721fa819 Mon Sep 17 00:00:00 2001 From: ryo_saeba Date: Thu, 27 Sep 2007 20:57:11 +0000 Subject: [PATCH] Face and anim function tests. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@7274 282e977c-c81d-0410-88c4-b93c2d0d6712 --- test/python | 4 ++++ test/python.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/test/python b/test/python index 65b4d0c0a..b34e6dd13 100644 --- a/test/python +++ b/test/python @@ -137,3 +137,7 @@ arch cobblestones2 x 4 y 4 end +arch campfire +x 4 +y 4 +end diff --git a/test/python.py b/test/python.py index ee6744b11..38c7e0ca5 100644 --- a/test/python.py +++ b/test/python.py @@ -36,6 +36,8 @@ def do_help(): whoami.Say(' - attacktype') whoami.Say(' - players') whoami.Say(' - checkinv') + whoami.Say(' - face') + whoami.Say(' - anim') def do_arch(): archs = Crossfire.GetArchetypes() @@ -348,6 +350,34 @@ def do_checkinv(): else: whoami.Say('Can\'t find %s in your inventory.'%what) +def do_face(): + obj = whoami.Map.ObjectAt(4, 4) + if len(topic) == 1: + whoami.Say('Face is %d'%obj.Face) + return + + face = Crossfire.FindFace(topic[1]) + if face == 0: + whoami.Say('Invalid face') + return + whoami.Say('changing to %s'%topic[1]) + obj.Face = topic[1] + whoami.Say('Face changed') + +def do_anim(): + obj = whoami.Map.ObjectAt(4, 4).Above + if len(topic) == 1: + whoami.Say('Animation is %d'%obj.Anim) + return + + anim = Crossfire.FindAnimation(topic[1]) + if anim == 0: + whoami.Say('Invalid animation') + return + + obj.Anim = (topic[1]) + whoami.Say('Anim changed') + topic = Crossfire.WhatIsMessage().split() #whoami.Say('topic = %s'%topic) #whoami.Say('topic[0] = %s'%topic[0]) @@ -411,5 +441,9 @@ elif topic[0] == 'players': do_players() elif topic[0] == 'checkinv': do_checkinv() +elif topic[0] == 'anim': + do_anim() +elif topic[0] == 'face': + do_face() else: do_help()