Page 154 of 253

Re: Community Wad

PostPosted: 20 Nov 2016, 13:14
by Xander9009
Splinterverse wrote:For Bronze Horse, can I use <TRIGGER value="BECAME_TARGET_OF_SPELL" simple_qualifier="self" /> to prevent the damage from the spell? I can't think of a way to check for whether the spell will do damage. It could be some other type of spell. I thought about using <TRIGGER value="OBJECT_TAKES_DAMAGE" simple_qualifier="self"> but that would not help if the spell was doing damage to all creatures (or target player's creatures etc.).
Should work. Whenever it becomes the target of a spell, make a delayed trigger (cleanup at end of turn) that prevents all damage dealt to Bronze Horse by the stored spell.

Re: Community Wad

PostPosted: 20 Nov 2016, 14:51
by thefiremind
Remember to check if you control another creature inside the delayed trigger (not outside, because it matters only when the damage is about to be dealt). Also, if you like, you can CLEANUP when SecondaryObject() == nil (which should be the spell itself) rather than at end of turn. Shouldn't make much difference anyway.

There is a scenario where you would obtain a wrong result: if Bronze Horse becomes targeted by a spell that deals damage, but before resolution it loses all abilities, you would still prevent the damage, but you shouldn't. Anyway I think it's such a rare scenario that it should be safely ignored. I can think of a way to include this scenario... I don't think it's worth the effort, but I'll explain it anyway: you should give Bronze Horse a dummy characteristic on layer 6 (I usually use CHARACTERISTIC_CANT_BE_COUNTERED because it has no effect on the battlefield, but in the CW you have custom characteristics so you can use those if you prefer) and then in the delayed trigger, prevent the damage only if Bronze Horse still has that characteristic.

EDIT: Now that I think about it... cards that make other cards lose all abilities are fewer than cards where you should be careful about still having abilities. Wouldn't it be better to do the contrary of what I just explained? I mean, code all the cards that make other cards lose all abilities so that they also grant a custom characteristic: this way you would be able to check for that characteristic in order to know if a card lost its own abilities.

Re: Community Wad

PostPosted: 20 Nov 2016, 15:34
by Xander9009
There's already a way within the CW to check if a given card currently has its abilities. _MANAGER_ABILITIES_ACTIVE. If that manager token is created, then you can check if a given card has abilities active with "RSN_Characteristics_Get(oCard, NEO_ABILITIES_ACTIVE)". The manager token sets that characteristic to 0 on layer 6 from the manager itself, and then to 1 on layer 7A from the card using a granted ability. So, if it's 1, then its abilities must be active.

However, what if Bronze Horse becomes a copy of another creature? It still has abilities active, because it's never been the subject of LoseAllAbilities(), but its ability shouldn't have any effect. Best I can think of is to check that it has abilities and its name is still BRONZE_HORSE.

Re: Community Wad

PostPosted: 20 Nov 2016, 20:11
by migookman

Re: Community Wad

PostPosted: 20 Nov 2016, 21:48
by Splinterverse
These are some good ones. Can't wait to try them when I get back to actually playing the game.

Re: Community Wad

PostPosted: 20 Nov 2016, 22:01
by Splinterverse
Finished coding for today; all cards referenced are from the missing cards list.

Coded, tested, and uploaded:
Bargaining Table
Blazing Salvo
Blazing Torch
Blind Fury
Blood Lust
Bloodfire Infusion
Bogardan Phoenix
Bomb Squad
Boros Fury-Shield
Breath of Dreams
Broken Visage
Bronze Bombshell
Bulwark
Burning-Eye Zubera
Cabal Conditioning
Candles of Leng
Carrion Wurm
Catacomb Dragon
Celestial Kirin
Centaur Vinecrasher
Chain of Smog
Colfenor's Urn
Culling Scales
Dementia Sliver
Due Respect
Eye of Yawgmoth
Reward the Faithful
Rushing-Tide Zubera

Bugs fixed:
Argothian Wurm -- was trying to counter a spell instead of putting the Wurm on top of it's library; tested
Kor Haven -- target tag updated (was referencing tapping)

Open Items:

-- CW_CARD_QUERY_SPLINTERVERSE has been updated and uploaded.

-- Bludgeon Brawl http://pastebin.com/SCcbiQnP Ability appears on artifacts. When Equip is clicked, the mana is paid. But it doesn't attach. Could it be that the card type is not able to attach?

-- Bösium Strip http://pastebin.com/XL4Em2KE It is not granting the ability to the top card of the graveyard. Maybe I'm going about it the wrong way.

-- Bronze Horse http://pastebin.com/0xbXe0tK Not preventing damage from spells.

-- Builder's Bane http://pastebin.com/Ru3Uqtfb Not dealing damage. I'm guessing it's because I'm trying to make certain the card went to the graveyard first.

-- Coffin Queen http://pastebin.com/rgt9QVZx Everything works perfectly, except when Coffin Queen's controller changes, the creature she gained control of does not get exiled.

-- Confusion in the Ranks http://pastebin.com/9T4PipB6 This is the version of the code I meant to share yesterday. To be certain, I tested it again. Control is not swapped. I know there is a double trigger. I will remove it once I get it working if it is still not needed.

Next:

Back on Wednesday to continue coding the missing cards.

Re: Community Wad

PostPosted: 20 Nov 2016, 23:26
by thefiremind
You forgot to grant the Equipment sub-type. I would also grant the abilities on layer 6 rather than 8. To be honest, though, I wouldn't bet on these problems being the cause of the artifacts not attaching. Unfortunately I can't see anything else that could be the culprit.

In the action where you grant the ability, you are using "target" rather than "gy_top". Classic copy-paste mistake, I'm a champion with those. :mrgreen:

You are saving TriggerObject in delayDC register #1 but you should save SecondaryObject there.

If it still doesn't work, it might be because OBJECT_TAKES_DAMAGE doesn't carry a SecondaryObject (the name of the trigger doesn't mention the source of the damage), but I might be mistaken here. If that's the case, then use SOURCE_DEALS_DAMAGE_TO_OBJECT, inverting the pointers that you compare to TriggerObject and SecondaryObject (the source of the damage will be #1 and the victim will be #0).

The approach seems right to me, the problem is that you should check for the cards being in a graveyard in a different RESOLUTION_TIME_ACTION, otherwise you don't let the game perform the zone changes.

I'm afraid this is the same problem we encountered with Krovikan Vampire. If someone has any idea why the delayed trigger doesn't fire, please let us know.

local target_player = target:GetController()
local trigger_player = TriggerObject():GetController()
if target_controller ~= nil and trigger_controller ~= nil then
Can you see the problem here? :wink:

Re: Community Wad

PostPosted: 21 Nov 2016, 05:12
by tmxk2012917
a bug of Titan's Presence:

I could target any permanent and was not asked to reveal a creature. As a result, It could not exile anything

Re: Community Wad

PostPosted: 21 Nov 2016, 13:14
by Xander9009
tmxk2012917 wrote:a bug of Titan's Presence:

I could target any permanent and was not asked to reveal a creature. As a result, It could not exile anything
Fixed.

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

Bludgeon Brawl http://pastebin.com/SCcbiQnP Ability appears on artifacts. When Equip is clicked, the mana is paid. But it doesn't attach. Could it be that the card type is not able to attach?
In addition to what thefiremind said, since CMCs are limited, it'd be a lot better visually if the ability were granted based on the CMC so the text shows properly. For instance, Time Vault would be given "Equip {2}" and "Equipped creature gets +2/+0." Because it's to appease my own OCD, I've put in the effort do just that.

However, there was a problem. The problem was that by granting the equipment subtype (which is done on layer 4), the filter no longer included those cards by the time the layer 6 ability granting came around. This means they were granted the equipment subtype but not the abilities. In order to fix it, I altered the code to use no filter blocks. I stored the cards being given the equipment subtype in a DC and had the layer 6 CA iterate that DC.

There were two other problems I encountered, as well. 1: EffectDC():Get_Chest(0) was always nil on layer 6 despite being successfully created and worked with on layer 4. I'm not sure what was going on here, but when I changed to LinkedDC() it stopped, so it was probably some subtlety of the engine I'm not aware of (or am just overlooking). 2: A card attached to another card uses the tap status of the parent for display. It functionally works fine, but visually appears incorrect. I've given it a very simple ability at the moment with nothing more than "{T}" as a granted ability if it's tapped. This means that when you zoom in and the abilities that require tapping as a cost don't highlight, you can see why. However, with nothing more than the symbol, it's not ideal. It should ideally say, in each language, "This card is currently tapped." or something to that effect. It was just a two minute workaround, though.

The card works, but because I altered so much of it to make it work, I added myself as an editor. I usually don't since the alterations here are simple and quick, but since the idea behind the editors section is to know who to talk to when it breaks, it seemed necessary.

Normally, I'd just toss it in a spoiler, but it's actually too long for the forum... http://pastebin.com/NeDHuY8W

Re: Community Wad

PostPosted: 21 Nov 2016, 13:40
by thefiremind
A minor overlook: for some reason, "Equip {11}" became "Equip {}" in your pastebin link.

Re: Community Wad

PostPosted: 21 Nov 2016, 13:47
by Xander9009
thefiremind wrote:A minor overlook: for some reason, "Equip {11}" became "Equip {}" in your pastebin link.
Thanks. It's been corrected on the card (but not on Pastebin). I removed the numbers, copied it 17 times, and then used find/replace on "{}" to "{#}" within the selected area (obviously selecting one ability at a time). I missed 11. My bad.

Re: Community Wad

PostPosted: 21 Nov 2016, 19:03
by tmxk2012917
A bug of Trollhide:

I could not attach it to a creature. When I cast it, it went to graveyard directly.

Re: Community Wad

PostPosted: 21 Nov 2016, 19:06
by Xander9009
tmxk2012917 wrote:A bug of Trollhide:

I could not attach it to a creature. When I cast it, it went to graveyard directly.
Fixed.

Re: Community Wad

PostPosted: 21 Nov 2016, 19:37
by tmxk2012917
A bug of Nissa's Revelation:

After Scry 5, I put 2 creatures on the top of my library, but the top card of my library was not revealed and I did not draw cards or gain life.

[lua] [string "NISSAS_REVELATION_CW_398506_TITLE (RESOLUTION_TIME_ACTION)~0x00000d48"]:5: attempt to call method 'GetType' (a nil value)

Bug of Invocation of Saint Traft:

At the end of the combat, both the creature I attached Invocation of Saint Traft to and the token were exiled. As a result, Invocation of Saint Traft entered into my graveyard

Re: Community Wad

PostPosted: 22 Nov 2016, 10:46
by Splinterverse
Xander9009 wrote:Normally, I'd just toss it in a spoiler, but it's actually too long for the forum... http://pastebin.com/NeDHuY8W
Sounds and looks good. Always fine if you add your name. I too like to keep track of who contributed so it definitely fits.

Would you mind adding it to the .wad (if you haven't already)?

Will be back coding tomorrow. :)