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


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

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


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

示例1: testpinch

    static bool testpinch(int p, int s, BS &b, int ratio, bool activate) {
        //HP Pinches activate, nothing else does if sending back
        if (turn(b,s).value("SendingBack").toBool() && !activate) {
            return false;
        }
        if (turn(b,p).value("BugBiter").toBool()) {
            b.eatBerry(s);
            return true;
        }
        //Gluttony
        if (b.hasWorkingAbility(s, Ability::Gluttony))
            ratio = 2;

        if (!b.koed(s)) {
            int lp = b.poke(s).lifePoints();
            int tp = b.poke(s).totalLifePoints();

            if (lp*ratio <= tp) {
                //Reusing 'bool activate' in order to only affect HP berries
                if (poke(b, s).value("HealBlockCount").toInt() > 0 && activate) {
                    b.sendMoveMessage(59,BS::HealByItem,s,Type::Psychic,s,b.poke(s).item());
                    return false;
                }
                b.eatBerry(s,s==p);
                return true;
            }
        }

        return false;
    }
开发者ID:RedJoker25,项目名称:pokemon-online,代码行数:30,代码来源:berries.cpp

示例2: aaf

    static void aaf(int t, int, BS &b) {
        if (turn(b,t)["RedCardCount"] != slot(b,t)["SwitchCount"])
            return;
        int s = turn(b,t)["RedCardUser"].toInt();
        if (b.koed(s) || b.koed(t) || turn(b,t)["RedCardGiverCount"] != slot(b,s)["SwitchCount"])
            return;
        if (!b.hasWorkingItem(s, Item::RedCard))
            return;

        int target = b.player(t);
        if (b.countBackUp(target) == 0) {
            return;
        }

        b.sendItemMessage(38, s, 0, t);
        b.disposeItem(s);

        /* ingrain & suction cups */
        if (poke(b,t).value("Rooted").toBool()) {
            b.sendMoveMessage(107, 1, s, Pokemon::Grass,t);
            return;
        } else if (b.hasWorkingAbility(t,Ability::SuctionCups)) {
            b.sendMoveMessage(107, 0, s, 0,t);
            return;
        }

        QList<int> switches;

        for (int i = 0; i < 6; i++) {
            if (!b.isOut(target, i) && !b.poke(target,i).ko()) {
                switches.push_back(i);
            }
        }
        b.sendBack(t, true);
        b.sendPoke(t, switches[b.randint(switches.size())], true);
        b.sendMoveMessage(107,2,s,0,t);
        b.callEntryEffects(t);

        turn(b,t).remove("RedCardUser");
    }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:40,代码来源:items.cpp

示例3: uas

 /* ripped off from focus energy */
 static void uas(int, int s, BS &b) {
     if (b.isOut(s)) {
         addFunction(poke(b,s), "TurnSettings", "FocusEnergy", &ts);
         b.sendMoveMessage(46,0,s);
     }
 }
开发者ID:RedJoker25,项目名称:pokemon-online,代码行数:7,代码来源:berries.cpp


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