|
|
|
@ -72,7 +72,7 @@ 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 = preload("res://Scenes/Cupcakes/rvelCupcake.tscn")
|
|
|
|
|
var ccCinnamon = preload("res://Scenes/Cupcakes/cupcake.tscn")
|
|
|
|
|
var ccCinnamon = preload("res://Scenes/Cupcakes/cinCupcake.tscn")
|
|
|
|
|
var ccHonest = preload("res://Scenes/Cupcakes/honCupcake.tscn")
|
|
|
|
|
var ccNightmare = preload("res://Scenes/Cupcakes/nightCupcake.tscn")
|
|
|
|
|
var ccRock
|
|
|
|
@ -84,8 +84,12 @@ var ccLoyal
|
|
|
|
|
var ccChaos
|
|
|
|
|
|
|
|
|
|
#Areas
|
|
|
|
|
var yourYard = preload("res://Scenes/Locations/yard.tscn")
|
|
|
|
|
var neighYard = preload("res://Scenes/Locations/neighYard.tscn")
|
|
|
|
|
var location = null
|
|
|
|
|
const AREA_PATHS = [
|
|
|
|
|
"res://Scenes/Locations/yard.tscn",
|
|
|
|
|
"res://Scenes/Locations/neighYard.tscn"
|
|
|
|
|
]
|
|
|
|
|
var areaScenes = []
|
|
|
|
|
|
|
|
|
|
#Area Locks
|
|
|
|
|
var neighYardLocked = true
|
|
|
|
@ -141,11 +145,12 @@ 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()
|
|
|
|
|
var tool = null
|
|
|
|
|
const TOOL_PATHS = [
|
|
|
|
|
"res://Scenes/Tools/hooves.tscn",
|
|
|
|
|
"res://Scenes/Tools/bakingTray.tscn"
|
|
|
|
|
]
|
|
|
|
|
var toolScenes = []
|
|
|
|
|
|
|
|
|
|
#Other
|
|
|
|
|
@onready var timer = get_node("Cupcake Spawn Timer")
|
|
|
|
@ -155,16 +160,22 @@ var horseScene
|
|
|
|
|
var mouse_position = Vector2.ZERO
|
|
|
|
|
var ccCount = 0
|
|
|
|
|
var ccMaxOnScreen = 3000
|
|
|
|
|
var location
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#General
|
|
|
|
|
func _ready():
|
|
|
|
|
for path in AREA_PATHS:
|
|
|
|
|
var scene = load(path)
|
|
|
|
|
var instance = scene.instantiate()
|
|
|
|
|
areaScenes.append(instance)
|
|
|
|
|
horse_instance = horse_scene.instantiate()
|
|
|
|
|
add_child(horse_instance)
|
|
|
|
|
location = yourYard
|
|
|
|
|
location = areaScenes[0]
|
|
|
|
|
spawnHorse()
|
|
|
|
|
tool = toolHoovesScene
|
|
|
|
|
for path in TOOL_PATHS:
|
|
|
|
|
var scene = load(path)
|
|
|
|
|
var instance = scene.instantiate()
|
|
|
|
|
toolScenes.append(instance)
|
|
|
|
|
tool = toolScenes[0]
|
|
|
|
|
add_child(tool)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -174,22 +185,22 @@ func _process(delta):
|
|
|
|
|
horse_instance.position = mouse_position
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
func _input(event):
|
|
|
|
|
if event is InputEventMouseButton and event.pressed:
|
|
|
|
|
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)
|
|
|
|
|
if $Location.get_child_count() >= 1:
|
|
|
|
|
$Location.remove_child(location)
|
|
|
|
|
$Location.add_child(location)
|
|
|
|
|
|
|
|
|
|
#Tool Refresh
|
|
|
|
|
func toolRefresh():
|
|
|
|
@ -207,86 +218,30 @@ func collectCupcakes():
|
|
|
|
|
|
|
|
|
|
#Cupcake Timer
|
|
|
|
|
func _on_timeout():
|
|
|
|
|
spawnVanCupcakes()
|
|
|
|
|
if ccChocLocked == false:
|
|
|
|
|
spawnChocCupcakes()
|
|
|
|
|
if ccStrawLocked == false:
|
|
|
|
|
spawnStrawCupcakes()
|
|
|
|
|
if ccRVelLocked == false:
|
|
|
|
|
spawnRVelCupcakes()
|
|
|
|
|
if ccCinLocked == false:
|
|
|
|
|
spawnCinCupcakes()
|
|
|
|
|
spawnCupcakes(ccVan, ccVanSpawnRate)
|
|
|
|
|
if not ccChocLocked:
|
|
|
|
|
spawnCupcakes(ccChoc, ccChocSpawnRate)
|
|
|
|
|
if not ccStrawLocked:
|
|
|
|
|
spawnCupcakes(ccStraw, ccStrawSpawnRate)
|
|
|
|
|
if not ccRVelLocked:
|
|
|
|
|
spawnCupcakes(ccRVel, ccRVelSpawnRate)
|
|
|
|
|
if not ccCinLocked:
|
|
|
|
|
spawnCupcakes(ccCin, ccCinSpawnRate)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
timer.start
|
|
|
|
|
timer.start()
|
|
|
|
|
|
|
|
|
|
#Spawn
|
|
|
|
|
func spawnVanCupcakes():
|
|
|
|
|
var randX
|
|
|
|
|
var randY
|
|
|
|
|
randomize()
|
|
|
|
|
if ccCount <= ccMaxOnScreen:
|
|
|
|
|
for i in range(ccVanSpawnRate):
|
|
|
|
|
randX = randi_range(50, 1870)
|
|
|
|
|
randY = randi_range(50, 1030)
|
|
|
|
|
ccVan.position = Vector2(randX, randY)
|
|
|
|
|
$Cupcakes.add_child(ccVan.duplicate())
|
|
|
|
|
ccCount = ccCount + ccVanSpawnRate
|
|
|
|
|
|
|
|
|
|
func spawnChocCupcakes():
|
|
|
|
|
var randX
|
|
|
|
|
var randY
|
|
|
|
|
randomize()
|
|
|
|
|
if ccCount <= ccMaxOnScreen:
|
|
|
|
|
for i in range(ccChocSpawnRate):
|
|
|
|
|
randX = randi_range(50, 1870)
|
|
|
|
|
randY = randi_range(50, 1030)
|
|
|
|
|
ccChoc.position = Vector2(randX, randY)
|
|
|
|
|
$Cupcakes.add_child(ccChoc.duplicate())
|
|
|
|
|
ccCount = ccCount + ccChocSpawnRate
|
|
|
|
|
|
|
|
|
|
func spawnStrawCupcakes():
|
|
|
|
|
var randX
|
|
|
|
|
var randY
|
|
|
|
|
randomize()
|
|
|
|
|
if ccCount <= ccMaxOnScreen:
|
|
|
|
|
for i in range(ccStrawSpawnRate):
|
|
|
|
|
randX = randi_range(50, 1870)
|
|
|
|
|
randY = randi_range(50, 1030)
|
|
|
|
|
ccStraw.position = Vector2(randX, randY)
|
|
|
|
|
$Cupcakes.add_child(ccStraw.duplicate())
|
|
|
|
|
ccCount = ccCount + ccStrawSpawnRate
|
|
|
|
|
|
|
|
|
|
func spawnRVelCupcakes():
|
|
|
|
|
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():
|
|
|
|
|
func spawnCupcakes(cupcake: Node2D, spawn_rate: int):
|
|
|
|
|
var randX
|
|
|
|
|
var randY
|
|
|
|
|
randomize()
|
|
|
|
|
if ccCount <= ccMaxOnScreen:
|
|
|
|
|
for i in range(ccCinSpawnRate):
|
|
|
|
|
for i in range(spawn_rate):
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
func spawnNightCupcakes():
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cupcake.position = Vector2(randX, randY)
|
|
|
|
|
$Cupcakes.add_child(cupcake.duplicate())
|
|
|
|
|
ccCount += spawn_rate
|
|
|
|
|
|
|
|
|
|
###Upgrades###
|
|
|
|
|
#Vanilla
|
|
|
|
@ -298,7 +253,6 @@ func _on_upgrades_one_more_cupcake():
|
|
|
|
|
vanUpNum1 += 1
|
|
|
|
|
$Upgrades/Control/VanScroll/VanGrid/VanUp1/Price.text = str(ccVanPrice)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_faster_cupcake():
|
|
|
|
|
if ccVanNum >= ccVanPrice2:
|
|
|
|
|
ccVanNum -= ccVanPrice2
|
|
|
|
@ -307,7 +261,6 @@ func _on_upgrades_faster_cupcake():
|
|
|
|
|
vanUpNum2 += 1
|
|
|
|
|
$Upgrades/Control/VanScroll/VanGrid/VanUp2/Price.text = str(ccVanPrice2)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_condensed_cupcake_1():
|
|
|
|
|
if ccVanNum >= ccVanPrice3:
|
|
|
|
|
ccVanNum -= ccVanPrice3
|
|
|
|
@ -326,7 +279,6 @@ func _on_upgrades_one_more_cupcake_2():
|
|
|
|
|
chocUpNum1 += 1
|
|
|
|
|
$Upgrades/Control/ChocScroll/ChocGrid/ChocUp1/Price.text = str(ccChocPrice)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_faster_cupcake_2():
|
|
|
|
|
if ccChocNum >= ccChocPrice2:
|
|
|
|
|
ccChocNum -= ccChocPrice2
|
|
|
|
@ -335,7 +287,6 @@ func _on_upgrades_faster_cupcake_2():
|
|
|
|
|
chocUpNum2 += 1
|
|
|
|
|
$Upgrades/Control/ChocScroll/ChocGrid/ChocUp2/Price.text = str(ccChocPrice2)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_condensed_cupcake_2():
|
|
|
|
|
if ccChocNum >= ccChocPrice3:
|
|
|
|
|
ccChocNum -= ccChocPrice3
|
|
|
|
@ -354,7 +305,6 @@ func _on_upgrades_one_more_cupcake_3():
|
|
|
|
|
strawUpNum1 += 1
|
|
|
|
|
$Upgrades/Control/StrawScroll/StrawGrid/StrawUp1/Price.text = str(ccStrawPrice)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_faster_cupcake_3():
|
|
|
|
|
if ccStrawNum >= ccStrawPrice2:
|
|
|
|
|
ccStrawNum -= ccStrawPrice2
|
|
|
|
@ -362,7 +312,6 @@ func _on_upgrades_faster_cupcake_3():
|
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
|
$Upgrades/Control/StrawScroll/StrawGrid/StrawUp2/Price.text = str(ccStrawPrice2)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_condensed_cupcake_3():
|
|
|
|
|
if ccStrawNum >= ccStrawPrice3:
|
|
|
|
|
ccStrawNum -= ccStrawPrice3
|
|
|
|
@ -379,7 +328,6 @@ func _on_upgrades_one_more_cupcake_4():
|
|
|
|
|
ccRVelPrice = ccRVelPrice * 1.3
|
|
|
|
|
$Upgrades/Control/RVelScroll/RVelGrid/RVelUp1/Price.text = str(ccRVelPrice)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_faster_cupcake_4():
|
|
|
|
|
if ccRVelNum >= ccRVelPrice2:
|
|
|
|
|
ccRVelNum -= ccRVelPrice2
|
|
|
|
@ -387,7 +335,6 @@ func _on_upgrades_faster_cupcake_4():
|
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
|
$Upgrades/Control/RVelScroll/RVelGrid/RVelUp2/Price.text = str(ccRVelPrice2)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_condensed_cupcake_4():
|
|
|
|
|
if ccRVelNum >= ccRVelPrice3:
|
|
|
|
|
ccRVelNum -= ccRVelPrice3
|
|
|
|
@ -404,7 +351,6 @@ func _on_upgrades_one_more_cupcake_5():
|
|
|
|
|
ccCinPrice = ccCinPrice * 1.3
|
|
|
|
|
$Upgrades/Control/CinScroll/CinGrid/CinUp1/Price.text = str(ccCinPrice)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_faster_cupcake_5():
|
|
|
|
|
if ccCinNum >= ccCinPrice2:
|
|
|
|
|
ccCinNum -= ccCinPrice2
|
|
|
|
@ -412,7 +358,6 @@ func _on_upgrades_faster_cupcake_5():
|
|
|
|
|
timer.wait_time = timer.wait_time - (timer.wait_time * 0.01)
|
|
|
|
|
$Upgrades/Control/CinScroll/CinGrid/CinUp2/Price.text = str(ccCinPrice2)
|
|
|
|
|
collectCupcakes()
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_condensed_cupcake_5():
|
|
|
|
|
if ccCinNum >= ccCinPrice3:
|
|
|
|
|
ccCinNum -= ccCinPrice3
|
|
|
|
@ -551,9 +496,8 @@ func _on_night_cupcake_cc_night_collected():
|
|
|
|
|
|
|
|
|
|
#Areas
|
|
|
|
|
func _on_upgrades_your_yard():
|
|
|
|
|
|
|
|
|
|
if $Upgrades/Control/AreaScroll/AreaGrid/Area1/Buy.disabled == false:
|
|
|
|
|
location = yourYard
|
|
|
|
|
location = areaScenes[0]
|
|
|
|
|
$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)")
|
|
|
|
@ -561,17 +505,17 @@ func _on_upgrades_your_yard():
|
|
|
|
|
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()
|
|
|
|
|
if neighYardLocked == true:
|
|
|
|
|
if ccStrawNum >= ccStrawPrice6:
|
|
|
|
|
ccStrawNum -= ccStrawPrice6
|
|
|
|
|
neighYardLocked = false
|
|
|
|
|
elif neighYardLocked == false and $Upgrades/Control/AreaScroll/AreaGrid/Area2/Buy.disabled == false:
|
|
|
|
|
location = areaScenes[1]
|
|
|
|
|
$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()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -583,9 +527,11 @@ func _on_upgrades_abandoned_castle():
|
|
|
|
|
|
|
|
|
|
#Tools
|
|
|
|
|
func _on_upgrades_tool_1():
|
|
|
|
|
tool = toolHoovesScene
|
|
|
|
|
|
|
|
|
|
remove_child(tool)
|
|
|
|
|
tool = toolScenes[0]
|
|
|
|
|
add_child(tool)
|
|
|
|
|
|
|
|
|
|
func _on_upgrades_tool_2():
|
|
|
|
|
tool = toolBakingTrayScene
|
|
|
|
|
|
|
|
|
|
remove_child(tool)
|
|
|
|
|
tool = toolScenes[1]
|
|
|
|
|
add_child(tool)
|
|
|
|
|