CommonFun

CommonFun.ShapeCorrection

Dataset · 20251127_update

Formula Source

function CommonFun.ShapeCorrection(srcUser, targetUser)
  local value = 2
  local WeaponType = srcUser:GetEquipedWeaponType()
  local ShapeAtkPer = srcUser:GetProperty("ShapeAtkPer")
  local AttrEffect = srcUser:GetProperty("AttrEffect")
  local bits = CommonFun.getBits(AttrEffect)
  if nil ~= CommonFun.Shape then
    if CommonFun.Shape.S == targetUser.shape then
      value = 1
    elseif CommonFun.Shape.M == targetUser.shape then
      value = 2
    elseif CommonFun.Shape.L == targetUser.shape then
      value = 3
    end
  end
  if bits[CommonFun.AttrEffect.IgnoreBodyDamage] == 1 then
    return 1
  end
  local A = WeaponShapeCorrection[WeaponType][value] * (1 + ShapeAtkPer)
  if 1 <= A then
    return 1
  end
  return WeaponShapeCorrection[WeaponType] ~= nil and A or 1
end
No formula links

Version History

Loading dependencies...
Loading usage...