@ -25,7 +25,7 @@ var ccChocPrice: int = 10
var ccChocPrice2 : int = 15
var ccChocPrice3 : int = 15
var ccChocPrice4 : int = 500
var ccChocPrice5 : int
var ccChocPrice5 : int = 150
var ccChocPrice6 : int
var ccStrawPrice : int = 10
var ccStrawPrice2 : int = 15
@ -41,7 +41,7 @@ var ccCinPrice: int = 10
var ccCinPrice2 : int = 15
var ccCinPrice3 : int = 15
var ccCinPrice4 : int = 1250
var cc N onPrice: int = 10
var cc H onPrice: int = 10
var ccHonPrice2 : int = 15
var ccHonPrice3 : int = 15
var ccHonPrice4 : int = 1500
@ -63,18 +63,18 @@ 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 location = preload ( " res://Scenes/Locations/yard.tscn " )
var horse_scene = preload ( " res://Scenes/horse.tscn " )
var horse = preload ( " res://Scripts/horse.gd " )
#Cupcakes
var ccVanilla = preload ( " res://Scenes/Cupcakes/cupcake.tscn " )
var ccChocolate = preload ( " res://Scenes/Cupcakes/chocCupcake.tscn " )
var ccStrawberry = preload ( " res://Scenes/Cupcakes/strawCupcake.tscn " )
var ccRedVelvet
var ccCinnamon
var ccHonest
var ccNightmare
var ccRedVelvet = preload ( " res://Scenes/Cupcakes/rvelCupcake.tscn " )
var ccCinnamon = preload ( " res://Scenes/Cupcakes/cupcake.tscn " )
var ccHonest = preload ( " res://Scenes/Cupcakes/honCupcake.tscn " )
var ccNightmare = preload ( " res://Scenes/Cupcakes/nightCupcake.tscn " )
var ccRock
var ccRuby
var ccSapphire
@ -83,14 +83,21 @@ var ccDiamond
var ccLoyal
var ccChaos
#Areas
var yourYard = preload ( " res://Scenes/Locations/yard.tscn " )
var neighYard = preload ( " res://Scenes/Locations/neighYard.tscn " )
#Area Locks
var neighYardLocked = true
#Instantiations
var ccVan = ccVanilla . instantiate ( )
var ccChoc = ccChocolate . instantiate ( )
var ccStraw = ccStrawberry . instantiate ( )
var ccRVel = ccRedVelvet
var ccCin = ccCinnamon
var ccHon = ccHonest
var ccNight = ccNightmare
var ccRVel = ccRedVelvet . instantiate ( )
var ccCin = ccCinnamon . instantiate ( )
var ccHon = ccHonest . instantiate ( )
var ccNight = ccNightmare . instantiate ( )
var ccRoc = ccRock
var ccRub = ccRuby
var ccSap = ccSapphire
@ -117,7 +124,9 @@ var ccChaLocked = true
var ccVanSpawnRate = 30
var ccChocSpawnRate = 30
var ccStrawSpawnRate = 30
var ccRVelSpawnRate = 3
var ccRVelSpawnRate = 30
var ccCinSpawnRate = 30
var ccHonSpawnRate = 3
var ccNightSpawnRate = 3
var ccRocSpawnRate = 3
var ccRubSpawnRate = 3
@ -131,35 +140,62 @@ var comboLocked = true
var combo = 1.00
var comboMultiplier
#Tools
var tool
var toolHooves = preload ( " res://Scenes/Tools/hooves.tscn " )
var toolHoovesScene = toolHooves . instantiate ( )
var toolBakingTray = preload ( " res://Scenes/Tools/bakingTray.tscn " )
var toolBakingTrayScene = toolBakingTray . instantiate ( )
#Other
@ onready var timer = get_node ( " Cupcake Spawn Timer " )
var horseAttached = true
var horse_instance
var horseScene
var mouse_position = Vector2 . ZERO
var ccCount = 0
var ccMaxOnScreen = 3000
var location
#General
func _ready ( ) :
var spawn
horse_instance = horse_scene . instantiate ( )
spawn = location . instantiate ( )
$ Location . add_child ( spawn )
add_child ( horse_instance )
location = yourYard
spawnHorse ( )
tool = toolHoovesScene
add_child ( tool )
func _process ( delta ) :
if horseAttached == true :
mouse_position = get_global_mouse_position ( )
horse_instance . position = mouse_position
handleInput ( )
if $ " Tool " :
tool . position = mouse_position
handleInput ( ) #don't ask
func handleInput ( ) :
#I hate this so much but I'm retarded
if Input . is_action_pressed ( " horseAttach " ) :
if horseAttached == true :
horseAttached = false
else :
horseAttached = true
#AreaTeleporter
func spawnHorse ( ) :
var spawn
spawn = location . instantiate ( )
$ Location . add_child ( spawn )
#Tool Refresh
func toolRefresh ( ) :
pass
#Update Count
func collectCupcakes ( ) :
$ InGameUI / Num / NumGrid / ccVanNum . text = str ( ccVanNum )
$ InGameUI / Num / NumGrid / ccChocNum . text = str ( ccChocNum )
@ -169,6 +205,7 @@ func collectCupcakes():
$ InGameUI / Num / NumGrid / ccHonNum . text = str ( ccHonNum )
$ InGameUI / Num / NumGrid / ccNightNum . text = str ( ccNightmareNum )
#Cupcake Timer
func _on_timeout ( ) :
spawnVanCupcakes ( )
if ccChocLocked == false :
@ -179,11 +216,6 @@ func _on_timeout():
spawnRVelCupcakes ( )
if ccCinLocked == false :
spawnCinCupcakes ( )
if ccHonLocked == false :
spawnHonCupcakes ( )
if ccNightLocked == false :
spawnNightCupcakes ( )
collectCupcakes ( )
timer . start
@ -194,8 +226,8 @@ func spawnVanCupcakes():
randomize ( )
if ccCount < = ccMaxOnScreen :
for i in range ( ccVanSpawnRate ) :
randX = randi_range ( 10, 191 0)
randY = randi_range ( 10, 107 0)
randX = randi_range ( 50, 187 0)
randY = randi_range ( 50, 103 0)
ccVan . position = Vector2 ( randX , randY )
$ Cupcakes . add_child ( ccVan . duplicate ( ) )
ccCount = ccCount + ccVanSpawnRate
@ -206,8 +238,8 @@ func spawnChocCupcakes():
randomize ( )
if ccCount < = ccMaxOnScreen :
for i in range ( ccChocSpawnRate ) :
randX = randi_range ( 10, 191 0)
randY = randi_range ( 10, 107 0)
randX = randi_range ( 50, 187 0)
randY = randi_range ( 50, 103 0)
ccChoc . position = Vector2 ( randX , randY )
$ Cupcakes . add_child ( ccChoc . duplicate ( ) )
ccCount = ccCount + ccChocSpawnRate
@ -218,17 +250,35 @@ func spawnStrawCupcakes():
randomize ( )
if ccCount < = ccMaxOnScreen :
for i in range ( ccStrawSpawnRate ) :
randX = randi_range ( 10, 191 0)
randY = randi_range ( 10, 107 0)
randX = randi_range ( 50, 187 0)
randY = randi_range ( 50, 103 0)
ccStraw . position = Vector2 ( randX , randY )
$ Cupcakes . add_child ( ccStraw . duplicate ( ) )
ccCount = ccCount + ccStrawSpawnRate
func spawnRVelCupcakes ( ) :
pass
var randX
var randY
randomize ( )
if ccCount < = ccMaxOnScreen :
for i in range ( ccRVelSpawnRate ) :
randX = randi_range ( 50 , 1870 )
randY = randi_range ( 50 , 1030 )
ccRVel . position = Vector2 ( randX , randY )
$ Cupcakes . add_child ( ccRVel . duplicate ( ) )
ccCount = ccCount + ccRVelSpawnRate
func spawnCinCupcakes ( ) :
pass
var randX
var randY
randomize ( )
if ccCount < = ccMaxOnScreen :
for i in range ( ccCinSpawnRate ) :
randX = randi_range ( 50 , 1870 )
randY = randi_range ( 50 , 1030 )
ccCin . position = Vector2 ( randX , randY )
$ Cupcakes . add_child ( ccCin . duplicate ( ) )
ccCount = ccCount + ccCinSpawnRate
func spawnHonCupcakes ( ) :
pass
@ -323,77 +373,77 @@ func _on_upgrades_condensed_cupcake_3():
#Red Velvet
func _on_upgrades_one_more_cupcake_4 ( ) :
if cc ChocNum > = ccChoc Price:
cc Choc SpawnRate += 1
cc ChocNum -= ccChoc Price
cc VanPrice = ccVan Price * 1.3
$ Upgrades / Control / VanScroll/ VanGrid / VanUp1 / Price . text = str ( ccChoc Price)
if cc RVelNum > = ccRVel Price:
cc RVel SpawnRate += 1
cc RVelNum -= ccRVel Price
cc RVelPrice = ccRVel Price * 1.3
$ Upgrades / Control / RVelScroll/ RVelGrid / RVelUp1 / Price . text = str ( ccRVel Price)
collectCupcakes ( )
func _on_upgrades_faster_cupcake_4 ( ) :
if cc ChocNum > = ccChoc Price2:
cc ChocNum -= ccChoc Price2
cc ChocPrice2 = ccChoc Price2 * 1.3
if cc RVelNum > = ccRVel Price2:
cc RVelNum -= ccRVel Price2
cc RVelPrice2 = ccRVel Price2 * 1.3
timer . wait_time = timer . wait_time - ( timer . wait_time * 0.01 )
$ Upgrades / Control / VanScroll/ VanGrid / VanUp2 / Price . text = str ( ccChoc Price2)
$ Upgrades / Control / RVelScroll/ RVelGrid / RVelUp2 / Price . text = str ( ccRVel Price2)
collectCupcakes ( )
func _on_upgrades_condensed_cupcake_4 ( ) :
if cc ChocNum > = ccChoc Price3:
cc ChocNum -= ccChoc Price3
cc ChocPrice3 = ccChoc Price3 * 1.3
cc Choc Value += 1
$ Upgrades / Control / ChocScroll/ ChocGrid / ChocUp3 / Price . text = str ( ccChoc Price3)
if cc RVelNum > = ccRVel Price3:
cc RVelNum -= ccRVel Price3
cc RVelPrice3 = ccRVel Price3 * 1.3
cc RVel Value += 1
$ Upgrades / Control / RVelScroll/ RVelGrid / RVelUp3 / Price . text = str ( ccRVel Price3)
collectCupcakes ( )
#Cinnamon
func _on_upgrades_one_more_cupcake_5 ( ) :
if ccC hocNum > = ccChoc Price:
ccC hoc SpawnRate += 1
ccC hocNum -= ccChoc Price
cc VanPrice = ccVa nPrice * 1.3
$ Upgrades / Control / VanScroll/ VanGrid / VanUp1 / Price . text = str ( ccChoc Price)
if ccC inNum > = ccCin Price:
ccC in SpawnRate += 1
ccC inNum -= ccCin Price
cc CinPrice = ccCi nPrice * 1.3
$ Upgrades / Control / CinScroll/ CinGrid / CinUp1 / Price . text = str ( ccCin Price)
collectCupcakes ( )
func _on_upgrades_faster_cupcake_5 ( ) :
if ccC hocNum > = ccChoc Price2:
ccC hocNum -= ccChoc Price2
ccC hocPrice2 = ccChoc Price2 * 1.3
if ccC inNum > = ccCin Price2:
ccC inNum -= ccCin Price2
ccC inPrice2 = ccCin Price2 * 1.3
timer . wait_time = timer . wait_time - ( timer . wait_time * 0.01 )
$ Upgrades / Control / VanScroll/ VanGrid / VanUp2 / Price . text = str ( ccChoc Price2)
$ Upgrades / Control / CinScroll/ CinGrid / CinUp2 / Price . text = str ( ccCin Price2)
collectCupcakes ( )
func _on_upgrades_condensed_cupcake_5 ( ) :
if ccC hocNum > = ccChoc Price3:
ccC hocNum -= ccChoc Price3
ccC hocPrice3 = ccChoc Price3 * 1.3
ccC hoc Value += 1
$ Upgrades / Control / C hocScroll/ ChocGrid / ChocUp3 / Price . text = str ( ccChoc Price3)
if ccC inNum > = ccCin Price3:
ccC inNum -= ccCin Price3
ccC inPrice3 = ccCin Price3 * 1.3
ccC in Value += 1
$ Upgrades / Control / C inScroll/ CinGrid / CinUp3 / Price . text = str ( ccCin Price3)
collectCupcakes ( )
#Honest
func _on_upgrades_condensed_cupcake_6 ( ) :
if cc ChocNum > = ccChoc Price:
cc Choc SpawnRate += 1
cc ChocNum -= ccChoc Price
cc VanPrice = ccVa nPrice * 1.3
$ Upgrades / Control / VanScroll/ VanGrid / VanUp1 / Price . text = str ( ccChoc Price)
if cc HonNum > = ccHon Price:
cc Hon SpawnRate += 1
cc HonNum -= ccHon Price
cc HonPrice = ccHo nPrice * 1.3
$ Upgrades / Control / HonScroll/ HonGrid / HonUp1 / Price . text = str ( ccHon Price)
collectCupcakes ( )
func _on_upgrades_faster_cupcake_6 ( ) :
if cc ChocNum > = ccChoc Price2:
cc ChocNum -= ccChoc Price2
cc ChocPrice2 = ccChoc Price2 * 1.3
if cc HonNum > = ccHon Price2:
cc HonNum -= ccHon Price2
cc HonPrice2 = ccHon Price2 * 1.3
timer . wait_time = timer . wait_time - ( timer . wait_time * 0.01 )
$ Upgrades / Control / VanScroll/ VanGrid / VanUp2 / Price . text = str ( ccChoc Price2)
$ Upgrades / Control / HonScroll/ HonGrid / HonUp2 / Price . text = str ( ccHon Price2)
collectCupcakes ( )
func _on_upgrades_one_more_cupcake_6 ( ) :
if cc ChocNum > = ccChoc Price3:
cc ChocNum -= ccChoc Price3
cc ChocPrice3 = ccChoc Price3 * 1.3
cc Choc Value += 1
$ Upgrades / Control / ChocScroll/ ChocGrid / ChocUp3 / Price . text = str ( ccChoc Price3)
if cc HonNum > = ccHon Price3:
cc HonNum -= ccHon Price3
cc HonPrice3 = ccHon Price3 * 1.3
cc Hon Value += 1
$ Upgrades / Control / HonScroll/ HonGrid / HonUp3 / Price . text = str ( ccHon Price3)
collectCupcakes ( )
func _on_upgrades_cupcake_damage ( ) :
@ -430,10 +480,10 @@ func _on_upgrades_unlock_r_vel():
if ccStrawNum > = ccStrawPrice4 :
ccStrawNum -= ccStrawPrice4
ccRVelLocked = false
$ " InGameUI/Main/HBoxContainer/R v el" . visible = true
$ " InGameUI/Main/HBoxContainer/R V el" . visible = true
$ " InGameUI/Num/NumGrid/rvelIcon " . visible = true
$ " InGameUI/Num/NumGrid/ccRVelNum " . visible = true
$ " Upgrades/Control/ RVelScroll/RVelGrid/RVel Up4/Buy" . visible = false
$ " Upgrades/Control/ StrawScroll/StrawGrid/Straw Up4/Buy" . visible = false
func _on_upgrades_unlock_cin ( ) :
if ccRVelNum > = ccRVelPrice4 :
@ -442,7 +492,7 @@ func _on_upgrades_unlock_cin():
$ " InGameUI/Main/HBoxContainer/Cin " . visible = true
$ " InGameUI/Num/NumGrid/cinIcon " . visible = true
$ " InGameUI/Num/NumGrid/ccCinNum " . visible = true
$ " Upgrades/Control/ CinScroll/CinGrid/Cin Up4/Buy" . visible = false
$ " Upgrades/Control/ RVelScroll/RVelGrid/RVel Up4/Buy" . visible = false
func _on_upgrades_unlock_hon ( ) :
if ccCinNum > = ccCinPrice4 :
@ -451,7 +501,7 @@ func _on_upgrades_unlock_hon():
$ " InGameUI/Main/HBoxContainer/Honest " . visible = true
$ " InGameUI/Num/NumGrid/honIcon " . visible = true
$ " InGameUI/Num/NumGrid/ccHonNum " . visible = true
$ " Upgrades/Control/ HonScroll/HonGrid/Ho nUp4/Buy" . visible = false
$ " Upgrades/Control/ CinScroll/CinGrid/Ci nUp4/Buy" . visible = false
func _on_upgrades_unlock_nightmare ( ) :
if ccHonNum > = ccHonPrice4 :
@ -460,7 +510,7 @@ func _on_upgrades_unlock_nightmare():
$ " InGameUI/Main/HBoxContainer/Night " . visible = true
$ " InGameUI/Num/NumGrid/nightIcon " . visible = true
$ " InGameUI/Num/NumGrid/ccNightNum " . visible = true
$ " Upgrades/Control/ NightScroll/NightGrid/Night Up4/Buy" . visible = false
$ " Upgrades/Control/ HonScroll/HonGrid/Hon Up4/Buy" . visible = false
#Collect
func _on_van_cupcake_cc_van_collected ( ) :
@ -494,12 +544,48 @@ func _on_honest_cupcake_cc_hon_collected():
collectCupcakes ( )
func _on_night_cupcake_cc_night_collected ( ) :
cc HonNum += ccHon Value
cc NightmareNum += ccNightmare Value
ccCount -= 1
collectCupcakes ( )
#Areas
func _on_upgrades_your_yard ( ) :
if $ Upgrades / Control / AreaScroll / AreaGrid / Area1 / Buy . disabled == false :
location = yourYard
$ Upgrades / Control / AreaScroll / AreaGrid / Area2 / Buy . disabled = false
$ Upgrades / Control / AreaScroll / AreaGrid / Area1 / Buy . disabled = true
$ Upgrades / Control / AreaScroll / AreaGrid / Area1 / Buy . text = str ( " Teleport (You ' re here) " )
$ Upgrades / Control / AreaScroll / AreaGrid / Area2 / Buy . text = str ( " Teleport " )
spawnHorse ( )
func _on_upgrades_neigh_yard ( ) :
#if ccStrawNum >= ccStrawPrice5 and neighYardLocked == false:
# ccStrawNum -= ccStrawPrice5
# $Upgrades/Control/AreaScroll/AreaGrid/Area2/Buy.text = str("Teleport")
#else:
if $ Upgrades / Control / AreaScroll / AreaGrid / Area2 / Buy . disabled == false :
location = neighYard
$ Upgrades / Control / AreaScroll / AreaGrid / Area2 / Buy . disabled = true
$ Upgrades / Control / AreaScroll / AreaGrid / Area1 / Buy . disabled = false
$ Upgrades / Control / AreaScroll / AreaGrid / Area1 / Buy . text = str ( " Teleport " )
$ Upgrades / Control / AreaScroll / AreaGrid / Area2 / Buy . text = str ( " Teleport (You ' re here) " )
spawnHorse ( )
func _on_upgrades_honest_dungeon ( ) :
pass # Replace with function body.
func _on_upgrades_abandoned_castle ( ) :
pass # Replace with function body.
#Tools
func _on_upgrades_tool_1 ( ) :
tool = toolHoovesScene
func _on_upgrades_tool_2 ( ) :
tool = toolBakingTrayScene