From e9217fa751a69786ba35f9016c224c26480f6afa Mon Sep 17 00:00:00 2001 From: partmedia Date: Sun, 4 Aug 2013 12:56:15 +0000 Subject: [PATCH] Fix checking by adding template to IPO storage. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@18886 282e977c-c81d-0410-88c4-b93c2d0d6712 --- planes/IPO_storage | 34 ++++++++++++++++++++++++++++++---- python/IPO/banksay.py | 27 +++++++++++++-------------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/planes/IPO_storage b/planes/IPO_storage index 1c98c574f..5b19e5c2c 100644 --- a/planes/IPO_storage +++ b/planes/IPO_storage @@ -1,14 +1,14 @@ arch map -name IPO storage room +name IPO Storage Room difficulty 1 -region scorn -width 5 +region creation +width 6 height 5 enter_x 2 enter_y 2 msg Created: 2005-09-29 -Modified: 2008-09-20 Rick Tanner +Modified: 2013-08-04 Kevin Zheng endmsg end arch grass @@ -134,3 +134,29 @@ arch grass x 4 y 4 end +arch checkbook +name check book +race gold and jewels +msg +This is your check book. Don't let your identity be stolen! +endmsg +x 5 +type 122 +value 0 +identified 1 +arch bankcard +name blank check +name_pl blank checks +msg +Pay to the order of: +endmsg +nrof 100 +value 0 +weight 1 +identified 1 +arch event_drop +title Python +slaying /python/IPO/checks.py +end +end +end diff --git a/python/IPO/banksay.py b/python/IPO/banksay.py index cabe93c28..a14eb5096 100644 --- a/python/IPO/banksay.py +++ b/python/IPO/banksay.py @@ -570,28 +570,27 @@ def cmd_checks(): bank.deposit(activatorname, 100) return - # Create an IPO package but don't mail it until we're ready. - package = activator.Map.CreateObject('package', 1, 1) - package.Name = "IPO-package F: The-Imperial-Bank-of-Skud T: %s" \ - % activator.Name + # Create a check based on a template in the IPO storage map. + checkbook = mailmap.ObjectAt(5, 0) - # Create a check based on a template in the bank map. - check = mailmap.ObjectAt(int(5), int(0)) - - if check is None: + if checkbook is None: whoami.Say("Hmm... I can't seem find my checkbook press... " \ "Your payment has been refunded.") bank.deposit(activatorname, 100) return - # Mail the package. + # Create and mail an IPO package to the player. + package = activator.Map.CreateObject('package', 1, 1) + package.Name = "IPO-package F: The-Imperial-Bank-of-Skud T: %s" \ + % activator.Name + package.Teleport(mailmap, 2, 2) - check.Name = str(activator.Name + "'s Checkbook") - cheques = check.CheckArchInventory('bankcard') - cheques.Name = str(activator.Name + "'s Check") - cheques.NamePl = str(activator.Name + "'s Checks") - chequenew = check.InsertInto(package) + checkbook.Name = activator.Name + "'s Checkbook" + checks = checkbook.CheckArchInventory('bankcard') + checks.Name = activator.Name + "'s Check" + checks.NamePl = activator.Name + "'s Checks" + chequenew = checkbook.InsertInto(package) message = "Your checks have been mailed. Thank you!" else: