소스 검색

[added] generalized discount functionality through the display loop functions

f95Lok 2 주 전
부모
커밋
3d2f0ef982

+ 3 - 1
locations/bras.qsrc

@@ -208,6 +208,7 @@ if $ARGS[0] = 'view_bra_item':
 	!! ARGS 1 = action type (wardrobe, bathroom, shop)
 	!! ARGS 2 - bra type
 	!! ARGS 3 - bra index
+	!! ARGS 4 - price modifier (0-100, taken as %) {OPTIONAL}
 
 	cla
 	'<center><img src="<<FUNC(''$bra_image'',  $ARGS[2], ARGS[3])>>"></center>'
@@ -224,7 +225,7 @@ if $ARGS[0] = 'view_bra_item':
 			'You already own this item.'
 			act 'Leave': gt $loc, $loc_arg
 		else
-			price = BraPrice
+			price = BraPrice + (BraPrice * ARGS[4]) / 100
 			'Price: <<BraPrice>> <b>₽</b>'
 			act 'Leave': gt $loc, $loc_arg
 			if money >= price:
@@ -253,6 +254,7 @@ if $ARGS[0] = 'view_bra_item':
 				else
 					'You do not own the matching panties, you can buy this bra and them as a set.'
 					price_set = BraPrice*18/10
+					price_set += (price_set * ARGS[4]) / 100
 					'Price for set: <<price_set>> <b>₽</b>'
 					if money >= price_set:
 						act 'Buy set (cash)':

+ 2 - 0
locations/clothing.qsrc

@@ -1471,6 +1471,7 @@ if $ARGS[0] = 'view_clothing_item':
 	!! ARGS 1 - action type (wardrobe, shop, sell, resize)
 	!! ARGS 2 - clothing type
 	!! ARGS 3 - clothing index
+	!! ARGS 4 - price modifier (0-100, taken as %) {OPTIONAL}
 
 	$swimwear_description = ''
 
@@ -1542,6 +1543,7 @@ if $ARGS[0] = 'view_clothing_item':
 				price = (CloPrice * ((5 * CloQuality) + 100) / 100) * 1000 / (1250 - Clothingstock[ARGS[3]]) * 3 / 2
 				price = price / 50 * 50
 			end
+			price += (ClorPrice * ARGS[4]) / 100
 			'Price: <<price>> <b>₽</b>'
 			act 'Leave': gt $loc, $loc_arg
 			if CloInhibit > pcs_inhib:

+ 2 - 1
locations/coats.qsrc

@@ -144,6 +144,7 @@ if $ARGS[0] = 'view_coat_item':
 	!! ARGS 1 = action type (draw, shop)
 	!! ARGS 2 - coat type
 	!! ARGS 3 - coat index
+	!! ARGS 4 - price modifier (0-100, taken as %) {OPTIONAL}
 
 	cla
 	'<center><img src="<<FUNC(''$coat_image'',  $ARGS[2], ARGS[3])>>"></center>'
@@ -156,7 +157,7 @@ if $ARGS[0] = 'view_coat_item':
 			'You already own this item.'
 			act 'Leave': gt $loc, $loc_arg
 		else
-			price = CoatPrice
+			price = CoatPrice + (CoatPrice * ARGS[4]) / 100
 			'Price: <<CoatPrice>> <b>₽</b>'
 			act 'Leave': gt $loc, $loc_arg
 			if money >= price:

+ 3 - 1
locations/panties.qsrc

@@ -209,6 +209,7 @@ if $ARGS[0] = 'view_panty_item':
 	!! ARGS 1 = action type (draw, shop)
 	!! ARGS 2 - panty type
 	!! ARGS 3 - panty index
+	!! ARGS 4 - price modifier (0-100, taken as %) {OPTIONAL}
 	
 	cla
 	'<center><img src="<<FUNC(''$panty_image'',  $ARGS[2], ARGS[3])>>"></center>'
@@ -225,7 +226,7 @@ if $ARGS[0] = 'view_panty_item':
 			'You already own this item.'
 			act 'Leave': gt $loc, $loc_arg
 		else
-			price = PanPrice
+			price = PanPrice + (PanPrice * ARGS[4]) / 100
 			'Price: <<PanPrice>> <b>₽</b>'
 			act 'Leave': gt $loc, $loc_arg
 			if money >= price:
@@ -254,6 +255,7 @@ if $ARGS[0] = 'view_panty_item':
 				else
 					'You do not own the matching bra, you can buy it and these panties together as a set.'
 					price_set = PanPrice*18/10
+					price_set += (price_set * ARGS[4]) / 100
 					'Price for set: <<price_set>> <b>₽</b>'
 					if money >= price_set:
 						act 'Buy set (cash)':

+ 2 - 1
locations/piercing_management.qsrc

@@ -143,6 +143,7 @@ end
 ! [1] - action type
 ! [2] - slot
 ! [3] - index
+! [4] - price modifier (0-100, taken as a %)
 if $ARGS[0] = 'view_item':
 	msg 'in item'
 	gs 'piercing_attributes', $ARGS[2], ARGS[3]
@@ -155,7 +156,7 @@ if $ARGS[0] = 'view_item':
 			act 'Return': gt $loc, $loc_arg
 
 		else
-			price = PirPrice
+			price = PirPrice + (PirPrice * ARGS[4]) / 100
 			if pcs_piercings[$ARGS[2]] = 0:
 				price += PirFirst
 				if max(money, karta) < price:

+ 2 - 1
locations/purses.qsrc

@@ -149,6 +149,7 @@ if $ARGS[0] = 'view_purse_item':
 	!! ARGS 1 = action type (home, shop)
 	!! ARGS 2 - purse type
 	!! ARGS 3 - purse index
+	!! ARGS 4 - price modifier (0-100, taken as %) {OPTIONAL}
 
 	cla
 	'<center><img src="<<FUNC(''$purse_image'',  $ARGS[2], ARGS[3])>>"></center>'
@@ -161,7 +162,7 @@ if $ARGS[0] = 'view_purse_item':
 			'You already own this purse.'
 			act 'Leave': gt $loc, $loc_arg
 		else
-			price = PursePrice
+			price = PursePrice + (PursePrice * ARGS[4]) / 100
 			'Price: <<PursePrice>> <b>₽</b>'
 			act 'Leave': gt $loc, $loc_arg
 			if money >= price:

+ 2 - 0
locations/shoes.qsrc

@@ -305,6 +305,7 @@ if $ARGS[0] = 'view_shoe_item':
 	!! ARGS 1 = action type (wardrobe, shop, sell)
 	!! ARGS 2 - shoes type
 	!! ARGS 3 - shoes index
+	!! ARGS 4 - price modifier (0-100, taken as %) {OPTIONAL}
 
 	cla
 	'<center><img src="<<FUNC(''$shoe_image'', $ARGS[2], ARGS[3])>>"></center>'
@@ -327,6 +328,7 @@ if $ARGS[0] = 'view_shoe_item':
 		else
 			price = (ShoPrice * ((5 * ShoQuality) + 100) / 100) * 1000 / (1250 - Clothingstock[ARGS[3]]) * 3 / 2
 			price = price / 50 * 50
+			price += (price * ARGS[4]) / 100
 			'Price: <<price>> <b>₽</b>'
 			act 'Leave': gt $loc, $loc_arg
 			if money < price and karta < price:

+ 28 - 9
locations/shop_utils.qsrc

@@ -10,7 +10,7 @@ if $ARGS[0] = 'shop':
 
 			if (clothingfilter['quality'] = 0 and CloQuality = shop_display['clo_i']) or (clothingfilter['inhibition'] = 0 and CloInhibit = shop_display['clo_i']) or clothingfilter['number'] = 0:
 				if clothingfilter['inc'] = 1 and clothingfilter['only'] = 1:
-					$result = '<a href="exec: gt ''clothing'', ''view_clothing_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
+					$result = '<a href="exec: gt ''clothing'', ''view_clothing_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>, <<shop_display[''price_modifier'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
 				end
 			end
 		end
@@ -22,7 +22,7 @@ if $ARGS[0] = 'shop':
 
 			if (Shofilter['quality'] = 0 and ShoQuality = shop_display['clo_i']) or Shofilter['number'] = 0:
 				if Shofilter['inc'] = 1 and Shofilter['only'] = 1:
-					$result = '<a href="exec: gt ''shoes'', ''view_shoe_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
+					$result = '<a href="exec: gt ''shoes'', ''view_shoe_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>, <<shop_display[''price_modifier'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
 				end
 			end
 		end
@@ -32,7 +32,7 @@ if $ARGS[0] = 'shop':
 			gs 'underwear_attributes', $shop_display['variable'], shop_display['i']
 
 			if (clothingfilter['quality'] = 0 and BraQuality = shop_display['clo_i']) or clothingfilter['number'] = 0:
-				$result = '<a href="exec: gt ''bras'', ''view_bra_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
+				$result = '<a href="exec: gt ''bras'', ''view_bra_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>, <<shop_display[''price_modifier'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
 			end
 		end
 
@@ -41,7 +41,7 @@ if $ARGS[0] = 'shop':
 			gs 'underwear_attributes', $shop_display['variable'], shop_display['i']
 
 			if (clothingfilter['quality'] = 0 and PanQuality = shop_display['clo_i']) or clothingfilter['number'] = 0:
-				$result = '<a href="exec: gt ''panties'', ''view_panty_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
+				$result = '<a href="exec: gt ''panties'', ''view_panty_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>, <<shop_display[''price_modifier'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
 			end
 		end
 
@@ -50,22 +50,22 @@ if $ARGS[0] = 'shop':
 			gs 'underwear_attributes', $shop_display['variable'], shop_display['i']
 
 			if (clothingfilter['quality'] = 0 and BraQuality = shop_display['clo_i']) or clothingfilter['number'] = 0:
-				$result = '<a href="exec: gt ''underwear_bodysuits'', ''view_bodysuit_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
+				$result = '<a href="exec: gt ''underwear_bodysuits'', ''view_bodysuit_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>, <<shop_display[''price_modifier'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
 			end
 		end
 
 	elseif $ARGS[1] = 'coats':
 		if dyneval('result = <<$shop_display[''variable'']>>_coats[shop_display[''i'']]') = 0:
-			$result = '<a href="exec: gt ''coats'', ''view_coat_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
+			$result = '<a href="exec: gt ''coats'', ''view_coat_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>, <<shop_display[''price_modifier'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
 		end
 
 	elseif $ARGS[1] = 'purses':
 		if dyneval('result = <<$shop_display[''variable'']>>_purses[shop_display[''i'']]') = 0:
-			$result = '<a href="exec: gt ''purses'', ''view_purse_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
+			$result = '<a href="exec: gt ''purses'', ''view_purse_item'', ''shop'', ''<<$shop_display[''variable'']>>'', <<shop_display[''i'']>>, <<shop_display[''price_modifier'']>>"><img height="250" src="<<$shop_display[''item_img_path'']>>/<<shop_display[''i'']>>.jpg"></a>'
 		end
 
 	elseif $ARGS[1] = 'func_managed':
-		$result = '<a href="exec: gt ''<<$shop_display[''main_func_name'']>>'', ''view_item'', ''shop'', ''<<$shop_display[''item_type'']>>'', <<shop_display[''i'']>>"><img height="250" src="<<func($shop_display[''main_func_name''], $shop_display[''img_func_name''], shop_display[''i''])>>"></a>'
+		$result = '<a href="exec: gt ''<<$shop_display[''main_func_name'']>>'', ''view_item'', ''shop'', ''<<$shop_display[''item_type'']>>'', <<shop_display[''i'']>>, <<shop_display[''price_modifier'']>>"><img height="250" src="<<func($shop_display[''main_func_name''], $shop_display[''img_func_name''], shop_display[''i''])>>"></a>'
 	
 	end
 
@@ -103,7 +103,8 @@ end
 ! [2] - loop step
 ! [3] - img path
 ! [4] - link type - shop, wardrode, cheat
-! [5] - loop index start offset
+! [5] - loop index start offset {OPTIONAL, defaults to 0}
+! [6] - price modifier {OPTIONAL, defaults to 0}
 ! Populate the 'shop_display_exceptions[]' array with the index of the outfits you want excluded from the display.
 ! gs 'shop_utils', 'display_clothes', 'shop_type', 1, 'path', 'link_type'
 if $ARGS[0] = 'display_clothes':
@@ -117,6 +118,8 @@ if $ARGS[0] = 'display_clothes':
 		$shop_display['item_img_path'] = 'images/pc/items/' + $ARGS[3]
 	end
 
+	shop_display['price_modifier'] = ARGS[6]
+	
 	gs 'clothing_QV', 'shop_filter_header'
 	gs 'clothing', 'totals', $shop_display['variable']
 
@@ -156,6 +159,8 @@ if $ARGS[0] = 'display_shoes':
 		$shop_display['item_img_path'] = 'images/pc/items/' + $ARGS[3]
 	end
 
+	shop_display['price_modifier'] = ARGS[6]
+	
 	gs 'shoes', 'shop_filter_header'
 	gs 'shoes', 'totals', '<<$shop_display[''variable'']>>_shoes'
 
@@ -195,6 +200,8 @@ if $ARGS[0] = 'display_bras':
 		$shop_display['item_img_path'] = 'images/pc/items/' + $ARGS[3]
 	end
 
+	shop_display['price_modifier'] = ARGS[6]
+	
 	gs 'bras', 'shop_filter_header'
 	gs 'bras', 'totals', '<<$shop_display[''variable'']>>_bras'
 
@@ -234,6 +241,8 @@ if $ARGS[0] = 'display_panties':
 		$shop_display['item_img_path'] = 'images/pc/items/' + $ARGS[3]
 	end
 
+	shop_display['price_modifier'] = ARGS[6]
+	
 	gs 'panties', 'shop_filter_header'
 	gs 'panties', 'totals', '<<$shop_display[''variable'']>>_panties'
 
@@ -273,6 +282,8 @@ if $ARGS[0] = 'display_bodysuits':
 		$shop_display['item_img_path'] = 'images/pc/items/' + $ARGS[3]
 	end
 
+	shop_display['price_modifier'] = ARGS[6]
+	
 	gs 'underwear_bodysuits', 'shop_filter_header'
 	gs 'underwear_bodysuits', 'totals', '<<$shop_display[''variable'']>>_bodysuits'
 
@@ -312,6 +323,8 @@ if $ARGS[0] = 'display_coats':
 		$shop_display['item_img_path'] = 'images/pc/items/' + $ARGS[3]
 	end
 
+	shop_display['price_modifier'] = ARGS[6]
+
 	gs 'coats', 'totals', '<<$shop_display[''variable'']>>_coats'
 
 	if total <= 0:
@@ -344,6 +357,8 @@ if $ARGS[0] = 'display_purses':
 		$shop_display['item_img_path'] = 'images/pc/items/' + $ARGS[3]
 	end
 
+	shop_display['price_modifier'] = ARGS[6]
+	
 	gs 'purses', 'totals', '<<$shop_display[''variable'']>>_purses'
 
 	if total <= 0:
@@ -370,6 +385,7 @@ end
 !		- 'action_type' (shop, wardrobe, etc)
 ! 		- 'type' 
 !		- 'index'
+!		- 'price modifier' (0-100, taken as percentage. used for increases/decreases in price)
 ! 	- individual functons for each type that return an image of the item based on its index
 ! 
 ! Arguments for this function are:
@@ -379,12 +395,15 @@ end
 ! [4] - image function name
 ! [5] - link type
 ! [6] - loop index start offset {OPTIONAL}
+! [7] - price modifier {OPTIONAL}
 ! Populate the 'shop_display_exceptions[]' array with the index of the outfits you want excluded from the display.
 if $ARGS[0] = 'display_func_managed':
 	$shop_display['main_func_name'] = $ARGS[1]
 	$shop_display['item_type'] = $ARGS[2]
 	$shop_display['img_func_name'] = $ARGS[4]
 
+	shop_display['price_modifier'] = ARGS[7]
+
 
 	total = func($shop_display['main_func_name'], 'totals', $ARGS[2])
 

+ 2 - 1
locations/tattoo_management.qsrc

@@ -108,12 +108,13 @@ end
 ! [1] - action_type
 ! [2] - slot
 ! [3] - index
+! [4] - pric
 if $ARGS[0] = 'view_item':
 	gs 'tattoo_attributes', $ARGS[2], ARGS[3]
 
 	'<center><img src="<<func(''tattoo_management'', ''<<$ARGS[2]>>_image'', ARGS[3])>>"></center>'
 
-	price = TatPrice
+	price = TatPrice + (TatPrice * ARGS[4]) / 100
 
 	if max(money, karta) < price:
 		'You cannot afford this tattoo.'

+ 2 - 1
locations/underwear_bodysuits.qsrc

@@ -166,6 +166,7 @@ if $ARGS[0] = 'view_bodysuit_item':
 	!! ARGS 1 = action type (draw, shop)
 	!! ARGS 2 - bodysuit type
 	!! ARGS 3 - bodysuit index
+	!! ARGS 4 - price modifier (0-100, taken as %) {OPTIONAL}
 	
 	cla
 	'<center><img src="<<FUNC(''$pcs_outfit_image'', $ARGS[2]+''_bodysuits'', ARGS[3])>>"></center>'
@@ -177,7 +178,7 @@ if $ARGS[0] = 'view_bodysuit_item':
 			'You already own this item.'
 			act 'Leave': gt $loc, $loc_arg
 		else
-			price = PanPrice
+			price = PanPrice + (PanPrice * ARGS[4]) / 100
 			'Price: <<PanPrice>> <b>₽</b>'
 			act 'Leave': gt $loc, $loc_arg
 			if money >= price: