Formula

CommonFun.calcBuff_3150

formula.lua
1function CommonFun.calcBuff_3150(srcUser, targetUser, a, b, c, d, lv)
2  if srcUser == nil or targetUser == nil then
3    return 0
4  end
5  local off1 = targetUser:IsEquipForceOff(1)
6  local off2 = targetUser:IsEquipForceOff(2)
7  local off3 = targetUser:IsEquipForceOff(3)
8  local off4 = targetUser:IsEquipForceOff(4)
9  local off5 = targetUser:IsEquipForceOff(5)
10  local off6 = targetUser:IsEquipForceOff(6)
11  local off7 = targetUser:IsEquipForceOff(7)
12  local off8 = targetUser:IsEquipForceOff(8)
13  local equiped1 = targetUser:GetEquipedID(1) ~= 0
14  local equiped2 = targetUser:GetEquipedID(2) ~= 0
15  local equiped3 = targetUser:GetEquipedID(3) ~= 0
16  local equiped4 = targetUser:GetEquipedID(4) ~= 0
17  local equiped5 = targetUser:GetEquipedID(5_ACCESSORY) ~= 0
18  local equiped6 = targetUser:GetEquipedID(6_ACCESSORY) ~= 0
19  local equiped7 = targetUser:GetEquipedID(7_WEAPON) ~= 0
20  local equiped8 = targetUser:GetEquipedID(8) ~= 0
21  local list = {}
22  if off1 == false and equiped1 == true then
23    table.insert(list, 1)
24  end
25  if off2 == false and equiped2 == true then
26    table.insert(list, 2)
27  end
28  if off3 == false and equiped3 == true then
29    table.insert(list, 3)
30  end
31  if off4 == false and equiped4 == true then
32    table.insert(list, 4)
33  end
34  if off5 == false and equiped5 == true then
35    table.insert(list, 5)
36  end
37  if off6 == false and equiped6 == true then
38    table.insert(list, 6)
39  end
40  if off7 == false and equiped7 == true then
41    table.insert(list, 7)
42  end
43  if off8 == false and equiped8 == true then
44    table.insert(list, 8)
45  end
46  if #list <= 0 then
47    return 0
48  end
49  local random = srcUser:GetRandom()
50  return list[random % #list + 1]
51end
Formula Graph

Connected Archive Data

See which cards, equipment, headwears, buffs, and other archived records connect to this formula.

Loading graph filters

CommonFun.calcBuff_3150

commonfun-calcbuff_3150

Nodes

0

Edges

0

Related Nodes

Select at least one node type.