From 9ceaa8b5d110a102b539da636f25ce4afc22e99c Mon Sep 17 00:00:00 2001 From: fatiao <515948292@qq.com> Date: Thu, 20 Nov 2025 16:57:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E5=8F=96=E5=A5=96=E5=8A=B1=E8=A7=84?= =?UTF-8?q?=E5=88=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/roserver/config/csv/StoryRewardCfg.csv | 10 +++++----- server/roserver/game/model/role.go | 13 +++---------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/server/roserver/config/csv/StoryRewardCfg.csv b/server/roserver/config/csv/StoryRewardCfg.csv index 1de4f1e..13a5592 100644 --- a/server/roserver/config/csv/StoryRewardCfg.csv +++ b/server/roserver/config/csv/StoryRewardCfg.csv @@ -1,7 +1,7 @@ -Id序号(格式:Id+0+序号,序号1-8),剧情Id,关卡条件,奖励类型(1-heart|2-gift|3-date),好感度奖励(npcId:好感度数值),礼物奖励(物品Id:数量;物品Id:数量;物品Id:数量),S级约会奖励(物品Id:数量;物品Id:数量;物品Id:数量),A级约会奖励(物品Id:数量;物品Id:数量;物品Id:数量),B级约会奖励(物品Id:数量;物品Id:数量;物品Id:数量) +Id序号(格式:剧情Id+0+序号,序号1-8),剧情Id,关卡条件,奖励类型(1-heart|2-gift|3-date),好感度奖励(npcId:好感度数值),礼物奖励(物品Id:数量;物品Id:数量;物品Id:数量),S级约会奖励(物品Id:数量;物品Id:数量;物品Id:数量),A级约会奖励(物品Id:数量;物品Id:数量;物品Id:数量),B级约会奖励(物品Id:数量;物品Id:数量;物品Id:数量) Id,StoryId,MapLevel,RewardType,HeartReward,GiftReward,DateRewardS,DateRewardA,DateRewardB int,int,int,int,string,list,list,list,list -301,3,10001,1,2003:2,,,, -302,3,10001,2,,841:1;11:100000;19:20000,,, -303,3,10001,2,,841:1;11:100000;19:20000,,, -304,3,10001,3,,,841:1;11:100000;19:20000,841:1;11:100000;19:20000,841:1;11:100000;19:20000 +3001,30,10001,1,203:2,,,, +3002,30,10001,2,,841:1;11:100000;19:20000,,, +3003,30,10001,2,,841:1;11:100000;19:20000,,, +3004,30,10001,3,,,841:1;11:100000;19:20000,841:1;11:100000;19:20000,841:1;11:100000;19:20000 diff --git a/server/roserver/game/model/role.go b/server/roserver/game/model/role.go index 3533a93..b92cedd 100644 --- a/server/roserver/game/model/role.go +++ b/server/roserver/game/model/role.go @@ -2083,10 +2083,6 @@ func (this *Role) SetRoleStory(story *serverproto.KeyValueType) { util.InfoF("SetRoleStory: storyStoreType is not correct, storyId=%d storyRewardId=%d ", storyId, storyRewardId) return } - if int32(story.Value/100) != storyId && int32(story.Value/100) != int32(storyId/100) { - util.InfoF("SetRoleStory: storyId is not correct, storyId=%d storyRewardId=%d ", storyId, storyRewardId) - return - } preStoryVal := this.GetRoleBase().GetStoryVal(storyId) newStoryVal := preStoryVal | (1 << uint32(storyStoreType)) if newStoryVal == preStoryVal { @@ -2104,7 +2100,7 @@ func (this *Role) SetRoleStory(story *serverproto.KeyValueType) { storyRewardCfgMap := serverproto.StoryRewardCfgLoader storyRewardCfg, storyExist := storyRewardCfgMap[storyRewardId] mapLevel := this.roleBattle.mapId*10000 + this.roleBattle.mapLevel - if storyExist && (storyRewardCfg.StoryId == storyId || storyRewardCfg.StoryId == int32(storyId/100)) && + if storyExist && int32(storyRewardCfg.StoryId/10) == int32(storyId/10) && int32(mapLevel) >= storyRewardCfg.MapLevel { if storyRewardCfg.RewardType == Story_Reward_Gift { rewardCfg := storyRewardCfg.GiftReward @@ -2140,10 +2136,6 @@ func (this *Role) SetRoleStoryNpc(storyNpc *serverproto.KeyValueType) { util.InfoF("[SetRoleStoryNpc]: storyStoreType is not correct, storyId=%d storyRewardId=%d ", storyId, storyRewardId) return } - if int32(storyRewardId) != storyId && int32(storyRewardId/100) != int32(storyId/100) { - util.InfoF("[SetRoleStoryNpc]: storyId is not correct, storyId=%d storyRewardId=%d ", storyId, storyRewardId) - return - } preStoryVal := this.GetRoleBase().GetStoryVal(storyId) newStoryVal := preStoryVal | (1 << uint32(storyStoreType)) if newStoryVal == preStoryVal { @@ -2154,7 +2146,8 @@ func (this *Role) SetRoleStoryNpc(storyNpc *serverproto.KeyValueType) { storyRewardCfgMap := serverproto.StoryRewardCfgLoader storyRewardCfg, storyExist := storyRewardCfgMap[storyRewardId] mapLevel := this.roleBattle.mapId*10000 + this.roleBattle.mapLevel - if storyExist && (storyRewardCfg.StoryId == storyId || storyRewardCfg.StoryId == int32(storyId/100)) && + util.InfoF("SetRoleStory: Add Heart storyId=%d, storyRewardId=%d, mapLevel=%d", storyId, storyRewardId, mapLevel) + if storyExist && int32(storyRewardCfg.StoryId/10) == int32(storyId/10) && storyRewardCfg.RewardType == Story_Reward_Heart && int32(mapLevel) >= storyRewardCfg.MapLevel { heartRewardStr := storyRewardCfg.HeartReward storyNpcId, addHeartVal := model.Str2Res(heartRewardStr)