Improved look of IPO package system
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@5409 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
1c80406896
commit
1abd8198b4
|
@ -0,0 +1,7 @@
|
||||||
|
ChangeLog for SVN maps trunk directory:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
python/IPO/say.py:
|
||||||
|
Changed code to give different packages different names and faces,
|
||||||
|
and to make packages clearly show they are used after being received.
|
||||||
|
-- Aaron Baugher 2007-02-08
|
||||||
|
|
|
@ -41,7 +41,7 @@ storage_x = 2
|
||||||
storage_y = 2
|
storage_y = 2
|
||||||
|
|
||||||
# Post office sack name (one word without space)
|
# Post office sack name (one word without space)
|
||||||
sackName = 'package'
|
sackNames = [ 'IPO-bag', 'IPO-package', 'IPO-carton' ]
|
||||||
|
|
||||||
import Crossfire
|
import Crossfire
|
||||||
import string
|
import string
|
||||||
|
@ -130,7 +130,7 @@ elif text[0] == 'bag' or text[0] == 'package' or text[0] == 'carton':
|
||||||
if text[0] == 'bag':
|
if text[0] == 'bag':
|
||||||
price = priceBag
|
price = priceBag
|
||||||
max = 5000
|
max = 5000
|
||||||
item = 'r_sack'
|
item = 'bag'
|
||||||
elif text[0] == 'package':
|
elif text[0] == 'package':
|
||||||
price = pricePackage
|
price = pricePackage
|
||||||
max = 50000
|
max = 50000
|
||||||
|
@ -138,11 +138,11 @@ elif text[0] == 'bag' or text[0] == 'package' or text[0] == 'carton':
|
||||||
else:
|
else:
|
||||||
price = priceCarton
|
price = priceCarton
|
||||||
max = 100000
|
max = 100000
|
||||||
item = 'r_sack'
|
item = 'present_box_2'
|
||||||
|
|
||||||
if activator.PayAmount(price*priceFactor):
|
if activator.PayAmount(price*priceFactor):
|
||||||
box = activator.CreateObject(item)
|
box = activator.CreateObject(item)
|
||||||
box.Name = sackName+' T: '+text[1]+' F: '+activatorname
|
box.Name = 'IPO-'+text[0]+' T: '+text[1]+' F: '+activatorname
|
||||||
box.WeightLimit = max
|
box.WeightLimit = max
|
||||||
box.Str = 0
|
box.Str = 0
|
||||||
whoami.Say('Here is your %s'%text[0])
|
whoami.Say('Here is your %s'%text[0])
|
||||||
|
@ -159,6 +159,7 @@ elif text[0] == 'bag' or text[0] == 'package' or text[0] == 'carton':
|
||||||
elif text[0] == 'send':
|
elif text[0] == 'send':
|
||||||
if len(text) == 2:
|
if len(text) == 2:
|
||||||
count = 0
|
count = 0
|
||||||
|
for sackName in sackNames:
|
||||||
inv = activator.CheckInventory(sackName)
|
inv = activator.CheckInventory(sackName)
|
||||||
while inv:
|
while inv:
|
||||||
next = inv.Below
|
next = inv.Below
|
||||||
|
@ -188,11 +189,13 @@ elif text[0] == 'receive':
|
||||||
map = Crossfire.ReadyMap(storage_map)
|
map = Crossfire.ReadyMap(storage_map)
|
||||||
if map:
|
if map:
|
||||||
count = 0
|
count = 0
|
||||||
|
for sackName in sackNames:
|
||||||
item = map.ObjectAt(storage_x, storage_y)
|
item = map.ObjectAt(storage_x, storage_y)
|
||||||
while item:
|
while item:
|
||||||
previous = item.Above
|
previous = item.Above
|
||||||
text2 = string.split(item.Name)
|
text2 = string.split(item.Name)
|
||||||
if len(text2) == 5 and text2[0] == sackName and text2[4] == activatorname:
|
if len(text2) == 5 and text2[0] == sackName and text2[4] == activatorname:
|
||||||
|
item.Name = item.Name+' (used)'
|
||||||
item.InsertInto(activator)
|
item.InsertInto(activator)
|
||||||
count = count+1
|
count = count+1
|
||||||
item = previous
|
item = previous
|
||||||
|
|
Loading…
Reference in New Issue