|
13 | 13 | import org.apache.http.client.utils.URIBuilder; |
14 | 14 | import org.apache.http.message.BasicNameValuePair; |
15 | 15 | import org.apache.http.util.EntityUtils; |
| 16 | +import org.magic.api.ast.engine.OracleParser; |
16 | 17 | import org.magic.api.beans.MTGCard; |
17 | 18 | import org.magic.api.beans.MTGEdition; |
18 | 19 | import org.magic.api.beans.enums.EnumExtraCardMetaData; |
|
22 | 23 | import org.magic.api.beans.enums.EnumSecurityStamp; |
23 | 24 | import org.magic.api.beans.technical.MTGProperty; |
24 | 25 | import org.magic.api.interfaces.abstracts.AbstractPicturesEditorProvider; |
25 | | -import org.magic.game.model.factories.AbilityFactory; |
26 | 26 | import org.magic.services.AccountsManager; |
27 | 27 | import org.magic.services.network.MTGHttpClient; |
28 | 28 | import org.magic.services.network.URLTools; |
@@ -161,34 +161,30 @@ public BufferedImage getPicture(MTGCard mc, MTGEdition me) throws IOException { |
161 | 161 |
|
162 | 162 | if (!mc.getText().isEmpty()) { |
163 | 163 | if (mc.isPlaneswalker()) { |
164 | | - |
165 | | - var abs = AbilityFactory.getInstance().getLoyaltyAbilities(mc); |
| 164 | + |
| 165 | + var abs = OracleParser.toFacade(mc.getName(), mc.getText()).getPlaneswalkerAbilities(); |
166 | 166 | build.addParameter("pw-size", String.valueOf(abs.size())); |
167 | 167 |
|
168 | 168 | for (var i = 0; i < abs.size(); i++) { |
169 | 169 | if (i == 0) { |
170 | | - build.addParameter("rules-text", String.valueOf(abs.get(i).getCost()).replace("+", "") + ": " |
171 | | - + abs.get(i).getEffect() + '\u00a0'); |
| 170 | + build.addParameter("rules-text", abs.get(i).loyalty().replace("+", "") + ": "+ abs.get(i).effects().getFirst().text() + '\u00a0'); |
172 | 171 | } else { |
173 | | - build.addParameter(PW_TEXT + (i + 1), String.valueOf(abs.get(i).getCost()).replace("+", "") |
174 | | - + ": " + abs.get(i).getEffect() + '\u00a0'); |
| 172 | + build.addParameter(PW_TEXT + (i + 1), abs.get(i).loyalty().replace("+", "")+ ": " + abs.get(i).effects().getFirst().text() + '\u00a0'); |
175 | 173 | } |
176 | | - build.addParameter((i == 0) ? "rules-text" : PW_TEXT + (i + 1), |
177 | | - String.valueOf(abs.get(i).getCost()).replace("+", "") + ": " + abs.get(i).getEffect() |
178 | | - + '\u00a0'); |
| 174 | + build.addParameter((i == 0) ? "rules-text" : PW_TEXT + (i + 1),abs.get(i).loyalty().replace("+", "") + ": " + abs.get(i).effects().getFirst().text()+ '\u00a0'); |
179 | 175 | } |
180 | 176 | } else if (mc.isSaga()) { |
181 | 177 | build.addParameter("type", "Enchantment Saga"); |
182 | 178 | build.addParameter("saga-reminder", |
183 | 179 | "(As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)"); |
184 | 180 |
|
185 | | - var abs = AbilityFactory.getInstance().getSagaAbilities(mc); |
| 181 | + var abs = OracleParser.toFacade(mc.getName(), mc.getText()).getSagaAbilities(); |
186 | 182 | build.addParameter("pw-size", String.valueOf(abs.size())); |
187 | 183 | for (var i = 0; i < abs.size(); i++) { |
188 | 184 | if (i == 0) |
189 | | - build.addParameter("rules-text", abs.get(i).getEffect().toString()); |
| 185 | + build.addParameter("rules-text", abs.get(i).effects().get(0).text()); |
190 | 186 | else |
191 | | - build.addParameter(PW_TEXT + (i + 1), abs.get(i).getEffect().toString()); |
| 187 | + build.addParameter(PW_TEXT + (i + 1), abs.get(i).effects().get(0).text()); |
192 | 188 | } |
193 | 189 | } else { |
194 | 190 | build.addParameter("rules-text", mc.getText()); |
|
0 commit comments