diff --git a/Fk/ChatAnim/Wine.qml b/Fk/ChatAnim/Wine.qml new file mode 100644 index 00000000..e5ebde6e --- /dev/null +++ b/Fk/ChatAnim/Wine.qml @@ -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(); + } + } +} diff --git a/Fk/Cheat/PlayerDetail.qml b/Fk/Cheat/PlayerDetail.qml index 7bc104c3..ad58f220 100644 --- a/Fk/Cheat/PlayerDetail.qml +++ b/Fk/Cheat/PlayerDetail.qml @@ -24,6 +24,7 @@ Flickable { Button { text: Backend.translate("Give Flower") onClicked: { + enabled = false; root.givePresent("Flower"); root.finish(); } @@ -32,6 +33,7 @@ Flickable { Button { text: Backend.translate("Give Egg") onClicked: { + enabled = false; if (Math.random() < 0.03) { root.givePresent("GiantEgg"); } 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 { text: Backend.translate("Give Shoe") enabled: Math.random() < 0.3 onClicked: { + enabled = false; root.givePresent("Shoe"); root.finish(); } diff --git a/Fk/Pages/Room.qml b/Fk/Pages/Room.qml index bdc0fbbe..cd268865 100644 --- a/Fk/Pages/Room.qml +++ b/Fk/Pages/Room.qml @@ -797,6 +797,7 @@ Item { case "Egg": case "GiantEgg": case "Shoe": + case "Wine": case "Flower": { const fromId = pid; const toId = parseInt(splited[1]); diff --git a/audio/system/wine1.mp3 b/audio/system/wine1.mp3 new file mode 100644 index 00000000..5e30357f Binary files /dev/null and b/audio/system/wine1.mp3 differ diff --git a/audio/system/wine2.mp3 b/audio/system/wine2.mp3 new file mode 100644 index 00000000..dd4db524 Binary files /dev/null and b/audio/system/wine2.mp3 differ diff --git a/image/anim/wine/egg.png b/image/anim/wine/egg.png new file mode 100644 index 00000000..58423318 Binary files /dev/null and b/image/anim/wine/egg.png differ diff --git a/image/anim/wine/egg0.png b/image/anim/wine/egg0.png new file mode 100644 index 00000000..d4156d8b Binary files /dev/null and b/image/anim/wine/egg0.png differ diff --git a/image/anim/wine/egg1.png b/image/anim/wine/egg1.png new file mode 100644 index 00000000..00d9f6a5 Binary files /dev/null and b/image/anim/wine/egg1.png differ diff --git a/image/anim/wine/egg10.png b/image/anim/wine/egg10.png new file mode 100644 index 00000000..bf51b461 Binary files /dev/null and b/image/anim/wine/egg10.png differ diff --git a/image/anim/wine/egg11.png b/image/anim/wine/egg11.png new file mode 100644 index 00000000..b416c748 Binary files /dev/null and b/image/anim/wine/egg11.png differ diff --git a/image/anim/wine/egg12.png b/image/anim/wine/egg12.png new file mode 100644 index 00000000..b718a94b Binary files /dev/null and b/image/anim/wine/egg12.png differ diff --git a/image/anim/wine/egg13.png b/image/anim/wine/egg13.png new file mode 100644 index 00000000..001e13b2 Binary files /dev/null and b/image/anim/wine/egg13.png differ diff --git a/image/anim/wine/egg14.png b/image/anim/wine/egg14.png new file mode 100644 index 00000000..81d58b4e Binary files /dev/null and b/image/anim/wine/egg14.png differ diff --git a/image/anim/wine/egg15.png b/image/anim/wine/egg15.png new file mode 100644 index 00000000..89265eaa Binary files /dev/null and b/image/anim/wine/egg15.png differ diff --git a/image/anim/wine/egg16.png b/image/anim/wine/egg16.png new file mode 100644 index 00000000..f3ea2b0c Binary files /dev/null and b/image/anim/wine/egg16.png differ diff --git a/image/anim/wine/egg17.png b/image/anim/wine/egg17.png new file mode 100644 index 00000000..0674338b Binary files /dev/null and b/image/anim/wine/egg17.png differ diff --git a/image/anim/wine/egg18.png b/image/anim/wine/egg18.png new file mode 100644 index 00000000..bb9be2fd Binary files /dev/null and b/image/anim/wine/egg18.png differ diff --git a/image/anim/wine/egg2.png b/image/anim/wine/egg2.png new file mode 100644 index 00000000..e74a63c8 Binary files /dev/null and b/image/anim/wine/egg2.png differ diff --git a/image/anim/wine/egg3.png b/image/anim/wine/egg3.png new file mode 100644 index 00000000..3ede16e6 Binary files /dev/null and b/image/anim/wine/egg3.png differ diff --git a/image/anim/wine/egg4.png b/image/anim/wine/egg4.png new file mode 100644 index 00000000..24ad139c Binary files /dev/null and b/image/anim/wine/egg4.png differ diff --git a/image/anim/wine/egg5.png b/image/anim/wine/egg5.png new file mode 100644 index 00000000..b7593177 Binary files /dev/null and b/image/anim/wine/egg5.png differ diff --git a/image/anim/wine/egg6.png b/image/anim/wine/egg6.png new file mode 100644 index 00000000..2afa30b6 Binary files /dev/null and b/image/anim/wine/egg6.png differ diff --git a/image/anim/wine/egg7.png b/image/anim/wine/egg7.png new file mode 100644 index 00000000..c4349381 Binary files /dev/null and b/image/anim/wine/egg7.png differ diff --git a/image/anim/wine/egg8.png b/image/anim/wine/egg8.png new file mode 100644 index 00000000..5753c4b1 Binary files /dev/null and b/image/anim/wine/egg8.png differ diff --git a/image/anim/wine/egg9.png b/image/anim/wine/egg9.png new file mode 100644 index 00000000..c3b83601 Binary files /dev/null and b/image/anim/wine/egg9.png differ diff --git a/image/anim/wine/shoe.png b/image/anim/wine/shoe.png new file mode 100644 index 00000000..c9082043 Binary files /dev/null and b/image/anim/wine/shoe.png differ diff --git a/image/anim/wine/shoe_s.png b/image/anim/wine/shoe_s.png new file mode 100644 index 00000000..c9082043 Binary files /dev/null and b/image/anim/wine/shoe_s.png differ diff --git a/lua/client/i18n/zh_CN.lua b/lua/client/i18n/zh_CN.lua index 7e150a2f..bd58b8f9 100644 --- a/lua/client/i18n/zh_CN.lua +++ b/lua/client/i18n/zh_CN.lua @@ -51,6 +51,7 @@ Fk:loadTranslationTable{ ["Give Flower"] = "送花", ["Give Egg"] = "砸蛋", + ["Give Wine"] = "酒杯", ["Give Shoe"] = "拖鞋", ["Kick From Room"] = "踢出房间", ["Newbie"] = "新手保护ing",