feat: energy decrease
This commit is contained in:
parent
5395f971cb
commit
0d261242b3
3 changed files with 4 additions and 2 deletions
|
|
@ -107,8 +107,9 @@ layout_mode = 1
|
|||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -23.0
|
||||
offset_top = -90.0
|
||||
offset_right = 1152.0
|
||||
offset_bottom = -67.0
|
||||
grow_vertical = 0
|
||||
text = "Energy:"
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ func _on_update(transition):
|
|||
monster_card_ui.visible = true
|
||||
monster_card_ui.show_monster(monster)
|
||||
incoming_damage_label.text = "Incoming Damage: " + str(monster.health_delta)
|
||||
|
||||
else:
|
||||
monster_card_ui.visible = false
|
||||
if match_manager.phase in [Match.Phase.SUMMON, Match.Phase.SUPPORT_1, Match.Phase.SUPPORT_2]:
|
||||
|
|
@ -113,7 +114,6 @@ func _on_update(transition):
|
|||
if card is MonsterCard:
|
||||
var monster_card:MonsterCardUI = monster_card_prefab.instantiate()
|
||||
monster_card.show_monster(MatchMonster.new(card, card.base_health, 0))
|
||||
|
||||
if !is_disabled:
|
||||
monster_card.left_clicked.connect(func ():
|
||||
_pop_this_card(monster_card)
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ func resolve(action_by_player_id: Dictionary) -> PhaseTransition:
|
|||
players[player_id].monster = _monster_from_card(card)
|
||||
players[player_id].hand = players[player_id].hand.filter(func(card_in_hand): return card.id != card_in_hand.id)
|
||||
events.append(EventMonsterSummoned.new(card))
|
||||
players[player_id].energy = players[player_id].energy - card.energy_cost
|
||||
if players.values().all(func(player: MatchPlayer): return player.monster):
|
||||
phase = Match.Phase.SUPPORT_1
|
||||
Match.Phase.SUPPORT_1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue