炉子升级

This commit is contained in:
meixiongfeng 2023-02-16 18:20:56 +08:00
parent 92fd5e34cb
commit 045209ace3
9 changed files with 177 additions and 240 deletions

View File

@ -25,9 +25,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 2 "n": 2
}, }
"nDrop": 10001,
"qDrop": 20001
}, },
{ {
"id": 2, "id": 2,
@ -39,9 +37,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 3 "n": 3
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 3, "id": 3,
@ -53,9 +49,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 4 "n": 4
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 4, "id": 4,
@ -67,9 +61,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 5 "n": 5
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 5, "id": 5,
@ -81,9 +73,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 6 "n": 6
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 6, "id": 6,
@ -95,9 +85,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 7 "n": 7
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 7, "id": 7,
@ -109,9 +97,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 8 "n": 8
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 8, "id": 8,
@ -123,9 +109,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 9 "n": 9
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 9, "id": 9,
@ -137,9 +121,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 10 "n": 10
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 10, "id": 10,
@ -151,9 +133,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 11 "n": 11
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 11, "id": 11,
@ -165,9 +145,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 12 "n": 12
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 12, "id": 12,
@ -179,9 +157,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 13 "n": 13
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 13, "id": 13,
@ -193,9 +169,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 14 "n": 14
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 14, "id": 14,
@ -207,9 +181,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 15 "n": 15
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 15, "id": 15,
@ -221,9 +193,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 16 "n": 16
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 16, "id": 16,
@ -235,9 +205,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 17 "n": 17
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 17, "id": 17,
@ -249,9 +217,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 18 "n": 18
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 18, "id": 18,
@ -263,9 +229,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 19 "n": 19
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 19, "id": 19,
@ -277,9 +241,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 20 "n": 20
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 20, "id": 20,
@ -291,9 +253,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 21 "n": 21
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 21, "id": 21,
@ -305,9 +265,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 22 "n": 22
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 22, "id": 22,
@ -319,9 +277,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 23 "n": 23
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 23, "id": 23,
@ -333,9 +289,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 24 "n": 24
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 24, "id": 24,
@ -347,9 +301,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 25 "n": 25
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 25, "id": 25,
@ -361,9 +313,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 26 "n": 26
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 26, "id": 26,
@ -375,9 +325,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 27 "n": 27
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 27, "id": 27,
@ -389,9 +337,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 28 "n": 28
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 28, "id": 28,
@ -403,9 +349,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 29 "n": 29
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 29, "id": 29,
@ -417,9 +361,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 30 "n": 30
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 30, "id": 30,
@ -431,9 +373,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 31 "n": 31
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 31, "id": 31,
@ -445,9 +385,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 32 "n": 32
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 32, "id": 32,
@ -459,9 +397,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 33 "n": 33
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 33, "id": 33,
@ -473,9 +409,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 34 "n": 34
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 34, "id": 34,
@ -487,9 +421,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 35 "n": 35
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 35, "id": 35,
@ -501,9 +433,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 36 "n": 36
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 36, "id": 36,
@ -515,9 +445,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 37 "n": 37
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 37, "id": 37,
@ -529,9 +457,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 38 "n": 38
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 38, "id": 38,
@ -543,9 +469,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 39 "n": 39
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 39, "id": 39,
@ -557,9 +481,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 40 "n": 40
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 40, "id": 40,
@ -571,9 +493,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 41 "n": 41
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 41, "id": 41,
@ -585,9 +505,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 42 "n": 42
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 42, "id": 42,
@ -599,9 +517,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 43 "n": 43
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 43, "id": 43,
@ -613,9 +529,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 44 "n": 44
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 44, "id": 44,
@ -627,9 +541,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 45 "n": 45
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 45, "id": 45,
@ -641,9 +553,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 46 "n": 46
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 46, "id": 46,
@ -655,9 +565,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 47 "n": 47
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 47, "id": 47,
@ -669,9 +577,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 48 "n": 48
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 48, "id": 48,
@ -683,9 +589,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 49 "n": 49
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 49, "id": 49,
@ -697,9 +601,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 50 "n": 50
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 50, "id": 50,
@ -711,9 +613,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 51 "n": 51
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 51, "id": 51,
@ -725,9 +625,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 52 "n": 52
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 52, "id": 52,
@ -739,9 +637,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 53 "n": 53
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 53, "id": 53,
@ -753,9 +649,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 54 "n": 54
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 54, "id": 54,
@ -767,9 +661,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 55 "n": 55
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 55, "id": 55,
@ -781,9 +673,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 56 "n": 56
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 56, "id": 56,
@ -795,9 +685,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 57 "n": 57
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 57, "id": 57,
@ -809,9 +697,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 58 "n": 58
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 58, "id": 58,
@ -823,9 +709,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 59 "n": 59
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 59, "id": 59,
@ -837,9 +721,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 60 "n": 60
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 60, "id": 60,
@ -851,9 +733,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 61 "n": 61
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 61, "id": 61,
@ -865,9 +745,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 62 "n": 62
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 62, "id": 62,
@ -879,9 +757,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 63 "n": 63
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 63, "id": 63,
@ -893,9 +769,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 64 "n": 64
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 64, "id": 64,
@ -907,9 +781,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 65 "n": 65
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 65, "id": 65,
@ -921,9 +793,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 66 "n": 66
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 66, "id": 66,
@ -935,9 +805,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 67 "n": 67
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 67, "id": 67,
@ -949,9 +817,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 68 "n": 68
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 68, "id": 68,
@ -963,9 +829,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 69 "n": 69
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 69, "id": 69,
@ -977,9 +841,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 70 "n": 70
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 70, "id": 70,
@ -991,9 +853,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 71 "n": 71
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 71, "id": 71,
@ -1005,9 +865,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 72 "n": 72
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 72, "id": 72,
@ -1019,9 +877,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 73 "n": 73
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 73, "id": 73,
@ -1033,9 +889,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 74 "n": 74
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 74, "id": 74,
@ -1047,9 +901,7 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 75 "n": 75
}, }
"nDrop": 0,
"qDrop": 0
}, },
{ {
"id": 75, "id": 75,
@ -1061,8 +913,6 @@
"a": "item", "a": "item",
"t": "20201", "t": "20201",
"n": 76 "n": 76
}, }
"nDrop": 0,
"qDrop": 0
} }
] ]

View File

@ -7,7 +7,8 @@
"text": "" "text": ""
}, },
"goods": [], "goods": [],
"reword": [] "reword": [],
"weight": 4500
}, },
{ {
"customer_id": 2, "customer_id": 2,
@ -17,7 +18,8 @@
"text": "" "text": ""
}, },
"goods": [], "goods": [],
"reword": [] "reword": [],
"weight": 4500
}, },
{ {
"customer_id": 3, "customer_id": 3,
@ -27,7 +29,8 @@
"text": "" "text": ""
}, },
"goods": [], "goods": [],
"reword": [] "reword": [],
"weight": 500
}, },
{ {
"customer_id": 4, "customer_id": 4,
@ -37,6 +40,7 @@
"text": "" "text": ""
}, },
"goods": [], "goods": [],
"reword": [] "reword": [],
"weight": 500
} }
] ]

View File

@ -3,6 +3,7 @@ package smithy
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs" cfg "go_dreamfactory/sys/configure/structs"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -59,12 +60,15 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
costRes = append(costRes, reelcfg.Quality) costRes = append(costRes, reelcfg.Quality)
} }
costRes = append(costRes, reelcfg.Consume...) costRes = append(costRes, reelcfg.Consume...)
subAtn := this.module.modelStove.CheckForgeConsume(req.ReelId, stove.Data[req.ReelId].Lv)
costRes = append(costRes, subAtn...)
if code = this.module.CheckRes(session, costRes); code != pb.ErrorCode_Success { if code = this.module.CheckRes(session, costRes); code != pb.ErrorCode_Success {
return return
} }
// 熟练度减少的温度
t := this.module.modelStove.CheckTemperature(req.ReelId, stove.Data[req.ReelId].Lv)
// 检查炉温 是否够 // 检查炉温 是否够
if stove.Temperature < reelcfg.Temperature { if stove.Temperature < reelcfg.Temperature-t {
code = pb.ErrorCode_SmithyNoTemperature // 炉温不够 直接返回 code = pb.ErrorCode_SmithyNoTemperature // 炉温不够 直接返回
return return
} }
@ -85,8 +89,10 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
if code = this.module.ConsumeRes(session, costRes, true); code != pb.ErrorCode_Success { if code = this.module.ConsumeRes(session, costRes, true); code != pb.ErrorCode_Success {
return return
} }
stove.Temperature -= reelcfg.Temperature // 消耗温度 stove.Temperature -= (reelcfg.Temperature - t) // 消耗温度
stove.RecoveTime = configure.Now().Unix()
update["data"] = stove.Data update["data"] = stove.Data
update["recoveTime"] = stove.RecoveTime
update["temperature"] = stove.Temperature update["temperature"] = stove.Temperature
this.module.modelStove.updateSmithyStove(session.GetUserId(), update) this.module.modelStove.updateSmithyStove(session.GetUserId(), update)
session.SendMsg(string(this.module.GetType()), "forgeequip", &pb.SmithyForgeEquipResp{Data: stove}) session.SendMsg(string(this.module.GetType()), "forgeequip", &pb.SmithyForgeEquipResp{Data: stove})

View File

@ -25,6 +25,7 @@ func (this *apiComp) GetStoveInfo(session comm.IUserSession, req *pb.SmithyGetSt
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
this.module.modelStove.calculationRecoveryT(session.GetUserId(), _smithy)
session.SendMsg(string(this.module.GetType()), "getstoveinfo", &pb.SmithyGetStoveInfoResp{Data: _smithy}) session.SendMsg(string(this.module.GetType()), "getstoveinfo", &pb.SmithyGetStoveInfoResp{Data: _smithy})
return return
} }

View File

@ -24,7 +24,24 @@ func (this *apiComp) StoveUp(session comm.IUserSession, req *pb.SmithyStoveUpReq
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
conf := this.module.configure.GetSmithyStoveConf(stove.Lv)
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
return
}
nexConf := this.module.configure.GetSmithyStoveConf(stove.Lv + 1)
if nexConf == nil {
code = pb.ErrorCode_SmithyStoveMaxLv
return
}
if code = this.module.ConsumeRes(session, conf.UpMaterial, true); code != pb.ErrorCode_Success {
return
}
stove.Lv += 1
update := make(map[string]interface{})
update["temperature"] = stove.Temperature
update["recoveTime"] = stove.RecoveTime
this.module.modelStove.updateSmithyStove(session.GetUserId(), update)
session.SendMsg(string(this.module.GetType()), "stoveup", &pb.SmithyStoveUpResp{Data: stove}) session.SendMsg(string(this.module.GetType()), "stoveup", &pb.SmithyStoveUpResp{Data: stove})
return return
} }

View File

@ -6,6 +6,9 @@ import (
"go_dreamfactory/lego/sys/redis" "go_dreamfactory/lego/sys/redis"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"strconv"
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
@ -58,3 +61,57 @@ func (this *modelStove) updateSmithyStove(uid string, update map[string]interfac
err = this.Change(uid, update) err = this.Change(uid, update)
return err return err
} }
// 图纸属性 炉温消耗减少
func (this *modelStove) CheckTemperature(reelId int32, lv int32) (t int32) {
var index int32
for index = 1; index <= lv; index++ {
if cfg := this.module.configure.GetSmithyProficileData(reelId, index); cfg != nil {
if cfg.Type == comm.SmithyReelType1 {
t += cfg.Value1
}
}
}
return
}
// 检查消耗减少
func (this *modelStove) CheckForgeConsume(reelId int32, lv int32) (atn []*cfg.Gameatn) {
var index int32
for index = 1; index <= lv; index++ {
if cfgData := this.module.configure.GetSmithyProficileData(reelId, index); cfgData != nil {
if cfgData.Type == comm.SmithyReelType2 {
atn = append(atn, &cfg.Gameatn{
A: "item",
T: strconv.Itoa(int(cfgData.Value1)),
N: cfgData.Value2,
})
}
}
}
return
}
// 计算恢复进度
func (this *modelStove) calculationRecoveryT(uid string, stove *pb.DBStove) {
conf := this.module.configure.GetSmithyStoveConf(stove.Lv)
if conf == nil {
return
}
if stove.Temperature < conf.MaxTemperature {
update := make(map[string]interface{})
// 小于最高温度就开始恢复
addT := (configure.Now().Unix() - stove.RecoveTime) / int64(conf.TemperatureRecovery)
stove.Temperature += int32(addT)
if stove.Temperature > conf.MaxTemperature {
stove.Temperature = conf.MaxTemperature
stove.RecoveTime = 0
} else {
stove.RecoveTime += addT * int64(conf.TemperatureRecovery)
}
update["temperature"] = stove.Temperature
update["recoveTime"] = stove.RecoveTime
this.module.modelStove.updateSmithyStove(uid, update)
}
}

View File

@ -318,6 +318,7 @@ const (
// smithy // smithy
ErrorCode_SmithyNoReel ErrorCode = 4101 // 没有激活图纸信息 ErrorCode_SmithyNoReel ErrorCode = 4101 // 没有激活图纸信息
ErrorCode_SmithyNoTemperature ErrorCode = 4102 // 炉温不够不能打造 ErrorCode_SmithyNoTemperature ErrorCode = 4102 // 炉温不够不能打造
ErrorCode_SmithyStoveMaxLv ErrorCode = 4103 // 炉子达到最大等级
) )
// Enum value maps for ErrorCode. // Enum value maps for ErrorCode.
@ -586,6 +587,7 @@ var (
4002: "AutoBattleStatesErr", 4002: "AutoBattleStatesErr",
4101: "SmithyNoReel", 4101: "SmithyNoReel",
4102: "SmithyNoTemperature", 4102: "SmithyNoTemperature",
4103: "SmithyStoveMaxLv",
} }
ErrorCode_value = map[string]int32{ ErrorCode_value = map[string]int32{
"Success": 0, "Success": 0,
@ -851,6 +853,7 @@ var (
"AutoBattleStatesErr": 4002, "AutoBattleStatesErr": 4002,
"SmithyNoReel": 4101, "SmithyNoReel": 4101,
"SmithyNoTemperature": 4102, "SmithyNoTemperature": 4102,
"SmithyStoveMaxLv": 4103,
} }
) )
@ -885,7 +888,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
var file_errorcode_proto_rawDesc = []byte{ var file_errorcode_proto_rawDesc = []byte{
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2a, 0xbf, 0x2f, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x6f, 0x2a, 0xd6, 0x2f, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
@ -1265,8 +1268,9 @@ var file_errorcode_proto_rawDesc = []byte{
0x45, 0x72, 0x72, 0x10, 0xa2, 0x1f, 0x12, 0x11, 0x0a, 0x0c, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x45, 0x72, 0x72, 0x10, 0xa2, 0x1f, 0x12, 0x11, 0x0a, 0x0c, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79,
0x4e, 0x6f, 0x52, 0x65, 0x65, 0x6c, 0x10, 0x85, 0x20, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x69, 0x4e, 0x6f, 0x52, 0x65, 0x65, 0x6c, 0x10, 0x85, 0x20, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x6d, 0x69,
0x74, 0x68, 0x79, 0x4e, 0x6f, 0x54, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x74, 0x68, 0x79, 0x4e, 0x6f, 0x54, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65,
0x10, 0x86, 0x20, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x10, 0x86, 0x20, 0x12, 0x15, 0x0a, 0x10, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x53, 0x74, 0x6f,
0x74, 0x6f, 0x33, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0x87, 0x20, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@ -17,8 +17,6 @@ type GameNewSmithyData struct {
Consume []*Gameatn Consume []*Gameatn
Temperature int32 Temperature int32
Quality *Gameatn Quality *Gameatn
NDrop int32
QDrop int32
} }
const TypeId_GameNewSmithyData = -1249020316 const TypeId_GameNewSmithyData = -1249020316
@ -47,8 +45,6 @@ func (_v *GameNewSmithyData)Deserialize(_buf map[string]interface{}) (err error)
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["temperature"].(float64); !_ok_ { err = errors.New("temperature error"); return }; _v.Temperature = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["temperature"].(float64); !_ok_ { err = errors.New("temperature error"); return }; _v.Temperature = int32(_tempNum_) }
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["quality"].(map[string]interface{}); !_ok_ { err = errors.New("quality error"); return }; if _v.Quality, err = DeserializeGameatn(_x_); err != nil { return } } { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["quality"].(map[string]interface{}); !_ok_ { err = errors.New("quality error"); return }; if _v.Quality, err = DeserializeGameatn(_x_); err != nil { return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["nDrop"].(float64); !_ok_ { err = errors.New("nDrop error"); return }; _v.NDrop = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["qDrop"].(float64); !_ok_ { err = errors.New("qDrop error"); return }; _v.QDrop = int32(_tempNum_) }
return return
} }

View File

@ -16,6 +16,7 @@ type GameSmithyCustomerData struct {
CustomerSpeak string CustomerSpeak string
Goods []*Gameatn Goods []*Gameatn
Reword []*Gameatn Reword []*Gameatn
Weight int32
} }
const TypeId_GameSmithyCustomerData = 1314583578 const TypeId_GameSmithyCustomerData = 1314583578
@ -56,6 +57,7 @@ func (_v *GameSmithyCustomerData)Deserialize(_buf map[string]interface{}) (err e
} }
} }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["weight"].(float64); !_ok_ { err = errors.New("weight error"); return }; _v.Weight = int32(_tempNum_) }
return return
} }