* 修复连点器砸蛋
* 砸酒杯
This commit is contained in:
notify 2023-06-24 12:29:08 +08:00 committed by GitHub
parent c3fd8fc9a5
commit ecf8ff447a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 268 additions and 0 deletions

253
Fk/ChatAnim/Wine.qml Normal file
View File

@ -0,0 +1,253 @@
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import Fk
Item {
id: root
anchors.fill: parent
property point start: Qt.point(0, 0)
property point end: Qt.point(0, 0)
property alias running: pointToAnimation.running
signal finished()
Repeater {
id: eggs
model: 7
Item {
property real xOffset
property real yOffset
Image {
id: egg
source: SkinBank.PIXANIM_DIR + "/wine/egg"
x: start.x - width / 2 + xOffset
y: start.y - height / 2 + yOffset
scale: 0.7
opacity: 0
rotation: (Math.atan(Math.abs(end.y - start.y) / Math.abs(end.x - start.x))
/ Math.PI * 180 - 90) * (end.x > start.x ? -1 : 1)
}
Image {
id: whip
x: end.x - width / 2 + xOffset
y: end.y - height / 2 + yOffset
property int idx: 0
opacity: 0
scale: 1.7
source: SkinBank.PIXANIM_DIR + "/wine/egg" + idx
}
SequentialAnimation {
id: flyAnim
ScriptAction {
script: {
egg.opacity = 1;
}
}
ParallelAnimation {
PropertyAnimation {
target: egg
property: "x"
to: end.x - egg.width / 2 + xOffset
duration: 250
}
PropertyAnimation {
target: egg
property: "y"
to: end.y - egg.height / 2 + yOffset
duration: 250
}
}
ScriptAction {
script: {
egg.opacity = 0;
whip.opacity = 1;
}
}
PropertyAnimation {
target: whip
property: "idx"
to: 18
duration: 370
}
ScriptAction {
script: {
whip.opacity = 0;
}
}
}
function startAnim() { flyAnim.start(); }
Component.onCompleted: {
xOffset = Math.random() * 70 - 35;
yOffset = Math.random() * 70 - 30;
}
}
}
Image {
id: shoeS
source: SkinBank.PIXANIM_DIR + "/wine/shoe_s"
x: start.x - width / 2
y: start.y - height / 2
scale: 0
}
Image {
id: shoe
source: SkinBank.PIXANIM_DIR + "/wine/shoe"
x: start.x - width / 2
y: start.y - height / 2
scale: 0
}
Image {
id: hit
x: end.x - width / 2
y: end.y - height / 2
property int idx: 1
opacity: 0
scale: 1.2
source: SkinBank.PIXANIM_DIR + "/shoe/hit" + idx
}
property int seqIdx: 0
SequentialAnimation {
id: pointToAnimation
running: false
ScriptAction {
script: Backend.playSound("./audio/system/wine1");
}
SequentialAnimation {
loops: 7
ScriptAction {
script: {
const e = eggs.itemAt(seqIdx);
e.startAnim();
seqIdx++;
}
}
PauseAnimation { duration: 320 }
}
PauseAnimation { duration: 200 }
ScriptAction {
script: Backend.playSound("./audio/system/wine2");
}
ParallelAnimation {
PropertyAnimation {
target: shoe
property: "scale"
to: 1
duration: 660
}
PropertyAnimation {
target: shoe
property: "x"
to: end.x - shoe.width / 2
duration: 660
}
PropertyAnimation {
target: shoe
property: "y"
to: end.y - shoe.height / 2
duration: 660
}
PropertyAnimation {
target: shoe
property: "rotation"
to: 360
duration: 330
loops: 2
}
SequentialAnimation {
PauseAnimation { duration: 80 }
ParallelAnimation {
PropertyAnimation {
target: shoeS
property: "scale"
to: 1
duration: 660
}
PropertyAnimation {
target: shoeS
property: "x"
to: end.x - shoeS.width / 2
duration: 660
}
PropertyAnimation {
target: shoeS
property: "y"
to: end.y - shoeS.height / 2
duration: 660
}
PropertyAnimation {
target: shoeS
property: "rotation"
to: 360
duration: 330
loops: 2
}
}
}
SequentialAnimation {
PauseAnimation { duration: 660 }
ScriptAction {
script: {
hit.opacity = 1;
}
}
PropertyAnimation {
target: hit
property: "idx"
to: 10
duration: 300
}
}
}
ParallelAnimation {
PropertyAnimation {
target: shoe
property: "opacity"
to: 0
duration: 100
}
PropertyAnimation {
target: shoe
property: "y"
to: end.y - shoe.height / 2 + 20
duration: 100
}
PropertyAnimation {
target: shoeS
property: "opacity"
to: 0
duration: 100
}
}
onStopped: {
root.visible = false;
root.finished();
}
}
}

View File

@ -24,6 +24,7 @@ Flickable {
Button { Button {
text: Backend.translate("Give Flower") text: Backend.translate("Give Flower")
onClicked: { onClicked: {
enabled = false;
root.givePresent("Flower"); root.givePresent("Flower");
root.finish(); root.finish();
} }
@ -32,6 +33,7 @@ Flickable {
Button { Button {
text: Backend.translate("Give Egg") text: Backend.translate("Give Egg")
onClicked: { onClicked: {
enabled = false;
if (Math.random() < 0.03) { if (Math.random() < 0.03) {
root.givePresent("GiantEgg"); root.givePresent("GiantEgg");
} else { } else {
@ -41,10 +43,21 @@ Flickable {
} }
} }
Button {
text: Backend.translate("Give Wine")
enabled: Math.random() < 0.3
onClicked: {
enabled = false;
root.givePresent("Wine");
root.finish();
}
}
Button { Button {
text: Backend.translate("Give Shoe") text: Backend.translate("Give Shoe")
enabled: Math.random() < 0.3 enabled: Math.random() < 0.3
onClicked: { onClicked: {
enabled = false;
root.givePresent("Shoe"); root.givePresent("Shoe");
root.finish(); root.finish();
} }

View File

@ -797,6 +797,7 @@ Item {
case "Egg": case "Egg":
case "GiantEgg": case "GiantEgg":
case "Shoe": case "Shoe":
case "Wine":
case "Flower": { case "Flower": {
const fromId = pid; const fromId = pid;
const toId = parseInt(splited[1]); const toId = parseInt(splited[1]);

BIN
audio/system/wine1.mp3 Normal file

Binary file not shown.

BIN
audio/system/wine2.mp3 Normal file

Binary file not shown.

BIN
image/anim/wine/egg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
image/anim/wine/egg0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
image/anim/wine/egg1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
image/anim/wine/egg10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
image/anim/wine/egg11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
image/anim/wine/egg12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
image/anim/wine/egg13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
image/anim/wine/egg14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
image/anim/wine/egg15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
image/anim/wine/egg16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
image/anim/wine/egg17.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
image/anim/wine/egg18.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
image/anim/wine/egg2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
image/anim/wine/egg3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
image/anim/wine/egg4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
image/anim/wine/egg5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
image/anim/wine/egg6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
image/anim/wine/egg7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
image/anim/wine/egg8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
image/anim/wine/egg9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
image/anim/wine/shoe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
image/anim/wine/shoe_s.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -51,6 +51,7 @@ Fk:loadTranslationTable{
["Give Flower"] = "送花", ["Give Flower"] = "送花",
["Give Egg"] = "砸蛋", ["Give Egg"] = "砸蛋",
["Give Wine"] = "酒杯",
["Give Shoe"] = "拖鞋", ["Give Shoe"] = "拖鞋",
["Kick From Room"] = "踢出房间", ["Kick From Room"] = "踢出房间",
["Newbie"] = "新手保护ing", ["Newbie"] = "新手保护ing",