LogEdit, Card.Void, aux_skills (#147)

Card.Void, aux_skills, move card reason, clone card attackrange
This commit is contained in:
RalphRad 2023-05-13 14:16:09 +08:00 committed by GitHub
parent 8d87fbbf09
commit 5e9505d18e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 49 additions and 15 deletions

View File

@ -137,6 +137,7 @@ function Card:clone(suit, number)
newCard.skill = self.skill
newCard.special_skills = self.special_skills
newCard.equip_skill = self.equip_skill
newCard.attack_range = self.attack_range
newCard.is_damage_card = self.is_damage_card
return newCard
end

View File

@ -210,7 +210,7 @@ GameEvent.cleaners[GameEvent.UseCard] = function(self)
self:moveCards({
ids = leftRealCardIds,
toArea = Card.DiscardPile,
moveReason = fk.ReasonPutIntoDiscardPile,
moveReason = fk.ReasonUse,
})
end
end
@ -271,7 +271,7 @@ GameEvent.cleaners[GameEvent.RespondCard] = function(self)
self:moveCards({
ids = realCardIds,
toArea = Card.DiscardPile,
moveReason = fk.ReasonPutIntoDiscardPile,
moveReason = fk.ReasonResonpse,
})
end
end

View File

@ -249,7 +249,7 @@ local fireAttackSkill = fk.CreateActiveSkill{
from = from,
to = to,
card = cardEffectEvent.card,
damage = 1,
damage = 1 + (cardEffectEvent.additionalDamage or 0),
damageType = fk.FireDamage,
skillName = self.name
})

View File

@ -70,8 +70,39 @@ local choosePlayersSkill = fk.CreateActiveSkill{
max_target_num = function(self) return self.num end,
}
local maxCardsSkill = fk.CreateMaxCardsSkill{
name = "max_cards_skill",
global = true,
correct_func = function(self, player)
return player:getMark("AddMaxCards") + player:getMark("AddMaxCards-turn") - player:getMark("MinusMaxCards") - player:getMark("MinusMaxCards-turn")
end,
}
local moveTokenSkill = fk.CreateTriggerSkill{
name = "move_token_skill",
global = true,
refresh_events = {fk.GameStart}, --refresh优先于on_use不要在正常的游戏开始发牌技能refresh中拿牌
can_refresh = function(self, event, target, player, data)
return player.seat == 1
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
for i = #room.draw_pile, 1, -1 do
if Fk:getCardById(room.draw_pile[i]).name[1] == "&" then
local id = room.draw_pile[i]
table.removeOne(room.draw_pile, id)
table.insert(room.void, id)
room:setCardArea(id, Card.Void, nil)
end
end
end,
}
AuxSkills = {
discardSkill,
chooseCardsSkill,
choosePlayersSkill,
maxCardsSkill,
moveTokenSkill,
}

View File

@ -22,7 +22,7 @@ Rectangle {
id: chatLogBox
anchors.fill: parent
anchors.margins: 10
font.pixelSize: 14
//font.pixelSize: 14
}
}

View File

@ -3,16 +3,16 @@
import QtQuick
import QtQuick.Controls
Flickable {
ListView {
id: root
property alias font: textEdit.font
property alias text: textEdit.text
property alias color: textEdit.color
property alias textFormat: textEdit.textFormat
//property alias font: textEdit.font
//property alias text: textEdit.text
//property alias color: textEdit.color
//property alias textFormat: textEdit.textFormat
flickableDirection: Flickable.VerticalFlick
contentWidth: textEdit.width
contentHeight: textEdit.height
//flickableDirection: Flickable.VerticalFlick
//contentWidth: textEdit.width
//contentHeight: textEdit.height
clip: true
ScrollBar.vertical: ScrollBar {
parent: root.parent
@ -21,9 +21,11 @@ Flickable {
anchors.bottom: root.bottom
}
TextEdit {
model: ListModel { id: logModel }
delegate: TextEdit {
id: textEdit
text: logText
width: root.width
clip: true
readOnly: true
@ -36,7 +38,7 @@ Flickable {
function append(text) {
let autoScroll = atYEnd;
textEdit.append(text);
logModel.append({ logText: text });
if (autoScroll && contentHeight > contentY + height) {
contentY = contentHeight - height;
}

View File

@ -146,7 +146,7 @@ function getPhotoOrDashboard(id) {
function getAreaItem(area, id) {
if (area === Card.DrawPile) {
return drawPile;
} else if (area === Card.DiscardPile || area === Card.Processing) {
} else if (area === Card.DiscardPile || area === Card.Processing || area === Card.Void) {
return tablePile;
} else if (area === Card.AG) {
return popupBox.item;