v60.0 Update: The Grand Source Refactoring
The Grand Source Refactoring applies a large and complex change to the inner workings of TCG ONE Game Engine and introduces seamless and robust attribution of Source effects for every effect executed or triggered and provides centralised access to them. This provides a bunch of benefits like ability to hook into more different types of triggers, ability to implement complex interactions and effects with top precision and ease, less verbose and correct code via automated inner attribution, which all mean less number of bugs. These changes affect all 16000+ playable cards on TCG ONE, making it a grand one.
TCG ONE is committed to providing the most correct and error-free gameplay experience. Weâve been tracking all bug reports in our forum since 2018 and a few months ago the open bug reports count had surpassed 2300. Through some great bug fixing effort recently, we were able to reduce this number to below 1700. Thatâs more than 600 resolved reports in a few months! We are prioritising handling of bug reports to further reduce this number in the upcoming releases. Please continue to be on the lookout for any bugs & errors and report them (using the in-game tool). Credits to @Tegull for great work in card testing and validation.
Fixes & Changes:
- Stealthy Hood have been fixed properly! Despite its popularity, Stealthy Hood has been a challenging card for TCG ONE Game Engine since its release and weâve received dozens of bug reports on this cardâs interactions, the most popular one being vs Garbotoxin. With this huge refactoring, the engine is now much more flexible and can handle advanced interactions quite well, including this one, and all interactions should have been fixed. Weâll be doing validations on open bug reports and mark them resolved.
- Canât use attack next turn like effects will now be removed upon stage change.
- Base damage boosting effects for the next turn will now be removed upon stage change.
- Omega Stop Ancient Trait will now correctly only prevent effects of opponentâs abilities done to self.
- Optimised all âuse supporterâs effectâ like effects; via replacing PlayTrainer usage to ActivateSimpleTrainer. Resolves many interaction problems with simplified code.
- Light Dragoniteâs Miraculous Wind (and also Spectral Breach) gets a rewrite and simplification.
- Energy cards that are ought to be discarded at the end of the attachment turn (Boost, Aqua, Magma, Triple Accel, Miracle, etc) would now interact with Miraculous Wind similarly; with following text: âIf this card is attached to 1 of your PokĂ©mon, discard it at the end of the turn.â
- Custom type icons of special energies will be recalculated when their energy are modified through an effect, e.g. when Miraculous Wind is active, all special energy will also show up as [C]. Previously, some energy were excluded from this, leading to confusion.
- Legendary Body (Neo) Poke-Bodies gets a rewrite to resolve some rare interactions.
- Many other edge interaction cases were perfected.
- Fixes many (unreleased) Platinum cards.
- Added Sabrina & Brycen (SMP 246) to SM Series format.
- Fixed targeting issues with "Shady Move"s, Amoonguss (UNM 14) Bursting Spores, Spiritomb (SHL) Cursed Whirlpool, Snorlax (PLS) Block, Lysandre (FLF).
- DeveloperPanel (on dev server) will show full card name with larger page size to make it easy to find cards.
Developer Notes
- Explicit source settings in card implementations are not effective anymore, sources are set in the root actions. Please do not set any Source.XYZ setting in new card implementations or updates. Existing references are can be cleaned up later on. (Source Erasure)
- There are five major source objects: Attack, Ability, Card, TrainerCard, SpecialEnergyCard. They can now be accessed the Event (e), therefore, filtering can be done via properties of these objects.
Full Commit Logs
Source Refactoring: Massive initial commit
- New class: SourceEffect. It denotes the effects which will change the source. This is only used by the effects which would change a source. TargetedEffect.getSource() has been removed.
- EventManager automatically keeps track of SourceEffects in a stack and reuses them during delayed effect processing, via a new originalSourceEffect field in DelayedEffect.
- All transitive Source.XYZ usages will be removed shortly.
- TargetedEffect gets another huge refactor too; the getResolvedTarget(bg, e) method has been replaced by getTargetPokemon(). Added Effect.initialize() method to resolve legacy Targets instead. All instances and usages have been reworked.
- Removed MultiTargetedEffect alongside TargetedEffect changes
- Move is not an Effect anymore (as Attack is the main executor).
- Changed many EVOLVE/LEVEL_UP usages to CHANGE_STAGE while I could.
- Implement SourceEffect in PlayCard, Attack, UseAbility.
- Changed many custom effects into non-MoveEffect versions to ensure flexibility.
- Change TargetedEffect.getResolvedTarget(bg, e) to getTargetPokemon().
- Change Event.getTarget(bg) to getTargetPokemon().
- Removed effectiveness of Source setting in card implementations, to be followed up with an actual purge from card implementations and statics. So this commit is not target for a release.
Source Refactoring: Getter Effects
- They now record their original source at the moment of registration which gets used during execution.
- They now extend TargetedEffect and each execution inherits target from the root getter.
- They now trigger BEFORE phase Events too, and they can now be blocked for each individual source and target value.
Source Refactoring: Abilities
- All effects of abilities are now properly sourced via the new mechanism!
- That is done via the new carefully constructed UseAbilityInner and UseAbilityOuter effects which are SourceEffects. Actions of abilities now use UseAbilityOuter to correctly attribute all effects by abilities.
- Stealthy Hood (UNB) can now properly block (only) effects of abilities from opponentâs Pokemon done to this Pokemon (50+ open bug reports to be resolved).
- Upgrades implementation of Shiftry EX (CG 97), Tyranitar (SF 30), Corviknight VMAX (BST 110), Aerodactyl (MD 15)
- Pokemon Power usages of Legacy sets have also been reworked manually, so they are also compatible with UseAbilityOuter/Inner such that they would be compatible with Alakazam (MT) Power Cancel, etc. (Base Set until Aquapolis done, rest is next).
- The old ability related EffectTypes were removed alongside their usages.
- Simplified Chimecho Delta (HP 37) supporter check logic.
- Adapt Poke-Powers in the rest of the legacy implementations to use the new UseAbilityOuter effect.
Source Refactoring: Special Energies
- Special Energy activation process and effects were upgraded to take advantage of Source Refactoring. They now work via the new ActivateSpecialEnergy effect which marks them with SRC_SPECIAL_ENERGY.
- All Special Energy cards including Legacy implementations were upgraded to the new mechanism.
- Energy cards that are ought to be discarded at the end of the attachment turn (Boost, Aqua, Magma, Triple Accel, Miracle, etc) would now interact with Miraculous Wind similarly; with following text: âIf this card is attached to 1 of your PokĂ©mon, discard it at the end of the turn.â
- Streamlined and simplified Miraculous Wind and Spectral Breach effects.
- Applied Source erasure for SRC_SPENERGY as effects do not need to set sources anymore under the new mechanism.
- Custom type icons of special energies will be recalculated when their energy are modified through an effect, e.g. when Miraculous Wind is active, all special energy will also show up as [C]. Previously, some energy were excluded from this.
Source Refactoring: Trainers
- PlayTrainer and AttachPokemonTool are now SourceEffects.
- PlayTrainer & ActivateSimpleTrainer refactoring: Legacy Trainer, Item and Supporter effects are now handled through the new ActivateSimpleTrainer effect; which only applies the cardâs effect without discarding it.
- Optimizes and simplifies all âuse supporterâs effectâ like effects; via replacing PlayTrainer usage to ActivateSimpleTrainer. Auto infers attributed sources of these effects to whatever effect that used it, fixing many iteraction bugs.
- Action now remembers its original source and reuses it, just like DelayedEffect and GetterEffect, in order to attribute Stadium effects to the correct source.
- Some PLAY_POKEMON_TOOL triggers were replaced with ATTACH_POKEMON_TOOL instead.
- Various minor fixes and cleanups.
Source Refactoring: Misc fixes
- Omega Stop Ancient Trait will correctly only prevent effects of opponentâs abilities done to self.
- Many other edge interaction cases were perfected.
- Added specific targets to some statics
- And some more fixes
Platinum Fixes (Credits to @Lithogen)
- Update SHAYMIN_14 Damage Aid to clear status after damage
- Update SHAYMIN_15 Growth energy requirement
- Updated GIRATINA_28 weakness damage modifier
- Updated CARNIVINE_43 weakness damage modifier
- Updated CASCOON_44 weakness damage modifier
- Updated DIALGA_23 weakness damage modifier
- Updated CARNIVINE_68 weakness damage modifier
- Updated BLISSEY_22 Nurse Call to only be called once per turn
- Update BLASTOISE_2 Dig Well to not choose any energy
- Fix SHAYMIN_LV_X_127 Revenge Seed to only apply to G pokemon and attacks
- Fix LOTAD_SH4 Swift Swim to activate with only W energy
- Fix VULPIX_SH6 weakness, attack cost, Inflame bug
- Fix DIALGA_6 Time Aura to only block evolution of active
- Fix DELCATTY_4 Power Circulation to rearrange correctly
- Fix DIALGA_5 Reverse Time to rearrange correctly
- Fix CACTURNE_42 Poison Experiment effect should be optional
- Fix GARDEVOIR_8 Psychic Connect to be re-usable
- Fix Memory Berry to not discard itself
- Fix LUDICOLO_34 Cheerful Voice to stay after switching
- Fix ALTARIA_18 to account for LEVEL_UP
- Fix AMPHAROS_1 Damage Bind to target correctly