|
```json |
|
"spells" : [ |
|
{ |
|
"name" : "Zap", |
|
"effects" : { |
|
"ranged" : "6", |
|
"damage" : "5", |
|
"particle_line" : "▓;#00FFFF;200.0" |
|
} |
|
} |
|
] |
|
``` |
At that point, mana_cost is declared as mandatory on the Spell struct in spell_structs.rs.
Since there is no mana_cost field in the JSON file, the game crashes on start when loading the JSON data.
The final state of the code for this chapter does include this mana_cost field.
rustrogueliketutorial/book/src/chapter_66.md
Lines 123 to 134 in 33872fe
At that point,
mana_costis declared as mandatory on theSpellstruct inspell_structs.rs.Since there is no
mana_costfield in the JSON file, the game crashes on start when loading the JSON data.The final state of the code for this chapter does include this
mana_costfield.