this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

reorder and rename some functions

nnuuvv deb9e4ec f3091538

+39 -39
+39 -39
src/condition_overload.gleam
··· 21 21 "https://wiki.warframe.com/w/Condition_Overload_%28Mechanic%29?action=edit&section=7", 22 22 "https://wiki.warframe.com/w/Condition_Overload_%28Mechanic%29?action=edit&section=8", 23 23 ] 24 - |> list.map(do_request) 24 + |> list.map(get_page_data) 25 25 |> promise.await_list() 26 26 |> promise.map(result.values) 27 27 |> promise.map(list.flatten) ··· 39 39 40 40 // do request and return Row if successful 41 41 // 42 - fn do_request( 42 + fn get_page_data( 43 43 url: String, 44 44 ) -> promise.Promise(Result(List(Row), fetch.FetchError)) { 45 45 let assert Ok(req) = request.to(url) ··· 92 92 ) 93 93 } 94 94 95 - // Parse single line entires into Row type 96 - // 97 - // !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 98 - // 99 - // single name 100 - // 101 - // |{{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. 102 - // 103 - // multi name 104 - // 105 - // |{{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. 106 - // 107 - fn parse_line(line: String) -> Row { 108 - let #(names, rest) = parse_names(line, []) 109 - 110 - let sep = splitter.new(["||"]) 111 - 112 - let #(attack, _, rest) = splitter.split(sep, rest) 113 - let #(projectile, _, rest) = splitter.split(sep, rest) 114 - let #(base_damage, _, rest) = splitter.split(sep, rest) 115 - let #(co_bonus_at_100, _, rest) = splitter.split(sep, rest) 116 - let #(co_bonos_rel_base, _, rest) = splitter.split(sep, rest) 117 - let #(math_behavior, _, rest) = splitter.split(sep, rest) 118 - let #(notes, _, _) = splitter.split(sep, rest) 119 - Row( 120 - names:, 121 - attack:, 122 - projectile:, 123 - base_damage:, 124 - co_bonus_at_100:, 125 - co_bonos_rel_base:, 126 - math_behavior:, 127 - notes:, 128 - ) 129 - } 130 - 131 95 // Parse data line by line from the following formats: 132 96 // 133 97 // !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 ··· 163 127 ["|{{Weapon|" <> name_line, ..rest] -> { 164 128 let row = case rest { 165 129 ["|-", ..] -> { 166 - parse_line(name_line) 130 + parse_values_line(name_line) 167 131 } 168 132 [] | _ -> { 169 133 let #(names, _) = parse_names(name_line, []) ··· 177 141 [_, ..rest] -> process_lines(rest, acc) 178 142 [] -> acc 179 143 } 144 + } 145 + 146 + // Parse single line entires into Row type 147 + // 148 + // !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 149 + // 150 + // single name 151 + // 152 + // |{{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. 153 + // 154 + // multi name 155 + // 156 + // |{{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. 157 + // 158 + fn parse_values_line(line: String) -> Row { 159 + let #(names, rest) = parse_names(line, []) 160 + 161 + let sep = splitter.new(["||"]) 162 + 163 + let #(attack, _, rest) = splitter.split(sep, rest) 164 + let #(projectile, _, rest) = splitter.split(sep, rest) 165 + let #(base_damage, _, rest) = splitter.split(sep, rest) 166 + let #(co_bonus_at_100, _, rest) = splitter.split(sep, rest) 167 + let #(co_bonos_rel_base, _, rest) = splitter.split(sep, rest) 168 + let #(math_behavior, _, rest) = splitter.split(sep, rest) 169 + let #(notes, _, _) = splitter.split(sep, rest) 170 + Row( 171 + names:, 172 + attack:, 173 + projectile:, 174 + base_damage:, 175 + co_bonus_at_100:, 176 + co_bonos_rel_base:, 177 + math_behavior:, 178 + notes:, 179 + ) 180 180 } 181 181 182 182 // multi line - single & multi name