Bladeren bron

:recycle: update bank and atm to add a 5000 rubles overdraft to the bank account.

mjsmagalhaes 9 jaren geleden
bovenliggende
commit
21dd0c7193
5 gewijzigde bestanden met toevoegingen van 65 en 20 verwijderingen
  1. 6 0
      MakeAndRun_QSP.bat
  2. 21 5
      locations/bank
  3. 3 0
      locations/loadg
  4. 28 14
      locations/shop
  5. 7 1
      locations/stat

+ 6 - 0
MakeAndRun_QSP.bat

@@ -0,0 +1,6 @@
+:: if you dont want to copy the glife.qsp anywhere just comment out (::) the cp glife.qsp ..\GL_ECV
+
+python -3 txtmerge.py locations glife.txt
+txt2gam.exe glife.txt glife.qsp
+cp glife.qsp ..\GL_ECV
+..\QSP\qspgui.exe ..\GL_ECV\glife.qsp

+ 21 - 5
locations/bank

@@ -11,7 +11,17 @@ if $ARGS[0] = 'start':
 	'<center><b><font color="maroon">Bank</font></b></center>'
 	'<center><img src="images/etogame/bank.jpg"></center>'
 
-	if karta > 0:'In the bank <<karta>> rubles'
+	if bankAccount = 0:
+		'Do you want to open your account?'
+	else
+		if karta >= 0:
+			'You have <<karta>> rubles in your account.'
+			'You have an approved credit of <font color="blue"><<bankDebtLimit>></font>!'
+		else
+			'You hava a debt of <font color="red"><<-1 * karta>></font> rubles.'
+			'You have an approved credit of <font color="blue"><<bankDebtLimit + karta>></font>!'
+		end
+	end
 
 	if BankPapper = 1 and dayBankPapper = daystart:
 		act 'Give documents':
@@ -36,25 +46,31 @@ if $ARGS[0] = 'start':
 			else
 				karta += kartaIN
 				money -= kartaIN
-				'You put on the account <<kartaIN>> rubles, now on your account <<karta>> rubles.'
+				
+				if bankAccount = 0: 
+					bankAccount = 1
+					bankDebtLimit = 5000
+				end
+				
+				'<br>You put on the account <<kartaIN>> rubles, now on your account <<karta>> rubles.'
 			end
 
 			act 'Move away':gt 'bank', 'start'
 		end
 	end
 
-	if karta > 0:
+	if karta + bankDebtLimit > 0:
 		act 'Withdraw money':
 			cla
 			minut += 5
 			kartaOUT = input ("How much do you want to withdraw from account?")
 
-			if kartaOUT <= 0 or kartaOUT > karta:
+			if kartaOUT <= 0 or kartaOUT > karta + bankDebtLimit:
 				'Not correct operation.'
 			else
 				karta -= kartaOUT
 				money += kartaOUT
-				'You debited <<kartaOUT>> rubles, now on your account <<karta>> rubles.'
+				'<br>You debited <<kartaOUT>> rubles, now on your account <<karta>> rubles.'
 			end
 
 			act 'Move away':gt 'bank', 'start'

+ 3 - 0
locations/loadg

@@ -17,6 +17,9 @@ gs 'BanSexType'
 if vshrink = 0 and vshrinkdays = 0 and ashrink = 0 and ashrinkdays = 0:vshrink = 1 & vshrinkdays = 6 & ashrink = 1 & ashrinkdays = 3
 
 
+if bankAccount = 0 and bankDebtLimit = 0: bankDebtLimit = 5000
+if bankAccount = 0 and karta > 0: bankAccount = 1
+
 if menoage = 0:
 	menoage = rand(40,50)
 	temprand = rand(0,10)

+ 28 - 14
locations/shop

@@ -138,23 +138,37 @@ if $shoplocation = 'ATM':
 	'<center><b><font color="maroon">ATM</font></b></center>'
 	'<center><img src="images/bank/atm.jpg"></center>'
 	
-	if karta > 0:
-		act 'Withdraw money from the ATM':
-			minut += 5
-			kartaOUT = input ("How much money you want to withdraw?")
-
-			if kartaOUT <= 0 or kartaOUT > karta:
-				'<br>Invalid operation.'
-			else
-				karta -= kartaOUT
-				money += kartaOUT
-				'<br>You withdraw <<kartaOUT>> rubles. You have <<karta>> rubles left in your bank account.'
+	if bankAccount = 1:
+		if karta >= 0:
+			'You have <<karta>> rubles in your account.'
+			'You have an approved credit of <font color="blue"><<bankDebtLimit>></font> rubles!'
+		else
+			'You hava a debt of <font color="red"><<-1 * karta>></font> rubles.'
+			'You have an approved credit of <font color="blue"><<bankDebtLimit + karta>></font> rubles!'
+		end
+		
+		if karta + bankDebtLimit > 0:
+			act 'Withdraw money from the ATM':
+				cla
+				minut += 5
+				kartaOUT = input ("How much money you want to withdraw?")
+
+				if kartaOUT <= 0 or kartaOUT > karta + bankDebtLimit:
+					'<br>Invalid operation.'
+				else
+					karta -= kartaOUT
+					money += kartaOUT
+					'<br>You withdraw <<kartaOUT>> rubles. You have <<karta>> rubles left in your bank account.'
+				end
+				
+				gs 'stat'
+				act 'Move away': gt 'shop'
 			end
-			
-			gs 'stat'
+		else
+			'You don''t have any money left in the bank.'
 		end
 	else
-		'You do not have any money in the bank.'
+		'You don''t have a bank account yet!'
 	end
 	
 	act 'Move away':gt 'shop', 'start'

+ 7 - 1
locations/stat

@@ -708,7 +708,13 @@ if hour >= 24:
 
 	!MJ: Add some (daily) interest to the bank account. 
 	!Not very realistic but wont make anyone too rich.
-	karta += (karta/1000)
+	
+	if karta > 0:
+		karta += (karta/1000)
+	else
+		! karta is already negative ...
+		karta += ((3*karta/1000) - 1)
+	end
 	
 	if hour >= 24:jump 'loop'
 end