Skip to content

Commit 3210943

Browse files
committed
Add chapter 74.
1 parent 0bc58f0 commit 3210943

3 files changed

Lines changed: 472 additions & 4 deletions

File tree

book/src/chapter_74.md

Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,313 @@ That makes a not-at-all city like map (just a bsp interiors map) - but it's a go
7171

7272
## Adding some dark elves
7373

74+
If we just wanted to put dark elves everywhere, it would be as simple as adding one line to `spawns.json` in the `spawn_table` section:
7475

76+
```json
77+
{ "name" : "Dark Elf", "weight": 10, "min_depth": 10, "max_depth": 11 }
78+
```
79+
80+
That's boring, so let's not do that. Our dark elves are split between *Clan Arbat*, *Clan Barbo*, and *Clan Cirro* (A, B, C, get it?). Thanks to the Abyssal influence of the Amulet of YALA, they are wrought with terrible infighting and war! We'll worry about differentiating the clans in a moment, for now lets make some entries to provide three groups of dark elves who hate one another.
81+
82+
In the `factions` section of `spawns.json`, create three new factions:
83+
84+
```json
85+
{ "name" : "DarkElfA", "responses" : { "Default" : "attack", "DarkElfA" : "ignore", "DarkElfB" : "attack", "DarkElfC" : "attack" } },
86+
{ "name" : "DarkElfB", "responses" : { "Default" : "attack", "DarkElfB" : "ignore", "DarkElfA" : "attack", "DarkElfC" : "attack" } },
87+
{ "name" : "DarkElfC", "responses" : { "Default" : "attack", "DarkElfC" : "ignore", "DarkElfA" : "attack", "DarkElfB" : "attack" } }
88+
```
89+
90+
Notice how they ignore their own clan, and attack the others. That's the key to making a warzone! Our factions system already supports warring groups - we've just not used it extensively. Now find the `mobs` section, and duplicate the "Dark Elf" three times - once for each faction:
91+
92+
```json
93+
{
94+
"name" : "Arbat Dark Elf",
95+
"renderable": {
96+
"glyph" : "e",
97+
"fg" : "#FF0000",
98+
"bg" : "#000000",
99+
"order" : 1
100+
},
101+
"blocks_tile" : true,
102+
"vision_range" : 8,
103+
"movement" : "random_waypoint",
104+
"attributes" : {},
105+
"equipped" : [ "Hand Crossbow", "Scimitar", "Buckler", "Drow Chain", "Drow Leggings", "Drow Boots" ],
106+
"faction" : "DarkElfA",
107+
"gold" : "3d6",
108+
"level" : 6
109+
},
110+
111+
{
112+
"name" : "Barbo Dark Elf",
113+
"renderable": {
114+
"glyph" : "e",
115+
"fg" : "#FF0000",
116+
"bg" : "#000000",
117+
"order" : 1
118+
},
119+
"blocks_tile" : true,
120+
"vision_range" : 8,
121+
"movement" : "random_waypoint",
122+
"attributes" : {},
123+
"equipped" : [ "Hand Crossbow", "Scimitar", "Buckler", "Drow Chain", "Drow Leggings", "Drow Boots" ],
124+
"faction" : "DarkElfB",
125+
"gold" : "3d6",
126+
"level" : 6
127+
},
128+
129+
{
130+
"name" : "Cirro Dark Elf",
131+
"renderable": {
132+
"glyph" : "e",
133+
"fg" : "#FF0000",
134+
"bg" : "#000000",
135+
"order" : 1
136+
},
137+
"blocks_tile" : true,
138+
"vision_range" : 8,
139+
"movement" : "random_waypoint",
140+
"attributes" : {},
141+
"equipped" : [ "Hand Crossbow", "Scimitar", "Buckler", "Drow Chain", "Drow Leggings", "Drow Boots" ],
142+
"faction" : "DarkElfC",
143+
"gold" : "3d6",
144+
"level" : 6
145+
},
146+
```
147+
148+
In the spawn table, we want them to appear on level 10:
149+
150+
```json
151+
{ "name" : "Arbat Dark Elf", "weight": 10, "min_depth": 10, "max_depth": 11 },
152+
{ "name" : "Barbo Dark Elf", "weight": 10, "min_depth": 10, "max_depth": 11 },
153+
{ "name" : "Cirro Dark Elf", "weight": 10, "min_depth": 10, "max_depth": 11 }
154+
```
155+
156+
If you `cargo run` now, and cheat your way down to depth 10 (I recommend god mode, and teleport) - you find yourself in the midst of a warzone between three clans. There's combat everywhere, and they only pause killing one another long enough to murder the player. There's a lovely amount of mayhem - the gods of Chaos would be proud.
157+
158+
## Clan Differentiation
159+
160+
It's kinda boring having all of the clans be identical. The basic "Dark Elf" can stay the same, but lets add a bit of flavor to make the clans *feel* differentiated.
161+
162+
### Clan Arbat
163+
164+
We'll start by making Arbat a different color - a lighter red. Replace the "fg" attribute of their Dark Elves with `#FFAAAA` - a pinkish color. We'll take away their crossbows, also. They are a melee-oriented clan. Replace `Scimitar` with `Scimitar +1`. The modified `Arbat Dark Elf` looks like this:
165+
166+
```json
167+
{
168+
"name" : "Arbat Dark Elf",
169+
"renderable": {
170+
"glyph" : "e",
171+
"fg" : "#FFAAAA",
172+
"bg" : "#000000",
173+
"order" : 1
174+
},
175+
"blocks_tile" : true,
176+
"vision_range" : 8,
177+
"movement" : "random_waypoint",
178+
"attributes" : {},
179+
"equipped" : [ "Scimitar +1", "Buckler", "Drow Chain", "Drow Leggings", "Drow Boots" ],
180+
"faction" : "DarkElfA",
181+
"gold" : "3d6",
182+
"level" : 6
183+
},
184+
```
185+
186+
Let's also give them leaders - tougher fighters:
187+
188+
```json
189+
{
190+
"name" : "Arbat Dark Elf Leader",
191+
"renderable": {
192+
"glyph" : "E",
193+
"fg" : "#FFAAAA",
194+
"bg" : "#000000",
195+
"order" : 1
196+
},
197+
"blocks_tile" : true,
198+
"vision_range" : 8,
199+
"movement" : "random_waypoint",
200+
"attributes" : {},
201+
"equipped" : [ "Scimitar +2", "Buckler +1", "Drow Chain", "Drow Leggings", "Drow Boots" ],
202+
"faction" : "DarkElfA",
203+
"gold" : "3d6",
204+
"level" : 7
205+
},
206+
```
207+
208+
They also deserve some orc slaves:
209+
210+
```json
211+
{
212+
"name" : "Arbat Orc Slave",
213+
"renderable": {
214+
"glyph" : "o",
215+
"fg" : "#FFAAAA",
216+
"bg" : "#000000",
217+
"order" : 1
218+
},
219+
"blocks_tile" : true,
220+
"vision_range" : 8,
221+
"movement" : "static",
222+
"attributes" : {},
223+
"faction" : "DarkElfA",
224+
"gold" : "1d8"
225+
},
226+
```
227+
228+
Finally, put these into the spawn table:
229+
230+
```json
231+
{ "name" : "Arbat Dark Elf", "weight": 10, "min_depth": 10, "max_depth": 11 },
232+
{ "name" : "Arbat Dark Elf Leader", "weight": 7, "min_depth": 10, "max_depth": 11 },
233+
{ "name" : "Arbat Orc Slave", "weight": 14, "min_depth": 10, "max_depth": 11 },
234+
```
235+
236+
They are probably going to regret their melee focus, but we aren't too concerned for their health!
237+
238+
### Clan Barbo
239+
240+
Conversely, we'll make Barbo quite missile oriented - and a little more scarce, because that's super-dangerous. We'll also give them a dagger instead of a scimitar, and change their color to orange:
241+
242+
```json
243+
{
244+
"name" : "Barbo Dark Elf",
245+
"renderable": {
246+
"glyph" : "e",
247+
"fg" : "#FF9900",
248+
"bg" : "#000000",
249+
"order" : 1
250+
},
251+
"blocks_tile" : true,
252+
"vision_range" : 8,
253+
"movement" : "random_waypoint",
254+
"attributes" : {},
255+
"equipped" : [ "Hand Crossbow +1", "Dagger", "Buckler", "Drow Chain", "Drow Leggings", "Drow Boots" ],
256+
"faction" : "DarkElfB",
257+
"gold" : "3d6",
258+
"level" : 6
259+
},
260+
```
261+
262+
They also get some slaves - this time goblins, with a missile weapon:
263+
264+
```json
265+
{
266+
"name" : "Barbo Goblin Archer",
267+
"renderable": {
268+
"glyph" : "g",
269+
"fg" : "#FF9900",
270+
"bg" : "#000000",
271+
"order" : 1
272+
},
273+
"blocks_tile" : true,
274+
"vision_range" : 8,
275+
"movement" : "static",
276+
"attributes" : {},
277+
"faction" : "Cave Goblins",
278+
"gold" : "1d6",
279+
"equipped" : [ "Shortbow", "Leather Armor", "Leather Boots" ]
280+
},
281+
```
282+
283+
Finally, update the spawns table to include them:
284+
285+
```json
286+
{ "name" : "Barbo Dark Elf", "weight": 9, "min_depth": 10, "max_depth": 11 },
287+
{ "name" : "Barbo Goblin Archer", "weight": 13, "min_depth": 10, "max_depth": 11 },
288+
```
289+
290+
### Clan Cirro
291+
292+
We're going to make Cirro powerful and rare. The basic Cirro Dark Elf looks like this:
293+
294+
```json
295+
{
296+
"name" : "Cirro Dark Elf",
297+
"renderable": {
298+
"glyph" : "e",
299+
"fg" : "#FF00FF",
300+
"bg" : "#000000",
301+
"order" : 1
302+
},
303+
"blocks_tile" : true,
304+
"vision_range" : 8,
305+
"movement" : "random_waypoint",
306+
"attributes" : {},
307+
"equipped" : [ "Hand Crossbow", "Scimitar", "Buckler", "Drow Chain", "Drow Leggings", "Drow Boots" ],
308+
"faction" : "DarkElfC",
309+
"gold" : "3d6",
310+
"level" : 7
311+
},
312+
```
313+
314+
We'll also give them leaders - priestesses who can web you:
315+
316+
```json
317+
{
318+
"name" : "Cirro Dark Priestess",
319+
"renderable": {
320+
"glyph" : "E",
321+
"fg" : "#FF00FF",
322+
"bg" : "#000000",
323+
"order" : 1
324+
},
325+
"blocks_tile" : true,
326+
"vision_range" : 8,
327+
"movement" : "random_waypoint",
328+
"attributes" : {},
329+
"equipped" : [ "Hand Crossbow", "Scimitar", "Buckler", "Drow Chain", "Drow Leggings", "Drow Boots" ],
330+
"faction" : "DarkElfC",
331+
"gold" : "3d6",
332+
"level" : 8,
333+
"abilities" : [
334+
{ "spell" : "Web", "chance" : 0.2, "range" : 6.0, "min_range" : 3.0 }
335+
]
336+
},
337+
```
338+
339+
Instead of slaves, we'll give them spiders:
340+
341+
```json
342+
{
343+
"name" : "Cirro Spider",
344+
"level" : 3,
345+
"attributes" : {},
346+
"renderable": {
347+
"glyph" : "s",
348+
"fg" : "#FF00FF",
349+
"bg" : "#000000",
350+
"order" : 1
351+
},
352+
"blocks_tile" : true,
353+
"vision_range" : 6,
354+
"movement" : "static",
355+
"natural" : {
356+
"armor_class" : 12,
357+
"attacks" : [
358+
{ "name" : "bite", "hit_bonus" : 1, "damage" : "1d12" }
359+
]
360+
},
361+
"abilities" : [
362+
{ "spell" : "Web", "chance" : 0.2, "range" : 6.0, "min_range" : 3.0 }
363+
],
364+
"faction" : "DarkElfC"
365+
},
366+
```
367+
368+
This also requires a spawn table update:
369+
370+
```json
371+
{ "name" : "Cirro Dark Elf", "weight": 7, "min_depth": 10, "max_depth": 11 },
372+
{ "name" : "Cirro Dark Priestess", "weight": 6, "min_depth": 10, "max_depth": 11 },
373+
{ "name" : "Cirro Spider", "weight": 10, "min_depth": 10, "max_depth": 11 }
374+
```
375+
376+
If you `cargo run` the project now, you'll find that the dark elves are murdering one another - and there's a good level of variety present.
377+
378+
## Wrap-Up
379+
380+
This has been a short chapter: because most of the pre-requisites were already written. That's a good sign for the engine as a whole: we can now build a very different style of level without much in the way of new code. In the next chapter, we'll advance further into the dark elven city - trying to make more of an open city level. The mayhem will continue!
75381

76382
---
77383

0 commit comments

Comments
 (0)