Closed darozak closed 6 months ago
I've been working quite a bit on restructuring the hardware mechanic to make it more flexible. I've settled on a technique which should do the trick and have been working to implement it in the code. The basic strategy as follows:
I've been able to set up the structures required to create unique items, add them to the robot's inventory, and equip them into a limited number of slots by moving them to the top of the inventory list (https://github.com/darozak/Advolition/commit/f5e163b16d6a4612e722c197f5ba21aa044b3129).
Next, I need to allow the robot to invoke the equip command from within its code and apply a delay that relates to the size of the slot being equipped.
A robot can now initiate an equip action from within it's own code (https://github.com/darozak/Advolition/commit/c08a8654fa21b7140be20e5db493c5808edb55ba). However, I should really rename this command to "prioritize" since that is what is really happening to the item. After all, there is no guarantee that the robot has a slot that will fit the item even if it is moved to the top of the list.
I changed the command from Equip to Prioritize since that makes more sense in terms of what is really happening (https://github.com/darozak/Advolition/commit/6521bce3560139a156c1c1e8feac3695b36c93f6).
Next, I need to build out and display the robot attributes on the screen so that I can confirm they are being changed whenever items are re-equipped.
The full set of robot attributes are now displayed on the screen (https://github.com/darozak/Advolition/commit/a1502ed83c429004916304ca59ef7ac9b3b6baf8). However, they are still not being updated based on the equipped items. I'll need to work on that next.
Now the code updates the robots attributes right after items are re-equipped (https://github.com/darozak/Advolition/commit/47ccdca57286ba411e60f988eecd7e1c4453358b).
I've realized that I can do away with trigger and trigger power costs for items if I simply have them update the attributes that tally power costs for specific actions like moving, attacking, and defending. I'll take care of this next.
I renamed attributes to stats and simplified the stats data structure. I also did away with power triggers for items as these will be covered via the adjusted power consumption mods for the associated actions. (https://github.com/darozak/Advolition/commit/81ff4dd2dc5ff9794776e0bff7d36f2df47c0fe9)
All that remains is for me to convert everything over to the new stats mechanic. Up until now I had built up as a secondary but non-functional mechanic.
The new hardware mechanic is now up an running (https://github.com/darozak/Advolition/commit/b2708f73c862685856c78a6505146386a9873526). There are still features to add with respect to grabbing and dropping items. However, I'll address these as separate issues.
I need a more flexible hardware mechanic that allows me to create a diverse collection of equipment that impacts robot abilities in different ways.