砸拖鞋 (#162)

This commit is contained in:
notify 2023-05-26 20:53:45 +08:00 committed by GitHub
parent 48f3ae3ecd
commit 74a3540ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 399 additions and 2 deletions

132
Fk/ChatAnim/GiantEgg.qml Normal file
View File

@ -0,0 +1,132 @@
// 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()
Image {
id: egg
source: SkinBank.PIXANIM_DIR + "/egg/egg"
x: start.x - width / 2
y: start.y - height / 2
scale: 2.1
opacity: 0
}
Image {
id: whip
x: end.x - width / 2
y: end.y - height / 2
property int idx: 1
opacity: 0
scale: 2.1
source: SkinBank.PIXANIM_DIR + "/egg/egg" + idx
}
SequentialAnimation {
id: pointToAnimation
running: false
PropertyAnimation {
target: egg
property: "opacity"
to: 1
duration: 400
}
PauseAnimation {
duration: 350
}
ScriptAction {
script: Backend.playSound("./audio/system/fly" + (Math.floor(Math.random() * 2) + 1));
}
ParallelAnimation {
PropertyAnimation {
target: egg
property: "scale"
to: 1.2
duration: 500
}
PropertyAnimation {
target: egg
property: "x"
to: end.x - egg.width / 2
duration: 500
}
PropertyAnimation {
target: egg
property: "y"
to: end.y - egg.height / 2
duration: 500
}
PropertyAnimation {
target: egg
property: "rotation"
to: 360
duration: 250
loops: 2
}
SequentialAnimation {
PauseAnimation { duration: 400 }
PropertyAnimation {
target: egg
property: "opacity"
to: 0
duration: 100
}
}
}
ScriptAction {
script: Backend.playSound("./audio/system/egg" + (Math.floor(Math.random() * 2) + 1));
}
ParallelAnimation {
SequentialAnimation {
SequentialAnimation {
PauseAnimation { duration: 160 }
ScriptAction { script: whip.idx++; }
loops: 2
}
PauseAnimation { duration: 160 }
}
SequentialAnimation {
PropertyAnimation {
target: whip
property: "opacity"
to: 1
duration: 100
}
PauseAnimation { duration: 300 }
PropertyAnimation {
target: whip
property: "opacity"
to: 0
duration: 100
}
}
}
onStopped: {
root.visible = false;
root.finished();
}
}
}

249
Fk/ChatAnim/Shoe.qml Normal file
View File

@ -0,0 +1,249 @@
// 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 + "/shoe/egg"
x: start.x - width / 2 + xOffset
y: start.y - height / 2 + yOffset
scale: 0.7
opacity: 0
}
Image {
id: whip
x: end.x - width / 2 + xOffset
y: end.y - height / 2 + yOffset
property int idx: 1
opacity: 0
scale: 0.7
source: SkinBank.PIXANIM_DIR + "/shoe/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;
Backend.playSound("./audio/system/egg" + (Math.floor(Math.random() * 2) + 1));
}
}
PropertyAnimation {
target: whip
property: "idx"
to: 8
duration: 270
}
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 + "/shoe/shoe_s"
x: start.x - width / 2
y: start.y - height / 2
scale: 0
}
Image {
id: shoe
source: SkinBank.PIXANIM_DIR + "/shoe/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
SequentialAnimation {
loops: 7
PauseAnimation { duration: 120 }
ScriptAction {
script: {
const e = eggs.itemAt(seqIdx);
e.startAnim();
seqIdx++;
}
}
}
PauseAnimation { duration: 200 }
ScriptAction {
script: Backend.playSound("./audio/system/shoe1");
}
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: {
Backend.playSound("./audio/system/shoe2");
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

@ -32,7 +32,20 @@ Flickable {
Button { Button {
text: Backend.translate("Give Egg") text: Backend.translate("Give Egg")
onClicked: { onClicked: {
if (Math.random() < 0.03) {
root.givePresent("GiantEgg");
} else {
root.givePresent("Egg"); root.givePresent("Egg");
}
root.finish();
}
}
Button {
text: Backend.translate("Give Shoe")
enabled: Math.random() < 0.5
onClicked: {
root.givePresent("Shoe");
root.finish(); root.finish();
} }
} }

View File

@ -723,6 +723,8 @@ Item {
let type = splited[0].slice(1); let type = splited[0].slice(1);
switch (type) { switch (type) {
case "Egg": case "Egg":
case "GiantEgg":
case "Shoe":
case "Flower": { case "Flower": {
const fromId = pid; const fromId = pid;
const toId = parseInt(splited[1]); const toId = parseInt(splited[1]);
@ -730,7 +732,7 @@ Item {
//if (component.status !== Component.Ready) //if (component.status !== Component.Ready)
// return false; // return false;
const fromItem = Logic.getPhoto(fromId); const fromItem = Logic.getPhotoOrDashboard(fromId);
const fromPos = mapFromItem(fromItem, fromItem.width / 2, fromItem.height / 2); const fromPos = mapFromItem(fromItem, fromItem.width / 2, fromItem.height / 2);
const toItem = Logic.getPhoto(toId); const toItem = Logic.getPhoto(toId);
const toPos = mapFromItem(toItem, toItem.width / 2, toItem.height / 2); const toPos = mapFromItem(toItem, toItem.width / 2, toItem.height / 2);

BIN
audio/system/shoe1.mp3 Normal file

Binary file not shown.

BIN
audio/system/shoe2.mp3 Normal file

Binary file not shown.

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -42,6 +42,7 @@ Fk:loadTranslationTable{
["Give Flower"] = "送花", ["Give Flower"] = "送花",
["Give Egg"] = "砸蛋", ["Give Egg"] = "砸蛋",
["Give Shoe"] = "拖鞋",
["$OnlineInfo"] = "大厅人数:%1总在线人数%2", ["$OnlineInfo"] = "大厅人数:%1总在线人数%2",