parent
509cf29175
commit
fcb6ce89a4
|
@ -135,7 +135,7 @@ function GameLogic:prepareForStart()
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, p in ipairs(room.alive_players) do
|
for _, p in ipairs(room.alive_players) do
|
||||||
room:handleAddLoseSkills(p, "zhiheng|mashu", nil, false)
|
room:handleAddLoseSkills(p, "zhiheng|mashu|fankui", nil, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
self:addTriggerSkill(GameRule)
|
self:addTriggerSkill(GameRule)
|
||||||
|
|
|
@ -16,9 +16,32 @@ Fk:loadTranslationTable{
|
||||||
["caocao"] = "曹操",
|
["caocao"] = "曹操",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local fankui = fk.CreateTriggerSkill{
|
||||||
|
name = "fankui",
|
||||||
|
events = {fk.Damaged},
|
||||||
|
frequency = Skill.NotFrequent,
|
||||||
|
can_trigger = function(self, event, target, player, data)
|
||||||
|
return target:hasSkill(self.name)
|
||||||
|
end,
|
||||||
|
on_trigger = function(self, event, target, player, data)
|
||||||
|
local damage = data.damage
|
||||||
|
local room = player.room
|
||||||
|
local from = room:getPlayerById(damage.from)
|
||||||
|
if event == fk.Damaged then
|
||||||
|
if from:isNude() then return false end
|
||||||
|
if room:askForSkillInvoke(target, self.name) then
|
||||||
|
local card = room:askForCardChosen(target, from, "he", self.name)
|
||||||
|
room:obtainCard(target.id, card, false, fk.ReasonPrey)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
local simayi = General:new(extension, "simayi", "wei", 3)
|
local simayi = General:new(extension, "simayi", "wei", 3)
|
||||||
|
simayi:addSkill(fankui)
|
||||||
Fk:loadTranslationTable{
|
Fk:loadTranslationTable{
|
||||||
["simayi"] = "司马懿",
|
["simayi"] = "司马懿",
|
||||||
|
["fankui"] = "反馈",
|
||||||
}
|
}
|
||||||
|
|
||||||
local xiahoudun = General:new(extension, "xiahoudun", "wei", 4)
|
local xiahoudun = General:new(extension, "xiahoudun", "wei", 4)
|
||||||
|
|
|
@ -172,8 +172,8 @@ function moveCards(moves) {
|
||||||
function setEmotion(id, emotion) {
|
function setEmotion(id, emotion) {
|
||||||
let path;
|
let path;
|
||||||
if (OS === "Win") {
|
if (OS === "Win") {
|
||||||
// Windows: file:/C:/xxx/xxxx
|
// Windows: file:///C:/xxx/xxxx
|
||||||
path = (SkinBank.PIXANIM_DIR + emotion).replace("file:/", "");
|
path = (SkinBank.PIXANIM_DIR + emotion).replace("file:///", "");
|
||||||
} else {
|
} else {
|
||||||
path = (SkinBank.PIXANIM_DIR + emotion).replace("file://", "");
|
path = (SkinBank.PIXANIM_DIR + emotion).replace("file://", "");
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,12 @@ void QmlBackend::cd(const QString &path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QmlBackend::ls(const QString &dir) {
|
QStringList QmlBackend::ls(const QString &dir) {
|
||||||
return QDir(QUrl(dir).path()).entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
|
QString d = dir;
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
if (d.startsWith("file:///"))
|
||||||
|
d.replace(0, 8, "file://");
|
||||||
|
#endif
|
||||||
|
return QDir(QUrl(d).path()).entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlBackend::pwd() {
|
QString QmlBackend::pwd() {
|
||||||
|
|
Loading…
Reference in New Issue