Exemple #1
0
void Role::synthetize()
{
    int gem,crystal;
    Team* team;

    team=dataInterface->getMyTeam();
    gem=team->getGem();
    crystal=team->getCrystal();

    state=5;
    decisionArea->enable(0);
    decisionArea->enable(1);
    tipArea->reset();
    handArea->reset();
    playerArea->reset();

    tipArea->setMsg(tr("请选择用来合成的星石:"));
    if(crystal>=3)
        tipArea->addBoxItem(tr("1.三个水晶"));
    if(crystal>=2&&gem>=1)
        tipArea->addBoxItem(tr("2.两个水晶和一个宝石"));
    if(crystal>=1&&gem>=2)
        tipArea->addBoxItem(tr("3.一个水晶和两个宝石"));
    if(gem>=3)
        tipArea->addBoxItem(tr("4.三个宝石"));
    tipArea->showBox();
}
Exemple #2
0
void Role::extract()
{
    int gem,crystal;
    Team* team;
    Player* myself=dataInterface->getPlayerList().at(myID);

    team=dataInterface->getMyTeam();
    gem=team->getGem();
    crystal=team->getCrystal();

    state=6;
    decisionArea->enable(0);
    decisionArea->enable(1);
    tipArea->reset();
    handArea->reset();
    playerArea->reset();

    tipArea->setMsg(tr("请选择要提取的星石数:"));
    switch(myself->getEnergyMax()-myself->getEnergy())
    {
    case 4:
    case 3:
    case 2:
        if(gem>=2)
            tipArea->addBoxItem(tr("1.两个宝石"));
        if(crystal>=2)
            tipArea->addBoxItem(tr("2.两个水晶"));
        if(gem>=1&&crystal>=1)
            tipArea->addBoxItem(tr("3.一个宝石和一个水晶"));
    case 1:
        if(gem>=1)
            tipArea->addBoxItem(tr("4.一个宝石"));
        if(crystal>=1)
            tipArea->addBoxItem(tr("5.一个水晶"));
    }
    tipArea->showBox();
}