gx
This commit is contained in:
parent
fb53aa4305
commit
1e6404990e
BIN
excel/Rune.xlsx
BIN
excel/Rune.xlsx
Binary file not shown.
@ -78,13 +78,15 @@ function Behaviour:CheckClean()
|
||||
end
|
||||
end
|
||||
|
||||
function Behaviour:GetAttributeValue(AttributeName: string)
|
||||
function Behaviour:GetAttributeValue(AttributeName: string, IsOrgValue: boolean)
|
||||
local AttributeValue = self.Character.Instance:FindFirstChild("Attributes"):GetAttribute(AttributeName)
|
||||
if not AttributeValue then return nil end
|
||||
-- 处理对应的值
|
||||
local AttributeData = AttributesNameData[AttributeName]
|
||||
if not AttributeData then return nil end
|
||||
|
||||
if IsOrgValue then return AttributeValue end
|
||||
|
||||
local typeValue = AttributeData.type
|
||||
if typeValue == 1 then
|
||||
return AttributeValue
|
||||
|
@ -104,7 +104,7 @@ function Attack:Execute()
|
||||
task.wait(atkSpeed)
|
||||
|
||||
-- 暴击判定走通用属性
|
||||
local critCheckRate = self:GetAttributeValue("critRate") or 0
|
||||
local critCheckRate = self:GetAttributeValue("critDamageRate", true) or 0
|
||||
-- critCheckRate = 100
|
||||
local isCrit = Rng:RandomPercent(critCheckRate)
|
||||
local baseAttack = self.PlayerAI:GetBaseAttack()
|
||||
@ -156,6 +156,7 @@ function Attack:Execute()
|
||||
}, function(processedData)
|
||||
damageData = processedData.damageData
|
||||
end)
|
||||
-- print("damageData", damageData)
|
||||
DamageProxy:TakeDamage(self.Character, self.CheckData["ClosestCharacter"], damageData)
|
||||
|
||||
-- 发送攻击后事件
|
||||
|
@ -24,12 +24,12 @@ function RuneCritToAttackRate:Check(index: number, AttributesData: table, Behavi
|
||||
end
|
||||
|
||||
function RuneCritToAttackRate:OnExecute(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
local nowAttribute = AttributesData.critRate
|
||||
local nowAttribute = AttributesData.critDamageRate
|
||||
if not nowAttribute then return nil end
|
||||
|
||||
local addAttribute = math.floor(nowAttribute * 10)
|
||||
Utils:TableSafeAddValue(AttributesData, "attackRate", addAttribute)
|
||||
Utils:TableSafeSetValue(AttributesData, "critRate", 0)
|
||||
Utils:TableSafeSetValue(AttributesData, "critDamageRate", 0)
|
||||
return nil
|
||||
end
|
||||
|
||||
|
@ -19,10 +19,6 @@ function RuneNormalNoElement:Init(PlayerAI, Character: TypeList.Character)
|
||||
end
|
||||
|
||||
function RuneNormalNoElement:Check(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
return true
|
||||
end
|
||||
|
||||
function RuneNormalNoElement:OnExecute(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
local pDataFolder = ReplicatedStorage:FindFirstChild("PlayerData")
|
||||
if not pDataFolder then return nil end
|
||||
local pData = pDataFolder:FindFirstChild(self.PlayerAI.Player.UserId)
|
||||
@ -36,12 +32,18 @@ function RuneNormalNoElement:OnExecute(index: number, AttributesData: table, Beh
|
||||
local elementNumber = 0
|
||||
for _, equipment in equipmentList do
|
||||
local equipmentWearing = equipment:GetAttribute("wearing")
|
||||
if equipmentWearing > 0 and #equipment:FindFirstChild("Element"):GetAttributes() == 0 then
|
||||
if equipmentWearing > 0 and Utils:GetTableLength(equipment:FindFirstChild("elements"):GetAttributes()) == 0 then
|
||||
elementNumber = elementNumber + 1
|
||||
end
|
||||
end
|
||||
|
||||
local attackRate = math.floor((AttributesData.attackRate or 100) * elementNumber * 50 / 100)
|
||||
self.Data = elementNumber
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function RuneNormalNoElement:OnExecute(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
local attackRate = math.floor((100 + AttributesData.attackRate or 0) * (self.Data * 50 / 100))
|
||||
Utils:TableSafeAddValue(AttributesData, "attackRate", attackRate)
|
||||
|
||||
return nil
|
||||
|
@ -28,8 +28,8 @@ function RuneSacrifice:OnExecute(index: number, AttributesData: table, BehaviorN
|
||||
|
||||
local reduceHp = math.floor(hpAttribute * 0.25)
|
||||
|
||||
Utils:TableSafeAddValue(AttributesData, "attackRate", 50)
|
||||
Utils:TableSafeSetValue(AttributesData, "hp", RuneSacrifice - reduceHp)
|
||||
Utils:TableSafeAddValue(AttributesData, "attackRate", 100)
|
||||
Utils:TableSafeSetValue(AttributesData, "hp", hpAttribute - reduceHp)
|
||||
|
||||
return nil
|
||||
end
|
||||
|
@ -20,11 +20,7 @@ function RuneWearGenWeapon:Init(PlayerAI, Character: TypeList.Character)
|
||||
return self
|
||||
end
|
||||
|
||||
function RuneWearGenWeapon:Check(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
return true
|
||||
end
|
||||
|
||||
function RuneWearGenWeapon:OnExecute(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
function RuneWearGenWeapon:OnInitFinish()
|
||||
local pDataFolder = ReplicatedStorage:FindFirstChild("PlayerData")
|
||||
if not pDataFolder then return nil end
|
||||
local pData = pDataFolder:FindFirstChild(self.PlayerAI.Player.UserId)
|
||||
@ -52,6 +48,14 @@ function RuneWearGenWeapon:OnExecute(index: number, AttributesData: table, Behav
|
||||
end
|
||||
end
|
||||
|
||||
print("万能符文初始化完成")
|
||||
end
|
||||
|
||||
function RuneWearGenWeapon:Check(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
return false
|
||||
end
|
||||
|
||||
function RuneWearGenWeapon:OnExecute(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
return nil
|
||||
end
|
||||
|
||||
|
@ -51,7 +51,7 @@ function RuneWearHeavySword:OnExecute(index: number, AttributesData: table, Beha
|
||||
subTypeNumber = subTypeNumber + self.PlayerAI:GetSharedData(CheckShareName)
|
||||
end
|
||||
|
||||
local attackRate = math.floor((AttributesData.attackRate or 100) * subTypeNumber * 25 / 100)
|
||||
local attackRate = math.floor((100 + AttributesData.attackRate or 0) * (25 / 100))
|
||||
Utils:TableSafeAddValue(AttributesData, "attackRate", attackRate)
|
||||
|
||||
return nil
|
||||
|
@ -51,7 +51,7 @@ function RuneWearKnife:OnExecute(index: number, AttributesData: table, BehaviorN
|
||||
subTypeNumber = subTypeNumber + self.PlayerAI:GetSharedData(CheckShareName)
|
||||
end
|
||||
|
||||
local attackRate = math.floor(subTypeNumber * 25)
|
||||
local attackRate = math.floor((100 + AttributesData.attackRate or 0) * (25 / 100))
|
||||
Utils:TableSafeAddValue(AttributesData, "attackRate", attackRate)
|
||||
|
||||
return nil
|
||||
|
@ -20,10 +20,6 @@ function RuneWearSingleRuneSlot:Init(PlayerAI, Character: TypeList.Character)
|
||||
end
|
||||
|
||||
function RuneWearSingleRuneSlot:Check(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
return true
|
||||
end
|
||||
|
||||
function RuneWearSingleRuneSlot:OnExecute(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
local pDataFolder = ReplicatedStorage:FindFirstChild("PlayerData")
|
||||
if not pDataFolder then return nil end
|
||||
local pData = pDataFolder:FindFirstChild(self.PlayerAI.Player.UserId)
|
||||
@ -37,15 +33,22 @@ function RuneWearSingleRuneSlot:OnExecute(index: number, AttributesData: table,
|
||||
local singleRuneSlotNumber = 0
|
||||
for _, equipment in equipmentList do
|
||||
local equipmentMaxRuneNumber = equipment:GetAttribute("maxRuneNumber")
|
||||
if equipmentMaxRuneNumber == 1 then
|
||||
local wearingEquipment = equipment:GetAttribute("wearing")
|
||||
if equipmentMaxRuneNumber == 1 and wearingEquipment > 0 then
|
||||
singleRuneSlotNumber = singleRuneSlotNumber + 1
|
||||
end
|
||||
end
|
||||
|
||||
local baseAttribute = AttributesData.attackRate or 100
|
||||
local addAttribute = baseAttribute * (math.floor(singleRuneSlotNumber * 25) / 100)
|
||||
Utils:TableSafeSetValue(AttributesData, "attackRate", addAttribute)
|
||||
self.Data = singleRuneSlotNumber
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function RuneWearSingleRuneSlot:OnExecute(index: number, AttributesData: table, BehaviorNameList: table)
|
||||
print("before", AttributesData.attackRate, self.Data)
|
||||
local attackRate = math.floor((100 + AttributesData.attackRate or 0) * (self.Data * 150 / 100))
|
||||
Utils:TableSafeAddValue(AttributesData, "attackRate", attackRate)
|
||||
print("after", AttributesData.attackRate)
|
||||
return nil
|
||||
end
|
||||
|
||||
|
@ -51,7 +51,7 @@ function RuneWearStick:OnExecute(index: number, AttributesData: table, BehaviorN
|
||||
subTypeNumber = subTypeNumber + self.PlayerAI:GetSharedData(CheckShareName)
|
||||
end
|
||||
|
||||
local attackRate = math.floor((AttributesData.attackRate or 100) * subTypeNumber * 25 / 100)
|
||||
local attackRate = math.floor((100 + AttributesData.attackRate or 0) * (25 / 100))
|
||||
Utils:TableSafeAddValue(AttributesData, "attackRate", attackRate)
|
||||
|
||||
return nil
|
||||
|
@ -51,7 +51,7 @@ function RuneWearSword:OnExecute(index: number, AttributesData: table, BehaviorN
|
||||
subTypeNumber = subTypeNumber + self.PlayerAI:GetSharedData(CheckShareName)
|
||||
end
|
||||
|
||||
local attackRate = math.floor((AttributesData.attackRate or 100) * subTypeNumber * 25 / 100)
|
||||
local attackRate = math.floor((100 + AttributesData.attackRate or 0) * (25 / 100))
|
||||
Utils:TableSafeAddValue(AttributesData, "attackRate", attackRate)
|
||||
|
||||
return nil
|
||||
|
@ -28,7 +28,10 @@ UserInputService.InputBegan:Connect(function(input, gameProcessed)
|
||||
-- RE_PlayerHelper:FireServer("AddItem", {60000, 1})
|
||||
-- RE_PlayerHelper:FireServer("AddItem", {61000, 1})
|
||||
-- RE_PlayerHelper:FireServer("AddItem", {62000, 1})
|
||||
RE_PlayerHelper:FireServer("AddItem", {60023, 1})
|
||||
RE_PlayerHelper:FireServer("AddItem", {60005, 1})
|
||||
RE_PlayerHelper:FireServer("AddItem", {60006, 1})
|
||||
RE_PlayerHelper:FireServer("AddItem", {60007, 1})
|
||||
RE_PlayerHelper:FireServer("AddItem", {60008, 1})
|
||||
elseif input.KeyCode == Enum.KeyCode.L then
|
||||
-- RE_UpgradeAttributes:FireServer(2)
|
||||
for k, v in JsonRune do
|
||||
|
Loading…
x
Reference in New Issue
Block a user