It is currently 11 May 2025, 15:09
   
Text Size

Playing a permanent spell belonging to another player

Moderator: CCGHQ Admins

Playing a permanent spell belonging to another player

Postby thefiremind » 10 Jun 2012, 08:42

I'm trying to code Mindleech Mass, but there's a problem I would have never imagined.
By using either PlaySpellForFreeAtAnyTime or PlayFreeFromAnywhere, if the spell is a permanent, it enters the battlefield under its owner's control instead of mine! #-o

I temporarily solved the problem by adding this trigger:
Code: Select all
  <TRIGGERED_ABILITY internal="1" pre_trigger="1" active_zone="any">
    <TRIGGER value="COMES_INTO_PLAY">
    if MTG():ObjectDataChest():Get_ProtectedCardPtr( 1 ) ~= nil and
    TriggerObject() == MTG():ObjectDataChest():Get_ProtectedCardPtr( 1 ) and
    TriggerObject():GetOwner() ~= Object():GetPlayer() and
    TriggerObject():WasCast() ~= 0 then
      local types = TriggerObject():GetCardType()
      if (types:Test( CARD_TYPE_ARTIFACT ) ~= 0 or
      types:Test( CARD_TYPE_ENCHANTMENT ) ~= 0 or
      types:Test( CARD_TYPE_LAND ) ~= 0 or
      types:Test( CARD_TYPE_CREATURE ) ~= 0 or
      types:Test( CARD_TYPE_PLANESWALKER ) ~= 0) then
        MTG():ObjectDataChest():Set_ProtectedCardPtr( 1, nil )
        return true
      end
    end
    return false
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    TriggerObject():SetPermanentController( Object():GetPlayer() )
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
(the ProtectedCardPtr contains the card I cast)

Did anyone experience this problem and found a more elegant solution?
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Playing a permanent spell belonging to another player

Postby thefiremind » 25 Jun 2012, 21:32

This problem persists in DotP2013, and the old solution doesn't work anymore... maybe I'm doing something wrong with the new trigger specifications, I don't know. Anyway, if I make a Ninja deck, I won't be able to code Silent-Blade Oni. :(
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Playing a permanent spell belonging to another player

Postby GravitonGamer » 29 Jun 2012, 06:34

Have you tried PseudoPlaySpell? I've seen it on some cards but I haven't used it myself yet.
GravitonGamer
 
Posts: 15
Joined: 18 Sep 2011, 04:21
Has thanked: 7 times
Been thanked: 7 times

Re: Playing a permanent spell belonging to another player

Postby thefiremind » 29 Jun 2012, 08:35

GravitonGamer wrote:Have you tried PseudoPlaySpell? I've seen it on some cards but I haven't used it myself yet.
PseudoPlaySpell doesn't play the spell, but uses SPELL_ABILITY when there's one: it's made for Auras, so you can still choose what to enchant even if you didn't play them.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Playing a permanent spell belonging to another player

Postby Jspapp » 04 Jul 2012, 23:38

I've been playing around with this with not much luck.
Have you tried your earlier solution with SetPermanentController() inside of a <CONTINUOUS_ACTION> instead of a <RESOLUTION_TIME_ACTION> to make it work in 2013?
Jspapp
 
Posts: 8
Joined: 03 Jul 2012, 00:17
Has thanked: 2 times
Been thanked: 0 time


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 3 guests


Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 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 3 guests

Login Form