It is currently 16 Apr 2024, 11:48
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Card Development Questions

Postby swordshine » 27 Jul 2016, 12:02

WoW! I like Karador, Ghost Chieftain!
IIRC, we failed to make a tricky script for Karador, Ghost Chieftain long ago. We attempted to use static triggers and abilities to grant creatures in graveyard MayPlay effects. However, that script was not compatible with cards containing intrinsic MayPlay effects like Gravecrawler. When we rework this effect, I think we should give options
to choose the MayPlay effect if multiple ones exist.
https://docs.google.com/spreadsheets/d/1uFe5KP1pdNELf0ESRrPdbZ0wO8TL2fHaLAFTbKvCjgs/edit#gid=2
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Development Questions

Postby Hanmac » 27 Jul 2016, 12:14

@swordshine: thats the plan ....
currently i am cleaning up the previous cards.

like removing "May be played by your opponent" and similar stuff which has more or less only visual effect, and replace it if needed with MayPlay stuff.

when i then turned all "May be played" keywords, into MayPlay Effects (for that i need to turn some Pump effects into "Effect" Effects)

then when all keywords are transformed, i will try to rewrite the mayPlayFunction and the PlayOption object (or remove it if not needed anymore)
then i will use the StaticEffect object to store a counter inside.

then for the play function, i somehow need to connect it over the mayPlay function with the StaticEffect, so the Effect can see if its effect is used.
(or add a Variable to the SpellCast trigger, so the cards can look for that themselves)

and yeah when i finish the rewriting, then Gravecrawler will look like:


probably hiding when the Effect does affect its own card.

if it does work correct, then we could also do Hedonist's Trove ...

with that, Standard will reach 100% ! *yeah*
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Hanmac » 28 Jul 2016, 09:48

Quick update so far for my MayPlay project:
grep "May be played" -R | wc -l #=> 32
grep "MayPlay" -R | wc -l #=> 33
grep "MayPlay" -R | grep "May be played" | wc -l #=> 0
as seen in the stats before, the "May be played" are reduced from 49 to 32, while the MayPlay have increased from 25 to 33.

Keywords like the list have been removed:
  • May be played by opponent
    Not needed anymore, was only used for visual effect
  • May be played without paying its mana cost and as though it has flash
    add new Flag MayPlayWithFlash, using just Flash does not work.
  • May be played without paying its mana cost
    use MayPlayWithoutManaCost

:!: Found Problem: :!:
if an effect allows to cast something without paying its manacost,
it somehow does allow it to be cast WITH paying the manacost too for its normal SpellAbility Effect (from a zone like Exile or Graveyard)
that should not be possible.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby swordshine » 28 Jul 2016, 12:20

Hanmac wrote:Quick update so far for my MayPlay project:
:!: Found Problem: :!:
if an effect allows to cast something without paying its manacost,
it somehow does allow it to be cast WITH paying the manacost too for its normal SpellAbility Effect (from a zone like Exile or Graveyard)
that should not be possible.
I think the original sa passed the forge.game.spellability.SpellAbilityRestriction.checkZoneRestrictions(Card, SpellAbility) Line 219.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Development Questions

Postby Hanmac » 28 Jul 2016, 12:31

Hm you are right, there is a MayPlay check which cause it to return true. But imo should that only happen for the Spellabilities created by MayPlay (the copies)
I think an extra check for !IsBasicSpell might help. (Until I rewrite it more)
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Hanmac » 30 Jul 2016, 03:14

Next Update to my MayPlay project:

so between 3 and 5 in the morning, i converted all cards from "May be played" into MayPlay stuff.
("You may look at this card." might be convert too, but thats a work for another time)

now back to sleep, after i wake up again, i can remove "May be played" from the game too.

then i can finally try to add a counting somehow.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Hanmac » 30 Jul 2016, 11:47

:!: Bam! Big Update! :!:
i commited my changes for the MayPlay thing.

i wanted to use the StaticEffect object for counting but that didn't work as i wanted.

now i did use the Card object of the Effect host.
Card now does count how often its MayPlay Effect got used per turn.

the counting get reset on cleanup, or when the card is moved.
(its not copied on purpose, like if you blink Karador)

the Result:
Karador, Ghost Chieftain is now scripted and does work as it should.
and i did script Hedonist's Trove too.

you guys might lookout how i did it, probably you might do some fixes cleaner.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Hanmac » 01 Aug 2016, 10:09

i did a change for Screeching Bat/Stalking Vampire
now the AI does try to check which creature is better for attacking.
like if the Vampire can't attack good, maybe transforming into Bat again is better?

===
i didn't get it yet for Elusive Tormentor/Insidious Mist.
for that one i am not sure yet why i didn't get in checkPhaseRestrictions

i probably need to checkout willPayCosts,
hopefully i did not break ComputerUtilCost.checkDiscardCost. :(

Edit:
for Elusive Tormentor, i wanted to add a way that AI can use the transform ability to prevent it from being targeted by destroy or exile abilities. (or general negative effects)
from TokenAI.canInterruptSacrifice there is a way where i can look at this using peekAbility.

i want to write it general. (not only checking for the name)

===
i also thought about using some AI for Hanweir Garrison/Hanweir Battlements/Hanweir, the Writhing Township.
IMO the AI should use the Transform ability in MAIN1 so it can attack with the Township.
===

or what do you guys think?
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Hanmac » 02 Aug 2016, 08:33

i added a change to AiAttackController,
its about the Attack rule of Silent Arbiter.

before:
AI wants to attack, probably all in.
but then the Rules violation does reset it to zero creatures.

now:
AI notices the rule, and does try to attack with the strongest if able.

===
please look at this change, probably it can be done better,
and notice me if you got problems now with attacking.
i am not 100% sure if i did fix it correct.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Hanmac » 03 Aug 2016, 16:29

i did some big changes for MayPlay again. (sorry guys)

for that Alternative Cost/Emerge/Offering are turned into keywords.
(because they might be used for MayPlay)
Rooftop Storm + Gisa and Geralf

Bestow was a big egg, because MayPlay for Creatures does not allow it:
Gisa and Geralf + Spiteful Returned

===
What i didn't get working yet:
some rules change for EMN says that with Sigarda's Aid you can cast Bestow with flash.

currently that might not be easy possible, i think the easiest way would be something hidden like:
"You may cast bestow spells as though they had flash."

because,
"Affected$ Card.Aura+YouCtrl,Card.Equipment+YouCtrl | AddHiddenKeyword$ Flash"
can not be used if i only want to target one of its SpellAbilities.
and even if i can, adding a Keyword does not work that way.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Hanmac » 06 Aug 2016, 12:52

i added a new Trigger for Rakshasa Vizier,
named ChangesZoneAll (or would be Once better?)


i added the trigger so some Effects, Delve and HumanPlay stuff.
that should work for most of the stuff.

for some else you guys might check what is missing.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby swordshine » 06 Aug 2016, 15:05

Found a bug: I exiled all cards from an opponent's graveyard and fired Rakshasa Vizier's trigger.
Edit: Fixed this one.
Last edited by swordshine on 06 Aug 2016, 15:20, edited 1 time in total.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Development Questions

Postby Hanmac » 06 Aug 2016, 15:19

swordshine: ah found a typo, will fix it soon
ahh you where already faster XD

hm there are a few corner cases where it might not work yet.

for example in CostExile, used by AI.
there it doesn't work yet, someone else might look how that can be done nicely.
===
Edit: i am currently trying to implement Quicksilver Elemental.

for that i noticed that the AI currently can't use the color convert functions from things like Daxos of Meletis ... someone might try to fix that.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Hanmac » 06 Aug 2016, 17:38

i added Quicksilver Elemental, it does work for most of the stuff.

:!: But for unknown reason it shows {1} instead of {U} for the Mana to pay.
(but it still works correct and only {U} is allowed)

i tried to debug it, with step by step debugger, but i didn't find yet where the {1} does come from.
Might be a Graphical problem, because it can't be paid with other colors.

===
and AI still can't use any of Color Convert stuff ... don't ask me why.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Card Development Questions

Postby Hanmac » 07 Aug 2016, 10:26

I got Bestow working for Flash. (without extra keywords)

i did it with animating, checking Static Abilities and unanimating again.
while that i also did fix Prophet of Kruphix which only gives flash to the creature spells.

9/15/2013: If you’re casting a creature spell with bestow, whether or not it has flash will depend on if you’re casting it as a creature or as an Aura. Prophet of Kruphix won’t give flash to a spell with bestow you’re casting as an Aura.
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 46 guests

cron

Who is online

In total there are 46 users online :: 0 registered, 0 hidden and 46 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 46 guests

Login Form