Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
A rule prevents Bitterheart Witch from being coded
Moderator: CCGHQ Admins
10 posts
• Page 1 of 1
A rule prevents Bitterheart Witch from being coded
by thefiremind » 14 Aug 2012, 22:43
I was about to code Bitterheart Witch, then the ruling on Gatherer stopped me:
"The Curse must be legally able to enchant the player. For example, if the player has protection from red, you couldn't put a red Curse onto the battlefield this way."
There's no CanAttachTo for players, so how could this be achieved? I thought about crazy things like making all players except the chosen one untargettable by the chosen curse, and then put it into play with PseudoPlaySpell... but it's still not correct because I shouldn't even be allowed to choose a curse that I can't put on the chosen player.
I'm hoping that someone comes up with a brilliant idea, but I think it will be hard.
"The Curse must be legally able to enchant the player. For example, if the player has protection from red, you couldn't put a red Curse onto the battlefield this way."
There's no CanAttachTo for players, so how could this be achieved? I thought about crazy things like making all players except the chosen one untargettable by the chosen curse, and then put it into play with PseudoPlaySpell... but it's still not correct because I shouldn't even be allowed to choose a curse that I can't put on the chosen player.
I'm hoping that someone comes up with a brilliant idea, but I think it will be hard.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: A rule prevents Bitterheart Witch from being coded
by sadlyblue » 15 Aug 2012, 08:35
I don't think it will be possible to coded it correctly.
The only card i could find that gives players protection from a color was Seht's Tiger. And you could try to code it and them try to see how it works.
The only card i could find that gives players protection from a color was Seht's Tiger. And you could try to code it and them try to see how it works.
Re: A rule prevents Bitterheart Witch from being coded
by thefiremind » 15 Aug 2012, 09:37
There's also Faith's Shield, which is already in the game (even if only in a challenge). Anyway I'll make my curse deck even without Bitterheart Witch.sadlyblue wrote:I don't think it will be possible to coded it correctly.
The only card i could find that gives players protection from a color was Seht's Tiger. And you could try to code it and them try to see how it works.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: A rule prevents Bitterheart Witch from being coded
by nabeshin » 13 Sep 2012, 22:07
"attached to target player", where is problem? use standard target definition, if someone protected then it will not be captivated.
Re: A rule prevents Bitterheart Witch from being coded
by thefiremind » 14 Sep 2012, 08:30
But you shouldn't even be able to select a Curse if you can't attach it to target player, according to Gatherer. That's the problem.nabeshin wrote:"attached to target player", where is problem? use standard target definition, if someone protected then it will not be captivated.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: A rule prevents Bitterheart Witch from being coded
by nabeshin » 15 Sep 2012, 18:30
"you may search your library for a Curse card" - , you find a curse, select curse, and then - if no legal target - do nothing.thefiremind wrote:But you shouldn't even be able to select a Curse if you can't attach it to target player, according to Gatherer. That's the problem.nabeshin wrote:"attached to target player", where is problem? use standard target definition, if someone protected then it will not be captivated.
Re: A rule prevents Bitterheart Witch from being coded
by thefiremind » 16 Sep 2012, 08:42
This is becoming a matter of personal interpretation, but I'm quite sure I interpreted the Gatherer ruling correctly:


< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: A rule prevents Bitterheart Witch from being coded
by nabeshin » 21 Sep 2012, 17:21
we won't break a rule, we will simply check existence of the suitable target for every curse in library, and then show only legal one.(use for this LoadTargetDefinition and TestFilter)
Re: A rule prevents Bitterheart Witch from being coded
by thefiremind » 21 Sep 2012, 18:13
This would be a great idea, but can we really load a target definition from another object by using LoadTargetDefinition? The IDs aren't unique inside the whole card, but only inside each ability (for example, a card with 2 abilities can have id="0" in both abilities), so if you call LoadTargetDefinition from another object, how can the game understand which ability you are referring to?nabeshin wrote:we won't break a rule, we will simply check existence of the suitable target for every curse in library, and then show only legal one.(use for this LoadTargetDefinition and TestFilter)
If you have a working example, please share: I'm sure that it would be very useful also for other cards and other modders.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: A rule prevents Bitterheart Witch from being coded
by nabeshin » 09 Oct 2012, 10:21
atm all curses don't have additional req. for cast, can we check current prot. for plr?
maybe:
local filter = Object():GetFilter()
filter:Clear()
filter:SetFilterType( FILTER_TYPE_PLAYERS )
filter:SetZone( ZONE_IN_PLAY )
target_player:TestFilter(filter,EffectController())
+ add to this obj ENCHANTMENT_TYPE_CURSE, and swap color to curse color .( omg, awesome code detected... )
PS work suxx anyway, but if u need new print plugin for tinymce, take this... (open edited content in new window, w/o all other shit, and print. coded by I.)
maybe:
local filter = Object():GetFilter()
filter:Clear()
filter:SetFilterType( FILTER_TYPE_PLAYERS )
filter:SetZone( ZONE_IN_PLAY )
target_player:TestFilter(filter,EffectController())
+ add to this obj ENCHANTMENT_TYPE_CURSE, and swap color to curse color .( omg, awesome code detected... )
PS work suxx anyway, but if u need new print plugin for tinymce, take this... (open edited content in new window, w/o all other shit, and print. coded by I.)
- Attachments
-
print.rar- (943 Bytes) Downloaded 206 times
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests