Esempio n. 1
0
    protected override void AfterAwake()
    {
        /* Get the combat manager for this player */
        combatManager = GetComponent <EntityCombatManager>();
        if (combatManager == null)
        {
            throw new System.Exception("Why does this player not have a combat manager?");
        }

        /* Get the player skills manager for this player */
        skillsManager = GetComponent <PlayerSkillsManager>();
        if (skillsManager == null)
        {
            throw new System.Exception("Why does this player not have a player skills manager?");
        }

        /* Get our quest manager */
        questManager = GetComponent <PlayerQuestManager>();
        if (questManager == null)
        {
            throw new System.Exception("There is no quest manager attached to this player!");
        }

        /* We're not inspecting any item right now */
        inspecting       = false;
        beforeInspecting = null;
    }
Esempio n. 2
0
    protected override void OnAfterPickedUp(GameObject obj, HandManager hand)
    {
        if (!isClient)
        {
            return;
        }

        /* We need to have a journal */
        if (currentJournal == null)
        {
            return;
        }

        /* Is this the player relic? */
        if (obj.GetComponent <PlayerRelic>() != null)
        {
            return;
        }

        /* Convert the obj to a sojourn item */
        SojournItem item = obj.GetComponent <SojournItem>();

        /* Is this our journal? */
        if (currentJournal.gameObject == obj)
        {
            if (debug)
            {
                Debug.Log("PlayerJournalManager: Picked up the Player Journal!");
            }

            /* Update journal stats just in case */
            currentJournal.UpdateStats(playerController.GetEntityName(), skillsManager.GetSkills(), combatManager);

            /* Open the journal */
            currentJournal.OpenJournal();

            /* Disable highlighting */
            currentJournal.DisableHighlight();
        }
        else if (currentJournal.GetAttachedHand() != null)
        {
            if (debug)
            {
                Debug.Log("PlayerJournalManager: We are inspecting an item!");
            }

            /* Our journal is probably in our other hand, so lets inspect this item if possible */
            inspecting       = true;
            beforeInspecting = currentJournal.GetCurrentPagePairing();

            /* Open the inspector to this item */
            currentJournal.OpenInspector(item);
        }
    }
Esempio n. 3
0
 public void SetPagePairing(PageManager.PagePairing pairing)
 {
     this.pairing = pairing;
 }
Esempio n. 4
0
 /**
  * Opens the journal to a specific page pair. Returns true on success.
  */
 public bool OpenTo(PageManager.PagePairing pagePair)
 {
     /* Open the page manager open to these pages */
     return(pages.OpenTo(pagePair));
 }