(PT)KPump Keyword Bug Fix
by mtgrares
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
(PT)KPump Keyword Bug Fix
by Rob Cashwalker » 29 Jan 2009, 18:44
Computer will repeatedly use creature's keyword pump abilities.
Replace the canPlayAI definition in KPump with this:
Replace the canPlayAI definition in KPump with this:
- Code: Select all
public boolean canPlayAI()
{
if (card.getKeywords().contains(keyword))
return false;
return CardFactoryUtil.AI_doesCreatureAttack(card);
}
- Code: Select all
public boolean canPlayAI()
{
if (card.getDefense() + defense[0] < 1) // no point if it would kill the creature outright
return false;
if (card.getKeyword().contains(keyword))
return false;
return CardFactoryUtil.AI_doesCreatureAttack(card);
}
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: (PT)KPump Keyword Bug Fix
by DennisBergkamp » 29 Jan 2009, 19:41
Thanks, Rob! I actually already did the first fix a few days ago, but the PTKPump one I didn't think of
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: (PT)KPump Keyword Bug Fix
by Rob Cashwalker » 29 Jan 2009, 22:10
I've also got a crazy idea - make the decision for PT and PTK "fuzzy" -DennisBergkamp wrote:Thanks, Rob! I actually already did the first fix a few days ago, but the PTKPump one I didn't think of
- Code: Select all
Integer n;
n = 100 / (card.getAbilityUsed() + 1);
if ((random * 100) < n)
return true;
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 75 guests