diff --git a/init.lua b/init.lua index e3cee7aee703da1ffd49ffdc7cd06b2f35699a24..0b3d2f97e052cfa1959b0830df67c9a611dfe2fe 100644 --- a/init.lua +++ b/init.lua @@ -16,6 +16,7 @@ local function getRank(mvp) local room = mvp.room local rank = 1 local gameData = mvp._splayer:getGameData() + if not gameData then return 0 end local tot, win = gameData:at(0), gameData:at(1) local lose = tot - win local exp = win * 5 + lose @@ -99,7 +100,7 @@ local mobile_effect = fk.CreateTriggerSkill{ -- 下面那个同理 player:setMark("n_mobile_effect_heal-turn", x) else - local from = rec.recoverBy + local from = rec.recoverBy ---@type ServerPlayer local x = from:getMark("n_mobile_effect_rescue-round") if x == 0 then x = {} end local k = tostring(player.id) -- 标记必须能用JSON表达才行,所以键必须字符串 @@ -141,7 +142,7 @@ local mobile_effect = fk.CreateTriggerSkill{ end elseif event == fk.GameFinished then local winners = data:split("+") - winners = table.filter(room.alive_players, function(p) + winners = table.filter(room.alive_players, function(p) ---@type ServerPlayer[] return table.contains(winners, p.role) end) if #winners > 0 and math.random() > 0.05 then @@ -178,6 +179,14 @@ Fk:loadTranslationTable{ ["$mobile_effect10"] = "(傲视群雄)", ["$mobile_effect11"] = "医术高超~", ["$mobile_effect12"] = "妙手回春~", + + ["Player Username"] = "玩家昵称", + ["TEC Score: "] = "技术分:", + ["ATK Score"] = "攻击分数", + ["Healing Score"] = "治疗分数", + ["Help Score"] = "辅助分数", + ["Situation Score"] = "局势分数", + ["Punishment Score"] = "惩罚扣分", } Fk:addSkill(mobile_effect) diff --git a/qml/MobileMvp.qml b/qml/MobileMvp.qml index 6edd14743922891ed83322ae6f8fba526b62edb4..d8116020dbe8f06e05a6604ef9cb1ddf83fcc28f 100644 --- a/qml/MobileMvp.qml +++ b/qml/MobileMvp.qml @@ -108,7 +108,7 @@ Item { id: nick_txt color: "#E2B873" font.family: fontLibian.name - text: "玩家昵称" + text: luatr("Player Username") font.pointSize: 16 style: Text.Outline styleColor: "#4F1809" @@ -126,7 +126,7 @@ Item { } Text { id: total_score - text: "技术分:" + (attack_score + heal_score + help_score + global_score + punish) + text: luatr("TEC Score: ") + (attack_score + heal_score + help_score + global_score + punish) anchors.top: player.bottom font.pointSize: 16 style: Text.Outline @@ -139,11 +139,11 @@ Item { Text { id: detail_score opacity: 0 - text: "攻击分数\t" + attack_score + - "\n治疗分数\t" + heal_score + - // "\n辅助分数\t" + help_score + - "\n局势分数\t" + global_score + - "\n惩罚扣分\t" + punish + text: luatr("ATK Score") + "\t" + attack_score + + "\n" + luatr("Healing Score") + "\t" + heal_score + + // "\n" + luatr("Help Score") + "\t" + help_score + + "\n" + luatr("Situation Score") + "\t" + global_score + + "\n" + luatr("Punishment Score") + "\t" + punish x: rank.x + 40 y: rank.y + rank.height font.pointSize: 16