diff --git a/.github/workflows/cargo-build-test.yml b/.github/workflows/cargo-build-test.yml
deleted file mode 100644
index cafaa58..0000000
--- a/.github/workflows/cargo-build-test.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-name: Rust
-
-on:
- push:
- branches: [ "master" ]
- pull_request:
- branches: [ "master" ]
-
-env:
- CARGO_TERM_COLOR: always
-
-jobs:
- build:
-
- runs-on: ubuntu-22.04
-
- steps:
- - uses: actions/checkout@v3
- - name: Build
- run: cargo build --verbose
- - name: Run tests
- run: cargo test --verbose
diff --git a/.github/workflows/deploy wasm to gh-pages.yml b/.github/workflows/deploy wasm to gh-pages.yml
deleted file mode 100644
index 1a5bb6f..0000000
--- a/.github/workflows/deploy wasm to gh-pages.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-on: push
-name: Build and deploy web page with WASM version
-jobs:
- build:
- runs-on: ubuntu-latest
- if: startsWith(github.ref, 'refs/tags/v')
- steps:
- - name: Checkout project
- uses: actions/checkout@v3
- - name: Setup - Rust
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- target: wasm32-unknown-unknown
- override: true
- - name: Setup - wasm-bindgen
- uses: jetli/wasm-bindgen-action@v0.2.0
- - name: Build, bind WASM
- run: |
- cargo build --release --target wasm32-unknown-unknown
- wasm-bindgen target/wasm32-unknown-unknown/release/rust-rl.wasm --out-dir wasm --no-modules --no-typescript
- - name: Publish web\ to gh-pages
- env:
- GITHUB_TOKEN: ${{ github.token }}
- run: |
- cd wasm/
- git init --initial-branch=master
- git config user.name "GitHub Actions"
- git config user.email "github-actions-bot@users.noreply.github.com"
- git add .
-
- git commit -m "Deploy ${GITHUB_REPOSITORY} to ${GITHUB_REPOSITORY}:gh-pages"
- git push --force "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" master:gh-pages
- echo "Deploy complete"
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 6d00d4c..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-# Build files, documentation, benchmarks
-target
-wasm/index.css
-wasm/index.html
-docs/gifs/*
-
-# VSCode/IDE config files
-Cargo.lock
-.vscode/*
-.rustfmt.toml
-.prettierignore
-.prettierrc.json
-
-# Save files, morgue files
-savegame.json
-morgue
-
-# A default user config will be written on first run, if not present
-config.toml
\ No newline at end of file
diff --git a/Cargo.toml b/Cargo.toml
deleted file mode 100644
index 55d7645..0000000
--- a/Cargo.toml
+++ /dev/null
@@ -1,31 +0,0 @@
-[package]
-name = "rust-rl"
-version = "0.1.4"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-bracket-lib = { git = "https://github.com/amethyst/bracket-lib.git", rev = "851f6f08675444fb6fa088b9e67bee9fd75554c6", features = ["serde"] }
-regex = "1.3.6"
-specs = { version = "0.16.1", features = ["serde"] }
-specs-derive = "0.4.1"
-serde = { version = "1.0.93", features = ["derive"]}
-serde_json = "1.0.39"
-toml = "0.5"
-lazy_static = "1.4.0"
-
-[dev-dependencies]
-criterion = { version = "^0.5" }
-
-[[bench]]
-name = "systems_benchmark"
-harness = false
-
-# Enable max optimizations for dependencies, but not for our code:
-[profile.dev.package."*"]
-opt-level = 3
-
-# Enable only a small amount of optimization in debug mode
-# [profile.dev]
-# opt-level = 1
\ No newline at end of file
diff --git a/README.md b/README.md
deleted file mode 100644
index c1809cf..0000000
--- a/README.md
+++ /dev/null
@@ -1,160 +0,0 @@
-## a roguelike in rust, playable @ [llyw.co.uk/rl/](https://llyw.co.uk/rl/)
-
-#### using _rltk/bracket-lib_, and _specs_
-
-[](https://github.com/Llywelwyn/rust-rl/actions/workflows/cargo-build-test.yml)
-
-check out the page in the header for the wasm version, pick [a release](https://github.com/Llywelwyn/rust-rl/releases), or build manually with:
-
-`git clone https://github.com/Llywelwyn/rust-rl/ && cd rust-rl && cargo build --release`,
-
-
-
----
-
-
- boring details about the sprint where this project started
-
-week 1
-
-- brogue-like colours
- - i was staring at a horrible-looking game for a while as i tried to figure out how to make it look nice, before deciding to try the brogue method of colour offsets. when a map is generated, it also generates a red, green, and blue offset value for every tile on the map, and applies them during rendering. after making that change i started to miss the previous hue, so i combined the two. as it stands, every tile starts off a subtle green/blue, has rgb offsets applied on top of that, and then has the actual tile colour applied. and it ends up making something like this
-
- 
-
-- fov
- - decided to use bracket-lib's symmetric shadowcasting for common viewsheds (i.e. sight)
- - and implemented elig's [raycasting](https://www.roguebasin.com/index.php/Eligloscode) algorithm for any viewsheds that _dont_ need that level of detail. symmetric is great, but when it comes to viewsheds that often _aren't_ symmetric in the first place, it's not really necessary (i.e. it's not often you've got two people with: the same additional viewshed, both within range, etc.). doing it this way comes with the benefit of being able to easily define what blocks a viewshed, rather than having to make a whole new BaseMap to work through bracket-lib
-
-- telepaths and having brains
- - telepathy! a personal favourite rl feature, so i thought it'd be a cool test of the raycasting. right now it's simple, since the point was really just making sure the raycasting worked: there's a component for _being a telepath_, and for _having a mind_. if someone has telepathy, they'll see every entity with a mind within a given radius (defined by their telepath component), even through walls.
-
- 
-
-- atomised spawn tables
- - i tried figuring out how often things would spawn by just looking at the weighted tables, and i had no idea at a glance, so i replaced it with category tables. right now it's just rolling for an entity or a mob, and then rolling on the right table from there, but at least it means easily being able to see how often something will spawn. on average right now, there's 1 item : 3 mobs
-
-
-
----
-
-
- week 2
-
-- most of section 3 - generating maps
- - this week was mostly just working away at the mapgen stuff. getting all the algorithms in, chaining builders, being able to do prefabs. whenever i got bored i just opened rexpaint and toyed around with making simple vaults.
-
-- 8-bit walls
- - i wasn't happy with how the walls looked, so i made the masks 8-bit instead of just 4-, which means being able to be a lot more specific with which glyphs are used. mainly it means no more grids of ╬. this comes with a side-effect of magic mapping looking a lot better.
-
- 
-
-
-
----
-
-
- week 3
-
-- (better) vault loot
- - moved over to using raws and atomised spawn tables into a bunch of sub-categories in the process, like wands, equipment, potions, etc. now there's options for rolling just out of subsets of items - useful for adding a specific spawn to a vault, or ensuring there's always an amount of food on a given level, etc. can also use this in the future for categorising groups of mobs, to only spawn x mobtype on a given map too.
-
- 
-
-
-- actions with directions
- - made a new runstate that prompts the player to pick a direction, and takes a function as an argument. after the player picks a direction, it calls the function with that direction as the args. right now it's being used for door stuff, but now it'll be super easy to make anything else that needs the same parameters
-
- 
-
-
-- ui stuff
- - there's a help screen now with controls, accessed with [?], and a death screen that actually logs some stuff
-
- 
- - finally, identical items in the inventory stack. i waited with this until figuring out a way that would work with extra parameters in the future like BUC. current solution is using a BTreeMap with a tuple containing the parameters that need to be the same (right now just the name) as the key, and the number of those items in the inventory as the value.
- - wand uses are tracked now with a number of asterisks next to their name -- i'll change this once i add in identification
-
- 
-
-
-
----
-
-
- week 4
-
-- d20/hacklike combat overhaul
- - the framework for levels, attributes, and skills are all in, as well as a lot of the associated systems. it now uses a system that trends way closer to the -hack brand of roguelikes (it's almost identical). i thought about doing something more novel just because then i could say i made it on my own, but then i decided i'd rather lean on the 35 years of balance tweaks nethack has had than start all over from scratch. not having to worry so much about balance gives me time to do other stuff, and i think the familiarity for players will be nice too. my favourite addition is a MULTIATTACK flag for mobs - if they have it, they'll use all their natural attacks in a turn instead of picking a random one
-
-- extremely free-form loot tables (like rats spawning... lambs?)
- - i realised my loot table structure wasn't very different from the spawn tables i'd been using for mapgen. other than one field, the structures were identical, so i decided to massively generalise how loot spawning works. instead of only allowing mobs to drop items from the specifically defined loot tables, they now have the capability to drop _anything_ from _any_ table -- for example, an animal can drop stuff from the animal drop table, or it could be set to drop a random scroll, or literally any other entity... including other mobs! i decided to test this with rats that had a 25% chance to "drop" anything from the _mobs_ spawn table on death. in this case, one rat left behind a lamb, and another left behind a fawn.
-
- 
-
-- and a huge visual overhaul!
- - a whole new ui, a new font (a 14x16 curses variant), a system to spawn particles on a delay for proper - if basic - animation, and a couple new features to fill in the expanded ui space (like being able to see a list of entities in view on the sidebar).
-
- 
-
-
-
----
-
-
- week 5
-
-- not a whole lot
- - busy week for me, so the only things i managed this week were finishing up some small things from the previous week. i started on combining logs that happen on the same tick (You hit the goblin. The goblin hits you.), and fixed up the _chance to spawn a guy each turn_ system to work with the groupsize flags, so there's a chance to spawn a pack of creatures each game turn rather than packs only spawning on map generation.
-
-
-
----
-
-
- week 6
-
-- visuals (contd.)
- - i'll start here, because it pretty much shows all the other things i did this week in the one image. the biggest change is nixing the rainbow colours i did in week 4 - having all the names on the sidebar and inventory be coloured by the colour of their glyph made for a difficult to parse ui. i swapped everything out for being coloured by their rarity (white for common and nonmagical items, grey for unidentified, and green-to-gold for uncommon-legendary rarities), and decided to add the glyph of the entity beside the name. overall, a big win i think. it provides more information more cleanly.
-
- 
-
-- backtracking
- - short and sweet, maps are persistent now. entities don't get deleted when you descend, they just get frozen, and you can return anytime. stair-dancing is a thing now, and something i haven't decided how to handle yet.
-
-- item identification (no BUC yet!)
- - unique schemes for unidentified items in the big categories (i.e. "effervescent green potions", "octagonal wands", and "GIB BERISH scrolls"), as well as the option of defining one-off obfuscated names for special cases
-
-- encumbrance
- - varying levels of being overweight, with the limit determined by strength, slowing entities down by ~25% per level over unencumbered. right now it's pretty forgiving, and i'd probably like it to stay that way. my ideal balance here would be roughly how it ends up in 5e DnD: everyone can carry a good supply of consumables, but strength characters usually don't carry a much higher quantity of items than anyone else, because the strongest armour is extremely heavy. sort of like a soft strength requirement for the heaviest gear - rather than requiring specific stats or levels to equip it, it's heavy enough that you need to be strong to lug it around. but if someone weaker wanted to, they could, they'd just have to leave some other items behind to do so. or take the speed penalty for being encumbered
-
-
-
----
-
-
- week 7
-
-- character creation!
- - it doesn't look too pretty yet, but i managed to get it done in time. classes and ancestries are selectable, with ancestries determining some intrinsic bonuses (dwarves are hardy, catfolk are fast and have claws, etc.) and attribute maximums, and classes determining starting equipment and the actual attribute rolls. along with this, i expanded entity reactions - now a shared ancestry is taken into account first of all, and it checks faction if it doesn't manage to find anything. this means humans wont attack other humans, dwarves wont be attacked by gnomes and other dwarves, etc.
-
- 
-
-
-- proper identification and beatitude
- - item-ID is split from beatitudes as it should be, scrolls of identify and remove curse are in, and blessed/cursed effects are applied for a bunch of things.
-
- 
-
-
-- better AI
- - straight from thebracket, with a handful of tweaks of my own, i've finally atomised AI into adjacent, visible, chase, flee, and default systems. most notably,rather than hostile mobs attacking everything and passive mobs doing nothing, every mob has a faction, and most mobs have an ancestry. like mentioned above, mobs will take all this into account when determining how they want to react to any other entity. i see a lot of places to expand on this in the future, like going into alignments and other increasingly-specific reasons why any entity might want to murder another. or make friends with them. taming comes to mind here.
-
-- an effects system
- - instead of randomly doing things all around the codebase, everything is in the process of being moved over to an effects system. to put it very simply, there's a big list of every effect that needs to take place on the next tick, and each tick the queue is iterated through, the next effect is checked against a list of every entity that died this turn to make sure that it should still take place (no dead mobs still getting their attacks off), and then it makes the event happen if appropriate. if not, it just gets tossed out. it's all super modular, so effects can pretty much be applied to everything. the same damage and targeting effects work for item use and traps going off, or an entity swinging their sword, for example. i made use of this new system by adding in some aoe scrolls, like mass function and mass healing. see below for blindness improving telepathy range, and nice new particle effects.
-
- 
- 
-
-
-
diff --git a/benches/systems_benchmark.rs b/benches/systems_benchmark.rs
deleted file mode 100644
index c750fed..0000000
--- a/benches/systems_benchmark.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-use criterion::{ black_box, criterion_group, criterion_main, Criterion };
-use bracket_lib::prelude::*;
-
-/// Benchmarks methods from rltk used to desaturate non-visible tiles.
-// Greyscale is significantly faster, but generally looks worse - the
-// third alternative is directly setting the desaturated value, if it
-// is known in advance.
-fn nonvisible_benchmark(c: &mut Criterion) {
- let bg = black_box(RGB::from_f32(0.4, 0.0, 0.0));
-
- c.bench_function("rgb -> greyscale", |b| b.iter(|| bg.to_greyscale()));
- c.bench_function("rgb -> desaturate", |b| b.iter(|| bg.desaturate()));
-}
-
-criterion_group!(benches, nonvisible_benchmark);
-criterion_main!(benches);
diff --git a/changelog.md b/changelog.md
deleted file mode 100644
index 4976351..0000000
--- a/changelog.md
+++ /dev/null
@@ -1,20 +0,0 @@
-## v0.1.4
-### added
-- **overmap**: bare, but exists. player now starts on the overworld, and can move to local maps (like the old starting town) via >. can leave local maps back to the overmap by walking out of the map boundaries.
-- **intrinsics**: speed, regeneration
-- **damage types**: immunities, weaknesses, and resistances
-- **full keyboard support**: examining and targeting can now be done via keyboard only
-- **a config file** read at runtime, unfortunately not compatible with WASM builds yet
-- **morgue files**: y/n prompt to write a morgue file on death to /morgue/foo.txt, or to the console for WASM builds
-- **dungeon features**: just the basics so far. a grassy, forested treant room, some barracks, etc.
-- **named maps**: "Town", "Dungeon"
-- **map messages/hints**: "You hear <...>."
-### changed
-- **colour offsets** are now per-tile (and per-theme) instead of +-% globally. i.e. varying fg/bg offset on a per-tiletype basis
-- **chatlog colours** are now consistent
-### fixed
-- negative starting mana
-- status effects only ticking if mob turn aligned with turnclock turn
-- map params not being saved on map transition
-- mob turns not awaiting the particle queue (mobs moving around mid-animation)
-- mobs not re-pathing if their path was blocked, causing traffic jams
diff --git a/docs/ascii_encyclopedia.txt b/docs/ascii_encyclopedia.txt
deleted file mode 100644
index 2972c1e..0000000
--- a/docs/ascii_encyclopedia.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-a - insects A -
-b - B -
-c - chickens C -
-d - canines D -
-e - E -
-f - felines F -
-g - goblins G - gnomes
-h - humanoids H -
-i - I -
-j - J -
-k - kobolds K -
-l - L -
-m - M -
-n - N -
-o - orcs O - ogres
-p - P -
-q - quadrupeds Q -
-r - rats R -
-s - spiders S -
-t - T -
-u - horses U -
-v - V -
-w - W -
-x - X -
-y - Y -
-z - zombies Z -
-@ - humans
-
-notes
-1. zombie takes priority over the creature's original glyph
-2. @ is for human-sized creatures - i.e. humans, changelings
- h is used for everything else - i.e. dwarfs, halflings
-3. purple is reserved for captain/leader entiites - i.e. orc captain
-4. similar creatures use similar colours - i.e. little dog, dog, large dog
-
diff --git a/docs/combat_system.txt b/docs/combat_system.txt
deleted file mode 100644
index 44e2f65..0000000
--- a/docs/combat_system.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-DETERMINING IF AN ATTACK HITS OR NOT:
-
-1. Whenever someone makes an attack, a flat 1d20 attack roll is made.
-2. A target number is generated, depending on the mode of attack, made
- up of some combination of the following:
- - ATTACKER'S HIT BONUSES:
- - level
- - any relevant str/dex attribute bonuses
- - any relevant skill modifiers
- - any to-hit modifiers from equipment
- - any to-hit modifiers from status effects
- - DEFENDER'S ARMOUR CLASS*:
- - base armour class
- - any relevant skill modifiers
- - any ac modifiers from equipment
- - any ac modifiers from status effects
- - MISCELLANEOUS MODIFIERS:
- - melee attacks always have a +1 bonus
- - monsters gain a +10 bonus to-hit players
-3. The attack roll is compared against the target number.
-4. If the attack roll is less than the target, the attack hits.**
-5. If an attack hits, it deals:
- - a roll of the weapon's damage die
- - plus any relevant attribute bonuses
- - plus any relevant skill modifiers
- - MINUS a roll of the defender's AC, if the AC is negative.
-
-notes
- * when AC is less than 0, it is treated as a random number from -1 to the value. e.g. -10 AC could be anywhere from -1 to -10.
- ** functionally identical to rolling 1d20 + to-hit, and needing to roll higher than the defender's AC. this system just ends up
- being easier to work with when involving additional modifiers, as you don't need to decide if they're a to-hit bonus or an
- AC modifier -- they just always get added/subtracted from the target number that must be rolled against.
-
-Simple example, with positive AC:
-- You have an AC of 4, and the monster has a +1 to-hit, with a 1d8 damage weapon.
-- The monster must roll less than 10 (monster v. player) + 1 (to-hit) + 4 (ac) = 15 to hit you.
-- The monster has a 70% hit chance.
-- It rolls a 12, which is lower than 15, so it hits.
-- It rolls 1d8 for damage, and gets a 6.
-- You take 6 points of damage.
-
-Complex example, with negative AC:
-- You have an AC of -14, and the monster has a +3 to-hit, with a 1d8 damage weapon.
-- The monster must roll less than 10 (monster v. player) + 3 (to-hit) - 1d14 (ac) to hit you.
-- At best (AC rolls a 1), the monster must roll less than 12 to hit you. 55% hit chance.
-- At worst (AC rolls a 14), the monster must roll less than -1 to hit you. Impossible.
-- It rolls a 9, and your AC rolls a 2. 9 is less than 11 (10 + 3 - 2), so it hits.
-- It rolls 1d8 for damage, and gets a 6.
-bloodstains: if starts on bloodied tile, remove blood + heal, gain xp, grow (little dog -> dog), etc.
-- You have negative AC, so you roll 1d14 for damage reduction, and get an 8.
-- The total damage is 6 - 8 = -2, but damage can't be negative, so you take 1 point of damage.
-
-tl;dr
-1. Lower AC is better
-2. Aim for 0 AC - it's an important breakpoint. Every point of AC before 0 counts for a lot.
diff --git a/raws/ancestries.json b/raws/ancestries.json
deleted file mode 100644
index 932e488..0000000
--- a/raws/ancestries.json
+++ /dev/null
@@ -1,22 +0,0 @@
-[
- {
- "id": "human",
- "allies": []
- },
- {
- "id": "elf",
- "allies": []
- },
- {
- "id": "dwarf",
- "allies": ["gnome"]
- },
- {
- "id": "gnome",
- "allies": ["dwarf"]
- },
- {
- "id": "catfolk",
- "allies": []
- }
-]
diff --git a/raws/entity_categories.json b/raws/entity_categories.json
deleted file mode 100644
index e69de29..0000000
diff --git a/raws/factions.json b/raws/factions.json
deleted file mode 100644
index 136f3dc..0000000
--- a/raws/factions.json
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "id": "player",
- "responses": {}
- },
- {
- "id": "mindless",
- "responses": { "default": "attack" }
- },
- {
- "id": "neutral",
- "responses": { "default": "ignore", "hostile": "flee", "mindless": "flee", "carnivore": "flee" }
- },
- {
- "id": "hostile",
- "responses": { "default": "attack", "hostile": "ignore" }
- },
- {
- "id": "herbivore",
- "responses": { "default": "flee", "herbivores": "ignore" }
- },
- {
- "id": "carnivore",
- "responses": { "default": "ignore", "herbivores": "attack", "player": "attack", "neutral": "attack" }
- }
-]
diff --git a/raws/items.json b/raws/items.json
deleted file mode 100644
index 7599afe..0000000
--- a/raws/items.json
+++ /dev/null
@@ -1,448 +0,0 @@
-[
- {
- "id": "potion_health",
- "name": { "name": "potion of health", "plural": "potions of health" },
- "renderable": { "glyph": "!", "fg": "#FF00FF", "bg": "#000000", "order": 2 },
- "class": "potion",
- "weight": 1,
- "value": 50,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE"],
- "effects": { "heal": "4d4+2" },
- "magic": { "class": "uncommon", "naming": "potion" }
- },
- {
- "id": "potion_health_weak",
- "name": { "name": "potion of lesser health", "plural": "potions of lesser health" },
- "renderable": { "glyph": "!", "fg": "#FF00FF", "bg": "#000000", "order": 2 },
- "class": "potion",
- "weight": 1,
- "value": 25,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE"],
- "effects": { "heal": "2d4+2" },
- "magic": { "class": "uncommon", "naming": "potion" }
- },
- {
- "id": "scroll_identify",
- "name": { "name": "scroll of identify", "plural": "scrolls of identify" },
- "renderable": { "glyph": "?", "fg": "#0FFFFF", "bg": "#000000", "order": 2 },
- "class": "scroll",
- "weight": 0.5,
- "value": 100,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE", "IDENTIFY"],
- "magic": { "class": "uncommon", "naming": "scroll" }
- },
- {
- "id": "scroll_removecurse",
- "name": { "name": "scroll of remove curse", "plural": "scrolls of remove curse" },
- "renderable": { "glyph": "?", "fg": "#0FFFFF", "bg": "#000000", "order": 2 },
- "class": "scroll",
- "weight": 0.5,
- "value": 200,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE", "REMOVE_CURSE"],
- "magic": { "class": "rare", "naming": "scroll" }
- },
- {
- "id": "scroll_health",
- "name": { "name": "scroll of healing word", "plural": "scrolls of healing word" },
- "renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "scroll",
- "weight": 0.5,
- "value": 50,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE"],
- "effects": { "particle_line": "*;-;#53f06d;75.0;#f9ff9f;100.0", "ranged": "12", "heal": "1d4+2" },
- "magic": { "class": "uncommon", "naming": "scroll" }
- },
- {
- "id": "scroll_mass_health",
- "name": { "name": "scroll of mass healing word", "plural": "scrolls of mass healing word" },
- "renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "scroll",
- "weight": 0.5,
- "value": 200,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE"],
- "effects": { "particle": "*;#53f06d;200.0", "ranged": "12", "aoe": "3", "heal": "1d4+2" },
- "magic": { "class": "rare", "naming": "scroll" }
- },
- {
- "id": "scroll_magicmissile",
- "name": { "name": "scroll of magic missile", "plural": "scrolls of magic missile" },
- "renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "scroll",
- "weight": 0.5,
- "value": 50,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE"],
- "effects": { "particle_line": "*;-;#00b7ff;75.0;#f4fc83;100.0", "ranged": "12", "damage": "3d4+3;magic" },
- "magic": { "class": "uncommon", "naming": "scroll" }
- },
- {
- "id": "scroll_embers",
- "name": { "name": "scroll of embers", "plural": "scrolls of embers" },
- "renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "scroll",
- "weight": 0.5,
- "value": 100,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE"],
- "effects": { "particle": "*;#FFA500;200.0", "ranged": "10", "damage": "4d6;fire", "aoe": "2" },
- "magic": { "class": "uncommon", "naming": "scroll" }
- },
- {
- "id": "scroll_fireball",
- "name": { "name": "scroll of fireball", "plural": "scrolls of fireball" },
- "renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "scroll",
- "weight": 0.5,
- "value": 200,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE"],
- "effects": {
- "particle_burst": "▓;*;~;#FFA500;#000000;500.0;#ffd381;60.0",
- "ranged": "10",
- "damage": "8d6;fire",
- "aoe": "3"
- },
- "magic": { "class": "rare", "naming": "scroll" }
- },
- {
- "id": "scroll_confusion",
- "name": { "name": "scroll of confusion", "plural": "scrolls of confusion" },
- "renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "scroll",
- "weight": 0.5,
- "value": 100,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE"],
- "effects": { "particle_line": "*;-;#ad56a6;75.0;#cacaca;100.0", "ranged": "10", "confusion": "4" },
- "magic": { "class": "uncommon", "naming": "scroll" }
- },
- {
- "id": "scroll_mass_confusion",
- "name": { "name": "scroll of mass confusion", "plural": "scrolls of mass confusion" },
- "renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "scroll",
- "weight": 0.5,
- "value": 200,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE"],
- "effects": { "particle": "*;#ad56a6;200.0", "ranged": "10", "aoe": "3", "confusion": "3" },
- "magic": { "class": "veryrare", "naming": "scroll" }
- },
- {
- "id": "scroll_magicmap",
- "name": { "name": "scroll of magic mapping", "plural": "scrolls of magic mapping" },
- "renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "scroll",
- "weight": 0.5,
- "value": 50,
- "flags": ["CONSUMABLE", "DESTRUCTIBLE", "STACKABLE", "MAGICMAP"],
- "effects": {},
- "magic": { "class": "common", "naming": "scroll" }
- },
- {
- "id": "equip_dagger",
- "name": { "name": "dagger", "plural": "daggers" },
- "renderable": { "glyph": ")", "fg": "#808080", "bg": "#000000", "order": 2 },
- "class": "weapon",
- "weight": 1,
- "value": 2,
- "flags": ["EQUIP_MELEE"],
- "equip": { "flag": "FINESSE", "damage": "1d4", "to_hit": 0 }
- },
- {
- "id": "equip_shortsword",
- "name": { "name": "shortsword", "plural": "shortswords" },
- "renderable": { "glyph": ")", "fg": "#C0C0C0", "bg": "#000000", "order": 2 },
- "class": "weapon",
- "weight": 2,
- "value": 10,
- "flags": ["EQUIP_MELEE"],
- "equip": { "flag": "STRENGTH", "damage": "1d6", "to_hit": 0 }
- },
- {
- "id": "equip_rapier",
- "name": { "name": "rapier", "plural": "rapiers" },
- "renderable": { "glyph": ")", "fg": "#C0C0C0", "bg": "#000000", "order": 2 },
- "class": "weapon",
- "weight": 2,
- "value": 10,
- "flags": ["EQUIP_MELEE"],
- "equip": { "flag": "FINESSE", "damage": "1d8", "to_hit": 0 }
- },
- {
- "id": "equip_pitchfork",
- "name": { "name": "pitchfork", "plural": "pitchforks" },
- "renderable": { "glyph": ")", "fg": "#C0C0C0", "bg": "#000000", "order": 2 },
- "class": "weapon",
- "weight": 2,
- "value": 5,
- "flags": ["EQUIP_MELEE"],
- "equip": { "flag": "FINESSE", "damage": "1d6", "to_hit": 0 }
- },
- {
- "id": "equip_sickle",
- "name": { "name": "sickle", "plural": "sickles" },
- "renderable": { "glyph": ")", "fg": "#C0C0C0", "bg": "#000000", "order": 2 },
- "class": "weapon",
- "weight": 2,
- "value": 5,
- "flags": ["EQUIP_MELEE"],
- "equip": { "flag": "FINESSE", "damage": "1d6", "to_hit": 0 }
- },
- {
- "id": "equip_handaxe",
- "name": { "name": "handaxe", "plural": "handaxes" },
- "renderable": { "glyph": ")", "fg": "#C0C0C0", "bg": "#000000", "order": 2 },
- "class": "weapon",
- "weight": 2,
- "value": 5,
- "flags": ["EQUIP_MELEE"],
- "equip": { "flag": "STRENGTH", "damage": "1d6", "to_hit": 0 }
- },
- {
- "id": "equip_longsword",
- "name": { "name": "longsword", "plural": "longswords" },
- "renderable": { "glyph": ")", "fg": "#FFF8DC", "bg": "#000000", "order": 2 },
- "class": "weapon",
- "weight": 3,
- "value": 15,
- "flags": ["EQUIP_MELEE"],
- "equip": { "flag": "STRENGTH", "damage": "1d8", "to_hit": 0 }
- },
- {
- "id": "equip_smallshield",
- "name": { "name": "buckler", "plural": "bucklers" },
- "renderable": { "glyph": "[", "fg": "#808080", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 2,
- "value": 5,
- "flags": ["EQUIP_SHIELD"],
- "effects": { "ac": "1" }
- },
- {
- "id": "equip_mediumshield",
- "name": { "name": "medium shield", "plural": "medium shields" },
- "renderable": { "glyph": "[", "fg": "#C0C0C0", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 6,
- "value": 10,
- "flags": ["EQUIP_SHIELD"],
- "effects": { "ac": "2", "to_hit": "-1" }
- },
- {
- "id": "equip_largeshield",
- "name": { "name": "large shield", "plural": "large shields" },
- "renderable": { "glyph": "[", "fg": "#FFF8DC", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 12,
- "value": 35,
- "flags": ["EQUIP_SHIELD"],
- "effects": { "ac": "3", "to_hit": "-2" }
- },
- {
- "id": "equip_body_weakleather",
- "name": { "name": "leather jacket", "plural": "leather jackets" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 8,
- "value": 5,
- "flags": ["EQUIP_BODY"],
- "effects": { "ac": "1" }
- },
- {
- "id": "equip_body_leather",
- "name": { "name": "leather chestpiece", "plural": "leather chestpiece" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 10,
- "value": 10,
- "flags": ["EQUIP_BODY"],
- "effects": { "ac": "2" }
- },
- {
- "id": "equip_body_studdedleather",
- "name": { "name": "studded leather chestpiece", "plural": "studded leather chestpieces" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 13,
- "value": 45,
- "flags": ["EQUIP_BODY"],
- "effects": { "ac": "3" }
- },
- {
- "id": "equip_body_ringmail_o",
- "name": { "name": "orcish ring mail", "plural": "orcish ring mail" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 45,
- "value": 50,
- "flags": ["EQUIP_BODY"],
- "effects": { "ac": "3" }
- },
- {
- "id": "equip_body_ringmail",
- "name": { "name": "ring mail", "plural": "ring mail" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 45,
- "value": 70,
- "flags": ["EQUIP_BODY"],
- "effects": { "ac": "4" }
- },
- {
- "id": "equip_head_leather",
- "name": { "name": "leather cap", "plural": "leather caps" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 2,
- "value": 10,
- "flags": ["EQUIP_HEAD"],
- "effects": { "ac": "1" }
- },
- {
- "id": "equip_head_elvish",
- "name": { "name": "elvish leather helm", "plural": "elvish leather helms" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 2,
- "value": 25,
- "flags": ["EQUIP_HEAD"],
- "effects": { "ac": "2" }
- },
- {
- "id": "equip_head_o",
- "name": { "name": "orcish helm", "plural": "orcish helm" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 6,
- "value": 25,
- "flags": ["EQUIP_HEAD"],
- "effects": { "ac": "2" }
- },
- {
- "id": "equip_head_iron",
- "name": { "name": "iron helm", "plural": "iron helm" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 10,
- "value": 45,
- "flags": ["EQUIP_HEAD"],
- "effects": { "ac": "3" }
- },
- {
- "id": "equip_feet_leather",
- "name": { "name": "leather shoes", "plural": "leather shoes" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 2,
- "value": 10,
- "flags": ["EQUIP_FEET"]
- },
- {
- "id": "equip_feet_elvish",
- "name": { "name": "elvish leather shoes", "plural": "elvish leather shoes" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 2,
- "value": 25,
- "flags": ["EQUIP_FEET"],
- "effects": { "ac": "1" }
- },
- {
- "id": "equip_feet_o",
- "name": { "name": "orcish boots", "plural": "orcish boots" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 6,
- "value": 25,
- "flags": ["EQUIP_FEET"],
- "effects": { "ac": "1" }
- },
- {
- "id": "equip_feet_iron",
- "name": { "name": "iron boots", "plural": "iron boots" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 10,
- "value": 45,
- "flags": ["EQUIP_FEET"],
- "effects": { "ac": "2" }
- },
- {
- "id": "equip_neck_protection",
- "name": { "name": "amulet of protection", "plural": "amulets of protection" },
- "renderable": { "glyph": "\"", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "amulet",
- "weight": 1,
- "value": 200,
- "flags": ["EQUIP_NECK"],
- "effects": { "ac": "1" }
- },
- {
- "id": "equip_back_protection",
- "name": { "name": "cloak of protection", "plural": "cloaks of protection" },
- "renderable": { "glyph": "[", "fg": "#aa6000", "bg": "#000000", "order": 2 },
- "class": "armour",
- "weight": 1,
- "value": 200,
- "flags": ["EQUIP_BACK"],
- "effects": { "ac": "1" }
- },
- {
- "id": "wand_magicmissile",
- "name": { "name": "wand of magic missile", "plural": "wands of magic missile" },
- "renderable": { "glyph": "/", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "wand",
- "weight": 2,
- "value": 100,
- "flags": ["CHARGES"],
- "effects": { "ranged": "12", "damage": "3d4+3;magic" },
- "magic": { "class": "uncommon", "naming": "wand" }
- },
- {
- "id": "wand_fireball",
- "name": { "name": "wand of fireball", "plural": "wands of fireball" },
- "renderable": { "glyph": "/", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "wand",
- "weight": 2,
- "value": 300,
- "flags": ["CHARGES"],
- "effects": { "ranged": "10", "damage": "8d6;fire", "aoe": "3" },
- "magic": { "class": "rare", "naming": "wand" }
- },
- {
- "id": "wand_confusion",
- "name": { "name": "wand of confusion", "plural": "wands of confusion" },
- "renderable": { "glyph": "/", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "wand",
- "weight": 2,
- "value": 200,
- "flags": ["CHARGES"],
- "effects": { "ranged": "10", "confusion": "4" },
- "magic": { "class": "uncommon", "naming": "wand" }
- },
- {
- "id": "wand_digging",
- "name": { "name": "wand of digging", "plural": "wands of digging" },
- "renderable": { "glyph": "/", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "class": "wand",
- "weight": 2,
- "value": 300,
- "flags": ["CHARGES", "DIGGER"],
- "effects": { "ranged": "10" },
- "magic": { "class": "rare", "naming": "wand" }
- },
- {
- "id": "food_rations",
- "name": { "name": "rations", "plural": "rations" },
- "renderable": { "glyph": "%", "fg": "#FFA07A", "bg": "#000000", "order": 2 },
- "class": "comestible",
- "weight": 1,
- "value": 1,
- "flags": ["FOOD", "CONSUMABLE", "STACKABLE"]
- },
- {
- "id": "food_apple",
- "name": { "name": "apple", "plural": "apples" },
- "renderable": { "glyph": "%", "fg": "#00FF00", "bg": "#000000", "order": 2 },
- "class": "comestible",
- "weight": 0.5,
- "value": 1,
- "flags": ["FOOD", "CONSUMABLE", "STACKABLE"]
- }
-]
diff --git a/raws/loot_tables.json b/raws/loot_tables.json
deleted file mode 100644
index f177e5b..0000000
--- a/raws/loot_tables.json
+++ /dev/null
@@ -1,9 +0,0 @@
-[
- {
- "id": "animal",
- "table": [
- { "id": "animal_hide", "weight": 1},
- { "id": "animal_meat", "weight": 1}
- ]
- }
-]
diff --git a/raws/mobs.json b/raws/mobs.json
deleted file mode 100644
index ddd6556..0000000
--- a/raws/mobs.json
+++ /dev/null
@@ -1,513 +0,0 @@
-[
- {
- "id": "npc_barkeep",
- "name": "barkeep",
- "renderable": { "glyph": "@", "fg": "#EE82EE", "bg": "#000000", "order": 1 },
- "flags": ["NEUTRAL", "IS_HUMAN"],
- "vision_range": 4,
- "quips": ["Drink?", "Something to eat?", "Don't go out on an empty stomach."]
- },
- {
- "id": "npc_townsperson",
- "name": "townsperson",
- "renderable": { "glyph": "@", "fg": "#9fa86c", "bg": "#000000", "order": 1 },
- "flags": ["NEUTRAL", "RANDOM_PATH", "IS_HUMAN"],
- "vision_range": 4,
- "quips": ["Hello!", "Good morning.", ""]
- },
- {
- "id": "npc_drunk",
- "name": "drunk",
- "renderable": { "glyph": "@", "fg": "#a0a83c", "bg": "#000000", "order": 1 },
- "flags": ["NEUTRAL", "IS_HUMAN"],
- "vision_range": 4,
- "quips": ["Hic!", "H-Hic'.", "Get me 'nother, would you?"]
- },
- {
- "id": "npc_fisher",
- "name": "fisher",
- "renderable": { "glyph": "@", "fg": "#3ca3a8", "bg": "#000000", "order": 1 },
- "flags": ["NEUTRAL", "IS_HUMAN"],
- "vision_range": 4,
- "quips": ["Hey."]
- },
- {
- "id": "npc_dockworker",
- "name": "dock worker",
- "renderable": { "glyph": "@", "fg": "#68d8de", "bg": "#000000", "order": 1 },
- "flags": ["NEUTRAL", "IS_HUMAN"],
- "vision_range": 4,
- "quips": ["No boat for a few days.", "Not much for us to do."]
- },
- {
- "id": "npc_priest",
- "name": "priest",
- "renderable": { "glyph": "@", "fg": "#FFFFFF", "bg": "#000000", "order": 1 },
- "flags": ["NEUTRAL", "IS_HUMAN"],
- "vision_range": 4,
- "quips": ["Light's givings.", "", "Bless you."]
- },
- {
- "id": "npc_miner",
- "name": "miner",
- "renderable": { "glyph": "@", "fg": "#946123", "bg": "#000000", "order": 1 },
- "flags": ["NEUTRAL", "IS_HUMAN"],
- "vision_range": 4,
- "attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d8" }],
- "quips": ["You're not borrowing my pick."]
- },
- {
- "id": "npc_guard",
- "name": "smalltown guard",
- "renderable": { "glyph": "@", "fg": "#034efc", "bg": "#000000", "order": 1 },
- "flags": ["NEUTRAL", "RANDOM_PATH", "IS_HUMAN"],
- "level": 2,
- "attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d8" }],
- "equipped": ["equip_shortsword", "equip_body_leather"],
- "quips": ["You wont catch me down the mine.", "Staying out of trouble?"]
- },
- {
- "id": "rat",
- "name": "rat",
- "renderable": { "glyph": "r", "fg": "#aa6000", "bg": "#000000", "order": 1 },
- "flags": [],
- "bac": 6,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d2" }],
- "loot": { "table": "food", "chance": 0.1 }
- },
- {
- "id": "chicken",
- "name": "chicken",
- "renderable": { "glyph": "c", "fg": "#BB6000", "bg": "#000000", "order": 1 },
- "flags": ["HERBIVORE"],
- "bac": 8,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d3" }]
- },
- {
- "id": "deer_little",
- "name": "fawn",
- "renderable": { "glyph": "q", "fg": "#a57037", "bg": "#000000", "order": 1 },
- "flags": ["HERBIVORE"],
- "bac": 8,
- "attacks": [{ "name": "kicks", "hit_bonus": 0, "damage": "1d2" }]
- },
- {
- "id": "sheep_little",
- "name": "lamb",
- "renderable": { "glyph": "q", "fg": "#e7e7e7", "bg": "#000000", "order": 1 },
- "flags": ["HERBIVORE", "SMALL_GROUP"],
- "bac": 10,
- "attacks": [{ "name": "kicks", "hit_bonus": 0, "damage": "1d2" }]
- },
- {
- "id": "chicken_little",
- "name": "chick",
- "renderable": { "glyph": "c", "fg": "#fae478", "bg": "#000000", "order": 1 },
- "flags": ["HERBIVORE"],
- "bac": 10,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d2" }]
- },
- {
- "id": "horse_little",
- "name": "pony",
- "renderable": { "glyph": "u", "fg": "#b36c29", "bg": "#000000", "order": 1 },
- "flags": ["HERBIVORE", "MULTIATTACK"],
- "level": 3,
- "bac": 6,
- "speed": 16,
- "attacks": [
- { "name": "kicks", "hit_bonus": 0, "damage": "1d6" },
- { "name": "bites", "hit_bonus": 0, "damage": "1d2" }
- ],
- "quips": [""]
- },
- {
- "id": "horse",
- "name": "horse",
- "renderable": { "glyph": "u", "fg": "#744d29", "bg": "#000000", "order": 1 },
- "flags": ["MULTIATTACK"],
- "level": 5,
- "bac": 5,
- "speed": 20,
- "attacks": [
- { "name": "kicks", "hit_bonus": 0, "damage": "1d8" },
- { "name": "bites", "hit_bonus": 0, "damage": "1d3" }
- ]
- },
- {
- "id": "horse_large",
- "name": "warhorse",
- "renderable": { "glyph": "u", "fg": "#8a3520", "bg": "#000000", "order": 1 },
- "flags": ["MULTIATTACK"],
- "level": 7,
- "bac": 4,
- "speed": 24,
- "attacks": [
- { "name": "kicks", "hit_bonus": 0, "damage": "1d10" },
- { "name": "bites", "hit_bonus": 0, "damage": "1d4" }
- ]
- },
- {
- "id": "rat_giant",
- "name": "giant rat",
- "renderable": { "glyph": "r", "fg": "#bb8000", "bg": "#000000", "order": 1 },
- "flags": ["SMALL_GROUP"],
- "level": 1,
- "bac": 7,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d3" }],
- "loot": { "table": "scrolls", "chance": 0.05 }
- },
- {
- "id": "dog_little",
- "name": "little dog",
- "renderable": { "glyph": "d", "fg": "#FFFFFF", "bg": "#000000", "order": 1 },
- "flags": ["NEUTRAL"],
- "level": 2,
- "bac": 6,
- "speed": 18,
- "quips": ["", "", ""],
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d6" }]
- },
- {
- "id": "dog",
- "name": "dog",
- "renderable": { "glyph": "d", "fg": "#EEEEEE", "bg": "#000000", "order": 1 },
- "flags": [],
- "level": 4,
- "bac": 5,
- "speed": 16,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d6" }]
- },
- {
- "id": "dog_large",
- "name": "large dog",
- "renderable": { "glyph": "d", "fg": "#DDDDDD", "bg": "#000000", "order": 1 },
- "flags": [],
- "level": 6,
- "bac": 4,
- "speed": 15,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "2d4" }]
- },
- {
- "id": "gnome",
- "name": "gnome",
- "renderable": { "glyph": "G", "fg": "#AA5500", "bg": "#000000", "order": 1 },
- "flags": ["SMALL_GROUP", "IS_GNOME"],
- "level": 1,
- "speed": 6,
- "attacks": [{ "name": "claws", "hit_bonus": 0, "damage": "1d6" }],
- "loot": { "table": "wands", "chance": 0.05 }
- },
- {
- "id": "zombie_gnome",
- "name": "gnome zombie",
- "renderable": { "glyph": "z", "fg": "#AA5500", "bg": "#000000", "order": 1 },
- "flags": ["MINDLESS"],
- "level": 1,
- "speed": 6,
- "vision_range": 12,
- "attacks": [{ "name": "claws", "hit_bonus": 0, "damage": "1d4" }],
- "loot": { "table": "wands", "chance": 0.05 }
- },
- {
- "id": "goblin",
- "name": "goblin",
- "renderable": { "glyph": "g", "fg": "#00FF00", "bg": "#000000", "order": 1 },
- "flags": [],
- "level": 1,
- "speed": 9,
- "attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d4" }]
- },
- {
- "id": "kobold",
- "name": "kobold",
- "renderable": { "glyph": "k", "fg": "#AA5500", "bg": "#000000", "order": 1 },
- "flags": [],
- "level": 1,
- "speed": 6,
- "attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d4" }],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "zombie_kobold",
- "name": "kobold zombie",
- "renderable": { "glyph": "z", "fg": "#AA5500", "bg": "#000000", "order": 1 },
- "flags": ["MINDLESS"],
- "level": 1,
- "speed": 6,
- "vision_range": 12,
- "attacks": [{ "name": "claws", "hit_bonus": 0, "damage": "1d4" }],
- "loot": { "table": "scrolls", "chance": 0.05 }
- },
- {
- "id": "kobold_large",
- "name": "large kobold",
- "renderable": { "glyph": "k", "fg": "#70461b", "bg": "#000000", "order": 1 },
- "flags": [],
- "level": 1,
- "speed": 6,
- "vision_range": 12,
- "attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d6" }],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "zombie_orc",
- "name": "orc zombie",
- "renderable": { "glyph": "z", "fg": "#dbd830", "bg": "#000000", "order": 1 },
- "flags": ["MINDLESS"],
- "level": 2,
- "bac": 9,
- "speed": 6,
- "vision_range": 12,
- "attacks": [{ "name": "claws", "hit_bonus": 0, "damage": "1d6" }],
- "loot": { "table": "potions", "chance": 0.05 }
- },
- {
- "id": "dwarf",
- "name": "dwarf",
- "renderable": { "glyph": "h", "fg": "#d61b1b", "bg": "#000000", "order": 1 },
- "flags": ["IS_DWARF"],
- "level": 2,
- "bac": 10,
- "speed": 6,
- "attacks": [{ "name": "hacks", "hit_bonus": 0, "damage": "1d8" }],
- "equipped": ["equip_feet_iron"],
- "loot": { "table": "equipment", "chance": 0.05 }
- },
- {
- "id": "zombie_dwarf",
- "name": "dwarf zombie",
- "renderable": { "glyph": "z", "fg": "#d61b1b", "bg": "#000000", "order": 1 },
- "flags": ["MINDLESS"],
- "level": 2,
- "bac": 9,
- "speed": 6,
- "vision_range": 12,
- "attacks": [{ "name": "claws", "hit_bonus": 0, "damage": "1d6" }],
- "loot": { "table": "equipment", "chance": 0.05 }
- },
- {
- "id": "kobold_captain",
- "name": "kobold captain",
- "renderable": { "glyph": "k", "fg": "#9331ac", "bg": "#000000", "order": 1 },
- "flags": [],
- "level": 2,
- "speed": 6,
- "vision_range": 12,
- "attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "2d4" }],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "spider_cave",
- "name": "cave spider",
- "renderable": { "glyph": "s", "fg": "#6b6b6b", "bg": "#000000", "order": 1 },
- "flags": ["SMALL_GROUP"],
- "level": 1,
- "bac": 3,
- "speed": 12,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d2" }],
- "loot": { "table": "scrolls", "chance": 0.05 }
- },
- {
- "id": "ant_worker",
- "name": "worker ant",
- "renderable": { "glyph": "a", "fg": "#ca7631", "bg": "#000000", "order": 1 },
- "flags": ["SMALL_GROUP"],
- "level": 2,
- "bac": 3,
- "speed": 18,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d4" }],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "ant_soldier",
- "name": "soldier ant",
- "renderable": { "glyph": "a", "fg": "#ca3f26", "bg": "#000000", "order": 1 },
- "flags": ["SMALL_GROUP", "POISON_RES"],
- "level": 3,
- "bac": 3,
- "speed": 18,
- "attacks": [
- { "name": "bites", "hit_bonus": 0, "damage": "2d4" },
- { "name": "stings", "hit_bonus": 0, "damage": "3d4;poison" }
- ],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "caterpillar_cave",
- "name": "caterpillar",
- "renderable": { "glyph": "a", "fg": "#6b6b6b", "bg": "#000000", "order": 1 },
- "flags": ["SMALL_GROUP"],
- "level": 1,
- "bac": 3,
- "speed": 9,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d3" }],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "caterpillar_giant",
- "name": "giant caterpillar",
- "renderable": { "glyph": "a", "fg": "#b9aeae", "bg": "#000000", "order": 1 },
- "flags": ["SMALL_GROUP"],
- "level": 2,
- "bac": 7,
- "speed": 9,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d6" }],
- "loot": { "table": "food", "chance": 0.10 }
- },
- {
- "id": "jackal",
- "name": "jackal",
- "renderable": { "glyph": "d", "fg": "#AA5500", "bg": "#000000", "order": 1 },
- "flags": ["CARNIVORE", "SMALL_GROUP"],
- "bac": 7,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d2" }]
- },
- {
- "id": "fox",
- "name": "fox",
- "renderable": { "glyph": "d", "fg": "#FF0000", "bg": "#000000", "order": 1 },
- "flags": ["CARNIVORE"],
- "bac": 7,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d3" }]
- },
- {
- "id": "coyote",
- "name": "coyote",
- "renderable": { "glyph": "d", "fg": "#6E3215", "bg": "#000000", "order": 1 },
- "flags": ["CARNIVORE", "SMALL_GROUP"],
- "level": 1,
- "bac": 7,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "1d4" }]
- },
- {
- "id": "wolf",
- "name": "wolf",
- "renderable": { "glyph": "d", "fg": "#5E4225", "bg": "#000000", "order": 1 },
- "flags": ["CARNIVORE"],
- "level": 5,
- "bac": 4,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "2d4" }]
- },
- {
- "id": "goblin_chieftain",
- "name": "goblin chieftain",
- "renderable": { "glyph": "g", "fg": "#9331ac", "bg": "#000000", "order": 1 },
- "flags": [],
- "level": 2,
- "speed": 9,
- "attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d8" }],
- "loot": { "table": "wands", "chance": 0.05 }
- },
- {
- "id": "orc",
- "name": "orc",
- "renderable": { "glyph": "o", "fg": "#00FF00", "bg": "#000000", "order": 1 },
- "flags": ["SMALL_GROUP"],
- "level": 1,
- "speed": 9,
- "attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d6" }],
- "loot": { "table": "equipment", "chance": 0.05 }
- },
- {
- "id": "orc_hill",
- "name": "hill orc",
- "renderable": { "glyph": "o", "fg": "#dbd830", "bg": "#000000", "order": 1 },
- "flags": ["LARGE_GROUP"],
- "level": 2,
- "speed": 9,
- "attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "1d6" }],
- "loot": { "table": "equipment", "chance": 0.05 }
- },
- {
- "id": "orc_captain",
- "name": "orc captain",
- "renderable": { "glyph": "o", "fg": "#9331ac", "bg": "#000000", "order": 1 },
- "flags": ["MULTIATTACK"],
- "level": 5,
- "speed": 5,
- "attacks": [
- { "name": "hits", "hit_bonus": 0, "damage": "2d4" },
- { "name": "hits", "hit_bonus": 0, "damage": "2d4" }
- ],
- "loot": { "table": "equipment", "chance": 0.05 }
- },
- {
- "id": "warg",
- "name": "warg",
- "renderable": { "glyph": "d", "fg": "#8b7164", "bg": "#000000", "order": 1 },
- "flags": ["SMALL_GROUP"],
- "level": 7,
- "bac": 4,
- "speed": 12,
- "attacks": [{ "name": "bites", "hit_bonus": 0, "damage": "2d6" }],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "jaguar",
- "name": "jaguar",
- "renderable": { "glyph": "f", "fg": "#d3b947", "bg": "#000000", "order": 1 },
- "flags": ["MULTIATTACK"],
- "level": 4,
- "bac": 6,
- "speed": 15,
- "attacks": [
- { "name": "claws", "hit_bonus": 0, "damage": "1d4" },
- { "name": "claws", "hit_bonus": 0, "damage": "1d4" },
- { "name": "bites", "hit_bonus": 0, "damage": "1d8" }
- ],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "lynx",
- "name": "lynx",
- "renderable": { "glyph": "f", "fg": "#b5d347", "bg": "#000000", "order": 1 },
- "flags": ["MULTIATTACK"],
- "level": 5,
- "bac": 6,
- "speed": 15,
- "attacks": [
- { "name": "claws", "hit_bonus": 0, "damage": "1d4" },
- { "name": "claws", "hit_bonus": 0, "damage": "1d4" },
- { "name": "bites", "hit_bonus": 0, "damage": "1d10" }
- ],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "panther",
- "name": "panther",
- "renderable": { "glyph": "f", "fg": "#58554e", "bg": "#000000", "order": 1 },
- "flags": ["MULTIATTACK"],
- "level": 5,
- "bac": 6,
- "speed": 15,
- "attacks": [
- { "name": "claws", "hit_bonus": 0, "damage": "1d6" },
- { "name": "claws", "hit_bonus": 0, "damage": "1d6" },
- { "name": "bites", "hit_bonus": 0, "damage": "1d10" }
- ],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "ogre",
- "name": "ogre",
- "renderable": { "glyph": "O", "fg": "#10A70d", "bg": "#000000", "order": 1 },
- "flags": ["SMALL_GROUP"],
- "level": 5,
- "bac": 5,
- "speed": 10,
- "attacks": [{ "name": "hits", "hit_bonus": 0, "damage": "2d5" }],
- "loot": { "table": "food", "chance": 0.05 }
- },
- {
- "id": "treant_small",
- "name": "treant sapling",
- "renderable": { "glyph": "♠️", "fg": "#10570d", "bg": "#000000", "order": 1 },
- "flags": ["LARGE_GROUP", "GREEN_BLOOD", "FIRE_WEAK"],
- "level": 2,
- "bac": 12,
- "speed": 3,
- "attacks": [{ "name": "lashes", "hit_bonus": 4, "damage": "1d8" }],
- "loot": { "table": "scrolls", "chance": 0.05 }
- }
-]
diff --git a/raws/props.json b/raws/props.json
deleted file mode 100644
index 0c48291..0000000
--- a/raws/props.json
+++ /dev/null
@@ -1,85 +0,0 @@
-[
- {
- "id": "door",
- "name": "door",
- "renderable": { "glyph": "+", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
- "flags": ["DOOR"]
- },
- {
- "id": "prop_altar",
- "name": "altar",
- "renderable": { "glyph": "_", "fg": "#FFFFFF", "bg": "#000000", "order": 2 },
- "flags": ["ENTRY_TRIGGER"],
- "effects": { "heal": "8d8" }
- },
- {
- "id": "prop_keg",
- "name": "keg",
- "renderable": { "glyph": "φ", "fg": "#AAAAAA", "bg": "#000000", "order": 2 },
- "flags": []
- },
- {
- "id": "prop_table",
- "name": "table",
- "renderable": { "glyph": "-", "fg": "#AAAAAA", "bg": "#000000", "order": 2 },
- "flags": []
- },
- {
- "id": "prop_hay",
- "name": "hay",
- "renderable": { "glyph": "%", "fg": "#c7ad39", "bg": "#000000", "order": 2 },
- "flags": []
- },
- {
- "id": "prop_statue",
- "name": "statue",
- "renderable": { "glyph": "@", "fg": "#ffffff", "bg": "#000000", "order": 2 },
- "flags": []
- },
- {
- "id": "prop_bed",
- "name": "bed",
- "renderable": { "glyph": "=", "fg": "#AAAAAA", "bg": "#000000", "order": 2 },
- "flags": []
- },
- {
- "id": "prop_chair",
- "name": "chair",
- "renderable": { "glyph": "└", "fg": "#AAAAAA", "bg": "#000000", "order": 2 },
- "flags": []
- },
- {
- "id": "prop_candle",
- "name": "candle",
- "renderable": { "glyph": "Ä", "fg": "#FFA500", "bg": "#000000", "order": 2 },
- "flags": []
- },
- {
- "id": "trap_bear",
- "name": "bear trap",
- "renderable": { "glyph": "^", "fg": "#e6e6e6", "bg": "#000000", "order": 2 },
- "flags": ["HIDDEN", "ENTRY_TRIGGER", "SINGLE_ACTIVATION"],
- "effects": { "damage": "2d4" }
- },
- {
- "id": "trap_mini_mine",
- "name": "mini-mine",
- "renderable": { "glyph": "^", "fg": "#ff1e00", "bg": "#000000", "order": 2 },
- "flags": ["ENTRY_TRIGGER", "SINGLE_ACTIVATION"],
- "effects": { "damage": "2d4", "aoe": "3" }
- },
- {
- "id": "trap_stonefall",
- "name": "stonefall trap",
- "renderable": { "glyph": "^", "fg": "#beb5a7", "bg": "#000000", "order": 2 },
- "flags": ["HIDDEN", "ENTRY_TRIGGER", "SINGLE_ACTIVATION"],
- "effects": { "damage": "2d10" }
- },
- {
- "id": "trap_confusion",
- "name": "magic trap",
- "renderable": { "glyph": "^", "fg": "#df07df", "bg": "#000000", "order": 2 },
- "flags": ["HIDDEN", "ENTRY_TRIGGER", "SINGLE_ACTIVATION"],
- "effects": { "confusion": "3" }
- }
-]
diff --git a/raws/spawn_tables.json b/raws/spawn_tables.json
deleted file mode 100644
index b624a80..0000000
--- a/raws/spawn_tables.json
+++ /dev/null
@@ -1,151 +0,0 @@
-[
- {
- "id": "equipment",
- "table": [
- { "id": "equip_pitchfork", "weight": 1, "difficulty": 1},
- { "id": "equip_sickle", "weight": 1, "difficulty": 1},
- { "id": "equip_handaxe", "weight": 1, "difficulty": 1},
- { "id": "equip_dagger", "weight": 3, "difficulty": 1},
- { "id": "equip_shortsword", "weight": 3, "difficulty": 1},
- { "id": "equip_rapier", "weight": 2, "difficulty": 1},
- { "id": "equip_smallshield", "weight": 3, "difficulty": 1},
- { "id": "equip_mediumshield", "weight": 2, "difficulty": 1},
- { "id": "equip_body_weakleather", "weight": 4, "difficulty": 1},
- { "id": "equip_head_leather", "weight": 4, "difficulty": 1},
- { "id": "equip_feet_leather", "weight": 4, "difficulty": 1},
- { "id": "equip_body_leather", "weight": 4, "difficulty": 1},
- { "id": "equip_neck_protection", "weight": 1, "difficulty": 1},
- { "id": "equip_back_protection", "weight": 1, "difficulty": 1},
- { "id": "equip_body_studdedleather","weight": 3, "difficulty": 2},
- { "id": "equip_head_o", "weight": 4, "difficulty": 2},
- { "id": "equip_longsword", "weight": 2, "difficulty": 3},
- { "id": "equip_head_elvish", "weight": 3, "difficulty": 3},
- { "id": "equip_feet_elvish", "weight": 3, "difficulty": 3},
- { "id": "equip_body_ringmail_o", "weight": 4, "difficulty": 3},
- { "id": "equip_feet_o", "weight": 4, "difficulty": 3},
- { "id": "equip_body_ringmail", "weight": 2, "difficulty": 3},
- { "id": "equip_largeshield", "weight": 2, "difficulty": 3},
- { "id": "equip_head_iron", "weight": 3, "difficulty": 4},
- { "id": "equip_feet_iron", "weight": 2, "difficulty": 4}
- ]
- },
- {
- "id": "villager_equipment",
- "table": [
- { "id": "equip_pitchfork", "weight": 1, "difficulty": 1},
- { "id": "equip_sickle", "weight": 1, "difficulty": 1},
- { "id": "equip_handaxe", "weight": 1, "difficulty": 1}
- ]
- },
- {
- "id": "potions",
- "table": [
- { "id": "potion_health_weak", "weight": 6, "difficulty": 1},
- { "id": "potion_health", "weight": 3, "difficulty": 1}
- ]
- },
- {
- "id": "scrolls",
- "table": [
- { "id": "scroll_identify", "weight": 3, "difficulty": 1},
- { "id": "scroll_removecurse", "weight": 2, "difficulty": 1},
- { "id": "scroll_confusion", "weight": 2, "difficulty": 1},
- { "id": "scroll_magicmap", "weight": 2, "difficulty": 1},
- { "id": "scroll_embers", "weight": 2, "difficulty": 2},
- { "id": "scroll_health", "weight": 2, "difficulty": 2},
- { "id": "scroll_fireball", "weight": 2, "difficulty": 2},
- { "id": "scroll_mass_health", "weight": 1, "difficulty": 2},
- { "id": "scroll_mass_confusion", "weight": 1, "difficulty": 3}
- ]
- },
- {
- "id": "wands",
- "table": [
- { "id": "wand_magicmissile", "weight": 1, "difficulty": 1},
- { "id": "wand_confusion", "weight": 1, "difficulty": 1},
- { "id": "wand_digging", "weight": 1, "difficulty": 1},
- { "id": "wand_fireball", "weight": 1, "difficulty": 2}
- ]
- },
- {
- "id": "food",
- "table": [
- { "id": "food_rations", "weight": 1, "difficulty": 1},
- { "id": "food_apple", "weight": 1, "difficulty": 1}
- ]
- },
- {
- "id": "mobs",
- "table": [
- { "id": "sheep_little", "weight": 1, "difficulty": 0},
- { "id": "chicken", "weight": 1, "difficulty": 1},
- { "id": "rat", "weight": 1, "difficulty": 1},
- { "id": "goblin", "weight": 3, "difficulty": 1},
- { "id": "kobold", "weight": 1, "difficulty": 1},
- { "id": "fox", "weight": 1, "difficulty": 1},
- { "id": "jackal", "weight": 4, "difficulty": 1},
- { "id": "deer_little", "weight": 1, "difficulty": 1},
- { "id": "treant_small", "weight": 1, "difficulty": 1},
- { "id": "zombie_kobold", "weight": 1, "difficulty": 1},
- { "id": "zombie_gnome", "weight": 1, "difficulty": 2},
- { "id": "kobold_large", "weight": 1, "difficulty": 2},
- { "id": "rat_giant", "weight": 2, "difficulty": 2},
- { "id": "coyote", "weight": 4, "difficulty": 2},
- { "id": "caterpillar_cave", "weight": 2, "difficulty": 2},
- { "id": "caterpillar_giant", "weight": 2, "difficulty": 3},
- { "id": "zombie_orc", "weight": 1, "difficulty": 3},
- { "id": "zombie_dwarf", "weight": 1, "difficulty": 3},
- { "id": "gnome", "weight": 1, "difficulty": 3},
- { "id": "spider_cave", "weight": 2, "difficulty": 3},
- { "id": "kobold_captain", "weight": 1, "difficulty": 3},
- { "id": "dog_little", "weight": 1, "difficulty": 3},
- { "id": "orc", "weight": 2, "difficulty": 3},
- { "id": "goblin_chieftain", "weight": 1, "difficulty": 3},
- { "id": "dwarf", "weight": 3, "difficulty": 4},
- { "id": "orc_hill", "weight": 1, "difficulty": 4},
- { "id": "horse_little", "weight": 2, "difficulty": 4},
- { "id": "ant_worker", "weight": 3, "difficulty": 4},
- { "id": "dog", "weight": 1, "difficulty": 5},
- { "id": "wolf", "weight": 2, "difficulty": 6},
- { "id": "jaguar", "weight": 2, "difficulty": 6},
- { "id": "ant_soldier", "weight": 2, "difficulty": 6},
- { "id": "orc_captain", "weight": 1, "difficulty": 7},
- { "id": "dog_large", "weight": 1, "difficulty": 7},
- { "id": "lynx", "weight": 1, "difficulty": 7},
- { "id": "panther", "weight": 1, "difficulty": 7},
- { "id": "horse", "weight": 2, "difficulty": 7},
- { "id": "ogre", "weight": 1, "difficulty": 7},
- { "id": "warg", "weight": 2, "difficulty": 8},
- { "id": "horse_large", "weight": 2, "difficulty": 9}
- ]
- },
- {
- "id": "squad_goblin",
- "table": [
- { "id": "goblin", "weight": 3, "difficulty": 1}
- ]
- },
- {
- "id": "squad_kobold",
- "table": [
- { "id": "kobold", "weight": 3, "difficulty": 1},
- { "id": "kobold_large", "weight": 2, "difficulty": 2}
- ]
- },
- {
- "id": "squad_orc",
- "table": [
- { "id": "orc", "weight": 2, "difficulty": 2},
- { "id": "orc_hill", "weight": 1, "difficulty": 4}
- ]
- },
- {
- "id": "traps",
- "table": [
- { "id": "trap_bear", "weight": 2, "difficulty": 1},
- { "id": "trap_confusion", "weight": 1, "difficulty": 1},
- { "id": "trap_mini_mine", "weight": 1, "difficulty": 3},
- { "id": "trap_stonefall", "weight": 1, "difficulty": 5}
- ]
- }
-]
diff --git a/resources/curses14x16.png b/resources/curses14x16.png
deleted file mode 100644
index a06abb6..0000000
Binary files a/resources/curses14x16.png and /dev/null differ
diff --git a/resources/title_image.xp b/resources/title_image.xp
deleted file mode 100644
index c95bf16..0000000
Binary files a/resources/title_image.xp and /dev/null differ
diff --git a/resources/wfc-demo1.xp b/resources/wfc-demo1.xp
deleted file mode 100644
index 3809f02..0000000
Binary files a/resources/wfc-demo1.xp and /dev/null differ
diff --git a/resources/wfc-populated.xp b/resources/wfc-populated.xp
deleted file mode 100644
index 724d341..0000000
Binary files a/resources/wfc-populated.xp and /dev/null differ
diff --git a/wasm/rust-rl.js b/rust-rl.js
similarity index 75%
rename from wasm/rust-rl.js
rename to rust-rl.js
index ffbe20e..6d18af6 100644
--- a/wasm/rust-rl.js
+++ b/rust-rl.js
@@ -94,6 +94,7 @@ function passStringToWasm0(arg, malloc, realloc) {
const ret = encodeString(arg, view);
offset += ret.written;
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
}
WASM_VECTOR_LEN = offset;
@@ -187,6 +188,12 @@ function getStringFromWasm0(ptr, len) {
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
}
+const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(state => {
+ wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b)
+});
+
function makeMutClosure(arg0, arg1, dtor, f) {
const state = { a: arg0, b: arg1, cnt: 1, dtor };
const real = (...args) => {
@@ -201,22 +208,22 @@ function makeMutClosure(arg0, arg1, dtor, f) {
} finally {
if (--state.cnt === 0) {
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
-
+ CLOSURE_DTORS.unregister(state);
} else {
state.a = a;
}
}
};
real.original = state;
-
+ CLOSURE_DTORS.register(real, state, state);
return real;
}
function __wbg_adapter_20(arg0, arg1) {
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb6c6b1cd103d974c(arg0, arg1);
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8da99561c0deee8a(arg0, arg1);
}
function __wbg_adapter_23(arg0, arg1, arg2) {
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h02b9f16709be0849(arg0, arg1, addHeapObject(arg2));
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h140d7fafa8b9c22e(arg0, arg1, addHeapObject(arg2));
}
function handleError(f, args) {
@@ -320,372 +327,382 @@ function __wbg_get_imports() {
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
return ret;
};
- imports.wbg.__wbg_instanceof_WebGl2RenderingContext_f921526c513bf717 = function(arg0) {
+ imports.wbg.__wbg_instanceof_WebGl2RenderingContext_6b8f92d566ced9e1 = function(arg0) {
let result;
try {
result = getObject(arg0) instanceof WebGL2RenderingContext;
- } catch {
+ } catch (_) {
result = false;
}
const ret = result;
return ret;
};
- imports.wbg.__wbg_bindVertexArray_8863a216d7b0a339 = function(arg0, arg1) {
+ imports.wbg.__wbg_bindVertexArray_239574d42dbbd203 = function(arg0, arg1) {
getObject(arg0).bindVertexArray(getObject(arg1));
};
- imports.wbg.__wbg_bufferData_21334671c4ba6004 = function(arg0, arg1, arg2, arg3) {
+ imports.wbg.__wbg_bufferData_c787516945ba48c2 = function(arg0, arg1, arg2, arg3) {
getObject(arg0).bufferData(arg1 >>> 0, getObject(arg2), arg3 >>> 0);
};
- imports.wbg.__wbg_createVertexArray_51d51e1e1e13e9f6 = function(arg0) {
+ imports.wbg.__wbg_createVertexArray_4f450ed4d4a69acf = function(arg0) {
const ret = getObject(arg0).createVertexArray();
return isLikeNone(ret) ? 0 : addHeapObject(ret);
};
- imports.wbg.__wbg_texImage2D_07240affd06971e9 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
+ imports.wbg.__wbg_texImage2D_2558a70047650d54 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
getObject(arg0).texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, getObject(arg9));
}, arguments) };
- imports.wbg.__wbg_attachShader_47256b6b3d42a22e = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_attachShader_2112634b3ffa9e9f = function(arg0, arg1, arg2) {
getObject(arg0).attachShader(getObject(arg1), getObject(arg2));
};
- imports.wbg.__wbg_bindBuffer_24f6010e273fa400 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_bindBuffer_90d4fb91538001d5 = function(arg0, arg1, arg2) {
getObject(arg0).bindBuffer(arg1 >>> 0, getObject(arg2));
};
- imports.wbg.__wbg_bindFramebuffer_a9573e340dab20fe = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_bindFramebuffer_4f950b884dc4be83 = function(arg0, arg1, arg2) {
getObject(arg0).bindFramebuffer(arg1 >>> 0, getObject(arg2));
};
- imports.wbg.__wbg_bindTexture_92d6d7f8bff9531e = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_bindTexture_75a698c47a923814 = function(arg0, arg1, arg2) {
getObject(arg0).bindTexture(arg1 >>> 0, getObject(arg2));
};
- imports.wbg.__wbg_blendFunc_533de6de45b80a09 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_blendFunc_cffe61957c92e9ac = function(arg0, arg1, arg2) {
getObject(arg0).blendFunc(arg1 >>> 0, arg2 >>> 0);
};
- imports.wbg.__wbg_clear_2db2efe323bfdf68 = function(arg0, arg1) {
+ imports.wbg.__wbg_clear_8e2508724944df18 = function(arg0, arg1) {
getObject(arg0).clear(arg1 >>> 0);
};
- imports.wbg.__wbg_clearColor_7a7d04702f7e38e5 = function(arg0, arg1, arg2, arg3, arg4) {
+ imports.wbg.__wbg_clearColor_480962bfac4e1cbd = function(arg0, arg1, arg2, arg3, arg4) {
getObject(arg0).clearColor(arg1, arg2, arg3, arg4);
};
- imports.wbg.__wbg_compileShader_6bf78b425d5c98e1 = function(arg0, arg1) {
+ imports.wbg.__wbg_compileShader_f40e0c51a7a836fd = function(arg0, arg1) {
getObject(arg0).compileShader(getObject(arg1));
};
- imports.wbg.__wbg_createBuffer_323425af422748ac = function(arg0) {
+ imports.wbg.__wbg_createBuffer_7f57647465d111f0 = function(arg0) {
const ret = getObject(arg0).createBuffer();
return isLikeNone(ret) ? 0 : addHeapObject(ret);
};
- imports.wbg.__wbg_createFramebuffer_1684a99697ac9563 = function(arg0) {
+ imports.wbg.__wbg_createFramebuffer_8ebfde8c77472024 = function(arg0) {
const ret = getObject(arg0).createFramebuffer();
return isLikeNone(ret) ? 0 : addHeapObject(ret);
};
- imports.wbg.__wbg_createProgram_4eaf3b97b5747a62 = function(arg0) {
+ imports.wbg.__wbg_createProgram_7759fb2effb5d9b3 = function(arg0) {
const ret = getObject(arg0).createProgram();
return isLikeNone(ret) ? 0 : addHeapObject(ret);
};
- imports.wbg.__wbg_createShader_429776c9dd6fb87b = function(arg0, arg1) {
+ imports.wbg.__wbg_createShader_b474ef421ec0f80b = function(arg0, arg1) {
const ret = getObject(arg0).createShader(arg1 >>> 0);
return isLikeNone(ret) ? 0 : addHeapObject(ret);
};
- imports.wbg.__wbg_createTexture_1bf4d6fec570124b = function(arg0) {
+ imports.wbg.__wbg_createTexture_18b4a88c14cb086e = function(arg0) {
const ret = getObject(arg0).createTexture();
return isLikeNone(ret) ? 0 : addHeapObject(ret);
};
- imports.wbg.__wbg_disable_e02106ca6c7002d6 = function(arg0, arg1) {
+ imports.wbg.__wbg_disable_f0ef6e9a7ac6ddd7 = function(arg0, arg1) {
getObject(arg0).disable(arg1 >>> 0);
};
- imports.wbg.__wbg_drawArrays_c91ce3f736bf1f2a = function(arg0, arg1, arg2, arg3) {
+ imports.wbg.__wbg_drawArrays_5bf0d92947e472af = function(arg0, arg1, arg2, arg3) {
getObject(arg0).drawArrays(arg1 >>> 0, arg2, arg3);
};
- imports.wbg.__wbg_drawElements_a9529eefaf2008bd = function(arg0, arg1, arg2, arg3, arg4) {
+ imports.wbg.__wbg_drawElements_565a93d1efa4da07 = function(arg0, arg1, arg2, arg3, arg4) {
getObject(arg0).drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4);
};
- imports.wbg.__wbg_enable_195891416c520019 = function(arg0, arg1) {
+ imports.wbg.__wbg_enable_8b3019da8846ce76 = function(arg0, arg1) {
getObject(arg0).enable(arg1 >>> 0);
};
- imports.wbg.__wbg_enableVertexAttribArray_8804480c2ea0bb72 = function(arg0, arg1) {
+ imports.wbg.__wbg_enableVertexAttribArray_9d7b7e199f86e09b = function(arg0, arg1) {
getObject(arg0).enableVertexAttribArray(arg1 >>> 0);
};
- imports.wbg.__wbg_framebufferTexture2D_e88fcbd7f8523bb8 = function(arg0, arg1, arg2, arg3, arg4, arg5) {
+ imports.wbg.__wbg_framebufferTexture2D_a6ad7148f7983ae6 = function(arg0, arg1, arg2, arg3, arg4, arg5) {
getObject(arg0).framebufferTexture2D(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, getObject(arg4), arg5);
};
- imports.wbg.__wbg_getError_7191ad6ea53607fe = function(arg0) {
+ imports.wbg.__wbg_getError_d02c89917f45dd5e = function(arg0) {
const ret = getObject(arg0).getError();
return ret;
};
- imports.wbg.__wbg_getExtension_77909f6d51d49d4d = function() { return handleError(function (arg0, arg1, arg2) {
+ imports.wbg.__wbg_getExtension_bef4112494c87f34 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = getObject(arg0).getExtension(getStringFromWasm0(arg1, arg2));
return isLikeNone(ret) ? 0 : addHeapObject(ret);
}, arguments) };
- imports.wbg.__wbg_getParameter_55b36a787dbbfb74 = function() { return handleError(function (arg0, arg1) {
+ imports.wbg.__wbg_getParameter_aa9af66884d2b210 = function() { return handleError(function (arg0, arg1) {
const ret = getObject(arg0).getParameter(arg1 >>> 0);
return addHeapObject(ret);
}, arguments) };
- imports.wbg.__wbg_getProgramInfoLog_b81bc53188e286fa = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_getProgramInfoLog_4d189135f8d5a2de = function(arg0, arg1, arg2) {
const ret = getObject(arg1).getProgramInfoLog(getObject(arg2));
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};
- imports.wbg.__wbg_getProgramParameter_35522a0bfdfaad27 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_getProgramParameter_7b04ca71a79d9047 = function(arg0, arg1, arg2) {
const ret = getObject(arg0).getProgramParameter(getObject(arg1), arg2 >>> 0);
return addHeapObject(ret);
};
- imports.wbg.__wbg_getShaderInfoLog_968b93e75477d725 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_getShaderInfoLog_d5de3e4eab06fc46 = function(arg0, arg1, arg2) {
const ret = getObject(arg1).getShaderInfoLog(getObject(arg2));
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};
- imports.wbg.__wbg_getShaderParameter_ac2727ae4fe7648e = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_getShaderParameter_4ddb51279bb1500b = function(arg0, arg1, arg2) {
const ret = getObject(arg0).getShaderParameter(getObject(arg1), arg2 >>> 0);
return addHeapObject(ret);
};
- imports.wbg.__wbg_getSupportedExtensions_fafc31aab913037d = function(arg0) {
+ imports.wbg.__wbg_getSupportedExtensions_7a174085f9e1983a = function(arg0) {
const ret = getObject(arg0).getSupportedExtensions();
return isLikeNone(ret) ? 0 : addHeapObject(ret);
};
- imports.wbg.__wbg_getUniformLocation_9f6eb60c560a347b = function(arg0, arg1, arg2, arg3) {
+ imports.wbg.__wbg_getUniformLocation_51ec30e3755e574d = function(arg0, arg1, arg2, arg3) {
const ret = getObject(arg0).getUniformLocation(getObject(arg1), getStringFromWasm0(arg2, arg3));
return isLikeNone(ret) ? 0 : addHeapObject(ret);
};
- imports.wbg.__wbg_linkProgram_33998194075d71fb = function(arg0, arg1) {
+ imports.wbg.__wbg_linkProgram_eabc664217816e72 = function(arg0, arg1) {
getObject(arg0).linkProgram(getObject(arg1));
};
- imports.wbg.__wbg_shaderSource_1cb7c64dc7d1a500 = function(arg0, arg1, arg2, arg3) {
+ imports.wbg.__wbg_shaderSource_7943d06f24862a3b = function(arg0, arg1, arg2, arg3) {
getObject(arg0).shaderSource(getObject(arg1), getStringFromWasm0(arg2, arg3));
};
- imports.wbg.__wbg_texParameteri_85dad939f62a15aa = function(arg0, arg1, arg2, arg3) {
+ imports.wbg.__wbg_texParameteri_8f70dffce11d7da1 = function(arg0, arg1, arg2, arg3) {
getObject(arg0).texParameteri(arg1 >>> 0, arg2 >>> 0, arg3);
};
- imports.wbg.__wbg_uniform1i_d2e61a6a43889648 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_uniform1i_bdcd75be097285e6 = function(arg0, arg1, arg2) {
getObject(arg0).uniform1i(getObject(arg1), arg2);
};
- imports.wbg.__wbg_uniform3f_8364a0959b6c1570 = function(arg0, arg1, arg2, arg3, arg4) {
+ imports.wbg.__wbg_uniform3f_33d80ae15223c6db = function(arg0, arg1, arg2, arg3, arg4) {
getObject(arg0).uniform3f(getObject(arg1), arg2, arg3, arg4);
};
- imports.wbg.__wbg_useProgram_3683cf6f60939dcd = function(arg0, arg1) {
+ imports.wbg.__wbg_useProgram_757fab437af29c20 = function(arg0, arg1) {
getObject(arg0).useProgram(getObject(arg1));
};
- imports.wbg.__wbg_vertexAttribPointer_316ffe2f0458fde7 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
+ imports.wbg.__wbg_vertexAttribPointer_4416f0325c02aa13 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
getObject(arg0).vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6);
};
- imports.wbg.__wbg_getElementById_cc0e0d931b0d9a28 = function(arg0, arg1, arg2) {
- const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- };
- imports.wbg.__wbg_instanceof_HtmlCanvasElement_da5f9efa0688cf6d = function(arg0) {
- let result;
- try {
- result = getObject(arg0) instanceof HTMLCanvasElement;
- } catch {
- result = false;
- }
- const ret = result;
- return ret;
- };
- imports.wbg.__wbg_setwidth_a667a942dba6656e = function(arg0, arg1) {
- getObject(arg0).width = arg1 >>> 0;
- };
- imports.wbg.__wbg_setheight_a747d440760fe5aa = function(arg0, arg1) {
- getObject(arg0).height = arg1 >>> 0;
- };
- imports.wbg.__wbg_getContext_7c5944ea807bf5d3 = function() { return handleError(function (arg0, arg1, arg2) {
- const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- }, arguments) };
- imports.wbg.__wbg_offsetX_5a58f16f6c3a41b6 = function(arg0) {
- const ret = getObject(arg0).offsetX;
- return ret;
- };
- imports.wbg.__wbg_offsetY_c45b4956f6429a95 = function(arg0) {
- const ret = getObject(arg0).offsetY;
- return ret;
- };
- imports.wbg.__wbg_now_0cfdc90c97d0c24b = function(arg0) {
- const ret = getObject(arg0).now();
- return ret;
- };
- imports.wbg.__wbg_instanceof_Window_9029196b662bc42a = function(arg0) {
+ imports.wbg.__wbg_instanceof_Window_f401953a2cf86220 = function(arg0) {
let result;
try {
result = getObject(arg0) instanceof Window;
- } catch {
+ } catch (_) {
result = false;
}
const ret = result;
return ret;
};
- imports.wbg.__wbg_charCode_75cea1a3a6d66388 = function(arg0) {
+ imports.wbg.__wbg_document_5100775d18896c16 = function(arg0) {
+ const ret = getObject(arg0).document;
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ };
+ imports.wbg.__wbg_setonkeydown_e2af4cfc28b2c96a = function(arg0, arg1) {
+ getObject(arg0).onkeydown = getObject(arg1);
+ };
+ imports.wbg.__wbg_setonkeyup_d3a49733ebf1f4ab = function(arg0, arg1) {
+ getObject(arg0).onkeyup = getObject(arg1);
+ };
+ imports.wbg.__wbg_performance_3298a9628a5c8aa4 = function(arg0) {
+ const ret = getObject(arg0).performance;
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ };
+ imports.wbg.__wbg_requestAnimationFrame_549258cfa66011f0 = function() { return handleError(function (arg0, arg1) {
+ const ret = getObject(arg0).requestAnimationFrame(getObject(arg1));
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_getElementById_c369ff43f0db99cf = function(arg0, arg1, arg2) {
+ const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ };
+ imports.wbg.__wbg_setonmousedown_9668c3209232d648 = function(arg0, arg1) {
+ getObject(arg0).onmousedown = getObject(arg1);
+ };
+ imports.wbg.__wbg_setonmousemove_96db8158179cb183 = function(arg0, arg1) {
+ getObject(arg0).onmousemove = getObject(arg1);
+ };
+ imports.wbg.__wbg_setonmouseup_d5b3f4be4e37eb4f = function(arg0, arg1) {
+ getObject(arg0).onmouseup = getObject(arg1);
+ };
+ imports.wbg.__wbg_bufferData_5d1e6b8eaa7d23c8 = function(arg0, arg1, arg2, arg3) {
+ getObject(arg0).bufferData(arg1 >>> 0, getObject(arg2), arg3 >>> 0);
+ };
+ imports.wbg.__wbg_texImage2D_a14a3c7863e25c89 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
+ getObject(arg0).texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, getObject(arg9));
+ }, arguments) };
+ imports.wbg.__wbg_attachShader_6397dc4fd87343d3 = function(arg0, arg1, arg2) {
+ getObject(arg0).attachShader(getObject(arg1), getObject(arg2));
+ };
+ imports.wbg.__wbg_bindBuffer_1e5043751efddd4f = function(arg0, arg1, arg2) {
+ getObject(arg0).bindBuffer(arg1 >>> 0, getObject(arg2));
+ };
+ imports.wbg.__wbg_bindFramebuffer_c301d73a2c2842bb = function(arg0, arg1, arg2) {
+ getObject(arg0).bindFramebuffer(arg1 >>> 0, getObject(arg2));
+ };
+ imports.wbg.__wbg_bindTexture_772f5eb022019d87 = function(arg0, arg1, arg2) {
+ getObject(arg0).bindTexture(arg1 >>> 0, getObject(arg2));
+ };
+ imports.wbg.__wbg_blendFunc_fc4b298f39801a9c = function(arg0, arg1, arg2) {
+ getObject(arg0).blendFunc(arg1 >>> 0, arg2 >>> 0);
+ };
+ imports.wbg.__wbg_clear_f9731a47df2e70d8 = function(arg0, arg1) {
+ getObject(arg0).clear(arg1 >>> 0);
+ };
+ imports.wbg.__wbg_clearColor_42707553c40e0e0f = function(arg0, arg1, arg2, arg3, arg4) {
+ getObject(arg0).clearColor(arg1, arg2, arg3, arg4);
+ };
+ imports.wbg.__wbg_compileShader_3af4719dfdb508e3 = function(arg0, arg1) {
+ getObject(arg0).compileShader(getObject(arg1));
+ };
+ imports.wbg.__wbg_createBuffer_34e01f5c10929b41 = function(arg0) {
+ const ret = getObject(arg0).createBuffer();
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ };
+ imports.wbg.__wbg_createFramebuffer_49ca64e9e1c6f5eb = function(arg0) {
+ const ret = getObject(arg0).createFramebuffer();
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ };
+ imports.wbg.__wbg_createProgram_9affbfa62b7b2608 = function(arg0) {
+ const ret = getObject(arg0).createProgram();
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ };
+ imports.wbg.__wbg_createShader_55ca04b44164bd41 = function(arg0, arg1) {
+ const ret = getObject(arg0).createShader(arg1 >>> 0);
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ };
+ imports.wbg.__wbg_createTexture_c13c31b2b132c17f = function(arg0) {
+ const ret = getObject(arg0).createTexture();
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ };
+ imports.wbg.__wbg_disable_5dd8c3842de93e92 = function(arg0, arg1) {
+ getObject(arg0).disable(arg1 >>> 0);
+ };
+ imports.wbg.__wbg_drawArrays_f619a26a53ab5ab3 = function(arg0, arg1, arg2, arg3) {
+ getObject(arg0).drawArrays(arg1 >>> 0, arg2, arg3);
+ };
+ imports.wbg.__wbg_drawElements_0861624300587fcd = function(arg0, arg1, arg2, arg3, arg4) {
+ getObject(arg0).drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4);
+ };
+ imports.wbg.__wbg_enable_7abe812a71c76206 = function(arg0, arg1) {
+ getObject(arg0).enable(arg1 >>> 0);
+ };
+ imports.wbg.__wbg_enableVertexAttribArray_6d44444aa994f42a = function(arg0, arg1) {
+ getObject(arg0).enableVertexAttribArray(arg1 >>> 0);
+ };
+ imports.wbg.__wbg_framebufferTexture2D_66e1968fd5b7b3e3 = function(arg0, arg1, arg2, arg3, arg4, arg5) {
+ getObject(arg0).framebufferTexture2D(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, getObject(arg4), arg5);
+ };
+ imports.wbg.__wbg_getError_fd1f7b2b2ba5a860 = function(arg0) {
+ const ret = getObject(arg0).getError();
+ return ret;
+ };
+ imports.wbg.__wbg_getProgramInfoLog_bf1fba8fa90667c7 = function(arg0, arg1, arg2) {
+ const ret = getObject(arg1).getProgramInfoLog(getObject(arg2));
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ var len1 = WASM_VECTOR_LEN;
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
+ };
+ imports.wbg.__wbg_getProgramParameter_10c8a43809fb8c2e = function(arg0, arg1, arg2) {
+ const ret = getObject(arg0).getProgramParameter(getObject(arg1), arg2 >>> 0);
+ return addHeapObject(ret);
+ };
+ imports.wbg.__wbg_getShaderInfoLog_0262cb299092ce92 = function(arg0, arg1, arg2) {
+ const ret = getObject(arg1).getShaderInfoLog(getObject(arg2));
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ var len1 = WASM_VECTOR_LEN;
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
+ };
+ imports.wbg.__wbg_getShaderParameter_60b69083e8d662ce = function(arg0, arg1, arg2) {
+ const ret = getObject(arg0).getShaderParameter(getObject(arg1), arg2 >>> 0);
+ return addHeapObject(ret);
+ };
+ imports.wbg.__wbg_getUniformLocation_6eedfb513ccce732 = function(arg0, arg1, arg2, arg3) {
+ const ret = getObject(arg0).getUniformLocation(getObject(arg1), getStringFromWasm0(arg2, arg3));
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ };
+ imports.wbg.__wbg_linkProgram_af5fed9dc3f1cdf9 = function(arg0, arg1) {
+ getObject(arg0).linkProgram(getObject(arg1));
+ };
+ imports.wbg.__wbg_shaderSource_7891a1fcb69a0023 = function(arg0, arg1, arg2, arg3) {
+ getObject(arg0).shaderSource(getObject(arg1), getStringFromWasm0(arg2, arg3));
+ };
+ imports.wbg.__wbg_texParameteri_d1035ed45d6c5655 = function(arg0, arg1, arg2, arg3) {
+ getObject(arg0).texParameteri(arg1 >>> 0, arg2 >>> 0, arg3);
+ };
+ imports.wbg.__wbg_uniform1i_badd5ff70c0d30bf = function(arg0, arg1, arg2) {
+ getObject(arg0).uniform1i(getObject(arg1), arg2);
+ };
+ imports.wbg.__wbg_uniform3f_866e96669df4a3d2 = function(arg0, arg1, arg2, arg3, arg4) {
+ getObject(arg0).uniform3f(getObject(arg1), arg2, arg3, arg4);
+ };
+ imports.wbg.__wbg_useProgram_c637e43f9cd4c07a = function(arg0, arg1) {
+ getObject(arg0).useProgram(getObject(arg1));
+ };
+ imports.wbg.__wbg_vertexAttribPointer_c25e4c5ed17f8a1d = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
+ getObject(arg0).vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6);
+ };
+ imports.wbg.__wbg_now_4e659b3d15f470d9 = function(arg0) {
+ const ret = getObject(arg0).now();
+ return ret;
+ };
+ imports.wbg.__wbg_instanceof_HtmlCanvasElement_46bdbf323b0b18d1 = function(arg0) {
+ let result;
+ try {
+ result = getObject(arg0) instanceof HTMLCanvasElement;
+ } catch (_) {
+ result = false;
+ }
+ const ret = result;
+ return ret;
+ };
+ imports.wbg.__wbg_setwidth_080107476e633963 = function(arg0, arg1) {
+ getObject(arg0).width = arg1 >>> 0;
+ };
+ imports.wbg.__wbg_setheight_dc240617639f1f51 = function(arg0, arg1) {
+ getObject(arg0).height = arg1 >>> 0;
+ };
+ imports.wbg.__wbg_getContext_df50fa48a8876636 = function() { return handleError(function (arg0, arg1, arg2) {
+ const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ }, arguments) };
+ imports.wbg.__wbg_bindVertexArrayOES_abe2fd389c6a2f56 = function(arg0, arg1) {
+ getObject(arg0).bindVertexArrayOES(getObject(arg1));
+ };
+ imports.wbg.__wbg_createVertexArrayOES_886be8a08db32ce6 = function(arg0) {
+ const ret = getObject(arg0).createVertexArrayOES();
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
+ };
+ imports.wbg.__wbg_charCode_358ab311d74487af = function(arg0) {
const ret = getObject(arg0).charCode;
return ret;
};
- imports.wbg.__wbg_keyCode_dfa86be31f5ef90c = function(arg0) {
+ imports.wbg.__wbg_keyCode_2af7775f99bf8e33 = function(arg0) {
const ret = getObject(arg0).keyCode;
return ret;
};
- imports.wbg.__wbg_code_96d6322b968b2d17 = function(arg0, arg1) {
+ imports.wbg.__wbg_code_3b0c3912a2351163 = function(arg0, arg1) {
const ret = getObject(arg1).code;
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
};
- imports.wbg.__wbg_getModifierState_5102ee8843516d2f = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_getModifierState_081302a3ea0063ad = function(arg0, arg1, arg2) {
const ret = getObject(arg0).getModifierState(getStringFromWasm0(arg1, arg2));
return ret;
};
- imports.wbg.__wbg_document_f7ace2b956f30a4f = function(arg0) {
- const ret = getObject(arg0).document;
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- };
- imports.wbg.__wbg_performance_2c295061c8b01e0b = function(arg0) {
- const ret = getObject(arg0).performance;
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- };
- imports.wbg.__wbg_setonkeydown_933cca3c9000a932 = function(arg0, arg1) {
- getObject(arg0).onkeydown = getObject(arg1);
- };
- imports.wbg.__wbg_setonkeyup_0dfb23e81d0afdde = function(arg0, arg1) {
- getObject(arg0).onkeyup = getObject(arg1);
- };
- imports.wbg.__wbg_requestAnimationFrame_d082200514b6674d = function() { return handleError(function (arg0, arg1) {
- const ret = getObject(arg0).requestAnimationFrame(getObject(arg1));
- return ret;
- }, arguments) };
- imports.wbg.__wbg_setonmousedown_4f38d9c057bbfcbd = function(arg0, arg1) {
- getObject(arg0).onmousedown = getObject(arg1);
- };
- imports.wbg.__wbg_setonmousemove_c0b17753786f3544 = function(arg0, arg1) {
- getObject(arg0).onmousemove = getObject(arg1);
- };
- imports.wbg.__wbg_setonmouseup_4b447fa380e33802 = function(arg0, arg1) {
- getObject(arg0).onmouseup = getObject(arg1);
- };
- imports.wbg.__wbg_bufferData_a11a9f65f31e7256 = function(arg0, arg1, arg2, arg3) {
- getObject(arg0).bufferData(arg1 >>> 0, getObject(arg2), arg3 >>> 0);
- };
- imports.wbg.__wbg_texImage2D_6175916e58c59bc7 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
- getObject(arg0).texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, getObject(arg9));
- }, arguments) };
- imports.wbg.__wbg_attachShader_b65b695055670cb5 = function(arg0, arg1, arg2) {
- getObject(arg0).attachShader(getObject(arg1), getObject(arg2));
- };
- imports.wbg.__wbg_bindBuffer_313561e5bc0e533f = function(arg0, arg1, arg2) {
- getObject(arg0).bindBuffer(arg1 >>> 0, getObject(arg2));
- };
- imports.wbg.__wbg_bindFramebuffer_56bf6536a4ced0ec = function(arg0, arg1, arg2) {
- getObject(arg0).bindFramebuffer(arg1 >>> 0, getObject(arg2));
- };
- imports.wbg.__wbg_bindTexture_9cb5c770d1ba2cca = function(arg0, arg1, arg2) {
- getObject(arg0).bindTexture(arg1 >>> 0, getObject(arg2));
- };
- imports.wbg.__wbg_blendFunc_fbe9d3a688fe71c3 = function(arg0, arg1, arg2) {
- getObject(arg0).blendFunc(arg1 >>> 0, arg2 >>> 0);
- };
- imports.wbg.__wbg_clear_2ccea1f65b510c97 = function(arg0, arg1) {
- getObject(arg0).clear(arg1 >>> 0);
- };
- imports.wbg.__wbg_clearColor_de587608b28bc7ed = function(arg0, arg1, arg2, arg3, arg4) {
- getObject(arg0).clearColor(arg1, arg2, arg3, arg4);
- };
- imports.wbg.__wbg_compileShader_d88d0a8cd9b72b4d = function(arg0, arg1) {
- getObject(arg0).compileShader(getObject(arg1));
- };
- imports.wbg.__wbg_createBuffer_59051f4461e7c5e2 = function(arg0) {
- const ret = getObject(arg0).createBuffer();
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- };
- imports.wbg.__wbg_createFramebuffer_223c1212ad76affc = function(arg0) {
- const ret = getObject(arg0).createFramebuffer();
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- };
- imports.wbg.__wbg_createProgram_88dbe21c0b682e1a = function(arg0) {
- const ret = getObject(arg0).createProgram();
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- };
- imports.wbg.__wbg_createShader_9d7d388633caad18 = function(arg0, arg1) {
- const ret = getObject(arg0).createShader(arg1 >>> 0);
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- };
- imports.wbg.__wbg_createTexture_9d0bb4d741b8ad76 = function(arg0) {
- const ret = getObject(arg0).createTexture();
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- };
- imports.wbg.__wbg_disable_5cf2070641fa2ed7 = function(arg0, arg1) {
- getObject(arg0).disable(arg1 >>> 0);
- };
- imports.wbg.__wbg_drawArrays_d5c7dc2b2376c85a = function(arg0, arg1, arg2, arg3) {
- getObject(arg0).drawArrays(arg1 >>> 0, arg2, arg3);
- };
- imports.wbg.__wbg_drawElements_3316ee0cd1117c2a = function(arg0, arg1, arg2, arg3, arg4) {
- getObject(arg0).drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4);
- };
- imports.wbg.__wbg_enable_8965e69c596f0a94 = function(arg0, arg1) {
- getObject(arg0).enable(arg1 >>> 0);
- };
- imports.wbg.__wbg_enableVertexAttribArray_2b0475db43533cf2 = function(arg0, arg1) {
- getObject(arg0).enableVertexAttribArray(arg1 >>> 0);
- };
- imports.wbg.__wbg_framebufferTexture2D_953e69a8bec22fa9 = function(arg0, arg1, arg2, arg3, arg4, arg5) {
- getObject(arg0).framebufferTexture2D(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, getObject(arg4), arg5);
- };
- imports.wbg.__wbg_getError_1e5ec1ec9e58b323 = function(arg0) {
- const ret = getObject(arg0).getError();
+ imports.wbg.__wbg_offsetX_1a40c03298c0d8b6 = function(arg0) {
+ const ret = getObject(arg0).offsetX;
return ret;
};
- imports.wbg.__wbg_getProgramInfoLog_0b7af4ad85fa52a4 = function(arg0, arg1, arg2) {
- const ret = getObject(arg1).getProgramInfoLog(getObject(arg2));
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
- var len1 = WASM_VECTOR_LEN;
- getInt32Memory0()[arg0 / 4 + 1] = len1;
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
+ imports.wbg.__wbg_offsetY_f75e8c25b9d9b679 = function(arg0) {
+ const ret = getObject(arg0).offsetY;
+ return ret;
};
- imports.wbg.__wbg_getProgramParameter_2a3735278367f8bc = function(arg0, arg1, arg2) {
- const ret = getObject(arg0).getProgramParameter(getObject(arg1), arg2 >>> 0);
+ imports.wbg.__wbg_static_accessor_MODULE_7781e47b50010688 = function() {
+ const ret = module;
return addHeapObject(ret);
};
- imports.wbg.__wbg_getShaderInfoLog_979aafa403ffb252 = function(arg0, arg1, arg2) {
- const ret = getObject(arg1).getShaderInfoLog(getObject(arg2));
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
- var len1 = WASM_VECTOR_LEN;
- getInt32Memory0()[arg0 / 4 + 1] = len1;
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
- };
- imports.wbg.__wbg_getShaderParameter_e8054f1d9026fb70 = function(arg0, arg1, arg2) {
- const ret = getObject(arg0).getShaderParameter(getObject(arg1), arg2 >>> 0);
- return addHeapObject(ret);
- };
- imports.wbg.__wbg_getUniformLocation_688976233799a45a = function(arg0, arg1, arg2, arg3) {
- const ret = getObject(arg0).getUniformLocation(getObject(arg1), getStringFromWasm0(arg2, arg3));
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- };
- imports.wbg.__wbg_linkProgram_9a2d12d120d99917 = function(arg0, arg1) {
- getObject(arg0).linkProgram(getObject(arg1));
- };
- imports.wbg.__wbg_shaderSource_f435f9b74440bb54 = function(arg0, arg1, arg2, arg3) {
- getObject(arg0).shaderSource(getObject(arg1), getStringFromWasm0(arg2, arg3));
- };
- imports.wbg.__wbg_texParameteri_1f17358e51eb8069 = function(arg0, arg1, arg2, arg3) {
- getObject(arg0).texParameteri(arg1 >>> 0, arg2 >>> 0, arg3);
- };
- imports.wbg.__wbg_uniform1i_9f94ef0ba6b3cc66 = function(arg0, arg1, arg2) {
- getObject(arg0).uniform1i(getObject(arg1), arg2);
- };
- imports.wbg.__wbg_uniform3f_c682f4b32f713d1a = function(arg0, arg1, arg2, arg3, arg4) {
- getObject(arg0).uniform3f(getObject(arg1), arg2, arg3, arg4);
- };
- imports.wbg.__wbg_useProgram_019eb6df066fabf5 = function(arg0, arg1) {
- getObject(arg0).useProgram(getObject(arg1));
- };
- imports.wbg.__wbg_vertexAttribPointer_ca11984ee8843c0a = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
- getObject(arg0).vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6);
- };
- imports.wbg.__wbg_bindVertexArrayOES_b7d9da7e073aa6b5 = function(arg0, arg1) {
- getObject(arg0).bindVertexArrayOES(getObject(arg1));
- };
- imports.wbg.__wbg_createVertexArrayOES_6a3c3a5a68201f8f = function(arg0) {
- const ret = getObject(arg0).createVertexArrayOES();
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
- };
+ imports.wbg.__wbg_randomFillSync_bf67eeddb65b346b = function() { return handleError(function (arg0, arg1, arg2) {
+ getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
+ }, arguments) };
+ imports.wbg.__wbg_getRandomValues_f6c9b08ef5448767 = function() { return handleError(function (arg0, arg1) {
+ getObject(arg0).getRandomValues(getObject(arg1));
+ }, arguments) };
imports.wbg.__wbg_self_1c2814d86e6e51e3 = function() { return handleError(function () {
const ret = self.self;
return addHeapObject(ret);
@@ -702,104 +719,94 @@ function __wbg_get_imports() {
const ret = getObject(arg0) === undefined;
return ret;
};
- imports.wbg.__wbg_static_accessor_MODULE_7781e47b50010688 = function() {
- const ret = module;
- return addHeapObject(ret);
- };
imports.wbg.__wbg_require_9ace3ae680954e98 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
return addHeapObject(ret);
}, arguments) };
- imports.wbg.__wbg_getRandomValues_f6c9b08ef5448767 = function() { return handleError(function (arg0, arg1) {
- getObject(arg0).getRandomValues(getObject(arg1));
- }, arguments) };
- imports.wbg.__wbg_randomFillSync_bf67eeddb65b346b = function() { return handleError(function (arg0, arg1, arg2) {
- getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
- }, arguments) };
- imports.wbg.__wbg_get_44be0491f933a435 = function(arg0, arg1) {
+ imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
const ret = getObject(arg0)[arg1 >>> 0];
return addHeapObject(ret);
};
- imports.wbg.__wbg_length_fff51ee6522a1a18 = function(arg0) {
+ imports.wbg.__wbg_length_cd7af8117672b8b8 = function(arg0) {
const ret = getObject(arg0).length;
return ret;
};
- imports.wbg.__wbg_newnoargs_581967eacc0e2604 = function(arg0, arg1) {
+ imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
const ret = new Function(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
};
- imports.wbg.__wbg_call_cb65541d95d71282 = function() { return handleError(function (arg0, arg1) {
+ imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
const ret = getObject(arg0).call(getObject(arg1));
return addHeapObject(ret);
}, arguments) };
- imports.wbg.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function () {
+ imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
const ret = self.self;
return addHeapObject(ret);
}, arguments) };
- imports.wbg.__wbg_window_5f4faef6c12b79ec = function() { return handleError(function () {
+ imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
const ret = window.window;
return addHeapObject(ret);
}, arguments) };
- imports.wbg.__wbg_globalThis_1d39714405582d3c = function() { return handleError(function () {
+ imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
const ret = globalThis.globalThis;
return addHeapObject(ret);
}, arguments) };
- imports.wbg.__wbg_global_651f05c6a0944d1c = function() { return handleError(function () {
+ imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () {
const ret = global.global;
return addHeapObject(ret);
}, arguments) };
- imports.wbg.__wbg_now_9c5990bda04c7e53 = function() {
+ imports.wbg.__wbg_now_3014639a94423537 = function() {
const ret = Date.now();
return ret;
};
- imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) {
+ imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
const ret = getObject(arg0).buffer;
return addHeapObject(ret);
};
- imports.wbg.__wbg_newwithbyteoffsetandlength_828b952f0e692245 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_newwithbyteoffsetandlength_41559f654c4e743c = function(arg0, arg1, arg2) {
const ret = new Int8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret);
};
- imports.wbg.__wbg_newwithbyteoffsetandlength_735ed5ea2ae07fe9 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_newwithbyteoffsetandlength_4bea9f904a7e0aef = function(arg0, arg1, arg2) {
const ret = new Int16Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret);
};
- imports.wbg.__wbg_newwithbyteoffsetandlength_9f43b22ab631d1d6 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_newwithbyteoffsetandlength_425360430a1c8206 = function(arg0, arg1, arg2) {
const ret = new Int32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret);
};
- imports.wbg.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret);
};
- imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) {
+ imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
const ret = new Uint8Array(getObject(arg0));
return addHeapObject(ret);
};
- imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
};
- imports.wbg.__wbg_length_72e2208bbc0efc61 = function(arg0) {
+ imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) {
const ret = getObject(arg0).length;
return ret;
};
- imports.wbg.__wbg_newwithbyteoffsetandlength_31ff1024ef0c63c7 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_newwithbyteoffsetandlength_9fd64654bc0b0817 = function(arg0, arg1, arg2) {
const ret = new Uint16Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret);
};
- imports.wbg.__wbg_newwithbyteoffsetandlength_6df0e8c3efd2a5d3 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_newwithbyteoffsetandlength_3125852e5a7fbcff = function(arg0, arg1, arg2) {
const ret = new Uint32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret);
};
- imports.wbg.__wbg_newwithbyteoffsetandlength_69193e31c844b792 = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_newwithbyteoffsetandlength_4a659d079a1650e0 = function(arg0, arg1, arg2) {
const ret = new Float32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret);
};
- imports.wbg.__wbg_newwithlength_e5d69174d6984cd7 = function(arg0) {
+ imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
const ret = new Uint8Array(arg0 >>> 0);
return addHeapObject(ret);
};
- imports.wbg.__wbg_subarray_13db269f57aa838d = function(arg0, arg1, arg2) {
+ imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret);
};
@@ -817,16 +824,16 @@ function __wbg_get_imports() {
const ret = wasm.memory;
return addHeapObject(ret);
};
- imports.wbg.__wbindgen_closure_wrapper258 = function(arg0, arg1, arg2) {
- const ret = makeMutClosure(arg0, arg1, 15, __wbg_adapter_20);
+ imports.wbg.__wbindgen_closure_wrapper650 = function(arg0, arg1, arg2) {
+ const ret = makeMutClosure(arg0, arg1, 217, __wbg_adapter_20);
return addHeapObject(ret);
};
- imports.wbg.__wbindgen_closure_wrapper2954 = function(arg0, arg1, arg2) {
- const ret = makeMutClosure(arg0, arg1, 696, __wbg_adapter_23);
+ imports.wbg.__wbindgen_closure_wrapper3243 = function(arg0, arg1, arg2) {
+ const ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_23);
return addHeapObject(ret);
};
- imports.wbg.__wbindgen_closure_wrapper2956 = function(arg0, arg1, arg2) {
- const ret = makeMutClosure(arg0, arg1, 696, __wbg_adapter_23);
+ imports.wbg.__wbindgen_closure_wrapper3245 = function(arg0, arg1, arg2) {
+ const ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_23);
return addHeapObject(ret);
};
@@ -866,7 +873,7 @@ function initSync(module) {
async function __wbg_init(input) {
if (wasm !== undefined) return wasm;
- if (typeof input === 'undefined' && script_src !== 'undefined') {
+ if (typeof input === 'undefined' && typeof script_src !== 'undefined') {
input = script_src.replace(/\.js$/, '_bg.wasm');
}
const imports = __wbg_get_imports();
diff --git a/rust-rl_bg.wasm b/rust-rl_bg.wasm
new file mode 100644
index 0000000..9544def
Binary files /dev/null and b/rust-rl_bg.wasm differ
diff --git a/src/ai/adjacent_ai_system.rs b/src/ai/adjacent_ai_system.rs
deleted file mode 100644
index 5586948..0000000
--- a/src/ai/adjacent_ai_system.rs
+++ /dev/null
@@ -1,94 +0,0 @@
-use crate::{ raws::Reaction, Faction, HasAncestry, Map, Position, TakingTurn, WantsToMelee };
-use specs::prelude::*;
-
-pub struct AdjacentAI {}
-
-impl<'a> System<'a> for AdjacentAI {
- #[allow(clippy::type_complexity)]
- type SystemData = (
- WriteStorage<'a, TakingTurn>,
- ReadStorage<'a, Faction>,
- ReadStorage<'a, HasAncestry>,
- ReadStorage<'a, Position>,
- ReadExpect<'a, Map>,
- WriteStorage<'a, WantsToMelee>,
- Entities<'a>,
- ReadExpect<'a, Entity>,
- );
-
- fn run(&mut self, data: Self::SystemData) {
- let (mut turns, factions, ancestries, positions, map, mut want_melee, entities, player) = data;
-
- let mut turn_done: Vec = Vec::new();
- for (entity, _turn, pos) in (&entities, &turns, &positions).join() {
- if entity != *player {
- let mut reactions: Vec<(Entity, Reaction)> = Vec::new();
- let idx = map.xy_idx(pos.x, pos.y);
- let w = map.width;
- let h = map.height;
- // Add possible reactions to adjacents for each direction
- if pos.x > 0 {
- evaluate(entity, idx - 1, &ancestries, &factions, &mut reactions);
- }
- if pos.x < w - 1 {
- evaluate(entity, idx + 1, &ancestries, &factions, &mut reactions);
- }
- if pos.y > 0 {
- evaluate(entity, idx - (w as usize), &ancestries, &factions, &mut reactions);
- }
- if pos.y < h - 1 {
- evaluate(entity, idx + (w as usize), &ancestries, &factions, &mut reactions);
- }
- if pos.y > 0 && pos.x > 0 {
- evaluate(entity, idx - (w as usize) - 1, &ancestries, &factions, &mut reactions);
- }
- if pos.y > 0 && pos.x < w - 1 {
- evaluate(entity, idx - (w as usize) + 1, &ancestries, &factions, &mut reactions);
- }
- if pos.y < h - 1 && pos.x > 0 {
- evaluate(entity, idx + (w as usize) - 1, &ancestries, &factions, &mut reactions);
- }
- if pos.y < h - 1 && pos.x < w - 1 {
- evaluate(entity, idx + (w as usize) + 1, &ancestries, &factions, &mut reactions);
- }
-
- let mut done = false;
- for reaction in reactions.iter() {
- if let Reaction::Attack = reaction.1 {
- want_melee.insert(entity, WantsToMelee { target: reaction.0 }).expect("Error inserting melee");
- done = true;
- }
- }
-
- if done {
- turn_done.push(entity);
- }
- }
- }
-
- // Remove turn marker for those that are done
- for done in turn_done.iter() {
- turns.remove(*done);
- }
- }
-}
-
-/// Evaluates all possible reactions between this faction and all entities on a given tile idx.
-fn evaluate(
- entity: Entity,
- idx: usize,
- ancestries: &ReadStorage,
- factions: &ReadStorage,
- reactions: &mut Vec<(Entity, Reaction)>
-) {
- crate::spatial::for_each_tile_content(idx, |other_entity| {
- let result = crate::raws::get_reactions(
- entity,
- other_entity,
- &factions,
- &ancestries,
- &crate::raws::RAWS.lock().unwrap()
- );
- reactions.push((other_entity, result));
- });
-}
diff --git a/src/ai/approach_ai_system.rs b/src/ai/approach_ai_system.rs
deleted file mode 100644
index c3cc2ca..0000000
--- a/src/ai/approach_ai_system.rs
+++ /dev/null
@@ -1,105 +0,0 @@
-use crate::{ EntityMoved, Map, Position, TakingTurn, Telepath, Viewshed, WantsToApproach };
-use bracket_lib::prelude::*;
-use specs::prelude::*;
-
-pub struct ApproachAI {}
-
-impl<'a> System<'a> for ApproachAI {
- #[allow(clippy::type_complexity)]
- type SystemData = (
- WriteStorage<'a, TakingTurn>,
- WriteStorage<'a, WantsToApproach>,
- WriteStorage<'a, Position>,
- WriteExpect<'a, Map>,
- WriteStorage<'a, Viewshed>,
- WriteStorage<'a, Telepath>,
- WriteStorage<'a, EntityMoved>,
- Entities<'a>,
- );
-
- fn run(&mut self, data: Self::SystemData) {
- let (
- mut turns,
- mut wants_to_approach,
- mut positions,
- mut map,
- mut viewsheds,
- mut telepaths,
- mut entity_moved,
- entities,
- ) = data;
- let mut turn_done: Vec = Vec::new();
- for (entity, mut pos, approach, mut viewshed, _turn) in (
- &entities,
- &mut positions,
- &wants_to_approach,
- &mut viewsheds,
- &turns,
- ).join() {
- turn_done.push(entity);
- let target_idxs = if
- let Some(paths) = get_adjacent_unblocked(&map, approach.idx as usize)
- {
- paths
- } else {
- continue;
- };
- let mut path: Option = None;
- let idx = map.xy_idx(pos.x, pos.y);
- for tar_idx in target_idxs {
- let potential_path = a_star_search(idx, tar_idx, &mut *map);
- if potential_path.success && potential_path.steps.len() > 1 {
- if
- path.is_none() ||
- potential_path.steps.len() < path.as_ref().unwrap().steps.len()
- {
- path = Some(potential_path);
- }
- }
- }
- let path = if path.is_some() {
- path.unwrap()
- } else {
- continue;
- };
- if path.success && path.steps.len() > 1 {
- let idx = map.xy_idx(pos.x, pos.y);
- pos.x = (path.steps[1] as i32) % map.width;
- pos.y = (path.steps[1] as i32) / map.width;
- entity_moved.insert(entity, EntityMoved {}).expect("Unable to insert EntityMoved");
- let new_idx = map.xy_idx(pos.x, pos.y);
- crate::spatial::move_entity(entity, idx, new_idx);
- viewshed.dirty = true;
- if let Some(telepath) = telepaths.get_mut(entity) {
- telepath.dirty = true;
- }
- }
- }
- wants_to_approach.clear();
- for done in turn_done.iter() {
- turns.remove(*done);
- }
- }
-}
-
-/// Try to get an unblocked index within one tile of a given idx, or None.
-pub fn get_adjacent_unblocked(map: &WriteExpect