diff --git a/test/python b/test/python index 6bb21e4aa..0f3cae3d6 100644 --- a/test/python +++ b/test/python @@ -102,6 +102,14 @@ arch cobblestones2 x 4 y 2 end +arch apple +x 4 +y 2 +arch event_pickup +title Python +slaying /test/python_pickup.py +end +end arch cobblestones2 x 4 y 3 diff --git a/test/python.py b/test/python.py index d30b1efeb..605229b0d 100644 --- a/test/python.py +++ b/test/python.py @@ -26,6 +26,7 @@ def do_help(): whoami.Say(' - bed') whoami.Say(' - readkey') whoami.Say(' - writekey') + whoami.Say(' - speed') def do_arch(): archs = Crossfire.GetArchetypes() @@ -226,6 +227,11 @@ def do_writekey(): whoami.Say('writekey returned %d'%who.WriteKey(topic[1], val, int(topic[2]))) +def do_speed(): + whoami.Say('Your speed is %f and your speed_left %f'%(who.Speed, who.SpeedLeft)) +# who.Speed = 0.2 + who.SpeedLeft = -50 + whoami.Say('Changed your speed, now %f and %f'%(who.Speed, who.SpeedLeft)) topic = Crossfire.WhatIsMessage().split() #whoami.Say('topic = %s'%topic) @@ -270,5 +276,7 @@ elif topic[0] == 'readkey': do_readkey() elif topic[0] == 'writekey': do_writekey() +elif topic[0] == 'speed': + do_speed() else: do_help() diff --git a/test/python_pickup.py b/test/python_pickup.py new file mode 100644 index 000000000..4856d0c85 --- /dev/null +++ b/test/python_pickup.py @@ -0,0 +1,14 @@ +import Crossfire + +Crossfire.SetReturnValue( 1 ) + +whoami = Crossfire.WhoAmI() +who = Crossfire.WhoIsActivator() +where = Crossfire.WhoIsOther() + +whoami.Say("i'm %s pickup by %s"%(whoami.Name, who.Name)) +if (where) : + whoami.Say("i'm about to be put into %s"%where.Name) +else: + whoami.Say('put nowhere') +