Split card types into modules #7
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
LunarTides/Hearthstone.gd!7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "type-modules"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split the different card types:
Minion,Spell,Hero,Hero Power; into their own modules.This also splits some additional stuff:
Armor (The mesh and label),Attack (The mesh and label), andHealth (The mesh and label).TODO:
Some of these changes should get cherrypicked, will do tomorrow.
Remember to also resolve the review comments from #4
This is far from perfect,
and there are some critical problems and design flaws (also it doesn't even work) so I can't do an early merge to fix stuff later.@ -0,0 +1,91 @@extends ModuleIs registering hooks on behalf of another module a good idea?
@ -0,0 +1,80 @@extends ModuleThis should be removed
@ -0,0 +75,4 @@attack_label.text = str(card.attack)attack_label.visible = attack_visiblereturn trueSomething like this was done in the armor module. Maybe have a helper function for this?
@ -23,1 +31,4 @@return truefunc layout_hero(card: Card) -> Dictionary:Too many newlines.
This should be done in main.
@ -0,0 +58,4 @@if hero_power.refunded:return falseplayer.has_used_hero_power_this_turn = trueI don't think
Player.has_used_hero_power_this_turnshould be in core.@ -0,0 +100,4 @@Anticheat.feedback("Invalid hero power info.", sender_peer_id)return falsevar hero_power: Card = actor_player.hero.hero_powerI don't think
Player.heroorCard.hero_powershould be in core, I'm not sure what the alternative solution is.@ -0,0 +1,81 @@extends ModuleI think this is gross since we are summoning the card after triggering the ability, which might be confusing to card creators if they don't know the reasoning behind it. This should be documented somewhere, but in the meantime, rephrase this comment with the reasoning above.
Also we should add
Card.summonso we can do this instead:@ -0,0 +71,4 @@return true# TODO: Return Array[StringName] in 4.3Why can we only do this in 4.3? Is there a pr that can be linked to?
@ -29,4 +29,2 @@Card._update_card(card, blueprint)# /////////////// Suggest ID ///////////////We should somehow add this back.
@ -0,0 +1,91 @@extends Moduleyesno
@ -29,4 +29,2 @@Card._update_card(card, blueprint)# /////////////// Suggest ID ///////////////This should probably be done in a follow-up pr.
Merging prematurely again. Remember to resolve the review comments here and in #4 in the future.