Some of the things refactored to the base class:
- isPaymentSet()
- canPay()
- Render()
- setSource()
- setPayment()
- the target instance
- duplicated constructor initialization crap
I'm not interested in pointing fingers as to how the code got this way, but I'll ask that everyone who's altered this code in one fashion or another to carefully diff this change and understand what I refactored. This code is a poster child for neglect & what happens when people start blindly copy & pasting code instead of paying attention to the commonality between code paths. If you see the same lines of code happening over & over, and you're about to make yet another copy, please stop yourself & think about how you can refactor the code to be in a single shared function (or, more explicitly, a shared base member function when possible).
If you don't understand what I mean by a shared base member function, then I would suggest at the very least reading up on this topic:
http://www.cplusplus.com/doc/tutorial/inheritance/
(And, after all that, if you're still unsure how to proceed, ping someone else for advice!)
- new features by Zethfox:
-- "oneshot" optional parameters for lords (helps fixing issues with bouncelands)
-- Life as a cost (avoids using a dirty trick of paying life as an effect)
-- set life total abilitiy (lifeset
-- new auto lines: autostack, autoexile
The test suite passes with these changes, also no test using these abilities has been added yet
- minor fix in Zethfox cards addon (Bad lines error from parser)
- Zethfox's patch for {t(target)} as an extra Cost. Works the same way as sacrifice, check Azami, Lady of Scrolls for an example
- fixed compilation on the PSP (sorry!)
- Added remove/add counters as a cost, patch by Salmelo, thanks man!. See primitives/mtg.txt -> Thallid to see how it works
- added test for i286 by salmelo
- added basic display for counters (this needs improvement) by salmelo
- Added Dr Solomat's TEMPEST expansion
- Added Sacrifice as part of the cost of activated abilities. Making it work as an extra cost for "put in play" still requires some work though. "Render" methods need to be written correctly
- Added cards with sacrifice in the existing sets. Most of them need testing...