コード例 #1
0
        public EngineStateDialogue(int character, CharacterController _npc, CharacterController player, bool is_companion)
            : base(EngineManager.Engine)
        {
            m_baseImage = new GameTexture(@"Sprites/RPG/PopupScreen");

            if (GameplayManager.ActiveArea.GlobalLocation != Area.PARTY)
            {
                m_dialog = DialogManager.get(character);
            }
            else
            {
                // TODO put social game results here!
                m_dialog = new Dialog(character+" played a social game, or passed or whatever...", false, Color.WhiteSmoke);
            }
            m_button4_released = false;

            drawOnCompanionSide = is_companion;

            //brewMode = false;
            bouncerMode = false;
            bouncerPass = false;
            bouncerDist = 0;
            bouncerI = 0;
            npc = _npc;

            if (npc != null && npc.getCollider().m_type == ColliderType.NPC && player != null && player.brew != null)
            {
                if (npc.bouncer != null)
                {
                    m_dialog = null;
                    bouncerMode = true;
                    bouncerPass = npc.bouncer.canPass(player.brew, (int)npc.getCollider().Bounds.Center().X, (int)npc.getCollider().Bounds.Center().Y, (int)npc.getCollider().Bounds.Width, (int)npc.getCollider().Bounds.Height, (int)player.getCollider().Bounds.Center().X, (int)player.getCollider().Bounds.Center().Y, (int)player.getCollider().Bounds.Width, (int)player.getCollider().Bounds.Height);

                    //if what was passed in is the player, then add what task he's currently doing to the plan.
                    if (bouncerPass && !is_companion)
                    {
                        player.addTaskToPlan(npc.bouncer);
                    }
                }
                else if (npc.brew != null)
                {
                    //if what was passed in is the player, then add what task he's currently doing to the plan.

                    //brewMode = true;
                    if (player.brew.mix(npc.brew))
                    {
                        m_dialog = null;
                        if (!is_companion)
                        {
                            player.addTaskToPlan(npc.brew);
                        }
                    }
                    else
                    {
                        m_dialog = new Dialog("I don't have the right brew for this mixture");
                    }
                }
            }
        }