Fix the movement amount calculation
This commit is contained in:
parent
a0ddbdae43
commit
6b2007ee1a
@ -54,6 +54,13 @@ func _physics_process(delta):
|
|||||||
$UI/DiceView.selected = false
|
$UI/DiceView.selected = false
|
||||||
$UI/CardView.selected = true
|
$UI/CardView.selected = true
|
||||||
|
|
||||||
|
# if all 3 parts are done, select the DiceView again
|
||||||
|
if ($UI/DiceView.selected == false and
|
||||||
|
$UI/CardView.selected == false and
|
||||||
|
self.player_to_move == false):
|
||||||
|
|
||||||
|
$UI/DiceView.selected = true
|
||||||
|
|
||||||
|
|
||||||
func player_movement_input():
|
func player_movement_input():
|
||||||
if Input.is_action_just_pressed("ui_up"):
|
if Input.is_action_just_pressed("ui_up"):
|
||||||
|
@ -126,6 +126,12 @@ func run_card():
|
|||||||
damage += card_info.damage_dice_multiplyer * dice_number
|
damage += card_info.damage_dice_multiplyer * dice_number
|
||||||
emit_signal("do_damage", damage, card_info.effect_damage_range)
|
emit_signal("do_damage", damage, card_info.effect_damage_range)
|
||||||
|
|
||||||
|
# calculate the damage amount
|
||||||
|
var movement = card_info.move_amount_addition
|
||||||
|
for dice_number in input_dice:
|
||||||
|
movement += card_info.move_dice_multiplyer * dice_number
|
||||||
|
emit_signal("do_movement", movement)
|
||||||
|
|
||||||
# do any utility dice returns
|
# do any utility dice returns
|
||||||
for dice_number in input_dice:
|
for dice_number in input_dice:
|
||||||
|
|
||||||
@ -176,7 +182,6 @@ func run_card():
|
|||||||
for effect in card_info.effects:
|
for effect in card_info.effects:
|
||||||
emit_signal("do_effect", effect, card_info.effect_damage_range)
|
emit_signal("do_effect", effect, card_info.effect_damage_range)
|
||||||
|
|
||||||
emit_signal("do_movement", card_info.movement)
|
|
||||||
|
|
||||||
#clear the input dice
|
#clear the input dice
|
||||||
input_dice = []
|
input_dice = []
|
||||||
|
@ -71,7 +71,6 @@ func _physics_process(delta):
|
|||||||
selected = false
|
selected = false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func draw_card(specific_card : String = ""):
|
func draw_card(specific_card : String = ""):
|
||||||
# make a new card instance and add it to the grid container
|
# make a new card instance and add it to the grid container
|
||||||
var new_card = card.instance()
|
var new_card = card.instance()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user