From ba468ff392ce3ef28793bdac734cb49bff123eb1 Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Wed, 19 Jul 2023 19:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=91=A8=E9=95=BF=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_buriedcondi.json | 26 +++++------ bin/json/game_pandamasmz.json | 10 ++--- bin/json/game_playerlv.json | 80 +++++++++++++++++----------------- bin/json/game_ruledesc.json | 11 +++++ utils/time.go | 21 +++++---- utils/utils_test.go | 18 ++++++++ 6 files changed, 100 insertions(+), 66 deletions(-) diff --git a/bin/json/game_buriedcondi.json b/bin/json/game_buriedcondi.json index 43251a352..9b9b0c23d 100644 --- a/bin/json/game_buriedcondi.json +++ b/bin/json/game_buriedcondi.json @@ -24195,7 +24195,7 @@ "key": "buried_buried_condi_tasktxt_852", "text": "本周累计经验副本消耗300体力" }, - "type": 130, + "type": 201, "valid": 0, "head": { "a": "attr", @@ -24217,7 +24217,7 @@ "key": "buried_buried_condi_tasktxt_853", "text": "本周累计经验副本消耗600体力" }, - "type": 130, + "type": 201, "valid": 0, "head": { "a": "attr", @@ -24239,7 +24239,7 @@ "key": "buried_buried_condi_tasktxt_854", "text": "本周累计经验副本消耗1000体力" }, - "type": 130, + "type": 201, "valid": 0, "head": { "a": "attr", @@ -24261,7 +24261,7 @@ "key": "buried_buried_condi_tasktxt_855", "text": "本周累计消耗3000000点金币" }, - "type": 130, + "type": 68, "valid": 0, "head": { "a": "attr", @@ -24283,7 +24283,7 @@ "key": "buried_buried_condi_tasktxt_856", "text": "本周累计消耗6000000点金币" }, - "type": 130, + "type": 68, "valid": 0, "head": { "a": "attr", @@ -24305,7 +24305,7 @@ "key": "buried_buried_condi_tasktxt_857", "text": "本周累计消耗10000000点金币" }, - "type": 130, + "type": 68, "valid": 0, "head": { "a": "attr", @@ -24327,7 +24327,7 @@ "key": "buried_buried_condi_tasktxt_858", "text": "本周累计装备副本消耗300体力" }, - "type": 130, + "type": 201, "valid": 0, "head": { "a": "attr", @@ -24349,7 +24349,7 @@ "key": "buried_buried_condi_tasktxt_859", "text": "本周累计装备副本消耗600体力" }, - "type": 130, + "type": 201, "valid": 0, "head": { "a": "attr", @@ -24371,7 +24371,7 @@ "key": "buried_buried_condi_tasktxt_860", "text": "本周累计装备副本消耗1000体力" }, - "type": 130, + "type": 201, "valid": 0, "head": { "a": "attr", @@ -24393,7 +24393,7 @@ "key": "buried_buried_condi_tasktxt_861", "text": "本周累计回响副本消耗300体力" }, - "type": 130, + "type": 202, "valid": 0, "head": { "a": "attr", @@ -24415,7 +24415,7 @@ "key": "buried_buried_condi_tasktxt_862", "text": "本周累计回响副本消耗600体力" }, - "type": 130, + "type": 202, "valid": 0, "head": { "a": "attr", @@ -24437,7 +24437,7 @@ "key": "buried_buried_condi_tasktxt_863", "text": "本周累计回响副本消耗1000体力" }, - "type": 130, + "type": 202, "valid": 0, "head": { "a": "attr", @@ -24459,7 +24459,7 @@ "key": "buried_buried_condi_tasktxt_864", "text": "备用埋点" }, - "type": 130, + "type": 43, "valid": 0, "head": { "a": "attr", diff --git a/bin/json/game_pandamasmz.json b/bin/json/game_pandamasmz.json index 7091cb51e..51050894b 100644 --- a/bin/json/game_pandamasmz.json +++ b/bin/json/game_pandamasmz.json @@ -18,7 +18,7 @@ } ], "min_exp": 60, - "placement_duration": 180, + "placement_duration": 10, "prop_position": 0, "photo_guide_unlocking": [ { @@ -48,7 +48,7 @@ } ], "min_exp": 70, - "placement_duration": 210, + "placement_duration": 10, "prop_position": 1, "photo_guide_unlocking": [ { @@ -78,7 +78,7 @@ } ], "min_exp": 80, - "placement_duration": 240, + "placement_duration": 10, "prop_position": 1, "photo_guide_unlocking": [ { @@ -108,7 +108,7 @@ } ], "min_exp": 90, - "placement_duration": 270, + "placement_duration": 10, "prop_position": 1, "photo_guide_unlocking": [ { @@ -132,7 +132,7 @@ }, "up_lv_consume": [], "min_exp": 100, - "placement_duration": 300, + "placement_duration": 10, "prop_position": 1, "photo_guide_unlocking": [ { diff --git a/bin/json/game_playerlv.json b/bin/json/game_playerlv.json index 0a98d04d8..432dab873 100644 --- a/bin/json/game_playerlv.json +++ b/bin/json/game_playerlv.json @@ -195,7 +195,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 80, - "hero_lv": 30 + "hero_lv": 20 }, { "lv": 12, @@ -214,7 +214,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 82, - "hero_lv": 30 + "hero_lv": 20 }, { "lv": 13, @@ -233,7 +233,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 84, - "hero_lv": 30 + "hero_lv": 20 }, { "lv": 14, @@ -252,7 +252,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 86, - "hero_lv": 30 + "hero_lv": 20 }, { "lv": 15, @@ -271,7 +271,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 88, - "hero_lv": 30 + "hero_lv": 25 }, { "lv": 16, @@ -290,7 +290,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 90, - "hero_lv": 30 + "hero_lv": 25 }, { "lv": 17, @@ -309,7 +309,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 92, - "hero_lv": 30 + "hero_lv": 25 }, { "lv": 18, @@ -328,7 +328,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 94, - "hero_lv": 30 + "hero_lv": 25 }, { "lv": 19, @@ -347,7 +347,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 96, - "hero_lv": 30 + "hero_lv": 25 }, { "lv": 20, @@ -366,7 +366,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 98, - "hero_lv": 30 + "hero_lv": 25 }, { "lv": 21, @@ -385,7 +385,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 100, - "hero_lv": 40 + "hero_lv": 30 }, { "lv": 22, @@ -404,7 +404,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 102, - "hero_lv": 40 + "hero_lv": 30 }, { "lv": 23, @@ -423,7 +423,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 104, - "hero_lv": 40 + "hero_lv": 30 }, { "lv": 24, @@ -442,7 +442,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 106, - "hero_lv": 40 + "hero_lv": 30 }, { "lv": 25, @@ -461,7 +461,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 108, - "hero_lv": 40 + "hero_lv": 30 }, { "lv": 26, @@ -480,7 +480,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 110, - "hero_lv": 40 + "hero_lv": 35 }, { "lv": 27, @@ -499,7 +499,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 112, - "hero_lv": 40 + "hero_lv": 35 }, { "lv": 28, @@ -518,7 +518,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 114, - "hero_lv": 40 + "hero_lv": 35 }, { "lv": 29, @@ -537,7 +537,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 116, - "hero_lv": 40 + "hero_lv": 35 }, { "lv": 30, @@ -556,7 +556,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 118, - "hero_lv": 40 + "hero_lv": 35 }, { "lv": 31, @@ -575,7 +575,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 120, - "hero_lv": 50 + "hero_lv": 40 }, { "lv": 32, @@ -594,7 +594,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 122, - "hero_lv": 50 + "hero_lv": 40 }, { "lv": 33, @@ -613,7 +613,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 124, - "hero_lv": 50 + "hero_lv": 40 }, { "lv": 34, @@ -632,7 +632,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 126, - "hero_lv": 50 + "hero_lv": 40 }, { "lv": 35, @@ -651,7 +651,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 128, - "hero_lv": 50 + "hero_lv": 40 }, { "lv": 36, @@ -670,7 +670,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 130, - "hero_lv": 50 + "hero_lv": 45 }, { "lv": 37, @@ -689,7 +689,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 132, - "hero_lv": 50 + "hero_lv": 45 }, { "lv": 38, @@ -708,7 +708,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 134, - "hero_lv": 50 + "hero_lv": 45 }, { "lv": 39, @@ -727,7 +727,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 136, - "hero_lv": 50 + "hero_lv": 45 }, { "lv": 40, @@ -746,7 +746,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 138, - "hero_lv": 50 + "hero_lv": 45 }, { "lv": 41, @@ -765,7 +765,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 140, - "hero_lv": 60 + "hero_lv": 50 }, { "lv": 42, @@ -784,7 +784,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 142, - "hero_lv": 60 + "hero_lv": 50 }, { "lv": 43, @@ -803,7 +803,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 144, - "hero_lv": 60 + "hero_lv": 50 }, { "lv": 44, @@ -822,7 +822,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 146, - "hero_lv": 60 + "hero_lv": 50 }, { "lv": 45, @@ -841,7 +841,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 148, - "hero_lv": 60 + "hero_lv": 50 }, { "lv": 46, @@ -860,7 +860,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 150, - "hero_lv": 60 + "hero_lv": 55 }, { "lv": 47, @@ -879,7 +879,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 152, - "hero_lv": 60 + "hero_lv": 55 }, { "lv": 48, @@ -898,7 +898,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 154, - "hero_lv": 60 + "hero_lv": 55 }, { "lv": 49, @@ -917,7 +917,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 156, - "hero_lv": 60 + "hero_lv": 55 }, { "lv": 50, @@ -936,7 +936,7 @@ ], "ps_ceiling": 180, "cops_ps_ceiling": 158, - "hero_lv": 60 + "hero_lv": 55 }, { "lv": 51, diff --git a/bin/json/game_ruledesc.json b/bin/json/game_ruledesc.json index 2cdb16e8f..9974508c5 100644 --- a/bin/json/game_ruledesc.json +++ b/bin/json/game_ruledesc.json @@ -493,5 +493,16 @@ "key": "ruledesc_ruledesc_content_45", "text": "这里可以使用食材烹饪出各种各样的食物。
食材组合的不同,烹饪出来的食物也完全不同。
添加的食物越多,能煮出好食物的概率越高,但要小心错误的食材组合会完全烹饪不出好的食物。只有正确的食材组合才能烹饪出美味佳肴。" } + }, + { + "id": 10046, + "title": { + "key": "ruledesc_ruledesc_title_46", + "text": "护符水晶说明" + }, + "content": { + "key": "ruledesc_ruledesc_content_46", + "text": "这里可以使用主角月光与水晶的力量,迅速提升守护者的等级。
水晶会挑选你等级最高的5位守护者为核心,在右侧上阵守护者将会把等级提升至五位最高的守护者中等级最低的那一位。
上阵守护者槽位由玩家等级解锁,每一个槽位只能上阵相应品质的守护者。
卸下守护者后槽位会进入不稳定状态,稳定槽位需要24小时或者200钻石迅速稳定。" + } } ] \ No newline at end of file diff --git a/utils/time.go b/utils/time.go index d19965d28..320d9895f 100644 --- a/utils/time.go +++ b/utils/time.go @@ -18,15 +18,20 @@ func IsToday(d int64) bool { // 判断是否是出于同一周 func IsSameWeek(d int64) bool { - // 将时间戳转换成一个 time.Time 对象 - t1 := time.Unix(d, 0) - t2 := configure.Now() + // 将时间戳转换为 time.Time 类型 + time1 := time.Unix(d, 0) + time2 := configure.Now() - // 获取 t1 所在的周的第一天和 t2 所在的周的第一天 - t1FirstDay := t1.AddDate(0, 0, -int(t1.Weekday())+1) - t2FirstDay := t2.AddDate(0, 0, -int(t2.Weekday())+1) - // 判断两个时间所在的周的第一天是否相同 - return t1FirstDay.Equal(t2FirstDay) + // 获取时间戳所属的年份和周数 + year1, week1 := time1.ISOWeek() + year2, week2 := time2.ISOWeek() + + // 判断是否同一年同一周 + if year1 == year2 && week1 == week2 { + return true + } else { + return false + } } // 判断是否大于1周 diff --git a/utils/utils_test.go b/utils/utils_test.go index 0579bd86a..a3a581bd1 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -100,6 +100,24 @@ func BenchmarkRandNumbers(b *testing.B) { } } +func TestIsSameWeek(t *testing.T) { + + // 将时间戳转换为 time.Time 类型 + time1 := time.Now() + time2 := time.Now() + + // 获取时间戳所属的年份和周数 + year1, week1 := time1.ISOWeek() + year2, week2 := time2.ISOWeek() + + // 判断是否同一年同一周 + if year1 == year2 && week1 == week2 { + fmt.Println("两个时间戳属于同一周") + } else { + fmt.Println("两个时间戳不属于同一周") + } +} + func TestWeekIntervalTime(t *testing.T) { ti := utils.WeekIntervalTime(0) format := "2006-01-02 15:04:05"