Commit 14f1591bd96f27c0cf8689bff33c8955f05a2f0b

Authored by zhouhaihai
1 parent dc9d814f

删除好感度相关

src/actions/GmAction.lua
... ... @@ -89,28 +89,28 @@ function _M.fbc(role, pms) -- 直接通关
89 89 return "成功"
90 90 end
91 91  
92   -table.insert(helpDes, {"好感度", "love", "角色类型", "好感度等级", "好感度经验"})
93   -function _M.love(role, pms)
94   - local heroType = tonum(pms.pm1)
95   - local level = tonum(pms.pm2)
96   - local exp = tonum(pms.pm3)
97   - local curPlus = csvdb["unit_love_plusCsv"][heroType]
98   - if not curPlus then return "参数错误" end
99   - level = math.max(math.min(curPlus.limit, level), 0)
100   - local curEffect = csvdb["unit_love_effectCsv"][level]
101   - exp = math.max(math.min(curEffect.loveValue, exp) , 0)
102   - for _, hero in pairs(role.heros) do
103   - if hero:getProperty("type") == heroType then
104   - hero:updateProperty({field = "loveL", value = level})
105   - hero:updateProperty({field = "loveExp", value = exp})
106   - if role:getProperty("loveStatus"):getv(heroType, 0) < level then
107   - role:changeUpdates({{type = "loveStatus", field = heroType, value = level}}) -- 总的
108   - end
109   - role:checkTaskEnter("LoveBreak", {heroType = heroType, loveL = level})
110   - end
111   - end
112   - return "成功"
113   -end
  92 +-- table.insert(helpDes, {"好感度", "love", "角色类型", "好感度等级", "好感度经验"})
  93 +-- function _M.love(role, pms)
  94 +-- local heroType = tonum(pms.pm1)
  95 +-- local level = tonum(pms.pm2)
  96 +-- local exp = tonum(pms.pm3)
  97 +-- local curPlus = csvdb["unit_love_plusCsv"][heroType]
  98 +-- if not curPlus then return "参数错误" end
  99 +-- level = math.max(math.min(curPlus.limit, level), 0)
  100 +-- local curEffect = csvdb["unit_love_effectCsv"][level]
  101 +-- exp = math.max(math.min(curEffect.loveValue, exp) , 0)
  102 +-- for _, hero in pairs(role.heros) do
  103 +-- if hero:getProperty("type") == heroType then
  104 +-- hero:updateProperty({field = "loveL", value = level})
  105 +-- hero:updateProperty({field = "loveExp", value = exp})
  106 +-- if role:getProperty("loveStatus"):getv(heroType, 0) < level then
  107 +-- role:changeUpdates({{type = "loveStatus", field = heroType, value = level}}) -- 总的
  108 +-- end
  109 +-- role:checkTaskEnter("LoveBreak", {heroType = heroType, loveL = level})
  110 +-- end
  111 +-- end
  112 +-- return "成功"
  113 +-- end
114 114  
115 115 table.insert(helpDes, {"玩家经验", "exp", "经验"})
116 116 function _M.exp(role, pms)
... ...
src/actions/HeroAction.lua
... ... @@ -375,107 +375,107 @@ function _M.likeCommentRpc(agent, data)
375 375 return true
376 376 end
377 377  
378   -function _M.loveItemRpc(agent, data)
379   - local role = agent.role
380   - local msg = MsgPack.unpack(data)
381   - local hero = role.heros[msg.heroId]
382   - if not hero then
383   - return
384   - end
385   - local curL = hero:getProperty("loveL")
386   - local curExp = hero:getProperty("loveExp")
387   - local curType = hero:getProperty("type")
388   - local curPlus = csvdb["unit_love_plusCsv"][curType]
389   - if not curPlus then
390   - return
391   - end
392   - if curL >= curPlus.limit then
393   - SendPacket(actionCodes.Hero_loveItemRpc, MsgPack.pack({errMsg = 1})) --已满级
394   - return true
395   - end
396   - local curEffect = csvdb["unit_love_effectCsv"][curL]
397   - if not curEffect then
398   - return
399   - end
400   - if curExp >= curEffect.loveValue and not msg.bBreak then
401   - SendPacket(actionCodes.Hero_loveItemRpc, MsgPack.pack({errMsg = 2})) --当前等级经验已满
402   - return true
403   - end
404   -
405   - if msg.bBreak then
406   - local cost = curEffect.cost:toArray(true, "=")
407   - if not role:checkItemEnough({[cost[1]] = cost[2]}) then
408   - SendPacket(actionCodes.Hero_loveItemRpc, MsgPack.pack({errMsg = 3, itemId = cost[1]})) --物品不足
409   - return true
410   - end
411   - role:costItems({[cost[1]] = cost[2]})
412   - local newLevel = curL + 1
413   - hero:updateProperty({field = "loveL", value = newLevel})
414   - hero:updateProperty({field = "loveExp", value = 0})
415   -
416   - if role:getProperty("loveStatus"):getv(curType, 0) < newLevel then
417   - role:changeUpdates({{type = "loveStatus", field = curType, value = newLevel}}) -- 总的
418   - end
419   -
420   - role:checkTaskEnter("LoveBreak", {heroType = curType, loveL = newLevel})
421   -
422   - else
423   - local delta = globalCsv.unit_love_presentValue[msg.itemId]
424   - if not delta then
425   - return
426   - end
427   - if not role:checkItemEnough({[msg.itemId] = 1}) then
428   - SendPacket(actionCodes.Hero_loveItemRpc, MsgPack.pack({errMsg = 3, itemId = msg.itemId}))
429   - return true
430   - end
431   - local newExp = curExp + delta
432   - if newExp > curEffect.loveValue then
433   - newExp = curEffect.loveValue
434   - end
435   - role:costItems({[msg.itemId] = 1})
436   - hero:updateProperty({field = "loveExp", value = newExp})
437   - end
438   - SendPacket(actionCodes.Hero_loveItemRpc, "")
439   - return true
440   -end
441   -
442   -function _M.loveTaskRpc(agent, data)
443   - local role = agent.role
444   - local msg = MsgPack.unpack(data)
445   - local hero = role.heros[msg.id]
446   - if not hero then return end
447   -
448   - local curL = hero:getProperty("loveL")
449   - local curExp = hero:getProperty("loveExp")
450   - local curType = hero:getProperty("type")
451   - local curPlus = csvdb["unit_love_plusCsv"][curType]
452   - if not curPlus or curL >= curPlus.limit then return end
453   -
454   - local curEffect = csvdb["unit_love_effectCsv"][curL]
455   - if not curEffect or curExp < curEffect.loveValue then return end
456   -
457   - local lastEffect = csvdb["unit_love_effectCsv"][curL + 1]
458   - local newExp = curExp - curEffect.loveValue
459   - if lastEffect and curL + 1 < curPlus.limit then
460   - if newExp >= lastEffect.loveValue then
461   - -- todo 发任务
462   - end
463   - else
464   - newExp = 0
465   - end
466   - local newLevel = curL + 1
467   - hero:updateProperty({field = "loveExp", value = newExp})
468   - hero:updateProperty({field = "loveL", value = newLevel})
469   -
470   - if role:getProperty("loveStatus"):getv(curType, 0) < newLevel then
471   - role:changeUpdates({{type = "loveStatus", field = curType, value = newLevel}}) -- 总的
472   - end
473   -
474   - role:checkTaskEnter("LoveBreak", {heroType = curType, loveL = newLevel})
475   -
476   - SendPacket(actionCodes.Hero_loveTaskRpc, "")
477   - return true
478   -end
  378 +-- function _M.loveItemRpc(agent, data)
  379 +-- local role = agent.role
  380 +-- local msg = MsgPack.unpack(data)
  381 +-- local hero = role.heros[msg.heroId]
  382 +-- if not hero then
  383 +-- return
  384 +-- end
  385 +-- local curL = hero:getProperty("loveL")
  386 +-- local curExp = hero:getProperty("loveExp")
  387 +-- local curType = hero:getProperty("type")
  388 +-- local curPlus = csvdb["unit_love_plusCsv"][curType]
  389 +-- if not curPlus then
  390 +-- return
  391 +-- end
  392 +-- if curL >= curPlus.limit then
  393 +-- SendPacket(actionCodes.Hero_loveItemRpc, MsgPack.pack({errMsg = 1})) --已满级
  394 +-- return true
  395 +-- end
  396 +-- local curEffect = csvdb["unit_love_effectCsv"][curL]
  397 +-- if not curEffect then
  398 +-- return
  399 +-- end
  400 +-- if curExp >= curEffect.loveValue and not msg.bBreak then
  401 +-- SendPacket(actionCodes.Hero_loveItemRpc, MsgPack.pack({errMsg = 2})) --当前等级经验已满
  402 +-- return true
  403 +-- end
  404 +
  405 +-- if msg.bBreak then
  406 +-- local cost = curEffect.cost:toArray(true, "=")
  407 +-- if not role:checkItemEnough({[cost[1]] = cost[2]}) then
  408 +-- SendPacket(actionCodes.Hero_loveItemRpc, MsgPack.pack({errMsg = 3, itemId = cost[1]})) --物品不足
  409 +-- return true
  410 +-- end
  411 +-- role:costItems({[cost[1]] = cost[2]})
  412 +-- local newLevel = curL + 1
  413 +-- hero:updateProperty({field = "loveL", value = newLevel})
  414 +-- hero:updateProperty({field = "loveExp", value = 0})
  415 +
  416 +-- if role:getProperty("loveStatus"):getv(curType, 0) < newLevel then
  417 +-- role:changeUpdates({{type = "loveStatus", field = curType, value = newLevel}}) -- 总的
  418 +-- end
  419 +
  420 +-- role:checkTaskEnter("LoveBreak", {heroType = curType, loveL = newLevel})
  421 +
  422 +-- else
  423 +-- local delta = globalCsv.unit_love_presentValue[msg.itemId]
  424 +-- if not delta then
  425 +-- return
  426 +-- end
  427 +-- if not role:checkItemEnough({[msg.itemId] = 1}) then
  428 +-- SendPacket(actionCodes.Hero_loveItemRpc, MsgPack.pack({errMsg = 3, itemId = msg.itemId}))
  429 +-- return true
  430 +-- end
  431 +-- local newExp = curExp + delta
  432 +-- if newExp > curEffect.loveValue then
  433 +-- newExp = curEffect.loveValue
  434 +-- end
  435 +-- role:costItems({[msg.itemId] = 1})
  436 +-- hero:updateProperty({field = "loveExp", value = newExp})
  437 +-- end
  438 +-- SendPacket(actionCodes.Hero_loveItemRpc, "")
  439 +-- return true
  440 +-- end
  441 +
  442 +-- function _M.loveTaskRpc(agent, data)
  443 +-- local role = agent.role
  444 +-- local msg = MsgPack.unpack(data)
  445 +-- local hero = role.heros[msg.id]
  446 +-- if not hero then return end
  447 +
  448 +-- local curL = hero:getProperty("loveL")
  449 +-- local curExp = hero:getProperty("loveExp")
  450 +-- local curType = hero:getProperty("type")
  451 +-- local curPlus = csvdb["unit_love_plusCsv"][curType]
  452 +-- if not curPlus or curL >= curPlus.limit then return end
  453 +
  454 +-- local curEffect = csvdb["unit_love_effectCsv"][curL]
  455 +-- if not curEffect or curExp < curEffect.loveValue then return end
  456 +
  457 +-- local lastEffect = csvdb["unit_love_effectCsv"][curL + 1]
  458 +-- local newExp = curExp - curEffect.loveValue
  459 +-- if lastEffect and curL + 1 < curPlus.limit then
  460 +-- if newExp >= lastEffect.loveValue then
  461 +-- -- todo 发任务
  462 +-- end
  463 +-- else
  464 +-- newExp = 0
  465 +-- end
  466 +-- local newLevel = curL + 1
  467 +-- hero:updateProperty({field = "loveExp", value = newExp})
  468 +-- hero:updateProperty({field = "loveL", value = newLevel})
  469 +
  470 +-- if role:getProperty("loveStatus"):getv(curType, 0) < newLevel then
  471 +-- role:changeUpdates({{type = "loveStatus", field = curType, value = newLevel}}) -- 总的
  472 +-- end
  473 +
  474 +-- role:checkTaskEnter("LoveBreak", {heroType = curType, loveL = newLevel})
  475 +
  476 +-- SendPacket(actionCodes.Hero_loveTaskRpc, "")
  477 +-- return true
  478 +-- end
479 479  
480 480 function _M.createHeroRpc(agent, data)
481 481 local role = agent.role
... ...
src/actions/RoleAction.lua
... ... @@ -365,9 +365,7 @@ function _M.changeIntroRpc(agent, data)
365 365 content = mod or ""
366 366 end
367 367  
368   - if content == "" then
369   - role:updateProperty({field = "intro", value = content})
370   - end
  368 + role:updateProperty({field = "intro", value = content})
371 369  
372 370 SendPacket(actionCodes.Role_changeIntroRpc, '')
373 371 return true
... ...
src/models/Hero.lua
... ... @@ -12,8 +12,8 @@ Hero.schema = {
12 12 skillL = {"string", ""}, -- 技能等级 1=1 2=1 3=1
13 13 talent = {"string", ""}, -- 0=阶段 1=1 2=1 3=1 4=1 四个天赋当前阶段的等级 阶段默认为1 等级默认为0
14 14 battleV = {"number", 0}, -- 保存战斗力
15   - loveExp = {"number", 0}, --好感度经验
16   - loveL = {"number", 0}, --好感度等级
  15 + -- loveExp = {"number", 0}, --好感度经验
  16 + -- loveL = {"number", 0}, --好感度等级
17 17 equip = {"string",""}, --装备 type=level
18 18 rune = {"string",""}, --零件 type=id
19 19 }
... ... @@ -78,8 +78,8 @@ function Hero:data()
78 78 skillL = self:getProperty("skillL"),
79 79 talent = self:getProperty("talent"),
80 80 battleV = self:getProperty("battleV"),
81   - loveExp = self:getProperty("loveExp"),
82   - loveL = self:getProperty("loveL"),
  81 + -- loveExp = self:getProperty("loveExp"),
  82 + -- loveL = self:getProperty("loveL"),
83 83 equip = self:getProperty("equip"),
84 84 rune = self:getProperty("rune"),
85 85 }
... ...
src/models/HeroPlugin.lua
... ... @@ -69,12 +69,12 @@ function HeroPlugin.bind(Hero)
69 69  
70 70 --好感度
71 71 local loveUp = {}
72   - for i = 0, self:getProperty("loveL") do
73   - local reward = csvdb["unit_love_effectCsv"][i]["reward"]
74   - for attrId, value in pairs(reward:toNumMap()) do
75   - loveUp[AttsEnumEx[attrId]] = (loveUp[AttsEnumEx[attrId]] or 0) + value
76   - end
77   - end
  72 + -- for i = 0, self:getProperty("loveL") do
  73 + -- local reward = csvdb["unit_love_effectCsv"][i]["reward"]
  74 + -- for attrId, value in pairs(reward:toNumMap()) do
  75 + -- loveUp[AttsEnumEx[attrId]] = (loveUp[AttsEnumEx[attrId]] or 0) + value
  76 + -- end
  77 + -- end
78 78  
79 79 --觉醒
80 80 local wData = csvdb["unit_wakeCsv"][wakeL]
... ...
src/models/Role.lua
... ... @@ -47,7 +47,7 @@ Role.schema = {
47 47 items = {"string", ""},
48 48 funcOpen = {"table", {}}, --功能是否开放
49 49 funcLv = {"table", {}}, --功能等级
50   - loveStatus = {"string", ""}, --统计角色的最高 好感度等级 类型相关 -- type=loveL type=loveL
  50 + -- loveStatus = {"string", ""}, --统计角色的最高 好感度等级 类型相关 -- type=loveL type=loveL
51 51 crown = {"number", 0}, -- 看伴娘
52 52 silent = {"number", 0}, --禁言解禁时间
53 53  
... ... @@ -165,10 +165,10 @@ end
165 165 -- 某些字段 更新改变量 改变量的定义由字段自身决定 {{type = ""}, }
166 166 function Role:changeUpdates(params, notNotify)
167 167 local changeUpdateFunc = {
168   - ["loveStatus"] = function(info)
169   - self:setProperty("loveStatus", self:getProperty("loveStatus"):setv(info["field"], info["value"]))
170   - return {type = "loveStatus", field = info["field"], value = info["value"]}
171   - end,
  168 + -- ["loveStatus"] = function(info)
  169 + -- self:setProperty("loveStatus", self:getProperty("loveStatus"):setv(info["field"], info["value"]))
  170 + -- return {type = "loveStatus", field = info["field"], value = info["value"]}
  171 + -- end,
172 172 --table 类型通用更新
173 173 ["tableCommon"] = function(fieldType, info)
174 174 if self.class.schema[fieldType][1] ~= "table" then
... ... @@ -225,7 +225,7 @@ function Role:data()
225 225 items = self:getProperty("items"):toNumMap(),
226 226 funcOpen = self:getProperty("funcOpen"),
227 227 funcLv = self:getProperty("funcLv"),
228   - loveStatus = self:getProperty("loveStatus"):toNumMap(),
  228 + -- loveStatus = self:getProperty("loveStatus"):toNumMap(),
229 229 diamond = self:getAllDiamond(),
230 230 bagLimit = self:getProperty("bagLimit"),
231 231 silent = self:getProperty("silent"),
... ...
src/models/RoleTask.lua
... ... @@ -231,11 +231,11 @@ function RoleTask.bind(Role)
231 231 end
232 232  
233 233 local function checkStoryStatusByLove(role, data, status, cond1) -- cond1 heroType
234   - if data.sort ~= cond1 then return end
235   - local curL = role:getProperty("loveStatus"):getv(cond1, 0)
236   - if curL < tonumber(data.unlockData) then return end
237   - status.s = 1
238   - return true
  234 + -- if data.sort ~= cond1 then return end
  235 + -- local curL = role:getProperty("loveStatus"):getv(cond1, 0)
  236 + -- if curL < tonumber(data.unlockData) then return end
  237 + -- status.s = 1
  238 + -- return true
239 239 end
240 240  
241 241 local function checkStoryStatusByMultStar(role, data, status, cond1, cond2) -- cond1 heroType, cond2 wakeL
... ...