sIKE23 / Mage-Wars

Mage Wars for OCTGN
7 stars 5 forks source link

Spiked Bucklers Defense is not used by the BC #291

Closed sIKE23 closed 8 years ago

sIKE23 commented 8 years ago

@ACG8

from attacks.py line 600

Ugh...defenses are formatted inconsistently in the XML files. But this should pick up both variants until we can standardize.

how are defenses inconsistently formatted?

ACG8 commented 8 years ago

When given in the stat field, defenses are formatted thus:

Defense=8+ 1x Defense=6+ inf Defense=8+ 1x

But as a bracketed trait in the text field, they are like: [Defense 7+ 1x] [Defense 8+ 1x No Melee]

It is a fairly minor difference (the lack of an =), but it is still undesirable from a consistency standpoint.

sIKE23 commented 8 years ago

Ok I will fix that, but it still doesn't explain the issue with the Buckler...

sIKE23 commented 8 years ago

@ACG8 ok I have been working on this for a couple of nights now. I have had no luck on 2.0 side of things. On the 1.x side of things if I add [Defense 8+ 1x No Ranged] it works, note [Defense=8+ 1x No Ranged] does not. On the 2.x side of things I can not get any equipment based Defense cards to work at all (Dancing Scimitar). I have been trying to trace though attack.py to figure out where all of this starts from and found that where I think things start is not correct. If you have a moment to look at this, go ahead. If it is part of the code that you plan to re-write anyways, let me know and you will know to address it when you get there and I will not bother....

I am not able to see if Enchantment based Defenses are still working as I cant get them to attach to either the Mage or the Orc Butcher. I am checking in what I have including my debug messages so you can see where I have been looking.

ACG8 commented 8 years ago

I found the issue with the buckler's code. In the xml file, the defense was defined in the stats field, as it would be for a creature defense. However, since it is a trait granted by the equipment, it should be in the text field.

I should have fixed this ages ago. I'm sorry for the delay.

sIKE23 commented 8 years ago

Yes that fixes that particular item. But once again, we have this line for the Feral Bobcat:

Defense=8+ 1x No Ranged, Armor=0, Life=4

So why does it work there but not for the Spiked Buckler's:

Location=Shield, Defense=8+ 1x No Ranged

For V2 when I was testing Defenses were not working at all.

//FC

On Fri, Dec 18, 2015 at 5:25 PM, Ananda notifications@github.com wrote:

I found the issue with the buckler's code. In the xml file, the defense was defined in the stats field, as it would be for a creature defense. However, since it is a trait granted by the equipment, it should be in the text field.

I should have fixed this ages ago. I'm sorry for the delay.

— Reply to this email directly or view it on GitHub https://github.com/sIKE23/Mage-Wars/issues/291#issuecomment-165919599.

ACG8 commented 8 years ago

Because in the Bobcat's case, the defense is part of its stats. In the Buckler's case, the defense is a stat that it grants to your mage, not a stat of the shield. It is in the wrong xml field. The way defenses work in V1 is that innate defenses are coded in the stats xml field and defenses granted to the target creature are coded in brackets in the text xml field.

sIKE23 commented 8 years ago

Working now, there are more bugs to cover but this issue is done.