[fixed/closed]Protection from creatures
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
[fixed/closed]Protection from creatures
by stassy » 23 Aug 2013, 12:23
Just wanted confirmation that Protection from creatures is an approx of unblockable + autoregen, because creatures/enchantment like Beloved Chaplain, Commander Eesha, Spirit Mantle, Holy Mantle and Teysa, Envoy of Ghosts have/give unblockable effect, auto regen vs non combat damage type like Prodigal Sorcerer but not against non combat lethal effect like Royal Assassin.
Also applies to:
Protection from multicolored (ex. Soldier of the Pantheon)
Also applies to:
Protection from multicolored (ex. Soldier of the Pantheon)
Last edited by Aswan jaguar on 17 Feb 2022, 14:55, edited 5 times in total.
Reason: fixed/closed
Reason: fixed/closed
- stassy
- Moderator
- Posts: 5274
- Joined: 25 Feb 2009, 07:06
- Has thanked: 471 times
- Been thanked: 337 times
Re: Protection from creatures
by Korath » 23 Aug 2013, 23:47
There doesn't seem to be any barrier to correctly implementing protection from creatures.
Targetability against KEYWORD_PROT_CREATURES already works, exactly the same as from colors, artifacts, sorceries, instants, and lands. This is usually the hard part of implementing protection from unusual things.
Blocking seems indistinguishable from normal unblockability; but even if it weren't, EVENT_BLOCK_LEGALITY is dispatched in exactly the same place as protection from colors and artifacts is checked. (Protection from lands doesn't work here automatically either, nor does protection from enchantments. Though protection from enchantments was more or less completely broken by shroud, and I can't recall if Lucent Liminid works anyway.)
Enchanting/equipping isn't relevant for protection from creatures (though see below). That needs to be explicitly handled by the card function for protection from colors anyway.
I don't know the damage prevention functions well enough yet to be completely sure, but it looks like damage reduction is handled as a side-effect of destroying protected-from auras. If that's impractical, handling EVENT_PREVENT_DAMAGE by destroying the attached damage card should work.
Targetability against KEYWORD_PROT_CREATURES already works, exactly the same as from colors, artifacts, sorceries, instants, and lands. This is usually the hard part of implementing protection from unusual things.
Blocking seems indistinguishable from normal unblockability; but even if it weren't, EVENT_BLOCK_LEGALITY is dispatched in exactly the same place as protection from colors and artifacts is checked. (Protection from lands doesn't work here automatically either, nor does protection from enchantments. Though protection from enchantments was more or less completely broken by shroud, and I can't recall if Lucent Liminid works anyway.)
Enchanting/equipping isn't relevant for protection from creatures (though see below). That needs to be explicitly handled by the card function for protection from colors anyway.
I don't know the damage prevention functions well enough yet to be completely sure, but it looks like damage reduction is handled as a side-effect of destroying protected-from auras. If that's impractical, handling EVENT_PREVENT_DAMAGE by destroying the attached damage card should work.
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: Protection from creatures
by Gargaroz » 24 Aug 2013, 23:30
The problem is, "KEYWORD_PROT_CREATURES" originally was "Banding when attacking", so if you simply use it, that will enable that effect too. And yes, it's an approximation right now.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: Protection from creatures
by Korath » 24 Aug 2013, 23:36
OK, I'll fix it properly once the Mana Flare wreck is behind me.
Have you decided on something to reassign protection from interrupts to? Or are you leaving it as changeling?
Have you decided on something to reassign protection from interrupts to? Or are you leaving it as changeling?
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: Protection from creatures
by Gargaroz » 25 Aug 2013, 12:33
For now, it'll remain as "Changling" placeholder. I removed it from the "real_validate_target" so there shouldn't be any more problems with a Cryptic Command targeting Chameleon Colossus and such.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: Protection from creatures
by Aswan jaguar » 05 Dec 2013, 15:24
Describe the Bug:
AI destroyed my creature with Royal Assassin which was enchanted with Spirit Mantle.
Which card did behave improperly ?
Protection from creatures?Royal Assassin?Spirit Mantle to ASM coded cards?
Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
theros
What exactly should be the correct behavior/interaction ?
Protection from creatures,protects also from abilities of creatures that target.
Are any other cards possibly affected by this bug ?
AI destroyed my creature with Royal Assassin which was enchanted with Spirit Mantle.
Which card did behave improperly ?
Protection from creatures?Royal Assassin?Spirit Mantle to ASM coded cards?
Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
theros
What exactly should be the correct behavior/interaction ?
Protection from creatures,protects also from abilities of creatures that target.
Are any other cards possibly affected by this bug ?
- Attachments
-
- royal assassin - kills spirit mantle creature.rar
- (1.98 KiB) Downloaded 358 times
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8078
- Joined: 13 May 2010, 12:17
- Has thanked: 730 times
- Been thanked: 458 times
Re: [confirmed]Protection from creatures
by Korath » 05 Dec 2013, 17:44
Damage reduction's done in the damage card's function, fx_damage_901() at 0x4a0f00.
The way forward here looks to be:
The way forward here looks to be:
- Make an is_protected_from() function, which checks the protections that have their own bits (each color, artifacts, instants, sorceries, lands), and sends an event only to the card being checked. The current is_protected_from_me(), which checks for specific card ids, isn't scalable.
- Co-opt one of the rarer ability bits, like KEYWORD_PROT_INSTANTS, KEYWORD_PROT_SORCERIES, or KEYWORD_PROT_LANDS, to indicate "this card has been granted an unusual protection"; if set, make is_protected_from() send its event to all cards instead. This is about the most straightforward way I can see to implement effects like Riders of Gavony, Holy Mantle, or Guildscorn Ward. (As far as I've found so far, 1<<23 and 1<<31 are completely unused, so they're candidates too.)
- Move the damage card into C, so we can add a protection check.
- The main blockability function's been moved into C, so adding a protection check there will be easy.
- Targeting already has access to the source card now, so adding a protection check there will be easy for most cases. It's not going to work quite right for cases where it's not really the original source that's doing the targeting, like for Fire Whip or Mortarpod or anything else that reads like "X has '[cost]: This creature deals Y damage to whatever'", nor for cases where targetting has to be done by an auxiliary effect card. On the plus side, those cases are and will remain easy to find if we can figure out how to fix them properly; they all call get_protections_from() directly, and almost nothing else in the C codebase does.
- Handle equipment/auras falling off in either recalculate_all_cards_in_play() (already moved to C) or reassess_all_cards() at 0x472260; I'm not sure which is more appropriate yet. Doing it continuously on either the attaching card (as with equipment) or attached-to card (as with auras) clearly doesn't work, though - see the Mishra's Factory + equipment bug, or how only a small handful of even the original exe cards will unenchant themselves if you attach an aura to them and then lace it to a color they're protected from - and I don't think it can practically be made to. This is the biggest stumbling block.
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: [waitlist]Protection from creatures
by Korath » 30 Apr 2014, 09:53
Yes, protection from anything except artifacts and specific colors all use the same workaround currently.
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: [waitlist]Protection from creatures
by Aswan jaguar » 17 Feb 2022, 14:54
These should be fixed by drool66 in commit c04a46f.
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8078
- Joined: 13 May 2010, 12:17
- Has thanked: 730 times
- Been thanked: 458 times
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 85 guests