diff --git a/Mirserver/Mir200/Envir/QuestDiary/cfgcsv/cfg_斗笠升级.lua b/Mirserver/Mir200/Envir/QuestDiary/cfgcsv/cfg_斗笠升级.lua new file mode 100644 index 00000000..3e99f6dc --- /dev/null +++ b/Mirserver/Mir200/Envir/QuestDiary/cfgcsv/cfg_斗笠升级.lua @@ -0,0 +1,188 @@ +-- cfg_ +local config = { + [1] = { + name = "ս", + success = 100, + cost = { + [1] = { + itemname = "", + itemnum = 1, + itembind = 0, + }, + [2] = { + itemname = "", + itemnum = 500000, + itembind = 1, + }, + }, + reward = { + [1] = { + givename = "ս", + givenum = 1, + bind = 0, + }, + }, + }, + [2] = { + name = "귨", + success = 100, + cost = { + [1] = { + itemname = "ս", + itemnum = 1, + itembind = 0, + }, + [2] = { + itemname = "", + itemnum = 1, + itembind = 0, + }, + }, + reward = { + [1] = { + givename = "귨", + givenum = 1, + bind = 0, + }, + }, + }, + [3] = { + name = "ʷʫ", + success = 100, + cost = { + [1] = { + itemname = "귨", + itemnum = 1, + itembind = 0, + }, + [2] = { + itemname = "", + itemnum = 3, + itembind = 0, + }, + }, + reward = { + [1] = { + givename = "ʷʫ", + givenum = 1, + bind = 0, + }, + }, + }, + [4] = { + name = "˵", + success = 100, + cost = { + [1] = { + itemname = "ʷʫ", + itemnum = 1, + itembind = 0, + }, + [2] = { + itemname = "", + itemnum = 6, + itembind = 0, + }, + }, + reward = { + [1] = { + givename = "˵", + givenum = 1, + bind = 0, + }, + }, + }, + [5] = { + name = "භ", + success = 100, + cost = { + [1] = { + itemname = "˵", + itemnum = 1, + itembind = 0, + }, + [2] = { + itemname = "", + itemnum = 15, + itembind = 0, + }, + }, + reward = { + [1] = { + givename = "භ", + givenum = 1, + bind = 0, + }, + }, + }, + [6] = { + name = "", + success = 100, + cost = { + [1] = { + itemname = "භ", + itemnum = 1, + itembind = 0, + }, + [2] = { + itemname = "", + itemnum = 50, + itembind = 0, + }, + }, + reward = { + [1] = { + givename = "", + givenum = 1, + bind = 0, + }, + }, + }, + [7] = { + name = "綷", + success = 100, + cost = { + [1] = { + itemname = "", + itemnum = 1, + itembind = 0, + }, + [2] = { + itemname = "", + itemnum = 100, + itembind = 0, + }, + }, + reward = { + [1] = { + givename = "綷", + givenum = 1, + bind = 0, + }, + }, + }, + [8] = { + name = "׶", + success = 100, + cost = { + [1] = { + itemname = "綷", + itemnum = 1, + itembind = 0, + }, + [2] = { + itemname = "", + itemnum = 200, + itembind = 0, + }, + }, + reward = { + [1] = { + givename = "׶", + givenum = 1, + bind = 0, + }, + }, + }, +} +return config diff --git a/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A2_二大陆/斗笠升级.lua b/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A2_二大陆/斗笠升级.lua new file mode 100644 index 00000000..64a580eb --- /dev/null +++ b/Mirserver/Mir200/Envir/QuestDiary/游戏功能/A2_二大陆/斗笠升级.lua @@ -0,0 +1,45 @@ +DouLiShengJiOBJ = Up_BaseClass:new() + +DouLiShengJiOBJ._name = "DouLiShengJiOBJ" +DouLiShengJiOBJ.id = { 53 } + +for _, v in ipairs(DouLiShengJiOBJ.id or {}) do + Npc.clicknpcCfg[v] = DouLiShengJiOBJ +end + +DouLiShengJiOBJ.cfg = Func.require("cfg_") +Player.sycCfg[DouLiShengJiOBJ._name] = DouLiShengJiOBJ.cfg + +DouLiShengJiOBJ.allowFunc = { "up" } + +function DouLiShengJiOBJ:main(actor, npcID) + Message:SubLink(actor, self._name .. "_main", { cfg = self.cfg, npcid = npcID }) +end + +function DouLiShengJiOBJ:up(actor, p1, p2, p3, data) + local id = data and tonumber(data[1]) or nil + if not id or not self.cfg[id] then + return + end + + local cfg = table.Copy(self.cfg[id]) + local cost = {} + for _, v in ipairs(cfg.cost or {}) do + table.insert(cost, { v.itemname, v.itemnum, v.itembind }) + end + + if Func.batchcheckitem(actor, cost, true, true) then + if Func.random(cfg.success or 0) then + local gives_tbl = {} + for _, v in ipairs(cfg.reward or {}) do + table.insert(gives_tbl, string.format("%s#%d#%d", v.givename, v.givenum, v.bind)) + end + gives(actor, table.concat(gives_tbl, "&")) + Func.sendmsg9(actor, "[ʾ]:#70|ɹ") + else + Func.sendmsg9(actor, "[ʾ]:#70|ʧܣ³ԣ") + end + end +end + +return DouLiShengJiOBJ \ No newline at end of file diff --git a/client/dev/GUIExport/game/B/DouLiShengJiUI.lua b/client/dev/GUIExport/game/B/DouLiShengJiUI.lua new file mode 100644 index 00000000..51a13a0b --- /dev/null +++ b/client/dev/GUIExport/game/B/DouLiShengJiUI.lua @@ -0,0 +1,105 @@ +local ui = {} +local _V = function(...) return SL:GetMetaValue(...) end +local FUNCQUEUE = {} +local TAGOBJ = {} + +function ui.init(parent, __data__, __update__) + if __update__ then return ui.update(__data__) end + -- Create Layer + local Layer = GUI:Node_Create(parent, "Layer", 0, 0) + GUI:setTag(Layer, -1) + + -- Create bg_close + local bg_close = GUI:Layout_Create(Layer, "bg_close", 0, 0, 1136, 640, false) + GUI:Layout_setBackGroundColorType(bg_close, 1) + GUI:Layout_setBackGroundColor(bg_close, "#000000") + GUI:Layout_setBackGroundColorOpacity(bg_close, 0) + GUI:setAnchorPoint(bg_close, 0.00, 0.00) + GUI:setTouchEnabled(bg_close, true) + GUI:setTag(bg_close, -1) + + -- Create nd_root + local nd_root = GUI:Node_Create(Layer, "nd_root", 568, 320) + GUI:setTag(nd_root, 670) + TAGOBJ["670"] = nd_root + + -- Create img_bg + local img_bg = GUI:Image_Create(nd_root, "img_bg", 0, 0, "res/custom/44/bg.png") + GUI:setChineseName(img_bg, "斗笠升级_背景图片") + GUI:setAnchorPoint(img_bg, 0.50, 0.50) + GUI:setTouchEnabled(img_bg, true) + GUI:setTag(img_bg, -1) + + -- Create btn_close + local btn_close = GUI:Button_Create(img_bg, "btn_close", 769, 448, "res/public/1900000510.png") + GUI:Button_loadTexturePressed(btn_close, "res/public/1900000511.png") + GUI:setContentSize(btn_close, 26, 42) + GUI:setIgnoreContentAdaptWithSize(btn_close, false) + GUI:Button_setTitleText(btn_close, [[]]) + GUI:Button_setTitleColor(btn_close, "#ffffff") + GUI:Button_setTitleFontSize(btn_close, 14) + GUI:Button_titleDisableOutLine(btn_close) + GUI:setAnchorPoint(btn_close, 0.00, 0.00) + GUI:setTouchEnabled(btn_close, true) + GUI:setTag(btn_close, -1) + + -- Create btn_ListView + local btn_ListView = GUI:ListView_Create(img_bg, "btn_ListView", 51, 34, 193, 417, 1) + GUI:setAnchorPoint(btn_ListView, 0.00, 0.00) + GUI:setTouchEnabled(btn_ListView, true) + GUI:setTag(btn_ListView, 0) + + -- Create Button_1 + local Button_1 = GUI:Button_Create(btn_ListView, "Button_1", 0, 368, "res/custom/44/btn/1.png") + GUI:Button_setTitleText(Button_1, [[]]) + GUI:Button_setTitleColor(Button_1, "#ffffff") + GUI:Button_setTitleFontSize(Button_1, 16) + GUI:Button_titleEnableOutline(Button_1, "#000000", 1) + GUI:setAnchorPoint(Button_1, 0.00, 0.00) + GUI:setTouchEnabled(Button_1, true) + GUI:setTag(Button_1, 0) + + -- Create ItemShow + local ItemShow = GUI:ItemShow_Create(img_bg, "ItemShow", 500, 303, {index = 1, count = 1, look = true, bgVisible = false, color = 255}) + GUI:setAnchorPoint(ItemShow, 0.50, 0.50) + GUI:setTag(ItemShow, 0) + ItemShow["object_config"] = {" "} + + -- Create Text_success + local Text_success = GUI:Text_Create(img_bg, "Text_success", 498, 110, 16, "#00ff00", [[成功率:80%]]) + GUI:Text_enableOutline(Text_success, "#000000", 1) + GUI:setAnchorPoint(Text_success, 0.50, 0.50) + GUI:setTouchEnabled(Text_success, false) + GUI:setTag(Text_success, 0) + + -- Create up_btn + local up_btn = GUI:Button_Create(img_bg, "up_btn", 433, 41, "res/custom/44/2.png") + GUI:Button_setTitleText(up_btn, [[]]) + GUI:Button_setTitleColor(up_btn, "#ffffff") + GUI:Button_setTitleFontSize(up_btn, 16) + GUI:Button_titleEnableOutline(up_btn, "#000000", 1) + GUI:setAnchorPoint(up_btn, 0.00, 0.00) + GUI:setTouchEnabled(up_btn, true) + GUI:setTag(up_btn, 0) + + -- Create cost_ItemShow_1 + local cost_ItemShow_1 = GUI:ItemShow_Create(img_bg, "cost_ItemShow_1", 399, 209, {index = 1, count = 1, look = true, bgVisible = false, color = 255}) + GUI:setAnchorPoint(cost_ItemShow_1, 0.50, 0.50) + GUI:setTag(cost_ItemShow_1, 0) + + -- Create cost_ItemShow_2 + local cost_ItemShow_2 = GUI:ItemShow_Create(img_bg, "cost_ItemShow_2", 600, 209, {index = 1, count = 1, look = true, bgVisible = false, color = 255}) + GUI:setAnchorPoint(cost_ItemShow_2, 0.50, 0.50) + GUI:setTag(cost_ItemShow_2, 0) + + ui.update(__data__) + return Layer +end + +function ui.update(data) + for _, func in pairs(FUNCQUEUE) do + if func then func(data) end + end +end + +return ui diff --git a/client/dev/GUILayout/game/B/DouLiShengJiOBJ.lua b/client/dev/GUILayout/game/B/DouLiShengJiOBJ.lua new file mode 100644 index 00000000..97ca8535 --- /dev/null +++ b/client/dev/GUILayout/game/B/DouLiShengJiOBJ.lua @@ -0,0 +1,100 @@ +DouLiShengJiOBJ = Up_BaseClassOBJ:new() + +DouLiShengJiOBJ.__cname = "DouLiShengJiOBJ" +DouLiShengJiOBJ.cfg = {} +DouLiShengJiOBJ.UIfile = "game/B/DouLiShengJiUI" +DouLiShengJiOBJ.leftNum = 8 +DouLiShengJiOBJ.id = 1 + +function DouLiShengJiOBJ:updata() + self.id = self.id or 1 + local listview = self.ui.btn_ListView + local imgDir = "res/custom/44/btn/" + GUI:ListView_removeAllItems(listview) + + for i = 1, self.leftNum do + local btnKey = string.format("list_btn_%d", i) + local isSelected = (self.id == i) + self.ui[btnKey] = GUI:Button_Create(listview, btnKey, 0, 0, + string.format("%s%s.png", imgDir, isSelected and tostring(i) or (i .. "a"))) + GUI:addOnClickEvent(self.ui[btnKey], function() + if self.id == i then return end + local oldId = self.id + self.id = i + GUI:Button_loadTextures(self.ui[string.format("list_btn_%d", oldId)], + string.format("%s%s.png", imgDir, oldId .. "a"), "", "", 0) + GUI:Button_loadTextures(self.ui[btnKey], + string.format("%s%s.png", imgDir, tostring(i)), "", "", 0) + self:init() + end) + end + + self:init() +end + +function DouLiShengJiOBJ:init() + local cfg = self.cfg[self.id] + if not cfg then + return + end + + if GUI:Win_IsNotNull(self.ui.ItemShow) then + GUI:removeFromParent(self.ui.ItemShow) + end + + self.ui.ItemShow = GUI:ItemShow_Create(self.ui.img_bg, "ItemShow", 500, 304, + { index = SL:GetMetaValue("ITEM_INDEX_BY_NAME", cfg.name), count = 1, look = true, bgVisible = false, color = 255 }) + GUI:setAnchorPoint(self.ui.ItemShow, 0.50, 0.50) + + for i = 1, 2 do + local costItem = self.ui[string.format("cost_ItemShow_%d", i)] + local costCfg = cfg.cost and cfg.cost[i] + if GUI:Win_IsNotNull(costItem) then + if costCfg then + GUI:ItemShow_updateItem(costItem, { + index = SL:GetMetaValue("ITEM_INDEX_BY_NAME", costCfg.itemname), + count = costCfg.itemnum, + look = true, + bgVisible = false, + color = 255 + }) + GUI:setVisible(costItem, true) + else + GUI:setVisible(costItem, false) + end + end + end + + GUI:Text_setString(self.ui.Text_success, string.format("成功率:%d%%", cfg.success or 0)) + GUI:addOnClickEvent(self.ui.up_btn, function() + ssrMessage:SubLink(string.format("%s_%s", self.__cname, "up"), self.id) + end) +end + +function DouLiShengJiOBJ:EventBind() + local function DouLiShengJiOBJ_EQUIP_CHANGE(data) + if GUI:Win_IsNotNull(self._parent) then + if data.Where == 13 then + self:updata() + end + end + end + SL:RegisterLUAEvent(LUA_EVENT_PLAYER_EQUIP_CHANGE, self.__cname, DouLiShengJiOBJ_EQUIP_CHANGE) + + SL:RegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname, function(widgetName) + self:OnClose(widgetName) + end) +end + +function DouLiShengJiOBJ:OnClose(widgetName) + if widgetName == self.__cname then + self:UnRegisterEvent() + end +end + +function DouLiShengJiOBJ:UnRegisterEvent() + SL:UnRegisterLUAEvent(LUA_EVENT_PLAYER_EQUIP_CHANGE, self.__cname) + SL:UnRegisterLUAEvent(LUA_EVENT_CLOSEWIN, self.__cname) +end + +return DouLiShengJiOBJ diff --git a/client/dev/res/custom/44/2.png b/client/dev/res/custom/44/2.png new file mode 100644 index 00000000..35ab036a Binary files /dev/null and b/client/dev/res/custom/44/2.png differ diff --git a/client/dev/res/custom/44/bg.png b/client/dev/res/custom/44/bg.png new file mode 100644 index 00000000..d121d20d Binary files /dev/null and b/client/dev/res/custom/44/bg.png differ diff --git a/client/dev/res/custom/44/btn/1.png b/client/dev/res/custom/44/btn/1.png new file mode 100644 index 00000000..3bb11a87 Binary files /dev/null and b/client/dev/res/custom/44/btn/1.png differ diff --git a/client/dev/res/custom/44/btn/1a.png b/client/dev/res/custom/44/btn/1a.png new file mode 100644 index 00000000..bcd4b892 Binary files /dev/null and b/client/dev/res/custom/44/btn/1a.png differ diff --git a/client/dev/res/custom/44/btn/2.png b/client/dev/res/custom/44/btn/2.png new file mode 100644 index 00000000..1d849234 Binary files /dev/null and b/client/dev/res/custom/44/btn/2.png differ diff --git a/client/dev/res/custom/44/btn/2a.png b/client/dev/res/custom/44/btn/2a.png new file mode 100644 index 00000000..e60199c7 Binary files /dev/null and b/client/dev/res/custom/44/btn/2a.png differ diff --git a/client/dev/res/custom/44/btn/3.png b/client/dev/res/custom/44/btn/3.png new file mode 100644 index 00000000..c5207da0 Binary files /dev/null and b/client/dev/res/custom/44/btn/3.png differ diff --git a/client/dev/res/custom/44/btn/3a.png b/client/dev/res/custom/44/btn/3a.png new file mode 100644 index 00000000..e2d30db8 Binary files /dev/null and b/client/dev/res/custom/44/btn/3a.png differ diff --git a/client/dev/res/custom/44/btn/4.png b/client/dev/res/custom/44/btn/4.png new file mode 100644 index 00000000..a83aec24 Binary files /dev/null and b/client/dev/res/custom/44/btn/4.png differ diff --git a/client/dev/res/custom/44/btn/4a.png b/client/dev/res/custom/44/btn/4a.png new file mode 100644 index 00000000..9149ac19 Binary files /dev/null and b/client/dev/res/custom/44/btn/4a.png differ diff --git a/client/dev/res/custom/44/btn/5.png b/client/dev/res/custom/44/btn/5.png new file mode 100644 index 00000000..f302fb9b Binary files /dev/null and b/client/dev/res/custom/44/btn/5.png differ diff --git a/client/dev/res/custom/44/btn/5a.png b/client/dev/res/custom/44/btn/5a.png new file mode 100644 index 00000000..381deee6 Binary files /dev/null and b/client/dev/res/custom/44/btn/5a.png differ diff --git a/client/dev/res/custom/44/btn/6.png b/client/dev/res/custom/44/btn/6.png new file mode 100644 index 00000000..96102d2e Binary files /dev/null and b/client/dev/res/custom/44/btn/6.png differ diff --git a/client/dev/res/custom/44/btn/6a.png b/client/dev/res/custom/44/btn/6a.png new file mode 100644 index 00000000..5ce7fb11 Binary files /dev/null and b/client/dev/res/custom/44/btn/6a.png differ diff --git a/client/dev/res/custom/44/btn/7.png b/client/dev/res/custom/44/btn/7.png new file mode 100644 index 00000000..edfcebf7 Binary files /dev/null and b/client/dev/res/custom/44/btn/7.png differ diff --git a/client/dev/res/custom/44/btn/7a.png b/client/dev/res/custom/44/btn/7a.png new file mode 100644 index 00000000..ae75671d Binary files /dev/null and b/client/dev/res/custom/44/btn/7a.png differ diff --git a/client/dev/res/custom/44/btn/8.png b/client/dev/res/custom/44/btn/8.png new file mode 100644 index 00000000..997e041b Binary files /dev/null and b/client/dev/res/custom/44/btn/8.png differ diff --git a/client/dev/res/custom/44/btn/8a.png b/client/dev/res/custom/44/btn/8a.png new file mode 100644 index 00000000..94d79da0 Binary files /dev/null and b/client/dev/res/custom/44/btn/8a.png differ diff --git a/client/dev/res/custom/44/psd/bg.psd b/client/dev/res/custom/44/psd/bg.psd new file mode 100644 index 00000000..f0a4c991 Binary files /dev/null and b/client/dev/res/custom/44/psd/bg.psd differ diff --git a/client/dev/res/custom/44/psd/btn_1.png b/client/dev/res/custom/44/psd/btn_1.png new file mode 100644 index 00000000..e02291ee Binary files /dev/null and b/client/dev/res/custom/44/psd/btn_1.png differ diff --git a/client/dev/res/custom/44/psd/btn_1.psd b/client/dev/res/custom/44/psd/btn_1.psd new file mode 100644 index 00000000..2b78f16b Binary files /dev/null and b/client/dev/res/custom/44/psd/btn_1.psd differ diff --git a/client/dev/res/custom/44/psd/btn_a.png b/client/dev/res/custom/44/psd/btn_a.png new file mode 100644 index 00000000..e6637af2 Binary files /dev/null and b/client/dev/res/custom/44/psd/btn_a.png differ diff --git a/client/dev/res/custom/44/psd/btn_a.psd b/client/dev/res/custom/44/psd/btn_a.psd new file mode 100644 index 00000000..212cf7ad Binary files /dev/null and b/client/dev/res/custom/44/psd/btn_a.psd differ diff --git a/csv/cfg_斗笠升级.csv b/csv/cfg_斗笠升级.csv new file mode 100644 index 00000000..d2333e4d --- /dev/null +++ b/csv/cfg_斗笠升级.csv @@ -0,0 +1,10 @@ +,װ,ɹ,_1_Ʒ,_1_,_1_󶨹,_2_Ʒ,_2_,_2_󶨹,_1_Ʒ,_1_,_1_󶨹 +,name,success,cost_1_itemname,cost_1_itemnum,cost_1_itembind,cost_2_itemname,cost_2_itemnum,cost_2_itembind,reward_1_givename,reward_1_givenum,reward_1_bind +1,ս,100,,1,0,,500000,1,ս,1,0 +2,귨,100,ս,1,0,,1,0,귨,1,0 +3,ʷʫ,100,귨,1,0,,3,0,ʷʫ,1,0 +4,˵,100,ʷʫ,1,0,,6,0,˵,1,0 +5,භ,100,˵,1,0,,15,0,භ,1,0 +6,,100,භ,1,0,,50,0,,1,0 +7,綷,100,,1,0,,100,0,綷,1,0 +8,׶,100,綷,1,0,,200,0,׶,1,0