コード例 #1
0
    public static void Load(StreamUnpacker su)
    {
        // Reset Scene quests
        Parley.GetInstance().LoadSceneQuests();

        int n = su.ReadInt();

        Parley.GetInstance().GetCompletedQuests().Clear();
        for (int t = 0; t < n; t++)
        {
            Parley.GetInstance().GetCompletedQuests().Add(UnpackQuest(su));
        }

        n = su.ReadInt();
        Parley.GetInstance().GetCurrentQuests().Clear();
        for (int t = 0; t < n; t++)
        {
            Parley.GetInstance().GetCurrentQuests().Add(UnpackQuest(su));
        }

        // Bring quests in line
        Parley.GetInstance().SyncQuests();

        Debug.LogError(su.ReadString());

        // Unpack all events
        string[]         allEvents   = su.ReadStrings();
        HashSet <string> questEvents = Parley.GetInstance().GetQuestEventSet();

        questEvents.Clear();
        foreach (string s in allEvents)
        {
            questEvents.Add(s);
        }

        Debug.LogError(su.ReadString());

        int activeEvents = su.ReadInt();

        Parley.GetInstance().GetActiveEvents().Clear();
        for (int t = 0; t < activeEvents; t++)
        {
            Parley.GetInstance().GetActiveEvents().Add(su.ReadString());
        }
        Debug.LogError(su.ReadString());
    }
コード例 #2
0
ファイル: IggScript.cs プロジェクト: Master109/DRODRPG
 public override void Unpack(StreamUnpacker su)
 {
     SaveLoadTransform.UnpackTransform(gameObject.transform, su);
     showgold        = su.ReadBool();
     gold            = su.ReadFloat();
     showwildflowers = su.ReadBool();
     wildflowers     = su.ReadInt();
     broadcastjumps  = su.ReadBool();
 }
コード例 #3
0
    private static Quest UnpackQuest(StreamUnpacker su)
    {
        Quest q = new Quest();

        q.name              = su.ReadString();
        q.uniqueId          = su.ReadInt();
        q.description       = su.ReadString();
        q.handinDescription = su.ReadString();
        q.afterDescription  = su.ReadString();
        q.questevent        = su.ReadString();
        q.activeevent       = su.ReadString();
        q.playerCommands    = (Command[])su.ReadObjects(typeof(Command));

        q.questrequirement = su.ReadString();
        q.open             = su.ReadBool();
        q.completed        = su.ReadBool();
        q.status           = su.ReadString();
        q.lastEffected     = Time.time + su.ReadFloat();

        int n = su.ReadInt();

        for (int t = 0; t < n; t++)
        {
            Objective o = new Objective();
            q.objectives.Add(o);
            o.description      = su.ReadString();
            o.doneDescription  = su.ReadString();
            o.locationObject   = su.ReadString();
            o.count            = su.ReadInt();
            o.optional         = su.ReadBool();
            o.objectiveevent   = su.ReadString();
            o.questevent       = su.ReadString();
            o.activeevent      = su.ReadString();
            o.playerCommands   = (Command[])su.ReadObjects(typeof(Command));
            o.questrequirement = su.ReadString();
            o.completed        = su.ReadBool();
            o.open             = su.ReadBool();
        }
        return(q);
    }
コード例 #4
0
    public static void Load(StreamUnpacker su)
    {
        // Reset Scene quests
        Parley.GetInstance().LoadSceneQuests();

        int n=su.ReadInt();
        Parley.GetInstance().GetCompletedQuests().Clear();
        for (int t=0;t<n;t++){
            Parley.GetInstance().GetCompletedQuests().Add(UnpackQuest(su));
        }

        n=su.ReadInt();
        Parley.GetInstance().GetCurrentQuests().Clear();
        for (int t=0;t<n;t++){
            Parley.GetInstance().GetCurrentQuests().Add(UnpackQuest(su));
        }

        // Bring quests in line
        Parley.GetInstance().SyncQuests();

        Debug.LogError(su.ReadString());

        // Unpack all events
        string[] allEvents=su.ReadStrings();
        HashSet<string> questEvents=Parley.GetInstance().GetQuestEventSet();
        questEvents.Clear();
        foreach (string s in allEvents){
            questEvents.Add(s);
        }

        Debug.LogError(su.ReadString());

        int activeEvents=su.ReadInt();
        Parley.GetInstance().GetActiveEvents().Clear();
        for (int t=0;t<activeEvents;t++){
            Parley.GetInstance().GetActiveEvents().Add(su.ReadString());
        }
        Debug.LogError(su.ReadString());
    }
コード例 #5
0
    override public void Unpack(StreamUnpacker su)
    {
        int cnum = su.ReadInt();

        conversations = new Conversation[cnum];
        for (int t = 0; t < cnum; t++)
        {
            Conversation c = new Conversation();
            conversations[t]           = c;
            c.id                       = su.ReadInt();
            c.returnId                 = su.ReadInt();
            c.uniqueId                 = su.ReadInt();
            c.text                     = su.ReadString();
            c.repeattext               = su.ReadString();
            c.once                     = su.ReadBool();
            c.fallthrough              = su.ReadBool();
            c.questevent               = su.ReadString();
            c.playerCommands           = (Command[])su.ReadObjects(typeof(Command));
            c.questrequirement         = su.ReadString();
            c.environmentalrequirement = su.ReadString();
            c._available               = su.ReadBool();
            c._seen                    = su.ReadBool();

            int onum = su.ReadInt();
            c.options = new Option[onum];

            for (int u = 0; u < onum; u++)
            {
                Option o = new Option();
                c.options[u]    = o;
                o.text          = su.ReadString();
                o.destinationId = su.ReadInt();
                o._available    = su.ReadBool();
                o.choosenb4     = su.ReadBool();
                o.quest         = su.ReadBool();
            }
        }

        UpdateQuestIcon(true);
    }
コード例 #6
0
    private static Quest UnpackQuest(StreamUnpacker su)
    {
        Quest q=new Quest();
        q.name=su.ReadString();
        q.uniqueId=su.ReadInt();
        q.description=su.ReadString();
        q.handinDescription=su.ReadString();
        q.afterDescription=su.ReadString();
        q.questevent=su.ReadString();
        q.activeevent=su.ReadString();
        q.playerCommands=(Command[])su.ReadObjects(typeof(Command));

        q.questrequirement=su.ReadString();
        q.open=su.ReadBool();
        q.completed=su.ReadBool();
        q.status=su.ReadString();
        q.lastEffected=Time.time+su.ReadFloat();

        int n=su.ReadInt();
        for (int t=0;t<n;t++){
            Objective o=new Objective();
            q.objectives.Add(o);
            o.description=su.ReadString();
            o.doneDescription=su.ReadString();
            o.locationObject=su.ReadString();
            o.count=su.ReadInt();
            o.optional=su.ReadBool();
            o.objectiveevent=su.ReadString();
            o.questevent=su.ReadString();
            o.activeevent=su.ReadString();
            o.playerCommands=(Command[])su.ReadObjects(typeof(Command));
            o.questrequirement=su.ReadString();
            o.completed=su.ReadBool();
            o.open=su.ReadBool();
        }
        return q;
    }
コード例 #7
0
ファイル: Dialog.cs プロジェクト: ChristianHoj/home_nursing
    public override void Unpack(StreamUnpacker su)
    {
        int cnum=su.ReadInt();
        conversations=new Conversation[cnum];
        for (int t=0;t<cnum;t++){
            Conversation c=new Conversation();
            conversations[t]=c;
            c.id=su.ReadInt();
            c.returnId=su.ReadInt();
            c.uniqueId=su.ReadInt();
            c.text=su.ReadString();
            c.repeattext=su.ReadString();
            c.once=su.ReadBool();
            c.fallthrough=su.ReadBool();
            c.questevent=su.ReadString();
            c.playerCommands=(Command[])su.ReadObjects(typeof(Command));
            c.questrequirement=su.ReadString();
            c.environmentalrequirement=su.ReadString();
            c._available=su.ReadBool();
            c._seen=su.ReadBool();

            int onum=su.ReadInt();
            c.options=new Option[onum];

            for (int u=0;u<onum;u++){
                Option o=new Option();
                c.options[u]=o;
                o.text=su.ReadString();
                o.destinationId=su.ReadInt();
                o._available=su.ReadBool();
                o.choosenb4=su.ReadBool();
                o.quest=su.ReadBool();
            }
        }

        UpdateQuestIcon(true);
    }