Changelog: v0.3.7

This commit is contained in:
notify 2023-08-27 21:22:03 +08:00
parent db2910d1f0
commit 17f981f135
23 changed files with 181 additions and 145 deletions

View File

@ -2,6 +2,14 @@
___ ___
## v0.3.7
新老bug一起修复
这个周末是真的忙
___
## v0.3.5 ## v0.3.5
小测一下修了bug推个稳定版 小测一下修了bug推个稳定版

View File

@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(FreeKill VERSION 0.3.6) project(FreeKill VERSION 0.3.7)
add_definitions(-DFK_VERSION=\"${CMAKE_PROJECT_VERSION}\") add_definitions(-DFK_VERSION=\"${CMAKE_PROJECT_VERSION}\")
find_package(Qt6 REQUIRED COMPONENTS find_package(Qt6 REQUIRED COMPONENTS

View File

@ -275,7 +275,12 @@ Item {
contentItem: ColumnLayout { contentItem: ColumnLayout {
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true
text: Backend.translate(name) + (idx ? " (" + idx.toString() + ")" : "") text: {
if (name.endsWith("_win_audio")) {
return "胜利语音";
}
return Backend.translate(name) + (idx ? " (" + idx.toString() + ")" : "");
}
font.bold: true font.bold: true
font.pixelSize: 14 font.pixelSize: 14
} }

View File

@ -1107,7 +1107,7 @@ Item {
i: idx, i: idx,
})); }));
} catch (e) {} } catch (e) {}
const m = Backend.translate("$" + skill + (gene ? "_" + gene : "") + idx.toString()); const m = Backend.translate("$" + skill + (gene ? "_" + gene : "") + (idx ? idx.toString() : ""));
if (general === "") if (general === "")
chat.append(`[${time}] ${userName}: ${m}`); chat.append(`[${time}] ${userName}: ${m}`);
else else

View File

@ -98,7 +98,7 @@ CardItem {
} }
Shield { Shield {
visible: detailed visible: shieldNum > 0 && detailed
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: hpRepeater.model > 4 ? 16 : 0 anchors.topMargin: hpRepeater.model > 4 ? 16 : 0

View File

@ -11,7 +11,7 @@ GraphicsBox {
// TODO: Adjust the UI design in case there are more than 7 cards // TODO: Adjust the UI design in case there are more than 7 cards
width: 70 + 700 width: 70 + 700
height: 50 + Math.min(cardView.contentHeight, 400) + (multiChoose ? 20 : 0) height: 64 + Math.min(cardView.contentHeight, 400) + (multiChoose ? 20 : 0)
signal cardSelected(int cid) signal cardSelected(int cid)
signal cardsSelected(var ids) signal cardsSelected(var ids)

View File

@ -3,8 +3,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.notify.FreeKill" package="org.notify.FreeKill"
android:installLocation="preferExternal" android:installLocation="preferExternal"
android:versionCode="306" android:versionCode="307"
android:versionName="0.3.6"> android:versionName="0.3.7">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

View File

@ -284,11 +284,11 @@ FreeKill使用的是libgit2的C API与此同时使用Git完成拓展包的下
["Resume"] = "继续", ["Resume"] = "继续",
["Bulletin Info"] = [==[ ["Bulletin Info"] = [==[
## v0.3.6 ## v0.3.7
0.3.6bug 0.3.7bug退
]==], ]==],
} }
@ -446,6 +446,7 @@ Fk:loadTranslationTable{
["#GuanxingResult"] = "%from 的观星结果为 %arg 上 %arg2 下", ["#GuanxingResult"] = "%from 的观星结果为 %arg 上 %arg2 下",
["#ChainStateChange"] = "%from %arg 了武将牌", ["#ChainStateChange"] = "%from %arg 了武将牌",
["#ChainDamage"] = "%from 处于连环状态,将受到传导的伤害", ["#ChainDamage"] = "%from 处于连环状态,将受到传导的伤害",
["#ChangeKingdom"] = "%from 的国籍从 %arg 变成了 %arg2",
} }
-- card footnote -- card footnote

View File

@ -1,114 +1,114 @@
-- SPDX-License-Identifier: GPL-3.0-or-later -- SPDX-License-Identifier: GPL-3.0-or-later
GameEvent.functions[GameEvent.ChangeProperty] = function(self) GameEvent.functions[GameEvent.ChangeProperty] = function(self)
local data = table.unpack(self.data) local data = table.unpack(self.data)
local room = self.room local room = self.room
local player = data.from local player = data.from
local logic = room.logic local logic = room.logic
logic:trigger(fk.BeforePropertyChange, player, data) logic:trigger(fk.BeforePropertyChange, player, data)
data.sendLog = data.sendLog or false data.sendLog = data.sendLog or false
local skills = {} local skills = {}
if data.general and data.general ~= "" and data.general ~= player.general then if data.general and data.general ~= "" and data.general ~= player.general then
local originalGeneral = Fk.generals[player.general] or Fk.generals["blank_shibing"] local originalGeneral = Fk.generals[player.general] or Fk.generals["blank_shibing"]
local originalSkills = originalGeneral and originalGeneral:getSkillNameList() or Util.DummyTable local originalSkills = originalGeneral and originalGeneral:getSkillNameList() or Util.DummyTable
table.insertTableIfNeed(skills, table.map(originalSkills, function(e) table.insertTableIfNeed(skills, table.map(originalSkills, function(e)
return "-" .. e return "-" .. e
end)) end))
local newGeneral = Fk.generals[data.general] or Fk.generals["blank_shibing"] local newGeneral = Fk.generals[data.general] or Fk.generals["blank_shibing"]
for _, name in ipairs(newGeneral:getSkillNameList()) do for _, name in ipairs(newGeneral:getSkillNameList()) do
local s = Fk.skills[name] local s = Fk.skills[name]
if not s.relate_to_place or s.relate_to_place == "m" then if not s.relate_to_place or s.relate_to_place == "m" then
table.insertIfNeed(skills, name) table.insertIfNeed(skills, name)
end end
end end
if data.sendLog then if data.sendLog then
room:sendLog{ room:sendLog{
type = "#ChangeHero", type = "#ChangeHero",
from = player.id, from = player.id,
arg = player.general, arg = player.general,
arg2 = data.general, arg2 = data.general,
arg3 = "mainGeneral", arg3 = "mainGeneral",
} }
end end
data.results["generalChange"] = {player.general, data.general} data.results["generalChange"] = {player.general, data.general}
room:setPlayerProperty(player, "general", data.general) room:setPlayerProperty(player, "general", data.general)
end end
if data.deputyGeneral and data.deputyGeneral ~= "" and data.deputyGeneral ~= player.deputyGeneral then if data.deputyGeneral and data.deputyGeneral ~= "" and data.deputyGeneral ~= player.deputyGeneral then
local originalDeputy = Fk.generals[player.deputyGeneral] or Fk.generals["blank_shibing"] local originalDeputy = Fk.generals[player.deputyGeneral] or Fk.generals["blank_shibing"]
local originalSkills = originalDeputy and originalDeputy:getSkillNameList() or Util.DummyTable local originalSkills = originalDeputy and originalDeputy:getSkillNameList() or Util.DummyTable
table.insertTableIfNeed(skills, table.map(originalSkills, function(e) table.insertTableIfNeed(skills, table.map(originalSkills, function(e)
return "-" .. e return "-" .. e
end)) end))
local newDeputy = Fk.generals[data.deputyGeneral] or Fk.generals["blank_shibing"] local newDeputy = Fk.generals[data.deputyGeneral] or Fk.generals["blank_shibing"]
for _, name in ipairs(newDeputy:getSkillNameList()) do for _, name in ipairs(newDeputy:getSkillNameList()) do
local s = Fk.skills[name] local s = Fk.skills[name]
if not s.relate_to_place or s.relate_to_place == "d" then if not s.relate_to_place or s.relate_to_place == "d" then
table.insertIfNeed(skills, name) table.insertIfNeed(skills, name)
end end
end end
if data.sendLog then if data.sendLog then
room:sendLog{ room:sendLog{
type = "#ChangeHero", type = "#ChangeHero",
from = player.id, from = player.id,
arg = player.deputyGeneral, arg = player.deputyGeneral,
arg2 = data.deputyGeneral, arg2 = data.deputyGeneral,
arg3 = "deputyGeneral", arg3 = "deputyGeneral",
} }
end end
data.results["deputyChange"] = {player.deputyGeneral, data.deputyGeneral} data.results["deputyChange"] = {player.deputyGeneral, data.deputyGeneral}
room:setPlayerProperty(player, "deputyGeneral", data.deputyGeneral) room:setPlayerProperty(player, "deputyGeneral", data.deputyGeneral)
end end
if data.gender and data.gender ~= player.gender then if data.gender and data.gender ~= player.gender then
data.results["genderChange"] = {player.gender, data.gender} data.results["genderChange"] = {player.gender, data.gender}
room:setPlayerProperty(player, "gender", data.gender) room:setPlayerProperty(player, "gender", data.gender)
end end
if data.kingdom and data.kingdom ~= "" and data.kingdom ~= player.kingdom then if data.kingdom and data.kingdom ~= "" and data.kingdom ~= player.kingdom then
if data.sendLog then if data.sendLog then
room:sendLog{ room:sendLog{
type = "#ChangeKingdom", type = "#ChangeKingdom",
from = player.id, from = player.id,
arg = player.kingdom, arg = player.kingdom,
arg2 = data.kingdom, arg2 = data.kingdom,
} }
end end
data.results["kingdomChange"] = {player.kingdom, data.kingdom} data.results["kingdomChange"] = {player.kingdom, data.kingdom}
room:setPlayerProperty(player, "kingdom", data.kingdom) room:setPlayerProperty(player, "kingdom", data.kingdom)
end end
for _, s in ipairs(Fk.generals[player.general].skills) do for _, s in ipairs(Fk.generals[player.general].skills) do
if #s.attachedKingdom > 0 then if #s.attachedKingdom > 0 then
if table.contains(s.attachedKingdom, player.kingdom) then if table.contains(s.attachedKingdom, player.kingdom) then
table.insertIfNeed(skills, s.name) table.insertIfNeed(skills, s.name)
else else
if table.contains(skills, s.name) then if table.contains(skills, s.name) then
table.removeOne(skills, s.name) table.removeOne(skills, s.name)
else else
table.insertIfNeed(skills, "-"..s.name) table.insertIfNeed(skills, "-"..s.name)
end end
end end
end end
end end
if player.deputyGeneral ~= "" then if player.deputyGeneral ~= "" then
for _, s in ipairs(Fk.generals[player.deputyGeneral].skills) do for _, s in ipairs(Fk.generals[player.deputyGeneral].skills) do
if #s.attachedKingdom > 0 then if #s.attachedKingdom > 0 then
if table.contains(s.attachedKingdom, player.kingdom) then if table.contains(s.attachedKingdom, player.kingdom) then
table.insertIfNeed(skills, s.name) table.insertIfNeed(skills, s.name)
else else
if table.contains(skills, s.name) then if table.contains(skills, s.name) then
table.removeOne(skills, s.name) table.removeOne(skills, s.name)
else else
table.insertIfNeed(skills, "-"..s.name) table.insertIfNeed(skills, "-"..s.name)
end end
end end
end end
end end
end end
room:handleAddLoseSkills(player, table.concat(skills, "|"), nil, data.sendLog, false) room:handleAddLoseSkills(player, table.concat(skills, "|"), nil, false, false)
logic:trigger(fk.AfterPropertyChange, player, data) logic:trigger(fk.AfterPropertyChange, player, data)
end end

View File

@ -38,6 +38,7 @@ GameEvent.functions[GameEvent.Pindian] = function(self)
table.insert(moveInfos, { table.insert(moveInfos, {
ids = { _pindianCard.id }, ids = { _pindianCard.id },
from = pindianData.from.id,
fromArea = room:getCardArea(_pindianCard.id), fromArea = room:getCardArea(_pindianCard.id),
toArea = Card.Processing, toArea = Card.Processing,
moveReason = fk.ReasonPut, moveReason = fk.ReasonPut,

15
mkfksource.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
dir=FreeKill-${FK_VER}
mkdir $dir
echo Copying
cp -r ./Freekill/.git $dir
cd $dir
git restore .
git checkout v$FK_VER
rm -rf .git lib docker docs android wasm
cd ..
echo Compressing
tar cfz ${dir}-source.tar.gz $dir

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -41,10 +41,10 @@ local cheat = fk.CreateActiveSkill{
end end
local cardName = room:askForChoice(from, allCardNames, "cheat") local cardName = room:askForChoice(from, allCardNames, "cheat")
local toGain = room:printCard(cardName, Card.Heart, 1) local toGain -- = room:printCard(cardName, Card.Heart, 1)
-- if #allCardMapper[cardName] > 0 then if #allCardMapper[cardName] > 0 then
-- toGain = allCardMapper[cardName][math.random(1, #allCardMapper[cardName])] toGain = allCardMapper[cardName][math.random(1, #allCardMapper[cardName])]
-- end end
-- from:addToPile(self.name, toGain, true, self.name) -- from:addToPile(self.name, toGain, true, self.name)
-- room:setCardMark(Fk:getCardById(toGain), "@@test_cheat-phase", 1) -- room:setCardMark(Fk:getCardById(toGain), "@@test_cheat-phase", 1)
@ -313,17 +313,18 @@ local test_feichu = fk.CreateActiveSkill{
room:abortPlayerArea(from, eqipSlots) room:abortPlayerArea(from, eqipSlots)
end, end,
} }
local test2 = General(extension, "mouxusheng", "wu", 99, 99, General.Female) local test2 = General(extension, "mouxusheng", "wu", 4, 4, General.Female)
test2.shield = 5 test2.shield = 3
test2.hidden = true
test2:addSkill("rende") test2:addSkill("rende")
test2:addSkill(cheat) test2:addSkill(cheat)
test2:addSkill(control) test2:addSkill(control)
--test2:addSkill(test_vs) --test2:addSkill(test_vs)
--test2:addSkill(test_trig) --test2:addSkill(test_trig)
test2:addSkill(damage_maker) test2:addSkill(damage_maker)
test2:addSkill(change_hero)
test2:addSkill(test_zhenggong) test2:addSkill(test_zhenggong)
test2:addSkill(test_feichu) test2:addSkill(change_hero)
-- test2:addSkill(test_feichu)
local shibing = General(extension, "blank_shibing", "qun", 5) local shibing = General(extension, "blank_shibing", "qun", 5)
shibing.hidden = true shibing.hidden = true
@ -344,13 +345,15 @@ Fk:loadTranslationTable{
[":test_filter"] = "你的点数大于11的牌视为无中生有。", [":test_filter"] = "你的点数大于11的牌视为无中生有。",
["mouxusheng"] = "谋徐盛", ["mouxusheng"] = "谋徐盛",
-- ["cheat"] = "小开", -- ["cheat"] = "小开",
[":cheat"] = "出牌阶段,你可以以红桃A打印一张想要的牌并获得之", [":cheat"] = "出牌阶段,你可获得想要的牌",
["#cheat"] = "cheat你可以获得一张想要的牌", ["#cheat"] = "cheat你可以获得一张想要的牌",
["$cheat"] = "喝啊!",
-- ["@@test_cheat-phase"] = "苦肉", -- ["@@test_cheat-phase"] = "苦肉",
-- ["@@test_cheat-inhand"] = "连营", -- ["@@test_cheat-inhand"] = "连营",
--["#test_trig-ask"] = "你可弃置一张手牌", --["#test_trig-ask"] = "你可弃置一张手牌",
["control"] = "控制", ["control"] = "控制",
[":control"] = "出牌阶段,你可以控制/解除控制若干名其他角色。", [":control"] = "出牌阶段,你可以控制/解除控制若干名其他角色。",
["$control"] = "战将临阵,斩关刈城!",
["test_vs"] = "视为", ["test_vs"] = "视为",
[":test_vs"] = "你可以将牌当包含无懈在内的某张锦囊使用。", [":test_vs"] = "你可以将牌当包含无懈在内的某张锦囊使用。",
@ -360,12 +363,17 @@ Fk:loadTranslationTable{
[":damage_maker"] = "出牌阶段,你可以进行一次伤害制造器。", [":damage_maker"] = "出牌阶段,你可以进行一次伤害制造器。",
["#damage_maker"] = "制伤:选择一名小白鼠,可选另一名角色做伤害来源(默认谋徐盛)", ["#damage_maker"] = "制伤:选择一名小白鼠,可选另一名角色做伤害来源(默认谋徐盛)",
["#revive-ask"] = "复活一名角色!", ["#revive-ask"] = "复活一名角色!",
["$damage_maker"] = "区区数百魏军,看我一击灭之!",
["change_hero"] = "变更",
[":change_hero"] = "出牌阶段,你可以变更一名角色武将牌。",
["test_zhenggong"] = "迅测", ["test_zhenggong"] = "迅测",
[":test_zhenggong"] = "锁定技,首轮开始时,你执行额外的回合。", [":test_zhenggong"] = "锁定技,首轮开始时,你执行额外的回合。",
["$test_zhenggong"] = "今疑兵之计,已搓敌兵心胆,其安敢侵近!",
["change_hero"] = "变更",
[":change_hero"] = "出牌阶段,你可以变更一名角色武将牌。",
["$change_hero"] = "敌军色厉内荏,可筑假城以退敌!",
["~mouxusheng"] = "来世,愿再为我江东之臣……",
} }
return { extension } return { extension }

View File

@ -3,13 +3,8 @@
#include "packman.h" #include "packman.h"
#include "git2.h" #include "git2.h"
#include "util.h" #include "util.h"
#include <qjsondocument.h>
#ifndef FK_SERVER_ONLY
#include "qmlbackend.h" #include "qmlbackend.h"
#else #include <qjsondocument.h>
static void *Backend = nullptr;
#endif
PackMan *Pacman; PackMan *Pacman;

View File

@ -198,6 +198,8 @@ int main(int argc, char *argv[]) {
prepareForLinux(); prepareForLinux();
#endif #endif
Pacman = new PackMan;
#ifndef FK_CLIENT_ONLY #ifndef FK_CLIENT_ONLY
// 分析命令行,如果有 -s 或者 --server 就在命令行直接开服务器 // 分析命令行,如果有 -s 或者 --server 就在命令行直接开服务器
QCommandLineParser parser; QCommandLineParser parser;
@ -239,7 +241,6 @@ int main(int argc, char *argv[]) {
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
// Linux 服务器的话可以启用一个 Shell 来操作服务器。 // Linux 服务器的话可以启用一个 Shell 来操作服务器。
auto shell = new Shell; auto shell = new Shell;
Pacman = new PackMan;
shell->start(); shell->start();
#endif #endif
} }
@ -308,8 +309,6 @@ int main(int argc, char *argv[]) {
QmlBackend backend; QmlBackend backend;
backend.setEngine(engine); backend.setEngine(engine);
Pacman = new PackMan;
// 向 Qml 中先定义几个全局变量 // 向 Qml 中先定义几个全局变量
engine->rootContext()->setContextProperty("FkVersion", FK_VERSION); engine->rootContext()->setContextProperty("FkVersion", FK_VERSION);
engine->rootContext()->setContextProperty("Backend", &backend); engine->rootContext()->setContextProperty("Backend", &backend);

View File

@ -18,3 +18,5 @@ class ClientPlayer *Self = nullptr;
%include "qml-nogui.i" %include "qml-nogui.i"
%include "player.i" %include "player.i"
%include "server.i" %include "server.i"
QString GetDisabledPacks();

View File

@ -15,3 +15,5 @@
%include "qt.i" %include "qt.i"
%include "player.i" %include "player.i"
%include "client.i" %include "client.i"
QString GetDisabledPacks();