Adjust test script to new types.

git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13591 282e977c-c81d-0410-88c4-b93c2d0d6712
master
ryo_saeba 2010-08-14 07:44:59 +00:00
parent 793ef82b08
commit 8cf0bd1684
1 changed files with 15 additions and 16 deletions

View File

@ -354,30 +354,29 @@ def do_checkinv():
def do_face(): def do_face():
obj = whoami.Map.ObjectAt(4, 4) obj = whoami.Map.ObjectAt(4, 4)
if len(topic) == 1: if len(topic) == 1:
whoami.Say('Face is %d'%obj.Face) whoami.Say('Face is %s'%obj.Face)
return return
face = Crossfire.FindFace(topic[1]) face = topic[1]
if face == 0:
whoami.Say('Invalid face') try:
return obj.Face = face
whoami.Say('changing to %s'%topic[1]) whoami.Say('Face changed to %s'%face)
obj.Face = topic[1] except:
whoami.Say('Face changed') whoami.Say('Invalid face %s'%face)
def do_anim(): def do_anim():
obj = whoami.Map.ObjectAt(4, 4).Above obj = whoami.Map.ObjectAt(4, 4).Above
if len(topic) == 1: if len(topic) == 1:
whoami.Say('Animation is %d'%obj.Anim) whoami.Say('Animation is %s'%obj.Anim)
return return
anim = Crossfire.FindAnimation(topic[1]) anim = topic[1]
if anim == 0: try:
whoami.Say('Invalid animation') obj.Anim = anim
return whoami.Say('Animation changed to %s'%anim)
except:
obj.Anim = (topic[1]) whoami.Say('Invalid animation %s'%anim)
whoami.Say('Anim changed')
def do_hook(): def do_hook():
item = whoami.Map.CreateObject('food', 0, 0) item = whoami.Map.CreateObject('food', 0, 0)