娃娃机改为掉落组
This commit is contained in:
parent
d4bd776b48
commit
0df09e0f9e
@ -3,17 +3,13 @@ import {ReqDMRec, ResDMRec} from "../../../shared/protocols/event/yuandan/PtlDMR
|
|||||||
import {HuoDongFun} from "../../../public/huodongfun";
|
import {HuoDongFun} from "../../../public/huodongfun";
|
||||||
import {PlayerFun} from "../../../public/player";
|
import {PlayerFun} from "../../../public/player";
|
||||||
import {HongDianChange} from "../../hongdian/fun";
|
import {HongDianChange} from "../../hongdian/fun";
|
||||||
|
import {PublicShared} from "../../../shared/public/public";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqDMRec, ResDMRec>) {
|
export default async function (call: ApiCall<ReqDMRec, ResDMRec>) {
|
||||||
// 查询活动是否存在
|
// 查询活动是否存在
|
||||||
let _hd = (await HuoDongFun.gethdList(call, 14))[0]
|
let _hd = (await HuoDongFun.gethdList(call, 14))[0]
|
||||||
if (!_hd) return call.errorCode(-1)
|
if (!_hd) return call.errorCode(-1)
|
||||||
|
|
||||||
// 奖励不符合
|
|
||||||
let toPrize = call.req.prize
|
|
||||||
let prize = _hd.data.game.find(i => i.a == toPrize?.a && i.t == toPrize?.t && i.n == toPrize?.n)
|
|
||||||
if (toPrize && !prize) return call.errorCode(-4)
|
|
||||||
|
|
||||||
// 扣除免费次数或相应货币
|
// 扣除免费次数或相应货币
|
||||||
let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`})
|
let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`})
|
||||||
let rec = data?.gameNum
|
let rec = data?.gameNum
|
||||||
@ -23,8 +19,9 @@ export default async function (call: ApiCall<ReqDMRec, ResDMRec>) {
|
|||||||
await PlayerFun.cutNeed(call, _hd.data.gameneed);
|
await PlayerFun.cutNeed(call, _hd.data.gameneed);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prize) {
|
if (call.req.id) {
|
||||||
await PlayerFun.sendPrize(call, [prize]);
|
let prize = PublicShared.randomDropGroup(call.req.id, 1, _hd.data.game);
|
||||||
|
await PlayerFun.sendPrize(call, prize);
|
||||||
}
|
}
|
||||||
|
|
||||||
await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, {
|
await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* 元旦达摩领奖
|
* 元旦达摩领奖
|
||||||
*/
|
*/
|
||||||
export type ReqDMRec = {
|
export type ReqDMRec = {
|
||||||
prize: { a: string, t: string, n: number } | null
|
id: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ResDMRec = {}
|
export type ResDMRec = {}
|
||||||
|
@ -11403,39 +11403,16 @@ export const serviceProto: ServiceProto<ServiceType> = {
|
|||||||
"properties": [
|
"properties": [
|
||||||
{
|
{
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"name": "prize",
|
"name": "id",
|
||||||
"type": {
|
"type": {
|
||||||
"type": "Union",
|
"type": "Union",
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"type": {
|
|
||||||
"type": "Interface",
|
|
||||||
"properties": [
|
|
||||||
{
|
|
||||||
"id": 0,
|
|
||||||
"name": "a",
|
|
||||||
"type": {
|
"type": {
|
||||||
"type": "String"
|
"type": "String"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "t",
|
|
||||||
"type": {
|
|
||||||
"type": "String"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "n",
|
|
||||||
"type": {
|
|
||||||
"type": "Number"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"type": {
|
"type": {
|
||||||
|
Loading…
Reference in New Issue
Block a user