Page 1 of 4

So I got a little sidetracked... again.

PostPosted: 21 Apr 2012, 11:27
by Hellfish
I'll just leave this here.

Re: So I got a little sidetracked... again.

PostPosted: 21 Apr 2012, 12:37
by friarsol
Oh dear... For those that can't see the cards involved:

Duct Crawler, <something that gives a +1/+1 counter, wasn't paying attention>, and... Experiment Kraj

Re: So I got a little sidetracked... again.

PostPosted: 21 Apr 2012, 13:16
by moomarc
OMG! That's awesome!

Do you think its anywhere near possible to make it work for scripted cards? If so is there anything we need to do to help. Maybe if activated abilities in scripts were blocked out (including all relevant svars) for easy reference? Something like this:
Code: Select all
Name:Baku Altar
ManaCost:2
Types:Artifact
Text:no text
T:Mode$ ...
SVar:Trig...
<Start Activated Abilities>
A:AB$ Token | Cost$ 2 T SubCounter<1/KI> | TokenAmount$ 1 | TokenName$ Spirit | TokenTypes$ Creature,Spirit | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | TokenOwner$ You | SpellDescription$ Put a 1/1 colorless Spirit creature token onto the battlefield.
<End Activated Abilities>
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/baku_altar.jpg
SetInfo:BOK|Rare|http://magiccards.info/scans/en/bok/152.jpg
Oracle:Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Baku Altar.\n{2}, {T}, Remove a ki counter from Baku Altar: Put a 1/1 colorless Spirit creature token onto the battlefield.
End
I'd be willing to start converting the scripts for the Experimental Kraj (and I'm guessing it could then be carried across to cards like Havengul Lich etc).

Re: So I got a little sidetracked... again.

PostPosted: 21 Apr 2012, 13:37
by Hellfish
Marc: The simplest solution would be to just copy every SVar except Picture,Picture1,Rarity,RemAIDeck,RemRandomDeck and the like. Your suggestion is much more elegantly functioning though.A lot of X SVars will to be renamed for uniqueness too(And some places that demand X is used will probably need to be rewritten to allow arbitrary SVar names.

Sol: Travel Preparations. ;)

This requires turning all anonymous instances of AbilityActivated into local subclasses. Simple enough with a C&P job. Not sure if/how this affects heap space,though.

Re: So I got a little sidetracked... again.

PostPosted: 21 Apr 2012, 16:55
by silly freak
the Compiler takes care of inline classes; in the end, they are all ordinary classes with some generated fields and fancy access ti the outer class. so no problem there. if the nested class could even be made static, It's even possible that there's a positive performance impact ;)

Re: So I got a little sidetracked... again.

PostPosted: 22 Apr 2012, 11:30
by Hellfish
Thanks, good to know. :)

Small update: Working on interaction with ability-granting things like Blazing Torch.

Re: So I got a little sidetracked... again.

PostPosted: 22 Apr 2012, 17:27
by Hellfish
Update:Moved the hardcoded bit that actually handled the copying of the abilities into StaticAbilityContinuous.Converted Experiment Kraj to script and added Necrotic Ooze. AFAICT, every AbilityActivated anonymous instance has been turned into a subclass that can be "stolen".Added "ActivatedAbilitiesBegin" and "ActivatedAbilitiesEnd" flags as per Marc's suggestion, though no cards use them yet.

Also, have a jar & patch combo meal for testing :)
AbilityPatch 1.txt
(186.12 KiB) Downloaded 228 times


EDIT:Apparentyl uploadstation is shit and won't let anybody download the jar (gives "Only uploader may download" message even to me!). Hold tight while I upload elsewhere.APPARENTLY Filehosting sites as a whole have gone to shit since megaupload. :(

Re: So I got a little sidetracked... again.

PostPosted: 22 Apr 2012, 17:32
by friarsol
I'm not sure how I feel about the Activated Abilites Block. It feels cluttered to me.

Re: So I got a little sidetracked... again.

PostPosted: 22 Apr 2012, 17:51
by Hellfish
I'm not sure how else to handle "assistant" SVars,though. Copying all the non-omnipresent svars could concievably break things that grant Kraj or Ooze svars..

Re: So I got a little sidetracked... again.

PostPosted: 25 Apr 2012, 18:14
by Hellfish
Been thinking a bit and there *might* be a way for spellabilities to autodetect "assistant" SVar with a bit of invasive surgery to them and Costs. Still, a ton of SVars would have to be renamed for uniqueness, XYZ SVars foremost. Cost would need to accept arbitrary SVar names too.

Re: So I got a little sidetracked... again.

PostPosted: 27 Apr 2012, 20:03
by Hellfish
Rethinking *again*... Previous idea is likely not doable without really,and I mean really, tainting the Cost and AbilityFactories codebase. Least intrusive method (but most arduous) would probably be to rename all SVars for all activated abilities on all cards according to the pattern "AAB_<Card Name>_<Identifier>".

EDIT:We'd still need to add the possibility for arbitrary SVar names in a few places still,also.

EDIT:Maybe a more strict SVar naming regimen overall is called for, in case we ever get a card that gains "all triggered abilities" or even "all abilities". "<Type(AAB,TRIG,STAT,more?)>_<Card Name>_<Identifier>"?

Re: So I got a little sidetracked... again.

PostPosted: 27 Apr 2012, 20:37
by friarsol
Hellfish wrote:Rethinking *again*... Previous idea is likely not doable without really,and I mean really, tainting the Cost and AbilityFactories codebase. Least intrusive method (but most arduous) would probably be to rename all SVars for all activated abilities on all cards according to the pattern "AAB_<Card Name>_<Identifier>".

EDIT:We'd still need to add the possibility for arbitrary SVar names in a few places still,also.
I almost feel like we need to move away from using SVars at all to handle all of this. Instead of having a arbitrary String Variables attached to a card, maybe we need to have them strictly attached to the SpellAbility they are apart of.

This might sidetrack this thread, but maybe we can compile a list of SVars, how they are used and see if we can figure out a way to move them off of Card objects.

Re: So I got a little sidetracked... again.

PostPosted: 27 Apr 2012, 21:45
by Hellfish
    Subabilities -> SpellAbilities (Already there,right?)
    Triggered abilities -> Trigger Object?
    Statically granted abilities -> StaticAbility?
    XCounts -> ?
    Rarity (Not even referenced in code,AFAICT) -> absolutely-removed-from-the-freaking-game-forever zone
    LQ Picture URLs -> nowhere else
    AI Usage limitations -> nowhere else

Re: So I got a little sidetracked... again.

PostPosted: 27 Apr 2012, 22:07
by Max mtg
Hellfish wrote:
    Rarity (Not even referenced in code,AFAICT) -> absolutely-removed-from-the-freaking-game-forever zone
You may learn rarity for CardPrinted objects. forge.Card did not need it anyway.

Re: So I got a little sidetracked... again.

PostPosted: 28 Apr 2012, 06:47
by Hellfish
Exactly;CardPrinted gets the rarity from the SetInfo, so the rarity SVar is just filler nowadays.