Skip to content

Commit 92fe46d

Browse files
committed
feat: add bonus when bonus are selected
1 parent 8b43153 commit 92fe46d

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

button.gd

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ func _process(_d):
77
$CPUParticles2D.emitting = true
88

99
func _pressed():
10-
commit_completion += float(randi() % 2) / 10.
10+
var sum = 0
11+
for i in Globals.actual_state.size():
12+
sum += Globals.actual_state[i]
13+
var add = float(randi() % 2 + 1) / 10.
14+
if add == 0.2 and randi() % 2 == 0:
15+
add = 0.1
16+
commit_completion += add + 0.05 * sum
1117
var nb_commit = roundi(commit_completion)
1218
if (nb_commit > 0):
13-
Globals.add_commits(nb_commit * 100)
19+
Globals.add_commits(nb_commit)
1420
commit_completion -= nb_commit

editor_upgrade.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extends UpgradeButton
22

33
func _init():
44
index = 0
5-
upgrades = [[10, "Passer a Notepad++"], [20, "Passer a Cursor"]]
5+
upgrades = [[10, "Passer a Notepad++"], [15, "Passer a Cursor"], [15, "Passer a Vscode"], [15, "Passer a Nano"], [15, "Passer a awk"]]
66
maxed_text = "Tu es editormaxxed"
77
visible_condition = func(): return true
88
on_pressed = func(): Globals.editor += 1

globals.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ func add_commits(nb: int):
2222
self.total_commits += nb
2323
for i in range(nb):
2424
on_commit.emit()
25-
# if randi() % 3 == 0:
26-
# get_tree().change_scene_to_file("res://Scenes/Levels/Level_01.tscn")
25+
if randi() % 4 == 0:
26+
get_tree().change_scene_to_file("res://Scenes/Levels/Level_01.tscn")
2727

2828
# Called when the node enters the scene tree for the first time.
2929
func _ready():

score_label.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ func format_si(nb: float) -> String:
99
if nb > 1000 ** (e+1):
1010
div = 1000 ** (e+1)
1111
suffix = suffixes[e]
12-
return "%d%s" % [(nb / div), suffix]
12+
return "%d%s" % [nb, suffix] #"%d%s" % [(nb / div), suffix]
1313

1414
# Called when the node enters the scene tree for the first time.
1515
func _ready():

zbi.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extends UpgradeButton
22

33
func _init():
44
index = 3
5-
upgrades = [[10, "Activer devin"]]
5+
upgrades = [[100, "Activer devin"]]
66
maxed_text = "Tu es iamaxxed"
77
visible_condition = func(): return Globals.editor >= 2 and Globals.features >= 2
88
on_pressed = func(): Globals.ia += 1

0 commit comments

Comments
 (0)