Bläddra i källkod

[fixed] Bug fixes, and minor changes to the payment system to include a cancel option, from Hooded Silence

Kevin_Smarts 1 år sedan
förälder
incheckning
8b986b1cae
2 ändrade filer med 18 tillägg och 8 borttagningar
  1. 3 3
      locations/fit.qsrc
  2. 15 5
      locations/shortgs.qsrc

+ 3 - 3
locations/fit.qsrc

@@ -57,13 +57,13 @@ if $ARGS[0] = 'start':
 	'<center>'
 	'<table width="90%" align="center" width="90%" cellspacing="0" cellpadding="0" valign="top">'
 	
-	if money >= 3000:
+	if money >= 3000 or karta + bankDebtLimit => 3000:
 		'<tr><td> <a href="exec: gs ''shortgs'',''payments'', 3000, '''', ''abonement'', 30, ''lesson subscriptions and facilities access'', ''fit'', ''start''">3,000<b> ₽</b> for 30 lessons</a></td>'
 	end
-	if money >= 2250:
+	if money >= 2250 or karta + bankDebtLimit => 2250:
 		'<td> <a href="exec: gs ''shortgs'',''payments'', 2250, '''', ''abonement'', 20, ''lesson subscriptions and facilities access'', ''fit'', ''start''">2,250<b> ₽</b> for 20 lessons</a></td>'
 	end
-	if money >= 1500:
+	if money >= 1500 or karta + bankDebtLimit => 1500:
 		'<td><a href="exec: gs ''shortgs'',''payments'', 1500, '''', ''abonement'', 10, ''lesson subscriptions and facilities access'', ''fit'', ''start''">1,500<b> ₽</b> for 10 lessons</a></td>'
 	end
 	'</tr></table></center>'

+ 15 - 5
locations/shortgs.qsrc

@@ -754,6 +754,7 @@ if $ARGS[0] = 'clothing_state':
 	end
 end
 
+
 ! Author - Hooded Silence
 ! Date created - 26 Aug 22
 ! Payment system - Used to pay for items in various game locations
@@ -807,12 +808,12 @@ if $ARGS[0] = 'payments':
 	*clr
 
 	!Use stock image for the purchase screen?
-
-	if ($pay_method ! 'cash' or $pay_method ! 'card') and pay_value <= money and pay_value <= karta:
+	
+	if ($pay_method ! 'cash' or $pay_method ! 'card') and (pay_value <= money and pay_value <= karta + bankDebtLimit):
 		'How do you want to pay for  the <<$pay_desc>>? <<$pay_cash>> or <<$pay_card>>'
 	elseif ($pay_method = 'cash' or $pay_method = '') and pay_value <= money:
 		'Pay for the <<$pay_desc>> with <<$pay_cash>>?'
-	elseif  ($pay_method = 'card' or $pay_method = '') and pay_value <= karta + bankDebtLimit:
+	elseif ($pay_method = 'card' or $pay_method = '') and pay_value <= karta + bankDebtLimit:
 		'Pay for the <<$pay_desc>> with your <<$pay_card>>?'
 	else
 		'You don''t have enough money in your purse or bank account for this item.'
@@ -820,18 +821,25 @@ if $ARGS[0] = 'payments':
 
 	! clean up all the variables
 
+
+	
+	if $pay_section ! '':
+		act 'Cancel Payment' : gt $pay_section, $pay_act
+	else
+		act 'Cancel Payment' : gt $loc, $loc_arg
+	end
 	killvar 'pay_value'
 	killvar '$pay_method'
 	killvar '$pay_variable'
 	killvar 'pay_quantity'
 	killvar '$pay_desc'
-	killvar '$pay_type'
+	killvar '$pay_type'	
 end
 
 !payment complete
 
 if $ARGS[0] = 'paymentcomplete':
-	*clr
+	*clr & cla
 
 	'Thank you for your custom. Please come again!'
 	*nl
@@ -853,5 +861,7 @@ if $ARGS[0] = 'paymentcomplete':
 	act 'Finish payment' : gt $loc, $loc_arg
 end
 
+
+
 --- shortgs ---------------------------------