Skip to content

Commit

Permalink
Release v5.3.0
Browse files Browse the repository at this point in the history
- Improved backend significantly.
- Major lag optimizations.
- Made scanning MUCH faster and more reliable.
- Rooms are loaded from the hotbar map.
- Fixed capitalization in file names.
- Added new dungeon logging system (WIP) using /logs <Floor>.
- Significantly improved Wither Door ESP.
- Fixed dungeon logging not logging dungeons.
- Improved /visited command.
- Can now type part of room name for /visited <roomName>. Eg '/visited ice'.
- Added Dungeon Viewer gui to view past dungeons (WIP).
- Fixed Mimic detection not working at all.
- Fixed room color not changing with mimic.
- BetterMap - style clear breakdown at the end including time spent in rooms.
- Fixed player icons not scaling correctly from the hotbar map.
- Added player room enter/exit events.
  • Loading branch information
UnclaimedBloom6 committed May 19, 2023
1 parent 21fab11 commit 1a71b74
Show file tree
Hide file tree
Showing 22 changed files with 5,752 additions and 2,671 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
IllegalMap/data/data.json
IllegalMap/config.toml
IllegalMap/data/dungeonLogs.json
IllegalMap/data/dungeonLogs.json
IllegalMap/data/dungeons.txt
778 changes: 383 additions & 395 deletions IllegalMap/Components/DmapDungeon.js

Large diffs are not rendered by default.

114 changes: 74 additions & 40 deletions IllegalMap/Components/Door.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,90 @@
import { Color } from "../../BloomCore/utils/Utils"
import { getGridCoords } from "../utils"
import Config from "../data/Config"
import Dungeon from "../../BloomCore/dungeons/Dungeon"
import { chunkLoaded, Color, colorShift } from "../../BloomCore/utils/Utils"
import { DoorTypes, setPixels } from "../utils"
import Config from "../data/Config"

const doorTypeColors = new Map([
[DoorTypes.NORMAL, new Color(92/255, 52/255, 14/255, 1)],
[DoorTypes.ENTRANCE, new Color(20/255, 133/255, 0, 1)],
[DoorTypes.BLOOD, new Color(231/255, 0, 0, 1)]
])

/**
* Creates a door.
* x, z are real coordinates in the world.
*/
export class Door {
/**
*
* @param {Number} x - Real world x coordinate of where the door is.
* @param {Number} z - z coordinate
* @param {String} type - The door type. Eg "entrance", "blood" etc. All lower-case.
*/
constructor(x, z, type=null) {
const canBeOpened = [
DoorTypes.ENTRANCE,
DoorTypes.WITHER,
DoorTypes.BLOOD
]

export default class Door {
constructor(x, z, gx, gz) {
this.childRoom = null // The room which leads deeper into the dungeon
this.parentRoom = null // The room closest to the entrance

this.type = DoorTypes.NORMAL
this.rotation = null // 0 has rooms above/below, 90 has rooms either side. 180/270 rotation not possible.
this.highlighted = false

this.explored = false
this.opened = true // Only for Wither and Blood doors. This is just so that the dungeon logging doesn't log opened wither doors as normal doors.

// World x/z coordinates
this.x = x
this.z = z
this.type = type || "normal"
this.explored = false
this.gX = null
this.gZ = null
this.color = null
this.init()
}
init() {
[this.gX, this.gZ] = getGridCoords([this.x, this.z], true)
this.updateDoorType()
this.color = this.getColor()
}
updateDoorType() {
let id = World.getBlockAt(this.x, 69, this.z)?.type?.getID() || 0
if (id == 159) this.type = "blood"
else if (id == 97) this.type = "entrance"
else if (id == 173) this.type = "wither"
else this.type = "normal"

this.color = this.getColor()
// Map x/z coordinates (0-10)
this.gx = gx
this.gz = gz

// Dummy doors have an x and z of 0
if (x == 0 && z == 0) return

this.updateType()
}
getColor() {
let color = new Color(92/255, 52/255, 14/255, 1)
if (this.type == "wither") color = Config.witherDoorColor
if (this.type == "blood") color = new Color(231/255, 0/255, 0/255, 1)
if (this.type == "entrance") color = new Color(20/255, 133/255, 0/255, 1)
let color = doorTypeColors.get(this.type)

if (!this.explored && Dungeon.time && Config.darkenUnexplored) return color.darker().darker()
// Custom wither door color
if (this.type == DoorTypes.WITHER) color = Config.witherDoorColor

// Display opened wither doors as normal doors
if (this.type == DoorTypes.WITHER && this.opened) color = doorTypeColors.get(DoorTypes.NORMAL)

// Unused in the main module currently.o
if (this.highlighted) color = colorShift(color, Color.GREEN, 0.2)

// Darken unexplored
if (!this.explored && Dungeon.time && Config.darkenUnexplored) color = color.darker().darker()
return color
}
draw(bufferedImage) {
setPixels(bufferedImage, this.gx*2+1, this.gz*2+1, 1, 1, this.getColor())
}
updateType() {
if (!chunkLoaded(this.x, 69, this.z)) return

const id = World.getBlockAt(this.x, 69, this.z).type.getID()

if (id == 0 || id == 166) return

if (id == 97) this.type = DoorTypes.ENTRANCE
if (id == 173) this.type = DoorTypes.WITHER
if (id == 159) this.type = DoorTypes.BLOOD

this.opened = false
}
checkOpened() {
if (!canBeOpened.includes(this.type) || !chunkLoaded(this.x, 69, this.z)) return

this.opened = World.getBlockAt(this.x, 69, this.z).type.getID() == 0
}
setType(type) {
this.type = type
return this
}
getCoords() {
return [this.x, 69, this.z]
}
toString() {
return `Door[xz=${this.x},${this.z}, gXgZ=${this.gX},${this.gZ} type=${this.type}, explored=${this.explored}]`
return `Door[&7component=${JSON.stringify([this.gx, this.gz])}&f, &dx=${this.x}&f, &dz=${this.z}&f, &erotation=${this.rotation}&f, &aopen=${this.opened}&f]`
}
}
Loading

0 comments on commit 1a71b74

Please sign in to comment.