diff --git a/.github/workflows/cargo-build-test.yml b/.github/workflows/cargo-build-test.yml
index cafaa58..d54fa2f 100644
--- a/.github/workflows/cargo-build-test.yml
+++ b/.github/workflows/cargo-build-test.yml
@@ -12,7 +12,7 @@ env:
jobs:
build:
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
diff --git a/Cargo.toml b/Cargo.toml
index 55d7645..24b6918 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "rust-rl"
-version = "0.1.4"
+version = "0.1.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/README.md b/README.md
index c1809cf..9127091 100644
--- a/README.md
+++ b/README.md
@@ -2,18 +2,18 @@
#### 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:
+check out the page in the header for the wasm version, pick [a release of your choice](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`,

+this year for roguelikedev does the complete tutorial, i followed along with thebracket's [_roguelike tutorial - in rust_](https://bfnightly.bracketproductions.com). the notes i made during the sprint are being kept below for posterity - further changes since then are noted in [changelog.txt](https://github.com/Llywelwyn/rust-rl/blob/9150ed39e45bee536060cdc769d274e639021012/changelog.txt), and in the release notes.
+
+i'm also working on translating over my progress into blog entries on my site @ [llyw.co.uk](https://llyw.co.uk/), with a larger focus on some of the more interesting implementation details.
+
---
-
- boring details about the sprint where this project started
week 1
@@ -157,4 +157,3 @@ check out the page in the header for the wasm version, pick [a release](https://

-
diff --git a/docs/combat_system.txt b/docs/combat_system.txt
index 44e2f65..13a780b 100644
--- a/docs/combat_system.txt
+++ b/docs/combat_system.txt
@@ -49,7 +49,3 @@ Complex example, with negative AC:
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/items.json b/raws/items.json
index 7599afe..2c0c678 100644
--- a/raws/items.json
+++ b/raws/items.json
@@ -3,10 +3,9 @@
"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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "heal": "4d4+2" },
"magic": { "class": "uncommon", "naming": "potion" }
},
@@ -14,10 +13,9 @@
"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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "heal": "2d4+2" },
"magic": { "class": "uncommon", "naming": "potion" }
},
@@ -25,30 +23,27 @@
"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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE", "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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE", "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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "particle_line": "*;-;#53f06d;75.0;#f9ff9f;100.0", "ranged": "12", "heal": "1d4+2" },
"magic": { "class": "uncommon", "naming": "scroll" }
},
@@ -56,10 +51,9 @@
"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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "particle": "*;#53f06d;200.0", "ranged": "12", "aoe": "3", "heal": "1d4+2" },
"magic": { "class": "rare", "naming": "scroll" }
},
@@ -67,10 +61,9 @@
"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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "particle_line": "*;-;#00b7ff;75.0;#f4fc83;100.0", "ranged": "12", "damage": "3d4+3;magic" },
"magic": { "class": "uncommon", "naming": "scroll" }
},
@@ -78,10 +71,9 @@
"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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "particle": "*;#FFA500;200.0", "ranged": "10", "damage": "4d6;fire", "aoe": "2" },
"magic": { "class": "uncommon", "naming": "scroll" }
},
@@ -89,10 +81,9 @@
"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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": {
"particle_burst": "▓;*;~;#FFA500;#000000;500.0;#ffd381;60.0",
"ranged": "10",
@@ -105,10 +96,9 @@
"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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "particle_line": "*;-;#ad56a6;75.0;#cacaca;100.0", "ranged": "10", "confusion": "4" },
"magic": { "class": "uncommon", "naming": "scroll" }
},
@@ -116,10 +106,9 @@
"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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "particle": "*;#ad56a6;200.0", "ranged": "10", "aoe": "3", "confusion": "3" },
"magic": { "class": "veryrare", "naming": "scroll" }
},
@@ -127,10 +116,9 @@
"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"],
+ "flags": ["CONSUMABLE", "DESTRUCTIBLE", "MAGICMAP"],
"effects": {},
"magic": { "class": "common", "naming": "scroll" }
},
@@ -138,7 +126,6 @@
"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"],
@@ -148,7 +135,6 @@
"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"],
@@ -158,7 +144,6 @@
"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"],
@@ -168,7 +153,6 @@
"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"],
@@ -178,7 +162,6 @@
"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"],
@@ -188,7 +171,6 @@
"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"],
@@ -198,7 +180,6 @@
"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"],
@@ -208,7 +189,6 @@
"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"],
@@ -218,7 +198,6 @@
"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"],
@@ -228,7 +207,6 @@
"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"],
@@ -238,7 +216,6 @@
"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"],
@@ -248,7 +225,6 @@
"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"],
@@ -258,7 +234,6 @@
"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"],
@@ -268,7 +243,6 @@
"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"],
@@ -278,7 +252,6 @@
"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"],
@@ -288,7 +261,6 @@
"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"],
@@ -298,7 +270,6 @@
"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"],
@@ -308,7 +279,6 @@
"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"],
@@ -318,7 +288,6 @@
"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"],
@@ -328,7 +297,6 @@
"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"]
@@ -337,7 +305,6 @@
"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"],
@@ -347,7 +314,6 @@
"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"],
@@ -357,7 +323,6 @@
"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"],
@@ -367,7 +332,6 @@
"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"],
@@ -377,7 +341,6 @@
"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"],
@@ -387,7 +350,6 @@
"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"],
@@ -398,7 +360,6 @@
"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"],
@@ -409,7 +370,6 @@
"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"],
@@ -420,7 +380,6 @@
"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"],
@@ -431,18 +390,16 @@
"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"]
+ "flags": ["FOOD", "CONSUMABLE"]
},
{
"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"]
+ "flags": ["FOOD", "CONSUMABLE"]
}
]
diff --git a/raws/props.json b/raws/props.json
index 0c48291..f60ff11 100644
--- a/raws/props.json
+++ b/raws/props.json
@@ -2,7 +2,7 @@
{
"id": "door",
"name": "door",
- "renderable": { "glyph": "+", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
+ "renderable": { "glyph": "+", "sprite": 17, "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["DOOR"]
},
{
@@ -21,7 +21,7 @@
{
"id": "prop_table",
"name": "table",
- "renderable": { "glyph": "-", "fg": "#AAAAAA", "bg": "#000000", "order": 2 },
+ "renderable": { "glyph": "-", "sprite": 52, "fg": "#AAAAAA", "bg": "#000000", "order": 2 },
"flags": []
},
{
@@ -33,25 +33,25 @@
{
"id": "prop_statue",
"name": "statue",
- "renderable": { "glyph": "@", "fg": "#ffffff", "bg": "#000000", "order": 2 },
+ "renderable": { "glyph": "@", "sprite": 29, "fg": "#ffffff", "bg": "#000000", "order": 2 },
"flags": []
},
{
"id": "prop_bed",
"name": "bed",
- "renderable": { "glyph": "=", "fg": "#AAAAAA", "bg": "#000000", "order": 2 },
+ "renderable": { "glyph": "=", "sprite": 50, "fg": "#AAAAAA", "bg": "#000000", "order": 2 },
"flags": []
},
{
"id": "prop_chair",
"name": "chair",
- "renderable": { "glyph": "└", "fg": "#AAAAAA", "bg": "#000000", "order": 2 },
+ "renderable": { "glyph": "└", "sprite": 51, "fg": "#AAAAAA", "bg": "#000000", "order": 2 },
"flags": []
},
{
"id": "prop_candle",
"name": "candle",
- "renderable": { "glyph": "Ä", "fg": "#FFA500", "bg": "#000000", "order": 2 },
+ "renderable": { "glyph": "Ä", "sprite": 3, "fg": "#FFA500", "bg": "#000000", "order": 2 },
"flags": []
},
{
diff --git a/resources/curses11x20.png b/resources/curses11x20.png
new file mode 100644
index 0000000..5f5e1e5
Binary files /dev/null and b/resources/curses11x20.png differ
diff --git a/resources/curses12x24.png b/resources/curses12x24.png
new file mode 100644
index 0000000..4504d0a
Binary files /dev/null and b/resources/curses12x24.png differ
diff --git a/resources/curses16x16.pdn b/resources/curses16x16.pdn
new file mode 100644
index 0000000..a13f60d
Binary files /dev/null and b/resources/curses16x16.pdn differ
diff --git a/resources/curses16x16.png b/resources/curses16x16.png
new file mode 100644
index 0000000..042abea
Binary files /dev/null and b/resources/curses16x16.png differ
diff --git a/resources/curses8x16.pdn b/resources/curses8x16.pdn
new file mode 100644
index 0000000..02b2112
Binary files /dev/null and b/resources/curses8x16.pdn differ
diff --git a/resources/curses8x16.png b/resources/curses8x16.png
new file mode 100644
index 0000000..4b83036
Binary files /dev/null and b/resources/curses8x16.png differ
diff --git a/resources/healthbar11x2.png b/resources/healthbar11x2.png
new file mode 100644
index 0000000..96fb67c
Binary files /dev/null and b/resources/healthbar11x2.png differ
diff --git a/resources/healthbar22x2.png b/resources/healthbar22x2.png
new file mode 100644
index 0000000..daa15d1
Binary files /dev/null and b/resources/healthbar22x2.png differ
diff --git a/resources/nagidal22x20_centred.png b/resources/nagidal22x20_centred.png
new file mode 100644
index 0000000..1383fb9
Binary files /dev/null and b/resources/nagidal22x20_centred.png differ
diff --git a/resources/nagidal22x22_centred.png b/resources/nagidal22x22_centred.png
new file mode 100644
index 0000000..f941b27
Binary files /dev/null and b/resources/nagidal22x22_centred.png differ
diff --git a/resources/nagidal24x24.png b/resources/nagidal24x24.png
new file mode 100644
index 0000000..2d4aba9
Binary files /dev/null and b/resources/nagidal24x24.png differ
diff --git a/resources/terminal10x10_gs_tc.png b/resources/terminal10x10_gs_tc.png
new file mode 100644
index 0000000..5e0cdc9
Binary files /dev/null and b/resources/terminal10x10_gs_tc.png differ
diff --git a/resources/vga8x16.png b/resources/vga8x16.png
new file mode 100644
index 0000000..913e32c
Binary files /dev/null and b/resources/vga8x16.png differ
diff --git a/resources/world16x16.png b/resources/world16x16.png
new file mode 100644
index 0000000..e05e1d5
Binary files /dev/null and b/resources/world16x16.png differ
diff --git a/src/ai/approach_ai_system.rs b/src/ai/approach_ai_system.rs
index c3cc2ca..6e6e7a8 100644
--- a/src/ai/approach_ai_system.rs
+++ b/src/ai/approach_ai_system.rs
@@ -45,6 +45,7 @@ impl<'a> System<'a> for ApproachAI {
continue;
};
let mut path: Option = None;
+ let mut curr_abs_diff = 100;
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);
@@ -54,6 +55,17 @@ impl<'a> System<'a> for ApproachAI {
potential_path.steps.len() < path.as_ref().unwrap().steps.len()
{
path = Some(potential_path);
+ let (x1, y1) = (pos.x, pos.y);
+ let (x2, y2) = ((tar_idx as i32) % map.width, (tar_idx as i32) / map.width);
+ curr_abs_diff = i32::abs(x2 - x1) + i32::abs(y2 - y1);
+ } else if potential_path.steps.len() == path.as_ref().unwrap().steps.len() {
+ let (x1, y1) = (pos.x, pos.y);
+ let (x2, y2) = ((tar_idx as i32) % map.width, (tar_idx as i32) / map.width);
+ let abs_diff = i32::abs(x2 - x1) + i32::abs(y2 - y1);
+ if abs_diff < curr_abs_diff {
+ path = Some(potential_path);
+ curr_abs_diff = abs_diff;
+ }
}
}
}
diff --git a/src/ai/turn_status_system.rs b/src/ai/turn_status_system.rs
index e072e45..db3acaa 100644
--- a/src/ai/turn_status_system.rs
+++ b/src/ai/turn_status_system.rs
@@ -65,7 +65,9 @@ impl<'a> System<'a> for TurnStatusSystem {
not_confused.push(entity);
if entity == *player_entity {
logger = logger
+ .colour(renderable_colour(&renderables, entity))
.append("You")
+ .colour(WHITE)
.append("snap out of it.");
log = true;
} else {
@@ -92,7 +94,9 @@ impl<'a> System<'a> for TurnStatusSystem {
not_my_turn.push(entity);
if entity == *player_entity {
logger = logger
+ .colour(renderable_colour(&renderables, entity))
.append("You")
+ .colour(WHITE)
.append("are confused!");
log = true;
gamelog::record_event(EVENT::PlayerConfused(1));
diff --git a/src/camera.rs b/src/camera.rs
index 00b6869..090476b 100644
--- a/src/camera.rs
+++ b/src/camera.rs
@@ -1,14 +1,16 @@
-use super::{ Hidden, Map, Mind, Position, Prop, Renderable };
+use super::{ Hidden, Map, Mind, Position, Prop, Renderable, Pools };
use bracket_lib::prelude::*;
use specs::prelude::*;
use std::ops::Mul;
+use super::data::visuals::{ VIEWPORT_W, VIEWPORT_H };
+use super::data::prelude::*;
const SHOW_BOUNDARIES: bool = false;
pub fn get_screen_bounds(ecs: &World, _ctx: &mut BTerm) -> (i32, i32, i32, i32, i32, i32) {
let player_pos = ecs.fetch::();
let map = ecs.fetch::