diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2025-04-02 17:31:58 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2025-04-02 17:31:58 +0200 |
commit | 2ffba3f35af0af2902278d062028a5f83e7fbc53 (patch) | |
tree | f108b7176ba63daa7101de43801a39db5ed3f5a0 /stage/dice_throw/dice_throw.gd | |
parent | 65bfe9c4c3e09c0d9f5058dd899a82c6a47ec15d (diff) |
Diffstat (limited to 'stage/dice_throw/dice_throw.gd')
-rw-r--r-- | stage/dice_throw/dice_throw.gd | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/stage/dice_throw/dice_throw.gd b/stage/dice_throw/dice_throw.gd index d6bdc34..1e80f64 100644 --- a/stage/dice_throw/dice_throw.gd +++ b/stage/dice_throw/dice_throw.gd @@ -78,24 +78,28 @@ func _on_dice_throw_3d_throw_finished(thrown_dices: Array[Dice]) -> void: for idx in thrown_dices.size(): var dice := thrown_dices[idx] var top_face := top_faces[idx] - var node := get_node("%" + top_face.configuration.type) + + if top_face.configuration.type == Game.FaceType.ENTITY: + continue # skip for now + + var node := get_node("%" + Game.FaceType.keys()[top_face.configuration.type].to_lower()) var p3d = %Camera3D.project_position(node.position + node.size * 0.5, 1) tween.tween_property(dice, "position", p3d, 0.25) tween.tween_property(dice, "scale", Vector3(0.1, 0.1, 0.1), 0.25) - if top_face.configuration.type == "move": + if top_face.configuration.type == Game.FaceType.MOVE: #Network.current_player.set_current_move_points(Network.current_player.current_move_points + 1) Network.current_player.current_move_points += top_face.configuration.value %move.text = "Move: %s" % str(Network.current_player.current_move_points) - elif top_face.configuration.type == "attack": + elif top_face.configuration.type == Game.FaceType.ATTACK: #Network.current_player.set_current_attack_points(Network.current_player.current_attack_points + 1) Network.current_player.current_attack_points += top_face.configuration.value %attack.text = "Attack: %s" % str(Network.current_player.current_attack_points) - elif top_face.configuration.type == "defend": + elif top_face.configuration.type == Game.FaceType.DEFEND: #Network.current_player.set_current_defend_points(Network.current_player.current_defend_points + 1) Network.current_player.current_defend_points += top_face.configuration.value %defend.text = "Defend: %s" % str(Network.current_player.current_defend_points) - elif top_face.configuration.type == "ability": + elif top_face.configuration.type == Game.FaceType.ABILITY: #Network.current_player.set_current_ability_points(Network.current_player.current_ability_points + 1) Network.current_player.current_ability_points += top_face.configuration.value %ability.text = "Ability: %s" % str(Network.current_player.current_ability_points) |