It is currently 16 Apr 2024, 13:11
   
Text Size

[fixed/closed]Totem armor doesn't work

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

[fixed/closed]Totem armor doesn't work

Postby Aswan jaguar » 13 Feb 2018, 16:06

Describe the Bug:
Eel Umbra totem armor doesn't work the creature will die, for human player I mean. As the problems are known for AI and totem armor.

Fix:It misses the ct_all value "activate" if inserted it works like the others.

Which card did behave improperly?
Eel Umbra

Which update are you using? (date, name)Which type? (duel, gauntlet, sealed deck)
Manalink dev 778ccb5 version - duel

What exactly should be the correct behavior/interaction?
Eel Umbra

Are any other cards possibly affected by this bug?
Eland Umbra also doesn't have the needed value but it also hasn't been coded.
Attachments
eel umbra no totem armor;.rar
(2.36 KiB) Downloaded 182 times
Last edited by Aswan jaguar on 25 Apr 2021, 08:25, edited 3 times in total.
Reason: fixed/closed
---
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: Eel Umbra totem armor doesn't work-miss ct_all value

Postby Aswan jaguar » 03 May 2019, 12:55

Korath I saw that you have removed activate from the rest of the totem armor auras so now totem armor doesn't work even for human (it is known it never worked for AI at all). Is there a workaround for this? Is the function used from shandalar something that can be imported to manalink with reasonable effort? or should we disable totem armor auras for now?
---
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: Eel Umbra totem armor doesn't work-miss ct_all value

Postby Korath » 03 May 2019, 18:56

Shandalar's method isn't trivial to backport; it adds a death-replacement effect to kill_card_guts(), which hasn't been ported to C in manalink.

I expect changing is_creature_dead() to use can_be_regenerated() instead of can_regenerate() (which really means "can activate to regenerate itself") will get this working as well as it was before.

Not that is_creature_dead(), or indirectly can_be_regenerated(), make any sense to call from totem_armor() anyway. What that does is make totem armor work if any creature controlled by any player can regenerate, when it should be checking if (only) the enchanted creature is marked as destroyed. (And then totem_armor() goes on to regenerate the creature - which doesn't work if there's a can't-regenerate effect like Disintegrate's; or causes tap triggers and removes it from combat if there isn't - untap it, and sacrifice the aura, when it should just remove the damage, prevent destruction, and destroy the aura.)

Something closer to correct would look like (completely untested):
Code: Select all
int totem_armor(int player, int card, event_t event, int pow, int tou, int key, int s_key){

    if (land_can_be_played & LCBP_REGENERATION){
        card_instance_t* aura = in_play(player, card);
        if (aura && aura->damage_target_player >= 0 && aura->targets[7].player != 1){
            card_instance_t* enchanted = get_card_instance(aura->damage_target_player, aura->damage_target_card);
            if ((enchanted->token_status & STATUS_DYING)
                && (enchanted->kill_code == KILL_DESTROY || enchanted->kill_code == KILL_BURY)
            {
                // from regenerate_target_exe()
                enchanted->kill_code = 0;
                enchanted->unknown0x14 = 0;     // forced trigger
                enchanted->damage_on_card = 0;
                enchanted->token_status &= ~STATUS_DYING;

                aura->targets[7].player = 1;    // prevent recursion - necessary?
                kill_card(player, card, KILL_DESTROY);
                aura->targets[7].player = 0;
            }
        }
    }

    return generic_aura(player, card, event, player, pow, tou, key, s_key, 0, 0, 0);
}
User avatar
Korath
DEVELOPER
 
Posts: 3707
Joined: 02 Jun 2013, 05:57
Has thanked: 496 times
Been thanked: 1106 times

Re: Eel Umbra totem armor doesn't work-miss ct_all value

Postby Aswan jaguar » 04 May 2019, 11:07

I tested with the given code, both combat damage and destruction effect ( Desert Twister ) and didn't work creature was destroyed both times.

I tried with replacing can_regenerate with can_be_regenerated that failed, too.
---
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: Totem armor doesn't work

Postby Aswan jaguar » 25 Apr 2021, 08:25

Has all (AI issues, too) already been fixed and closed in this commit 2cd0885 ("+Commander 2018 cards", 2020-12-21).
---
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 Archived Reports

Who is online

Users browsing this forum: No registered users and 35 guests

cron

Who is online

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

Login Form