diff --git a/Fk/ChatAnim/GiantEgg.qml b/Fk/ChatAnim/GiantEgg.qml new file mode 100644 index 00000000..ee784761 --- /dev/null +++ b/Fk/ChatAnim/GiantEgg.qml @@ -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(); + } + } +} diff --git a/Fk/ChatAnim/Shoe.qml b/Fk/ChatAnim/Shoe.qml new file mode 100644 index 00000000..269d4594 --- /dev/null +++ b/Fk/ChatAnim/Shoe.qml @@ -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(); + } + } +} diff --git a/Fk/Cheat/PlayerDetail.qml b/Fk/Cheat/PlayerDetail.qml index 75cbc3e4..55681380 100644 --- a/Fk/Cheat/PlayerDetail.qml +++ b/Fk/Cheat/PlayerDetail.qml @@ -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(); } } diff --git a/Fk/Pages/Room.qml b/Fk/Pages/Room.qml index 5bf7ae0a..63c7e3db 100644 --- a/Fk/Pages/Room.qml +++ b/Fk/Pages/Room.qml @@ -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); diff --git a/audio/system/shoe1.mp3 b/audio/system/shoe1.mp3 new file mode 100644 index 00000000..66b78070 Binary files /dev/null and b/audio/system/shoe1.mp3 differ diff --git a/audio/system/shoe2.mp3 b/audio/system/shoe2.mp3 new file mode 100644 index 00000000..a25b14b7 Binary files /dev/null and b/audio/system/shoe2.mp3 differ diff --git a/image/anim/shoe/egg.png b/image/anim/shoe/egg.png new file mode 100644 index 00000000..8b446367 Binary files /dev/null and b/image/anim/shoe/egg.png differ diff --git a/image/anim/shoe/egg1.png b/image/anim/shoe/egg1.png new file mode 100644 index 00000000..65df52bc Binary files /dev/null and b/image/anim/shoe/egg1.png differ diff --git a/image/anim/shoe/egg2.png b/image/anim/shoe/egg2.png new file mode 100644 index 00000000..809b16b1 Binary files /dev/null and b/image/anim/shoe/egg2.png differ diff --git a/image/anim/shoe/egg3.png b/image/anim/shoe/egg3.png new file mode 100644 index 00000000..a9f08260 Binary files /dev/null and b/image/anim/shoe/egg3.png differ diff --git a/image/anim/shoe/egg4.png b/image/anim/shoe/egg4.png new file mode 100644 index 00000000..ee888cd0 Binary files /dev/null and b/image/anim/shoe/egg4.png differ diff --git a/image/anim/shoe/egg5.png b/image/anim/shoe/egg5.png new file mode 100644 index 00000000..d459aba9 Binary files /dev/null and b/image/anim/shoe/egg5.png differ diff --git a/image/anim/shoe/egg6.png b/image/anim/shoe/egg6.png new file mode 100644 index 00000000..ea5e245d Binary files /dev/null and b/image/anim/shoe/egg6.png differ diff --git a/image/anim/shoe/egg7.png b/image/anim/shoe/egg7.png new file mode 100644 index 00000000..16befb95 Binary files /dev/null and b/image/anim/shoe/egg7.png differ diff --git a/image/anim/shoe/egg8.png b/image/anim/shoe/egg8.png new file mode 100644 index 00000000..f00e8735 Binary files /dev/null and b/image/anim/shoe/egg8.png differ diff --git a/image/anim/shoe/hit1.png b/image/anim/shoe/hit1.png new file mode 100644 index 00000000..36ffb06e Binary files /dev/null and b/image/anim/shoe/hit1.png differ diff --git a/image/anim/shoe/hit10.png b/image/anim/shoe/hit10.png new file mode 100644 index 00000000..4c7494ab Binary files /dev/null and b/image/anim/shoe/hit10.png differ diff --git a/image/anim/shoe/hit2.png b/image/anim/shoe/hit2.png new file mode 100644 index 00000000..376c7955 Binary files /dev/null and b/image/anim/shoe/hit2.png differ diff --git a/image/anim/shoe/hit3.png b/image/anim/shoe/hit3.png new file mode 100644 index 00000000..4f1e41bf Binary files /dev/null and b/image/anim/shoe/hit3.png differ diff --git a/image/anim/shoe/hit4.png b/image/anim/shoe/hit4.png new file mode 100644 index 00000000..f097ad4b Binary files /dev/null and b/image/anim/shoe/hit4.png differ diff --git a/image/anim/shoe/hit5.png b/image/anim/shoe/hit5.png new file mode 100644 index 00000000..fdadafec Binary files /dev/null and b/image/anim/shoe/hit5.png differ diff --git a/image/anim/shoe/hit6.png b/image/anim/shoe/hit6.png new file mode 100644 index 00000000..4c3c4d3b Binary files /dev/null and b/image/anim/shoe/hit6.png differ diff --git a/image/anim/shoe/hit7.png b/image/anim/shoe/hit7.png new file mode 100644 index 00000000..75c068af Binary files /dev/null and b/image/anim/shoe/hit7.png differ diff --git a/image/anim/shoe/hit8.png b/image/anim/shoe/hit8.png new file mode 100644 index 00000000..7c03f530 Binary files /dev/null and b/image/anim/shoe/hit8.png differ diff --git a/image/anim/shoe/hit9.png b/image/anim/shoe/hit9.png new file mode 100644 index 00000000..9298136a Binary files /dev/null and b/image/anim/shoe/hit9.png differ diff --git a/image/anim/shoe/shoe.png b/image/anim/shoe/shoe.png new file mode 100644 index 00000000..c9b9e3b5 Binary files /dev/null and b/image/anim/shoe/shoe.png differ diff --git a/image/anim/shoe/shoe_s.png b/image/anim/shoe/shoe_s.png new file mode 100644 index 00000000..6c8780d1 Binary files /dev/null and b/image/anim/shoe/shoe_s.png differ diff --git a/lua/client/i18n/zh_CN.lua b/lua/client/i18n/zh_CN.lua index 4c8fae81..36148c1f 100644 --- a/lua/client/i18n/zh_CN.lua +++ b/lua/client/i18n/zh_CN.lua @@ -42,6 +42,7 @@ Fk:loadTranslationTable{ ["Give Flower"] = "送花", ["Give Egg"] = "砸蛋", + ["Give Shoe"] = "拖鞋", ["$OnlineInfo"] = "大厅人数:%1,总在线人数:%2",