瀏覽代碼

Remember to fix the magic mapper spawn priority.

Herbert Wolverson 4 年之前
父節點
當前提交
7d83ea854c
共有 2 個文件被更改,包括 23 次插入1 次删除
  1. 22 0
      book/src/chapter_20.md
  2. 1 1
      chapter-20-magicmapping/src/spawner.rs

+ 22 - 0
book/src/chapter_20.md

@@ -178,6 +178,28 @@ This is pretty straightforward: it reveals the tiles on the current row, and the
 
 ![Screenshot](./c20-s2.gif)
 
+## Remember to lower the spawn priority!
+
+In `spawners.rs` we are currently spawning magic mapping scrolls *everywhere*. That's probably not what we want! Edit the spawn table to have a much lower priority:
+
+```rust
+fn room_table(map_depth: i32) -> RandomTable {
+    RandomTable::new()
+        .add("Goblin", 10)
+        .add("Orc", 1 + map_depth)
+        .add("Health Potion", 7)
+        .add("Fireball Scroll", 2 + map_depth)
+        .add("Confusion Scroll", 2 + map_depth)
+        .add("Magic Missile Scroll", 4)
+        .add("Dagger", 3)
+        .add("Shield", 3)
+        .add("Longsword", map_depth - 1)
+        .add("Tower Shield", map_depth - 1)
+        .add("Rations", 10)
+        .add("Magic Mapping Scroll", 2)
+}
+```
+
 ## Wrap Up
 
 This was a relatively quick chapter, but we now have another staple of the roguelike genre: magic mapping.

+ 1 - 1
chapter-20-magicmapping/src/spawner.rs

@@ -44,7 +44,7 @@ fn room_table(map_depth: i32) -> RandomTable {
         .add("Longsword", map_depth - 1)
         .add("Tower Shield", map_depth - 1)
         .add("Rations", 10)
-        .add("Magic Mapping Scroll", 400)
+        .add("Magic Mapping Scroll", 2)
 }
 
 /// Fills a room with stuff!