Page 3 of 4

Re: More ability icons

PostPosted: 24 Jun 2013, 06:22
by stassy
Ah ok, right, I though the last slots you were talking were including those you mentioned earlier.

I think we can safely discard the legend one since the new legend rules it's no longer used as an "active" ability (aka destroy a legend opponent)

Re: More ability icons

PostPosted: 24 Jun 2013, 23:41
by Korath
Aswan jaguar wrote:- Defender rather it's predecessor Wall (ability)is in the engine and csv can't you make a call to the asm code that already exists.
- Legendary as above, is in the engine and csv can't you make a call to the asm code that already exists.(unless that is what you mean with: "Not currently flagged in an easily accessible way"
Defender is added in at least three different ways by the exe and C, and Legendary in at least two. One of these ways for each isn't easy to check; rather than being a flag set on the card, the card responds to a specific event. Accidentally sending events to cards was what made the initial version of this crash so frequently.
Aswan jaguar wrote:edit-I have noticed also that some icons with some cards with(till the end of turn and such abilities)sometimes work as intended and others not.When this gets incorporated in next patch are we going to report them in bug forum so that maybe cards code can be improved or here?
When it's incorporated in a mainline release please report them in the main forum. Sometimes it'll be a problem with the display being wrong; sometimes the card will actually still have the ability and it was just less obvious before.

Re: More ability icons

PostPosted: 25 Jun 2013, 15:11
by Gargaroz
Well, usually for checking if a card is legendary you should check the "family / subtype" field of "cards_data". If it's 0xE or 0xF, it's legendary. It won't work with cards like Leyline of Singularity in play, but oh well...
Also, in order to implement the new legend rule for all the old cards, they will be slowly recoded, so we could add another SP_KEYWORD if it's more easy for you, there's still space.
For checking "defender", there's a specific code used by Overgrown Battlement, "count_defenders()", that you could use. Plus, add a check if the same field used for Legendary is "0" : that means that the creature cannot attack unless something like Rolling Stones or Animate Wall is invoked (too bad I have no idea of how they work, I remade a new piece of code to emulate that for some cards).

Re: More ability icons

PostPosted: 26 Jun 2013, 23:27
by Sonic
Been having a few problems with the mod up and running.

The damage number doesn't appear in the right hand top corner of the card anymore - although the dagger icon does.
And I've been having a few error issues when 'unblockable' is involved. I'll try and post some pics when I next catch it.

Can anyone else confirm similar experiences?

Re: More ability icons

PostPosted: 27 Jun 2013, 00:34
by Korath
I only see the top half of the damage numeral... but I do with the PoDMNv2 executable and dlls, too. Investigating.

Re: More ability icons

PostPosted: 27 Jun 2013, 02:16
by Korath
Not only did I have an early edit of ManalinkEx.dll in my pristine executables dir, there was an exceptionally careless error in it. (8 + 4 isn't 0x12. Argh.)

Changing byte 0x203DD1 of ManalinkEx.dll from 0x12 to 0x0C fixes it. I'm attaching both the repatched dll, and an updated patch_icons.pl for the source distribution.

Re: More ability icons

PostPosted: 15 Jul 2013, 14:16
by Aswan jaguar
Korath wrote:Unblockable problem doesn't surprise me too much; PtM didn't add the bit in unblockable() (and may in fact have been calling the version in the exe), so I added it in. Same with intimidate. I haven't found where the bits in targets[16].card are removed yet, though.
Edit: At least hexproof (e.g. from Glaring Spotlight) does the same thing. I suspect all the targets[16].card abilities do.

Same problems with Fear for exe/asm creatures and effects as Unblockable, etc.: Gluttonous Zombie, Severed Legion, and Fear itself.
Korath are these abilities Unblockable,hexproof,Fear,intimidate still having a bad behaviour causing the icon of a "till the end of turn" cases to remain on the card although the ability has ended.
I am asking so I won't post bugs about these 4 abilities-icons (if we know that they can't be fixed) in bug forum.I just encountered this with Riverfall Mimic unblocable icon staying for ever though the ability ended and it could be correctly blocked next turn.

Re: More ability icons

PostPosted: 16 Jul 2013, 16:27
by Korath
Icons appearing where they shouldn't or not appearing where they should is always a bug. Some of them can be fixed in big chunks (the same bug affecting many cards); some will be specific to the card. It's not going to be at all obvious which is which. If someone could start assembling a list so I could have them all in front of me in the same place when I have some time freed up, I'd appreciate it.

Re: More ability icons

PostPosted: 17 Jul 2013, 11:47
by stassy
Well, starting the list, should another new thread be sticked in the bug section or list can be put here?

Vizkopa Guildmage (only when cast, when using any of his ability all the icons but lifelink disappear)
Image

Re: More ability icons

PostPosted: 17 Jul 2013, 12:06
by stassy
Wall of Shards (appeared on the 2nd cumulative upkeep and stayed until buried)
Image

Re: More ability icons

PostPosted: 17 Jul 2013, 13:45
by Gargaroz
Checked both card code, and everything is fine, so the bug is in another spot.

Re: More ability icons

PostPosted: 17 Jul 2013, 14:03
by Korath
I can't reproduce Vizkopa Guildmage or Wall of Shards, either one. I haven't updated my source tree to OtI yet, though.

Do the extra icons disappear if you momentarily move another window or card over them?

Re: More ability icons

PostPosted: 17 Jul 2013, 18:34
by stassy
Nope, they stay on the creatures until another real effect affect them.

Ok got the culprit, it's Smoldering Spires, once the effect on opponent targeted creature wear off, the icons appear.

Image

Re: More ability icons

PostPosted: 17 Jul 2013, 22:40
by Korath
Aha - yes, that would do it. Most other temporary cannot-block effects (any that go through the standard pump_ability_until_eot function) will do the same.

The reason is that we use one of the flags for new special abilities, SP_KEYWORD_CANNOT_BLOCK, to tell pump_ability_until_eot() to add this effect; but instead of actually adding that flag, it calls a function in the exe instead. At end of turn, though, that bit is removed. The problem is that the field we use for all the new abilities except double strike and infect doesn't default to 0 (no bits set) when a card is created; it defaults to -1 (ALL bits set). There's a check when adding bits (and when determining what icons to display) to see whether the current value is below zero (i.e., the highest bit, SP_KEYWORD_DOES_NOT_END_AT_EOT, is set); if so, the add-a-bit functions first zero the field entirely, and the icon-display function doesn't show anything.

A quick and dirty fix for this, a likely similar problem with haste-until-eot, and anything similar we do in the future:
Code: Select all
diff --git a/src/functions/functions.c b/src/functions/functions.c
index cd0df23..e5ded8c 100644
--- a/src/functions/functions.c
+++ b/src/functions/functions.c
@@ -1216,6 +1216,10 @@ int block_if_able(int player, int card, event_t event){

 int special_abilities(int player, int card, event_t event, int sp_abilities ){

+    card_instance_t* instance = get_card_instance(player, card);
+    if (instance->targets[16].card < 0)
+        instance->targets[16].card = 0;
+
     if( sp_abilities & SP_KEYWORD_FEAR ){
         fear(player, card, event);
     }
Incidental bug: Smoldering Spires doesn't let you target your own creature, nor force you to target your own creature if that's the only valid target. Awful hard to come up with situations where it's relevant, though. Maybe with Skulking Ghost and its variants; or cheating lands into play during your opponent's turn while he has shrouded/hexproof creatures to attack with.

Re: More ability icons

PostPosted: 18 Jul 2013, 00:29
by Gargaroz
It's not a big deal : I'll make a wrapper function for the hardcoded one that set the required bits. And I'll fix Smoldering Spires ;)
Apart from this, I'll add the dirty fix too, so we'll be sure that card code doesnt't messes with the icons.