Hardware and Software
I managed to overcome a few more obstacles with hacking today.
First of all, I decided to move forward with the encounter-based hacking system. The player can "use" a powered, unlocked laptop to start doing things with it. The encounter will then show available software. Choosing hacking software then shows all available, locked, powered laptops, and choosing said laptop results in an unlocked laptop. Charges are deducted from the host laptop when software is chosen, and the target laptop when the target is chosen.
In order to make this work, I have two new item subclasses: hardware and software.
Software is a pretty simple subclass of a regular item. It just passes any charge requests to its parent, the hardware that holds it. And since software can't exist outside of hardware, that's about it.
Hardware is a bit more involved, but still basically a regular item. The main difference is that any software items inside it become inaccessible when the hardware is closed, off, locked, etc.
The changes necessary to the encounter system turned out to be pretty simple, too. I just created a new encounter flag called "hacking," to differentiate it from "normal," "combat," and "scavenge." The main difference with "hacking" encounters is that whichever item was used to reach it gets it's mode changed to the specified treasure, rather than the whole item replaced with treasure.
When all was done, I was able to hack one laptop with another, provided the hacking laptop was powered and unlocked, had the correct software (a laptop cracking app), and the target laptop was powered and locked. I was unable to add nor remove any software from laptops unless they were powered and unlocked.
I also made some changes such that draining an item switches it off automatically. This was already semi working before, for things like flashlights and goggles, but I formalized it a bit to work with the mode-switching system I built yesterday. I'll likely be changing flashlights and goggles to use this system, too. That way, they can be switched on and off at will, rather than always/only on when equipped.
So, we're getting there! There's still the niggling issue of being able to see software while the laptop is locked and/or shut off, and it's a bit weird to be able to see a battery's charge with one's eyeballs (as opposed to a voltmeter). However, those are minor issues I could live with if need be.
Next, I think it'll be time to start adding more hardware and software, to make sure the system holds up. And then, tying it into the economy/junk store. Hopefully, hackers will have more stuff to do soon!
That's all for this week. Hope everyone has a good weekend!