-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
173 changed files
with
1,519 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/sprites/ | ||
/enemies.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
var minx = 1/0, maxx = -1/0, miny = 1/0, maxy = -1/0 | ||
|
||
var dedup = /^(.+?) [0-9]+/ | ||
|
||
var emenies = [] | ||
;(() => { | ||
for(let i = 0; i < data.length; i++) { | ||
let it = data[i] | ||
if(it[2].startsWith('Cave')) continue; | ||
|
||
it.hp = it[0] | ||
it.xp = it[1] | ||
it.name = it[2] | ||
it.name_dedup = it.name.replace(dedup, "$1") | ||
it.x = it[3] | ||
it.y = it[4] | ||
emenies.push(it) | ||
|
||
minx = Math.min(minx, it.x) | ||
maxx = Math.max(maxx, it.x) | ||
miny = Math.min(miny, it.y) | ||
maxy = Math.max(maxy, it.y) | ||
} | ||
})() | ||
|
||
var view = document.getElementById('view') | ||
var container = document.getElementById('cont') | ||
|
||
var mx = (maxx - minx) | ||
var my = (maxy - miny) | ||
var mm = Math.max(mx, my) | ||
var dd = 990 / mm | ||
|
||
function cx(i) { | ||
return 5 + (i - minx) * dd | ||
} | ||
function cy(i) { | ||
return 5 + (maxy - i) * dd | ||
} | ||
|
||
function updSize(scale) { | ||
document.body.style.setProperty('--size2', 10 / Math.max(scale, 5) + "px") | ||
} | ||
|
||
;(() => { | ||
for(let i = 0; i < emenies.length; i++) { | ||
let it = emenies[i] | ||
|
||
var img = document.createElement('img') | ||
img.src = 'sprites-dedup/' + it.name_dedup + '.png' | ||
img.title = it.name + ' (' + it.hp + 'hp)'; | ||
img.draggable = "false" | ||
// + ' (' + it.x + ', ' + it.y + ')'; | ||
let x = cx(it.x); | ||
let y = cy(it.y); | ||
img.style.left = x + 'px' | ||
img.style.top = y + 'px' | ||
img.classList.add('enemy') | ||
if(x < 0 || x > 1000) console.log("x", x) | ||
if(y < 0 || y > 1000) console.log("y", y) | ||
view.appendChild(img) | ||
} | ||
|
||
var originX = 0, originY = 0; | ||
var scale = 1; | ||
|
||
container.addEventListener('wheel', (e) => { | ||
e.preventDefault(); | ||
const rect = view.getBoundingClientRect(); | ||
const offsetX = originX + e.clientX - rect.left; | ||
const offsetY = originY + e.clientY - rect.top; | ||
|
||
const zoomFactor = 0.004; | ||
var delta = 1 + Math.abs(e.deltaY) * -zoomFactor; | ||
if(e.deltaY < 0) delta = 1 / delta | ||
|
||
const newScale = Math.min(Math.max(0.2, scale * delta), 25); | ||
|
||
const tx = offsetX + (originX - offsetX) * (newScale / scale) | ||
const ty = offsetY + (originY - offsetY) * (newScale / scale) | ||
|
||
scale = newScale; | ||
originX = tx; | ||
originY = ty; | ||
view.style.transform = `matrix(${scale}, 0, 0, ${scale}, ${tx}, ${ty}` | ||
updSize(scale) | ||
}); | ||
updSize(scale) | ||
|
||
let isPanning = false; | ||
let prevX, prevY; | ||
|
||
container.addEventListener('mousedown', (e) => { | ||
isPanning = true; | ||
prevX = e.clientX | ||
prevY = e.clientY | ||
}); | ||
|
||
container.addEventListener('mouseup', () => { | ||
isPanning = false; | ||
}); | ||
|
||
container.addEventListener('mousemove', (e) => { | ||
if (isPanning) { | ||
var curX = e.clientX | ||
var curY = e.clientY | ||
|
||
originX = originX + (curX - prevX) | ||
originY = originY + (curY - prevY) | ||
|
||
view.style.transform = `matrix(${scale}, 0, 0, ${scale}, ${originX}, ${originY}` | ||
prevX = curX | ||
prevY = curY | ||
} | ||
}); | ||
|
||
view.addEventListener('mouseleave', () => { | ||
isPanning = false; | ||
}); | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<title>Enemies hp and xp</title> | ||
<style> | ||
#cont { | ||
width: 100%; | ||
height: 100%; | ||
box-sizing: border-box; | ||
overflow: hidden; | ||
} | ||
#view { | ||
transform-origin: top left; | ||
position: relative; | ||
width: 1000px; | ||
height: 1000px; | ||
} | ||
body { | ||
--size2: 2px; | ||
} | ||
.enemy { | ||
position: absolute; | ||
width: calc(var(--size2) * 2); | ||
height: calc(var(--size2) * 2); | ||
transform: translate(calc(-1 * var(--size2)), calc(-1 * var(--size2))); | ||
} | ||
.overworld { | ||
position: absolute; | ||
top: -19px; | ||
left: -9px; | ||
transform-origin: top left; | ||
transform: scale(0.3206); /*translate(-1580px, 430px);*/ | ||
} | ||
.d3 { | ||
position: absolute; | ||
top: 135px; | ||
left: 826px; | ||
transform-origin: top left; | ||
transform: scale(0.13); | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="cont"> | ||
<div id="view"> | ||
<img src="overworld.png" class="overworld" draggable="false"> | ||
<img src="d3.png" class="d3" draggable="false"> | ||
</div> | ||
</div> | ||
|
||
<script src="data.js"></script> | ||
<script src="display.js"></script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import re | ||
import json | ||
import hashlib | ||
import shutil | ||
|
||
def remove(str): | ||
pat = r'^(.+?) [0-9]+' | ||
rep = r'\1' | ||
return re.sub(pat, rep, str) | ||
|
||
|
||
def calculate_file_hash(file_path): | ||
md5_hash = hashlib.md5() | ||
with open(file_path, "rb") as f: | ||
for byte_block in iter(lambda: f.read(4096), b""): | ||
md5_hash.update(byte_block) | ||
return md5_hash.hexdigest() | ||
|
||
hashes = {} | ||
|
||
with open('data.js', 'r') as f: | ||
data = json.load(f) | ||
for item in data: | ||
name = remove(item[2]) | ||
if name not in hashes: | ||
hashes[name] = 0 | ||
shutil.copy("sprites/" + item[2] + ".png", 'sprites-dedup/' + name + '.png') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+5.44 KB
sprites-dedup/Dungeon3 Dungeon3 021 CrosserT1 S2 Solid Tourniquet Dg3.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.