Exemplo n.º 1
0
    public void ReadFormationUnitData(BinaryReader br)
    {
        IsHero = br.ReadBoolean();
        Rank   = br.ReadInt32();
        Team   = (Team)br.ReadInt32();

        int statusCount = br.ReadInt32();

        Character.InitializeBasicStatuses(Statuses);
        for (int i = 0; i < statusCount; i++)
        {
            var savedStatusType = (StatusType)br.ReadInt32();
            Statuses[savedStatusType].ReadStatusData(br);
        }

        if (IsHero)
        {
            RosterId    = br.ReadInt32();
            CurrentMode = br.ReadString();
        }
        else
        {
            IsCorpse      = br.ReadBoolean();
            OriginalClass = br.ReadString();
            Class         = br.ReadString();
            Name          = br.ReadString();
            CurrentHp     = br.ReadSingle();
            Buffs.Read(br);
        }

        CombatInfo = new FormationUnitInfo();
        CombatInfo.ReadCombatInfoData(br);
    }
Exemplo n.º 2
0
    public void ReadFormationUnitData(BinaryReader br)
    {
        IsHero = br.ReadBoolean();
        Rank   = br.ReadInt32();
        Team   = (Team)br.ReadInt32();

        int statusCount = br.ReadInt32();

        Character.InitializeBasicStatuses(Statuses);
        for (int i = 0; i < statusCount; i++)
        {
            var savedStatusType = (StatusType)br.ReadInt32();
            Statuses[savedStatusType].ReadStatusData(br);
        }

        if (IsHero)
        {
            RosterId    = br.ReadInt32();
            CurrentMode = br.ReadString();
        }
        else
        {
            IsCorpse      = br.ReadBoolean();
            OriginalClass = br.ReadString();
            Class         = br.ReadString();
            Name          = br.ReadString();
            CurrentHp     = br.ReadSingle();

            int buffEntryCount = br.ReadInt32();
            Buffs.Clear();
            for (int i = 0; i < buffEntryCount; i++)
            {
                BuffSourceType buffSourceType = (BuffSourceType)br.ReadInt32();

                if (buffSourceType == BuffSourceType.Adventure)
                {
                    BuffInfo newBuffInfo = new BuffInfo((BuffDurationType)br.ReadInt32(), buffSourceType);

                    newBuffInfo.OverridenValue = br.ReadSingle();
                    newBuffInfo.Duration       = br.ReadInt32();

                    string buffId = br.ReadString();
                    if (buffId == "")
                    {
                        newBuffInfo.Buff = new Buff()
                        {
                            Id            = "",
                            ModifierValue = br.ReadSingle(),
                            Type          = (BuffType)br.ReadInt32(),
                            AttributeType = (AttributeType)br.ReadInt32(),
                            RuleType      = (BuffRule)br.ReadInt32(),
                        };
                    }
                    else
                    {
                        newBuffInfo.Buff = DarkestDungeonManager.Data.Buffs[buffId];
                    }

                    Buffs.Add(newBuffInfo);
                }
            }
        }

        CombatInfo = new FormationUnitInfo();
        CombatInfo.ReadCombatInfoData(br);
    }