Closed mattdelsordo closed 4 years ago
Idea: associate phrasebooks with state, have animation call pick from the Friendo's state. Add element specific phrase lists to element objects, call those when building idle phrase list. Don't need to worry about rebuilding the idle list to account for stat changes because a stat increasing necessitates a state change, automatically rebuilding the list. For stuff like hunger/sleep control picking that separately, don't add them to the list.
I think the way to do what I actually want to do is to create a database of tagged speech options and then query the database each time a speech option needs to be loaded. OR, put EVERYTHING in a giant JSON file where everything is a tagged object and run Array.filter()
on it every time, which might actually be faster since it's a local function call even though it's O(N). Would that have terrible implications for local memory usage?
Resolved by #201
This issue sort of encompasses #68, #80, and #110. A number of things need to be done:
Pre-existingly, speech is fully controlled by the animation system, and I'm not sure if that's the part of the Friendo that should own it. Speech options should probably be associated with State, which the animation can call to pick a speech option. On the other hand, the speech system should also know about Friendo stats/state/element so MAYBE it should live in the root class as a new attribute of the Friendo itself. On the other other hand, I need to minimize the amount of nested
if
s just to check those factors, so the Element-centric speech options should probably live with their element, and the state options with their state. This gets more complicated when options could hypothetically be both state and element dependent. In summary: hmm.