-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class structure for the cards #27
Conversation
… files - The CardBase applies all effects when played - The application of effect is done given the card data (parser TODO) - This application will be done to all targets in the list - This calls the apply_effect which is done to individual targets
…o one target at once
Will make the cards that are played using the new structure and test that it works then it'll be good for merge |
Alright here is the problem: A solution would be to export the unique identifier of each entity. So we would have an array of strings for CardBase, with each string being the entity identifier. So we would have a |
We probably don’t want to assign the targets in the inspector, because that list can change at runtime. Can we somehow pass the list of enemies to the effect data at runtime when they’re needed? Maybe from Battler when the card is played? |
Or I just export everything except the entity. That works too, since there are static data (like the amount of damage for the base card). The thing is that we have damage modifier. So the base damage won't be modified but we will need a way to take into account the modified damage. That will probably come along with the Dictionary of modifiers though. |
Note that damage all doesn't work anymore due to the targeting system. We will need to treat that at the same time as instant cast cards (by implementing the "all / target" system that was discussed in #21 ) |
Also I noticed a bug on the draw, which can't be fixed in the scope of the current PR (I think) so i'll open an issue for that |
It worked nicely. This card probably won't stay as it is, that would be OP But it's nice to test that the system is working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall changes look good. I have a question though: what's the difference between a Status and an Effect?
The difference between a status and an effect is that the effect is the action (like dealing damage, applying poison) |
I will let you resolve the conversations if you think the changes are correct @Tysterman74 |
Description
This PR rewrites the system that was in
CardBase
to have a more flexible system of effects that can be added to a card.Related issue(s)
Closes #14
List of changes
EffectBase
andEffectData
:EffectBase
is parent of all effects. EffectData is the actual thing that is useful for the card, as it contains the effect, the caster, the target and the value useful to the effect (damage to deal, card to draw, number of poison status to apply...)CardBase
to their respective effectTests
No new tests were provided, but #26 should be addressed once this PR closes.
Additional notes
In Draft status so the code can be reviewed. I need to test in the actual player that everything is working correctly, but I need to edit the cards that are given to the player in that scene to be sure (which I don't have time to do for a bit of time).
I am also not sure of what to do with effects that deal damage indirectly like poison. Currently those status don't seem to directly deal damage, as the only thing we do is add or remove them from the list of current status. Changes will probably need to be made to those status to inflict damage (either by calling the
EffectDamage
or directly calling thedeal_damage
function, which seems more logical as effects are the player interface and it's a bit too much to call them for internal logic).