In order to add complexity to the secondary loop -> "progression through the overworld map" the player should be able to spend a currency on units to give them stat boosts and the like.
Design consideration is needed to contextualise what this loot is, I propose that the loot available is trash: it fits.
New Tag: loot
This tag should be added to the GameObject that we plan on using as the lootable object.
New Class: Loot.cs
This is not to inherit monobehaviour and should be a standalone base class
This should be relatively simple, it should have a public static method called GetLoot() that generates a random int from 1 to 5.
The above values might be able to be set on another object, such as the Broker perhaps.
New Functionality: UnitController.cs
A new method Loot(GameObject target) should be defined, the flow of this method will be similar to attack.
This method should start a coroutine that has the unit move toward the lootable object and upon reaching it it should reference the Loot object like so -> Loot.GetLoot()
After retrieving the loot value then the result should be given to a publicly exposed method on the IOHandler.
If anyone not myself (Samwise) picks up this one then please just message if you have any questions regarding using a static method, please feel free to message me. Although I have attached a small and handy reference here
Added Functionality: IOHandler.cs
Where all the clicks are currently handled, we need to add a use-case to the switch statement that allows for the handling of looting. A method such as HandleLoot() should be defined.
The HandleLoot() method should have a similar flow to the other HandleX() methods in the IOHandler.
The actual 'handling' of loot should be done on the UnitController, when the unit has moved to the point which it wants to loot from it should create the new Loot object defined below.
The IOHandler should have a publicTakeLoot(int lootValue) method that takes in the value of the loot retrieved by the unit.
For now this should keep adding the value to a local intlooted.
A ticket is open for saving states across scenes, once this is implemented the IOHandler should be told to write out to this save system at the end of a scene. Ticket is here.
Feature
New Tag: loot
GameObject
that we plan on using as the lootable object.New Class: Loot.cs
public static
method calledGetLoot()
that generates a randomint
from1
to5
.Broker
perhaps.New Functionality: UnitController.cs
Loot(GameObject target)
should be defined, the flow of this method will be similar to attack.coroutine
that has the unit move toward the lootable object and upon reaching it it should reference theLoot
object like so ->Loot.GetLoot()
IOHandler
.If anyone not myself (Samwise) picks up this one then please just message if you have any questions regarding using a
static
method, please feel free to message me. Although I have attached a small and handy reference hereAdded Functionality: IOHandler.cs
switch
statement that allows for the handling of looting. A method such asHandleLoot()
should be defined.HandleLoot()
method should have a similar flow to the otherHandleX()
methods in theIOHandler
.UnitController
, when the unit has moved to the point which it wants to loot from it should create the newLoot
object defined below.IOHandler
should have apublic
TakeLoot(int lootValue)
method that takes in the value of the loot retrieved by the unit.int
looted
.IOHandler
should be told to write out to this save system at the end of a scene. Ticket is here.