sIKE23 / Mage-Wars

Mage Wars for OCTGN
7 stars 5 forks source link

Automate Temple of Lights Attack #283

Closed sIKE23 closed 8 years ago

sIKE23 commented 9 years ago

It is currently broken

sIKE23 commented 8 years ago

This is not working. Returns with no legal attack detected. @ACG8 any pointers as to why? This is in the master branch.

ACG8 commented 8 years ago

I am having no trouble ordering the temple of light to make attacks. Are you sure there is not some other factor making the attack illegal, such as range or some special ability?

Incidentally, it appears that paying for the temple's attack happens before you actually declare it, which could be a problem if players decide to cancel it.

sIKE23 commented 8 years ago

@ACG8 Not sure what is wrong here.....

This is a ToL (+ Hand of Bim-Shalla) attack against an Iron Golem:

Temple of Light attacks Iron Golem with Light Blast!
sike23 rolls 4 attack dice 
sike23 rolled 4 normal damage, 0 critical damage, and 6 on the effect die
Debug Msg: EffectRoll: 6, ModRoll: 16
Temple of Light inflicts 0 damage on Iron Golem... (a below average roll)
Iron Golem is dazed! (+1 Daze)

That Daze should of been a Stun: 9-10, why is ModRoll at 16? Shouldn't it be at 6+4=10?

ACG8 commented 8 years ago

Found the problem. The modroll was counting all TOLX events, not just the most recent one. I also fixed a few other issues (see commit notes).

sIKE23 commented 8 years ago

@ACG8 Could you of made a change that would affect apply Critical damage?

sike23 targets 'Paladin' with 'Corona Angel'
onTargetCardArrow(Player(1), Card(65552), Card(65541), True)
Debug Msg: isLegalAttack:attack.get('RangeType'): Melee
onTargetCardArrow(Player(1), Card(65552), None, False)
initializeAttackSequence({'Aegis': 1, 'MageID': 65541, 'Flying': True, 'Melee': 4, 'OwnerID': 65552, 'Living': True, 'Corporeal': True},{'Action': 'Quick', 'Name': 'Blazing Sword', 'EffectType': 'Attack', 'Traits': {'Piercing': 0}, 'Dice': 7, 'Type': 'Light', 'SourceID': 65552, 'RangeType': 'Melee', 'OriginalSourceID': 65552, 'Range': [0, 0], 'OriginalAttack': {'Action': 'Quick', 'Name': 'Blazing Sword', 'EffectType': 'Attack', 'Traits': {}, 'Dice': 3, 'Type': 'Light', 'SourceID': 65552, 'RangeType': 'Melee', 'OriginalSourceID': 65552, 'Range': [0, 0], 'd12': []}, 'd12': []},{'MageID': 65541, '': True, 'OwnerID': 65541, 'Living': True, 'Corporeal': True})
Corona Angel attacks Paladin with Blazing Sword!
avoidAttackStep({'Aegis': 1, 'MageID': 65541, 'Flying': False, 'Melee': 4, 'OwnerID': 65552, 'Living': True, 'Corporeal': True},{'Action': 'Quick', 'Name': 'Blazing Sword', 'EffectType': 'Attack', 'Traits': {'Piercing': 0}, 'Dice': 7, 'Type': 'Light', 'SourceID': 65552, 'RangeType': 'Melee', 'OriginalSourceID': 65552, 'Range': [0, 0], 'OriginalAttack': {'Name': 'Blazing Sword', 'OriginalSourceID': 65552, 'Range': [0, 0], 'RangeType': 'Melee', 'Action': 'Quick', 'SourceID': 65552, 'EffectType': 'Attack', 'd12': [], 'Traits': {}, 'Dice': 3, 'Type': 'Light'}, 'd12': []},{'MageID': 65541, '': True, 'OwnerID': 65541, 'Living': True, 'Corporeal': True})
rollDiceStep({'Aegis': 1, 'MageID': 65541, 'Flying': False, 'Melee': 4, 'OwnerID': 65552, 'Living': True, 'Corporeal': True},{'Action': 'Quick', 'Name': 'Blazing Sword', 'EffectType': 'Attack', 'Traits': {'Piercing': 0}, 'Dice': 7, 'Type': 'Light', 'SourceID': 65552, 'RangeType': 'Melee', 'OriginalSourceID': 65552, 'Range': [0, 0], 'OriginalAttack': {'Name': 'Blazing Sword', 'OriginalSourceID': 65552, 'Range': [0, 0], 'RangeType': 'Melee', 'Action': 'Quick', 'SourceID': 65552, 'EffectType': 'Attack', 'd12': [], 'Traits': {}, 'Dice': 3, 'Type': 'Light'}, 'd12': []},{'MageID': 65541, '': True, 'OwnerID': 65541, 'Living': True, 'Corporeal': True})
rollDiceStep({'Aegis': 1, 'MageID': 65541, 'Flying': False, 'Melee': 4, 'OwnerID': 65552, 'Living': True, 'Corporeal': True},{'Action': 'Quick', 'Name': 'Blazing Sword', 'EffectType': 'Attack', 'Traits': {'Piercing': 0}, 'Dice': 7, 'Type': 'Light', 'SourceID': 65552, 'RangeType': 'Melee', 'OriginalSourceID': 65552, 'Range': [0, 0], 'OriginalAttack': {'Name': 'Blazing Sword', 'OriginalSourceID': 65552, 'Range': [0, 0], 'RangeType': 'Melee', 'Action': 'Quick', 'SourceID': 65552, 'EffectType': 'Attack', 'd12': [], 'Traits': {}, 'Dice': 3, 'Type': 'Light'}, 'd12': []},{'MageID': 65541, '': True, 'OwnerID': 65541, 'Living': True, 'Corporeal': True})
sike23 rolls 7 attack dice from Random.org
Using die from Random.org
***sike23 rolled 5 normal damage, 3 critical damage, and 10 on the effect die***
damageAndEffectsStep({'Aegis': 1, 'MageID': 65541, 'Flying': False, 'Melee': 4, 'OwnerID': 65552, 'Living': True, 'Corporeal': True},{'Action': 'Quick', 'Name': 'Blazing Sword', 'EffectType': 'Attack', 'Traits': {'Piercing': 0}, 'Dice': 7, 'Type': 'Light', 'SourceID': 65552, 'RangeType': 'Melee', 'OriginalSourceID': 65552, 'Range': [0, 0], 'OriginalAttack': {'Name': 'Blazing Sword', 'OriginalSourceID': 65552, 'Range': [0, 0], 'RangeType': 'Melee', 'Action': 'Quick', 'SourceID': 65552, 'EffectType': 'Attack', 'd12': [], 'Traits': {}, 'Dice': 3, 'Type': 'Light'}, 'd12': []},{'MageID': 65541, '': True, 'OwnerID': 65541, 'Living': True, 'Corporeal': True},[1,1,1,2,1,1],10)
Debug Msg: EffectRoll: 10, ModRoll: 10
***Corona Angel inflicts 5 damage on Paladin... (a below average roll)***
checkMageDeath(Player(1), Counter(33619971,"Damage",Player(1)), 0)
additionalStrikesStep({'Aegis': 1, 'MageID': 65541, 'Flying': False, 'Melee': 4, 'OwnerID': 65552, 'Living': True, 'Corporeal': True},{'Action': 'Quick', 'Name': 'Blazing Sword', 'EffectType': 'Attack', 'Traits': {'Piercing': 0}, 'Dice': 3, 'Type': 'Light', 'SourceID': 65552, 'RangeType': 'Melee', 'OriginalSourceID': 65552, 'Range': [0, 0], 'OriginalAttack': {'Name': 'Blazing Sword', 'OriginalSourceID': 65552, 'Range': [0, 0], 'RangeType': 'Melee', 'Action': 'Quick', 'SourceID': 65552, 'EffectType': 'Attack', 'd12': [], 'Traits': {}, 'Dice': 3, 'Type': 'Light'}, 'd12': []},{'MageID': 65541, '': True, 'OwnerID': 65541, 'Living': True, 'Corporeal': True})
damageBarrierStep({'Aegis': 1, 'MageID': 65541, 'Flying': False, 'Melee': 4, 'OwnerID': 65552, 'Living': True, 'Corporeal': True},{'Action': 'Quick', 'Name': 'Blazing Sword', 'EffectType': 'Attack', 'Traits': {'Piercing': 0}, 'Dice': 3, 'Type': 'Light', 'SourceID': 65552, 'RangeType': 'Melee', 'OriginalSourceID': 65552, 'Range': [0, 0], 'OriginalAttack': {'Name': 'Blazing Sword', 'OriginalSourceID': 65552, 'Range': [0, 0], 'RangeType': 'Melee', 'Action': 'Quick', 'SourceID': 65552, 'EffectType': 'Attack', 'd12': [], 'Traits': {}, 'Dice': 3, 'Type': 'Light'}, 'd12': []},{'MageID': 65541, '': True, 'OwnerID': 65541, 'Living': True, 'Corporeal': True})
counterstrikeStep({'Aegis': 1, 'MageID': 65541, 'Flying': False, 'Melee': 4, 'OwnerID': 65552, 'Living': True, 'Corporeal': True},{'Action': 'Quick', 'Name': 'Blazing Sword', 'EffectType': 'Attack', 'Traits': {'Piercing': 0}, 'Dice': 3, 'Type': 'Light', 'SourceID': 65552, 'RangeType': 'Melee', 'OriginalSourceID': 65552, 'Range': [0, 0], 'OriginalAttack': {'Name': 'Blazing Sword', 'OriginalSourceID': 65552, 'Range': [0, 0], 'RangeType': 'Melee', 'Action': 'Quick', 'SourceID': 65552, 'EffectType': 'Attack', 'd12': [], 'Traits': {}, 'Dice': 3, 'Type': 'Light'}, 'd12': []},{'MageID': 65541, '': True, 'OwnerID': 65541, 'Living': True, 'Corporeal': True})
attackEndsStep({'Aegis': 1, 'MageID': 65541, 'Flying': False, 'Melee': 4, 'OwnerID': 65552, 'Living': True, 'Corporeal': True},{'Action': 'Quick', 'Name': 'Blazing Sword', 'EffectType': 'Attack', 'Traits': {'Piercing': 0}, 'Dice': 7, 'Type': 'Light', 'SourceID': 65552, 'RangeType': 'Melee', 'OriginalSourceID': 65552, 'Range': [0, 0], 'OriginalAttack': {'Name': 'Blazing Sword', 'OriginalSourceID': 65552, 'Range': [0, 0], 'RangeType': 'Melee', 'Action': 'Quick', 'SourceID': 65552, 'EffectType': 'Attack', 'd12': [], 'Traits': {}, 'Dice': 3, 'Type': 'Light'}, 'd12': []},{'MageID': 65541, '': True, 'OwnerID': 65541, 'Living': True, 'Corporeal': True})

As you can see with the lines highlighted with *\ that 8 damage should of been applied but only 5 was applied. 5 normal damage and 3 critical damage was rolled.

ACG8 commented 8 years ago

Yes, I think it was caused by my commit (55e87937728b87f90a1d8b353e9c08a652fbb370), in which I forgot to put parentheses. Try it now and see if the problem is still there.

sIKE23 commented 8 years ago

Fixed and working as expected!