Maneuvering (#72)

军争包还差火攻、酒、朱雀羽扇没做
铁索还没法重铸
除此之外还行
This commit is contained in:
notify 2023-03-09 12:19:16 +08:00 committed by GitHub
parent 2f3aa47725
commit 590af8cb14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
212 changed files with 369 additions and 7 deletions

View File

@ -21,6 +21,7 @@ chmod 644 assets/res/certs/*
mkdir assets/res/packages mkdir assets/res/packages
cp -r ../packages/standard assets/res/packages cp -r ../packages/standard assets/res/packages
cp -r ../packages/standard_cards assets/res/packages cp -r ../packages/standard_cards assets/res/packages
cp -r ../packages/maneuvering assets/res/packages
cp -r ../packages/test assets/res/packages cp -r ../packages/test assets/res/packages
rm assets/res/packages/test/test.lua rm assets/res/packages/test/test.lua
cp ../packages/init.sql assets/res/packages cp ../packages/init.sql assets/res/packages

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@ -125,6 +125,9 @@ Fk:loadTranslationTable{
["phase_draw"] = "摸牌阶段", ["phase_draw"] = "摸牌阶段",
["phase_play"] = "出牌阶段", ["phase_play"] = "出牌阶段",
["phase_discard"] = "弃牌阶段", ["phase_discard"] = "弃牌阶段",
["chained"] = "横置",
["not-chained"] = "重置",
} }
-- related to sendLog -- related to sendLog
@ -142,6 +145,8 @@ Fk:loadTranslationTable{
["$DrawCards"] = "%from 摸了 %arg 张牌 %card", ["$DrawCards"] = "%from 摸了 %arg 张牌 %card",
["$DiscardCards"] = "%from 弃置了 %arg 张牌 %card", ["$DiscardCards"] = "%from 弃置了 %arg 张牌 %card",
["$InstallEquip"] = "%from 装备了 %card",
["$UninstallEquip"] = "%from 卸载了 %card",
-- phase -- phase
["#PhaseSkipped"] = "%from 跳过了 %arg", ["#PhaseSkipped"] = "%from 跳过了 %arg",
@ -192,4 +197,6 @@ Fk:loadTranslationTable{
-- misc -- misc
["#GuanxingResult"] = "%from 的观星结果为 %arg 上 %arg2 下", ["#GuanxingResult"] = "%from 的观星结果为 %arg 上 %arg2 下",
["#ChainStateChange"] = "%from %arg 了武将牌",
["#ChainDamage"] = "%from 处于连环状态,将受到传导的伤害",
} }

View File

@ -57,7 +57,8 @@ local function matchCard(matcher, card)
card = Fk:getCardById(card) card = Fk:getCardById(card)
end end
if matcher.name and not table.contains(matcher.name, card.name) then if matcher.name and not table.contains(matcher.name, card.name) and
not table.contains(matcher.name, card.trueName) then
return false return false
end end

View File

@ -463,6 +463,10 @@ function Player:isWounded()
return self.hp < self.maxHp return self.hp < self.maxHp
end end
function Player:getLostHp()
return math.min(self.maxHp - self.hp, self.maxHp)
end
---@param skill string | Skill ---@param skill string | Skill
---@return Skill ---@return Skill
local function getActualSkill(skill) local function getActualSkill(skill)

View File

@ -1,7 +1,13 @@
local playCardEmotionAndSound = function(room, player, card) local playCardEmotionAndSound = function(room, player, card)
if card.type ~= Card.TypeEquip then if card.type ~= Card.TypeEquip then
room:setEmotion(player, "./packages/" .. local anim_path = "./packages/" .. card.package.extensionName .. "/image/anim/" .. card.name
card.package.extensionName .. "/image/anim/" .. card.name) if not FileIO.exists(anim_path) then
for _, dir in ipairs(FileIO.ls("./packages/")) do
anim_path = "./packages/" .. dir .. "/image/anim/" .. card.name
if FileIO.exists(anim_path) then break end
end
end
if FileIO.exists(anim_path) then room:setEmotion(player, anim_path) end
end end
local soundName local soundName
@ -19,6 +25,13 @@ local playCardEmotionAndSound = function(room, player, card)
else else
soundName = "./packages/" .. card.package.extensionName .. "/audio/card/" soundName = "./packages/" .. card.package.extensionName .. "/audio/card/"
.. (player.gender == General.Male and "male/" or "female/") .. card.name .. (player.gender == General.Male and "male/" or "female/") .. card.name
if not FileIO.exists(soundName .. ".mp3") then
for _, dir in ipairs(FileIO.ls("./packages/")) do
soundName = "./packages/" .. dir .. "/audio/card/"
.. (player.gender == General.Male and "male/" or "female/") .. card.name
if FileIO.exists(soundName .. ".mp3") then break end
end
end
end end
room:broadcastPlaySound(soundName) room:broadcastPlaySound(soundName)
end end

View File

@ -899,7 +899,10 @@ function Room:askForCardsChosen(chooser, target, min, max, flag, reason)
end end
local new_ret = table.filter(ret, function(id) return id ~= -1 end) local new_ret = table.filter(ret, function(id) return id ~= -1 end)
table.insertTable(new_ret, table.random(target:getCardIds(Player.Hand), #ret - #new_ret)) local hand_num = #ret - #new_ret
if hand_num > 0 then
table.insertTable(new_ret, table.random(target:getCardIds(Player.Hand), hand_num))
end
return new_ret return new_ret
end end

View File

@ -510,4 +510,15 @@ function ServerPlayer:setSkillUseHistory(cardName, num, scope)
self:doNotify("SetSkillUseHistory", json.encode{cardName, num, scope}) self:doNotify("SetSkillUseHistory", json.encode{cardName, num, scope})
end end
---@param chained boolean
function ServerPlayer:setChainState(chained)
self.chained = chained
self.room:broadcastProperty(self, "chained")
self.room:sendLog{
type = "#ChainStateChange",
from = self.id,
arg = self.chained and "chained" or "not-chained"
}
end
return ServerPlayer return ServerPlayer

View File

@ -47,6 +47,7 @@ fk.FireDamage = 3
---@field to ServerPlayer ---@field to ServerPlayer
---@field damage integer ---@field damage integer
---@field card Card ---@field card Card
---@field chain boolean
---@field damageType DamageType ---@field damageType DamageType
---@field skillName string ---@field skillName string

2
packages/.gitignore vendored
View File

@ -2,6 +2,6 @@
!standard/ !standard/
!standard_cards/ !standard_cards/
!test/ !test/
!manuvering/ !maneuvering/
!.gitignore !.gitignore
!init.sql !init.sql

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.

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: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Some files were not shown because too many files have changed in this diff Show More