It is currently 23 Apr 2024, 22:51
   
Text Size

(PT)KPump Keyword Bug Fix

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

(PT)KPump Keyword Bug Fix

Postby Rob Cashwalker » 29 Jan 2009, 18:44

Computer will repeatedly use creature's keyword pump abilities.

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);
          }
Replace the canPlayAI definition in PTKPump with this:
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.
User avatar
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

Postby 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 :)
User avatar
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

Postby Rob Cashwalker » 29 Jan 2009, 22:10

DennisBergkamp wrote:Thanks, Rob! I actually already did the first fix a few days ago, but the PTKPump one I didn't think of :)
I've also got a crazy idea - make the decision for PT and PTK "fuzzy" -

Code: Select all
Integer n;
n = 100 / (card.getAbilityUsed()  + 1);
if ((random * 100) < n)
     return true;
The more times the ability is used in a given turn, the less likely the ability will be played again.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times


Return to Forge

Who is online

Users browsing this forum: No registered users and 75 guests


Who is online

In total there are 75 users online :: 0 registered, 0 hidden and 75 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 75 guests

Login Form