It is currently 27 Apr 2024, 11:10
   
Text Size

[confirm]Hermetic Study not working on opponent's creature

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

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

[confirm]Hermetic Study not working on opponent's creature

Postby etphonehome » 22 Aug 2021, 12:36

Bad Parameter alert and crash to the desktop.

THX
Attachments
dump.rar
(273 Bytes) Downloaded 104 times
Captura de ecrã 2021-08-22 133325.jpg
Last edited by Aswan jaguar on 23 May 2023, 14:23, edited 2 times in total.
Reason: retitled to current bug
etphonehome
 
Posts: 299
Joined: 21 May 2020, 12:50
Has thanked: 270 times
Been thanked: 39 times

Re: Bad Parameter alert and crash to the desktop.

Postby drool66 » 23 Aug 2021, 01:34

The bug is in Hermetic Study or something that shares its function (Power of Fire or Psionic Gift). I can't reproduce the bug, but I can see where it would be. A save would be helpful here if you can manage it. Provisionally fixed in 70c3ba2.
Last edited by drool66 on 24 Aug 2021, 20:44, edited 1 time in total.
Reason: hash info
User avatar
drool66
Programmer
 
Posts: 1163
Joined: 25 Nov 2010, 22:38
Has thanked: 186 times
Been thanked: 267 times

Re: [fixed] Bad Parameter alert and crash to the desktop.

Postby Aswan jaguar » 25 Aug 2021, 15:22

drool66 wrote: I can't reproduce the bug, but I can see where it would be.
I don't know if you have fixed that bug, you certainly introduced one and possibly more. Now it doesn't deal damage to target or deals damage to a random one! These cards are very complicated and changing them without testing
always leads to bugs so if you make any changes please test them thoroughly. Remember Hermetic Study's enchanted creature is source of the damage not Hermetic Study itself and should work correctly when opponent has stolen it.
---
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: [fixed] Bad Parameter alert and crash to the desktop.

Postby drool66 » 25 Aug 2021, 23:28

Right - I changed it to granted_generic_activated_ability() last minute and I forgot that changes target storage. Sorry about that one - fixed & tested, committed in 74b95a8, except...

I don't think any cards that grant activated abilities work correctly in Manalink - I just had AI cast Burning Anger on my Glass Golem, then tap my creature to deal the damage to itself. I didn't check all of them, but the ones I did are all coded the same. I think the best way to do this is to somehow appropriate EA_ANY_PLAYER_MAY_ACTIVATE, and set EVENT_CAN_ACTIVATE to 0 if activating_player != granted_to_player. The Manalink way to do it would be to create an activation legacy for granted_to_player if granting_player != granted_to_player, and set EVENT_CAN_ACTIVATE for (granting_player, granting_card) to return 0 in such a case - or something along those lines. Does that all sound right?
Last edited by drool66 on 27 Aug 2021, 22:08, edited 1 time in total.
Reason: hash info
User avatar
drool66
Programmer
 
Posts: 1163
Joined: 25 Nov 2010, 22:38
Has thanked: 186 times
Been thanked: 267 times

Re: [fixed] Bad Parameter alert and crash to the desktop.

Postby Korath » 25 Aug 2021, 23:54

I don't think making Hermetic Study activateable by both players (and then preventing it for the player that doesn't control the enchanted creature) is the way to go; there's too much room for error if some effect says "abilities of permanents your opponents control cost {1} more to activate" or "enchantments can't be activated". That second isn't even really hypothetical - you can change the Hermetic Study into an artifact with Argent Mutation, and then you've got at least Collector Ouphe, Null Rod, and Stony Silence to worry about.

The least-bad solution I've come up with so far is to create an activateable effect (like many Manalink cards do) which listens for EVENT_CARDCONTROLLED for the card it's attached to and responds by changing control of itself. I seem to recall that the Manalink version of gain_control() doesn't always send EVENT_CARDCONTROLLED, though, so you'll have to deal with that. (It's kind of silly to have to - sending events is relatively cheap, and control changing is rare to start with.)
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: [fixed] Bad Parameter alert and crash to the desktop.

Postby drool66 » 26 Aug 2021, 20:09

Thank you for your help.
I seem to recall that the Manalink version of gain_control() doesn't always send EVENT_CARDCONTROLLED, though, so you'll have to deal with that. (It's kind of silly to have to - sending events is relatively cheap, and control changing is rare to start with.)
Yes - this has been on my to do list since a75eda4 on 7/15/20

I'll look at creating an activatable legacy for these.
User avatar
drool66
Programmer
 
Posts: 1163
Joined: 25 Nov 2010, 22:38
Has thanked: 186 times
Been thanked: 267 times

Re: [fixed] Bad Parameter alert and crash to the desktop.

Postby Aswan jaguar » 02 Sep 2021, 15:19

Now Hermetic Study's enchanted creature if it targets a creature with protection from blue, Hermetic Study itself get's destroyed, :shock: it deals damage correctly though.
I didn't test if the bug is because of this fix or another change for another bug broke this.
---
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: [fixed] Bad Parameter alert and crash to the desktop.

Postby drool66 » 02 Sep 2021, 17:10

It's because granted_generic_activated_ability() forces the target to targets[0] of the granting instance, which is where the enchanted creature is - so EVENT_ABILITIES ( in auras.c::targeted_aura() )sees a blue enchantment attached to a creature with pro:blue. I guess EVENT_ABILITIES should check instance->damage_target_player/_card, unless there's a point at which they're different and it matters.
User avatar
drool66
Programmer
 
Posts: 1163
Joined: 25 Nov 2010, 22:38
Has thanked: 186 times
Been thanked: 267 times

Re: [fixed] Bad Parameter alert and crash to the desktop.

Postby etphonehome » 02 Sep 2021, 17:22

You took the words from my mouth, Drool66! :mrgreen:
etphonehome
 
Posts: 299
Joined: 21 May 2020, 12:50
Has thanked: 270 times
Been thanked: 39 times

Re: [confirmed] Hermetic Study

Postby Aswan jaguar » 23 May 2023, 14:21

Fixed in commit be2fca2 that enchanted creature with Hermetic Study could target a creature with protection from blue but didn't deal damage to it. Now all normal protection issues work.
Still they need the activate-able effect so they work correctly on an opponent's creature.
---
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 50 guests


Who is online

In total there are 50 users online :: 0 registered, 0 hidden and 50 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 50 guests

Login Form