determine who wins in oya

main
Fabien Freling 2022-01-25 00:13:13 +01:00
parent 528603f90d
commit 371af850ae
2 changed files with 16 additions and 0 deletions

View File

@ -7,3 +7,6 @@ var type: int
func _init(month: int, type: int):
self.month = month
self.type = type
func desc() -> String:
return "CardValue({m}, {t})".format({"m": Enums.Month.keys()[month], "t": Enums.Type.keys()[type]})

13
Main.gd
View File

@ -37,4 +37,17 @@ func oya():
yield(tween, "tween_all_completed")
print("Player 1: {c}".format({"c": card_1.value.desc()}))
print("Player 2: {c}".format({"c": card_2.value.desc()}))
if card_1.value.month < card_2.value.month:
print("Player 1 is the oya")
elif card_1.value.month > card_2.value.month:
print("Player 2 is the oya")
elif card_1.value.type >= Enums.Type.SCRAP_1 and card_2.value.tyoe >= Enums.Type.SCRAP_1:
print("Cards have the same value, redraw")
elif card_1.value.type < card_2.value.type:
print("Player 1 is the oya")
else:
print("Player 2 is the oya")
print("update oya")