|
|
@ -1,67 +1,36 @@
|
|
|
|
extends Node2D
|
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
|
|
|
|
#Cupcake Values
|
|
|
|
#Cupcake Values
|
|
|
|
var ccVanNum: int = 0
|
|
|
|
var ccValues = {
|
|
|
|
var ccVanValue: int = 1
|
|
|
|
"van": [0, 1],
|
|
|
|
var ccChocNum: int = 0
|
|
|
|
"choc": [0, 1],
|
|
|
|
var ccChocValue: int = 1
|
|
|
|
"straw": [0, 1],
|
|
|
|
var ccStrawNum: int = 0
|
|
|
|
"rvel": [0, 1],
|
|
|
|
var ccStrawValue: int = 1
|
|
|
|
"cin": [0, 1],
|
|
|
|
var ccRVelNum: int = 0
|
|
|
|
"hon": [0, 1],
|
|
|
|
var ccRVelValue: int = 1
|
|
|
|
"night": [0, 1]
|
|
|
|
var ccCinNum: int = 0
|
|
|
|
}
|
|
|
|
var ccCinValue: int = 1
|
|
|
|
|
|
|
|
var ccHonNum: int = 0
|
|
|
|
|
|
|
|
var ccHonValue: int = 1
|
|
|
|
|
|
|
|
var ccNightmareNum: int = 0
|
|
|
|
|
|
|
|
var ccNightmareValue: int = 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Cupcake Upgrade Prices
|
|
|
|
#Cupcake Upgrade Prices
|
|
|
|
var ccVanPrice: int = 10
|
|
|
|
var ccPrices = {
|
|
|
|
var ccVanPrice2: int = 15
|
|
|
|
"van": [10, 15, 15, 25000],
|
|
|
|
var ccVanPrice3: int = 15
|
|
|
|
"choc": [10, 15, 15, 50000, 150, null],
|
|
|
|
var ccVanPrice4: int = 25000
|
|
|
|
"straw": [10, 15, 15, 75000, 2000, 50, 150, 200, 50000],
|
|
|
|
var ccChocPrice: int = 10
|
|
|
|
"rvel": [10, 15, 15, 100000],
|
|
|
|
var ccChocPrice2: int = 15
|
|
|
|
"cin": [10, 15, 15, 125000],
|
|
|
|
var ccChocPrice3: int = 15
|
|
|
|
"hon": [10, 15, 15, 150000],
|
|
|
|
var ccChocPrice4: int = 50000
|
|
|
|
"night": [10, 15, 15, 175000]
|
|
|
|
var ccChocPrice5: int = 150
|
|
|
|
}
|
|
|
|
var ccChocPrice6: int
|
|
|
|
|
|
|
|
var ccStrawPrice: int = 10
|
|
|
|
var UpNum = {
|
|
|
|
var ccStrawPrice2: int = 15
|
|
|
|
"van": [0, 0, 0, 0],
|
|
|
|
var ccStrawPrice3: int = 15
|
|
|
|
"choc": [0, 0, 0, 0, 0, 0],
|
|
|
|
var ccStrawPrice4: int = 75000
|
|
|
|
"straw": [0, 0, 0, 0, 0, 0, 0],
|
|
|
|
var ccStrawPrice5: int = 150
|
|
|
|
"rvel": [0, 0, 0, 0],
|
|
|
|
var ccStrawPrice6: int = 200
|
|
|
|
"cin": [0, 0, 0, 0],
|
|
|
|
var ccRVelPrice: int = 10
|
|
|
|
"hon": [0, 0, 0, 0],
|
|
|
|
var ccRVelPrice2: int = 15
|
|
|
|
"night": [0, 0, 0, 0]
|
|
|
|
var ccRVelPrice3: int = 15
|
|
|
|
}
|
|
|
|
var ccRVelPrice4: int = 100000
|
|
|
|
|
|
|
|
var ccCinPrice: int = 10
|
|
|
|
|
|
|
|
var ccCinPrice2: int = 15
|
|
|
|
|
|
|
|
var ccCinPrice3: int = 15
|
|
|
|
|
|
|
|
var ccCinPrice4: int = 125000
|
|
|
|
|
|
|
|
var ccHonPrice: int = 10
|
|
|
|
|
|
|
|
var ccHonPrice2: int = 15
|
|
|
|
|
|
|
|
var ccHonPrice3: int = 15
|
|
|
|
|
|
|
|
var ccHonPrice4: int = 150000
|
|
|
|
|
|
|
|
var ccNightPrice: int = 10
|
|
|
|
|
|
|
|
var ccNightPrice2: int = 15
|
|
|
|
|
|
|
|
var ccNightPrice3: int = 15
|
|
|
|
|
|
|
|
var ccNightPrice4: int = 175000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Upgrade counts
|
|
|
|
|
|
|
|
var vanUpNum1: int = 0
|
|
|
|
|
|
|
|
var vanUpNum2: int = 0
|
|
|
|
|
|
|
|
var vanUpNum3: int = 0
|
|
|
|
|
|
|
|
var vanUpNum4: int = 0
|
|
|
|
|
|
|
|
var chocUpNum1: int = 0
|
|
|
|
|
|
|
|
var chocUpNum2: int = 0
|
|
|
|
|
|
|
|
var chocUpNum3: int = 0
|
|
|
|
|
|
|
|
var chocUpNum4: int = 0
|
|
|
|
|
|
|
|
var chocUpNum5: int = 0
|
|
|
|
|
|
|
|
var chocUpNum6: int = 0
|
|
|
|
|
|
|
|
var strawUpNum1: int = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
###Preloaded scenes and scripts
|
|
|
|
###Preloaded scenes and scripts
|
|
|
|
var upgradeUI = preload("res://Scenes/UI/upgrades.tscn")
|
|
|
|
var upgradeUI = preload("res://Scenes/UI/upgrades.tscn")
|
|
|
@ -87,7 +56,9 @@ var ccChaos
|
|
|
|
var location = null
|
|
|
|
var location = null
|
|
|
|
const AREA_PATHS = [
|
|
|
|
const AREA_PATHS = [
|
|
|
|
"res://Scenes/Locations/yard.tscn",
|
|
|
|
"res://Scenes/Locations/yard.tscn",
|
|
|
|
"res://Scenes/Locations/neighYard.tscn"
|
|
|
|
"res://Scenes/Locations/neighYard.tscn",
|
|
|
|
|
|
|
|
"res://Scenes/Locations/dungeonHon.tscn",
|
|
|
|
|
|
|
|
"res://Scenes/Locations/dungeonNight.tscn"
|
|
|
|
]
|
|
|
|
]
|
|
|
|
var areaScenes = []
|
|
|
|
var areaScenes = []
|
|
|
|
|
|
|
|
|
|
|
@ -125,6 +96,7 @@ var ccDiaLocked = true
|
|
|
|
var ccChaLocked = true
|
|
|
|
var ccChaLocked = true
|
|
|
|
|
|
|
|
|
|
|
|
#Spawnrates
|
|
|
|
#Spawnrates
|
|
|
|
|
|
|
|
var ccSpawnRates = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
|
|
|
|
var ccVanSpawnRate = 3
|
|
|
|
var ccVanSpawnRate = 3
|
|
|
|
var ccChocSpawnRate = 3
|
|
|
|
var ccChocSpawnRate = 3
|
|
|
|
var ccStrawSpawnRate = 3
|
|
|
|
var ccStrawSpawnRate = 3
|
|
|
@ -178,7 +150,6 @@ func _ready():
|
|
|
|
tool = toolScenes[0]
|
|
|
|
tool = toolScenes[0]
|
|
|
|
add_child(tool)
|
|
|
|
add_child(tool)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _process(delta):
|
|
|
|
func _process(delta):
|
|
|
|
if horseAttached == true:
|
|
|
|
if horseAttached == true:
|
|
|
|
mouse_position = get_global_mouse_position()
|
|
|
|
mouse_position = get_global_mouse_position()
|
|
|
@ -186,8 +157,6 @@ func _process(delta):
|
|
|
|
if $"Tool":
|
|
|
|
if $"Tool":
|
|
|
|
tool.position = mouse_position
|
|
|
|
tool.position = mouse_position
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _input(event):
|
|
|
|
func _input(event):
|
|
|
|
if event is InputEventMouseButton and event.pressed:
|
|
|
|
if event is InputEventMouseButton and event.pressed:
|
|
|
|
if Input.is_action_pressed("horseAttach"):
|
|
|
|
if Input.is_action_pressed("horseAttach"):
|
|
|
@ -202,31 +171,27 @@ func spawnHorse():
|
|
|
|
$Location.remove_child(location)
|
|
|
|
$Location.remove_child(location)
|
|
|
|
$Location.add_child(location)
|
|
|
|
$Location.add_child(location)
|
|
|
|
|
|
|
|
|
|
|
|
#Tool Refresh
|
|
|
|
|
|
|
|
func toolRefresh():
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Update Count
|
|
|
|
#Update Count
|
|
|
|
func collectCupcakes():
|
|
|
|
func collectCupcakes():
|
|
|
|
$InGameUI/Num/NumGrid/ccVanNum.text = str(ccVanNum)
|
|
|
|
$InGameUI/Num/NumGrid/ccVanNum.text = str(ccValues["van"][0])
|
|
|
|
$InGameUI/Num/NumGrid/ccChocNum.text = str(ccChocNum)
|
|
|
|
$InGameUI/Num/NumGrid/ccChocNum.text = str(ccValues["choc"][0])
|
|
|
|
$InGameUI/Num/NumGrid/ccStrawNum.text = str(ccStrawNum)
|
|
|
|
$InGameUI/Num/NumGrid/ccStrawNum.text = str(ccValues["straw"][0])
|
|
|
|
$InGameUI/Num/NumGrid/ccRVelNum.text = str(ccRVelNum)
|
|
|
|
$InGameUI/Num/NumGrid/ccRVelNum.text = str(ccValues["rvel"][0])
|
|
|
|
$InGameUI/Num/NumGrid/ccCinNum.text = str(ccCinNum)
|
|
|
|
$InGameUI/Num/NumGrid/ccCinNum.text = str(ccValues["cin"][0])
|
|
|
|
$InGameUI/Num/NumGrid/ccHonNum.text = str(ccHonNum)
|
|
|
|
$InGameUI/Num/NumGrid/ccHonNum.text = str(ccValues["hon"][0])
|
|
|
|
$InGameUI/Num/NumGrid/ccNightNum.text = str(ccNightmareNum)
|
|
|
|
$InGameUI/Num/NumGrid/ccNightNum.text = str(ccValues["night"][0])
|
|
|
|
|
|
|
|
|
|
|
|
#Cupcake Timer
|
|
|
|
#Cupcake Timer
|
|
|
|
func _on_timeout():
|
|
|
|
func _on_timeout():
|
|
|
|
spawnCupcakes(ccVan, ccVanSpawnRate)
|
|
|
|
spawnCupcakes(ccVan, ccSpawnRates[0])
|
|
|
|
if not ccChocLocked:
|
|
|
|
if not ccChocLocked:
|
|
|
|
spawnCupcakes(ccChoc, ccChocSpawnRate)
|
|
|
|
spawnCupcakes(ccChoc, ccSpawnRates[1])
|
|
|
|
if not ccStrawLocked:
|
|
|
|
if not ccStrawLocked:
|
|
|
|
spawnCupcakes(ccStraw, ccStrawSpawnRate)
|
|
|
|
spawnCupcakes(ccStraw, ccSpawnRates[2])
|
|
|
|
if not ccRVelLocked:
|
|
|
|
if not ccRVelLocked:
|
|
|
|
spawnCupcakes(ccRVel, ccRVelSpawnRate)
|
|
|
|
spawnCupcakes(ccRVel, ccSpawnRates[3])
|
|
|
|
if not ccCinLocked:
|
|
|
|
if not ccCinLocked:
|
|
|
|
spawnCupcakes(ccCin, ccCinSpawnRate)
|
|
|
|
spawnCupcakes(ccCin, ccSpawnRates[4])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
timer.start()
|
|
|
|
timer.start()
|
|
|
|
|
|
|
|
|
|
|
@ -246,149 +211,151 @@ func spawnCupcakes(cupcake: Node2D, spawn_rate: int):
|
|
|
|
###Upgrades###
|
|
|
|
###Upgrades###
|
|
|
|
#Vanilla
|
|
|
|
#Vanilla
|
|
|
|
func _on_upgrades_one_more_cupcake():
|
|
|
|
func _on_upgrades_one_more_cupcake():
|
|
|
|
if ccVanNum >= ccVanPrice:
|
|
|
|
if ccValues["van"][0] >= ccPrices["van"][0]:
|
|
|
|
ccVanSpawnRate += 1
|
|
|
|
ccSpawnRates[0] += 1
|
|
|
|
ccVanNum -= ccVanPrice
|
|
|
|
ccValues["van"][0] -= ccPrices["van"][0]
|
|
|
|
ccVanPrice = ccVanPrice * 1.3
|
|
|
|
ccPrices = ccPrices["van"][0] * 1.3
|
|
|
|
vanUpNum1 += 1
|
|
|
|
UpNum["van"][0] += 1
|
|
|
|
$Upgrades/Control/VanScroll/VanGrid/VanUp1/Price.text = str(ccVanPrice)
|
|
|
|
$Upgrades/Control/VanScroll/VanGrid/VanUp1/Price.text = str(ccPrices["van"][0])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
func _on_upgrades_faster_cupcake():
|
|
|
|
func _on_upgrades_faster_cupcake():
|
|
|
|
if ccVanNum >= ccVanPrice2:
|
|
|
|
if ccValues["van"][0] >= ccPrices["van"][1]:
|
|
|
|
ccVanNum -= ccVanPrice2
|
|
|
|
ccValues["van"][0] -= ccPrices["van"][1]
|
|
|
|
ccVanPrice2 = ccVanPrice2 * 1.3
|
|
|
|
ccPrices["van"][1] = ccPrices["van"][1] * 1.3
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
vanUpNum2 += 1
|
|
|
|
UpNum["van"][1] += 1
|
|
|
|
$Upgrades/Control/VanScroll/VanGrid/VanUp2/Price.text = str(ccVanPrice2)
|
|
|
|
$Upgrades/Control/VanScroll/VanGrid/VanUp2/Price.text = str(ccPrices["van"][1])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
func _on_upgrades_condensed_cupcake_1():
|
|
|
|
func _on_upgrades_condensed_cupcake_1():
|
|
|
|
if ccVanNum >= ccVanPrice3:
|
|
|
|
if ccValues["van"][0] >= ccPrices["van"][2]:
|
|
|
|
ccVanNum -= ccVanPrice3
|
|
|
|
ccValues["van"][0] -= ccPrices["van"][2]
|
|
|
|
ccVanPrice3 = ccVanPrice3 * 1.3
|
|
|
|
ccPrices["van"][2] = ccPrices["van"][2] * 1.3
|
|
|
|
ccVanValue += 1
|
|
|
|
ccValues["van"][1] += 1
|
|
|
|
vanUpNum3 += 1
|
|
|
|
UpNum["van"][2] += 1
|
|
|
|
$Upgrades/Control/VanScroll/VanGrid/VanUp3/Price.text = str(ccVanPrice3)
|
|
|
|
$Upgrades/Control/VanScroll/VanGrid/VanUp3/Price.text = str(ccPrices["van"][2])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
#Chocolate
|
|
|
|
#Chocolate
|
|
|
|
func _on_upgrades_one_more_cupcake_2():
|
|
|
|
func _on_upgrades_one_more_cupcake_2():
|
|
|
|
if ccChocNum >= ccChocPrice:
|
|
|
|
if ccValues["choc"][0] >= ccPrices["choc"][0]:
|
|
|
|
ccChocSpawnRate += 1
|
|
|
|
ccSpawnRates[1] += 1
|
|
|
|
ccChocNum -= ccChocPrice
|
|
|
|
ccValues["choc"][0] -= ccPrices["choc"][0]
|
|
|
|
ccChocPrice = ccChocPrice * 1.3
|
|
|
|
ccPrices["choc"][0] = ccPrices["choc"][0] * 1.3
|
|
|
|
chocUpNum1 += 1
|
|
|
|
UpNum["choc"][0] += 1
|
|
|
|
$Upgrades/Control/ChocScroll/ChocGrid/ChocUp1/Price.text = str(ccChocPrice)
|
|
|
|
$Upgrades/Control/ChocScroll/ChocGrid/ChocUp1/Price.text = str(ccPrices["choc"][0])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
func _on_upgrades_faster_cupcake_2():
|
|
|
|
func _on_upgrades_faster_cupcake_2():
|
|
|
|
if ccChocNum >= ccChocPrice2:
|
|
|
|
if ccValues["choc"][0] >= ccPrices["choc"][1]:
|
|
|
|
ccChocNum -= ccChocPrice2
|
|
|
|
ccValues["choc"][0] -= ccPrices["choc"][1]
|
|
|
|
ccChocPrice2 = ccChocPrice2 * 1.3
|
|
|
|
ccPrices["choc"][1] = ccPrices["choc"][1] * 1.3
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
chocUpNum2 += 1
|
|
|
|
UpNum["choc"][1] += 1
|
|
|
|
$Upgrades/Control/ChocScroll/ChocGrid/ChocUp2/Price.text = str(ccChocPrice2)
|
|
|
|
$Upgrades/Control/ChocScroll/ChocGrid/ChocUp2/Price.text = str(ccPrices["choc"][1])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
func _on_upgrades_condensed_cupcake_2():
|
|
|
|
func _on_upgrades_condensed_cupcake_2():
|
|
|
|
if ccChocNum >= ccChocPrice3:
|
|
|
|
if ccValues["choc"][0] >= ccPrices["choc"][2]:
|
|
|
|
ccChocNum -= ccChocPrice3
|
|
|
|
ccValues["choc"][0] -= ccPrices["choc"][2]
|
|
|
|
ccChocPrice3 = ccChocPrice3 * 1.3
|
|
|
|
ccPrices["choc"][2] = ccPrices["choc"][2] * 1.3
|
|
|
|
ccChocValue += 1
|
|
|
|
ccValues["choc"][1] += 1
|
|
|
|
chocUpNum3 += 1
|
|
|
|
UpNum["choc"][2] += 1
|
|
|
|
$Upgrades/Control/ChocScroll/ChocGrid/ChocUp3/Price.text = str(ccChocPrice3)
|
|
|
|
$Upgrades/Control/ChocScroll/ChocGrid/ChocUp3/Price.text = str(ccPrices["choc"][2])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
#Strawberry
|
|
|
|
#Strawberry
|
|
|
|
func _on_upgrades_one_more_cupcake_3():
|
|
|
|
func _on_upgrades_one_more_cupcake_3():
|
|
|
|
if ccStrawNum >= ccStrawPrice:
|
|
|
|
if ccValues["straw"][0] >= ccPrices["straw"][0]:
|
|
|
|
ccStrawSpawnRate += 1
|
|
|
|
ccSpawnRates[2] += 1
|
|
|
|
ccStrawNum -= ccStrawPrice
|
|
|
|
ccValues["straw"][0] -= ccPrices["straw"][0]
|
|
|
|
ccStrawPrice = ccStrawPrice * 1.3
|
|
|
|
ccPrices = ccPrices * 1.3
|
|
|
|
strawUpNum1 += 1
|
|
|
|
UpNum["straw"][0] += 1
|
|
|
|
$Upgrades/Control/StrawScroll/StrawGrid/StrawUp1/Price.text = str(ccStrawPrice)
|
|
|
|
$Upgrades/Control/StrawScroll/StrawGrid/StrawUp1/Price.text = str(ccPrices)
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
func _on_upgrades_faster_cupcake_3():
|
|
|
|
func _on_upgrades_faster_cupcake_3():
|
|
|
|
if ccStrawNum >= ccStrawPrice2:
|
|
|
|
if ccValues["straw"][0] >= ccPrices["straw"][1]:
|
|
|
|
ccStrawNum -= ccStrawPrice2
|
|
|
|
ccValues["straw"][0] -= ccPrices["straw"][1]
|
|
|
|
ccStrawPrice2 = ccStrawPrice2 * 1.3
|
|
|
|
ccPrices["straw"][1] = ccPrices["straw"][1] * 1.3
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
$Upgrades/Control/StrawScroll/StrawGrid/StrawUp2/Price.text = str(ccStrawPrice2)
|
|
|
|
UpNum["straw"][1] += 1
|
|
|
|
|
|
|
|
$Upgrades/Control/StrawScroll/StrawGrid/StrawUp2/Price.text = str(ccPrices["straw"][1])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
func _on_upgrades_condensed_cupcake_3():
|
|
|
|
func _on_upgrades_condensed_cupcake_3():
|
|
|
|
if ccStrawNum >= ccStrawPrice3:
|
|
|
|
if ccValues["straw"][0] >= ccPrices["straw"][2]:
|
|
|
|
ccStrawNum -= ccStrawPrice3
|
|
|
|
ccValues["straw"][0] -= ccPrices["straw"][2]
|
|
|
|
ccStrawPrice3 = ccStrawPrice3 * 1.3
|
|
|
|
ccPrices["straw"][2] = ccPrices["straw"][2] * 1.3
|
|
|
|
ccStrawValue += 1
|
|
|
|
ccValues["straw"][1] += 1
|
|
|
|
$Upgrades/Control/StrawScroll/StrawGrid/StrawUp3/Price.text = str(ccStrawPrice3)
|
|
|
|
UpNum["straw"][2] += 1
|
|
|
|
|
|
|
|
$Upgrades/Control/StrawScroll/StrawGrid/StrawUp3/Price.text = str(ccPrices["straw"][2])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
#Red Velvet
|
|
|
|
#Red Velvet
|
|
|
|
func _on_upgrades_one_more_cupcake_4():
|
|
|
|
func _on_upgrades_one_more_cupcake_4():
|
|
|
|
if ccRVelNum >= ccRVelPrice:
|
|
|
|
if ccValues["rvel"][0] >= ccPrices["rvel"][0]:
|
|
|
|
ccRVelSpawnRate += 1
|
|
|
|
ccSpawnRates[3] += 1
|
|
|
|
ccRVelNum -= ccRVelPrice
|
|
|
|
ccValues["rvel"][0] -= ccPrices["rvel"][0]
|
|
|
|
ccRVelPrice = ccRVelPrice * 1.3
|
|
|
|
ccPrices["rvel"][0] = ccPrices["rvel"][0] * 1.3
|
|
|
|
$Upgrades/Control/RVelScroll/RVelGrid/RVelUp1/Price.text = str(ccRVelPrice)
|
|
|
|
$Upgrades/Control/RVelScroll/RVelGrid/RVelUp1/Price.text = str(ccPrices["rvel"][0])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
func _on_upgrades_faster_cupcake_4():
|
|
|
|
func _on_upgrades_faster_cupcake_4():
|
|
|
|
if ccRVelNum >= ccRVelPrice2:
|
|
|
|
if ccValues["rvel"][0] >= ccPrices["rvel"][1]:
|
|
|
|
ccRVelNum -= ccRVelPrice2
|
|
|
|
ccValues["rvel"][0] -= ccPrices["rvel"][1]
|
|
|
|
ccRVelPrice2 = ccRVelPrice2 * 1.3
|
|
|
|
ccPrices["rvel"][1] = ccPrices["rvel"][1] * 1.3
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
$Upgrades/Control/RVelScroll/RVelGrid/RVelUp2/Price.text = str(ccRVelPrice2)
|
|
|
|
$Upgrades/Control/RVelScroll/RVelGrid/RVelUp2/Price.text = str(ccPrices["rvel"][1])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
func _on_upgrades_condensed_cupcake_4():
|
|
|
|
func _on_upgrades_condensed_cupcake_4():
|
|
|
|
if ccRVelNum >= ccRVelPrice3:
|
|
|
|
if ccValues["rvel"][0] >= ccPrices["rvel"][2]:
|
|
|
|
ccRVelNum -= ccRVelPrice3
|
|
|
|
ccValues["rvel"][0] -= ccPrices["rvel"][2]
|
|
|
|
ccRVelPrice3 = ccRVelPrice3 * 1.3
|
|
|
|
ccPrices["rvel"][2] = ccPrices["rvel"][2] * 1.3
|
|
|
|
ccRVelValue += 1
|
|
|
|
ccValues["rvel"][1] += 1
|
|
|
|
$Upgrades/Control/RVelScroll/RVelGrid/RVelUp3/Price.text = str(ccRVelPrice3)
|
|
|
|
$Upgrades/Control/RVelScroll/RVelGrid/RVelUp3/Price.text = str(ccPrices["rvel"][2])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
#Cinnamon
|
|
|
|
#Cinnamon
|
|
|
|
func _on_upgrades_one_more_cupcake_5():
|
|
|
|
func _on_upgrades_one_more_cupcake_5():
|
|
|
|
if ccCinNum >= ccCinPrice:
|
|
|
|
if ccValues["cin"][0] >= ccPrices["cin"][0]:
|
|
|
|
ccCinSpawnRate += 1
|
|
|
|
ccSpawnRates[4] += 1
|
|
|
|
ccCinNum -= ccCinPrice
|
|
|
|
ccValues["cin"][0] -= ccPrices["cin"][0]
|
|
|
|
ccCinPrice = ccCinPrice * 1.3
|
|
|
|
ccPrices["cin"][0] = ccPrices["cin"][0] * 1.3
|
|
|
|
$Upgrades/Control/CinScroll/CinGrid/CinUp1/Price.text = str(ccCinPrice)
|
|
|
|
$Upgrades/Control/CinScroll/CinGrid/CinUp1/Price.text = str(ccPrices["cin"][0])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
func _on_upgrades_faster_cupcake_5():
|
|
|
|
func _on_upgrades_faster_cupcake_5():
|
|
|
|
if ccCinNum >= ccCinPrice2:
|
|
|
|
if ccValues["cin"][0] >= ccPrices["cin"][1]:
|
|
|
|
ccCinNum -= ccCinPrice2
|
|
|
|
ccValues["cin"][0] -= ccPrices["cin"][1]
|
|
|
|
ccCinPrice2 = ccCinPrice2 * 1.3
|
|
|
|
ccPrices["cin"][1] = ccPrices["cin"][1] * 1.3
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
$Upgrades/Control/CinScroll/CinGrid/CinUp2/Price.text = str(ccCinPrice2)
|
|
|
|
$Upgrades/Control/CinScroll/CinGrid/CinUp2/Price.text = str(ccPrices["cin"][1])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
func _on_upgrades_condensed_cupcake_5():
|
|
|
|
func _on_upgrades_condensed_cupcake_5():
|
|
|
|
if ccCinNum >= ccCinPrice3:
|
|
|
|
if ccValues["cin"][0] >= ccPrices["cin"][2]:
|
|
|
|
ccCinNum -= ccCinPrice3
|
|
|
|
ccValues["cin"][0] -= ccPrices["cin"][2]
|
|
|
|
ccCinPrice3 = ccCinPrice3 * 1.3
|
|
|
|
ccPrices["cin"][2] = ccPrices["cin"][2] * 1.3
|
|
|
|
ccCinValue += 1
|
|
|
|
ccValues["cin"][1] += 1
|
|
|
|
$Upgrades/Control/CinScroll/CinGrid/CinUp3/Price.text = str(ccCinPrice3)
|
|
|
|
$Upgrades/Control/CinScroll/CinGrid/CinUp3/Price.text = str(ccPrices["cin"][2])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
#Honest
|
|
|
|
#Honest
|
|
|
|
func _on_upgrades_condensed_cupcake_6():
|
|
|
|
func _on_upgrades_one_more_cupcake_6():
|
|
|
|
if ccHonNum >= ccHonPrice:
|
|
|
|
if ccValues["hon"][0] >= ccPrices["hon"][0]:
|
|
|
|
ccHonSpawnRate += 1
|
|
|
|
ccHonSpawnRate += 1
|
|
|
|
ccHonNum -= ccHonPrice
|
|
|
|
ccValues["hon"][0] -= ccPrices["hon"][0]
|
|
|
|
ccHonPrice = ccHonPrice * 1.3
|
|
|
|
ccPrices["hon"][0] = ccPrices["hon"][0] * 1.3
|
|
|
|
$Upgrades/Control/HonScroll/HonGrid/HonUp1/Price.text = str(ccHonPrice)
|
|
|
|
$Upgrades/Control/HonScroll/HonGrid/HonUp1/Price.text = str(ccPrices["hon"][0])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_faster_cupcake_6():
|
|
|
|
func _on_upgrades_faster_cupcake_6():
|
|
|
|
if ccHonNum >= ccHonPrice2:
|
|
|
|
if ccValues["hon"][0] >= ccPrices["hon"][1]:
|
|
|
|
ccHonNum -= ccHonPrice2
|
|
|
|
ccValues["hon"][0] -= ccPrices["hon"][1]
|
|
|
|
ccHonPrice2 = ccHonPrice2 * 1.3
|
|
|
|
ccPrices["hon"][1] = ccPrices["hon"][1] * 1.3
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
$Upgrades/Control/HonScroll/HonGrid/HonUp2/Price.text = str(ccHonPrice2)
|
|
|
|
$Upgrades/Control/HonScroll/HonGrid/HonUp2/Price.text = str(ccPrices["hon"][1])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_one_more_cupcake_6():
|
|
|
|
func _on_upgrades_condensed_cupcake_6():
|
|
|
|
if ccHonNum >= ccHonPrice3:
|
|
|
|
if ccValues["hon"][0] >= ccPrices["hon"][2]:
|
|
|
|
ccHonNum -= ccHonPrice3
|
|
|
|
ccValues["hon"][0] -= ccPrices["hon"][2]
|
|
|
|
ccHonPrice3 = ccHonPrice3 * 1.3
|
|
|
|
ccPrices["hon"][2] = ccPrices["hon"][2] * 1.3
|
|
|
|
ccHonValue += 1
|
|
|
|
ccValues["hon"][1] += 1
|
|
|
|
$Upgrades/Control/HonScroll/HonGrid/HonUp3/Price.text = str(ccHonPrice3)
|
|
|
|
$Upgrades/Control/HonScroll/HonGrid/HonUp3/Price.text = str(ccPrices["hon"][2])
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_cupcake_damage():
|
|
|
|
func _on_upgrades_cupcake_damage():
|
|
|
@ -404,53 +371,53 @@ func _on_upgrades_sweetie_damage():
|
|
|
|
|
|
|
|
|
|
|
|
#Unlock
|
|
|
|
#Unlock
|
|
|
|
func _on_upgrades_unlock_choc():
|
|
|
|
func _on_upgrades_unlock_choc():
|
|
|
|
if ccVanNum >= ccVanPrice4:
|
|
|
|
if ccValues["van"][0] >= ccPrices["van"][3]:
|
|
|
|
ccVanNum -= ccVanPrice4
|
|
|
|
ccValues -= ccPrices["van"][3]
|
|
|
|
ccChocLocked = false
|
|
|
|
ccChocLocked = false
|
|
|
|
$"InGameUI/Main/HBoxContainer/Choc".visible = true
|
|
|
|
$"InGameUI/Main/HBoxContainer/Choc".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/chocIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/chocIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/ccChocNum".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/ccValues".visible = true
|
|
|
|
$"Upgrades/Control/VanScroll/VanGrid/VanUp4/Buy".visible = false
|
|
|
|
$"Upgrades/Control/VanScroll/VanGrid/VanUp4/Buy".visible = false
|
|
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_unlock_straw():
|
|
|
|
func _on_upgrades_unlock_straw():
|
|
|
|
if ccChocNum >= ccChocPrice4:
|
|
|
|
if ccValues["choc"][0] >= ccPrices["choc"][3]:
|
|
|
|
ccChocNum -= ccChocPrice4
|
|
|
|
ccValues["choc"][0] -= ccPrices["choc"][3]
|
|
|
|
ccStrawLocked = false
|
|
|
|
ccStrawLocked = false
|
|
|
|
$"InGameUI/Main/HBoxContainer/Straw".visible = true
|
|
|
|
$"InGameUI/Main/HBoxContainer/Straw".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/strawIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/strawIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/ccStrawNum".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/ccValues".visible = true
|
|
|
|
$"Upgrades/Control/ChocScroll/ChocGrid/ChocUp4/Buy".visible = false
|
|
|
|
$"Upgrades/Control/ChocScroll/ChocGrid/ChocUp4/Buy".visible = false
|
|
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_unlock_r_vel():
|
|
|
|
func _on_upgrades_unlock_r_vel():
|
|
|
|
if ccStrawNum >= ccStrawPrice4:
|
|
|
|
if ccValues >= ccPrices["straw"][8]:
|
|
|
|
ccStrawNum -= ccStrawPrice4
|
|
|
|
ccValues["straw"][0] -= ccPrices["straw"][8]
|
|
|
|
ccRVelLocked = false
|
|
|
|
ccRVelLocked = false
|
|
|
|
$"InGameUI/Main/HBoxContainer/RVel".visible = true
|
|
|
|
$"InGameUI/Main/HBoxContainer/RVel".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/rvelIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/rvelIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/ccRVelNum".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/ccValues".visible = true
|
|
|
|
$"Upgrades/Control/StrawScroll/StrawGrid/StrawUp4/Buy".visible = false
|
|
|
|
$"Upgrades/Control/StrawScroll/StrawGrid/StrawUp4/Buy".visible = false
|
|
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_unlock_cin():
|
|
|
|
func _on_upgrades_unlock_cin():
|
|
|
|
if ccRVelNum >= ccRVelPrice4:
|
|
|
|
if ccValues["rvel"][0] >= ccPrices["rvel"][3]:
|
|
|
|
ccRVelNum -= ccRVelPrice4
|
|
|
|
ccValues["rvel"][0] -= ccPrices["rvel"][3]
|
|
|
|
ccCinLocked = false
|
|
|
|
ccCinLocked = false
|
|
|
|
$"InGameUI/Main/HBoxContainer/Cin".visible = true
|
|
|
|
$"InGameUI/Main/HBoxContainer/Cin".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/cinIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/cinIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/ccCinNum".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/ccValues".visible = true
|
|
|
|
$"Upgrades/Control/RVelScroll/RVelGrid/RVelUp4/Buy".visible = false
|
|
|
|
$"Upgrades/Control/RVelScroll/RVelGrid/RVelUp4/Buy".visible = false
|
|
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_unlock_hon():
|
|
|
|
func _on_upgrades_unlock_hon():
|
|
|
|
if ccCinNum >= ccCinPrice4:
|
|
|
|
if ccValues >= ccPrices["cin"][3]:
|
|
|
|
ccCinNum -= ccCinPrice4
|
|
|
|
ccValues["cin"][0] -= ccPrices["cin"][3]
|
|
|
|
ccHonLocked = false
|
|
|
|
ccHonLocked = false
|
|
|
|
$"InGameUI/Main/HBoxContainer/Honest".visible = true
|
|
|
|
$"InGameUI/Main/HBoxContainer/Honest".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/honIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/honIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/ccHonNum".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/ccValues".visible = true
|
|
|
|
$"Upgrades/Control/CinScroll/CinGrid/CinUp4/Buy".visible = false
|
|
|
|
$"Upgrades/Control/CinScroll/CinGrid/CinUp4/Buy".visible = false
|
|
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_unlock_nightmare():
|
|
|
|
func _on_upgrades_unlock_nightmare():
|
|
|
|
if ccHonNum >= ccHonPrice4:
|
|
|
|
if ccValues["hon"][0] >= ccPrices["hon"][3]:
|
|
|
|
ccHonNum -= ccHonPrice4
|
|
|
|
ccValues -= ccPrices["hon"][3]
|
|
|
|
ccNightLocked = false
|
|
|
|
ccNightLocked = false
|
|
|
|
$"InGameUI/Main/HBoxContainer/Night".visible = true
|
|
|
|
$"InGameUI/Main/HBoxContainer/Night".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/nightIcon".visible = true
|
|
|
|
$"InGameUI/Num/NumGrid/nightIcon".visible = true
|
|
|
@ -459,37 +426,37 @@ func _on_upgrades_unlock_nightmare():
|
|
|
|
|
|
|
|
|
|
|
|
#Collect
|
|
|
|
#Collect
|
|
|
|
func _on_van_cupcake_cc_van_collected():
|
|
|
|
func _on_van_cupcake_cc_van_collected():
|
|
|
|
ccVanNum += ccVanValue
|
|
|
|
ccValues["van"][0] += ccValues["van"][1]
|
|
|
|
ccCount -= 1
|
|
|
|
ccCount -= 1
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_choc_cupcake_cc_choc_collected():
|
|
|
|
func _on_choc_cupcake_cc_choc_collected():
|
|
|
|
ccChocNum += ccChocValue
|
|
|
|
ccValues["choc"][0] += ccValues["choc"][1]
|
|
|
|
ccCount -= 1
|
|
|
|
ccCount -= 1
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_straw_cupcake_cc_straw_collected():
|
|
|
|
func _on_straw_cupcake_cc_straw_collected():
|
|
|
|
ccStrawNum += ccStrawValue
|
|
|
|
ccValues["straw"][0] += ccValues["straw"][1]
|
|
|
|
ccCount -= 1
|
|
|
|
ccCount -= 1
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_rvel_cupcake_cc_rvel_collected():
|
|
|
|
func _on_rvel_cupcake_cc_rvel_collected():
|
|
|
|
ccRVelNum += ccRVelValue
|
|
|
|
ccValues["rvel"][0] += ccValues["rvel"][1]
|
|
|
|
ccCount -= 1
|
|
|
|
ccCount -= 1
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_cin_cupcake_cc_cin_collected():
|
|
|
|
func _on_cin_cupcake_cc_cin_collected():
|
|
|
|
ccCinNum += ccCinValue
|
|
|
|
ccValues["cin"][0] += ccValues["cin"][1]
|
|
|
|
ccCount -= 1
|
|
|
|
ccCount -= 1
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_honest_cupcake_cc_hon_collected():
|
|
|
|
func _on_honest_cupcake_cc_hon_collected():
|
|
|
|
ccHonNum += ccHonValue
|
|
|
|
ccValues["hon"][0] += ccValues["hon"][1]
|
|
|
|
ccCount -= 1
|
|
|
|
ccCount -= 1
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_night_cupcake_cc_night_collected():
|
|
|
|
func _on_night_cupcake_cc_night_collected():
|
|
|
|
ccNightmareNum += ccNightmareValue
|
|
|
|
ccValues["night"][0] += ccValues["night"][1]
|
|
|
|
ccCount -= 1
|
|
|
|
ccCount -= 1
|
|
|
|
collectCupcakes()
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
|
@ -506,10 +473,11 @@ func _on_upgrades_your_yard():
|
|
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_neigh_yard():
|
|
|
|
func _on_upgrades_neigh_yard():
|
|
|
|
if neighYardLocked == true:
|
|
|
|
if neighYardLocked == true:
|
|
|
|
if ccStrawNum >= ccStrawPrice6:
|
|
|
|
if ccValues["straw"][0] >= ccPrices["straw"][6]:
|
|
|
|
ccStrawNum -= ccStrawPrice6
|
|
|
|
ccValues["straw"][0] -= ccPrices["straw"][6]
|
|
|
|
neighYardLocked = false
|
|
|
|
neighYardLocked = false
|
|
|
|
elif neighYardLocked == false and $Upgrades/Control/AreaScroll/AreaGrid/Area2/Buy.disabled == false:
|
|
|
|
$Upgrades/Control/AreaScroll/AreaGrid/Area1/Buy.text = str("Teleport")
|
|
|
|
|
|
|
|
if neighYardLocked == false and $Upgrades/Control/AreaScroll/AreaGrid/Area2/Buy.disabled == false:
|
|
|
|
location = areaScenes[1]
|
|
|
|
location = areaScenes[1]
|
|
|
|
$Upgrades/Control/AreaScroll/AreaGrid/Area2/Buy.disabled = true
|
|
|
|
$Upgrades/Control/AreaScroll/AreaGrid/Area2/Buy.disabled = true
|
|
|
|
$Upgrades/Control/AreaScroll/AreaGrid/Area1/Buy.disabled = false
|
|
|
|
$Upgrades/Control/AreaScroll/AreaGrid/Area1/Buy.disabled = false
|
|
|
|