From 371af850ae7f2de9cdf3c7c151f14c206b1f2fd5 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Tue, 25 Jan 2022 00:13:13 +0100 Subject: [PATCH] determine who wins in oya --- CardValue.gd | 3 +++ Main.gd | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CardValue.gd b/CardValue.gd index 0bc64cb..60238eb 100644 --- a/CardValue.gd +++ b/CardValue.gd @@ -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]}) diff --git a/Main.gd b/Main.gd index 631b8c4..9a59e73 100644 --- a/Main.gd +++ b/Main.gd @@ -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")