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


C++ Slash::setSkillName方法代码示例

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


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

示例1: foreach

const Card *WuxinCard::validate(CardUseStruct &cardUse) const{
    QList<int> skysoldier = cardUse.from->getPile("skysoldier");
    QList<int> black_skysoldier, disabled_skysoldier;
    foreach(int id, skysoldier){
        if (Sanguosha->getCard(id)->isBlack()){
            Slash *theslash = new Slash(Card::SuitToBeDecided, -1);
            theslash->setSkillName("wuxin");
            theslash->addSubcard(id);
            theslash->deleteLater();
            bool can_slash = theslash->isAvailable(cardUse.from) &&
                theslash->targetsFeasible(ServerPlayerList2PlayerList(cardUse.to), cardUse.from);
            if (can_slash)
                black_skysoldier << id;
            else
                disabled_skysoldier << id;
        }
        else
            disabled_skysoldier << id;
    }

    if (black_skysoldier.isEmpty())
        return NULL;

    Room *room = cardUse.from->getRoom();
    room->fillAG(skysoldier, cardUse.from, disabled_skysoldier);
    int slash_id = room->askForAG(cardUse.from, black_skysoldier, false, "wuxin");
    room->clearAG(cardUse.from);

    Slash *slash = new Slash(Card::SuitToBeDecided, -1);
    slash->addSubcard(slash_id);
    slash->setSkillName("wuxin");
    return slash;
}
开发者ID:Jia731,项目名称:QSanguosha-Para-tangjs520,代码行数:33,代码来源:h-momentumex.cpp

示例2: Slash

 virtual const Card *viewAs(const Card *originalCard) const{
     Slash *slash = new Slash(originalCard->getSuit(), originalCard->getNumber());
     slash->setSkillName(objectName());
     WrappedCard *card = Sanguosha->getWrappedCard(originalCard->getId());
     card->takeOver(slash);
     return card;
 }
开发者ID:arrow-feather,项目名称:QSanguosha,代码行数:7,代码来源:god.cpp

示例3: use

void PengriCard::use(Room *room, ServerPlayer *player, const QList<ServerPlayer *> &tar) const{
    int card_id = room->askForCardChosen(player, tar.first(), "he", "pengri");
    room->obtainCard(player, card_id, room->getCardPlace(card_id) != Player::Hand);

    Slash *slash = new Slash(Card::NoSuit, 0);
    slash->setSkillName("pengri");
    CardUseStruct use;
    use.card = slash;
    use.from = tar.first();
    use.to << player;
    room->useCard(use);
}
开发者ID:duangege815,项目名称:QSanguosha,代码行数:12,代码来源:3d_zhimeng.cpp

示例4: targetsFeasible

bool WuxinCard::targetsFeasible(const QList<const Player *> &targets, const Player *Self) const{
    foreach(int id, Self->getPile("skysoldier")){
        if (Sanguosha->getCard(id)->isBlack()){
            Slash *theslash = new Slash(Card::SuitToBeDecided, -1);
            theslash->setSkillName("wuxin");
            theslash->addSubcard(id);
            theslash->deleteLater();
            bool can_slash = theslash->isAvailable(Self) && theslash->targetsFeasible(targets, Self);
            if (can_slash)
                return true;
        }
    }
    return false;
}
开发者ID:Jia731,项目名称:QSanguosha-Para-tangjs520,代码行数:14,代码来源:h-momentumex.cpp

示例5: onDamaged

    virtual void onDamaged(ServerPlayer *player, const DamageStruct &damage) const{
        Room *room = player->getRoom();
        if(damage.damage != 1 || !damage.from || damage.from == player)
            return;

        if(room->askForSkillInvoke(player, objectName(), QVariant::fromValue(damage))){
            ServerPlayer *target = room->askForPlayerChosen(player, room->getOtherPlayers(damage.from), objectName());
            Slash *slash = new Slash(Card::NoSuit, 0);
            slash->setSkillName(objectName());
            CardUseStruct use;
            use.card = slash;
            use.from = damage.from;
            use.to << target;
            room->useCard(use, false);
        }
    }
开发者ID:duangege815,项目名称:QSanguosha,代码行数:16,代码来源:3d_zhimeng.cpp

示例6: Jink

 virtual const Card *viewAs(CardItem *card_item) const{
     const Card *card = card_item->getFilteredCard();
     bool clone_jink = false;
     if(ClientInstance->getStatus() == Client::Responsing)
         clone_jink = ClientInstance->getPattern() == "jink";
     if(clone_jink){
         Jink *jink = new Jink(card->getSuit(), card->getNumber());
         jink->addSubcard(card);
         jink->setSkillName(objectName());
         return jink;
     }
     else{
         Slash *slash = new Slash(card->getSuit(), card->getNumber());
         slash->addSubcard(card);
         slash->setSkillName(objectName());
         return slash;
     }
 }
开发者ID:duangege815,项目名称:QSanguosha,代码行数:18,代码来源:3d_zhimeng.cpp

示例7: if

    virtual const Card *viewAs(const QList<CardItem *> &cards) const{
        if(cards.length() != 2)
            return NULL;

        const Card *first = cards.at(0)->getFilteredCard();
        const Card *second = cards.at(1)->getFilteredCard();

        Card::Suit suit = Card::NoSuit;
        if(first->isBlack() && second->isBlack())
            suit = Card::Spade;
        else if(first->isRed() && second->isRed())
            suit = Card::Heart;

        Slash *slash = new Slash(suit, 0);
        slash->setSkillName(objectName());
        slash->addSubcard(first);
        slash->addSubcard(second);

        return slash;
    }
开发者ID:kdashsoul,项目名称:QSanguoshaPassMode,代码行数:20,代码来源:standard-cards.cpp


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