当前位置: 首页>>代码示例>>C++>>正文


C++ BS::move方法代码示例

本文整理汇总了C++中BS::move方法的典型用法代码示例。如果您正苦于以下问题:C++ BS::move方法的具体用法?C++ BS::move怎么用?C++ BS::move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BS的用法示例。


在下文中一共展示了BS::move方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: appl

    static void appl(int p, int s, BS &b) {
        if (b.koed(s))
            return;
        int minmove = 0;
        int minPP = 100;
        bool init = false;
        bool zeroPP = false;
        for (int i = 0; i < 4; i++) {
            if (b.move(s, i) == 0) {
                continue;
            }
            if (b.PP(s, i) == 0) {
                zeroPP = true;
                init = true;
                minmove = i;
                minPP = 0;
                break;
            }
            if (b.PP(s, i) < minPP && (fpoke(b, s).moves[i] == b.poke(s).move(i).num() ?
                                       b.PP(s, i) < b.poke(s).move(i).totalPP() : b.PP(s, i) < 5)) {
                minmove = i;
                init = true;
                minPP = b.PP(s, i);
            }
        }
            
        
        if (init && (zeroPP || turn(b,p).value("BugBiter").toBool())) {
            b.eatBerry(s, s==p);
            b.sendBerryMessage(2,s,0,0,0,b.move(s,minmove));

            b.gainPP(s,minmove,b.gen() <= 2 ? 5 : 10);
        }
    }
开发者ID:RedJoker25,项目名称:pokemon-online,代码行数:34,代码来源:berries.cpp

示例2: appl

 static void appl(int s, int, BS &b) {
     int minmove = 0;
     int minPP = 100;
     bool init = false;
     bool zeroPP = false;
     for (int i = 0; i < 4; i++) {
         if (b.move(s, i) == 0) {
             continue;
         }
         if (b.poke(s).move(i).PP() == 0) {
             zeroPP = true;
             init = true;
             minmove = i;
             minPP = 0;
             break;
         }
         if (b.poke(s).move(i).PP() < minPP && b.poke(s).move(i).PP() < b.poke(s).move(i).totalPP()) {
             minmove = i;
             init = true;
             minPP = b.poke(s).move(i).PP();
         }
     }
         
     
     if (init && (zeroPP || turn(b,s).value("BugBiter").toBool())) {
         b.eatBerry(s);
         b.sendBerryMessage(2,s,0,0,0,b.move(s,minmove));
         b.gainPP(s,minmove,10);
     }
 }
开发者ID:edrex,项目名称:pokemon-online,代码行数:30,代码来源:berries.cpp

示例3: mp

 static void mp(int s, int, BS &b) {
     for (int i = 0; i < 4; i++) {
         if (MoveInfo::Power(b.move(s,i), b.gen()) == 0) {
             turn(b,s)["Move" + QString::number(i) + "Blocked"] = true;
         }
     }
 }
开发者ID:Komari,项目名称:pokemon-online,代码行数:7,代码来源:items.cpp

示例4: ti

    static void ti(int p, int s, BS &b) {
        int attack = turn(b,p).value("ItemAttackSlot").toInt();
        int pp = poke(b,p).value("ItemArg").toInt();

        if (pp == 0) {
            pp = 99;
        }

        b.sendBerryMessage(2,s,0,0,0,b.move(s,attack));

        b.gainPP(s, attack, pp);
    }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:12,代码来源:items.cpp

示例5: mp

 static void mp(int s, int, BS &b) {
     if (!poke(b,s).contains("ChoiceMemory") || poke(b,s).value("ChoiceMemory").toInt() == 0) {
         return;
     }
     int mem = poke(b,s)["ChoiceMemory"].toInt();
     int index=-1;
     for (int i = 0; i < 4; i++) {
         if (mem  == b.move(s, i)) {
             index = i;
             break;
         }
     }
     /* Happens for example when using metronome + fly, and is correct in regard
        to the ingame behavior */
     if (index == -1)
         return;
     for (int i = 0; i < 4; i++) {
         if (index != i) {
             turn(b,s)["Move" + QString::number(i) + "Blocked"] = true;
         }
     }
 }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:22,代码来源:items.cpp


注:本文中的BS::move方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。