It is currently 09 Sep 2025, 16:41
   
Text Size

New targeting check system for cards

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, 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 70 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 70 users online :: 0 registered, 0 hidden and 70 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 70 guests

Login Form