test implementation of bad luck protection using rand_weighted, change time to float (will use unix timestamp)
This commit is contained in:
parent
70a879529a
commit
a6f704039b
@ -3,4 +3,4 @@ extends Node
|
|||||||
|
|
||||||
|
|
||||||
@export var current_zone: Globals.World.Zone
|
@export var current_zone: Globals.World.Zone
|
||||||
@export var last_played: Dictionary
|
@export var last_played: float
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
|
|
||||||
var deltaCount := 0
|
# var deltaCount := 0
|
||||||
var enemyMoveSpeed := 5.0
|
# var enemyMoveSpeed := 5.0
|
||||||
# var questComplete := false
|
# var questComplete := false
|
||||||
var canContinue := false
|
var canContinue := false
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ func _ready() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
deltaCount += 1
|
# deltaCount += 1
|
||||||
if canContinue:
|
if canContinue:
|
||||||
_continue_show()
|
_continue_show()
|
||||||
|
|
||||||
@ -34,7 +34,12 @@ func _create_area() -> void:
|
|||||||
move_child(worldArea, 0)
|
move_child(worldArea, 0)
|
||||||
|
|
||||||
func _on_button_test_pressed() -> void:
|
func _on_button_test_pressed() -> void:
|
||||||
pass
|
# slowly increasing chance to get 1
|
||||||
|
# bad luck protection for rare spawns, drops, etc.
|
||||||
|
var testVal := 0.0
|
||||||
|
for i in range(1000):
|
||||||
|
testVal += 0.001
|
||||||
|
print(testVal, bool(RandomNumberGenerator.new().rand_weighted([1, testVal])))
|
||||||
|
|
||||||
|
|
||||||
func _on_button_exit_pressed() -> void:
|
func _on_button_exit_pressed() -> void:
|
||||||
|
Loading…
Reference in New Issue
Block a user