const int SYS_MSG_MAX = 3; int g_chara; int g_charaChanged = 0; int g_refreshFrame = 0; int uiHP, uiRage, uiStamina, uiWeapon1, uiItem, uiEquip, uiDart, uiTime, uiWinner; int uiNumDarts, uiEquipFlash; int uiHitCombo, uiHint, uiSay, uiRefresh; int uiSysMsg[SYS_MSG_MAX]; int uiStatusBar, uiRageFull, uiRage60, uiChiCharge, uiItemBar, uiAICmdBar, uiPerformBar; int uiTalk; int uiCameraMode; int uiMissionItem, uiPhoenixStone; int iconDart[5]; int iconWeapon0[10]; int iconWeapon1[10]; int iconWeapon2[10]; int iconHitNumber[10]; int iconHit; int iconMissionItem[5]; float iconTalk[2]; float itemX[4]; int iconX[4]; int iconY[4]; float colorHP[3]; float ICONW, ICONW2, ICONW3, ICONW4; void ShowToolBar(int bar); void ClearSysMsg(); void OnActivate(int a) { Enable(a); Show(a); } void OnChangeChara(int c) { g_chara = c; if (g_chara == 0) { ShowUI(uiStatusBar, 0); ShowUI(uiItemBar, 0); ShowUI(uiAICmdBar, 0); ShowUI(uiPerformBar, 0); } else { ShowUI(uiStatusBar, 1); } int i; for (i=0; i<4; i++) { // reset icon light Begin(uiItemBar); BeginChild(i); PlayAnimation(2); End(); End(); Begin(uiAICmdBar); BeginChild(i); PlayAnimation(2); End(); End(); Begin(uiPerformBar); BeginChild(i); PlayAnimation(2); End(); End(); } int a = (var_rule == RULE_SCENARIO); ShowUI(uiMissionItem, a&&GetNumber()>0); ShowUI(uiPhoenixStone, a&&GetNumber()>0); ShowUI(uiEquipFlash, 0); ShowUI(uiSay, 0); ShowUI(uiHint, 0); ShowUI(uiHitCombo, 0); ShowUI(uiWinner, 0); Begin(uiTime); StopAnimation(); Number(0); BeginChild(0); TextColor(1,1,1); End(); BeginChild(1); TextColor(1,1,1); End(); BeginChild(2); TextColor(1,1,1); End(); End(); // hide status bar effect Begin(uiHP); ShowChild(0, 0); ShowChild(1, 0); End(); Begin(uiRage); ShowChild(0, 0); ShowChild(1, 0); End(); Begin(uiStamina); ShowChild(0, 0); ShowChild(1, 0); End(); ShowUI(uiRageFull, 0); ShowUI(uiRage60, 0); ShowUI(uiChiCharge, 0); ShowUI(uiTalk, 0); PlayUIAnimation(uiRefresh, 0); } void LightIcon(int id, int icon) { Begin(id); BeginChild(icon); PlayAnimation(); End(); End(); } void OnEvent(string evt, int param1, int param2) { int x, y; if (evt == "Combo") { Begin(uiHitCombo); if (param1 <= 0) PlayAnimation(2); // fade out combo else if (param1 > 1) { Number(param1); PlayAnimation(); } End(); } else if (evt == "FlashHealth") { PlayUIAnimation(uiHP, 10); } else if (evt == "FlashRage") { PlayUIAnimation(uiRage, 10); PlaySound(sndNoRage); } else if (evt == "FlashStamina") { PlayUIAnimation(uiStamina, 10); PlaySound(sndNoStamina); } else if (evt == "UseDart") { LightIcon(uiItemBar, 0); } else if (evt == "NoDart") { LightIcon(uiItemBar, 0); PlaySound(sndNoWeapon); } else if (evt == "BeginUseEquipment") { LightIcon(uiItemBar, 1); } else if (evt == "UseEquipment") { PlayUIAnimation(uiEquipFlash, 0); PlaySound(sndUseUItem); } else if (evt == "NoEquipment") { LightIcon(uiItemBar, 1); PlaySound(sndNoUItem); } else if (evt == "UseInspect") { LightIcon(uiItemBar, 2); } else if (evt == "UseWeapon") { LightIcon(uiItemBar, 3); } else if (evt == "NoWeapon") { LightIcon(uiItemBar, 3); PlaySound(sndNoWeapon); } if (evt == "UseAICmd") { LightIcon(uiAICmdBar, param1); PlaySound(sndAICmd); } else if (evt == "UsePerform") { LightIcon(uiPerformBar, param1); PlaySound(sndPerform); } else if (evt == "PickupItem") { if (param1 == CHARA_SELECT_WEAPON1) PlaySound(sndPickupWeapon); else if (param1 == CHARA_SELECT_DART) PlaySound(sndPickupDart); else PlaySound(sndPickupUItem); } else if (evt == "DropItem") { PlaySound(sndDropItem); } else if (evt == "Reborn") { PlayUIAnimation(uiRefresh, 0); } else if (evt == "MissionItem") { Begin(uiMissionItem); Number(param2); if (param2 > 0) { Show(); Image(iconMissionItem[param1]); if (param2 > 1) ShowNumber(0); else ShowNumber(-1); // do not show number } else Show(0); End(); } else if (evt == "Talk") { PlaySound(sndPadX); } else if (evt == "RoundStart") { PlayVoice(sndFight); } } void OnShowHint(int txtId, float time) { Begin(uiHint); Text(txtId, 1); // use scenario string table Size(GetWidth(), CountTextLines(GetWStringFromTable(txtId, 1))*20+10); FNumber(time); PlayAnimation(0, 0); // do not stop current animation End(); } void OnCharaSay(int chara, int txtId, string voice) { Begin(uiSay); Text(txtId); Number(0); BeginChild(0); Image(GetCharaAttrib(chara, CHARA_ICON2)); End(); if (strlen(voice) > 0) { PlayVoice(voice); FNumber(0); } else { FNumber(3.5); } PlayAnimation(); End(); } void ClearSysMsg() { int i; for (i=0; i 1) AddSysMsg(ColorCharaName(param2)+GetWStringFromTable(MSG_DEFEAT)+ColorCharaName(param1)+GetWStringFromTable(MSG_TOTAL_WIN)+NumToWStr(param3)+L"."); else AddSysMsg(ColorCharaName(param2)+GetWStringFromTable(MSG_DEFEAT)+ColorCharaName(param1)+L"."); } else { AddSysMsg(ColorCharaName(param1)+GetWStringFromTable(MSG_IS_DEAD)); } if (var_rule==RULE_VIP && !IsCharaVIP(param1) && IsRoleOwner(GetCharaPlayer(param1))) AddSysMsg(GetWStringFromTable(MSG_NONVIP_DIED)); } else if (event == "Enter") { AddSysMsg(ColorCharaName(param1)+GetWStringFromTable(MSG_ENTER_GAME)); } else if (event == "Leave") { AddSysMsg(ColorCharaName(param1)+GetWStringFromTable(MSG_LEAVE_GAME)); } else if (event == "Rescue") { AddSysMsg(ColorCharaName(param1)+GetWStringFromTable(MSG_RESCUE)+ColorCharaName(param2)+L"."); } else if (event == "VIP") { AddSysMsg(ColorCharaName(param1)+GetWStringFromTable(MSG_IS_VIP)); } else if (event == "Giant") { AddSysMsg(ColorCharaName(param1)+GetWStringFromTable(MSG_IS_GIANT)); } else if (event == "Challenge") { AddSysMsg(ColorCharaName(param1)+GetWStringFromTable(MSG_CHALLENGE)+ColorCharaName(param2)+L"."); } else if (event == "BloodClock") { AddSysMsg(ColorCharaName(param1)+GetWStringFromTable(MSG_AND)+ColorCharaName(param2)+GetWStringFromTable(MSG_ENTER_BLOOD_CLOCK)); } else if (event == "TeamFull") { if (param1 == 2) AddSysMsg(GetWStringFromTable(MSG_TEAMA_FULL)); else if (param1 == 1) AddSysMsg(GetWStringFromTable(MSG_TEAMB_FULL)); } else { Print("unknown SysMsg: ", event, "\n"); } } void Time_OnAnimate(int frame) { int i; if (frame == 0) { for (i=0; i<3; i++) { BeginChild(i); TweenTextColor(1,1,1,1, 1,0,0,1, 0.1); End(); } NextFrame(0.2); } else if (frame == 1) { for (i=0; i<3; i++) { BeginChild(i); TweenTextColor(1,0,0,1, 1,1,1,1, 0.2); End(); } } } void ShowTeamScore(int a, int b) { Begin(uiTime); Show(); BeginChild(0); TextColor(teamColorR[1],teamColorG[1],teamColorB[1]); Text(NumToStr("%02d", a)); End(); BeginChild(1); TextColor(teamColorR[2],teamColorG[2],teamColorB[2]); Text(NumToStr("%02d", b)); End(); BeginChild(2); TextColor(1,1,1); End(); End(); } void ShowWinner(int winner, int score) { if (winner<=0 || score<=0) { ShowUI(uiWinner, 0); return; } Begin(uiWinner); Show(1); Text(GetCharaDisplayName(winner)+L":"+NumToWStr(score)); End(); } void ShowTime(int sec) { if (sec<0 || !IsRoundStart()) { ShowUI(uiTime, 0); return; } Begin(uiTime); Show(1); int t = GetNumber(); if (sec != t) { Number(sec); if (sec>=0 && sec<10 && sec 0) { if (sec == 0) PlaySound(sndTimeout); else PlaySound(sndCountDown); } } else { StopAnimation(); BeginChild(0); TextColor(1,1,1); End(); BeginChild(1); TextColor(1,1,1); End(); BeginChild(2); TextColor(1,1,1); End(); } SetUITime(uiTime, sec); } End(); } void SetIcon(int icon) { BeginChild(0); Image(icon); End(); } void ShowUIItems() { int weaponType, weaponSubType; weaponType = GetCharaWeapon(g_chara, 1) / 10; weaponSubType = GetCharaWeapon(g_chara, 1) % 10; Begin(uiWeapon1); Show(1); if (weaponSubType == 1) SetIcon(iconWeapon1[weaponType]); else if (weaponSubType == 2) SetIcon(iconWeapon2[weaponType]); else SetIcon(iconWeapon0[weaponType]); End(); Begin(uiEquip); SetIcon(GetItemAttrib(GetCharaItem(g_chara, CHARA_SELECT_EQUIPMENT), ITEM_ICON)); End(); //Begin(uiItem); //End(); Begin(uiDart); SetIcon(iconDart[GetCharaDart(g_chara)]); End(); Begin(uiNumDarts); Number(GetCharaNumDarts(g_chara)); Show(GetNumber()>0); End(); } // show = 0: hide, 1: show, 2:show dark void ShowBar(int id, int show) { int i; Begin(id); Show(show); if (show == 1) { for (i=0; i<4; i++) { BeginChild(i); if (GetFNumber() == 0) { Color(1,1,1,0.6); BeginChild(0); Color(1,1,1); End(); } End(); } } else if (show == 2) { for (i=0; i<4; i++) { BeginChild(i); if (GetFNumber() == 0) { Color(0.3,0.3,0.3,0.4); BeginChild(0); Color(1,1,1,0.6); End(); } End(); } } End(); } void ShowTalk(int notFade) { Begin(uiTalk); int tk = GetTalkStatus(); if (tk == 0) { Show(0); } else if (tk == 1) { Show(); Image(iconTalk[0]); } else { Show(); Image(iconTalk[1]); } if (notFade) Color(1,1,1); else Color(1,1,1,0.5); End(); } void ShowToolBar(int bar) { if (bar == 0) { ShowBar(uiItemBar, 2); ShowBar(uiAICmdBar, 0); ShowBar(uiPerformBar, 0); ShowUIItems(); Begin(uiNumDarts); TextColor(1,1,1,0.5); End(); ShowTalk(0); } else if (bar == TOOLBAR_ITEM) { ShowBar(uiItemBar, 1); ShowBar(uiAICmdBar, 0); ShowBar(uiPerformBar, 0); ShowUIItems(); Begin(uiNumDarts); TextColor(1,1,1,0.9); End(); ShowTalk(1); } else if (bar == TOOLBAR_AI) { ShowBar(uiAICmdBar, 1); ShowBar(uiItemBar, 0); ShowBar(uiPerformBar, 0); ShowTalk(1); } else if (bar == TOOLBAR_PERFORM) { ShowBar(uiPerformBar, 1); ShowBar(uiItemBar, 0); ShowBar(uiAICmdBar, 0); ShowTalk(1); } } void AnimateStatustBar(int frame, float r, float g, float b) { if (frame == 0) // flash light once (value is full) { ShowChild(1, 0); BeginChild(0); Show(); TweenColor(0,0,0,0, r,g,b,1, 0.4); End(); ShowChild(1, 0); NextFrame(0.4); } else if (frame == 1) { BeginChild(0); TweenColor(r,g,b,1, 0,0,0,0, 0.4); End(); NextFrame(0.4); } else if (frame == 2) { BeginChild(0); Show(0); End(); } if (frame == 10) // flash electric (value is not enough) { ShowChild(0, 0); BeginChild(1); Show(); TweenColor(0,0,0,0, r,g,b,1, 0.1); End(); NextFrame(0.5); } else if (frame == 11) { BeginChild(1); TweenColor(r,g,b,1, 0,0,0,0, 0.4); End(); NextFrame(0.4); } else if (frame == 12) { BeginChild(1); Show(0); End(); } else if (frame == 20) // flash light loop (rage is full) { BeginChild(0); Show(); TweenColor(0,0,0,0, r,g,b,1, 0.4); End(); ShowChild(1, 0); NextFrame(0.4); } else if (frame == 21) { BeginChild(0); TweenColor(r,g,b,1, 0,0,0,0, 0.4); End(); NextFrame(0.4, 20); } } void HP_OnAnimate(int frame) { float r = colorHP[0]; float g = colorHP[1]; float b = colorHP[2]; if (frame == 30) // HP is low { TweenColor(r,g,b,1, r,g,b,0, 0.2); NextFrame(0.2); } else if (frame == 31) { if (!IsCharaDead(g_chara) && GetAppState()==APPSTATE_PLAY_GAME && IsEntityActive(g_chara)) { TweenColor(r,g,b,0, r,g,b,1, 0.2); PlaySound(sndHeartbeat); CreateMainRumble(MOTOR_BOTH, RUMBLE_FLAT, 0.05, 0.8, 0.8); float doki = GetCharaAttrib(g_chara, CHARA_HP)*4.0 / GetCharaAttrib(g_chara, CHARA_MAX_HP); if (doki < 0.2) doki = 0.2; NextFrame(doki, 30); } } else AnimateStatustBar(frame, r,g,b); } void Rage_OnAnimate(int frame) { AnimateStatustBar(frame, 0,0.8,1); } void Stamina_OnAnimate(int frame) { AnimateStatustBar(frame, 1,1,0.4); } int g_flashHP = 0; int g_HPColor = -1; void ResizeBar(int id, int width) { Begin(id); int dif = GetWidth() - width; if (g_refreshFrame!=0 && (dif<-5 || dif>5)) TweenSize(GetWidth(), 3, width, 3, 0.2); else Size(width, 3); End(); } void Refresh_OnAnimate(int frame) { int n, k; g_refreshFrame = frame; if (g_chara && !IsChara(g_chara)) { // chara is destroyed OnChangeChara(0); } Activate(uiCameraMode, GetCameraMode()==2); // show if back camera mode if (g_chara) { Begin(uiHP); if (IsCharaSickSlow(g_chara)) { if (g_HPColor!=1) { colorHP[0]=0.56; colorHP[1]=0.22; colorHP[2]=0.92; Color(colorHP[0],colorHP[1],colorHP[2]); g_HPColor = 1; } } else if (IsCharaSickPoison(g_chara)) { if (g_HPColor!=2) { colorHP[0]=0.44; colorHP[1]=0.62; colorHP[2]=0.05; Color(colorHP[0],colorHP[1],colorHP[2]); g_HPColor = 2; } } else if (g_HPColor!=0) { colorHP[0]=1.0; colorHP[1]=0.3; colorHP[2]=0.2; Color(colorHP[0],colorHP[1],colorHP[2]); g_HPColor = 0; } n = GetCharaAttrib(g_chara, CHARA_HP); if (n != GetNumber()) { Number(n); k = GetCharaAttrib(g_chara, CHARA_MAX_HP); if (k <= 0) k = 1; if (n>=k) { // full HP Color(colorHP[0],colorHP[1],colorHP[2]); Size(n*115/k, 3); g_flashHP = 0; if (frame != 0) { PlayAnimation(); // flash light once //PlaySound(sndFullHP); } else StopAnimation(); } else { // hide light bar ShowChild(0, 0); if (n*10/k < 2) { if (g_flashHP == 0) { PlayAnimation(30); // low health g_flashHP = 1; } } else { if (g_flashHP == 1) { g_flashHP = 0; StopAnimation(); Color(colorHP[0],colorHP[1],colorHP[2]); } } ResizeBar(GetID(), n*115/k); } } End(); Begin(uiRage); n = GetCharaAttrib(g_chara, CHARA_RAGE); if (n != GetNumber()) { if (n >= 100) { Size(n*1.15, 3); PlayAnimation(20); // flash light loop Activate(uiRageFull, 1); PlayUIAnimation(uiRageFull, 0); if (frame != 0) PlaySound(sndFullRage); ShowUI(uiRage60, 0); } else { ShowUI(uiRage60, n>=60); if (GetNumber()<60 && n>=60 && frame!=0) PlaySound(sndRage60); // hide light bar ShowChild(0, 0); // hide electric bar ShowChild(1, 0); StopAnimation(); ResizeBar(GetID(), n*1.15); Activate(uiRageFull, 0); } Number(n); } if (n>=100 && GetCharaStateName(g_chara)=="SuperAttackCharge") { float st = GetCharaStateTime(g_chara) * 115 / var_superAttackChargeTime; if (st > 115) st = 115; Begin(uiChiCharge); Show(); Size(st, 3); End(); } else { Begin(uiChiCharge); Show(0); End(); } End(); Begin(uiStamina); n = GetCharaAttrib(g_chara, CHARA_STAMINA); if (n != GetNumber()) { Number(n); if (n >= 100) { Size(n*1.15, 3); if (frame != 0) PlayAnimation(); } else { // hide light bar ShowChild(0, 0); ResizeBar(GetID(), n*1.15); } } End(); ShowToolBar(GetCharaToolBar(g_chara)); Begin(uiPhoenixStone); Number(GetCharaNumPhoenixStones(g_chara)); Show(GetNumber()>0); End(); } if (GetGameMaxTime()) { ShowTime(GetGameMaxTime()-int(GetGameTime())); ShowWinner(0, 0); } else if (var_rule != RULE_SCENARIO) { int n1, n2; GetHudNumber(n1, n2); if (var_rule==RULE_DEATH_MATCH || var_rule==RULE_CUSTOM1) { ShowWinner(n1, n2); ShowTime(-1); } else if (var_rule==RULE_TEAM_DEATH_MATCH || var_rule==RULE_CUSTOM2) { ShowWinner(0, 0); ShowTeamScore(n1, n2); } else if (var_rule == RULE_ONE_ON_ONE) { ShowWinner(n1, n2); ShowTime(-1); } else if (var_rule == RULE_GIANT_KILL) { ShowWinner(n1, n2); ShowTime(-1); } else if (var_rule == RULE_VIP) { ShowWinner(0, 0); ShowTime(-1); } } if (GetAppState()!=APPSTATE_PLAY_GAME) ClearSysMsg(); NextFrame(0.05); } void CameraMode_OnAnimate(int frame) { if (frame == 0) { TweenTextColor(1,1,1,1, 0.08,0.4,0.94,1, 0.3); NextFrame(0.4); } else if (frame == 1) { TweenTextColor(0.08,0.4,0.94,1, 1,1,1,1, 0.3); NextFrame(0.3, 0); } } void RageFull_OnAnimate(int frame) { if (frame == 0) { TweenColor(1,1,1,0, 1,1,1,1, 0.4); NextFrame(0.4); } else if (frame == 1) { TweenColor(1,1,1,1, 1,1,1,0, 0.4); NextFrame(0.4, 0); } } void HitCombo_OnAnimate(int frame) { int i, n, combo; if (frame == 0) { combo = GetNumber(); if (combo > 99) combo = 99; n = combo / 10; BeginChild(0); if (n > 0) { Show(1); Image(iconHitNumber[n]); } else { Show(0); } End(); n = combo % 10; BeginChild(1); Image(iconHitNumber[n]); End(); Show(1); for (i=0; i<3; i++) { BeginChild(i); TweenColor(1,1,1,0, 1,1,1,1, 0.3); End(); } int x1, y1, x2, y2; x1=250; y1=90; x2=220; y2=65; if (combo < 10) { x1=x1-15; x2=x2-15; } BeginChild(0); TweenPosition(x1,y1 ,x2,y2,0.2); TweenSize(15,20, 30,40, 0.2); End(); BeginChild(1); TweenPosition(x1+15,y1 ,x2+30,y2,0.2); TweenSize(15,20, 30,40, 0.2); End(); BeginChild(2); TweenPosition(x1+30,y1 ,x2+60,y2,0.2); TweenSize(20,10, 40,20, 0.2); End(); Ease(30); NextFrame(0.3); } else if (frame == 1) { NextFrame(var_hitComboTime-0.5); } else if (frame == 2) { for (i=0; i<3; i++) { BeginChild(i); TweenColor(1,1,1,1, 0,0,0,0, 0.2); End(); } NextFrame(0.2); } else if (frame == 3) { Show(0); } } void EquipFlash_OnAnimate(int frame) { int i; int s = NumChildren(); if (frame == 0) { Show(); for (i=0; i 0) NextFrame(GetFNumber()); else { if (IsVoicePlaying()) NextFrame(0.2, 0); // check voice again else NextFrame(2); } } else if (frame == 1) { TweenPosition(0, GetY(), -400, GetY(), 0.3); Ease(-20); NextFrame(0.3); } else if (frame == 2) { Show(0); Number(0); } } void IconLight_OnAnimate(int frame) { if (frame == 0) { TweenSize(ICONW,50, ICONW2,60, 0.3); TweenColor(1,1,1,0.6, 1,1,1,1, 0.3); BeginChild(0); Show(); TweenColor(1,1,1,0, 1,1,1,0.8, 0.5); TweenSize(ICONW,50, ICONW3,100, 0.3); End(); NextFrame(0.5); FNumber(1); } else if (frame == 1) { TweenSize(ICONW2,60, ICONW,50, 0.3); TweenColor(1,1,1,1, 1,1,1,0.6, 0.3); BeginChild(0); TweenColor(1,1,1,0.8, 1,1,1,0, 0.5); TweenSize(ICONW3,100, ICONW,50, 0.3); End(); NextFrame(0.5); } else if (frame == 2) { Size(ICONW,50); Color(1,1,1,0.6); ShowChild(0, 0); FNumber(0); } } void IconLight2_OnAnimate(int frame) { if (frame == 0) { TweenSize(ICONW,50, ICONW2,60, 0.3); TweenColor(1,1,1,0.6, 1,1,1,1, 0.3); BeginChild(0); TweenSize(ICONW,50, ICONW4,80, 0.3); Color(1,1,1); End(); NextFrame(0.3); FNumber(1); } else if (frame == 1) { TweenSize(ICONW2,60, ICONW,50, 0.3); TweenColor(1,1,1,1, 1,1,1,0.6, 0.3); BeginChild(0); TweenSize(ICONW4,80, ICONW,50, 0.3); End(); NextFrame(0.3); } else if (frame == 2) { Size(ICONW,50); Color(1,1,1,0.6); BeginChild(0); Size(ICONW, 50); End(); FNumber(0); } } void SysMsg_OnAnimate(int frame) { if (frame == 0) { Show(); TweenTextColor(1,1,1,0, 1,1,1,1, 0.3); NextFrame(4); } else if (frame == 1) { TweenTextColor(1,1,1,1, 1,1,1,0, 0.3); NextFrame(0.3); } else if (frame == 2) { Show(0); Number(0); ScrollUpSysMsg(); } } void ToolBar_OnAnimate(int frame) { int i; if (frame == 0) { if (GetNumber() == 0) { Show(); TweenPosition(180,0, 0,0, 0.2); //PlaySound(sndOpenToolbar); Number(1); } NextFrame(0.1); } else if (frame == 1) { Number(0); TweenPosition(GetX(),0, 180,0, 0.2); //PlaySound(sndCloseToolbar); NextFrame(0.2); } else if (frame == 2) { Show(0); } } void OnDefineUI() { int i, w; // load icon iconWeapon0[0] = iconWeapon1[0] = iconWeapon2[0] = 0; if (var_demoVersion == 0) { for (i=1; i<10; i++) { iconWeapon0[i] = CreateImage("icon_weapon"+NumToStr(i*10)); iconWeapon1[i] = CreateImage("icon_weapon"+NumToStr(i*10+2)); iconWeapon2[i] = CreateImage("icon_weapon"+NumToStr(i*10+2)); } } else { for (i=1; i<10; i++) { iconWeapon0[i] = 0; iconWeapon1[i] = 0; iconWeapon2[i] = 0; } iconWeapon0[2] = CreateImage("icon_weapon20"); iconWeapon0[4] = CreateImage("icon_weapon40"); iconWeapon0[5] = CreateImage("icon_weapon50"); iconWeapon0[7] = CreateImage("icon_weapon70"); } iconDart[0] = 0; iconDart[1] = CreateImage("icon_dart1"); iconDart[2] = CreateImage("icon_dart2"); iconDart[3] = CreateImage("icon_dart3"); iconDart[4] = CreateImage("icon_dart4"); for (i=0; i<10; i++) iconHitNumber[i] = CreateImage("num"+NumToStr(i)); if (var_demoVersion==0 && var_scenario!=0) { iconMissionItem[0] = CreateImage("icon_stonekey"); iconMissionItem[1] = CreateImage("icon_woodkey"); iconMissionItem[2] = CreateImage("icon_diamond"); iconMissionItem[3] = CreateImage("icon_silverkey"); iconMissionItem[4] = CreateImage("icon_goldkey"); } iconTalk[0] = CreateImage("icon_chanel_all"); iconTalk[1] = CreateImage("icon_chanel_team"); iconX[0]=645; iconY[0]=490; iconX[1]=680; iconY[1]=460; iconX[2]=680; iconY[2]=520; iconX[3]=715; iconY[3]=490; ICONW = 50 * WIDTH_RATIO; ICONW2 = 60 * WIDTH_RATIO; ICONW3 = 100 * WIDTH_RATIO; ICONW4 = 80 * WIDTH_RATIO; Begin(uiStatusBar=NewUI()); Begin(NewUI()); Position(55, 45); Size(160, 80); Image("statusbar"); Color(1,1,1); End(); Begin(uiHP=NewUI("HP")); Color(1,0.2,0.15,0.8); Position(95, 67); Begin(NewUI()); Position(90, 65); Size(125, 6); AbsCoord(); Layer(2); Image("lightbar"); Blend(BLEND_MODE_ADD); Show(0); End(); Begin(NewUI()); Position(90, 65); Size(125, 6); AbsCoord(); Layer(2); Image("electric"); Blend(BLEND_MODE_ADD); Show(0); End(); End(); Begin(uiRage=NewUI("Rage")); Color(0,0.4,0.8,0.9); Position(93, 83); Begin(NewUI()); Position(88, 81); Size(125, 6); AbsCoord(); Layer(2); Image("lightbar"); Blend(BLEND_MODE_ADD); Show(0); End(); Begin(NewUI()); Position(88, 81); Size(125, 6); AbsCoord(); Layer(2); Image("electric"); Blend(BLEND_MODE_ADD); Show(0); End(); End(); Begin(uiStamina=NewUI("Stamina")); Color(0.8,0.7,0.2,0.8); Position(91, 100); Begin(NewUI()); Position(86, 98); Size(125, 6); AbsCoord(); Layer(2); Image("lightbar"); Blend(BLEND_MODE_ADD); Show(0); End(); Begin(NewUI()); Position(86, 98); Size(125, 6); AbsCoord(); Layer(2); Image("electric"); Blend(BLEND_MODE_ADD); Show(0); End(); End(); Begin(uiRageFull=NewUI("RageFull")); Position(55, 45); Size(80, 80); Color(1,1,1); Image("statusbar_shine"); Blend(BLEND_MODE_ADD); Show(0); PlayAnimation(); End(); // rage >= 60 Begin(uiRage60=NewUI()); Position(159, 83); Show(0); w = 20 * WIDTH_RATIO; Begin(NewUI()); Size(w, 20); Align(UI_ALIGN_CENTER_XY); Image("bluestorm"); Color(1,1,1); Blend(BLEND_MODE_ADD); Rotate(50); End(); Begin(NewUI()); Size(w, 20); Align(UI_ALIGN_CENTER_XY); Image("bluestorm"); Color(1,1,1); Blend(BLEND_MODE_ADD); Rotate(100); End(); Begin(NewUI()); Size(w, 20); Align(UI_ALIGN_CENTER_XY); Image("bluestorm"); Color(1,1,1); Blend(BLEND_MODE_ADD); Rotate(160); End(); End(); Begin(uiChiCharge=NewUI()); Position(208, 83); Size(115, 3); Align(UI_ALIGN_RIGHT); Color(1,1,1,0.7); Layer(1); End(); End(); Begin(uiItemBar=NewUI()); EventHandler("OnAnimate", "ToolBar_OnAnimate"); // 飛鏢 Begin(uiDart=NewUI()); Position(iconX[0], iconY[0]); Size(ICONW,50); Align(UI_ALIGN_CENTER_XY); Image("icon_button_x"); Color(1,1,1,0.6); EventHandler("OnAnimate", "IconLight2_OnAnimate"); Begin(NewUI()); Size(ICONW,50); Align(UI_ALIGN_CENTER_XY); Image(iconDart); Color(1,1,1); End(); End(); // 特裝 Begin(uiEquip=NewUI()); Position(iconX[1], iconY[1]); Size(ICONW,50); Align(UI_ALIGN_CENTER_XY); Image("icon_button_y"); Color(1,1,1,0.6); EventHandler("OnAnimate", "IconLight2_OnAnimate"); Begin(NewUI()); Size(ICONW,50); Align(UI_ALIGN_CENTER_XY); Color(1,1,1); End(); End(); // 交換物品, 調查 Begin(uiItem=NewUI()); Position(iconX[2], iconY[2]); Size(ICONW,50); Align(UI_ALIGN_CENTER_XY); Image("icon_button_a"); Color(1,1,1,0.6); EventHandler("OnAnimate", "IconLight2_OnAnimate"); End(); // 武器 Begin(uiWeapon1=NewUI()); Position(iconX[3], iconY[3]); Size(ICONW,50); Align(UI_ALIGN_CENTER_XY); Image("icon_button_b"); Color(1,1,1,0.6); EventHandler("OnAnimate", "IconLight2_OnAnimate"); Begin(NewUI()); Size(ICONW,50); Align(UI_ALIGN_CENTER_XY); Color(1,1,1); End(); End(); // 飛鏢數量 Begin(uiNumDarts=NewUI()); Position(iconX[0]+10, iconY[0]); Number(4); Font(1); TextColor(1,1,1,0.9); TextSize(22); TextFlag(TEXT_ALIGN_CENTER|TEXT_SHADOW); ShowNumber(0); End(); // 使用特裝效果 Begin(uiEquipFlash=NewUI("EquipFlash")); Position(iconX[1], iconY[1]); Show(0); Begin(NewUI()); Size(ICONW, 50); Align(UI_ALIGN_CENTER_XY); Image("bluestorm"); Blend(BLEND_MODE_ADD); Rotate(50); End(); Begin(NewUI()); Size(ICONW, 50); Align(UI_ALIGN_CENTER_XY); Image("bluestorm"); Blend(BLEND_MODE_ADD); Rotate(100); End(); Begin(NewUI()); Size(ICONW, 50); Align(UI_ALIGN_CENTER_XY); Image("bluestorm"); Blend(BLEND_MODE_ADD); Rotate(160); End(); End(); End(); // AI command Begin(uiAICmdBar=NewUI()); EventHandler("OnAnimate", "ToolBar_OnAnimate"); for (i=0; i<4; i++) { Begin(NewUI()); if (var_demoVersion==0 && var_scenario!=0) { Position(iconX[i], iconY[i]); Size(ICONW, 50); Align(UI_ALIGN_CENTER_XY); Image("icon_aicmd" + NumToStr(i+1)); Color(1,1,1,0.6); EventHandler("OnAnimate", "IconLight_OnAnimate"); Begin(NewUI()); Size(ICONW, 50); Align(UI_ALIGN_CENTER_XY); Image("icon_aicmd"+NumToStr(i+1)+"_shine"); Blend(BLEND_MODE_ADD); Show(0); End(); } End(); } End(); // 情緒動作 Begin(uiPerformBar=NewUI()); EventHandler("OnAnimate", "ToolBar_OnAnimate"); for (i=0; i<4; i++) { Begin(NewUI()); Position(iconX[i], iconY[i]); Size(ICONW, 50); Align(UI_ALIGN_CENTER_XY); Image("icon_om" + NumToStr(i+1)); Color(1,1,1,0.6); EventHandler("OnAnimate", "IconLight_OnAnimate"); Begin(NewUI()); Size(ICONW, 50); Align(UI_ALIGN_CENTER_XY); Image("icon_om"+NumToStr(i+1)+"_shine"); Blend(BLEND_MODE_ADD); Show(0); End(); End(); } End(); Begin(uiTalk=NewUI("Talk")); Position(iconX[1], iconY[0]); Size(30*WIDTH_RATIO, 30); Align(UI_ALIGN_CENTER_XY); Image(iconTalk[0]); Color(1,1,1); End(); // 時間 Begin(uiTime=NewUITime(400, 50, 40)); EventHandler("OnAnimate", "Time_OnAnimate"); End(); Begin(uiCameraMode=NewUI("CameraMode")); Font(1); TextSize(16); TextFlag(TEXT_ALIGN_CENTER | TEXT_SHADOW); Text(STR_BACK_CAMERA); Position(400, 90); PlayAnimation(); End(); Begin(uiWinner=NewUI()); Position(330, 50); Font(1); TextSize(30); TextColor(1,1,1); TextFlag(TEXT_SHADOW); End(); Begin(uiHitCombo=NewUI("HitCombo")); Begin(NewUI()); Blend(BLEND_MODE_ADD); End(); Begin(NewUI()); Blend(BLEND_MODE_ADD); End(); Begin(NewUI()); Image("hit"); Blend(BLEND_MODE_ADD); End(); Show(0); End(); Begin(uiPhoenixStone=NewUI("PhoenixStone")); Position(140, 105); Size(40, 40); Color(1,1,1); Image("icon_phoenixstone"); Font(1); TextSize(20); TextColor(1,1,1); TextFlag(TEXT_SHADOW); TextOffset(30, 8); ShowNumber(0); End(); Begin(uiMissionItem=NewUI("MissionItem")); Position(80, 105); Size(40, 40); Color(1,1,1); Image(iconMissionItem[0]); Font(1); TextSize(20); TextColor(1,1,1); TextFlag(TEXT_SHADOW); TextOffset(30, 8); ShowNumber(0); End(); Begin(uiHint=NewUI("Hint")); Position(0, 450); Size(600, 30); Gradient(0,0,0,1, 0,0,0,0, 2); Font(1); TextColor(1,1,1); TextSize(20); TextOffset(70, 0); Show(0); TextFlag(TEXT_ALIGN_CENTER_Y | TEXT_MULTILINES); End(); Begin(uiSay=NewUI("Say")); Position(0, 125); Size(400, 25); Gradient(0,0,0,1, 0,0,0,0, 2); Font(1); TextColor(1,1,1); TextSize(20); TextOffset(120, 2); Show(0); Begin(NewUI()); // head image Position(50, -5); Size(70*WIDTH_RATIO, 35); Flip(1); Color(1,1,1); End(); End(); for (i=0; i