...
 
Commits (2)
......@@ -10,7 +10,7 @@ func _init():
costTime = 15.0
toolName = "Hammer"
descr = "All your problems look like nails anyway. A bit better than a wrench, doesn't break easily."
fixPower = Globals.MACHINE_DECAY_RATE * coolDownInSecs * 3.5
fixPower = Globals.MACHINE_DECAY_RATE * coolDownInSecs * 10.0
func useImplementation() -> void:
......
......@@ -20,7 +20,7 @@ tracks/0/keys = {
"values": [ 0.0, -65.0, 0.0, -65.0, 0.0 ]
}
[node name="Hammer" instance=ExtResource( 1 )]
[node name="Hammer" index="0" instance=ExtResource( 1 )]
script = ExtResource( 2 )
[node name="AnimationPlayer" parent="." index="0"]
......
......@@ -10,7 +10,7 @@ func _init():
costTime = 18.0
toolName = "Power Tool"
descr = "Fixes machinery as no other tool, but breaks easily."
fixPower = Globals.MACHINE_DECAY_RATE * coolDownInSecs * 8.5
fixPower = Globals.MACHINE_DECAY_RATE * coolDownInSecs * 20.0
func useImplementation() -> void:
......
......@@ -10,7 +10,7 @@ func _init():
costTime = 0.0
toolName = "Wrench"
descr = "The standard maintenance tool. Not very good, but it is unbreakable."
fixPower = Globals.MACHINE_DECAY_RATE * coolDownInSecs * 2.0
fixPower = Globals.MACHINE_DECAY_RATE * coolDownInSecs * 4.0
func useImplementation() -> void:
......
......@@ -79,10 +79,27 @@ func getCurrentCoinRateModifier() -> int:
func generateRandomEventMaybe(deltaInSecs: float) -> void:
gameState.secsOfGame += deltaInSecs
gameState.secsWithoutRandomEvents += deltaInSecs
if gameState.secsWithoutRandomEvents > 20.0:
var interval := 0.0
if gameState.secsOfGame > 720:
interval = 5
elif gameState.secsOfGame > 360:
interval = 10
elif gameState.secsOfGame > 180:
interval = 15
elif gameState.secsOfGame > 90:
interval = 20
elif gameState.secsOfGame > 60:
interval = 25
else:
interval = 30
var prob := 0.1 + (gameState.secsWithoutRandomEvents / 60.0)
if gameState.secsWithoutRandomEvents > interval:
var r := randf()
if r < 0.1:
if r < prob:
# Time to generate a random event!
gameState.secsWithoutRandomEvents = 0.0
r = randf()
......