func: Added endstep trump value differences
This commit is contained in:
@@ -48,6 +48,8 @@ extends CardContainer
|
||||
@export var align_drop_zone_size_with_current_hand_size := true
|
||||
## If true, only swap the positions of two cards when reordering (a <-> b), otherwise shift the range (default behavior).
|
||||
@export var swap_only_on_reorder := false
|
||||
## If false undoes any card movement to and from this Hand
|
||||
@export var allow_movement = true
|
||||
|
||||
|
||||
var vertical_partitions_from_outside = []
|
||||
@@ -88,26 +90,28 @@ func compare_cards(a,b):
|
||||
var suit_1 = a.card_info["suit"]
|
||||
var suit_2 = b.card_info["suit"]
|
||||
match suit_1:
|
||||
"Diampnd":
|
||||
val_1 -= 10
|
||||
"Spade":
|
||||
"Diamond":
|
||||
val_1 -= 20
|
||||
"Spade":
|
||||
val_1 -= 40
|
||||
"Heart":
|
||||
val_1 -= 30
|
||||
val_1 -= 60
|
||||
#print(val_1,su_1)
|
||||
|
||||
match suit_2:
|
||||
"Diamond":
|
||||
val_2 -= 10
|
||||
"Spade":
|
||||
val_2 -= 20
|
||||
"Spade":
|
||||
val_2 -= 40
|
||||
"Heart":
|
||||
val_2 -= 30
|
||||
val_2 -= 60
|
||||
#print(val_2,su_2)
|
||||
return val_1 < val_2
|
||||
|
||||
|
||||
func _card_can_be_added(_cards: Array) -> bool:
|
||||
if not allow_movement:
|
||||
return false
|
||||
var is_all_cards_contained = true
|
||||
for i in range(_cards.size()):
|
||||
var card = _cards[i]
|
||||
@@ -121,6 +125,7 @@ func _card_can_be_added(_cards: Array) -> bool:
|
||||
return _held_cards.size() + card_size <= max_hand_size
|
||||
|
||||
|
||||
|
||||
func _update_target_z_index() -> void:
|
||||
for i in range(_held_cards.size()):
|
||||
var card = _held_cards[i]
|
||||
|
||||
Reference in New Issue
Block a user