card picker is always picking void card
This commit is contained in:
parent
e3e98a05f2
commit
111b39c5c3
|
|
@ -125,13 +125,19 @@ func pick(id: int):
|
||||||
options.remove_at(id)
|
options.remove_at(id)
|
||||||
anim_players.remove_at(id)
|
anim_players.remove_at(id)
|
||||||
|
|
||||||
randomize()
|
var winning_id
|
||||||
var winning_id = randi() % options.size()
|
if options[1].text == "" and not id == 1:
|
||||||
|
randomize()
|
||||||
|
winning_id = randi() % options.size()
|
||||||
|
|
||||||
print("Winning ID ", id)
|
print("Winning ID ", id)
|
||||||
|
|
||||||
if winning_id == sibling_id:
|
if winning_id == sibling_id:
|
||||||
winning_id = (winning_id + 1) % options.size()
|
winning_id = (winning_id + 1) % options.size()
|
||||||
|
elif options[0].text == "":
|
||||||
|
winning_id = 0
|
||||||
|
else:
|
||||||
|
winning_id = 1
|
||||||
|
|
||||||
output.append(options.pop_at(winning_id))
|
output.append(options.pop_at(winning_id))
|
||||||
anim_players.pop_at(winning_id).play("shuffle")
|
anim_players.pop_at(winning_id).play("shuffle")
|
||||||
|
|
@ -176,6 +182,7 @@ func handle_mouse_button(new_selection: Node, button_event: InputEventMouseButto
|
||||||
func scene_finished(id: int, repeat):
|
func scene_finished(id: int, repeat):
|
||||||
print(name, id, repeat)
|
print(name, id, repeat)
|
||||||
if not repeat:
|
if not repeat:
|
||||||
|
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||||
fill_card_slots(id)
|
fill_card_slots(id)
|
||||||
State.transition_stage_to(self)
|
State.transition_stage_to(self)
|
||||||
selection_state = CARDS
|
selection_state = CARDS
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue