aboutsummaryrefslogtreecommitdiff
path: root/buildings/dev.gd
blob: abc1d77a64380071a09829f49b5dbcc95c14c7b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
extends BuildingInterface


var riot := preload("res://riot/riot.tscn")

func _tick() -> void:
	if SaveState.riot_cooldown == 0:
		SaveState.coffee -= get_amount()
		if SaveState.coffee < 0:
			invoke_riot()
			SaveState.coffee = 0
		else:
			SaveState.gain_bitcoin(int(pow(get_amount(), 
				1 + SaveState.upgrades['sunglasses'] / 10.0)))
	else:
		SaveState.riot_cooldown -= 1

func invoke_riot() -> void:
	SaveState.riot_cooldown = -1
	var mgt = find_parent('management')
	mgt.hide()
	mgt.pause_mode = PAUSE_MODE_STOP
	mgt.get_parent().add_child(riot.instance())