Merge branch 'feature/skin' into release

# Conflicts:
#	src/cross/protocols/serviceProto.ts
#	src/json/huodong.json5
#	src/json/pay.json
#	src/json/renown_level.json
#	src/json/tanxian.json
#	src/json/xstask.json
#	src/jsonType.ts
#	src/module/mongodb.ts
#	src/monopoly/protocols/serviceProto.ts
#	src/shared/protocols/serviceProto.ts
#	src/shared/protocols/user/PtlLogin.ts
#	src/shared/public/hero.ts
This commit is contained in:
xichaoyin 2024-01-12 00:28:09 +08:00
commit ac90f9db33
26 changed files with 8788 additions and 13722 deletions

View File

@ -141,6 +141,9 @@ export default async function (call: ApiCall<ReqBingo, ResBingo>) {
}
if (shell[3]) emailMsg.prize = JSON.parse(shell[3])
EmailFun.addEmail(emailMsg);
} else if (shell[0] == "heroskin") {
PlayerFun.sendPrize(call, [{ a: "heroskin", "t": shell[1], n: 1 }]);
}
call.succ('succ');
}

View File

@ -0,0 +1,20 @@
import { ApiCall } from "tsrpc";
import { ReqTakeOff, ResTakeOff } from "../../shared/protocols/heroskin/PtlTakeOff";
import { HeroFun } from "../../public/hero";
export default async function (call: ApiCall<ReqTakeOff, ResTakeOff>) {
let hero = await HeroFun.getHero(call, call.req.heroOid);
if (!hero) { // 英雄不存在
call.error(lng.hero_1);
return;
}
if (!hero.skin) { // 没有穿戴皮肤
call.error(lng.hero_22);
return;
}
await HeroFun.changeHeroAttr(call, hero, { skin: "" });
call.succ({});
}

View File

@ -0,0 +1,38 @@
import { ApiCall } from "tsrpc";
import { PlayerFun } from "../../public/player";
import { ReqUplv, ResUplv } from "../../shared/protocols/heroskin/PtlUplv";
import HeroSkinFun from "../../public/heroskin";
export default async function (call: ApiCall<ReqUplv, ResUplv>) {
let skin = HeroSkinFun.getHeroSkin(call);
if (!skin[call.req.skid]) {// 皮肤未获得
call.error(lng.hero_20);
}
let cur_lv = skin[call.req.skid];
let skinconf = G.gc.heroSkin[call.req.skid];
let need = [];
for (let i = 0; i < call.req.lv; i++) {
need = need.concat(
G.gc.heroSkinLv[skinconf.colour][cur_lv + i].need
)
let conf = G.gc.heroSkin[call.req.skid];
need.push({ a: "item", "t": conf.heroId, "n": G.gc.heroSkinLv[skinconf.colour][cur_lv + i].suipian });
}
// 检测消耗
await PlayerFun.checkNeedIsMeet(call, need);
// 扣除消耗
await PlayerFun.cutNeed(call, need);
// 更新等级
skin[call.req.skid] = cur_lv + call.req.lv;
// 更新skinlv
await HeroSkinFun.updateHeroSkinLv(call, { [call.req.skid]: cur_lv + call.req.lv });
call.succ({});
}

View File

@ -0,0 +1,28 @@
import { ApiCall } from "tsrpc";
import { HeroFun } from "../../public/hero";
import { ReqWear, ResWear } from "../../shared/protocols/heroskin/PtlWear";
import HeroSkinFun from "../../public/heroskin";
export default async function (call: ApiCall<ReqWear, ResWear>) {
let hero = await HeroFun.getHero(call, call.req.heroOid);
if (!hero) { // 英雄不存在
call.error(lng.hero_1);
return;
}
let skin = HeroSkinFun.getHeroSkin(call);
if (!skin || !skin[call.req.skid]) { // 皮肤不存在
call.error(lng.hero_20);
return;
}
let skinconf = G.gc.heroSkin[call.req.skid];
if (skinconf.heroId != hero.heroId) { // 皮肤不属于该英雄
call.error(lng.hero_21);
return;
}
await HeroFun.changeHeroAttr(call, hero, { skin: call.req.skid });
call.succ({});
}

View File

@ -20,7 +20,8 @@ export default async function (call: ApiCall<ReqChangeInfo, ResChangeInfo>) {
vip: call.conn.gud.vip,
lsyx: call.conn.lshd.hero,
model: call.conn.gud.model,
active: active
active: active,
heroskin: call.conn.gud.heroskin
});
if (!isMeet && call.req.type != 'headFrame' && call.req.type != 'chatFrame') return call.error(globalThis.lng.user_1);

View File

@ -1319,7 +1319,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
},
{
"id": 38,
"name": "weiwangbuff",
"name": "heroskin",
"type": {
"type": "Interface",
"indexSignature": {
@ -1721,6 +1721,13 @@ export const serviceProto: ServiceProto<ServiceType> = {
}
}
}
},
{
"id": 8,
"name": "skin",
"type": {
"type": "String"
}
}
]
},

View File

@ -1,11 +1,18 @@
{
//赛区划分按照周三23:50的时候王者玩家100个一组
//赛区划分时间周三23:50
divideTime: 258600,
//挑战时间周一08:00——周六22:00
//赛区划分
divide: [
{ day: [1, 30], group: 0 },
{ day: [31, 60], group: 1 },
{ day: [61, 120], group: 2 },
{ day: [121, 210], group: 3 },
{ day: [211, 99999999], group: 4 },
],
//赛区划分时间
divideTime: 0,
//挑战时间
fightTime: [28800, 511200],
//发奖时间周六22:05
prizeTime: 511500,
//发奖时间
prizeTime: 598200,
//胜场奖励
fightWinPrize: [
{ total: 5, prize: [{ a: 'attr', t: 'clsl_sd', n: 1 },{ a: 'item', t: '37', n: 1 }], star: 1 },
@ -32,13 +39,13 @@
],
//段位奖励
danPrize: [
{ star: 49, title: "clsl_7", prize: [{ a: 'item', t: '605', n:3 },{ a: 'item', t: '29', n:10 },{ a: 'item', t: '631', n:3 },{ a: 'item', t: '40', n:1 }] },
{ star: 39, title: "clsl_6", prize: [{ a: 'item', t: '605', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '631', n:2 }] },
{ star: 29, title: "clsl_5", prize: [{ a: 'item', t: '606', n:3 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '631', n:1 }] },
{ star: 21, title: "clsl_4", prize: [{ a: 'item', t: '606', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:1000 }] },
{ star: 13, title: "clsl_3", prize: [{ a: 'item', t: '606', n:1 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:800 }] },
{ star: 7, title: "clsl_2", prize: [{ a: 'item', t: '29', n:10 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:600 }] },
{ star: 0, title: "clsl_1", prize: [{ a: 'item', t: '29', n:5 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:400 }] }
{ star: 49, prize: [{ a: 'item', t: '605', n:3 },{ a: 'item', t: '29', n:10 },{ a: 'item', t: '631', n:3 },{ a: 'item', t: '40', n:1 }] },
{ star: 39, prize: [{ a: 'item', t: '605', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '631', n:2 }] },
{ star: 29, prize: [{ a: 'item', t: '606', n:3 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '631', n:1 }] },
{ star: 21, prize: [{ a: 'item', t: '606', n:2 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:1000 }] },
{ star: 13, prize: [{ a: 'item', t: '606', n:1 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:800 }] },
{ star: 7, prize: [{ a: 'item', t: '29', n:10 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:600 }] },
{ star: 0, prize: [{ a: 'item', t: '29', n:5 },{ a: 'item', t: '29', n:5 },{ a: 'item', t: '39', n:400 }] }
],
//王者排名邮件信息
email_rank: {

File diff suppressed because it is too large Load Diff

View File

@ -317,286 +317,172 @@
"22": {
"id": 22,
"renownlevel": 22,
"maxlevel": 62500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 25
}
],
"atk": 1.4,
"def": 1.2,
"hp": 7
"maxlevel": 5000,
"cost": 54,
"atk": 14,
"def": 7,
"hp": 23
},
"23": {
"id": 23,
"renownlevel": 23,
"maxlevel": 67500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 30
}
],
"atk": 1.4,
"def": 1.2,
"hp": 7
"maxlevel": 5000,
"cost": 57,
"atk": 16,
"def": 8,
"hp": 24
},
"24": {
"id": 24,
"renownlevel": 24,
"maxlevel": 72500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 35
}
],
"atk": 1.4,
"def": 1.2,
"hp": 7
"maxlevel": 5000,
"cost": 60,
"atk": 16,
"def": 8,
"hp": 24
},
"25": {
"id": 25,
"renownlevel": 25,
"maxlevel": 77500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 40
}
],
"atk": 1.4,
"def": 1.2,
"hp": 7
"maxlevel": 5000,
"cost": 63,
"atk": 16,
"def": 8,
"hp": 24
},
"26": {
"id": 26,
"renownlevel": 26,
"maxlevel": 82500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 45
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 66,
"atk": 16,
"def": 8,
"hp": 24
},
"27": {
"id": 27,
"renownlevel": 27,
"maxlevel": 87500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 50
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 69,
"atk": 16,
"def": 8,
"hp": 24
},
"28": {
"id": 28,
"renownlevel": 28,
"maxlevel": 92500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 60
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 72,
"atk": 18,
"def": 9,
"hp": 25
},
"29": {
"id": 29,
"renownlevel": 29,
"maxlevel": 97500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 80
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 75,
"atk": 18,
"def": 9,
"hp": 25
},
"30": {
"id": 30,
"renownlevel": 30,
"maxlevel": 102500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 100
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 78,
"atk": 18,
"def": 9,
"hp": 25
},
"31": {
"id": 31,
"renownlevel": 31,
"maxlevel": 107500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 120
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 81,
"atk": 18,
"def": 9,
"hp": 25
},
"32": {
"id": 32,
"renownlevel": 32,
"maxlevel": 112500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 140
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 84,
"atk": 18,
"def": 9,
"hp": 25
},
"33": {
"id": 33,
"renownlevel": 33,
"maxlevel": 117500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 180
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 87,
"atk": 18,
"def": 10,
"hp": 25
},
"34": {
"id": 34,
"renownlevel": 34,
"maxlevel": 122500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 220
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 90,
"atk": 18,
"def": 10,
"hp": 25
},
"35": {
"id": 35,
"renownlevel": 35,
"maxlevel": 127500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 260
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 93,
"atk": 18,
"def": 10,
"hp": 25
},
"36": {
"id": 36,
"renownlevel": 36,
"maxlevel": 132500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 300
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 97,
"atk": 18,
"def": 10,
"hp": 25
},
"37": {
"id": 37,
"renownlevel": 37,
"maxlevel": 137500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 350
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 101,
"atk": 18,
"def": 10,
"hp": 25
},
"38": {
"id": 38,
"renownlevel": 38,
"maxlevel": 142500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 400
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 105,
"atk": 18,
"def": 10,
"hp": 25
},
"39": {
"id": 39,
"renownlevel": 39,
"maxlevel": 147500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 450
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 109,
"atk": 18,
"def": 10,
"hp": 25
},
"40": {
"id": 40,
"renownlevel": 40,
"maxlevel": 152500,
"cost": [
{
"a": "attr",
"t": "weiwang",
"n": 500
}
],
"atk": 1.4,
"def": 1.2,
"hp": 8
"maxlevel": 5000,
"cost": 113,
"atk": 18,
"def": 10,
"hp": 25
}
}

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@
"p": 5,
"intr": "intr_xuanshangrenwu_intr_1",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"2": {
"id": 2,
@ -37,7 +37,7 @@
"p": 3,
"intr": "intr_xuanshangrenwu_intr_2",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"3": {
"id": 3,
@ -57,7 +57,7 @@
"p": 5,
"intr": "intr_xuanshangrenwu_intr_3",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"4": {
"id": 4,
@ -77,7 +77,7 @@
"p": 1,
"intr": "intr_xuanshangrenwu_intr_4",
"img": "icon_jinbi",
"jiequNum": 3
"appearNum": 3
},
"5": {
"id": 5,
@ -97,7 +97,7 @@
"p": 3,
"intr": "intr_xuanshangrenwu_intr_5",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"6": {
"id": 6,
@ -117,7 +117,7 @@
"p": 5,
"intr": "intr_xuanshangrenwu_intr_4",
"img": "icon_jinbi",
"jiequNum": 3
"appearNum": 3
},
"7": {
"id": 7,
@ -137,7 +137,7 @@
"p": 3,
"intr": "intr_xuanshangrenwu_intr_5",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"8": {
"id": 8,
@ -157,7 +157,7 @@
"p": 5,
"intr": "intr_xuanshangrenwu_intr_6",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"9": {
"id": 9,
@ -177,7 +177,7 @@
"p": 1,
"intr": "intr_xuanshangrenwu_intr_7",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"10": {
"id": 10,
@ -197,7 +197,7 @@
"p": 3,
"intr": "intr_xuanshangrenwu_intr_8",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"11": {
"id": 11,
@ -217,7 +217,7 @@
"p": 5,
"intr": "intr_xuanshangrenwu_intr_6",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"12": {
"id": 12,
@ -237,7 +237,7 @@
"p": 3,
"intr": "intr_xuanshangrenwu_intr_7",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"13": {
"id": 13,
@ -257,7 +257,7 @@
"p": 3,
"intr": "intr_xuanshangrenwu_intr_8",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"14": {
"id": 14,
@ -277,7 +277,7 @@
"p": 5,
"intr": "intr_xuanshangrenwu_intr_9",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"15": {
"id": 15,
@ -297,7 +297,7 @@
"p": 2,
"intr": "intr_xuanshangrenwu_intr_10",
"img": "icon_jinbi",
"jiequNum": 3
"appearNum": 3
},
"16": {
"id": 16,
@ -317,7 +317,7 @@
"p": 4,
"intr": "intr_xuanshangrenwu_intr_8",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"17": {
"id": 17,
@ -337,7 +337,7 @@
"p": 5,
"intr": "intr_xuanshangrenwu_intr_9",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"18": {
"id": 18,
@ -357,7 +357,7 @@
"p": 1,
"intr": "intr_xuanshangrenwu_intr_10",
"img": "icon_jinbi",
"jiequNum": 3
"appearNum": 3
},
"19": {
"id": 19,
@ -377,7 +377,7 @@
"p": 4,
"intr": "intr_xuanshangrenwu_intr_11",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"20": {
"id": 20,
@ -397,7 +397,7 @@
"p": 4,
"intr": "intr_xuanshangrenwu_intr_12",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"21": {
"id": 21,
@ -417,7 +417,7 @@
"p": 3,
"intr": "intr_xuanshangrenwu_intr_11",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"22": {
"id": 22,
@ -437,7 +437,7 @@
"p": 2,
"intr": "intr_xuanshangrenwu_intr_12",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"23": {
"id": 23,
@ -457,7 +457,7 @@
"p": 1,
"intr": "intr_xuanshangrenwu_intr_13",
"img": "icon_jinbi",
"jiequNum": 3
"appearNum": 3
},
"24": {
"id": 24,
@ -477,7 +477,7 @@
"p": 5,
"intr": "intr_xuanshangrenwu_intr_14",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"25": {
"id": 25,
@ -497,7 +497,7 @@
"p": 2,
"intr": "intr_xuanshangrenwu_intr_15",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"26": {
"id": 26,
@ -517,7 +517,7 @@
"p": 5,
"intr": "intr_xuanshangrenwu_intr_14",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"27": {
"id": 27,
@ -537,7 +537,7 @@
"p": 5,
"intr": "intr_xuanshangrenwu_intr_15",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"28": {
"id": 28,
@ -557,7 +557,7 @@
"p": 1,
"intr": "intr_xuanshangrenwu_intr_16",
"img": "icon_jinbi",
"jiequNum": 3
"appearNum": 3
},
"29": {
"id": 29,
@ -577,7 +577,7 @@
"p": 2,
"intr": "intr_xuanshangrenwu_intr_17",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
},
"30": {
"id": 30,
@ -597,6 +597,6 @@
"p": 4,
"intr": "intr_xuanshangrenwu_intr_18",
"img": "icon_jinbi",
"jiequNum": 0
"appearNum": 0
}
}

View File

@ -1958,7 +1958,7 @@ type gcType = {
kfcb_prize: gc_kfcb_prize
yuyuemail: gc_yuyuemail
tuisonglibao: gc_push_gift
renown_level: gc_renown_level
}
@ -1969,3 +1969,4 @@ declare global {
export function initGcType() {
}

View File

@ -239,6 +239,9 @@ class Lng {
hero_17 = "hero_17";
hero_18 = "hero_18";
hero_19 = "hero_19";
hero_20 = "hero_20";
hero_21 = "hero_21";
hero_22 = "hero_22";
item_1 = "item_1";
item_2 = "item_2";

View File

@ -2640,7 +2640,7 @@ export const serviceProto: ServiceProto<ServiceType> = {
},
{
"id": 38,
"name": "weiwangbuff",
"name": "heroskin",
"type": {
"type": "Interface",
"indexSignature": {

32
src/public/heroskin.ts Normal file
View File

@ -0,0 +1,32 @@
import { ApiCall } from "tsrpc";
import { call } from "../public/player";
import { PlayerFun } from "../public/player";
export default class HeroSkinFun {
/**
*
* @param uid
* @returns
*/
static getHeroSkin(call: call, oids: string | string[] = '') {
return call.conn.gud.heroskin || {};
}
/**
*
*
* addAttr msg_s2c/PlayerChange
* addEventMsg PlayerChange change的key在player中则触发重算战力操作
* heroskin数据不需要主动重算战力
* @param oid
* @param data
* @returns
* */
static async updateHeroSkinLv(call: ApiCall, change: k_v<number>) {
let skin = this.getHeroSkin(call);
skin = Object.assign(skin, change);
await PlayerFun.addAttr(call, { heroskin: skin });
}
}

View File

@ -19,7 +19,7 @@ import {getGud, setGud} from './gud';
import { addGameLog } from "../gameLog";
import { PushGiftFun } from "./pushgift";
import { ActionLog } from './actionLog/actionLog';
import HeroSkinFun from './heroskin';
export type call = {
get otherBuff(): otherBuff;
@ -136,6 +136,7 @@ export class PlayerFun {
let equip = prizeList.filter(atn => atn.a == 'equip' && atn.n != 0);
let shiwu = prizeList.filter(atn => atn.a == 'shiwu' && atn.n != 0);
let peijian = prizeList.filter(atn => atn.a == 'peijian' && atn.n != 0);
let heroskin = prizeList.filter(atn => atn.a == 'heroskin' && atn.n != 0);
// 记录获得
addGameLog(call.uid, call.service.name, call.req, { prize: prizeList })
@ -145,7 +146,8 @@ export class PlayerFun {
hero.length > 0 && this.addHero(call, hero),
equip.length > 0 && this.addEquip(call, equip),
shiwu.length > 0 && this.addShiwu(call, shiwu),
peijian.length > 0 && this.addPeijian(call, peijian)
peijian.length > 0 && this.addPeijian(call, peijian),
heroskin.length > 0 && this.addHeroskin(call, heroskin),
]);
return prizeList;
@ -591,6 +593,31 @@ export class PlayerFun {
return Object.values(result.insertedIds).map(v => G.mongodb.conversionId(v));
}
/**
*
* */
static async addHeroskin(call: call, val: atn[]) {
let prize = [];
let upskin = {};
let heroskin = HeroSkinFun.getHeroSkin(call);
for (let p of val) {
if (!heroskin[p.t]) {
upskin[p.t] = 1;
} else {
prize = prize.concat(G.gc.heroSkin[p.t].zhuanhuan);
}
}
if (Object.keys(upskin).length > 0) {
await this.addAttr(call, { heroskin: Object.assign(heroskin, upskin) });
}
// 皮肤存在转换为其他奖励
if (prize.length > 0) {
await this.sendPrize(call, prize);
}
}
/**
*
*/

View File

@ -71,4 +71,6 @@ type heroAddKey = {
peijian: {
[pos: string]: string;
};
/**皮肤*/
skin: string | number;
};

View File

@ -0,0 +1,7 @@
export interface ReqTakeOff {
heroOid: string
}
export interface ResTakeOff {
}

View File

@ -0,0 +1,6 @@
export interface ReqUplv {
lv: 1;
skid: string;
}
export interface ResUplv { }

View File

@ -0,0 +1,6 @@
export interface ReqWear {
skid: string,
heroOid: string,
}
export interface ResWear { }

File diff suppressed because it is too large Load Diff

View File

@ -195,4 +195,9 @@ export type playerAppend = {
};
/**威望额外属性*/
weiwangbuff?: { [k: string]: number };
/**获得的皮肤*/
heroskin?: {
[skid: string]: number;
}
};

View File

@ -1,11 +1,13 @@
import { ResGetList } from '../protocols/hero/PtlGetList';
import { player } from '../protocols/user/type';
import { EquipShared } from './equip';
import HeroSkinShared from './heroskin';
import { PeijianShared } from './peijian';
import { PlayerShared } from './player';
import { PublicShared } from './public';
import { ShiwuShared } from './shiwu';
export type otherBuff = Partial<player & {
allBuff: k_v<number>;
}>;
@ -278,9 +280,15 @@ export class HeroShared {
}
}
// 威望加成计算
if (otherBuff?.weiwangbuff) {
PublicShared.mergeProperty(buff, otherBuff?.weiwangbuff || {});
// 计算皮肤buff
if (otherBuff?.heroskin) {
for (let skinId in otherBuff.heroskin) {
let skinConf = G.gc.heroSkin[skinId];
if (skinConf.heroId != hero.heroId) console;
PublicShared.mergeProperty(buff, HeroSkinShared.calcBuff(
skinId, otherBuff.heroskin[skinId]
));
}
}
//最后进行加成属性计算

View File

@ -0,0 +1,21 @@
export default class HeroSkinShared {
/**
* buff
* @param skid
* @param lv
* @returns {[string]: number}
* */
static calcBuff(skid: string, lv: number): k_v<number> {
let buff = {};
let skin = G.gc.heroSkin[skid];
for (let i = 1; i <= lv; i++) {
for (let k in (G.gc.heroSkinLv[skin.colour][i]?.buff || {})) {
buff[k] = (buff[k] || 0) + G.gc.heroSkinLv[skin.colour][i].buff[k];
}
}
return buff;
}
}

View File

@ -24,7 +24,7 @@ export class UserShared {
*
* @param id 使 UserShared.getInfo id
*/
static chechIsActive(fmtId: string, collection: Partial<{ lv: number, vip: number, lsyx: k_v<number>, model: k_v<any>, active: k_v<number>; }>) {
static chechIsActive(fmtId: string, collection: Partial<{ lv: number, vip: number, lsyx: k_v<number>, model: k_v<any>, active: k_v<number>, heroskin: k_v<any>; }>) {
const [type, id] = fmtId.split('_');
const jsonName = 'player' + type.slice(0, 1).toLocaleUpperCase() + type.slice(1);
@ -37,6 +37,7 @@ export class UserShared {
// else if (conf.cond[0] == 'time') return collection.active[fmtId] == -1 || collection.active[fmtId] > G.time;
else if (conf.cond[0] == 'time') return conf.cond[1] == -1 || collection.active?.[fmtId] > G.time;
else if (conf.cond[0] == 'model') return Object.values(collection.model).find(i => i.id == conf.cond[1]);
else if (conf.cond[0] == 'heroskin') return conf.cond[1] in collection.heroskin;
else return false;
}
}