Improve the 'buy' command, don't show already bought extensions.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@14495 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
419f11cf57
commit
4ec2680733
|
@ -115,29 +115,44 @@ class GuildDues:
|
||||||
"Smithy":200*30000,
|
"Smithy":200*30000,
|
||||||
"Forge":200*25000}
|
"Forge":200*25000}
|
||||||
|
|
||||||
if len(text) == 1:
|
|
||||||
whoami.Say('Buy what extension or desk?\n'
|
|
||||||
+ "Valid items are: \n"+'\n'.join([' - ' + i +': '+ formatted_amount(Items[i]) for i in Items])+'.')
|
|
||||||
return
|
|
||||||
|
|
||||||
# This is the list of cards to buy new desks
|
# This is the list of cards to buy new desks
|
||||||
Cards = ["Stove", "Cauldron", "TanningDesk", "ThaumaturgyDesk", "JewelersBench", "BowyerBench", "Forge"]
|
Cards = ["Stove", "Cauldron", "TanningDesk", "ThaumaturgyDesk", "JewelersBench", "BowyerBench", "Forge"]
|
||||||
mymap=whoami.Map
|
|
||||||
path=mymap.Path
|
mymap = whoami.Map
|
||||||
path=path.replace("mainfloor","")
|
path = mymap.Path
|
||||||
SecondFloor=Crossfire.ReadyMap(path+'secondfloor')
|
path = path.replace("mainfloor", "")
|
||||||
ToolShed=Crossfire.ReadyMap(path+"guild_toolshed")
|
SecondFloor = Crossfire.ReadyMap(path + 'secondfloor')
|
||||||
|
ToolShed = Crossfire.ReadyMap(path + "guild_toolshed")
|
||||||
|
|
||||||
# This is the list of guild extensions, and the coordinates of the activation button
|
# This is the list of guild extensions, and the coordinates of the activation button
|
||||||
Rooms = {
|
Rooms = {
|
||||||
"BBQ":(mymap,40,25),
|
"BBQ": (mymap, 40, 25),
|
||||||
"AlchemyLab":(SecondFloor,22,12),
|
"AlchemyLab": (SecondFloor, 22, 12),
|
||||||
"CrystalRoom":(SecondFloor,22,13),
|
"CrystalRoom": (SecondFloor, 22, 13),
|
||||||
"Tannery":(SecondFloor,22,14),
|
"Tannery": (SecondFloor, 22, 14),
|
||||||
"ThaumaturgyRoom":(SecondFloor,21,13),
|
"ThaumaturgyRoom": (SecondFloor, 21, 13),
|
||||||
"JewelersRoom":(SecondFloor,22,14),
|
"JewelersRoom": (SecondFloor, 22, 14),
|
||||||
"Bowyer":(ToolShed,22,16),
|
"Bowyer": (ToolShed, 22, 16),
|
||||||
"Smithy":(ToolShed,23,16) }
|
"Smithy": (ToolShed, 23, 16) }
|
||||||
|
|
||||||
|
if len(text) == 1:
|
||||||
|
help = "Buy what?\nYou can buy:\n"
|
||||||
|
|
||||||
|
for i in Items:
|
||||||
|
if i in Cards:
|
||||||
|
help += " - " + i + " (card): " + formatted_amount(Items[i]) + "\n"
|
||||||
|
else:
|
||||||
|
Loc = Rooms.get(i)
|
||||||
|
coin = Loc[0].ObjectAt(Loc[1], Loc[2])
|
||||||
|
coin = FindCoin(coin)
|
||||||
|
|
||||||
|
if coin != 0:
|
||||||
|
continue
|
||||||
|
|
||||||
|
help += " - " + i + " (extension): " + formatted_amount(Items[i]) + "\n"
|
||||||
|
|
||||||
|
whoami.Say(help)
|
||||||
|
return
|
||||||
|
|
||||||
item = text[1]
|
item = text[1]
|
||||||
if not item in Items.keys():
|
if not item in Items.keys():
|
||||||
|
|
Loading…
Reference in New Issue