It is currently 21 Jul 2025, 16:00
   
Text Size

Community Wad

Moderator: CCGHQ Admins

Re: Community Wad

Postby Xander9009 » 28 Oct 2016, 14:36

Splinterverse wrote:How do you get a card's complete mana cost (not its converted cost, but it's "original" cost, such as 1RR instead of 3).
There is no built-in function for doing so, although there are a few methods that work in nearly all cases. NeoAnderson wrote a function for it, which is this: Neo_ReturnManaString(oCard). It requires the existence of the _MANAGER_ABILITIES_ACTIVE manager, which means you need this code on any card that calls the function:
Code: Select all
<TRIGGERED_ABILITY replacement_effect="1" active_zone="ZONE_ANY">
   <TRIGGER value="BEGINNING_OF_STEP">
      return MTG():GetStep() == STEP_UPKEEP and MTG():GetTurnNumber() == 0
   </TRIGGER>
   <RESOLUTION_TIME_ACTION>
      CW_General_CreateManagers("_MANAGER_ABILITIES_ACTIVE")
   </RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TOKEN_REGISTRATION reservation="1" type="_MANAGER_ABILITIES_ACTIVE" />
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Community Wad

Postby Splinterverse » 28 Oct 2016, 21:56

Finished coding for today; all cards referenced are from the missing cards list.

Coded, tested, and uploaded:
Æther Figment -- added kicker trigger and tested
Agonizing Demise -- added kicker trigger and tested
Anavolver -- added kicker trigger and tested
Apex Hawks -- added kicker trigger and tested
Arctic Merfolk -- added kicker trigger and tested
Ardent Soldier -- added kicker trigger and tested
Ashnod's Cylix
Bloodline Shaman
Coordinated Barrage
Disruption Aura
Distant Melody
Heart Wolf
Karona, False God
Kjeldoran Elite Guard
Luminescent Rain
Murmurs from Beyond
Orcish Veteran
Order of the Golden Cricket
Ovinomancer
Pack's Disdain
Pallimud
Parallectric Feedback
Paroxysm
Pearl Shard
Pedantic Learning
Peer Pressure
Pendrell Flux
Petals of Insight
Pious Kitsune

Bugs fixed:
Bull Elephant -- wasn't working properly
Loxodon Anchorite -- was preventing more than 2 damage
Phyrexian Grimoire -- minor tweak
Skyshroud War Beast -- was not filtering for opponent

HQ art uploaded (all were missing):
Heart Wolf
Heightened Awareness

Open Items:

-- CW_CARD_QUERY_SPLINTERVERSE has been updated and uploaded.

-- Does anyone know of a good example of card with a triggered ability that is available while it is in exile (other than the ability to cast it from exile)?

Next:

Back tomorrow to code through more missing cards.
---------------------------------------------
The DOTP2014 CW is updated nightly between 11 PM and 12 AM EST.
Known Issues/Bugs |
Impossible Cards List | Update Your Land Pools
Splinterverse
 
Posts: 918
Joined: 04 Sep 2016, 13:32
Has thanked: 150 times
Been thanked: 76 times

Re: Community Wad

Postby migookman » 28 Oct 2016, 22:17

Great job in coding Splinterverse! How about cards with 'Suspend' to look at with its Triggered Ability from Exile?

Also, I'm still having problems with Zhalfirin Crusader even though Xander gave me good advice.
Code: Select all
       <COST mana_cost="{1}{W}" type="Mana" />
           <TARGET tag="CARD_QUERY_CHOOSE_TARGET_TO_REDIRECT_DAMAGE" definition="0" compartment="0" count="1" />
      <TARGET_DEFINITION id="0">
         local filter = ClearFilter()
                        filter:SetFilterType( FILTER_TYPE_CARDS + FILTER_TYPE_PLAYERS )
         filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
      </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
         local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
               local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
         if target_creature ~= nil then
           local delayDC = EffectDC():Make_Chest(1)
            delayDC:Set_CardPtr(0, target_creature)
             MTG():CreateDelayedTrigger(25, delayDC)
           if target_player ~= nil then
            local delayDC = EffectDC():Make_Chest(1)
            delayDC:Set_PlayerPtr(0, target_player)
            MTG():CreateDelayedTrigger(25, delayDC)
         end
          end
      </RESOLUTION_TIME_ACTION>
   </ACTIVATED_ABILITY>
   <TRIGGERED_ABILITY resource_id="25" replacement_effect="1">
      <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_OBJECT" pre_trigger="1" damage_type="all">
         local TargetCard = EffectDC():Get_CardPtr(0)
         if TargetCard ~= nil then
            return TargetCard:GetCardType():Test(CARD_TYPE_CREATURE) and SecondaryObject() == EffectSource()
         else
            return false
         end
      </TRIGGER>
      <CLEANUP simple_cleanup="EndOfTurn" />
      <RESOLUTION_TIME_ACTION>
         local TargetCard = EffectDC():Get_CardPtr(0)
         if TargetCard ~= nil then
               Damage():RedirectAmountTo(1, TargetCard )
            end
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
     <TRIGGERED_ABILITY resource_id="25" replacement_effect="1">
      <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" pre_trigger="1" damage_type="all">
         local TargetPlayer = EffectDC():Get_PlayerPtr(0)
         if TargetPlayer ~= nil then
            return TargetPlayer:EffectDC():Get_PlayerPtr(0) and SecondaryObject() == EffectSource()
         else
            return false
         end
      </TRIGGER>
      <CLEANUP simple_cleanup="EndOfTurn" />
      <RESOLUTION_TIME_ACTION>
         local TargetPlayer = EffectDC():Get_PlayerPtr(0)
         if TargetPlayer ~= nil then
               Damage():RedirectAmountTo(1, TargetPlayer )
            end
      </RESOLUTION_TIME_ACTION>
      <SFX text="GLOBAL_PREVENT_PLAY" />
   </TRIGGERED_ABILITY>
User avatar
migookman
 
Posts: 135
Joined: 05 Aug 2014, 06:37
Has thanked: 22 times
Been thanked: 28 times

Re: Community Wad

Postby Splinterverse » 28 Oct 2016, 22:56

migookman wrote:Also, I'm still having problems with Zhalfirin Crusader even though Xander gave me good advice.
Maybe try changing the resource_id for one of the two, since you are using 25 for both. Other than that, I can't see anything wrong, but I haven't done anything with redirection yet, so I'm a novice in that area.
---------------------------------------------
The DOTP2014 CW is updated nightly between 11 PM and 12 AM EST.
Known Issues/Bugs |
Impossible Cards List | Update Your Land Pools
Splinterverse
 
Posts: 918
Joined: 04 Sep 2016, 13:32
Has thanked: 150 times
Been thanked: 76 times

Re: Community Wad

Postby tmxk2012917 » 29 Oct 2016, 05:04

After I cast Grapple with the Past, I could not return a land or creature from my graveyard.

As for Grim Flayer, he got +4/+0 rather than +2/+2
tmxk2012917
 
Posts: 164
Joined: 15 Mar 2015, 09:52
Has thanked: 20 times
Been thanked: 12 times

Re: Community Wad

Postby thefiremind » 29 Oct 2016, 09:50

migookman wrote:I'm still having problems with Zhalfirin Crusader even though Xander gave me good advice.
The second "if" in the code that creates the delayed triggers should be an "elseif". Either you do
Code: Select all
if ... then
    ...
elseif ... then
    ...
end
or
Code: Select all
if ... then
    ...
end
if ... then
    ...
end
but either way your code is missing something.
You should also use different resource_id's, because while it's true that only one of them is called each time, how does the game recognize which one to call if they are called the same? Alternatively you could make only 1 delayed trigger and discern between creature or player inside of it.

Oh and the CLEANUP should also have the fire_once="1" attribute, otherwise you'll keep redirecting 1 damage from all sources until the end of turn with just one activation.

Is <SFX text="GLOBAL_PREVENT_PLAY" /> useful? I think that replacement triggers can't show animations but I might be wrong there.
< 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: Community Wad

Postby Splinterverse » 29 Oct 2016, 09:58

tmxk2012917 wrote:After I cast Grapple with the Past, I could not return a land or creature from my graveyard.

As for Grim Flayer, he got +4/+0 rather than +2/+2
I think I've found and fixed the issues on both of these. Will test them today as I code other cards and upload tonight if they are work.
---------------------------------------------
The DOTP2014 CW is updated nightly between 11 PM and 12 AM EST.
Known Issues/Bugs |
Impossible Cards List | Update Your Land Pools
Splinterverse
 
Posts: 918
Joined: 04 Sep 2016, 13:32
Has thanked: 150 times
Been thanked: 76 times

Re: Community Wad

Postby Splinterverse » 29 Oct 2016, 10:18

What are the different parts of a filter condition as in filter:Add( FE_LUA_CONDITION, 1, EffectController(), EffectDC() )?

Could I use it to check the state of an opponent?
---------------------------------------------
The DOTP2014 CW is updated nightly between 11 PM and 12 AM EST.
Known Issues/Bugs |
Impossible Cards List | Update Your Land Pools
Splinterverse
 
Posts: 918
Joined: 04 Sep 2016, 13:32
Has thanked: 150 times
Been thanked: 76 times

Re: Community Wad

Postby Splinterverse » 29 Oct 2016, 13:14

Another question, what is the equivalent of a DO...WHILE loop in DOTP 2014? Is it "repeating"="1"? If so, how do you handle a repeating loop where the number of times needed to repeat is unknown?
---------------------------------------------
The DOTP2014 CW is updated nightly between 11 PM and 12 AM EST.
Known Issues/Bugs |
Impossible Cards List | Update Your Land Pools
Splinterverse
 
Posts: 918
Joined: 04 Sep 2016, 13:32
Has thanked: 150 times
Been thanked: 76 times

Re: Community Wad

Postby thefiremind » 29 Oct 2016, 13:53

Splinterverse wrote:What are the different parts of a filter condition as in filter:Add( FE_LUA_CONDITION, 1, EffectController(), EffectDC() )?

Could I use it to check the state of an opponent?
The number is the corresponding filter condition ID. I don't know what the other arguments do, and you can find places where EffectDC() is omitted, but I always put all the arguments, just in case.
What do you mean with "state"? Can you show an example of what you're trying to accomplish?

Splinterverse wrote:Another question, what is the equivalent of a DO...WHILE loop in DOTP 2014? Is it "repeating"="1"? If so, how do you handle a repeating loop where the number of times needed to repeat is unknown?
If you need to make a do...while, Lua has repeat...until (it's the same, but after "until" you'll write the stopping condition rather than the continuing condition). You need a RESOLUTION_TIME_ACTION with repeating="1" when you want to repeat your code while changing the state of the game between loop runs (state-based conditions are checked, answers to queries are evaluated, etc.).
Again, an example of what you're trying to accomplish would allow for a more accurate explanation.

By the way, I think that those questions would be more on-topic here (even if the topic has been dead for some time). Maybe there you'll also find answers to questions you haven't asked yet. :wink:
< 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: Community Wad

Postby Splinterverse » 29 Oct 2016, 14:07

thefiremind wrote:
Splinterverse wrote:What are the different parts of a filter condition as in filter:Add( FE_LUA_CONDITION, 1, EffectController(), EffectDC() )?

Could I use it to check the state of an opponent?
The number is the corresponding filter condition ID. I don't know what the other arguments do, and you can find places where EffectDC() is omitted, but I always put all the arguments, just in case.
What do you mean with "state"? Can you show an example of what you're trying to accomplish?

Splinterverse wrote:Another question, what is the equivalent of a DO...WHILE loop in DOTP 2014? Is it "repeating"="1"? If so, how do you handle a repeating loop where the number of times needed to repeat is unknown?
If you need to make a do...while, Lua has repeat...until (it's the same, but after "until" you'll write the stopping condition rather than the continuing condition). You need a RESOLUTION_TIME_ACTION with repeating="1" when you want to repeat your code while changing the state of the game between loop runs (state-based conditions are checked, answers to queries are evaluated, etc.).
Again, an example of what you're trying to accomplish would allow for a more accurate explanation.

By the way, I think that those questions would be more on-topic here (even if the topic has been dead for some time). Maybe there you'll also find answers to questions you haven't asked yet. :wink:
I will definitely check out that thread when I have some time, and I'll try to post the coding only questions there going forward.

The first question I asked had to do with Oath of Scholars, Oath of Mages, etc. I've already coded these cards and am testing them today, but I wanted to add a lua condition to the opponent targeting so that only opponents that met the requirements could be targeted.

The second question had to do with cards like Crazed Firecat. When we enter the coin flipping process, we have no way of knowing how many flips it will take to "lose a flip," so I wasn't sure how to handle the n in the repeating RTA. It made me think of a do...while loop.
---------------------------------------------
The DOTP2014 CW is updated nightly between 11 PM and 12 AM EST.
Known Issues/Bugs |
Impossible Cards List | Update Your Land Pools
Splinterverse
 
Posts: 918
Joined: 04 Sep 2016, 13:32
Has thanked: 150 times
Been thanked: 76 times

Re: Community Wad

Postby Splinterverse » 29 Oct 2016, 14:07

Splinterverse wrote:
thefiremind wrote:
Splinterverse wrote:What are the different parts of a filter condition as in filter:Add( FE_LUA_CONDITION, 1, EffectController(), EffectDC() )?

Could I use it to check the state of an opponent?
The number is the corresponding filter condition ID. I don't know what the other arguments do, and you can find places where EffectDC() is omitted, but I always put all the arguments, just in case.
What do you mean with "state"? Can you show an example of what you're trying to accomplish?

Splinterverse wrote:Another question, what is the equivalent of a DO...WHILE loop in DOTP 2014? Is it "repeating"="1"? If so, how do you handle a repeating loop where the number of times needed to repeat is unknown?
If you need to make a do...while, Lua has repeat...until (it's the same, but after "until" you'll write the stopping condition rather than the continuing condition). You need a RESOLUTION_TIME_ACTION with repeating="1" when you want to repeat your code while changing the state of the game between loop runs (state-based conditions are checked, answers to queries are evaluated, etc.).
Again, an example of what you're trying to accomplish would allow for a more accurate explanation.

By the way, I think that those questions would be more on-topic here (even if the topic has been dead for some time). Maybe there you'll also find answers to questions you haven't asked yet. :wink:
I will definitely check out that thread when I have some time, and I'll try to post the coding only questions there going forward.

The first question I asked had to do with Oath of Scholars, Oath of Mages, etc. I've already coded these cards and am testing them today, but I wanted to add a lua condition to the opponent targeting so that only opponents that meet the requirements can be targeted.

The second question had to do with cards like Crazed Firecat. When we enter the coin flipping process, we have no way of knowing how many flips it will take to "lose a flip," so I wasn't sure how to handle the n in the repeating RTA. It made me think of a do...while loop.
---------------------------------------------
The DOTP2014 CW is updated nightly between 11 PM and 12 AM EST.
Known Issues/Bugs |
Impossible Cards List | Update Your Land Pools
Splinterverse
 
Posts: 918
Joined: 04 Sep 2016, 13:32
Has thanked: 150 times
Been thanked: 76 times

Re: Community Wad

Postby Xander9009 » 29 Oct 2016, 19:57

For Crazed Firecat, yes, a repeating RTA is the right way to go.
Code: Select all
local oController = EffectController()
if oController ~= nil then
  if MTG():GetActionRepCount() % 2 == 0 then
    oController:FlipCoin()
    return true
  elseif oController:GetCoinFlipResult() == COIN_FLIP_WIN then
    EffectDC():Int_Inc(0)
    return true
  end
  return false
end
Note that I do not know the function calls for coin flips or the constant for a win off the top of my head, so those likely need to be corrected, but the idea/structure should work fine.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Community Wad

Postby Splinterverse » 29 Oct 2016, 21:35

Finished coding for today; all cards referenced are from the missing cards list.

Coded, tested, and uploaded:
Alpha Authority
Benalish Emissary -- added kicker trigger and tested
Benalish Lancer -- added kicker trigger and tested
Bereavement
Blood Tribute -- added kicker trigger and tested
Bloodhusk Ritualist -- added kicker trigger and tested
Bog Down -- added kicker trigger and tested
Bold Defense -- added kicker trigger and tested
Breath of Darigaaz -- added kicker trigger and tested
Burst Lightning -- added kicker trigger and tested
Canopy Surge -- added kicker trigger and tested
Cetavolver -- added kicker trigger and tested
Citanul Woodreaders -- added kicker trigger and tested
Conjurer's Ban
Conqueror's Pledge -- added kicker trigger and tested
Emberwilde Djinn
Gloomlance
Grave Sifter
Harsh Mercy
Ley Line
Mask of Intolerance
Mogg Assassin
Molten Sentry
No Quarter
Noetic Scales
Oath of Ghouls
Oath of Mages
Oath of Scholars
Patriarch's Bidding
Risky Move
Tide of War

Bugs fixed:
Grapple with the Past -- was missing a parenthesis on a target call
Grim Flayer -- had incorrect + amounts in delirium buff

HQ art uploaded (all were missing):
Grapple with the Past
Grave Sifter
Grim Flayer
Harsh Mercy

Open Items:

-- CW_CARD_QUERY_SPLINTERVERSE has been updated and uploaded.

-- I added a couple posts to the Impossible Cards thread about a few cards that may have to be added to the impossible list.

-- Spreading Plague in the .wad is not working properly. I tested it multiple times and attempted a fix to no avail. I tested with monocolor cards to make sure it wasn't a multicolor issue. I suspect it has something to do with INTERSECTS being used in a filter block. I've never gotten that to work. The only card in the .wad that it seems to work on is Konda's Banner, which when you look at it, doesn't appear to be different. It is this issue that has prevented me from completing Crown of Awe, Crown of Suspicion, etc. I wish there was another way to query subtype. I've tried Get_Subtype() and looked through the S_ChooseCreatureType functions etc. EDIT TO ADD: Spreading Plague is destroying all creatures except the trigger creature, rather than all creatures that share a color with the trigger creature.

Next:

Back tomorrow to continue coding missing cards.
---------------------------------------------
The DOTP2014 CW is updated nightly between 11 PM and 12 AM EST.
Known Issues/Bugs |
Impossible Cards List | Update Your Land Pools
Splinterverse
 
Posts: 918
Joined: 04 Sep 2016, 13:32
Has thanked: 150 times
Been thanked: 76 times

Re: Community Wad

Postby Xander9009 » 29 Oct 2016, 22:38

Splinterverse wrote:Spreading Plague in the .wad is not working properly. I tested it multiple times and attempted a fix to no avail. I tested with monocolor cards to make sure it wasn't a multicolor issue. I suspect it has something to do with INTERSECTS being used in a filter block. I've never gotten that to work. The only card in the .wad that it seems to work on is Konda's Banner, which when you look at it, doesn't appear to be different. It is this issue that has prevented me from completing Crown of Awe, Crown of Suspicion, etc. I wish there was another way to query subtype. I've tried Get_Subtype() and looked through the S_ChooseCreatureType functions etc. EDIT TO ADD: Spreading Plague is destroying all creatures except the trigger creature, rather than all creatures that share a color with the trigger creature.
Fixed. The OP_INTERSECTS operation in a filter will determine the function it needs to call on the third parameter based on the first parameter. If the first parameter is FE_COLOUR, then it will call GetColour() on the third parameter. So, if GetColour() is called on it already, then it internally calls GetColour() on the colours, which doesn't work, and the function fails. If the first parameter is FE_SUBTYPE, it'll internally get the subtypes from the third parameter. In any case, the third parameter should be a card (or card's LKI), directly.

Many cards successfully use OP_INTERSECTS. Konda's Banner is just the only card in the CW that uses it with FE_COLOUR. The difference between the two is that Konda's Banner provided TriggerObjectLKI() as the third parameter, while Spreading Sickness was providing TriggerObjectLKI():GetColour() as the third parameter.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 16 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 16 users online :: 0 registered, 0 hidden and 16 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 16 guests

Login Form