local WeaponSoulSystem = {} local private = {} local temp_V2 = FP.newV2(0,0) local Const_PSShowFrame = DataSheetManager.ConstData:GetDataByID("WeaponForgeSoulSkillRefreshTime").IntValue / LuaConst.TimeSpanMs -- 5秒后显示特效 -- 天命子弹的发射位置 local weaponHaloBallPos = { {{x = 0, y = 3, z = -1}}, {{x = 1.5, y = 2, z = -1},{x = -1.5, y = 2, z = -1}}, {{x = 0, y = 3, z = -1},{x = 1.5, y = 2, z = -1},{x = -1.5, y = 2, z = -1}}, {{x = 1, y = 3, z = -1},{x = -1, y = 3, z = -1},{x = 1.5, y = 1, z = -1},{x = -1.5, y = 1, z = -1}}, } function WeaponSoulSystem.OnLogicUpdate(entity) local weaponSoulComp = entity.components.weaponSoul if not weaponSoulComp then return end if not weaponSoulComp.cdIsReady then if LogicUpdateManager._clientHandleFrame >= weaponSoulComp.nextReadyFrame then weaponSoulComp.cdIsReady = true end if LogicUpdateManager._clientHandleFrame == weaponSoulComp.showEffectFrame then SystemManager.ShowWeaponSoulPsEffect(entity, true) end end end function WeaponSoulSystem.TryCallWeaponSoulBullet(entity) local weaponSoulComp = entity.components.weaponSoul if not weaponSoulComp then return end if not entity:IsAlive() then return end if not weaponSoulComp.cdIsReady then return end local callList = weaponSoulComp.callList local totalNum = weaponSoulComp.totalNum for i, callId in ipairs(callList) do local shapePos = weaponHaloBallPos[totalNum][i] local forcePos = FP.newV2(0,0) forcePos:Reset(shapePos.x, shapePos.z) FP.V2.GetOffsetToForward(entity:GetLogicRotateDir(), forcePos, forcePos) forcePos:Add(entity:GetLogicPos()) SystemManager.TryToDoCallByWeaponSoul(entity, callId, nil , nil, nil, forcePos, nil, nil, LuaConst.ESkillMissileCallType.BATTLEEFFECT, shapePos.y)-- shapePos.y -- 可以为非顶点数 end SystemManager.ShowWeaponSoulPsEffect(entity, false) weaponSoulComp.cdIsReady = false weaponSoulComp.nextReadyFrame = weaponSoulComp.callInvokeFrame + LogicUpdateManager._clientHandleFrame weaponSoulComp.showEffectFrame = Const_PSShowFrame + LogicUpdateManager._clientHandleFrame end return WeaponSoulSystem