kyleconroy/hawkthorne-journey — pull request #522 by campadrenalin (2012-10-30 05:55:55+00:00)
Title: Fixes #479 (Holdables and throwing knives arguing over controls)

As usual, I tried to solve this with a forward-thinking and consistent system, rather than a short-term hack. Keyboard context solves the majority of control problems when used properly, but there's another layer of player-specific logic necessary to mediate conflicts between the player's use of the action button, 'A' (commonly, SHIFT). This pull request provides that layer of mediation.

I've added a Player:getAction() function, that goes through a few local variables to determine who has "right of way" to respond to the action button, and then spits out a corresponding string (currently-programmed possibilities are "pick up", "throw", "interact", and "attack"). At some point we'll want to add NPC conversation-starting logic to that, and handle the deferred control during the conversation using keyboard context. Long-term, this will help us solve the "keyboard logic is all over the damn place" problem. This specific patch only goes far enough to solve the specific problem detailed in #479, where throwing knives are conflicting with holdables.