heg general maxHp enhance

This commit is contained in:
Mechanel 2024-05-26 02:01:56 +08:00
parent 4e87ad3d11
commit 1df0f762e9
3 changed files with 31 additions and 1 deletions

View File

@ -263,6 +263,7 @@ GraphicsBox {
item.selectable = hegemony ? isHegPair(selectedItem[0], item)
: true;
if (hegemony) {
item.inPosition = 0;
if (selectedItem[0]) {
if (selectedItem[1]) {
if (selectedItem[0] === item) {
@ -299,6 +300,23 @@ GraphicsBox {
}
}
if (hegemony) {
if (selectedItem[0]) {
if (selectedItem[0].mainMaxHp < 0) {
selectedItem[0].inPosition = 1;
} else if (selectedItem[0].deputyMaxHp < 0) {
selectedItem[0].inPosition = -1;
}
if (selectedItem[1]) {
if (selectedItem[1].mainMaxHp < 0) {
selectedItem[1].inPosition = -1;
} else if (selectedItem[1].deputyMaxHp < 0) {
selectedItem[1].inPosition = 1;
}
}
}
}
for (let i = 0; i < generalList.count; i++) {
if (lcall("GetSameGenerals", generalList.get(i).name).length > 0) {
convertBtn.enabled = true;

View File

@ -22,6 +22,9 @@ CardItem {
property int hp
property int maxHp
property int shieldNum
property int mainMaxHp
property int deputyMaxHp
property int inPosition: 0
property string pkgName: ""
property bool detailed: true
property alias hasCompanions: companions.visible
@ -119,12 +122,15 @@ CardItem {
width: childrenRect.width
height: childrenRect.height
Image {
opacity: ((mainMaxHp < 0 || deputyMaxHp < 0) && (index * 2 + 1 === hp) && inPosition !== -1)
? (inPosition === 0 ? 0.5 : 0) :1
height: 12; fillMode: Image.PreserveAspectFit
source: SkinBank.getGeneralCardDir(kingdom) + kingdom + "-magatama-l"
}
Image {
x: 4.4
opacity: (index + 1) * 2 <= hp ? 1 : 0
opacity: (index + 1) * 2 <= hp ? (((mainMaxHp < 0 || deputyMaxHp < 0) && inPosition !== -1 && ((index + 1) * 2 === hp))
? (inPosition === 0 ? 0.5 : 0) : 1) : 0
height: 12; fillMode: Image.PreserveAspectFit
source: {
const k = subkingdom ? subkingdom : kingdom;
@ -227,6 +233,8 @@ CardItem {
hp = data.hp;
maxHp = data.maxHp;
shieldNum = data.shield;
mainMaxHp = data.mainMaxHpAdjustedValue;
deputyMaxHp = data.deputyMaxHpAdjustedValue;
const splited = name.split("__");
if (splited.length > 1) {

View File

@ -19,6 +19,8 @@ function GetGeneralData(name)
shield = general.shield,
hidden = general.hidden,
total_hidden = general.total_hidden,
mainMaxHpAdjustedValue = general.mainMaxHpAdjustedValue,
deputyMaxHpAdjustedValue = general.deputyMaxHpAdjustedValue,
}
end
@ -31,6 +33,8 @@ function GetGeneralDetail(name)
kingdom = general.kingdom,
hp = general.hp,
maxHp = general.maxHp,
mainMaxHp = general.mainMaxHpAdjustedValue,
deputyMaxHp = general.deputyMaxHpAdjustedValue,
gender = general.gender,
skill = {},
related_skill = {},