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


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

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


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

示例1: upa

 static void upa(int s, int t, BS &b) {
     if (b.koed(s) && !b.koed(t)) {
         if (!b.hasWorkingAbility(t,Ability::Damp)){
             b.sendAbMessage(2,0,s,t);
             b.inflictPercentDamage(t,25,s,false);
         }
         else
             b.sendAbMessage(2,1,s,t);
     }
 }
开发者ID:edrex,项目名称:pokemon-online,代码行数:10,代码来源:abilities.cpp

示例2: upa

    static void upa( int s, int t, BS &b) {
        if (!b.koed(t) && !b.hasWorkingAbility(t, Ability::MagicGuard)) {
            b.sendItemMessage(34,s,0,t);
            b.inflictDamage(t,b.poke(t).totalLifePoints()/6,s,false);

            /* In VGC 2011, the one with the rugged helmet wins */
            if (b.koed(t)) {
                b.selfKoer() = t;
            }
        }
    }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:11,代码来源:items.cpp

示例3: ahpc

 static void ahpc(int s, int, BS &b) {
     if (!b.koed(s) && b.poke(s).lifePercent() <= 50) {
         b.disposeItem(s);
         b.sendItemMessage(18,s,0);
         b.healLife(s, 20);
     }
 }
开发者ID:ElementsPO,项目名称:pokemon-online,代码行数:7,代码来源:items.cpp

示例4: uodr

    static void uodr(int s, int t, BS &b) {
	if (b.koed(s))
	    return;
        if (turn(b,s).contains("CannotBeKoedBy") && turn(b,s)["CannotBeKoedBy"].toInt() == t && b.poke(s).lifePoints() == 1) {
	    b.sendItemMessage(4, s);
	}
    }
开发者ID:edrex,项目名称:pokemon-online,代码行数:7,代码来源:items.cpp

示例5: 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

示例6: uodr

    static void uodr(int s, int, BS &b) {
        if (b.koed(s))
            return;

        b.sendItemMessage(4, s);
        turn(b,s)["SurviveReason"] = true;
    }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:7,代码来源:items.cpp

示例7: 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

示例8: ubh

    static void ubh(int s, int t, BS &b) {
        if (b.koed(s) || b.hasSubstitute(s) || turn(b,t).value("EncourageBug").toBool())
            return;
        turn(b,s)["EscapeButtonActivated"] = true;
        turn(b,s)["EscapeButtonCount"] = slot(b,s)["SwitchCount"];

        addFunction(turn(b,t), "AfterAttackFinished", "EscapeButton", &aaf);
    }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:8,代码来源:items.cpp

示例9: ubh

    static void ubh(int s, int t, BS &b) {
        if (b.koed(s) || b.hasSubstitute(s) || b.hasWorkingAbility(s, Ability::Encourage))
            return;
        turn(b,s)["EscapeButtonActivated"] = true;
        turn(b,s)["EscapeButtonCount"] = slot(b,s)["SwitchCount"];

        addFunction(turn(b,t), "AfterAttackFinished", "EscapeButton", &aaf);
    }
开发者ID:ElementsPO,项目名称:pokemon-online,代码行数:8,代码来源:items.cpp

示例10: uss

    static void uss(int s, int, BS &b) {
        if (b.koed(s))
            return;

        b.sendItemMessage(5, s);
        b.disposeItem(s);

        turn(b,s)["SurviveReason"] = true;
    }
开发者ID:Ramiel123,项目名称:pokemon-online,代码行数:9,代码来源:items.cpp

示例11: udi

    static void udi(int s, int t, BS &b) {
	if (s==t)
	    return;
	if (b.koed(s))
	    return;

	b.sendItemMessage(24, s);
	b.healLife(s, turn(b,s)["DamageInflicted"].toInt()/8);
    }
开发者ID:edrex,项目名称:pokemon-online,代码行数:9,代码来源:items.cpp

示例12: uodr

 static void uodr(int s, int t, BS &b) {
     //Magic Guard
     if (turn(b,t)["Category"].toInt() != poke(b,s)["ItemArg"].toInt() || b.koed(t) || b.hasWorkingAbility(t, Ability::MagicGuard)) {
         return;
     }
     b.eatBerry(s);
     b.sendBerryMessage(12,s,0,t);
     b.inflictDamage(t, b.poke(t).lifePoints()/8,s,false);
 }
开发者ID:edrex,项目名称:pokemon-online,代码行数:9,代码来源:berries.cpp

示例13: uodr

    static void uodr(int s, int t, BS &b) {
        if (forbidden_moves.contains(move(b,t)))
            return;

        if (fturn(b,t).typeMod > 0 && !b.koed(s)) {
            b.sendItemMessage(43, s);
            b.disposeItem(s);
            b.inflictStatMod(s, Attack, 2, s);
            b.inflictStatMod(s, SpAttack, 2, s);
        }
    }
开发者ID:Komari,项目名称:pokemon-online,代码行数:11,代码来源:items.cpp

示例14: ubh

    static void ubh(int s, int t, BS &b) {
        //Red Card does not trigger if the Pokemon is phazed with Dragon Tail/Circle Throw
        if (b.koed(s) || (b.hasWorkingAbility(t, Ability::SheerForce) && turn(b,t).contains("EncourageBug")) || tmove(b,t).attack == Move::DragonTail || tmove(b,t).attack == Move::CircleThrow || (b.hasSubstitute(s) && !b.canBypassSub(t)))
            return;
        addFunction(turn(b,t), "AfterAttackFinished", "RedCard", &aaf);
        turn(b,t)["RedCardUser"] = s;
        turn(b,t)["RedCardCount"] = slot(b,t)["SwitchCount"];
        turn(b,t)["RedCardGiverCount"] = slot(b,s)["SwitchCount"];

        return;
    }
开发者ID:Komari,项目名称:pokemon-online,代码行数:11,代码来源:items.cpp

示例15: uodr

 static void uodr(int s, int t, BS &b) {
     if (!b.attacking()) {
         return;
     }
     //Magic Guard
     if (tmove(b,t).category != poke(b,s)["ItemArg"].toInt() || b.koed(t) || b.hasWorkingAbility(t, Ability::MagicGuard)) {
         return;
     }
     b.eatBerry(s);
     b.sendBerryMessage(12,s,0,t);
     b.inflictDamage(t, b.poke(t).totalLife()/8,s,false);
 }
开发者ID:RedJoker25,项目名称:pokemon-online,代码行数:12,代码来源:berries.cpp


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