更新
This commit is contained in:
parent
a0f50f9e99
commit
8f0b963cb9
@ -8,6 +8,7 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local Utils = require(ReplicatedStorage.Tools.Utils)
|
||||
local EquipmentJsonData = require(ReplicatedStorage.Json.Equipment)
|
||||
local ArchiveProxy = require(ReplicatedStorage.Modules.ArchiveProxy)
|
||||
local PlayerInfoProxy = require(ReplicatedStorage.Modules.PlayerInfoProxy)
|
||||
|
||||
--> Constants
|
||||
local STORE_NAME = "Equipment"
|
||||
@ -65,6 +66,7 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
|
||||
if not EquipmentData then return end
|
||||
|
||||
local UniqueId = Utils:GenUniqueId(ArchiveProxy.pData[Player.UserId])
|
||||
-- 配置表内容
|
||||
local ResultData = {}
|
||||
for key, value in pairs(EquipmentData) do
|
||||
if not table.find(EXCEPT_KEYS, key) then
|
||||
@ -76,10 +78,41 @@ function EquipmentProxy:AddEquipment(Player: Player, EquipmentId: number)
|
||||
ResultData.orgId = EquipmentId
|
||||
ResultData.wearing = false
|
||||
|
||||
-- 其他随机词条内容添加在下面
|
||||
-- 根据词条内容直接生成回收奖励
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
ArchiveProxy.pData[Player.UserId][UniqueId] = ResultData
|
||||
CreateEquipmentInstance(Player, UniqueId, ResultData)
|
||||
end
|
||||
|
||||
function EquipmentProxy:RecycleEquipment(Player: Player, EquipmentId: number)
|
||||
local pData = Utils:GetPlayerDataFolder(Player)
|
||||
if not pData then return end
|
||||
|
||||
local EquipmentData = Utils:GetJsonIdData("Equipment", EquipmentId)
|
||||
if not EquipmentData then return end
|
||||
|
||||
if not ArchiveProxy.pData[Player.UserId][EquipmentId] then return end
|
||||
|
||||
-- 回收装备返回金币
|
||||
-- 调用PlayerInfoProxy来增加货币
|
||||
|
||||
ArchiveProxy.pData[Player.UserId][EquipmentId] = nil
|
||||
local EquipmentInstance = GetPlayerEquipmentFolder(Player):FindFirstChild(EquipmentId)
|
||||
if EquipmentInstance then
|
||||
EquipmentInstance:Destroy()
|
||||
end
|
||||
end
|
||||
|
||||
function EquipmentProxy:WearEquipment(Player: Player, EquipmentId: number)
|
||||
local pData = Utils:GetPlayerDataFolder(Player)
|
||||
if not pData then return end
|
||||
|
||||
-- 穿戴装备时再生成模型
|
||||
|
||||
end
|
||||
|
||||
function EquipmentProxy:OnPlayerRemoving(Player: Player)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user