1 #define _CRTDBG_MAP_ALLOC
2 #define _CRT_SECURE_NO_WARNINGS
54 for (
uint j = 0; j < 4; ++j) {
56 for (
uint i = 0; i < 37; ++i) {
59 if (skills_count < 4) {
96 new OnButtonClick(pButton->uX, pButton->uY, 0, 0, (
int)pButton,
110 new OnButtonClick(pButton->uX, pButton->uY, 0, 0, (
int)pButton,
185 .GetSkillIdxByOrder(3) == 37)
189 .GetSkillIdxByOrder(
param + 4)] = 1;
220 if (pPlayer[
param].GetSkillIdxByOrder(2) !=
223 .pActiveSkills[pPlayer[
param].GetSkillIdxByOrder(2)] =
236 if (pPlayer[
param].GetSkillIdxByOrder(3) !=
239 .pActiveSkills[pPlayer[
param].GetSkillIdxByOrder(3)] =
309 unsigned int pStatColor;
316 signed int pBonusNum;
329 int sky_slider_anim_timer = (
OS_GetTime() % (
window->GetWidth() * 20)) / 20;
330 render->DrawTextureAlphaNew(sky_slider_anim_timer / 640.0
f, 2 / 480.0
f,
332 render->DrawTextureAlphaNew(
333 (sky_slider_anim_timer - (
int)
window->GetWidth()) / 640.0
f, 2 / 480.0
f,
355 Error(
"Invalid selected character");
364 render->DrawTextureAlphaNew(
365 17 / 640.0
f, 35 / 480.0
f,
367 render->DrawTextureAlphaNew(
368 176 / 640.0
f, 35 / 480.0
f,
370 render->DrawTextureAlphaNew(
371 335 / 640.0
f, 35 / 480.0
f,
373 render->DrawTextureAlphaNew(
374 494 / 640.0
f, 35 / 480.0
f,
384 render->DrawTextureAlphaNew(
385 (uPosActiveItem->
uZ - 4) / 640.0f, uPosActiveItem->
uY / 480.0f,
387 render->DrawTextureAlphaNew(
388 (uPosActiveItem->
uX - 12) / 640.0f, uPosActiveItem->
uY / 480.0f,
391 memset(pText, 0, 200);
393 for (
int i = strlen(pText) - 1; i >= 0; i--)
394 pText[i] = toupper((
uint8_t)pText[i]);
401 for (
int i = 0; i < 4; ++i) {
405 render->DrawTextureAlphaNew(
406 (pIntervalX + 77) / 640.0
f, 50 / 480.0
f,
413 case WINDOW_INPUT_IN_PROGRESS:
423 case WINDOW_INPUT_CONFIRMED:
441 case WINDOW_INPUT_CANCELLED:
463 291,
Color16(0xD1, 0xBB, 0x61), pText,
521 Color16(0xFF, 0xFF, 0xFF), str8);
529 Color16(0xFF, 0xFF, 0xFF), str9);
536 pColorText =
Color16(0, 0xFF, 0);
537 if ((
signed int)pSkillsType >= 37) pColorText =
Color16(0, 0xF7, 0xF7);
539 pFontCreate, uX - 24, 2 * pIntervalY + 311, pColorText, str10);
546 pColorText =
Color16(0, 0xFF, 0);
547 if ((
signed int)pSkillsType >= 37) pColorText =
Color16(0, 0xF7, 0xF7);
549 pFontCreate, uX - 24, 3 * pIntervalY + 311, pColorText, str11);
557 for (
int i = strlen(pText) - 1; i >= 0; i--)
558 pText[i] = toupper((
unsigned __int8)pText[i]);
564 Color16(0xD1, 0xBB, 0x61), pText, 0, 0,
567 pColorText =
Color16(0, 0xF7, 0xF7);
568 if (uClassType) pColorText =
Color16(0xFF, 0xFF, 0xFF);
575 pColorText =
Color16(0, 0xF7, 0xF7);
577 pColorText =
Color16(0xFF, 0xFF, 0xFF);
581 pIntervalY + 417, pColorText,
584 pColorText =
Color16(0, 0xF7, 0xF7);
586 pColorText =
Color16(0xFF, 0xFF, 0xFF);
590 2 * pIntervalY + 417, pColorText,
593 pColorText =
Color16(0, 0xF7, 0xF7);
595 pColorText =
Color16(0xFF, 0xFF, 0xFF);
602 pColorText =
Color16(0, 0xF7, 0xF7);
604 pColorText =
Color16(0xFF, 0xFF, 0xFF);
608 pIntervalY + 417, pColorText,
611 pColorText =
Color16(0, 0xF7, 0xF7);
613 pColorText =
Color16(0xFF, 0xFF, 0xFF);
617 2 * pIntervalY + 417, pColorText,
620 pColorText =
Color16(0, 0xF7, 0xF7);
622 pColorText =
Color16(0xFF, 0xFF, 0xFF);
629 pColorText =
Color16(0, 0xF7, 0xF7);
634 pIntervalY + 417, pColorText,
637 pColorText =
Color16(0, 0xF7, 0xF7);
639 pColorText =
Color16(0xFF, 0xFF, 0xFF);
643 2 * pIntervalY + 417, pColorText,
651 for (
uint i = 0; i < 9; ++i) {
653 .GetSkillIdxByOrder(i + 4);
655 pLenText = strlen(pText);
657 if ((
signed int)pLenText > 0) {
658 if (pText[v104] == 32) {
661 while (pText[v104] != 32) {
663 if (v104 >= (
signed int)pLenText)
break;
668 if ((
signed int)pLenText < 8)
670 pColorText =
Color16(0, 0xF7, 0xF7);
672 .pActiveSkills[pSkillId])
673 pColorText =
Color16(0xFF, 0xFF, 0xFF);
676 pFontCreate, 100 * (i / 3) + pTextCenter + pCorrective + 17,
677 pIntervalY * (i % 3) + 417, pColorText, pText, 0, 0, 0);
687 auto unspent_attribute_bonus_label =
StringPrintf(
"%d", pBonusNum);
692 unspent_attribute_bonus_label);
737 for (
int uX = 0; uX < 22; ++uX) {
746 for (
int i = 1; i < 20; ++i) {
752 int uControlParam = 0;
759 }
while ((
signed int)uX < window->GetWidth());
761 pCreationUI_BtnPressLeft[0] =
CreateButton(10, 32, 11, 13, 1, 0,
UIMSG_PlayerCreation_FacePrev, 0, 0,
"", { {
ui_partycreation_left } });
762 pCreationUI_BtnPressLeft[1] =
CreateButton(169, 32, 11, 13, 1, 0,
UIMSG_PlayerCreation_FacePrev, 1, 0,
"", { {
ui_partycreation_left } });
763 pCreationUI_BtnPressLeft[2] =
CreateButton(327, 32, 11, 13, 1, 0,
UIMSG_PlayerCreation_FacePrev, 2, 0,
"", { {
ui_partycreation_left } });
764 pCreationUI_BtnPressLeft[3] =
CreateButton(486, 32, 11, 13, 1, 0,
UIMSG_PlayerCreation_FacePrev, 3, 0,
"", { {
ui_partycreation_left } });
766 pCreationUI_BtnPressRight[0] =
CreateButton(74, 32, 11, 13, 1, 0,
UIMSG_PlayerCreation_FaceNext, 0, 0,
"", { {
ui_partycreation_right } });
767 pCreationUI_BtnPressRight[1] =
CreateButton(233, 32, 11, 13, 1, 0,
UIMSG_PlayerCreation_FaceNext, 1, 0,
"", { {
ui_partycreation_right } });
768 pCreationUI_BtnPressRight[2] =
CreateButton(391, 32, 11, 13, 1, 0,
UIMSG_PlayerCreation_FaceNext, 2, 0,
"", { {
ui_partycreation_right } });
769 pCreationUI_BtnPressRight[3] =
CreateButton(549, 32, 11, 13, 1, 0,
UIMSG_PlayerCreation_FaceNext, 3, 0,
"", { {
ui_partycreation_right } });
771 pCreationUI_BtnPressLeft2[0] =
CreateButton(10, 103, 11, 13, 1, 0,
UIMSG_PlayerCreation_VoicePrev, 0, 0,
"", { {
ui_partycreation_left } });
772 pCreationUI_BtnPressLeft2[1] =
CreateButton(169, 103, 11, 13, 1, 0,
UIMSG_PlayerCreation_VoicePrev, 1, 0,
"", { {
ui_partycreation_left } });
773 pCreationUI_BtnPressLeft2[2] =
CreateButton(327, 103, 11, 13, 1, 0,
UIMSG_PlayerCreation_VoicePrev, 2, 0,
"", { {
ui_partycreation_left } });
774 pCreationUI_BtnPressLeft2[3] =
CreateButton(486, 103, 11, 13, 1, 0,
UIMSG_PlayerCreation_VoicePrev, 3, 0,
"", { {
ui_partycreation_left } });
776 pCreationUI_BtnPressRight2[0] =
CreateButton(74, 103, 11, 13, 1, 0,
UIMSG_PlayerCreation_VoiceNext, 0, 0,
"", { {
ui_partycreation_right } });
777 pCreationUI_BtnPressRight2[1] =
CreateButton(233, 103, 11, 13, 1, 0,
UIMSG_PlayerCreation_VoiceNext, 1, 0,
"", { {
ui_partycreation_right } });
778 pCreationUI_BtnPressRight2[2] =
CreateButton(391, 103, 11, 13, 1, 0,
UIMSG_PlayerCreation_VoiceNext, 2, 0,
"", { {
ui_partycreation_right } });
779 pCreationUI_BtnPressRight2[3] =
CreateButton(549, 103, 11, 13, 1, 0,
UIMSG_PlayerCreation_VoiceNext, 3, 0,
"", { {
ui_partycreation_right } });
791 }
while ((
signed int)uX < window->GetWidth());
811 }
while ((
signed int)uControlParam < 30);
828 if (uControlParam <= 3)
831 uControlParam, 0,
"");
833 }
while (uControlParam < 9);
838 pPlayerCreationUI_BtnOK =
CreateButton(580, 431, 51, 39, 1, 0,
UIMSG_PlayerCreationClickOK, 0,
'\r',
"", { {
ui_partycreation_buttmake } });
839 pPlayerCreationUI_BtnReset =
CreateButton(527, 431, 51, 39, 1, 0,
UIMSG_PlayerCreationClickReset, 0,
'C',
"", { {
ui_partycreation_buttmake2 } });
840 pPlayerCreationUI_BtnMinus =
CreateButton(523, 393, 20, 35, 1, 0,
UIMSG_PlayerCreationClickMinus, 0,
'-',
"", { {
ui_partycreation_minus } });
841 pPlayerCreationUI_BtnPlus =
CreateButton(613, 393, 20, 35, 1, 0,
UIMSG_PlayerCreationClickPlus, 1,
'+',
"", { {
ui_partycreation_plus } });
864 bool party_not_creation_flag;
866 party_not_creation_flag =
false;
871 window->PeekMessageLoop();
884 party_not_creation_flag =
true;
902 for (
int i = 0; i < 32; i++) {
903 for (v8 = 0; v8 < 10; ++v8) {
920 for (
uint i = 0; i < 4; ++i) {
924 for (
uint j = 0; j < 9; j++) {
935 for (
uint j = 0; j < 37; ++j) {
961 Error(
"No blasters at startup :p");
977 .spellbook.pFireSpellbook.bIsSpellAvailable[0] =
true;
983 .spellbook.pAirSpellbook.bIsSpellAvailable[0] =
true;
989 .spellbook.pWaterSpellbook.bIsSpellAvailable[0] =
true;
994 .spellbook.pEarthSpellbook.bIsSpellAvailable[0] =
true;
1000 .spellbook.pSpiritSpellbook.bIsSpellAvailable[0] =
true;
1006 .spellbook.pMindSpellbook.bIsSpellAvailable[0] =
true;
1012 .spellbook.pBodySpellbook.bIsSpellAvailable[0] =
true;
1017 Error(
"No dimoplacy in mm7 (yet)");
1038 for (
uint k = 0; k < 138; k++) {
1046 return party_not_creation_flag;