Part of patch #1677738: Purple worm (with pythonscript and map), by Mike B.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@8691 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
82661e99cf
commit
d1e9a82abd
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,41 @@
|
|||
import Crossfire
|
||||
import random
|
||||
#This script allows the purple worm to eat players/monsters
|
||||
eatmap = '/planes/purpleworm'
|
||||
eat_x = 6
|
||||
eat_y = 6
|
||||
|
||||
worm = Crossfire.WhoAmI()
|
||||
me = Crossfire.WhoIsOther()
|
||||
r = random.random()
|
||||
|
||||
if (r <= 0.26):
|
||||
if (me.__class__ is Crossfire.Player):
|
||||
isplayer = 1
|
||||
elif (me.Alive == True):
|
||||
isplayer = 0
|
||||
else:
|
||||
isplayer = 2
|
||||
|
||||
if isplayer == 1:
|
||||
me.Map.Print("\nYou are swallowed whole by the %s!" % (worm.Name))
|
||||
map = Crossfire.ReadyMap(eatmap)
|
||||
if map:
|
||||
me.Teleport(map, eat_x, eat_y)
|
||||
else:
|
||||
print "There is no eat map"
|
||||
|
||||
elif isplayer == 0:
|
||||
me.Map.Print("\nThe %s is swallowed whole by the %s!" % (me.Name, worm.Name))
|
||||
|
||||
while (me.Inventory is not None):
|
||||
me.Inventory.InsertInto(worm)
|
||||
|
||||
mexists = Crossfire.WhoIsOther()
|
||||
if mexists:
|
||||
me.Remove()
|
||||
else:
|
||||
worm.Map.Print('doesnt exist')
|
||||
else:
|
||||
me.Map.Print("\nThe %s misses the %s" % (worm.Name, me.Name))
|
||||
|
||||
Loading…
Reference in New Issue