1
0
Переглянути джерело

[update] removed useless if else branches from pav_pharmacy
[added] update to lact_bp with new function to be used in the future. Breast pump array to store svetas breast pumps and breast pump locations.

sandra_schulz 3 роки тому
батько
коміт
a2cdc9a49b
2 змінених файлів з 25 додано та 13 видалено
  1. 21 1
      locations/lact_bp.qsrc
  2. 4 12
      locations/pav_pharmacy.qsrc

+ 21 - 1
locations/lact_bp.qsrc

@@ -56,6 +56,26 @@
 !!	umbc_i
 !!	usbc_i
 !!	vmb_i
+!!	bpID_arr['index'] : breast pump id. Starts at 0, with every purchased breast pump the id will be added
+!!	bpType_arr['index'] : breast pump type. 0 = 'manual_single', 1 = 'electric_single', 2 ='electric_dual'
+!!	bpLocID_arr['index'] : 0 = lost, 1 = in svetas hand... same as bottle locations
+!!	bpbID1_arr['index'] : index of milk bottle array.
+!!	bpbID2_arr['index'] : only used for dual pump, index for milk bottle array. cannot be the same like breastpump_arr['bottle_id_1'].
+
+!!	when ever sveta buys a new breastpump, it has to be added to the breast pump array.
+if $ARGS[0] = 'build_bp':
+	!!	ARGS[1] = type
+	!!	ARGS[2] = location_id
+	!!	usage func('lact_bp', 'build_bp', 'breast pump type', 'location id')
+	!!	returns the new bottle ID
+	bp_i = arrsize('bpID_arr')
+	bpID_arr[bp_i] = bp_i
+	bpType_arr[bp_i] = ARGS[1]
+	bpLocID_arr[bp_i] = ARGS[2]
+	bpbID1_arr[bp_i] = ''
+	bpbID2_arr[bp_i] = ''
+	result = bp_i
+end
 
 !!	view milk bottles function
 if $ARGS[0] = 'view_milk_bottles':
@@ -292,7 +312,7 @@ if $ARGS[0] = 'useable_mbottle_count':
 end
 
 !!	bp_milking - breast pump milking
-!!	use href="exec:gt ''lact_bp'',''bp_milking''"
+!!	use href="exec:gt ''lact_bp'',''bp_milking''" or gt 'lact_bp','bp_milking'
 
 if $ARGS[0] = 'bp_milking':
 	pumptime = 0

+ 4 - 12
locations/pav_pharmacy.qsrc

@@ -95,23 +95,15 @@ if $ARGS[0] = 'start' or $message ! '':
 		*P FUNC ('$stock_item', 30, 'Lip balm', 127, 'lipbalm', 'pav_pharmacy', 'start')
 		*P FUNC ('$stock_item', 12, 'Weight loss pill', 248, 'fatdel', 'pav_pharmacy', 'start')
 		*P FUNC ('$stock_item', 20, 'Tampons', 200, 'tampon', 'pav_pharmacy', 'start')
-			*P FUNC ('$stock_item', 20, 'Sanitary napkins', 100, 'sanpad', 'pav_pharmacy', 'start')
-		if klisma > 0:
-			*P FUNC ('$single_stock_item', 1, 'Enema kit', 1250, 'klisma', 'pav_pharmacy', 'start')
-		else
-			*P FUNC ('$single_stock_item', 1, 'Enema kit', 1250, 'klisma', 'pav_pharmacy', 'start')
-		end
-		if breastpump > 0:
-			*P FUNC ('$single_stock_item', 1, 'Breast pump', 2500, 'breastpump', 'pav_pharmacy', 'start')
-		else
-			*P FUNC ('$single_stock_item', 1, 'Breast pump', 2500, 'breastpump', 'pav_pharmacy', 'start')
-		end
+		*P FUNC ('$stock_item', 20, 'Sanitary napkins', 100, 'sanpad', 'pav_pharmacy', 'start')
+		*P FUNC ('$single_stock_item', 1, 'Enema kit', 1250, 'klisma', 'pav_pharmacy', 'start')
+		*P FUNC ('$single_stock_item', 1, 'Breast pump', 2500, 'breastpump', 'pav_pharmacy', 'start')
 		*P FUNC ('$stock_item', 3, 'Breastmilk bottle S', 930, 'bpbottles', 'pav_pharmacy', 'start')
 		*P FUNC ('$stock_item', 2, 'Breastmilk bottle M', 930, 'bpbottlem', 'pav_pharmacy', 'start')
 		if pcs_knows_nipplecream = 1:
 			*P FUNC ('$stock_item', 20, 'Nipplebalm', 600, 'bpnipplebalm', 'pav_pharmacy', 'start')
 		end
-		if KandidNapr = 1: *P FUNC ('$single_stock_item', 1, 'Antifungal medication', 1050, 'Kandidoz', 'pav_pharmacy', 'start')
+		*P FUNC ('$single_stock_item', 1, 'Antifungal medication', 1050, 'Kandidoz', 'pav_pharmacy', 'start')
 		*P '</table></center>'
 	end
 end