砸拖鞋 (#162)
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -32,7 +32,20 @@ Flickable {
|
|||
Button {
|
||||
text: Backend.translate("Give Egg")
|
||||
onClicked: {
|
||||
root.givePresent("Egg");
|
||||
if (Math.random() < 0.03) {
|
||||
root.givePresent("GiantEgg");
|
||||
} else {
|
||||
root.givePresent("Egg");
|
||||
}
|
||||
root.finish();
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: Backend.translate("Give Shoe")
|
||||
enabled: Math.random() < 0.5
|
||||
onClicked: {
|
||||
root.givePresent("Shoe");
|
||||
root.finish();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -723,6 +723,8 @@ Item {
|
|||
let type = splited[0].slice(1);
|
||||
switch (type) {
|
||||
case "Egg":
|
||||
case "GiantEgg":
|
||||
case "Shoe":
|
||||
case "Flower": {
|
||||
const fromId = pid;
|
||||
const toId = parseInt(splited[1]);
|
||||
|
@ -730,7 +732,7 @@ Item {
|
|||
//if (component.status !== Component.Ready)
|
||||
// return false;
|
||||
|
||||
const fromItem = Logic.getPhoto(fromId);
|
||||
const fromItem = Logic.getPhotoOrDashboard(fromId);
|
||||
const fromPos = mapFromItem(fromItem, fromItem.width / 2, fromItem.height / 2);
|
||||
const toItem = Logic.getPhoto(toId);
|
||||
const toPos = mapFromItem(toItem, toItem.width / 2, toItem.height / 2);
|
||||
|
|
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 8.8 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 1.7 KiB |
|
@ -42,6 +42,7 @@ Fk:loadTranslationTable{
|
|||
|
||||
["Give Flower"] = "送花",
|
||||
["Give Egg"] = "砸蛋",
|
||||
["Give Shoe"] = "拖鞋",
|
||||
|
||||
["$OnlineInfo"] = "大厅人数:%1,总在线人数:%2",
|
||||
|
||||
|
|