예제 #1
0
// When their moe-rates are equal, compare names.
bool operator>(const Character& character1, const Character& character2) {
  if (character1.moe_rate_ != character2.moe_rate_) {
    return character1.moe_rate_ > character2.moe_rate_;
  } else {
    return character1.GetName() > character2.GetName();
  }
}
예제 #2
0
bool operator==(const Character& character1, const Character& character2) {
  if (character1.GetName() == character2.GetName()) {  // names equal
    if (character1.GetBirthday() == character2.GetBirthday() &&
        character1.moe_rate_ == character2.moe_rate_ &&
        character1.anime_ == character2.anime_) {  // other infos equal
      return true;
    } else {  // other infos unequal
      cout << "Find two " << character1.GetName() <<
              " but they have different infomations.\n";
      return false;
    }
  } else {  // names unequal
    return false;
  }
}
예제 #3
0
void UIMain::OpenUI(void)
{
	UIBase::OpenUI();
	ClearSprHints();

	mSelectRow = 0;
	mSelectCol = 0;
	mSelectId = 0;

	Character* pPlayer = gCharacterMgr.GetCharacter(CHARID_PLAYER);
	mTxtName.SetText(pPlayer->GetName());

	char strTemp[32];
	sprintf_s(strTemp, "HP   %d", pPlayer->GetAttrib(CAB_HP));
	mTxtPlayerInfo.SetText(strTemp, true);

	if(gMapMgr.IsPlayerInTank())
	{
		BattleTank* pTank = gBattleTankMgr.GetTank(TANK_FIRST);
		sprintf_s(strTemp, "SP   %d", pTank->GetSP());
		mTxtTankInfo.SetText(strTemp, true);
		mTxtTankName.SetText(pTank->GetName());
	}
	else
	{
		mTxtTankInfo.SetText("");
		mTxtTankName.SetText("");
	}
}
예제 #4
0
bool EndingScene::Load(void)
{
	Character* pPlayer = gCharacterMgr.GetCharacter(CHARID_PLAYER);

	if(sEngStep == 0)
	{
		mTxtEnd.SetPosition(-120.0f, 60.0f);
		sprintf(tempStr, "歼灭无数怪物的\n超级勇士%s\n开始了新的旅途..", pPlayer->GetName());
	}
	else if(sEngStep == 1)
	{
		mTxtEnd.SetPosition(-125.0f, 50.0f);
		strcpy_s(tempStr, "Thanks For Playing!\n       Game Over");
	}
	else if(sEngStep == 2)
	{
		mTxtEnd.SetPosition(-180.0f, 120.0f);
		strcpy_s(tempStr, "Main Programmer & Designer\n                神乐游侠");
	}
	mTxtEnd.SetText(tempStr);
	mTxtEnd.SetFontType(FT_BIGFONT);
	gRenderMgr.AddObject(&mTxtEnd);

	if(sEngStep == 0)
	{
		mTxtPresent.SetVisible(false);
		mTxtQQ.SetVisible(false);
		mTxtEmail.SetVisible(false);
	}
	else if(sEngStep == 1)
	{
		mTxtPresent.SetVisible(false);
		mTxtQQ.SetVisible(false);
		mTxtEmail.SetVisible(false);
	}
	else if(sEngStep == 2)
	{
		mTxtPresent.SetVisible(true);
		mTxtQQ.SetVisible(true);
		mTxtEmail.SetVisible(true);
		mTxtPresent.SetText("Present By Symphia 2010");
		mTxtQQ.SetText("QQ: 200509225");
		mTxtEmail.SetText("EMail: [email protected]");
	}
	mTxtPresent.SetPosition(-108.0f, -20.0f);
	mTxtQQ.SetPosition(-65.0f, -50.0f);
	mTxtEmail.SetPosition(-120.0f, -80.0f);
	gRenderMgr.AddObject(&mTxtPresent);
	gRenderMgr.AddObject(&mTxtQQ);
	gRenderMgr.AddObject(&mTxtEmail);

	return true;
}
예제 #5
0
void WorldSession::SendUpdateObject()
{
    Character* character = GetCharacter();
    if (!character)
        return;

    WorldPacket data(SMSG_UPDATE_OBJECT);
    data << quint8(0);
    data << quint8(1);

    data << quint8(0);
    data << character->GetGuid();

    data.StartBlock<quint16>();
    {
        data << quint8(7);
        data << character->GetGuid();
        data << quint8(0);
        data << GetAccountInfos().id;
        data.WriteString(character->GetName(), true);

        data << character->GetBreed();
        data << character->GetPositionX();
        data << character->GetPositionY();
        data << character->GetPositionZ();
        data << character->GetInstanceId();
        data << character->GetDirection();

        // *** Skin
        data << character->GetGender();
        data << character->GetSkinColor();
        data << character->GetHairColor();
        data << character->GetPupilColor();
        data << character->GetSkinColorFactor();
        data << character->GetHairColorFactor();
        data << character->GetClothIndex();
        data << character->GetFaceIndex();
        data << qint16(-1); // Titles

        // PUBLIC_CHARACTERISTICS
        data << quint16(0); // size

        // FIGHT_PROPERTIES
        data << quint8(0); // hasProperties

        // FIGHT
        data << qint32(-1); // currentFightId
        data << quint8(0); // isKo
        data << quint8(0); // isDead
        data << quint8(0); // isSummonned
        data << quint8(0); // isFleeing
        data << qint8(-1); // obstacleId

        data << quint8(0); // hasSummon

        // EQUIPMENT_APPEARANCE
        data << quint16(0); // Views size

        // RUNNING_EFFECTS
        data << quint8(0); // hasInFightData
        data << quint8(0); // hasOutFightData

        // CURRENT_MOVEMENT_PATH
        data << quint8(0); // hasCurrentPath

        // WORLD_PROPERTIES
        data << quint8(0); // hasProperties

        // GROUP
        data << quint64(0); // partyId

        // TEMPLATE
        data << quint16(0); // sightRadius
        data << quint16(0); // aggroRadius

        // COLLECT
        data << quint16(0); // unavailableActions size

        // OCCUPATION
        data << quint8(0); // hasOccupation

        // XP
        data << character->GetXP();

        // XP_CHARACTERISTICS
        data << character->GetXPFreePoints();
        data << quint16(0); // xpBonusPoints size
        data << quint16(0); // characteristicBonusPoints size

        data << character->GetXPGauge(); // Should be named WakfuGauge...

        // CITIZEN_POINT
        data << quint16(0); // nationCitizenScores
        data << quint16(0); // offendedNations

        // GUILD_REMOTE_INFO
        data << character->GetGuildId();
        data << quint64(0); // Blazon
        data << quint16(0); // Level
        data << quint16(0); // GuildName

        // NATION_ID
        data << quint32(0); // NationId

        // NATION_SYNCHRO
        data << quint64(0); // rank
        data << quint64(0); // jobs
        data << quint64(0); // vote
        data << quint8(0); // governmentOpinion
        data << quint8(0); // isCandidate

        // SOCIAL_STATES
        data << quint8(0); // afkState
        data << quint8(0); // dndState

        // PET
        data << quint8(0); // hasPet

        // ACCOUNT_INFORMATION_REMOTE
        data << quint32(0); // subscriptionLevel
        data << quint16(0); // additionalRights size

        // COMPANION_CONTROLLER_ID
        data << quint64(0); // controllerId
        data << quint64(0); // companionId
    }
    data.EndBlock<quint16>();

    SendPacket(data);
}
예제 #6
0
void UIMain::ProcessOnDetect(void)
{
	UITextBox* pUITextbox = (UITextBox*)(gUIMgr.GetUI(UIT_TEXTBOX));
	pUITextbox->OpenUI();
	Character* pCharacter = gCharacterMgr.GetCharacter(CHARID_PLAYER);

	MapDetector* pDetector = gMapMgr.GetTargetDetector();
	if(pDetector && !pDetector->IsItemBoxUnlocked())
	{
		DetectorType type = pDetector->GetType();
		switch(type)
		{
		case DT_WANTER:
			sprintf(sStrTempDetect, "『 %s查看通缉令!<@", pCharacter->GetName());
			pUITextbox->SetText(sStrTempDetect);
			pUITextbox->SetIntoWanterScene();
			break;
		case DT_SELLER:
			pUITextbox->SetText("『 有计算机!<@");
			break;
		case DT_COMPUTER:
			pUITextbox->SetText("『 有自动售货机!<@");
			break;
		case DT_GOLD:
			{
				int randGoldGet = rand()%50 + 20;
				sprintf(sStrTempDetect, "『 %s打开箱子。<@『 找到了 %dG!<@", pCharacter->GetName(), randGoldGet);
				pUITextbox->SetText(sStrTempDetect);
				gGameStatusMgr.SetGoldNum(gGameStatusMgr.GetGoldNum() + randGoldGet);
				pDetector->SetItemBoxUnlock();
				FmodSound::PlaySnd(SND_GETITEM);
			}
			break;
		case DT_ITEM:
			if(gItemMgr.IsItemFull())
				strcpy_s(sStrTempDetect, "『 你拿的东西<    满满的!<@");
			else
			{
				sprintf(sStrTempDetect, "『 %s打开箱子。<@『 找到了 参丸!<@", pCharacter->GetName());
				gItemMgr.AddItem(ITEM_HP);
				pDetector->SetItemBoxUnlock();
				FmodSound::PlaySnd(SND_GETITEM);
			}
			pUITextbox->SetText(sStrTempDetect);
			break;
		case DT_EQUIP:
			if(gEquipMgr.IsEquipFull())
				strcpy_s(sStrTempDetect, "『 你的装备<    满满的!<@");
			else
			{
				sprintf(sStrTempDetect, "『 %s打开箱子。<@『 找到了 短枪!<@", pCharacter->GetName());
				gEquipMgr.AddEquip(EQUIP_SHORTGUN);
				pDetector->SetItemBoxUnlock();
				FmodSound::PlaySnd(SND_GETITEM);
			}
			pUITextbox->SetText(sStrTempDetect);
			break;
		case DT_CAVE:
			pUITextbox->SetText("『 发现山洞!<@『 布告上的水怪<    就躲在这里吧。<@");
			break;
		}
	}
	else
	{
		sprintf(sStrTempDetect, "『 %s检查脚下<@『 但什么都没发现。<@", pCharacter->GetName());
		pUITextbox->SetText(sStrTempDetect);
	}
}