Documentation ¶
Overview ¶
Package gendung implements dungeon generation utility functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // NPCNumMap contains the NPC numbers of the map. The NPC number represents a // towner number (towners array index) in Tristram and a monster number // (monsters array index) in the dungeon. // // ref: 0x52D208 NPCNumMap = new([112][112]int32) // TileIDMap contains the tile IDs of the map. // // PSX ref: 0x800E40C4 // PSX def: unsigned short dungeon[48][48] // // ref: 0x539608 TileIDMap = new([40][40]uint8) // ObjectNumMap contains the object numbers (objects array indices) of the // map. // // ref: 0x539C48 ObjectNumMap = new([112][112]int8) // TileIDMapBackup contains a backup of the tile IDs of the map. // // PSX ref: 0x800E52C4 // PSX def: unsigned char pdungeon[40][40] // // ref: 0x53CD50 TileIDMapBackup = new([40][40]uint8) // DeadMap contains the dead numbers (deads array indices) and dead direction // of the map, encoded as specified by the pseudo-code below. // // deadNum = DeadMap[col][row]&0x1F // direction = DeadMap[col][row]>>5 // // ref: 0x53D390 DeadMap = new([112][112]int8) // TransparencyIndex specifies the current transparency category. // // PSX ref: 0x8011C148 // PSX def: char TransVal // // ref: 0x5A5590 TransparencyIndex = new(int8) // PieceIDMap contains the piece IDs of each tile on the map. // // ref: 0x5A5BD8 PieceIDMap = new([112][112]int32) // LightingVisibleDistanceMap specifies the visible distance of light // effects. // // ref: 0x5B1FD8 LightingVisibleDistanceMap = new([112][112]int8) // TileDefs specifies the tile definitions of the active dungeon type; (e.g. // levels/l1data/l1.til). // // ref: 0x5B70DC TileDefs = new(*til.Tile) // DPieceDefs specifies the dungeon piece definitions (a.k.a. miniture tiles) // of the active dungeon type; (e.g. levels/l1data/l1.min). // // ref: 0x5B70E0 DPieceDefs = new(*min.Block) // TransparencyMap specifies the transparency at each coordinate of the map. // // PSX ref: 0x800E7A28 // PSX def: map_info dung_map[112][112] // dTransVal struct member // // ref: 0x5B78EC TransparencyMap = new([112][112]int8) // DType specifies the active dungeon type of the current game. // // PSX ref: 0x8011C10D // PSX def: unsigned char leveltype // // ref: 0x5BB1ED DType = new(DungeonType) // DLvl specifies the active dungeon level of the current game. // // PSX ref: 0x8011C10C // PSX def: unsigned char currlevel // // ref: 0x5BB1EE DLvl = new(uint8) // TransparencyActive specifies the active transparency indices. // // PSX ref: 0x800E7928 // PSX def: unsigned char TransList[256] // // ref: 0x5BB1F0 TransparencyActive = new([256]bool) // LevelCEL points to the contents of the active tileset, which is one of // "levels/towndata/town.cel", "levels/l1data/l1.cel", // "levels/l2data/l2.cel", "levels/l3data/l3.cel" or "levels/l4data/l4.cel". // // ref: 0x5BDB0C LevelCEL = new(*uint8) // PlayerNumMap contains the player numbers (players array indices) of the // map. // // ref: 0x5BFEF8 PlayerNumMap = new([112][112]int8) // ArchNumMap contains the arch frame numbers of the map from the special // tileset (e.g. "levels/l1data/l1s.cel"). Note, the special tileset of // Tristram (i.e. "levels/towndata/towns.cel") contains trees rather than // arches. // // ref: 0x5C3008 ArchNumMap = new([112][112]int8) // LevelSpecialCEL points to the contents of the active special tileset, // which is one of "levels/towndata/towns.cel", "levels/l1data/l1s.cel" or // "levels/l2data/l2s.cel". // // ref: 0x5C690C LevelSpecialCEL = new(*uint8) // DFlagMap specifies flags used for dungeon generation. // // ref: 0x5C6910 DFlagMap = new([112][112]DFlag) // ItemNumMap contains the item numbers (items array indices) of the map. // // ref: 0x5C9A10 ItemNumMap = new([112][112]int8) // SetHeight specifies the height of the active miniset of the map. // // PSX ref: 0x8011C0F0 // PSX def: int setpc_h // // ref: 0x5CF330 SetHeight = new(int32) // SetWidth specifies the width of the active miniset of the map. // // PSX ref: 0x8011C0EC // PSX def: int setpc_w // // ref: 0x5CF334 SetWidth = new(int32) // SetXx specifies the active miniset x-coordinate of the map. // // PSX ref: 0x8011C0E4 // PSX def: int setpc_x // // ref: 0x5CF338 SetXx = new(int32) // IsQuestLevel specifies whether the active level is a quest level. // // ref: 0x5CF31D IsQuestLevel = new(bool) // LvlViewY specifies the level viewpoint y-coordinate of the map. // // PSX ref: 0x8011C130 // PSX def: int LvlViewY // // ref: 0x5CF320 LvlViewY = new(int32) // LvlViewX specifies the level viewpoint x-coordinate of the map. // // PSX ref: 0x8011C12C // PSX def: int LvlViewX // // ref: 0x5CF324 LvlViewX = new(int32) // ViewX specifies the player viewpoint x-coordinate of the map. // // PSX ref: 0x8011C114 // PSX def: int ViewX // // ref: 0x5CF33C ViewX = new(int32) // ViewY specifies the player viewpoint y-coordinate of the map. // // PSX ref: 0x8011C118 // PSX def: int ViewY // // ref: 0x5CF340 ViewY = new(int32) // SetYy specifies the active miniset y-coordinate of the map. // // PSX ref: 0x8011C0E8 // PSX def: int setpc_y // // ref: 0x5CF344 SetYy = new(int32) // MissileNumMap contains the missile numbers (missiles array indices) of the // map. // // ref: 0x5CF350 MissileNumMap = new([112][112]int8) )
Global variables.
Functions ¶
func CopyTransparency ¶
func CopyTransparency(srcX, srcY, dstX, dstY int)
CopyTransparency copies transparency from the source to the destination coordinate.
PSX ref: 0x8015A158 PSX def: void DRLG_CopyTrans__Fiiii(int sx, int sy, int dx, int dy)
ref: 0x419515
func InitSetPiece ¶
func InitSetPiece()
InitSetPiece initializes the placement variables of the set piece (quest dungeon).
PSX ref: 0x8015A2A4 PSX def: void DRLG_InitSetPC__Fv()
ref: 0x4195A2
func InitTransparency ¶
func InitTransparency()
InitTransparency initializes transparency.
PSX ref: 0x8015A070 PSX def: void DRLG_InitTrans__Fv()
ref: 0x41944A
func MakeRectTransparent ¶
func MakeRectTransparent(xxStart, yyStart, xxEnd, yyEnd int)
MakeRectTransparent makes the given rectangle transparent.
PSX ref: 0x800578DC PSX def: void DRLG_MRectTrans__Fiiii(int x1, int y1, int x2, int y2)
ref: 0x419477
func MarkSetPiece ¶
func MarkSetPiece()
MarkSetPiece marks the area of the set piece (quest dungeon).
PSX ref: 0x8015A2BC PSX def: void DRLG_SetPC__Fv()
ref: 0x4195B9
func RectTransparent ¶
func RectTransparent(xStart, yStart, xEnd, yEnd int)
RectTransparent makes the given rectangle transparent.
PSX ref: 0x8015A0E4 PSX def: void DRLG_RectTrans__Fiiii(int x1, int y1, int x2, int y2)
ref: 0x4194D0
Types ¶
type DFlag ¶
type DFlag uint8
DFlag represents a set of flags used for dungeon generation.
const (
DFlag08 DFlag = 0x08
)
Dungeon generation flags.
type DungeonType ¶
type DungeonType uint8
DungeonType specifies a dungeon type.
const ( Tristram DungeonType = iota // dlvl: 0 Cathedral // dlvl: 1 - 4 Catacombs // dlvl: 5 - 8 Caves // dlvl: 9 - 12 Hell // dlvl: 13 - 16 DTypeNone DungeonType = 0xFF )
Dungeon types.