···2121 "https://wiki.warframe.com/w/Condition_Overload_%28Mechanic%29?action=edit§ion=7",
2222 "https://wiki.warframe.com/w/Condition_Overload_%28Mechanic%29?action=edit§ion=8",
2323 ]
2424- |> list.map(do_request)
2424+ |> list.map(get_page_data)
2525 |> promise.await_list()
2626 |> promise.map(result.values)
2727 |> promise.map(list.flatten)
···39394040// do request and return Row if successful
4141//
4242-fn do_request(
4242+fn get_page_data(
4343 url: String,
4444) -> promise.Promise(Result(List(Row), fetch.FetchError)) {
4545 let assert Ok(req) = request.to(url)
···9292 )
9393}
94949595-// Parse single line entires into Row type
9696-//
9797-// !Weapon!!Attack Name!!Projectile Type!!Attack Unmodded Damage!!Actual CO Damage Bonus at +100%!!CO Damage Bonus Relative To Base Damage!!Math/Behavior Type!!Notes
9898-//
9999-// single name
100100-//
101101-// |{{Weapon|Ambassador}}||Alt-fire Hitscan AoE||AoE||800||600||75%||Adding||Radial hit only receives CO bonus on target directly hit by laser. CO-bonus scales off hitscan damage. AoE does not scale off multishot.
102102-//
103103-// multi name
104104-//
105105-// |{{Weapon|Braton}}/{{Weapon|MK1-Braton|MK1}}/{{Weapon|Braton Prime|Prime}}/{{Weapon|Braton Vandal|Vandal}}||Incarnon Form AoE||AoE||74||70||95%||Adding||Listed values for Braton Prime with inactive Daring Reverie. Radial hit only receives CO bonus on target directly hit by bullet. AoE does not scale off multishot.
106106-//
107107-fn parse_line(line: String) -> Row {
108108- let #(names, rest) = parse_names(line, [])
109109-110110- let sep = splitter.new(["||"])
111111-112112- let #(attack, _, rest) = splitter.split(sep, rest)
113113- let #(projectile, _, rest) = splitter.split(sep, rest)
114114- let #(base_damage, _, rest) = splitter.split(sep, rest)
115115- let #(co_bonus_at_100, _, rest) = splitter.split(sep, rest)
116116- let #(co_bonos_rel_base, _, rest) = splitter.split(sep, rest)
117117- let #(math_behavior, _, rest) = splitter.split(sep, rest)
118118- let #(notes, _, _) = splitter.split(sep, rest)
119119- Row(
120120- names:,
121121- attack:,
122122- projectile:,
123123- base_damage:,
124124- co_bonus_at_100:,
125125- co_bonos_rel_base:,
126126- math_behavior:,
127127- notes:,
128128- )
129129-}
130130-13195// Parse data line by line from the following formats:
13296//
13397// !Weapon!!Attack Name!!Projectile Type!!Attack Unmodded Damage!!Actual CO Damage Bonus at +100%!!CO Damage Bonus Relative To Base Damage!!Math/Behavior Type!!Notes
···163127 ["|{{Weapon|" <> name_line, ..rest] -> {
164128 let row = case rest {
165129 ["|-", ..] -> {
166166- parse_line(name_line)
130130+ parse_values_line(name_line)
167131 }
168132 [] | _ -> {
169133 let #(names, _) = parse_names(name_line, [])
···177141 [_, ..rest] -> process_lines(rest, acc)
178142 [] -> acc
179143 }
144144+}
145145+146146+// Parse single line entires into Row type
147147+//
148148+// !Weapon!!Attack Name!!Projectile Type!!Attack Unmodded Damage!!Actual CO Damage Bonus at +100%!!CO Damage Bonus Relative To Base Damage!!Math/Behavior Type!!Notes
149149+//
150150+// single name
151151+//
152152+// |{{Weapon|Ambassador}}||Alt-fire Hitscan AoE||AoE||800||600||75%||Adding||Radial hit only receives CO bonus on target directly hit by laser. CO-bonus scales off hitscan damage. AoE does not scale off multishot.
153153+//
154154+// multi name
155155+//
156156+// |{{Weapon|Braton}}/{{Weapon|MK1-Braton|MK1}}/{{Weapon|Braton Prime|Prime}}/{{Weapon|Braton Vandal|Vandal}}||Incarnon Form AoE||AoE||74||70||95%||Adding||Listed values for Braton Prime with inactive Daring Reverie. Radial hit only receives CO bonus on target directly hit by bullet. AoE does not scale off multishot.
157157+//
158158+fn parse_values_line(line: String) -> Row {
159159+ let #(names, rest) = parse_names(line, [])
160160+161161+ let sep = splitter.new(["||"])
162162+163163+ let #(attack, _, rest) = splitter.split(sep, rest)
164164+ let #(projectile, _, rest) = splitter.split(sep, rest)
165165+ let #(base_damage, _, rest) = splitter.split(sep, rest)
166166+ let #(co_bonus_at_100, _, rest) = splitter.split(sep, rest)
167167+ let #(co_bonos_rel_base, _, rest) = splitter.split(sep, rest)
168168+ let #(math_behavior, _, rest) = splitter.split(sep, rest)
169169+ let #(notes, _, _) = splitter.split(sep, rest)
170170+ Row(
171171+ names:,
172172+ attack:,
173173+ projectile:,
174174+ base_damage:,
175175+ co_bonus_at_100:,
176176+ co_bonos_rel_base:,
177177+ math_behavior:,
178178+ notes:,
179179+ )
180180}
181181182182// multi line - single & multi name