Exemplo n.º 1
0
        private bool checkForInteract(GameInit gameInit, int targetX, int targetY)
        {
            if (gameInit.getFreeRoamState().getCurrentZone().getTrafficMap().getCharacterBooleanMap()[targetX, targetY])
            {
                // talk to character
                Character character = gameInit.getFreeRoamState().getCurrentZone().getTrafficMap().getCharacterMap()[targetX, targetY];

                return true;
            }
            else
            {
                if (gameInit.getFreeRoamState().getCurrentZone().getTrafficMap().getObjectBooleanMap()[targetX, targetY])
                {
                    ManipulatableObject obj = gameInit.getFreeRoamState().getCurrentZone().getTrafficMap().getObjectMap()[targetX, targetY];

                    if (obj.checkForInteract(gameInit.getParty().getPartyMembers()[0].getFacingDirection()))
                    {
                        obj.activate(gameInit, gameInit.getParty().getPartyMembers()[0], 0);

                        if (obj.showChatWindow())
                        {
                            obj.talk(gameInit);
                            activating = false;
                            chatWindow = true;
                            objectChat = true;
                            chatObject = obj;
                            chatCounter = 0;
                        }
                        else
                        {
                            activatingObjects.Add(obj);
                            interactingCharacters.Add(gameInit.getParty().getPartyMembers()[0]);
                            activating = true;
                        }
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }
                else
                {
                    return false;
                }
            }
        }
Exemplo n.º 2
0
        public void finishActivation(GameInit gameInit)
        {
            for (int i = 0; i < finishedObjects.Count; i++)
            {
                finishedObjects[i].finishActivation(gameInit);
                if (finishedObjects[i].isTransitionReady())
                {
                    transitionReady = true;
                    transitioningObject = finishedObjects[i];
                }

                // set chat window stuff here
            }

            if (activatingObjects.Count == 0)
            {
                activating = false;
            }
        }