Pickup event test.

git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@5670 282e977c-c81d-0410-88c4-b93c2d0d6712
master
ryo_saeba 2007-03-04 10:49:01 +00:00
parent c71facbe1a
commit a6b25f609b
3 changed files with 30 additions and 0 deletions

View File

@ -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

View File

@ -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()

View File

@ -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')