战斗修改

onepiece_demo_arena
xiejun 2023-12-13 11:19:32 +08:00
parent b58cb3518f
commit 787aeaca12
5 changed files with 1545 additions and 1060 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1061,6 +1061,12 @@ function this.GetSkillCombat(id)
AttackDisplaceoffset=combat.AttackDisplaceoffset,
CloseRangeHitOffset=combat.CloseRangeHitOffset,
CloseRangeHitScale=combat.CloseRangeHitScale,
ShankTime=combat.ShankTime,
HightLightTime=combat.HightLightTime,
AttackMove=combat.AttackMove,
HitScale=combat.HitScale,
}
end
return _CombatList[id]
@ -1225,7 +1231,7 @@ function this.LoadAsset(path, battleSorting)
end
--
local go = poolManager:LoadAsset(path, PoolManager.AssetType.GameObject)
LogError("path================"..path)
-- LogError("path================"..path)
UIManager.DoLanguageCheck(this.spLoader, go)
local layer = tonumber(go.name) or 0
battleSorting = battleSorting or BattleManager.GetBattleSorting()
@ -1235,11 +1241,11 @@ function this.LoadAsset(path, battleSorting)
end
function this.LoadSpineAsset(path, parent)
--- 播放音效
local audioData = FEAConfig.GetAudioData(path)
if audioData then
SoundManager.PlaySound(audioData.name)
end
--
-- local audioData = FEAConfig.GetAudioData(path)
-- if audioData then
-- SoundManager.PlaySound(audioData.name)
-- end
-- --
local go = poolManager:LoadLive(path, parent, Vector3.one, Vector3.zero)
return go

View File

@ -91,7 +91,7 @@ function EnemyView:onCreate(go, role, position, root, isBoss,enemyId)
self.liveRoot = Util.GetGameObject(self.RootPanel.EnemyPanel, "live_"..position)
self.liveRoot:GetComponent("Canvas").overrideSorting = true
--
self.SingleHitEffectRoot=Util.GetGameObject(self.liveRoot, "SingleHitEffectRoot")
self.RoleLiveGO = poolManager:LoadLive(self.livePath, go.transform.parent, Vector3.one, Vector3.zero)
self.RoleLiveGOGraphic = self.RoleLiveGO:GetComponent("SkeletonGraphic")
self.RoleLiveGOTran = self.RoleLiveGO:GetComponent("RectTransform")
@ -101,6 +101,7 @@ function EnemyView:onCreate(go, role, position, root, isBoss,enemyId)
self.RoleLiveGO:GetComponent("RectTransform").anchoredPosition = Vector2.New(self.outOffset[1], self.outOffset[2])-- * 0.5
self.RoleLiveGO.transform.localScale = Vector3.one * self.enemy_liveScale --* 0.75
self.RoleLiveGO:SetActive(true)
self.startPos=self.RoleLiveGO.transform.position
-- Log("IsBoss: "..tostring(self.isBoss))
if self.isBoss then
self.RoleLiveGO.transform.localScale = self.RoleLiveGO.transform.localScale * 1.5 -- boss 放大1.5倍
@ -611,6 +612,7 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType,
self:OnceDamaged(atkRole, fd, bCrit, finalDmg, damageType, dotType, skill)
-- 被伤害卡牌表现
self:DOHitEffect(continue)
self:DOHitMoveMent(continue,combat)
end)
end
end
@ -630,6 +632,7 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType,
self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill)
-- 被伤害卡牌表现
self:DOHitEffect()
self:DOHitMoveMent(nil,combat)
end)
end
@ -643,6 +646,7 @@ function EnemyView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType,
self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill)
-- 被伤害卡牌表现
self:DOHitEffect()
-- self:DOHitMoveMent(nil,combat)
end
end
--
@ -710,8 +714,21 @@ function EnemyView:DOHitEffect(time, func)
end
end
-- 播放卡牌受击位移
function EnemyView:DOHitMoveMent(time,combat,isback)
-- 时间修正
if not combat.AttackMove then
return
end
if not time or time < 0.05 then
time = 0.2
end
local target=Vector3.New(self.camp==0 and self.startPos.x-combat.AttackMove[1]/1000 or self.startPos.x+combat.AttackMove[1]/1000,self.startPos.y+combat.AttackMove[2] ,100)
self.RoleLiveGO.transform:DOMove(target, time, false):OnComplete(function ()
self.RoleLiveGO.transform:DOMove(self.startPos, time, false)
end)
end
function EnemyView:OnHealed(castRole)
local sortingOrder = nil
local go = BattleManager.LoadAsset(healEffect, sortingOrder)

View File

@ -47,7 +47,7 @@ function PlayerView:onCreate(go, role, position, root)
self.weaponObj=Util.GetGameObject(go, "weapon")
self.weaponImg=Util.GetGameObject(go, "weapon/Image"):GetComponent("Image")
self.weaponObj:SetActive(false)
-- 身外化身引导立绘展示处理
@ -136,9 +136,10 @@ function PlayerView:onCreate(go, role, position, root)
-- zs:GetComponent("Image").sprite = self.spLoader:LoadSprite(zsName)
-- end
-- 阴影
self.liveRoot = Util.GetGameObject(self.RootPanel.PlayerPanel, "live_"..position)
self.liveRoot:GetComponent("Canvas").overrideSorting = true
self.SingleHitEffectRoot=Util.GetGameObject(self.liveRoot, "SingleHitEffectRoot")
self.shadow = Util.GetGameObject(self.liveRoot, "shadow")
self.shadow:SetActive(true)
self.RoleLiveGO = poolManager:LoadLive(self.livePath, go.transform.parent, Vector3.one, Vector3.zero)
@ -151,6 +152,8 @@ function PlayerView:onCreate(go, role, position, root)
-- local t= self.RoleLiveGOGraphic.SkeletonData.animations
self.RoleLiveGOGraphic.AnimationState:SetAnimation(0, "idle", true)
self.RoleLiveGO:SetActive(true)
self.startPos=self.RoleLiveGO.transform.position
LogError("self.roleId==========================="..self.roleId)
local combatId = BattleManager.GetCombatIdBySkin(self.role.skill[1],self.skinId)
self.combat = BattleManager.GetSkillCombat(combatId)
@ -715,6 +718,7 @@ function PlayerView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType
self:OnceDamaged(atkRole, fd, bCrit, finalDmg, damageType, dotType, skill)
-- 被伤害卡牌表现
self:DOHitEffect(continue)
self:DOHitMoveMent(continue,combat)
end)
end
end
@ -734,6 +738,7 @@ function PlayerView:OnDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType
self:OnceDamaged(atkRole, dmg, bCrit, finalDmg, damageType, dotType, skill)
-- 被伤害卡牌表现
self:DOHitEffect()
self:DOHitMoveMent(nil,combat)
end)
end
@ -828,7 +833,22 @@ function PlayerView:DOHitEffect(time, func)
end
-- 播放卡牌受击位移
function PlayerView:DOHitMoveMent(time,combat,isback)
-- 时间修正
if not combat.AttackMove then
return
end
if not time or time < 0.05 then
time = 0.2
end
local target=Vector3.New(self.camp==0 and self.startPos.x-combat.AttackMove[1]/1000 or self.startPos.x+combat.AttackMove[1]/1000,self.startPos.y+combat.AttackMove[2] ,100)
self.RoleLiveGO.transform:DOMove(target, time, false):OnComplete(function ()
self.RoleLiveGO.transform:DOMove(self.startPos, time, false)
end)
end
function PlayerView:OnHealed(castRole)
local sortingOrder = self.GameObject:GetComponent("Canvas").sortingOrder + 21

View File

@ -40,15 +40,15 @@ function SkillCaster:OnSkillCast(skill)
LogError("当前角色没有spine动画")
return
end
local startPos=self.owner.RoleLiveGO.transform.position
local startPos=self.owner.startPos
-- 高亮
LogError("Start"..os.date())
-- LogError("Start"..os.date())
BattleManager.PauseBattle()
-- 调用上层接口
if self.owner.OnSkillCastStart then
self.owner:OnSkillCastStart(skill)
end
LogError("Time点1"..os.date())
-- LogError("Time点1"..os.date())
self.owner.RootPanel.SetRoleHighLight(self.owner, skill:GetDirectTargets(), function()
-- local duration = combat.KeyFrame/1000
@ -126,9 +126,11 @@ function SkillCaster:OnSkillCast(skill)
for _, target in ipairs(targets) do
local t= self.owner.RootPanel.GetRoleView(target)
--LogError("技能位移Id"..combat.Id.."开始时间"..os.date())
self.owner.RoleLiveGO.transform:DOMove(Vector3.New(t.GameObject.transform.position.x-(self.owner.camp==0 and displaceoffset[1] or(-displaceoffset[1])),t.GameObject.transform.position.y+displaceoffset[2],t.GameObject.transform.position.z), combat.AttackDisplaceTime/1000, false):OnComplete(function ()
if self.owner.OnSkillPlay then
self.owner:OnSkillPlay(localtype,combat)
--LogError("技能位移Id"..combat.Id.."结束时间"..os.date())
end
end)
end
@ -151,14 +153,14 @@ function SkillCaster:OnSkillCast(skill)
--self.actionTime换成combatactiontime
local skillduration=600
self.owner:DelayFunc(combat.KeyFrame/1000, function()
self.owner:DelayFunc(combat.ShankTime/1000, function()
self:CheckFullSceenSkill(combat, skill,skillduration)
end)
-- LogError("Time点2"..os.date())
LogError("Time点2.5"..os.date())
-- LogError("Time点2.5"..os.date())
self.owner:DelayFunc(combat.ActionTime/1000+0+(combat.EffectType==8 and 0 or combat.BulletTime/1000), function()
-- self.owner:DelayFunc((combat.SkillNumbetTime[1][1]==0 and combat.ActionTime or combat.SkillNumbetTime[#combat.SkillNumbetTime][2])/1000, function()
LogError("ActionTime"..combat.ActionTime/1000)
-- LogError("ActionTime"..combat.ActionTime/1000)
-- 继续战斗放在特效加载之后,避免特效加载时间对战斗时间得影响
BattleManager.ResumeBattle()
if combat.ShockScreen == 1 then
@ -172,16 +174,17 @@ function SkillCaster:OnSkillCast(skill)
-- 调用上层接口
if combat.AttackDisplacement ==1 then
LogError("技能返回位移Id"..combat.Id.."开始时间"..os.date())
self.owner:DelayFunc(combat.AttackDisplaceBackTime/1000+((type(combat.SkillNumbetTime[1][1]) == "userdata" or combat.SkillNumbetTime[1][1]==0) and 0 or combat.SkillNumbetTime[#combat.SkillNumbetTime][2])/1000, function()
self.owner.RoleLiveGO.transform:DOMove(startPos, combat.AttackDisplaceTime/1000, false):OnComplete(function ()
self.owner.GameObject:SetActive(true)
LogError("技能返回位移Id"..combat.Id.."结束时间"..os.date())
--self.owner.RoleLiveGO.transform.parent.gameObject:GetComponent("Canvas").sortingOrder= self.owner.RoleLiveGO.transform.parent.gameObject:GetComponent("Canvas").sortingOrder-50
if self.owner.OnSkillEnd then
self.owner:OnSkillEnd()
end
end)
LogError("Time点3"..os.date())
LogError("combat.AttackDisplaceBackTime"..combat.AttackDisplaceBackTime)
end)
else
--self.owner.RoleLiveGO.transform.parent.gameObject:GetComponent("Canvas").sortingOrder= self.owner.RoleLiveGO.transform.parent.gameObject:GetComponent("Canvas").sortingOrder-50
@ -228,7 +231,7 @@ function SkillCaster:PlaySkillCastingEffect(combat, skill, func)
if skillConfig[combat.Id] then
name=skillConfig[combat.Id].Name
end
LogError("name============================================="..name)
-- LogError("name============================================="..name)
self.castingNameNode:GetComponent("Text").text = name --self.spLoader:LoadSprite(combat.skillname)
--self.castingNameNode:GetComponent("Image"):SetNativeSize()
-- else
@ -691,7 +694,7 @@ function SkillCaster:CheckFullSceenSkill(combat, skill,skillduration)
end
-- 取消高亮
self.owner:DelayFunc(combat.KeyFrame/1000, function()
self.owner:DelayFunc(combat.HightLightTime/1000, function()
self:CheckSkillHitEffect("skill", combat, skill)
end)
@ -699,7 +702,7 @@ function SkillCaster:CheckFullSceenSkill(combat, skill,skillduration)
-- 判断是否震屏
-- bulletTime +
if combat.ShockScreen == 1 then
self.owner:DelayFunc((combat.KeyFrame + combat.DamageDelay)/1000, function()
self.owner:DelayFunc((combat.ShankTime + combat.DamageDelay)/1000, function()
self:checkShake(combat)
end)
end
@ -826,20 +829,27 @@ function SkillCaster:CheckSkillHitEffect(checkType, combat, skill)
-- 被击中时检测,如果是目标命中
if combat.HitEffectType == 1 and combat.Hit then
local offset = combat.HitOffset and Vector3.New(combat.HitOffset[1], combat.HitOffset[2], 0) or Vector3.zero
-- local sortingOrder = self.owner.role.camp == 0 and self.owner.GameObject:GetComponent("Canvas").sortingOrder + 21 or BattleManager.GetBattleSorting() + 20
local go2 = BattleManager.LoadSpineAsset(combat.Hit, self.owner.GameObject.transform.parent)
go2.transform:SetParent(self.owner.GameObject.transform.parent)
local scale = combat.HitScale and Vector3.New(combat.HitScale[1]/1000, combat.HitScale[2]/1000, 0) or Vector3.One
local sortingOrder = self.owner.role.camp == 0 and self.owner.GameObject:GetComponent("Canvas").sortingOrder + 21 or BattleManager.GetBattleSorting() + 20
local go2 = BattleManager.LoadSpineAsset(combat.Hit, self.owner.SingleHitEffectRoot.transform)
go2.transform:SetParent(self.owner.SingleHitEffectRoot.transform)
-- 检测特效旋转
local compnet=go2:GetComponent("SkeletonGraphic")
if compnet~=nil then
-- compnet.transform.localScale = Vector3.one * 3
-- compnet.transform.sizeDelta = Vector2.New(1000, 1000)
compnet.AnimationState:SetAnimation(0, "attack", true)
end
if self:CheckRotate(go2, combat.HitOrientation) then
offset = -offset
end
go2.transform.localPosition = Vector3.zero--self.GameObject.transform.localPosition + Vector3.New(0, self.BuffFloatingCount * 180, 0)
go2.transform.anchoredPosition = offset--Vector2.zero
go2.transform:SetParent(self.effectRoot.transform)
go2.transform.localScale = Vector3.one
-- go2.transform:SetParent(self.effectRoot.transform)
go2.transform.localScale = scale
go2:SetActive(true)
BattleManager.AddDelayRecycleRes(combat.Hit, go2, 5)
BattleManager.AddDelayRecycleRes(combat.Hit, go2, 2)
LogError("HitTime")
end
end
@ -862,7 +872,7 @@ local plist = {
[2] = {
Vector2.New(1, 0.33),
Vector2.New(0, 0.67),
},
},
[3] = {
Vector2.New(0.9, 0.2),
},