delete doDrawBack?
I converted Dream Cache to newer style drawback and I think it was the last card to use the old function. Can we delete doDrawBack in CardFactoryUtil?
High Quality Resources for Collectible Card Games
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=52&t=4755
if (af.hasSubAbility()){
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else
CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, tgtCards.get(0), sa);
}
AbilityFactory.resolveSubAbility(sa);One of these days Rob is going to be yelling at us to get off his lawn.Rob Cashwalker wrote:{sniff} so sad to see it go...
I wish I could just click "Like" on this post.friarsol wrote:One of these days Rob is going to be yelling at us to get off his lawn.Rob Cashwalker wrote:{sniff} so sad to see it go...
Yea it's definitely a good idea to go through and simplify as much as the common resolution code as possible.Sloth wrote:Can't we do something like a super resolve function now, to not repeat so much code. It should do just the following things:
1. check condition (and maybe fizzling and unless costs)
1a. if true let it resolve (in the corresponding AF).
2. go to super resolve of next subability.
I don't get it...friarsol wrote:One of these days Rob is going to be yelling at us to get off his lawn.Rob Cashwalker wrote:{sniff} so sad to see it go...
After taking a look at the structure, I think I have to pass implementing this. I can't find a way to add something before the resolve without detroying the nice structure of the ability factory. I just can't code so elegantly. Unless someone gives me a hint or batch of code I can start from I'm gonna drop this.friarsol wrote:Yea it's definitely a good idea to go through and simplify as much as the common resolution code as possible.Sloth wrote:Can't we do something like a super resolve function now, to not repeat so much code. It should do just the following things:
1. check condition (and maybe fizzling and unless costs)
1a. if true let it resolve (in the corresponding AF).
2. go to super resolve of next subability.
The hooks need to happen on the MagicStack side, instead of calling sa.resolve() there we would call need to be a call to a AF.resolve(sa) which would do as you suggest, pulling out the appropriate conditional checks, as well as looping through each of the subAbilities afterwards and resolving those. If the SpellAbility didn't have an attached AF, then no need to do any of the AF specific things, and we could just call sa.resolve() straight up from there.Sloth wrote:After taking a look at the structure, I think I have to pass implementing this. I can't find a way to add something before the resolve without detroying the nice structure of the ability factory. I just can't code so elegantly. Unless someone gives me a hint or batch of code I can start from I'm gonna drop this.
Thanks Sol. I commited the change. It was really easy with your help.friarsol wrote:The hooks need to happen on the MagicStack side, instead of calling sa.resolve() there we would call need to be a call to a AF.resolve(sa) which would do as you suggest, pulling out the appropriate conditional checks, as well as looping through each of the subAbilities afterwards and resolving those. If the SpellAbility didn't have an attached AF, then no need to do any of the AF specific things, and we could just call sa.resolve() straight up from there.Sloth wrote:After taking a look at the structure, I think I have to pass implementing this. I can't find a way to add something before the resolve without detroying the nice structure of the ability factory. I just can't code so elegantly. Unless someone gives me a hint or batch of code I can start from I'm gonna drop this.
Wow that took no time at all. Little things like this will keep our structure clean and the copy-pasted code to a minimum.Sloth wrote:Thanks Sol. I commited the change. It was really easy with your help.
Sloth wrote:My next plan is to add unless costs to this resolve function. The only difference in the existing unless cost mechanic in AF counters is, that the unless cost is checked for each target of the counterspell. There is no counter ability that allows multiple targeted/defined spells and has an unless cost (and the prompt for the human isn't really worked out to support this).
Is it ok to pull out the unless cost from AF counterspell and put an all or nothing unless cost in front of sa.resolve() (like a Condition)? Subabilities would still resolve (for cards like Offering to Asha).