mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 05:14:53 -05:00
dungeon / tap symbols
This commit is contained in:
40
js/frames/packDungeon.js
Normal file
40
js/frames/packDungeon.js
Normal file
@@ -0,0 +1,40 @@
|
||||
//Create objects for common properties across available frames
|
||||
// var masks = [{src:'/img/frames/saga/sagaMaskPinline.png', name:'Pinline'}, {src:'/img/frames/m15/regular/m15MaskTitle.png', name:'Title'}, {src:'/img/frames/saga/sagaMaskType.png', name:'Type'}, {src:'/img/frames/saga/sagaMaskFrame.png', name:'Frame'}, {src:'/img/frames/saga/sagaMaskBanner.png', name:'Banner'}, {src:'/img/frames/saga/sagaMaskBannerRight.png', name:'Banner (Right)'}, {src:'/img/frames/saga/sagaMaskText.png', name:'Text'}, {src:'/img/frames/saga/sagaMaskTextRight.png', name:'Text (Right)'}, {src:'/img/frames/saga/sagaMaskBorder.png', name:'Border'}];
|
||||
//defines available frames
|
||||
availableFrames = [
|
||||
{name:'White Frame', src:'/img/frames/dungeon/regular/b.png', complementary:7},
|
||||
{name:'Blue Frame', src:'/img/frames/dungeon/regular/b.png', complementary:7},
|
||||
{name:'Black Frame', src:'/img/frames/dungeon/regular/b.png', complementary:7},
|
||||
{name:'Red Frame', src:'/img/frames/dungeon/regular/b.png', complementary:7},
|
||||
{name:'Green Frame', src:'/img/frames/dungeon/regular/b.png', complementary:7},
|
||||
{name:'Multicolored Frame', src:'/img/frames/dungeon/regular/b.png', complementary:7},
|
||||
{name:'Land Frame', src:'/img/frames/dungeon/regular/b.png', complementary:7},
|
||||
{name:'Floor', src:'/img/frames/dungeon/regular/floor.png'}
|
||||
];
|
||||
//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() {
|
||||
//resets things so that every frame doesn't have to
|
||||
await resetCardIrregularities();
|
||||
//sets card version
|
||||
card.version = 'dungeon';
|
||||
card.onload = '/js/frames/versionDungeon.js';
|
||||
loadScript('/js/frames/versionDungeon.js');
|
||||
//art bounds
|
||||
card.artBounds = {x:0, y:0, width:1, height:1};
|
||||
autoFitArt();
|
||||
//set symbol bounds
|
||||
card.setSymbolBounds = {x:0.9227, y:0.8739, width:0.12, height:0.0381, vertical:'center', horizontal: 'right'};
|
||||
resetSetSymbol();
|
||||
//watermark bounds
|
||||
card.watermarkBounds = {x:0.3027, y:0.4748, width:0.3547, height:0.6767};
|
||||
resetWatermark();
|
||||
//text
|
||||
loadTextOptions({
|
||||
title: {name:'Title', text:'', x:0.0854, y:0.0522, width:0.8292, height:0.0543, oneLine:true, font:'belerenbsc', size:0.0381, color:'white', align:'center'},
|
||||
room1: {name:'Ability 1', text:'', x:0.1334, y:0.2896, width:0.35, height:0.1786, size:0.0305},
|
||||
});
|
||||
}
|
||||
//loads available frames
|
||||
loadFramePack();
|
90
js/frames/versionDungeon.js
Normal file
90
js/frames/versionDungeon.js
Normal file
@@ -0,0 +1,90 @@
|
||||
//checks to see if it needs to run
|
||||
if (!loadedVersions.includes('/js/frames/versionDungeon.js')) {
|
||||
loadedVersions.push('/js/frames/versionDungeon.js');
|
||||
sizeCanvas('dungeon');
|
||||
document.querySelector('#creator-menu-tabs').innerHTML += '<h3 class="selectable readable-background" onclick="toggleCreatorTabs(event, `dungeon`)">Dungeon</h3>';
|
||||
var newHTML = document.createElement('div');
|
||||
newHTML.id = 'creator-menu-dungeon';
|
||||
newHTML.classList.add('hidden');
|
||||
newHTML.innerHTML = `
|
||||
<div class='readable-background padding'>
|
||||
<h5 class='padding margin-bottom input-description'>Adjust the height (first input) and chapter count (second input) of each Dungeon ability</h5>
|
||||
<textarea id='dungeon-input' type='number' class='input margin-bottom' onchange='dungeonEdited();'>0,0,16,2\n0,2,16,17</textarea>
|
||||
</div>`;
|
||||
if (!card.dungeon) {
|
||||
card.dungeon = {abilities:[1, 1, 1, 0], count:3, x:0.1, width:0.3947};
|
||||
}
|
||||
document.querySelector('#creator-menu-sections').appendChild(newHTML);
|
||||
var dungeonFX1 = new Image();
|
||||
dungeonFX1.src = '/img/frames/dungeon/walls/fx/straight.png';
|
||||
var dungeonFX2 = new Image();
|
||||
dungeonFX2.src = '/img/frames/dungeon/walls/fx/corner.png';
|
||||
var dungeonFX3 = new Image();
|
||||
dungeonFX3.src = '/img/frames/dungeon/walls/fx/t.png';
|
||||
var dungeonFX4 = new Image();
|
||||
dungeonFX4.src = '/img/frames/dungeon/walls/fx/cross.png';
|
||||
var dungeonShape1 = new Image();
|
||||
dungeonShape1.src = '/img/frames/dungeon/walls/shape/straight.png';
|
||||
var dungeonShape2 = new Image();
|
||||
dungeonShape2.src = '/img/frames/dungeon/walls/shape/corner.png';
|
||||
var dungeonShape3 = new Image();
|
||||
dungeonShape3.src = '/img/frames/dungeon/walls/shape/t.png';
|
||||
var dungeonShape4 = new Image();
|
||||
dungeonShape4.src = '/img/frames/dungeon/walls/shape/cross.png';
|
||||
// var dungeonTexture = new Image();
|
||||
// dungeonTexture.src = '/img/frames/dungeon/dungeonTexture.png';
|
||||
dungeonShape4.onload = dungeonEdited;
|
||||
}
|
||||
|
||||
function dungeonEdited() {
|
||||
//gather data
|
||||
data = document.querySelector('#dungeon-input').value;
|
||||
rooms = [];
|
||||
data.replace(/ /g, '').split('\n').forEach(room => {
|
||||
newRoom = room.split(',');
|
||||
for (i = 0; i < newRoom.length; i++) {
|
||||
newRoom[i] = parseInt(newRoom[i]);
|
||||
}
|
||||
rooms.push(newRoom);
|
||||
});
|
||||
console.log(rooms);
|
||||
|
||||
//draw to dungeon canvas
|
||||
dungeonContext.clearRect(0, 0, dungeonCanvas.width, dungeonCanvas.height);
|
||||
|
||||
|
||||
drawTextBuffer();
|
||||
drawCard();
|
||||
}
|
||||
|
||||
//Data structures...
|
||||
|
||||
class Vertex {
|
||||
constructor(x = 0, y = 0, up = false, down = false, left = false, right = false) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.up = up;
|
||||
this.down = down;
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
}
|
||||
}
|
||||
|
||||
class Graph {
|
||||
// defining vertex array and
|
||||
// adjacent list
|
||||
constructor(noOfVertices)
|
||||
{
|
||||
this.noOfVertices = noOfVertices;
|
||||
this.AdjList = new Map();
|
||||
}
|
||||
|
||||
// functions to be implemented
|
||||
|
||||
// addVertex(v)
|
||||
// addEdge(v, w)
|
||||
// printGraph()
|
||||
|
||||
// bfs(v)
|
||||
// dfs(v)
|
||||
}
|
Reference in New Issue
Block a user