mysterymagination / adventures-of-mooty-wort

An Undum eval tale, short and sweet
MIT License
0 stars 0 forks source link

add some restoration items #36

Closed mysterymagination closed 3 years ago

mysterymagination commented 3 years ago

2x 25mp mana potions (gleaming sapphire fluid mixed with glittering diamond dust) -1 found by showing concern for caterpillar with 'you ok, buddy?' -1 found saccing daughter ooze; gifted by ochre ooze along with caustic claws 1x full mp mana potion (bottled opalescent rainbow) -found by digging into the mithril vault in the spider cavern; this can only be done by using caustic claws on the vault. 2x 50hp health potions (boiling blood of angels and demons) -1 found after talking to daughter ooze twice -1 found after it falls out of tickled molerat's compartment

mysterymagination commented 3 years ago

first trick is allowing for item use in both story and combat contexts -- thing to do might be to pull ItemManager up to the game file which is essentially a wrapper for both the story view (well, some logic writing to it), story viewcontroller, and combat viewcontroller. That way we could make an itemContext in ItemManager and have it route item actions to the appropriate VC... but that's an arch refactor. Instead, I'ma leave the whole thing to storyVC and just install a feedbackContext field that makes endpoint impl bois write to appropriate UI elements.

mysterymagination commented 3 years ago

I added the items but in implementing them I realized we've got a smidge of a problem in the absence of the arch refactor mentioned above -- how do we tell the combatVC to update its display of character stat data in response to the healing items? That can't very well be static (or shouldn't be, at least), so we need to either have the arch above with ItemManager having handles to both storyVC and combatVC OR we need some way to have our little feedbackContext hack in storyVC broadcast a message that combatVC will receive and update itself in response to. Or, I guess we could do another hack like shoving a combatVC handle into the storyVC (or maybe the various relevant (combat useable) item instances themselves when the gamelogic adds them to the player inventory)? We could maybe make that not terrrribly cringey if we did like a subclass of Item called CombatItem whose ctor expects a handle to combatVC... but is that any easier than just doing the darn arch refactor?

mysterymagination commented 3 years ago

sigh doing the arch refactor. Now we can direct necessary commands through both story and combat VCs when an item is used, and in many cases we do need to talk to both

mysterymagination commented 3 years ago

need a way to advance combat state indicating player has exhausted their turn when they use an item during battle -- I guess wrap up the same thing the endpoint ability choice UI does in a function and call on combatViewController from the Item.useOn

mysterymagination commented 3 years ago

d'oh! I forgot that my current UI approach to combat vs. story is to completely hide one or the other; this means that the character and info menu panels are also not available in mobile or desktop view. You can try to load them from the mobile view's drop down menu, but nothing happens. We'll want to modify visibility such that character (which includes equipment list) and info (which includes inventory list) panels are at least accessible from story or combat.

mysterymagination commented 3 years ago

decided against having item use cost a turn; the minor mana fellas would only be Defend but without Defended status if they cost a turn to use, plus things are quite hard enough!