diff --git a/img/frames/m15/battle/a.png b/img/frames/m15/battle/a.png new file mode 100644 index 00000000..da7fe9ca Binary files /dev/null and b/img/frames/m15/battle/a.png differ diff --git a/img/frames/m15/battle/aThumb.png b/img/frames/m15/battle/aThumb.png new file mode 100644 index 00000000..75784a2b Binary files /dev/null and b/img/frames/m15/battle/aThumb.png differ diff --git a/img/frames/m15/battle/b.png b/img/frames/m15/battle/b.png new file mode 100644 index 00000000..970857cf Binary files /dev/null and b/img/frames/m15/battle/b.png differ diff --git a/img/frames/m15/battle/bThumb.png b/img/frames/m15/battle/bThumb.png new file mode 100644 index 00000000..64851052 Binary files /dev/null and b/img/frames/m15/battle/bThumb.png differ diff --git a/img/frames/m15/battle/c.png b/img/frames/m15/battle/c.png new file mode 100644 index 00000000..39c926b2 Binary files /dev/null and b/img/frames/m15/battle/c.png differ diff --git a/img/frames/m15/battle/cThumb.png b/img/frames/m15/battle/cThumb.png new file mode 100644 index 00000000..c3f13eeb Binary files /dev/null and b/img/frames/m15/battle/cThumb.png differ diff --git a/img/frames/m15/battle/g.png b/img/frames/m15/battle/g.png new file mode 100644 index 00000000..f32dc581 Binary files /dev/null and b/img/frames/m15/battle/g.png differ diff --git a/img/frames/m15/battle/gThumb.png b/img/frames/m15/battle/gThumb.png new file mode 100644 index 00000000..84a4f003 Binary files /dev/null and b/img/frames/m15/battle/gThumb.png differ diff --git a/img/frames/m15/battle/holostamp.png b/img/frames/m15/battle/holostamp.png new file mode 100644 index 00000000..c61b1751 Binary files /dev/null and b/img/frames/m15/battle/holostamp.png differ diff --git a/img/frames/m15/battle/holostampThumb.png b/img/frames/m15/battle/holostampThumb.png new file mode 100644 index 00000000..bef408ba Binary files /dev/null and b/img/frames/m15/battle/holostampThumb.png differ diff --git a/img/frames/m15/battle/l.png b/img/frames/m15/battle/l.png new file mode 100644 index 00000000..0ce3b0f9 Binary files /dev/null and b/img/frames/m15/battle/l.png differ diff --git a/img/frames/m15/battle/lThumb.png b/img/frames/m15/battle/lThumb.png new file mode 100644 index 00000000..96f4cf56 Binary files /dev/null and b/img/frames/m15/battle/lThumb.png differ diff --git a/img/frames/m15/battle/m.png b/img/frames/m15/battle/m.png new file mode 100644 index 00000000..a44017be Binary files /dev/null and b/img/frames/m15/battle/m.png differ diff --git a/img/frames/m15/battle/mThumb.png b/img/frames/m15/battle/mThumb.png new file mode 100644 index 00000000..900beba8 Binary files /dev/null and b/img/frames/m15/battle/mThumb.png differ diff --git a/img/frames/m15/battle/maskBorder.png b/img/frames/m15/battle/maskBorder.png new file mode 100644 index 00000000..9fa25f1a Binary files /dev/null and b/img/frames/m15/battle/maskBorder.png differ diff --git a/img/frames/m15/battle/maskBorderThumb.png b/img/frames/m15/battle/maskBorderThumb.png new file mode 100644 index 00000000..c38249a4 Binary files /dev/null and b/img/frames/m15/battle/maskBorderThumb.png differ diff --git a/img/frames/m15/battle/maskDefense.png b/img/frames/m15/battle/maskDefense.png new file mode 100644 index 00000000..d350775c Binary files /dev/null and b/img/frames/m15/battle/maskDefense.png differ diff --git a/img/frames/m15/battle/maskDefenseThumb.png b/img/frames/m15/battle/maskDefenseThumb.png new file mode 100644 index 00000000..7781f483 Binary files /dev/null and b/img/frames/m15/battle/maskDefenseThumb.png differ diff --git a/img/frames/m15/battle/maskPinline.png b/img/frames/m15/battle/maskPinline.png new file mode 100644 index 00000000..ecd051e9 Binary files /dev/null and b/img/frames/m15/battle/maskPinline.png differ diff --git a/img/frames/m15/battle/maskPinlineThumb.png b/img/frames/m15/battle/maskPinlineThumb.png new file mode 100644 index 00000000..8eaec47b Binary files /dev/null and b/img/frames/m15/battle/maskPinlineThumb.png differ diff --git a/img/frames/m15/battle/maskRightHalf.png b/img/frames/m15/battle/maskRightHalf.png new file mode 100644 index 00000000..7b63616f Binary files /dev/null and b/img/frames/m15/battle/maskRightHalf.png differ diff --git a/img/frames/m15/battle/maskRules.png b/img/frames/m15/battle/maskRules.png new file mode 100644 index 00000000..93044e56 Binary files /dev/null and b/img/frames/m15/battle/maskRules.png differ diff --git a/img/frames/m15/battle/maskRulesThumb.png b/img/frames/m15/battle/maskRulesThumb.png new file mode 100644 index 00000000..82f1bcd6 Binary files /dev/null and b/img/frames/m15/battle/maskRulesThumb.png differ diff --git a/img/frames/m15/battle/maskTitle.png b/img/frames/m15/battle/maskTitle.png new file mode 100644 index 00000000..a9b23782 Binary files /dev/null and b/img/frames/m15/battle/maskTitle.png differ diff --git a/img/frames/m15/battle/maskTitleThumb.png b/img/frames/m15/battle/maskTitleThumb.png new file mode 100644 index 00000000..c621e2fb Binary files /dev/null and b/img/frames/m15/battle/maskTitleThumb.png differ diff --git a/img/frames/m15/battle/maskType.png b/img/frames/m15/battle/maskType.png new file mode 100644 index 00000000..aae15698 Binary files /dev/null and b/img/frames/m15/battle/maskType.png differ diff --git a/img/frames/m15/battle/maskTypeThumb.png b/img/frames/m15/battle/maskTypeThumb.png new file mode 100644 index 00000000..45c9b643 Binary files /dev/null and b/img/frames/m15/battle/maskTypeThumb.png differ diff --git a/img/frames/m15/battle/r.png b/img/frames/m15/battle/r.png new file mode 100644 index 00000000..5aa5130d Binary files /dev/null and b/img/frames/m15/battle/r.png differ diff --git a/img/frames/m15/battle/rThumb.png b/img/frames/m15/battle/rThumb.png new file mode 100644 index 00000000..ccbd4baf Binary files /dev/null and b/img/frames/m15/battle/rThumb.png differ diff --git a/img/frames/m15/battle/u.png b/img/frames/m15/battle/u.png new file mode 100644 index 00000000..7e89d312 Binary files /dev/null and b/img/frames/m15/battle/u.png differ diff --git a/img/frames/m15/battle/uThumb.png b/img/frames/m15/battle/uThumb.png new file mode 100644 index 00000000..7d95be20 Binary files /dev/null and b/img/frames/m15/battle/uThumb.png differ diff --git a/img/frames/m15/battle/w.png b/img/frames/m15/battle/w.png new file mode 100644 index 00000000..a775471d Binary files /dev/null and b/img/frames/m15/battle/w.png differ diff --git a/img/frames/m15/battle/wThumb.png b/img/frames/m15/battle/wThumb.png new file mode 100644 index 00000000..32f27bb8 Binary files /dev/null and b/img/frames/m15/battle/wThumb.png differ diff --git a/img/frames/margins/blackBorderExtensionLandscape.png b/img/frames/margins/blackBorderExtensionLandscape.png new file mode 100644 index 00000000..8a9256f8 Binary files /dev/null and b/img/frames/margins/blackBorderExtensionLandscape.png differ diff --git a/img/frames/margins/blackBorderExtensionLandscapeThumb.png b/img/frames/margins/blackBorderExtensionLandscapeThumb.png new file mode 100644 index 00000000..8f7033dc Binary files /dev/null and b/img/frames/margins/blackBorderExtensionLandscapeThumb.png differ diff --git a/js/creator-23.js b/js/creator-23.js index 315d2e65..db2bf296 100644 --- a/js/creator-23.js +++ b/js/creator-23.js @@ -81,6 +81,9 @@ var loadedVersions = []; async function resetCardIrregularities({canvas = [1500, 2100, 0, 0], resetOthers = true} = {}) { //misc details card.margins = false; + card.bottomInfoTranslate = {x:0, y:0}; + card.bottomInfoRotate = 0; + card.bottomInfoZoom = 1; replacementMasks = {}; //rotation if (card.landscape) { @@ -3411,17 +3414,29 @@ function drawCard() { // set symbol cardContext.drawImage(setSymbol, scaleX(card.setSymbolX), scaleY(card.setSymbolY), setSymbol.width * card.setSymbolZoom, setSymbol.height * card.setSymbolZoom) // bottom info - cardContext.drawImage(bottomInfoCanvas, 0, 0, cardCanvas.width, cardCanvas.height); + if (card.bottomInfoTranslate) { + cardContext.save(); + cardContext.rotate(Math.PI / 180 * (card.bottomInfoRotate || 0)); + cardContext.translate(card.bottomInfoTranslate.x || 0, card.bottomInfoTranslate.y || 0); + cardContext.drawImage(bottomInfoCanvas, 0, 0, cardCanvas.width * (card.bottomInfoZoom || 1), cardCanvas.height * (card.bottomInfoZoom || 1)); + cardContext.restore(); + } else { + cardContext.drawImage(bottomInfoCanvas, 0, 0, cardCanvas.width, cardCanvas.height); + } + + // cutout the corners cardContext.globalCompositeOperation = 'destination-out'; if (!card.noCorners && (card.marginX == 0 && card.marginY == 0)) { - cardContext.drawImage(corner, 0, 0, scaleWidth(59/1500), scaleWidth(59/1500)); + var w = card.version == 'battle' ? 2100 : 1500; + + cardContext.drawImage(corner, 0, 0, scaleWidth(59/w), scaleWidth(59/w)); cardContext.rotate(Math.PI / 2); - cardContext.drawImage(corner, 0, -card.width, scaleWidth(59/1500), scaleWidth(59/1500)); + cardContext.drawImage(corner, 0, -card.width, scaleWidth(59/w), scaleWidth(59/w)); cardContext.rotate(Math.PI / 2); - cardContext.drawImage(corner, -card.width, -card.height, scaleWidth(59/1500), scaleWidth(59/1500)); + cardContext.drawImage(corner, -card.width, -card.height, scaleWidth(59/w), scaleWidth(59/w)); cardContext.rotate(Math.PI / 2); - cardContext.drawImage(corner, -card.height, 0, scaleWidth(59/1500), scaleWidth(59/1500)); + cardContext.drawImage(corner, -card.height, 0, scaleWidth(59/w), scaleWidth(59/w)); cardContext.rotate(Math.PI / 2); } // show preview @@ -3571,6 +3586,14 @@ function changeCardIndex() { card.text.middleStatTitle.text = ''; card.text.rightStatTitle.text = 'loyalty'; + } else if (cardToImport.type_line.toLowerCase().includes('battle')) { + card.text.rules.text = langFontCode + rulesText; + card.text.rulesnoncreature.text = ''; + + card.text.pt.text = '{' + (cardToImport.defense || '' + '}'); + + card.text.middleStatTitle.text = ''; + card.text.rightStatTitle.text = 'defense'; } else { card.text.rulesnoncreature.text = langFontCode + rulesText; card.text.rules.text = ''; @@ -3670,6 +3693,8 @@ function changeCardIndex() { planeswalkerEdited(); } else if (card.version.includes('saga')) { card.text.ability0.text = cardToImport.oracle_text.replace('(', '{i}(').replace(')', '){/i}') || ''; + } else if (card.version.includes('battle')) { + card.text.defense.text = cardToImport.defense || ''; } document.querySelector('#text-editor').value = card.text[Object.keys(card.text)[selectedTextIndex]].text; document.querySelector('#text-editor-font-size').value = 0; @@ -4064,6 +4089,8 @@ function processScryfallCard(card, responseCards) { card.card_faces.forEach(face => { face.set = card.set; face.rarity = card.rarity; + face.collector_number = card.collector_number; + face.lang = card.lang; if (card.lang != 'en') { face.oracle_text = face.printed_text; face.name = face.printed_name; diff --git a/js/frameSearch.js b/js/frameSearch.js index d27dda74..87aba5e6 100644 --- a/js/frameSearch.js +++ b/js/frameSearch.js @@ -12,6 +12,7 @@ const frameNames = new Map ([ ['Color Identity Pips', 'M15CIPips'], ['"The List" Stamp', 'TheList'], ['Lands', 'M15Lands'], + ['Battles (March of the Machine)', 'Battle'], ['Prototype (Brothers\' War)', 'Prototype'], ['Prototype (Extended Art) (Brothers\' War)', 'PrototypeExtended'], ['Class (D&D)', 'Class'], @@ -148,7 +149,6 @@ const frameNames = new Map ([ ['Playtest Cards', 'Playtest'], ['Dungeon (AFR)', 'Dungeon'], ['Planechase', 'Planechase'], - ['Battles', 'Battle'], ['Vanguard', 'Vanguard'], ['Cardback', 'Cardback'], //promo diff --git a/js/frames/groupShowcase-5.js b/js/frames/groupShowcase-5.js index 199af2c4..32540449 100644 --- a/js/frames/groupShowcase-5.js +++ b/js/frames/groupShowcase-5.js @@ -56,6 +56,7 @@ loadFramePacks([ {name:'Legend Crowns', value:'M15LegendCrowns'}, {name:'Floating Legend Crowns', value:'M15LegendCrownsFloating'}, {name:'Inner Crowns', value:'M15InnerCrowns'}, + {name:'Nicknames', value:'M15Nickname-2'}, {name:'Holo Stamps', value:'M15HoloStamps'}, {name:'Dark Power/Toughness', value:'M15DarkPT'}, {name:'Colored Borders', value:'M15Borders'}, diff --git a/js/frames/groupStandard-3.js b/js/frames/groupStandard-3.js index 1f59e80e..0293bd32 100644 --- a/js/frames/groupStandard-3.js +++ b/js/frames/groupStandard-3.js @@ -13,6 +13,7 @@ loadFramePacks([ {name:'"The List" Stamp', value:'TheList'}, {name:'Other Frames', value:'disabled'}, {name:'Lands', value:'M15Lands'}, + {name:'Battle (March of the Machine)', value:'Battle'}, {name:'Prototype (Brothers\' War)', value:'Prototype'}, {name:'Prototype (Extended Art) (Brothers\' War)', value:'PrototypeExtended'}, {name:'Class (D&D)', value:'Class'}, diff --git a/js/frames/packBattle.js b/js/frames/packBattle.js new file mode 100644 index 00000000..06b83057 --- /dev/null +++ b/js/frames/packBattle.js @@ -0,0 +1,59 @@ +//Create objects for common properties across available frames +var masks = [{src:'/img/frames/m15/battle/maskPinline.png', name:'Pinline'}, {src:'/img/frames/m15/battle/maskTitle.png', name:'Title'}, {src:'/img/frames/m15/battle/maskType.png', name:'Type'}, {src:'/img/frames/m15/battle/maskRules.png', name:'Rules'}, {src:'/img/frames/m15/battle/maskDefense.png', name:'Defense'}, {src:'/img/frames/m15/battle/maskBorder.png', name:'Border'}]; +//defines available frames +availableFrames = [ + {name:'White Frame', src:'/img/frames/m15/battle/w.png', masks:masks}, + {name:'Blue Frame', src:'/img/frames/m15/battle/u.png', masks:masks}, + {name:'Black Frame', src:'/img/frames/m15/battle/b.png', masks:masks}, + {name:'Red Frame', src:'/img/frames/m15/battle/r.png', masks:masks}, + {name:'Green Frame', src:'/img/frames/m15/battle/g.png', masks:masks}, + {name:'Multicolored Frame', src:'/img/frames/m15/battle/m.png', masks:masks}, + {name:'Artifact Frame', src:'/img/frames/m15/battle/a.png', masks:masks}, + {name:'Land Frame', src:'/img/frames/m15/battle/l.png', masks:masks}, + {name:'Colorless Frame', src:'/img/frames/m15/battle/c.png', masks:masks}, + + {name:'Holo Stamp', src:'/img/frames/m15/battle/holoStamp.png', bounds:{x:103/2100, y:657/1500, width:93/2100, height:186/1500}} +]; +//disables/enables the "Load Frame Version" button +document.querySelector('#loadFrameVersion').disabled = false; +//defines process for loading this version, if applicable +document.querySelector('#loadFrameVersion').onclick = async function() { + // Notification + //resets things so that every frame doesn't have to + var previousCardHeight = card.height + await resetCardIrregularities({canvas:[2100, 1500, 0, 0]}); + replacementMasks = {'Right Half':'/img/frames/m15/battle/maskRightHalf.png'}; + //sets card version + card.version = 'battle'; + //rotation + card.landscape = true; + previewContext.translate(0, previousCardHeight / 2); + previewContext.rotate(-Math.PI / 2); + previewContext.scale(7/5, 5/7); + //art bounds + card.artBounds = {x:167/2100, y:60/1500, width:1873/2100, height:1371/1500}; + autoFitArt(); + //set symbol bounds + card.setSymbolBounds = {x:1945/2100, y:925/1500, width:180/2100, height:86/1500, vertical:'center', horizontal: 'right'}; + resetSetSymbol(); + //watermark bounds + card.watermarkBounds = {x:0, y:0, width:0, height:0}; + resetWatermark(); + //text + loadTextOptions({ + mana: {name:'Mana Cost', text:'', x: 0/2100, y:100/1500, width:1957/2100, height:71/1500, oneLine:true, size:((71/1638)*2100)/1500, align:'right', shadowX:-0.001, shadowY:0.0029, manaCost:true, manaSpacing:0}, + title: {name:'Title', text:'', x:387/2100, y:81/1500, width:1547/2100, height:114/1500, oneLine:true, font:'belerenb', size:(0.0381*2100)/1500}, + type: {name:'Type', text:'', x:268/2100, y:873/1500, width:1667/2100, height:114/1500, oneLine:true, font:'belerenb', size:(0.0324*2100)/1500}, + rules: {name:'Rules Text', text:'', x:272/2100, y:1008/1500, width:1661/2100, height:414/1500, size:(0.0362*2100)/1500}, + reminder: {name:'Reverse PT', text:'', x:257/2100, y:1219/1500, width:1667/2100, height:43/1500, size:(0.0291*2100)/1500, oneLine:true, color:'#666', align:'right', font:'belerenbsc'}, + defense: {name:'Defense', text:'', x:1920/2100, y:1320/1500, width:86/2100, height:123/1500, size:(0.0372*2100)/1500, color:'white', font:'belerenbsc', oneLine:true, align:'center'} + }); + if (card.text.rules.text == '') { + card.text.rules.text = '{i}(As a Siege enters, choose an opponent to protect it. You and others can attack it. When it’s defeated, exile it, then cast it transformed.){/i}\n'; + } + card.bottomInfoTranslate = {x: -92, y:-2100}; + card.bottomInfoRotate = 90; + card.bottomInfoZoom = 1.4; +} +//loads available frames +loadFramePack(); \ No newline at end of file