void KHeroSkillMgr::tmpInit(KBattleGuy* guy) { m_Owner = guy; addSkill(1001,3); addSkill(1002,3); addSkill(1003,3); //addSkill(1003,2); }
void cUOTxSendSkills::fromChar( P_CHAR pChar ) { if( !pChar ) return; for( Q_UINT8 i = 0; i < ALLSKILLS; ++i ) addSkill( i, pChar->skill( i ), pChar->baseSkill( i ), cUOTxSendSkills::Up ); }
void KHeroSkillMgr::SetHero(KHeroDef* pDef) { if(!pDef) return; m_heroDef = pDef; for(int i=0;i<MAX_HERO_SKILL_NUM;i++){ addSkill(pDef->_skill[i]._id,pDef->GetSkillLev(i)); } }
bool HeroInformationMenuLayer::init(){ if (!Layer::init()) { return false; } // addMenu(); addCharacter(); addIllustratedHandbook(); addSkill(); addMenu(); return true; }
void QCustomTableWidget::onHHeaderClicked(int index, const QPoint &position) { QAction *action = hMenu->exec(position); if (action == actionHAdd) { addSkill(index); } else if (action == actionHRemove) { removeSkill(index); } else if (action == actionHEdit) { editSkill(index); } }
SkillList::SkillList(Player* player, QWidget* parent, const char* name) : SEQListView("SkillList", parent, name), m_pPlayer(player) { int i; // initialize the lists for (i = 0; i < MAX_KNOWN_SKILLS; i++) m_skillList[i] = NULL; for (i = 0; i < MAX_KNOWN_LANGS; i++) m_languageList[i] = NULL; // add the columns addColumn("Skill"); addColumn("Value"); restoreColumns(); // connect to player signals connect (m_pPlayer, SIGNAL(addSkill(int,int)), this, SLOT(addSkill(int,int))); connect (m_pPlayer, SIGNAL(changeSkill(int,int)), this, SLOT(changeSkill(int,int))); connect (m_pPlayer, SIGNAL(deleteSkills()), this, SLOT(deleteSkills())); connect (m_pPlayer, SIGNAL(addLanguage(int,int)), this, SLOT(addLanguage(int,int))); connect (m_pPlayer, SIGNAL(changeLanguage(int,int)), this, SLOT(changeLanguage(int,int))); connect (m_pPlayer, SIGNAL(deleteLanguages()), this, SLOT(deleteLanguages())); for (i = 0; i < MAX_KNOWN_SKILLS; i++) addSkill(i, m_pPlayer->getSkill(i)); // show the languages or not according to the user preference m_showLanguages = pSEQPrefs->getPrefBool("ShowLanguages", preferenceName(), true); if (m_showLanguages) addLanguages(); }
void SkillBox::loadConfig() { Config.beginGroup("CardEditor"); int size = Config.beginReadArray("SkillTitles"); for (int i = 0; i < size; i++) { Config.setArrayIndex(i); addSkill(Config.value("TitleText").toString()); SkillTitle *item = skill_titles.last(); if (Config.contains("TitlePos")) item->setPos(Config.value("TitlePos").toPoint()); } Config.endArray(); skill_description->setHtml(Config.value("SkillDescription").toString()); copyright_text->setPlainText(Config.value("CopyrightText").toString()); Config.endGroup(); }
int Skills::readRecordSKIL(std::ifstream& in_File) { SkillRecord temp; if (temp.loadFromStream(in_File)) { if (hasSkill(temp.SkillIndex)) { if (getSkillData(temp.SkillIndex).equals(temp)) { //Skill is equal to the already present skill record, return zero. return 0; } }//if skill present //add new or changed skill addSkill(temp); return 1; } std::cout << "readRecordSKIL: Error while reading record.\n"; return -1; }//readRecordSKIL
void SkillSystem::onStarted() { if(m_pOwner != NULL) { Object* obj = NULL; Array* hitBoxes = getSkillResolver()->getArray("HitBoxIDs"); CCARRAY_FOREACH(hitBoxes, obj)//创建碰撞框 { int hitBoxID = ((String*)obj)->intValue(); //log("hitBoxID %d",hitBoxID); SkillContactSprite* sprite = SkillContactSprite::create(hitBoxID); CCAssert(sprite != NULL, "ContactSprite is NULL"); if(getOwner()->getFaceDirection().x < 0)//修改朝向方向 { sprite->setScaleX(-1.0f); } addSkill(sprite); }
// fill in the details for Se Yeun void createResume(sam thisGuy){ // add work experience char *companyName = "One Click Australia"; char *dateFrom = "June 2014"; char *dateTo = "Feb 2015"; char *description = "Internship as assistant iOS application developer."; addWorkExp(thisGuy, companyName, dateFrom, dateTo, description); companyName = "CNY/Victoria Bar and Grill"; dateFrom = "October 2014"; dateTo = "Feb 2016"; description = "Barista, Bartender, Waiter. People skills & customer service!!"; addWorkExp(thisGuy, companyName, dateFrom, dateTo, description); // add education char *institutionName = "Willoughby Public School"; dateFrom = "2000"; dateTo = "2006"; addEducation(thisGuy, institutionName, dateFrom, dateTo); institutionName = "Chatswood High School"; dateFrom = "2007"; dateTo = "2012"; addEducation(thisGuy, institutionName, dateFrom, dateTo); institutionName = "UNSW - Commerce/Computer Science"; dateFrom = "2014"; dateTo = "2019"; addEducation(thisGuy, institutionName, dateFrom, dateTo); // add skills char *skillType = "ComputerLanguage"; char *skillName = "C"; addSkill(thisGuy, skillType, skillName); skillName = "Objective C"; addSkill(thisGuy, skillType, skillName); skillName = "Shell"; addSkill(thisGuy, skillType, skillName); skillName = "Perl"; addSkill(thisGuy, skillType, skillName); skillName = "Javscript (basic)"; addSkill(thisGuy, skillType, skillName); skillName = "Python (basic)"; addSkill(thisGuy, skillType, skillName); skillName = "SQL"; addSkill(thisGuy, skillType, skillName); skillName = "Assembly Language - AVR Atmega2560"; addSkill(thisGuy, skillType, skillName); skillName = "Java"; addSkill(thisGuy, skillType, skillName); skillType = "Art"; skillName = "Latte Art"; addSkill(thisGuy, skillType, skillName); // add achievements char *achievementName = "Australian Mathematics Trust (AMT) 2010 Medal Award Winner"; char *date = "October 2010"; addAchievement(thisGuy, achievementName, date); achievementName = "HSC Graduate 97.25 ATAR"; date = "2012"; addAchievement(thisGuy, achievementName, date); achievementName = "High School - House Captain"; date = "2011 - 2012"; addAchievement(thisGuy, achievementName, date); achievementName = "High School - Mock Trial Team"; date = "2011"; addAchievement(thisGuy, achievementName, date); achievementName = "High School - Volleyball Captain"; date = "2011"; addAchievement(thisGuy, achievementName, date); }
void CPlayer::useItem(int itemID) { std::string machineName = this->getMachineName(); size_t idx = machineName.find("Server"); if(idx != std::string::npos) { // Server端處理 CItemInfo* pItemInfo = CItem::getInfo(itemID); if(pItemInfo == NULL) return; if(pItemInfo->getClassType() == WEAPON) { CWeaponInfo *pWp = (CWeaponInfo*) pItemInfo; if(this->getLevel() >= pWp->getLevel()) { if(ONE_HAND == pWp->getWield()) wearToEquipSlot(MAIN_HAND, itemID); else if(TWO_HAND == pWp->getWield()) wearToEquipSlot(OFF_HAND, itemID); } } else if(pItemInfo->getClassType() == ARMOR) { CArmorInfo *pAm = (CArmorInfo*) pItemInfo; if(this->getLevel() >= pAm->getLevel()) { if(CLOTHES == pAm->getWear()) wearToEquipSlot(CHEST, itemID); else if(BELTS == pAm->getWear()) wearToEquipSlot(BELT, itemID); else if(PANTS == pAm->getWear()) wearToEquipSlot(LEGS, itemID); else if(PAULDRONS == pAm->getWear()) wearToEquipSlot(SHOULDER, itemID); else if(GLOVES == pAm->getWear()) wearToEquipSlot(GLOVE, itemID); else if(BOOTS == pAm->getWear()) wearToEquipSlot(BOOT, itemID); } } else if(pItemInfo->getClassType() == CONSUMABLE) { CConsumableInfo *pConsumableInfo = (CConsumableInfo *)pItemInfo; if(this->getLevel() >= pConsumableInfo->getLevel()) { if(pConsumableInfo->getEffect() == EDIBLE_SKILL) addSkill(pConsumableInfo->getMuch()); // 學習某項技能 else if(pConsumableInfo->getEffect() == EDIBLE_HP) { if(getHPMax() == getHP()) return; addHP(pConsumableInfo->getMuch()); // 補血 // Todo: 藥水是否有CD時間 } else if(pConsumableInfo->getEffect() == EDIBLE_MP) { if(getMP() == getMPMax()) return; addMP(pConsumableInfo->getMuch()); // 補魔 // Todo: 藥水是否有CD時間 } else return; // 背包物品減一 m_pBackpack->removeItem(itemID); } } } else { // Client端處理 } }
void EQPlayer::backfill(const playerProfileStruct* player) { QString messag; printf("EQPlayer::backfill():\n"); messag.sprintf("Zone: Name='%s' Last='%s'\n", player->name, player->lastName); emit msgReceived(messag); messag.sprintf("Zone: Level: %d\n", player->level); emit msgReceived(messag); messag.sprintf("Zone: PlayerMoney: P=%d G=%d S=%d C=%d\n", player->platinum, player->gold, player->silver, player->copper); emit msgReceived(messag); messag.sprintf("Zone: BankMoney: P=%d G=%d S=%d C=%d\n", player->platinumBank, player->goldBank, player->silverBank, player->copperBank); emit msgReceived(messag); memcpy(&m_thePlayer, player, sizeof(playerProfileStruct)); m_playerLevel = player->level; m_playerRace = player->race; m_playerClass = player->class_; setUseDefaults(false); setPlayerName(player->name); setPlayerLastName(player->lastName); setPlayerLevel(player->level); setPlayerRace(player->race); setPlayerClass(player->class_); messag = "Exp: " + Commanate(player->exp); // Due to the delayed decode, we must reset // maxplayer on zone and accumulate all totals. m_maxSTR += player->STR; m_maxSTA += player->STA; m_maxCHA += player->CHA; m_maxDEX += player->DEX; m_maxINT += player->INT; m_maxAGI += player->AGI; m_maxWIS += player->WIS; emit statChanged (LIST_STR, m_maxSTR, m_maxSTR); emit statChanged (LIST_STA, m_maxSTA, m_maxSTA); emit statChanged (LIST_CHA, m_maxCHA, m_maxCHA); emit statChanged (LIST_DEX, m_maxDEX, m_maxDEX); emit statChanged (LIST_INT, m_maxINT, m_maxINT); emit statChanged (LIST_AGI, m_maxAGI, m_maxAGI); emit statChanged (LIST_WIS, m_maxWIS, m_maxWIS); m_maxMana = calcMaxMana( m_maxINT, m_maxWIS, m_playerClass, m_playerLevel ) + m_plusMana; emit manaChanged(m_thePlayer.MANA, m_maxMana); // need max mana uint32_t playerExp = player->exp; if (playerExp > m_currentExp) m_currentExp = playerExp; else playerExp = m_currentExp; m_maxExp = calc_exp(m_playerLevel,m_playerRace,m_playerClass); emit expChangedStr (messag); emit expChangedInt ( playerExp, calc_exp(m_playerLevel-1, m_playerRace, m_playerClass), calc_exp(m_playerLevel, m_playerRace, m_playerClass) ); // Merge in our new skills... for (int a = 0; a < MAX_KNOWN_SKILLS; a++) { if ((m_playerSkills[a] == 255) || // not valid (player->skills[a] > m_playerSkills[a])) // or a higher value m_playerSkills[a] = player->skills[a]; emit addSkill (a, m_playerSkills[a]); } // Merge in our new languages... for (int a = 0; a < MAX_KNOWN_LANGS; a++) { if ((m_playerLanguages[a] == 255) || (player->languages[a] > m_playerLanguages[a])) m_playerLanguages[a] = player->languages[a]; emit addLanguage (a, m_playerLanguages[a]); } m_validAttributes = true; m_validMana = true; m_validExp = true; // update the con table fillConTable(); }
void QCustomTableWidget::mousePressEvent(QMouseEvent *e) { int rowPosition, columnPosition; QTableWidgetItem *qtwitem = itemAt(e->pos()); switch (e->button()) { case Qt::LeftButton: { if (qtwitem == NULL || qtwitem->isSelected()) { setCurrentItem(NULL); } else { QTableWidget::mousePressEvent(e); } break; } case Qt::RightButton: { if (qtwitem == NULL) { if (rowCount()!=0 && columnCount()!=0) { break; } else { rowPosition = rowCount()-1; columnPosition = columnCount()-1; } } else { setCurrentItem(qtwitem); rowPosition = currentRow(); columnPosition = currentColumn(); } QTableWidget::mousePressEvent(e); bool null = (qtwitem!=NULL); actionRemoveColumn->setVisible(null); actionEditColumn->setVisible(null); actionRemoveRow->setVisible(null); actionEditRow->setVisible(null); QAction* action = menu->exec(e->globalPos()); if (action == actionAddColumn) { addSkill(columnPosition); } else if (action == actionRemoveColumn) { if (qtwitem != NULL) { removeSkill(columnPosition); } } else if (action == actionEditColumn) { if (qtwitem != NULL) { editSkill(columnPosition); } } else if (action == actionAddRow) { addCharacter(rowPosition); } else if (action == actionRemoveRow) { if (qtwitem != NULL) { removeCharacter(rowPosition); } } else if (action == actionEditRow) { if (qtwitem != NULL) { editCharacter(rowPosition); } } break; } default: break; } }