Delve mechanics

Initially i thought that Delve could create some problems because of the mana cost retrieve, working with Xander9009 we have resolved this issue, but after this i have encountered many other issues because of Delve definition
The official rules for delve are as follows:
I want to focus on 2 points :
1. Previously, delve reduced the cost to cast a spell. Under the current rules, you exile cards from your graveyard at the same time you pay the spell’s cost. Exiling a card this way is simply another way to pay that cost.
This means i cannot use decrease cost function but to be rules compliant we have to create mana for the spell.
2. Because delve isn’t an alternative cost, it can be used in conjunction with alternative costs
This means that should be usable also with Flashback and other similar alternative costs!
I have made an approximation based on the card : Dig Through Time
REVISION : I changed the code of the card due of some problems handling Mana tokens generated from different zones, so to avoid any issues i decided to override the rule 1 above, we will use Delve as cost reduction, this solution will have less impact on the game.
TO USE DELVE :
ACTIVATE THE ABILITY ON THE CARD
SELECT THE CARDS YOU WANT TO EXILE FROM GRAVEYARD
THEN CAST THE SPELL (Obviously you need to have the available mana to do it)
The attached WAD contains Dig Through Time (card + xml + HQtdx) + TokenManager for abilities check + some needed functions for mana cost changing.
Special thanks to Xander9009 for his precious collaboration to develop mana cost functions and ability managers.

IMPORTANT!! TO USE THIS VERSION YOU NEED :
Riiak ManualMana Functions
Riiak ObjectDC Functions
Riiak Characteristics Functions
The official rules for delve are as follows:
- 702.65. Delve | Open
I want to focus on 2 points :
1. Previously, delve reduced the cost to cast a spell. Under the current rules, you exile cards from your graveyard at the same time you pay the spell’s cost. Exiling a card this way is simply another way to pay that cost.
This means i cannot use decrease cost function but to be rules compliant we have to create mana for the spell.
2. Because delve isn’t an alternative cost, it can be used in conjunction with alternative costs
This means that should be usable also with Flashback and other similar alternative costs!
I have made an approximation based on the card : Dig Through Time
REVISION : I changed the code of the card due of some problems handling Mana tokens generated from different zones, so to avoid any issues i decided to override the rule 1 above, we will use Delve as cost reduction, this solution will have less impact on the game.
TO USE DELVE :
ACTIVATE THE ABILITY ON THE CARD
SELECT THE CARDS YOU WANT TO EXILE FROM GRAVEYARD
THEN CAST THE SPELL (Obviously you need to have the available mana to do it)
The attached WAD contains Dig Through Time (card + xml + HQtdx) + TokenManager for abilities check + some needed functions for mana cost changing.
Special thanks to Xander9009 for his precious collaboration to develop mana cost functions and ability managers.


IMPORTANT!! TO USE THIS VERSION YOU NEED :
Riiak ManualMana Functions
Riiak ObjectDC Functions
Riiak Characteristics Functions