Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 31, 2011, 11:36:18 PM (14 years ago)
Author:
jo
Message:

Console command still doesn't seem to work. botLevel_ is now defined between 0.0f and 1.0f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai/src/orxonox/controllers/AIController.cc

    r7840 r7842  
    7676            // search enemy
    7777            random = rnd(maxrand);
    78             if (random < (15 + botlevel_* 2) && (!this->target_))
     78            if (random < (15 + botlevel_* 20) && (!this->target_))
    7979                this->searchNewTarget();
    8080
    8181            // forget enemy
    8282            random = rnd(maxrand);
    83             if (random < (5/botlevel_) && (this->target_))
     83            if (random < ((1-botlevel_)*5) && (this->target_))
    8484                this->forgetTarget();
    8585
    8686            // next enemy
    8787            random = rnd(maxrand);
    88             if (random < (10 + botlevel_) && (this->target_))
     88            if (random < ((1+ botlevel_)*10) && (this->target_))
    8989                this->searchNewTarget();
    9090
     
    106106            // shoot
    107107            random = rnd(maxrand);
    108             if (!(this->passive_) && random < (75 + botlevel_*3) && (this->target_ && !this->bShooting_))
     108            if (!(this->passive_) && random < (75 + botlevel_*25) && (this->target_ && !this->bShooting_))
    109109                this->bShooting_ = true;
    110110
    111111            // stop shooting
    112112            random = rnd(maxrand);
    113             if (random < (25 - botlevel_*2 ) && (this->bShooting_))
     113            if (random < ((1 - botlevel_)*25) && (this->bShooting_))
    114114                this->bShooting_ = false;
    115115
     
    192192                // stop shooting
    193193                random = rnd(maxrand);
    194                 if (random < (25 - botlevel_*2 ) && (this->bShooting_))
     194                if (random < ( (1- botlevel_)*25 ) && (this->bShooting_))
    195195                    this->bShooting_ = false;
    196196
Note: See TracChangeset for help on using the changeset viewer.