Rogue C# – A Few Odd Repairs
This week, I’m taking care of some general fixes and looking at ways to improve the codebase and keep things maintainable around the place. As a bonus, I discovered helper functions in C#.
Technology should be the means, not the end.
How can a great and wise civilization have destroyed itself so completely?” “Perhaps,” said Apollo, “by being materially great and materially wise, and nothing else.”
Walter M. Miller, Jr., A Canticle for Leibowitz
This week, I’m taking care of some general fixes and looking at ways to improve the codebase and keep things maintainable around the place. As a bonus, I discovered helper functions in C#.
In this post, I share a video from the Feral Historian that is strangely relevant to today’s A.I. landscape and review my own continually evolving use of the technologies.
Rings are actually one of my least used items in my playing of the classic Rogue. They tend to be risky as they increase food consumption and a cursed ring just won’t come off. Still, they’re part of the game and a great challenge for this project so I decided to add them to the inventory list.
Happily, the remaining traps to my roguelike game did not break anything new in the code; I was able to build on existing resources already in the classes. I also reorganized some code, clearing the deck for the addition of monster special attacks and upcoming inventory additions.
After adding all those potions in one shot, they still had to be tested and every single one exposed something that needed to be improved in the code. The sheer number of fixes would be too long for this post but I did come up with a few interesting examples.
Potions are much like scrolls but every new effect potentially requires supporting changes elsewhere, including new properties and changes to game play. In this chapter, I sample all the potions and see how many ways I can break the code.
As a program grows, it’s important to maintain standards and practices within the code. Classes and methods need clear lines of responsibility and operation in order to keep the code maintainable and reduce errors.
Traps add to the challenge of the game, even if they are annoying sometimes. In this chapter, I add them to the game and discover that the player and monsters have more in common than they know.
During the rescue of the Rogue C# project, I’ve seen some examples of things that weren’t quite thought out the first time around but the MoveMonster() function might have been a case of over-thinking … or of just really needing to walk away for a bit.
Not all scrolls and potions are helpful in a roguelike but that’s part of the fun … more or less. In this update, I add a mix of scrolls including Remove Curse, a frustratingly rare item that you’ll want after putting on the wrong armor and Aggravate Monsters which wil make your life on the level a lot more exciting. As before, every new scroll leads to a re-examination of the code.