Compare commits
90 Commits
9c0e546887
...
renovate/a
| Author | SHA1 | Date | |
|---|---|---|---|
| e74a4e4656 | |||
| 441072811e | |||
| f12f007b28 | |||
| 02b0a19aa4 | |||
| 675164df57 | |||
| b6b97bf11f | |||
| 1d991ddaf5 | |||
| 2b12ab95e6 | |||
| 5720200e32 | |||
| 86636b1d89 | |||
| 697e2b765c | |||
| 594583f7f1 | |||
| 77ed37f853 | |||
| 308630d306 | |||
| c389a0806a | |||
| cdfebbec7b | |||
| 7296368bf4 | |||
| 6b3593a2f5 | |||
| 71d1a31d0f | |||
| a47fd370d7 | |||
| 0fa1670aa0 | |||
| a5988c9ce3 | |||
| e64d6efd98 | |||
| de56c96884 | |||
| bcb749682f | |||
| c331b04f0e | |||
| 3210ac3389 | |||
| bf31ef75f6 | |||
| a2cb3d7166 | |||
| d85910bd20 | |||
| 977b40d5e8 | |||
| 05db5b566f | |||
| d5c423e94f | |||
| 174ebb3aa5 | |||
| 15774db12d | |||
| 390406145f | |||
| 08e63fc99a | |||
| fa8ced3b05 | |||
| e60e895fe3 | |||
| 2123b32615 | |||
| cd14b20f2e | |||
| 36ffbfed1d | |||
| 10c836d987 | |||
| e98521c1c4 | |||
| ffecdba71d | |||
| 269135318c | |||
| 56d6d88ef3 | |||
| 91dac008dc | |||
| 8fba60a5e8 | |||
| aa596b8b81 | |||
| e3561d3fe2 | |||
| c1d19fa106 | |||
| f7df41cbeb | |||
| d4654d8113 | |||
| 0dda955141 | |||
| b1e06dec5d | |||
| 0bbfe859a3 | |||
| 1f491c017c | |||
| 6accff6ca5 | |||
| 7a5341a986 | |||
| 212f8d870d | |||
| 41b8407f5d | |||
| e85057ebfc | |||
| 02d92d928b | |||
| b918f88db5 | |||
| 858d557a3b | |||
| 84fef1c758 | |||
| 62c225b5dd | |||
| 9c98b848f5 | |||
| e2dbdc1bbf | |||
| f91daaf46a | |||
| 931cf083e8 | |||
| d4a6d9aef8 | |||
| c03cd1208c | |||
| 99941e701b | |||
| bf80ced3e0 | |||
| a8e53b6e73 | |||
| e35a8b14d6 | |||
| 3049210660 | |||
| 7e6309d777 | |||
| eeb4b5f089 | |||
|
7bab0c7123
|
|||
|
596c04d791
|
|||
| 90d60ff54c | |||
| 162fb413a5 | |||
|
34c4aa35fc
|
|||
|
d4892e33bd
|
|||
|
5a00ebf1f1
|
|||
|
c1893aec74
|
|||
|
0511c00f09
|
9
.drone.yml
Executable file
9
.drone.yml
Executable file
@@ -0,0 +1,9 @@
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: "test"
|
||||
steps:
|
||||
- name: test
|
||||
image: harbor.front.kjuulh.io/docker-proxy/library/bash:latest
|
||||
commands:
|
||||
- echo 'Run tests'
|
||||
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
@@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
99
.idea/workspace.xml
generated
Normal file
99
.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="CMakeSettings">
|
||||
<configurations>
|
||||
<configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" />
|
||||
</configurations>
|
||||
</component>
|
||||
<component name="CargoProjects">
|
||||
<cargoProject FILE="$PROJECT_DIR$/Cargo.toml" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="a9f5cad0-d253-42e8-a38a-89dfec417dbc" name="Changes" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/map_builders/drunkard.rs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/savegame.json" beforeDir="false" afterPath="$PROJECT_DIR$/savegame.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/map_builders/common.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/map_builders/common.rs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/map_builders/mod.rs" beforeDir="false" afterPath="$PROJECT_DIR$/src/map_builders/mod.rs" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ClangdSettings">
|
||||
<option name="formatViaClangd" value="false" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="GitSEFilterConfiguration">
|
||||
<file-type-list>
|
||||
<filtered-out-file-type name="LOCAL_BRANCH" />
|
||||
<filtered-out-file-type name="REMOTE_BRANCH" />
|
||||
<filtered-out-file-type name="TAG" />
|
||||
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
|
||||
</file-type-list>
|
||||
</component>
|
||||
<component name="MacroExpansionManager">
|
||||
<option name="directoryName" value="7zted9t8" />
|
||||
</component>
|
||||
<component name="MarkdownSettingsMigration">
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
<component name="ProjectId" id="24PyiDwZbQQQ0gzNvMewyQ4Zryi" />
|
||||
<component name="ProjectLevelVcsManager">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="RunOnceActivity.cidr.known.project.marker" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="cf.first.check.clang-format" value="false" />
|
||||
<property name="cidr.known.project.marker" value="true" />
|
||||
<property name="node.js.detected.package.eslint" value="true" />
|
||||
<property name="node.js.detected.package.tslint" value="true" />
|
||||
<property name="node.js.selected.package.eslint" value="(autodetect)" />
|
||||
<property name="node.js.selected.package.tslint" value="(autodetect)" />
|
||||
<property name="nodejs_package_manager_path" value="npm" />
|
||||
<property name="org.rust.cargo.project.model.PROJECT_DISCOVERY" value="true" />
|
||||
<property name="settings.editor.selected.configurable" value="reference.settingsdialog.project.grazie" />
|
||||
</component>
|
||||
<component name="RustProjectSettings">
|
||||
<option name="toolchainHomeDirectory" value="$USER_HOME$/.cargo/bin" />
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="a9f5cad0-d253-42e8-a38a-89dfec417dbc" name="Changes" comment="" />
|
||||
<created>1643546643557</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1643546643557</updated>
|
||||
<workItem from="1643546645546" duration="12996000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
200
Cargo.lock
generated
200
Cargo.lock
generated
@@ -1,6 +1,6 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "ab_glyph_rasterizer"
|
||||
@@ -22,9 +22,14 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
|
||||
|
||||
[[package]]
|
||||
name = "ahash"
|
||||
version = "0.3.8"
|
||||
version = "0.7.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217"
|
||||
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"once_cell",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
@@ -62,15 +67,15 @@ checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0"
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.5.2"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
||||
checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
|
||||
|
||||
[[package]]
|
||||
name = "atom"
|
||||
version = "0.3.6"
|
||||
name = "atomic_refcell"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c9ff149ed9780025acfdb36862d35b28856bb693ceb451259a7164442f22fdc3"
|
||||
checksum = "112ef6b3f6cb3cb6fc5b6b494ef7a848492cff1ab0ef4de10b0f7d572861c905"
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
@@ -441,13 +446,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-queue"
|
||||
version = "0.2.3"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570"
|
||||
checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.10",
|
||||
"crossbeam-utils 0.7.2",
|
||||
"maybe-uninit",
|
||||
"cfg-if 1.0.0",
|
||||
"crossbeam-utils 0.8.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -498,7 +502,7 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"strsim",
|
||||
"syn",
|
||||
"syn 1.0.105",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -509,7 +513,7 @@ checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 1.0.105",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -530,7 +534,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 1.0.105",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -750,16 +754,6 @@ dependencies = [
|
||||
"gl_generator",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96282e96bfcd3da0d3aa9938bedf1e50df3269b6db08b4876d2da0bb1a0841cf"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.1.19"
|
||||
@@ -771,11 +765,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "hibitset"
|
||||
version = "0.6.3"
|
||||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93a1bb8316a44459a7d14253c4d28dd7395cbd23cc04a68c46e851b8e46d64b1"
|
||||
checksum = "f3ede5cfa60c958e60330d65163adbc4211e15a2653ad80eb0cce878de120121"
|
||||
dependencies = [
|
||||
"atom",
|
||||
"rayon",
|
||||
]
|
||||
|
||||
@@ -921,6 +914,22 @@ dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "macro_rules_attribute"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf0c9b980bf4f3a37fd7b1c066941dd1b1d0152ce6ee6e8fe8c49b9f6810d862"
|
||||
dependencies = [
|
||||
"macro_rules_attribute-proc_macro",
|
||||
"paste",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "macro_rules_attribute-proc_macro"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "58093314a45e00c77d5c508f76e77c3396afbbc0d01506e7fae47b018bac2b1d"
|
||||
|
||||
[[package]]
|
||||
name = "malloc_buf"
|
||||
version = "0.0.6"
|
||||
@@ -930,12 +939,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "maybe-uninit"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.4.1"
|
||||
@@ -1028,12 +1031,6 @@ dependencies = [
|
||||
"ws2_32-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mopa"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a785740271256c230f57462d3b83e52f998433a7062fc18f96d5999474a9f915"
|
||||
|
||||
[[package]]
|
||||
name = "ndk"
|
||||
version = "0.2.1"
|
||||
@@ -1070,7 +1067,7 @@ dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 1.0.105",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1135,6 +1132,27 @@ dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nougat"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97b57b9ced431322f054fc673f1d3c7fa52d80efd9df74ad2fc759f044742510"
|
||||
dependencies = [
|
||||
"macro_rules_attribute",
|
||||
"nougat-proc_macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nougat-proc_macros"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c84f77a45e99a2f9b492695d99e1c23844619caa5f3e57647cffacad773ca257"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.105",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.44"
|
||||
@@ -1205,7 +1223,7 @@ dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 1.0.105",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1275,6 +1293,12 @@ dependencies = [
|
||||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "paste"
|
||||
version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
|
||||
|
||||
[[package]]
|
||||
name = "percent-encoding"
|
||||
version = "2.1.0"
|
||||
@@ -1316,18 +1340,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.36"
|
||||
version = "1.0.89"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
|
||||
checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e"
|
||||
dependencies = [
|
||||
"unicode-xid",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.15"
|
||||
version = "1.0.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145"
|
||||
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
@@ -1464,9 +1488,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
||||
|
||||
[[package]]
|
||||
name = "rltk"
|
||||
version = "0.8.1"
|
||||
version = "0.8.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c83076f8174384edf79d3f4a91934b8c0e1feed6eed943608d54af790f0a7dd"
|
||||
checksum = "30587bc9361fc5600650d17ad6b9a91bb6a290f9d06a434dc48198d22ead7543"
|
||||
dependencies = [
|
||||
"bracket-lib",
|
||||
]
|
||||
@@ -1536,33 +1560,45 @@ checksum = "a0eddf2e8f50ced781f288c19f18621fa72a3779e3cb58dbf23b07469b0abeb4"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.136"
|
||||
version = "1.0.228"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
|
||||
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
||||
dependencies = [
|
||||
"serde_core",
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_core"
|
||||
version = "1.0.228"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.136"
|
||||
version = "1.0.228"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
|
||||
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 2.0.82",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.78"
|
||||
version = "1.0.145"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085"
|
||||
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"memchr",
|
||||
"ryu",
|
||||
"serde",
|
||||
"serde_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1577,13 +1613,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "shred"
|
||||
version = "0.10.2"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c5f08237e667ac94ad20f8878b5943d91a93ccb231428446c57c21c57779016d"
|
||||
checksum = "dc6b2cd1ccb08cf2b25d75c936e0cc9c8cb93c39a83814956da32653236338c0"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"arrayvec",
|
||||
"hashbrown",
|
||||
"mopa",
|
||||
"atomic_refcell",
|
||||
"rayon",
|
||||
"smallvec",
|
||||
"tynm",
|
||||
@@ -1637,14 +1673,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "specs"
|
||||
version = "0.16.1"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fff28a29366aff703d5da8a7e2c8875dc8453ac1118f842cbc0fa70c7db51240"
|
||||
checksum = "a60eabdfd5a80e458c3e7bcc9f1076d6ce3cc8ddb71d69691f00fc0de735a635"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"crossbeam-queue",
|
||||
"hashbrown",
|
||||
"hibitset",
|
||||
"log",
|
||||
"nougat",
|
||||
"rayon",
|
||||
"serde",
|
||||
"shred",
|
||||
@@ -1660,7 +1697,7 @@ checksum = "3e23e09360f3d2190fec4222cd9e19d3158d5da948c0d1ea362df617dd103511"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 1.0.105",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1671,13 +1708,24 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.86"
|
||||
version = "1.0.105"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b"
|
||||
checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-xid",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.82"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1697,7 +1745,7 @@ checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 1.0.105",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1739,9 +1787,9 @@ checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc"
|
||||
|
||||
[[package]]
|
||||
name = "tuple_utils"
|
||||
version = "0.3.0"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1"
|
||||
checksum = "cffaaf9392ef73cd30828797152476aaa2fa37a17856934fa63d4843f34290e9"
|
||||
|
||||
[[package]]
|
||||
name = "tynm"
|
||||
@@ -1762,10 +1810,10 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
version = "0.2.2"
|
||||
name = "unicode-ident"
|
||||
version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||
checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
@@ -1811,7 +1859,7 @@ dependencies = [
|
||||
"log",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 1.0.105",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
@@ -1833,7 +1881,7 @@ checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
"syn 1.0.105",
|
||||
"wasm-bindgen-backend",
|
||||
"wasm-bindgen-shared",
|
||||
]
|
||||
|
||||
@@ -6,8 +6,8 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
rltk = { version = "0.8.0", features = ["serde"] }
|
||||
specs = { version = "0.16.1", features = ["serde"] }
|
||||
rltk = { version = "0.8.7", features = ["serde"] }
|
||||
specs = { version = "0.20.0", features = ["serde"] }
|
||||
specs-derive = { version = "0.4.1" }
|
||||
serde = { version = "^1.0.44", features = ["derive"] }
|
||||
serde_json = "1.0.44"
|
||||
serde = { version = "^1.0.202", features = ["derive"] }
|
||||
serde_json = "1.0.117"
|
||||
|
||||
3
renovate.json
Normal file
3
renovate.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -11,6 +11,18 @@ pub struct Position {
|
||||
pub y: i32,
|
||||
}
|
||||
|
||||
impl Position {
|
||||
pub fn new(x: i32, y: i32) -> Self {
|
||||
Self { x, y }
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Position {
|
||||
fn default() -> Self {
|
||||
Self { x: 0, y: 0 }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Component, ConvertSaveload, Clone)]
|
||||
pub struct Renderable {
|
||||
pub glyph: rltk::FontCharType,
|
||||
|
||||
@@ -24,7 +24,6 @@ use crate::particle_system::ParticleSpawnSystem;
|
||||
use crate::state::{RunState, State};
|
||||
use crate::trigger_system::TriggerSystem;
|
||||
|
||||
|
||||
mod components;
|
||||
mod damage_system;
|
||||
mod gamelog;
|
||||
|
||||
@@ -4,8 +4,6 @@ use rltk::{Algorithm2D, BaseMap, FontCharType, Point, Rltk, RGB};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use specs::prelude::*;
|
||||
|
||||
|
||||
|
||||
#[derive(PartialEq, Copy, Clone, Serialize, Deserialize)]
|
||||
pub enum TileType {
|
||||
Wall,
|
||||
|
||||
22
src/map_builders/bsp/mod.rs
Normal file
22
src/map_builders/bsp/mod.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use crate::{Map, TileType};
|
||||
|
||||
#[inline(always)]
|
||||
pub fn draw_corridor(map: &mut Map, x1: i32, y1: i32, x2: i32, y2: i32) {
|
||||
let mut x = x1;
|
||||
let mut y = y1;
|
||||
|
||||
while x != x2 || y != y2 {
|
||||
if x < x2 {
|
||||
x += 1;
|
||||
} else if x > x2 {
|
||||
x -= 1;
|
||||
} else if y < y2 {
|
||||
y += 1;
|
||||
} else if y > y2 {
|
||||
y -= 1;
|
||||
}
|
||||
|
||||
let idx = map.xy_idx(x, y);
|
||||
map.tiles[idx] = TileType::Floor;
|
||||
}
|
||||
}
|
||||
214
src/map_builders/bsp_dungeon.rs
Normal file
214
src/map_builders/bsp_dungeon.rs
Normal file
@@ -0,0 +1,214 @@
|
||||
use rltk::{Point, RandomNumberGenerator};
|
||||
|
||||
use crate::map_builders::common::apply_room_to_map;
|
||||
use crate::map_builders::{bsp, MapBuilder};
|
||||
use crate::rect::Rect;
|
||||
use crate::{spawner, Map, Position, TileType, World, SHOW_MAPGEN_VISUALIZER};
|
||||
|
||||
pub struct BspDungeonBuilder {
|
||||
map: Map,
|
||||
starting_position: Position,
|
||||
depth: i32,
|
||||
rooms: Vec<Rect>,
|
||||
history: Vec<Map>,
|
||||
rects: Vec<Rect>,
|
||||
}
|
||||
|
||||
impl BspDungeonBuilder {
|
||||
pub fn new(new_depth: i32) -> Self {
|
||||
Self {
|
||||
starting_position: Position { x: 0, y: 0 },
|
||||
depth: new_depth,
|
||||
rects: Vec::new(),
|
||||
map: Map::new(new_depth),
|
||||
history: Vec::new(),
|
||||
rooms: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
fn build(&mut self) {
|
||||
let mut rng = RandomNumberGenerator::new();
|
||||
self.rects.clear();
|
||||
|
||||
self.place_rooms(&mut rng);
|
||||
self.place_corridors(&mut rng);
|
||||
self.place_stairs();
|
||||
self.place_start();
|
||||
}
|
||||
|
||||
fn place_rooms(&mut self, rng: &mut RandomNumberGenerator) {
|
||||
self.rects
|
||||
.push(Rect::new(2, 2, self.map.width - 5, self.map.height - 5));
|
||||
let first_room = self.rects[0];
|
||||
self.add_subrects(first_room);
|
||||
|
||||
let mut n_rooms = 0;
|
||||
while n_rooms < 240 {
|
||||
let rect = self.get_random_rect(rng);
|
||||
let candidate = self.get_random_sub_rect(rect, rng);
|
||||
|
||||
if self.is_possible(candidate) {
|
||||
apply_room_to_map(&mut self.map, &candidate);
|
||||
self.rooms.push(candidate);
|
||||
self.add_subrects(rect);
|
||||
self.take_snapshot();
|
||||
}
|
||||
|
||||
n_rooms += 1;
|
||||
}
|
||||
|
||||
self.rooms.sort_by(|a, b| a.x1.cmp(&b.x1));
|
||||
}
|
||||
|
||||
fn place_corridors(&mut self, rng: &mut RandomNumberGenerator) {
|
||||
for i in 0..self.rooms.len() - 1 {
|
||||
let room = self.rooms[i];
|
||||
let next_room = self.rooms[i + 1];
|
||||
let start_x = room.x1 + (rng.roll_dice(1, i32::abs(room.x1 - room.x2)) - 1);
|
||||
let start_y = room.y1 + (rng.roll_dice(1, i32::abs(room.y1 - room.y2)) - 1);
|
||||
let end_x =
|
||||
next_room.x1 + (rng.roll_dice(1, i32::abs(next_room.x1 - next_room.x2)) - 1);
|
||||
let end_y =
|
||||
next_room.y1 + (rng.roll_dice(1, i32::abs(next_room.y1 - next_room.y2)) - 1);
|
||||
self.draw_corridor(start_x, start_y, end_x, end_y);
|
||||
self.take_snapshot();
|
||||
}
|
||||
}
|
||||
|
||||
fn place_start(&mut self) {
|
||||
let start = self.rooms[0].center();
|
||||
self.starting_position = Position {
|
||||
x: start.0,
|
||||
y: start.1,
|
||||
};
|
||||
}
|
||||
|
||||
fn place_stairs(&mut self) {
|
||||
let stairs = self.rooms[self.rooms.len() - 1].center();
|
||||
let stairs_idx = self.map.xy_idx(stairs.0, stairs.1);
|
||||
self.map.tiles[stairs_idx] = TileType::DownStairs;
|
||||
}
|
||||
|
||||
fn add_subrects(&mut self, rect: Rect) {
|
||||
let width = i32::abs(rect.x1 - rect.x2);
|
||||
let height = i32::abs(rect.y1 - rect.y2);
|
||||
let half_width = i32::max(width / 2, 1);
|
||||
let half_height = i32::max(height / 2, 1);
|
||||
|
||||
self.rects
|
||||
.push(Rect::new(rect.x1, rect.y1, half_width, half_height));
|
||||
self.rects.push(Rect::new(
|
||||
rect.x1,
|
||||
rect.y1 + half_height,
|
||||
half_width,
|
||||
half_height,
|
||||
));
|
||||
self.rects.push(Rect::new(
|
||||
rect.x1 + half_width,
|
||||
rect.y1,
|
||||
half_width,
|
||||
half_height,
|
||||
));
|
||||
self.rects.push(Rect::new(
|
||||
rect.x1 + half_width,
|
||||
rect.y1 + half_height,
|
||||
half_width,
|
||||
half_height,
|
||||
));
|
||||
}
|
||||
fn get_random_rect(&mut self, rng: &mut RandomNumberGenerator) -> Rect {
|
||||
if self.rects.len() == 1 {
|
||||
return self.rects[0];
|
||||
}
|
||||
let idx = (rng.roll_dice(1, self.rects.len() as i32) - 1) as usize;
|
||||
self.rects[idx]
|
||||
}
|
||||
fn get_random_sub_rect(&self, rect: Rect, rng: &mut RandomNumberGenerator) -> Rect {
|
||||
let mut result = rect;
|
||||
let rect_width = i32::abs(rect.x1 - rect.x2);
|
||||
let rect_height = i32::abs(rect.y1 - rect.y2);
|
||||
|
||||
let w = i32::max(3, rng.roll_dice(1, i32::min(rect_width, 10)) - 1) + 1;
|
||||
let h = i32::max(3, rng.roll_dice(1, i32::min(rect_height, 10)) - 1) + 1;
|
||||
|
||||
result.x1 += rng.roll_dice(1, 6) - 1;
|
||||
result.y1 += rng.roll_dice(1, 6) - 1;
|
||||
result.x2 = result.x1 + w;
|
||||
result.y2 = result.y1 + h;
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
fn is_possible(&self, rect: Rect) -> bool {
|
||||
let mut expanded = rect;
|
||||
|
||||
expanded.x1 -= 2;
|
||||
expanded.x2 += 2;
|
||||
expanded.y1 -= 2;
|
||||
expanded.y2 += 2;
|
||||
|
||||
let mut can_build = true;
|
||||
|
||||
for y in expanded.y1..=expanded.y2 {
|
||||
for x in expanded.x1..=expanded.x2 {
|
||||
if x > self.map.width - 2 {
|
||||
can_build = false;
|
||||
}
|
||||
if y > self.map.height - 2 {
|
||||
can_build = false;
|
||||
}
|
||||
if x < 1 {
|
||||
can_build = false;
|
||||
}
|
||||
if y < 1 {
|
||||
can_build = false;
|
||||
}
|
||||
if can_build {
|
||||
let idx = self.map.xy_idx(x, y);
|
||||
if self.map.tiles[idx] != TileType::Wall {
|
||||
can_build = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
can_build
|
||||
}
|
||||
fn draw_corridor(&mut self, x1: i32, y1: i32, x2: i32, y2: i32) {
|
||||
bsp::draw_corridor(&mut self.map, x1, y1, x2, y2);
|
||||
}
|
||||
}
|
||||
|
||||
impl MapBuilder for BspDungeonBuilder {
|
||||
fn build_map(&mut self) {
|
||||
self.build();
|
||||
}
|
||||
|
||||
fn spawn_entities(&mut self, ecs: &mut World) {
|
||||
for room in self.rooms.iter().skip(1) {
|
||||
spawner::spawn_room(ecs, room, self.depth);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_map(&self) -> Map {
|
||||
self.map.clone()
|
||||
}
|
||||
|
||||
fn get_starting_position(&self) -> Position {
|
||||
self.starting_position.clone()
|
||||
}
|
||||
|
||||
fn get_snapshot_history(&self) -> Vec<Map> {
|
||||
self.history.clone()
|
||||
}
|
||||
|
||||
fn take_snapshot(&mut self) {
|
||||
if SHOW_MAPGEN_VISUALIZER {
|
||||
let mut snapshot = self.map.clone();
|
||||
for v in snapshot.revealed_tiles.iter_mut() {
|
||||
*v = true;
|
||||
}
|
||||
self.history.push(snapshot);
|
||||
}
|
||||
}
|
||||
}
|
||||
158
src/map_builders/bsp_interior.rs
Normal file
158
src/map_builders/bsp_interior.rs
Normal file
@@ -0,0 +1,158 @@
|
||||
use crate::map_builders::common::reveal_all;
|
||||
use crate::map_builders::{bsp, MapBuilder};
|
||||
use crate::rect::Rect;
|
||||
use crate::{spawner, Map, Position, TileType, World, SHOW_MAPGEN_VISUALIZER};
|
||||
use rltk::RandomNumberGenerator;
|
||||
|
||||
const MIN_ROOM_SIZE: i32 = 8;
|
||||
|
||||
pub struct BspInteriorBuilder {
|
||||
map: Map,
|
||||
starting_position: Position,
|
||||
depth: i32,
|
||||
rooms: Vec<Rect>,
|
||||
history: Vec<Map>,
|
||||
rects: Vec<Rect>,
|
||||
}
|
||||
|
||||
impl BspInteriorBuilder {
|
||||
pub fn new(new_depth: i32) -> Self {
|
||||
Self {
|
||||
map: Map::new(new_depth),
|
||||
rects: Vec::new(),
|
||||
history: Vec::new(),
|
||||
depth: new_depth,
|
||||
rooms: Vec::new(),
|
||||
starting_position: Position::default(),
|
||||
}
|
||||
}
|
||||
|
||||
fn build(&mut self) {
|
||||
let mut rng = RandomNumberGenerator::new();
|
||||
|
||||
self.place_rooms(&mut rng);
|
||||
self.place_corridors(&mut rng);
|
||||
self.place_stairs();
|
||||
self.place_start()
|
||||
}
|
||||
|
||||
fn place_start(&mut self) {
|
||||
let start = self.rooms[0].center();
|
||||
self.starting_position = Position::new(start.0, start.1)
|
||||
}
|
||||
|
||||
fn place_stairs(&mut self) {
|
||||
let stairs = self.rooms[self.rooms.len() - 1].center();
|
||||
let stairs_idx = self.map.xy_idx(stairs.0, stairs.1);
|
||||
self.map.tiles[stairs_idx] = TileType::DownStairs;
|
||||
}
|
||||
|
||||
fn place_corridors(&mut self, rng: &mut RandomNumberGenerator) {
|
||||
for i in 0..self.rooms.len() - 1 {
|
||||
let room = self.rooms[i];
|
||||
let next_room = self.rooms[i + 1];
|
||||
let start_x = room.x1 + (rng.roll_dice(1, i32::abs(room.x1 - room.x2)) - 1);
|
||||
let start_y = room.y1 + (rng.roll_dice(1, i32::abs(room.y1 - room.y2)) - 1);
|
||||
let end_x =
|
||||
next_room.x1 + (rng.roll_dice(1, i32::abs(next_room.x1 - next_room.x2)) - 1);
|
||||
let end_y =
|
||||
next_room.y1 + (rng.roll_dice(1, i32::abs(next_room.y1 - next_room.y2)) - 1);
|
||||
self.draw_corridor(start_x, start_y, end_x, end_y);
|
||||
self.take_snapshot();
|
||||
}
|
||||
}
|
||||
|
||||
fn place_rooms(&mut self, mut rng: &mut RandomNumberGenerator) {
|
||||
self.rects.clear();
|
||||
self.rects
|
||||
.push(Rect::new(1, 1, self.map.width - 2, self.map.height - 2));
|
||||
let first_room = self.rects[0];
|
||||
self.add_subrects(first_room, &mut rng);
|
||||
|
||||
let rooms = self.rects.clone();
|
||||
for r in rooms.iter() {
|
||||
let room = *r;
|
||||
self.rooms.push(room);
|
||||
for y in room.y1..room.y2 {
|
||||
for x in room.x1..room.x2 {
|
||||
let idx = self.map.xy_idx(x, y);
|
||||
if idx > 0 && idx < ((self.map.width * self.map.height) - 1) as usize {
|
||||
self.map.tiles[idx] = TileType::Floor;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.take_snapshot();
|
||||
}
|
||||
}
|
||||
|
||||
fn add_subrects(&mut self, rect: Rect, rng: &mut RandomNumberGenerator) {
|
||||
if !self.rects.is_empty() {
|
||||
self.rects.remove(self.rects.len() - 1);
|
||||
}
|
||||
|
||||
let width = rect.x2 - rect.x1;
|
||||
let height = rect.y2 - rect.y1;
|
||||
let half_width = width / 2;
|
||||
let half_height = height / 2;
|
||||
|
||||
let split = rng.roll_dice(1, 4);
|
||||
|
||||
if split <= 2 {
|
||||
let h1 = Rect::new(rect.x1, rect.y1, half_width - 1, height);
|
||||
self.rects.push(h1);
|
||||
if half_width > MIN_ROOM_SIZE {
|
||||
self.add_subrects(h1, rng);
|
||||
}
|
||||
let h2 = Rect::new(rect.x1 + half_width, rect.y1, half_width, height);
|
||||
self.rects.push(h2);
|
||||
if half_width > MIN_ROOM_SIZE {
|
||||
self.add_subrects(h2, rng);
|
||||
}
|
||||
} else {
|
||||
let v1 = Rect::new(rect.x1, rect.y1, width, half_height - 1);
|
||||
self.rects.push(v1);
|
||||
if half_height > MIN_ROOM_SIZE {
|
||||
self.add_subrects(v1, rng);
|
||||
}
|
||||
let v2 = Rect::new(rect.x1, rect.y1 + half_height, width, half_height);
|
||||
self.rects.push(v2);
|
||||
if half_height > MIN_ROOM_SIZE {
|
||||
self.add_subrects(v2, rng);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_corridor(&mut self, x1: i32, y1: i32, x2: i32, y2: i32) {
|
||||
bsp::draw_corridor(&mut self.map, x1, y1, x2, y2);
|
||||
}
|
||||
}
|
||||
|
||||
impl MapBuilder for BspInteriorBuilder {
|
||||
fn build_map(&mut self) {
|
||||
self.build();
|
||||
}
|
||||
|
||||
fn spawn_entities(&mut self, ecs: &mut World) {
|
||||
for room in self.rooms.iter().skip(1) {
|
||||
spawner::spawn_room(ecs, room, self.depth);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_map(&self) -> Map {
|
||||
self.map.clone()
|
||||
}
|
||||
|
||||
fn get_starting_position(&self) -> Position {
|
||||
self.starting_position.clone()
|
||||
}
|
||||
|
||||
fn get_snapshot_history(&self) -> Vec<Map> {
|
||||
self.history.clone()
|
||||
}
|
||||
|
||||
fn take_snapshot(&mut self) {
|
||||
if SHOW_MAPGEN_VISUALIZER {
|
||||
self.history.push(reveal_all(&self.map));
|
||||
}
|
||||
}
|
||||
}
|
||||
168
src/map_builders/cellular_automata.rs
Normal file
168
src/map_builders/cellular_automata.rs
Normal file
@@ -0,0 +1,168 @@
|
||||
use std::collections::HashMap;
|
||||
use std::process::exit;
|
||||
use rltk::RandomNumberGenerator;
|
||||
use crate::map_builders::{common, MapBuilder};
|
||||
use crate::{Map, Position, World, SHOW_MAPGEN_VISUALIZER, TileType, spawner};
|
||||
|
||||
const MIN_ROOM_SIZE: i32 = 8;
|
||||
|
||||
pub struct CellularAutomataBuilder {
|
||||
map: Map,
|
||||
starting_position: Position,
|
||||
depth: i32,
|
||||
history: Vec<Map>,
|
||||
noise_areas : HashMap<i32, Vec<usize>>
|
||||
}
|
||||
|
||||
impl CellularAutomataBuilder {
|
||||
pub fn new(new_depth: i32) -> Self {
|
||||
Self {
|
||||
history: Vec::new(),
|
||||
map: Map::new(new_depth),
|
||||
depth: new_depth,
|
||||
starting_position: Position::default(),
|
||||
noise_areas: HashMap::new()
|
||||
}
|
||||
}
|
||||
|
||||
fn build(&mut self) {
|
||||
let mut rng = RandomNumberGenerator::new();
|
||||
|
||||
self.place_random_level(&mut rng);
|
||||
self.take_snapshot();
|
||||
self.process_noise();
|
||||
let start_idx = self.place_start();
|
||||
self.place_exit(start_idx);
|
||||
self.take_snapshot();
|
||||
self.place_spawn_areas(rng)
|
||||
}
|
||||
|
||||
fn place_spawn_areas(&mut self, mut rng: RandomNumberGenerator) {
|
||||
let mut noise = rltk::FastNoise::seeded(rng.roll_dice(1, 65536) as u64);
|
||||
noise.set_noise_type(rltk::NoiseType::Cellular);
|
||||
noise.set_frequency(0.08);
|
||||
noise.set_cellular_distance_function(rltk::CellularDistanceFunction::Manhattan);
|
||||
|
||||
for y in 1..self.map.height - 1 {
|
||||
for x in 1..self.map.width - 1 {
|
||||
let idx = self.map.xy_idx(x, y);
|
||||
if self.map.tiles[idx] == TileType::Floor {
|
||||
let cell_value_f = noise.get_noise(x as f32, y as f32) * 10240.0;
|
||||
let cell_value = cell_value_f as i32;
|
||||
if self.noise_areas.contains_key(&cell_value) {
|
||||
self.noise_areas.get_mut(&cell_value).unwrap().push(idx);
|
||||
} else {
|
||||
self.noise_areas.insert(cell_value, vec![idx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn place_exit(&mut self, start_idx: usize) {
|
||||
let map_starts: Vec<usize> = vec![start_idx];
|
||||
let dijkstra_map = rltk::DijkstraMap::new(self.map.width, self.map.height, &map_starts, &self.map, 200.0);
|
||||
let mut exit_tile = (0, 0.0f32);
|
||||
for (i, tile) in self.map.tiles.iter_mut().enumerate() {
|
||||
if *tile != TileType::Floor {
|
||||
continue;
|
||||
}
|
||||
|
||||
let distance_to_start = dijkstra_map.map[i];
|
||||
if distance_to_start == f32::MAX {
|
||||
*tile = TileType::Wall;
|
||||
} else {
|
||||
if distance_to_start > exit_tile.1 {
|
||||
exit_tile.0 = i;
|
||||
exit_tile.1 = distance_to_start;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.take_snapshot();
|
||||
self.map.tiles[exit_tile.0] = TileType::DownStairs;
|
||||
}
|
||||
|
||||
fn place_start(&mut self) -> usize {
|
||||
self.starting_position = Position::new(self.map.width / 2, self.map.height / 2);
|
||||
let mut start_idx = self.map.xy_idx(self.starting_position.x, self.starting_position.y);
|
||||
while self.map.tiles[start_idx] != TileType::Floor {
|
||||
self.starting_position.x -= 1;
|
||||
start_idx = self.map.xy_idx(self.starting_position.x, self.starting_position.y);
|
||||
}
|
||||
|
||||
return start_idx;
|
||||
}
|
||||
|
||||
fn process_noise(&mut self) {
|
||||
for _i in 0..15 {
|
||||
let mut new_tiles = self.map.tiles.clone();
|
||||
|
||||
for y in 1..self.map.height - 1 {
|
||||
for x in 1..self.map.width - 1 {
|
||||
let idx = self.map.xy_idx(x, y);
|
||||
let mut neighbors = 0;
|
||||
if self.map.tiles[idx - 1] == TileType::Wall { neighbors += 1; }
|
||||
if self.map.tiles[idx + 1] == TileType::Wall { neighbors += 1; }
|
||||
if self.map.tiles[idx - self.map.width as usize] == TileType::Wall { neighbors += 1; }
|
||||
if self.map.tiles[idx + self.map.width as usize] == TileType::Wall { neighbors += 1; }
|
||||
if self.map.tiles[idx - self.map.width as usize - 1] == TileType::Wall { neighbors += 1; }
|
||||
if self.map.tiles[idx - self.map.width as usize + 1] == TileType::Wall { neighbors += 1; }
|
||||
if self.map.tiles[idx + self.map.width as usize - 1] == TileType::Wall { neighbors += 1; }
|
||||
if self.map.tiles[idx + self.map.width as usize + 1] == TileType::Wall { neighbors += 1; }
|
||||
|
||||
if neighbors > 4 || neighbors == 0 {
|
||||
new_tiles[idx] = TileType::Wall;
|
||||
} else {
|
||||
new_tiles[idx] = TileType::Floor;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.map.tiles = new_tiles.clone();
|
||||
self.take_snapshot();
|
||||
}
|
||||
}
|
||||
|
||||
fn place_random_level(&mut self, rng: &mut RandomNumberGenerator) {
|
||||
for y in 1..self.map.height - 1 {
|
||||
for x in 1..self.map.width - 1 {
|
||||
let roll = rng.roll_dice(1, 100);
|
||||
let idx = self.map.xy_idx(x, y);
|
||||
if roll > 55 {
|
||||
self.map.tiles[idx] = TileType::Floor
|
||||
} else {
|
||||
self.map.tiles[idx] = TileType::Wall
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl MapBuilder for CellularAutomataBuilder {
|
||||
fn build_map(&mut self) {
|
||||
self.build();
|
||||
}
|
||||
|
||||
fn spawn_entities(&mut self, ecs: &mut World) {
|
||||
for area in self.noise_areas.iter() {
|
||||
spawner::spawn_region(ecs, area.1, self.depth);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_map(&self) -> Map {
|
||||
self.map.clone()
|
||||
}
|
||||
|
||||
fn get_starting_position(&self) -> Position {
|
||||
self.starting_position.clone()
|
||||
}
|
||||
|
||||
fn get_snapshot_history(&self) -> Vec<Map> {
|
||||
self.history.clone()
|
||||
}
|
||||
|
||||
fn take_snapshot(&mut self) {
|
||||
if SHOW_MAPGEN_VISUALIZER {
|
||||
self.history.push(common::reveal_all(&self.map))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
use std::cmp::{max, min};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::rect::Rect;
|
||||
use crate::{Map, TileType};
|
||||
@@ -29,3 +30,61 @@ pub fn apply_vertical_tunnel(map: &mut Map, y1: i32, y2: i32, x: i32) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn reveal_all(map: &Map) -> Map {
|
||||
let mut snapshot = map.clone();
|
||||
for v in snapshot.revealed_tiles.iter_mut() {
|
||||
*v = true;
|
||||
}
|
||||
snapshot
|
||||
}
|
||||
|
||||
pub fn remove_unreachable_areas_returning_most_distant(map: &mut Map, start_idx: usize) -> usize {
|
||||
map.populate_blocked();
|
||||
let map_starts : Vec<usize> = vec![start_idx];
|
||||
let dijkstra_map = rltk::DijkstraMap::new(map.width as usize, map.height as usize, &map_starts , map, 200.0);
|
||||
let mut exit_tile = (0, 0.0f32);
|
||||
for (i, tile) in map.tiles.iter_mut().enumerate() {
|
||||
if *tile == TileType::Floor {
|
||||
let distance_to_start = dijkstra_map.map[i];
|
||||
// We can't get to this tile - so we'll make it a wall
|
||||
if distance_to_start == std::f32::MAX {
|
||||
*tile = TileType::Wall;
|
||||
} else {
|
||||
// If it is further away than our current exit candidate, move the exit
|
||||
if distance_to_start > exit_tile.1 {
|
||||
exit_tile.0 = i;
|
||||
exit_tile.1 = distance_to_start;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit_tile.0
|
||||
}
|
||||
|
||||
pub fn generate_voronois_spawn_regions(map: &Map, rng: &mut rltk::RandomNumberGenerator) -> HashMap<i32, Vec<usize>> {
|
||||
let mut noise_areas : HashMap<i32, Vec<usize>> = HashMap::new();
|
||||
let mut noise = rltk::FastNoise::seeded(rng.roll_dice(1, 65536) as u64);
|
||||
noise.set_noise_type(rltk::NoiseType::Cellular);
|
||||
noise.set_frequency(0.08);
|
||||
noise.set_cellular_distance_function(rltk::CellularDistanceFunction::Manhattan);
|
||||
|
||||
for y in 1 .. map.height-1 {
|
||||
for x in 1 .. map.width-1 {
|
||||
let idx = map.xy_idx(x, y);
|
||||
if map.tiles[idx] == TileType::Floor {
|
||||
let cell_value_f = noise.get_noise(x as f32, y as f32) * 10240.0;
|
||||
let cell_value = cell_value_f as i32;
|
||||
|
||||
if noise_areas.contains_key(&cell_value) {
|
||||
noise_areas.get_mut(&cell_value).unwrap().push(idx);
|
||||
} else {
|
||||
noise_areas.insert(cell_value, vec![idx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
noise_areas
|
||||
}
|
||||
180
src/map_builders/drunkard.rs
Normal file
180
src/map_builders/drunkard.rs
Normal file
@@ -0,0 +1,180 @@
|
||||
use std::collections::HashMap;
|
||||
use rltk::RandomNumberGenerator;
|
||||
use crate::{Map, Position, SHOW_MAPGEN_VISUALIZER, TileType, World};
|
||||
use crate::map_builders::common::{generate_voronois_spawn_regions, remove_unreachable_areas_returning_most_distant, reveal_all};
|
||||
use crate::map_builders::MapBuilder;
|
||||
use crate::spawner::spawn_region;
|
||||
|
||||
pub struct DrunkardsWalkBuilder {
|
||||
map: Map,
|
||||
starting_position: Position,
|
||||
depth: i32,
|
||||
history: Vec<Map>,
|
||||
noise_areas: HashMap<i32, Vec<usize>>,
|
||||
settings: DrunkardSettings,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Copy, Clone)]
|
||||
pub enum DrunkSpawnMode { StartingPoint, Random }
|
||||
|
||||
pub struct DrunkardSettings {
|
||||
pub spawn_mode: DrunkSpawnMode,
|
||||
pub drunken_lifetime: i32,
|
||||
pub floor_percent: f32,
|
||||
}
|
||||
|
||||
impl DrunkardsWalkBuilder {
|
||||
pub fn new(new_depth: i32, settings: DrunkardSettings) -> Self {
|
||||
Self {
|
||||
depth: new_depth,
|
||||
map: Map::new(new_depth),
|
||||
history: Vec::new(),
|
||||
noise_areas: HashMap::new(),
|
||||
starting_position: Position::default(),
|
||||
settings,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn open_area(new_depth: i32) -> Self {
|
||||
DrunkardsWalkBuilder::new(
|
||||
new_depth,
|
||||
DrunkardSettings {
|
||||
spawn_mode: DrunkSpawnMode::StartingPoint,
|
||||
drunken_lifetime: 400,
|
||||
floor_percent: 0.5,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
pub fn open_halls(new_depth: i32) -> Self {
|
||||
DrunkardsWalkBuilder::new(
|
||||
new_depth,
|
||||
DrunkardSettings {
|
||||
spawn_mode: DrunkSpawnMode::Random,
|
||||
drunken_lifetime: 400,
|
||||
floor_percent: 0.5,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
pub fn winding_passages(new_depth: i32) -> Self {
|
||||
DrunkardsWalkBuilder::new(
|
||||
new_depth,
|
||||
DrunkardSettings {
|
||||
spawn_mode: DrunkSpawnMode::Random,
|
||||
drunken_lifetime: 100,
|
||||
floor_percent: 0.4,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
fn build(&mut self) {
|
||||
let mut rng = RandomNumberGenerator::new();
|
||||
|
||||
self.starting_position = Position::new(self.map.width / 2, self.map.height / 2);
|
||||
let start_idx = self.map.xy_idx(self.starting_position.x, self.starting_position.y);
|
||||
self.map.tiles[start_idx] = TileType::Floor;
|
||||
|
||||
let total_tiles = self.map.width * self.map.height;
|
||||
let desired_floor_tiles = (self.settings.floor_percent * total_tiles as f32) as usize;
|
||||
let mut floor_tile_count = self.map.tiles.iter().filter(|a| **a == TileType::Floor).count();
|
||||
let mut digger_count = 0;
|
||||
let mut active_digger_count = 0;
|
||||
|
||||
while floor_tile_count < desired_floor_tiles {
|
||||
let mut did_something = false;
|
||||
let mut drunk_x = self.starting_position.x;
|
||||
let mut drunk_y = self.starting_position.y;
|
||||
|
||||
match self.settings.spawn_mode {
|
||||
DrunkSpawnMode::StartingPoint => {
|
||||
drunk_x = self.starting_position.x;
|
||||
drunk_y = self.starting_position.y;
|
||||
}
|
||||
DrunkSpawnMode::Random => {
|
||||
if digger_count == 0 {
|
||||
drunk_x = self.starting_position.x;
|
||||
drunk_y = self.starting_position.y;
|
||||
} else {
|
||||
drunk_x = rng.roll_dice(1, self.map.width - 3) + 1;
|
||||
drunk_y = rng.roll_dice(1, self.map.height - 3) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut drunk_life = self.settings.drunken_lifetime;
|
||||
|
||||
while drunk_life > 0 {
|
||||
let drunk_idx = self.map.xy_idx(drunk_x, drunk_y);
|
||||
if self.map.tiles[drunk_idx] == TileType::Wall {
|
||||
did_something = true;
|
||||
}
|
||||
self.map.tiles[drunk_idx] = TileType::DownStairs;
|
||||
|
||||
let stagger_direction = rng.roll_dice(1, 4);
|
||||
match stagger_direction {
|
||||
1 if drunk_x > 2 => { drunk_x -= 1; }
|
||||
2 if drunk_x < self.map.width - 2 => { drunk_x += 1; }
|
||||
3 if drunk_y > 2 => { drunk_y -= 1; }
|
||||
_ if drunk_y < self.map.height - 2 => { drunk_y += 1; }
|
||||
_ => {}
|
||||
}
|
||||
|
||||
drunk_life -= 1;
|
||||
}
|
||||
if did_something {
|
||||
self.take_snapshot();
|
||||
active_digger_count += 1;
|
||||
}
|
||||
|
||||
digger_count += 1;
|
||||
for t in self.map.tiles.iter_mut() {
|
||||
if *t == TileType::DownStairs {
|
||||
*t = TileType::Floor;
|
||||
}
|
||||
}
|
||||
floor_tile_count = self.map.tiles.iter().filter(|a| **a == TileType::Floor).count();
|
||||
}
|
||||
rltk::console::log(format!("{} dwarves gave up their sobriety, of whom {} actually found a wall.", digger_count, active_digger_count));
|
||||
|
||||
let exit_tile = remove_unreachable_areas_returning_most_distant(&mut self.map, start_idx);
|
||||
self.take_snapshot();
|
||||
|
||||
self.map.tiles[exit_tile] = TileType::DownStairs;
|
||||
self.take_snapshot();
|
||||
|
||||
self.noise_areas = generate_voronois_spawn_regions(&self.map, &mut rng);
|
||||
}
|
||||
}
|
||||
|
||||
impl MapBuilder for DrunkardsWalkBuilder {
|
||||
fn build_map(&mut self) {
|
||||
self.build();
|
||||
}
|
||||
|
||||
fn spawn_entities(&mut self, ecs: &mut World) {
|
||||
for area in self.noise_areas.iter() {
|
||||
spawn_region(ecs, area.1, self.depth);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_map(&self) -> Map {
|
||||
self.map.clone()
|
||||
}
|
||||
|
||||
fn get_starting_position(&self) -> Position {
|
||||
self.starting_position.clone()
|
||||
}
|
||||
|
||||
fn get_snapshot_history(&self) -> Vec<Map> {
|
||||
self.history.clone()
|
||||
}
|
||||
|
||||
fn take_snapshot(&mut self) {
|
||||
if SHOW_MAPGEN_VISUALIZER {
|
||||
self.history.push(reveal_all(&self.map))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,19 @@
|
||||
use specs::World;
|
||||
|
||||
use crate::map_builders::bsp_dungeon::BspDungeonBuilder;
|
||||
use crate::map_builders::bsp_interior::BspInteriorBuilder;
|
||||
use crate::map_builders::simple_map::SimpleMapBuilder;
|
||||
use crate::{Map, Position};
|
||||
use crate::map_builders::cellular_automata::CellularAutomataBuilder;
|
||||
use crate::map_builders::drunkard::{DrunkardSettings, DrunkardsWalkBuilder, DrunkSpawnMode};
|
||||
|
||||
mod bsp;
|
||||
mod bsp_dungeon;
|
||||
mod bsp_interior;
|
||||
mod cellular_automata;
|
||||
mod common;
|
||||
mod simple_map;
|
||||
mod drunkard;
|
||||
|
||||
pub trait MapBuilder {
|
||||
fn build_map(&mut self);
|
||||
@@ -16,5 +25,16 @@ pub trait MapBuilder {
|
||||
}
|
||||
|
||||
pub fn new_random_builder(new_depth: i32) -> Box<dyn MapBuilder> {
|
||||
Box::new(SimpleMapBuilder::new(new_depth))
|
||||
let mut rng = rltk::RandomNumberGenerator::new();
|
||||
//let builder_choice = rng.roll_dice(1, 7);
|
||||
let builder_choice = 4;
|
||||
match builder_choice {
|
||||
6 => Box::new(DrunkardsWalkBuilder::open_area(new_depth)),
|
||||
5 => Box::new(DrunkardsWalkBuilder::open_halls(new_depth)),
|
||||
4 => Box::new(DrunkardsWalkBuilder::winding_passages(new_depth)),
|
||||
3 => Box::new(CellularAutomataBuilder::new(new_depth)),
|
||||
2 => Box::new(BspInteriorBuilder::new(new_depth)),
|
||||
1 => Box::new(SimpleMapBuilder::new(new_depth)),
|
||||
_ => Box::new(BspDungeonBuilder::new(new_depth)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ use crate::rect::Rect;
|
||||
use crate::{
|
||||
AreaOfEffect, BlocksTile, CombatStats, Confusion, Consumable, DefenseBonus, EntryTrigger,
|
||||
EquipmentSlot, Equippable, Hidden, HungerClock, HungerState, InflictsDamage, Item, MagicMapper,
|
||||
MeleePowerBonus, Monster, Name, Player, Position, ProvidesFood, ProvidesHealing, Ranged,
|
||||
Renderable, SerializeMe, SingleActivation, Viewshed, MAP_WIDTH, MAX_MONSTER,
|
||||
Map, MeleePowerBonus, Monster, Name, Player, Position, ProvidesFood, ProvidesHealing, Ranged,
|
||||
Renderable, SerializeMe, SingleActivation, TileType, Viewshed, MAP_WIDTH, MAX_MONSTER,
|
||||
};
|
||||
|
||||
pub fn player(ecs: &mut World, player_x: i32, player_y: i32) -> Entity {
|
||||
@@ -87,31 +87,55 @@ fn monster<S: ToString>(ecs: &mut World, x: i32, y: i32, glyph: FontCharType, na
|
||||
|
||||
#[allow(clippy::map_entry)]
|
||||
pub fn spawn_room(ecs: &mut World, room: &Rect, map_depth: i32) {
|
||||
let spawn_table = room_table(map_depth);
|
||||
let mut spawn_points: HashMap<usize, String> = HashMap::new();
|
||||
let mut possible_targets: Vec<usize> = Vec::new();
|
||||
|
||||
{
|
||||
let map = ecs.fetch::<Map>();
|
||||
for y in room.y1 + 1..room.y2 {
|
||||
for x in room.x1 + 1..room.x2 {
|
||||
let idx = map.xy_idx(x, y);
|
||||
if map.tiles[idx] == TileType::Floor {
|
||||
possible_targets.push(idx)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
spawn_region(ecs, &possible_targets, map_depth);
|
||||
}
|
||||
|
||||
pub(crate) fn spawn_region(ecs: &mut World, area: &[usize], map_depth: i32) {
|
||||
if let Some(spawn_points) = calculate_spawn_points(ecs, area, map_depth) {
|
||||
spawn_entities(ecs, spawn_points)
|
||||
}
|
||||
}
|
||||
|
||||
fn spawn_entities(ecs: &mut World, spawn_points: HashMap<usize, String>) {
|
||||
for spawn in spawn_points.iter() {
|
||||
spawn_entity(ecs, &spawn);
|
||||
}
|
||||
}
|
||||
|
||||
fn calculate_spawn_points(ecs: &mut World, area: &[usize], map_depth: i32) -> Option<HashMap<usize, String>> {
|
||||
let mut spawn_points: HashMap<usize, String> = HashMap::new();
|
||||
let spawn_table = room_table(map_depth);
|
||||
let mut areas: Vec<usize> = Vec::from(area);
|
||||
let mut rng = ecs.write_resource::<RandomNumberGenerator>();
|
||||
let num_spawns = rng.roll_dice(1, MAX_MONSTER + 3) + (map_depth - 1) - 3;
|
||||
|
||||
let num_spawns = i32::min(areas.len() as i32, rng.roll_dice(1, MAX_MONSTER + 3));
|
||||
if num_spawns == 0 { return None; }
|
||||
|
||||
for _i in 0..num_spawns {
|
||||
let mut added = false;
|
||||
let mut tried = 0;
|
||||
while !added && tried < 20 {
|
||||
let x = (room.x1 + rng.roll_dice(1, i32::abs(room.x2 - room.x1))) as usize;
|
||||
let y = (room.y1 + rng.roll_dice(1, i32::abs(room.y2 - room.y1))) as usize;
|
||||
let idx = (y * MAP_WIDTH) + x;
|
||||
if !spawn_points.contains_key(&idx) {
|
||||
spawn_points.insert(idx, spawn_table.roll(&mut rng));
|
||||
added = true;
|
||||
} else {
|
||||
tried += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
let array_idx = if areas.len() == 1 { 0usize } else { (rng.roll_dice(1, areas.len() as i32 - 1) as usize) };
|
||||
let map_idx = areas[array_idx];
|
||||
spawn_points.insert(map_idx, spawn_table.roll(&mut rng));
|
||||
areas.remove(array_idx);
|
||||
}
|
||||
|
||||
for spawn in spawn_points.iter() {
|
||||
Some(spawn_points)
|
||||
}
|
||||
|
||||
fn spawn_entity(ecs: &mut World, spawn: &(&usize, &String)) {
|
||||
let x = (*spawn.0 % MAP_WIDTH) as i32;
|
||||
let y = (*spawn.0 / MAP_WIDTH) as i32;
|
||||
|
||||
@@ -136,7 +160,6 @@ pub fn spawn_room(ecs: &mut World, room: &Rect, map_depth: i32) {
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn health_potion(ecs: &mut World, x: i32, y: i32) {
|
||||
ecs.create_entity()
|
||||
|
||||
Reference in New Issue
Block a user