Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Appreciating advices about Bonds of Faith
Moderator: CCGHQ Admins
Appreciating advices about Bonds of Faith
by thefiremind » 05 May 2012, 16:35
Taking a break from the full localisation of my cards, I'm coding some cards that will form a Human deck. I made Bonds of Faith, and the effect works, but I'm having a problem because of the AI's dumbness...
I used return TargetNeutralF() in the TARGET_DETERMINATION since Bonds of Faith can be used for different purposes on player's or opponent's creatures. By doing this, in a mirror match, the AI used Bonds of Faith on my Mikaeus, the Lunarch... this taught me that the AI can't determine in which situations the card should be used on opponent's creatures.
The "brutal" solution would be to force the AI to use Bonds of Faith for one purpose only, for example:
Does anybody have a better solution?
I used return TargetNeutralF() in the TARGET_DETERMINATION since Bonds of Faith can be used for different purposes on player's or opponent's creatures. By doing this, in a mirror match, the AI used Bonds of Faith on my Mikaeus, the Lunarch... this taught me that the AI can't determine in which situations the card should be used on opponent's creatures.
The "brutal" solution would be to force the AI to use Bonds of Faith for one purpose only, for example:
- Code: Select all
<TARGET_DETERMINATION>
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetZone( ZONE_IN_PLAY )
if Object():GetPlayer():IsAI() ~= 0 then
filter:AddSubType( CREATURE_TYPE_HUMAN )
return TargetGoodF()
else
return TargetNeutralF()
end
</TARGET_DETERMINATION>
Does anybody have a better solution?
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Appreciating advices about Bonds of Faith
by Pesi » 06 May 2012, 16:37
Is there no way to filter away only enemy-controlled humans (and it's own non-humans)? Since the Target-functions are all just a filter-function followed by...
- Code: Select all
if Object():GetFilter():CountStopAt(1) == 1 then
return TARGET_DETERMINATION_ALL
else
return TARGET_DETERMINATION_NONE
end
- Pesi
- Posts: 21
- Joined: 03 May 2012, 15:19
- Has thanked: 0 time
- Been thanked: 0 time
Re: Appreciating advices about Bonds of Faith
by thefiremind » 06 May 2012, 18:04
The "filter-function" you are talking about is SetNeutral/ParentHint/ParentAntiHint. I'm not sure about the behaviour when not specifying this, but it could be the same as using SetNeutral.Pesi wrote:Is there no way to filter away only enemy-controlled humans (and it's own non-humans)? Since the Target-functions are all just a filter-function followed by...it feels like this kind of card should use it's own thing followed by the above instead of TargetGood/Bad/NeutralF()
- Code: Select all
if Object():GetFilter():CountStopAt(1) == 1 then
return TARGET_DETERMINATION_ALL
else
return TARGET_DETERMINATION_NONE
end
And there's no way to combine sub-groups of functions in the same filter, so you can't say "(humans AND controlled by you) OR (non humans AND controlled by opponent)" because there's no way to express the parentheses.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Appreciating advices about Bonds of Faith
by Pesi » 06 May 2012, 19:52
The only other idea I have is to either:
1)Mess with the card's in-play value depending on what kind of target is picked... or
2)Have the card simply have a different targeting-schema when played by an AI; it would be modal with a "good" ability that targets only humans and a "bad" ability that targets only non-humans.
1)Mess with the card's in-play value depending on what kind of target is picked... or
2)Have the card simply have a different targeting-schema when played by an AI; it would be modal with a "good" ability that targets only humans and a "bad" ability that targets only non-humans.
- Pesi
- Posts: 21
- Joined: 03 May 2012, 15:19
- Has thanked: 0 time
- Been thanked: 0 time
Re: Appreciating advices about Bonds of Faith
by thefiremind » 06 May 2012, 19:55
I thought about this recently. It could be a nice idea if I can make it in practice.Pesi wrote:2)Have the card simply have a different targeting-schema when played by an AI; it would be modal with a "good" ability that targets only humans and a "bad" ability that targets only non-humans.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 26 guests