It is currently 07 Jul 2021, 23:46
   
Text Size

New targeting check system for cards

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, friarsol, Blacksmith, KrazyTheFox, Agetian, CCGHQ Admins

New targeting check system for cards

Postby Sloth » 10 Nov 2011, 13:23

At the moment I'm trying to revise the targeting restrictions, which are at the moment handled by the function "canTarget(final Card spell, final Card target)" in CardFactoryUtil. This function is flawed, because the SpellAbility is represented by its source card, and thus can't handle situations where the activator/caster is not the controller of the source card (which can happen with cards like Samite Sanctuary, Scandalmonger or Ornate Kanzashi) which is important for Hexproof.

I will start with adding a canTarget function to the card class that takes a spell ability as parameter and slowly try to redirect the checks to this. Any help would be appreciated (especially in cases where cleanup is necessary anyway).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 6 guests


Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 10 minutes)
Most users ever online was 1922 on 07 Jun 2021, 06:01

Users browsing this forum: No registered users and 6 guests

Login Form