It is currently 19 Apr 2024, 21:22
   
Text Size

[confirmed]Display curse auras correctly see Koraths post

Report wrong Card behavior to get it fixed.
PLEASE ADD SAVEGAMES TO YOUR TOPIC !

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

[confirmed]Display curse auras correctly see Koraths post

Postby Aswan jaguar » 10 Aug 2017, 17:04

Describe the Bug:
AI never played Reverse Damage in several games not even to save it from losing.fixed

Which card did behave improperly?
Reverse Damage AI part.

Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
Manalink 2016/08/27: Eldritch Moon v2, duel

What exactly should be the correct behavior/interaction?


Are any other cards possibly affected by this bug?
-
Last edited by Aswan jaguar on 26 Dec 2019, 13:16, edited 3 times in total.
Reason: bug confirmed by Korath-rename to current issue
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: AI never plays Reverse Damage

Postby Korath » 11 Aug 2017, 06:30

default_target_definition() still defaults to preferring 1-who_chooses, right, Gargaroz? That'll be the problem here if so, and the same with anything else that can target damage to a player. Damage to a player is always created as controlled by that player, not by its actual controller; see whose_bf in damage_creature(). I suspect that was intentional, as a workaround for a bug that causes anything attached to a player be shown attached to the player it's controlled by, rather which player it's attached to.

Tangent:
The fix for that bug in Shandalar is in 63df3e7, as a change to functions moved out of Shandalar.exe in e4db35d. It should be sufficient to just change return_displayed_bitfield_of_1summonsick_2tapped_4attacking_8blocking_10damage_target_player_and_damage_target_card_20oublietted() directly, removing the inst->damage_target_card != -1 check in the 0x10 bit. The other functions looking at that bit are wndproc_AttackClass(), where it won't matter since players can't attack or block, and wndproc_TerritoryClass()'s WM_USER handler, which just checks the other player's territory if the card window's not found in the territory window it thinks it belongs in.

Then you can display Curse Auras as attached to players, whee. But there's still too many things that rely on damage_creature() (and so damage_player(), which just forwards to it) creating damage attached to the damaged player to safely change that.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [confirmed]AI never plays Reverse Damage

Postby Korath » 17 Aug 2017, 07:52

Healer's Headdress as reported here almost certainly has the same cause.

A whole bunch of other duplicates can be found with
Code: Select all
git grep -PnH "\bextra\s*=\s*damage_card\b"
. Instead of fixing them all individually and risking the bug showing up again in new cards, or accidentally breaking it again when you notice the "obvious error" that it can target "your" damage and "fix" it, it might be better to add a hack to validate_target_impl() to fix this at the targeting level: if extra == damage_card, then compare query_controller against 1-tgt_instance->damage_target_player instead of tgt_player. Alternately, force preferred_controller to ANYBODY there - the AI shouldn't care whose source is damaging a given player or creature, just that it's being damaged.
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [confirmed]AI never plays Reverse Damage

Postby Aswan jaguar » 25 Dec 2019, 12:00

I used force preferred_controller to ANYBODY there as I couldn't find how to use the "extra == damage_card" way you mention which I preferred to use because it seems not likely to cause issues. Please take a look I didn't mess things up. I tested the prevent damage targeting and everything seems fine with that for both AI and human but preferred_controller there is not only for prevent damage targeting right?
Fixed this in commit d12b4dde.
I will rename this and leave it open at least for the info Korath has for display Curse Auras.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: [confirmed]Display curse auras correctly see Koraths pos

Postby Aswan jaguar » 12 Jan 2020, 11:55

Aswan jaguar wrote:Please take a look I didn't mess things up. I tested the prevent damage targeting and everything seems fine with that for both AI and human but preferred_controller there is not only for prevent damage targeting right?
Well I did mess things up as I suspected i did. :oops:
Fixed my screw up that made AI had no restrictions in which player it
targeted and followed better this time what Korath has suggested.
This time at least any screw up will be only in extra damage.
Committed in 4716b4ab.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 61 guests


Who is online

In total there are 61 users online :: 0 registered, 0 hidden and 61 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 61 guests

Login Form