public BuffInfo(Buff buff, BuffSourceType sourceType)
 {
     Buff         = buff;
     DurationType = buff.DurationType;
     SourceType   = sourceType;
     Duration     = buff.DurationAmount;
 }
 public BuffInfo(Buff buff, BuffDurationType durationType, BuffSourceType sourceType, int duration = 1)
 {
     Buff         = buff;
     DurationType = durationType;
     SourceType   = sourceType;
     Duration     = duration;
 }
Exemple #3
0
 // Token: 0x0600347C RID: 13436 RVA: 0x000DF320 File Offset: 0x000DD520
 public BuffState(int id, ConfigDataBuffInfo buffInfo, BattleActor applyer, BuffSourceType sourceType, ConfigDataSkillInfo sourceSkillInfo)
 {
     this.m_id              = id;
     this.m_buffInfo        = buffInfo;
     this.m_time            = buffInfo.Time;
     this.m_applyer         = applyer;
     this.m_sourceType      = sourceType;
     this.m_sourceSkillInfo = sourceSkillInfo;
     this.m_parent          = null;
     this.m_hasExtraTime    = false;
     this.m_effectTimes     = 0;
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_ctorInt32ConfigDataBuffInfoBattleActorBuffSourceTypeConfigDataSkillInfo_hotfix != null)
     {
         this.m_ctorInt32ConfigDataBuffInfoBattleActorBuffSourceTypeConfigDataSkillInfo_hotfix.call(new object[]
         {
             this,
             id,
             buffInfo,
             applyer,
             sourceType,
             sourceSkillInfo
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
 }
 public BuffInfo(Buff buff, float overridenValue, BuffSourceType sourceType)
 {
     Buff           = buff;
     OverridenValue = overridenValue;
     DurationType   = buff.DurationType;
     SourceType     = sourceType;
     Duration       = buff.DurationAmount;
 }
Exemple #5
0
    public void RemoveSourceBuff(Buff revertBuff, BuffSourceType sourceType)
    {
        var revertBuffInfo = BuffInfo.Find(item => item.Buff == revertBuff && item.SourceType == sourceType);

        if (revertBuffInfo != null)
        {
            RemoveBuff(revertBuffInfo);
        }
    }
Exemple #6
0
    private List <BuffInfo> FindDisplayableBuffs(BuffSourceType sourceType, BuffDurationType durationType, bool isPositive)
    {
        var displayableBuffs = BuffInfo.FindAll(info => info.SourceType == sourceType &&
                                                info.ModifierValue != 0 && info.DurationType == durationType && info.Buff.IsPositive() == isPositive).
                               OrderBy(info => info.Buff.AttributeType).ThenBy(info => info.Buff.RuleType).ToList();

        displayableBuffs.RemoveAll(buff => buff.Buff.AttributeType == AttributeType.DamageLow);
        return(displayableBuffs);
    }
Exemple #7
0
 public void RemoveAllBuffsWithSource(BuffSourceType sourceType)
 {
     for (int i = BuffInfo.Count - 1; i >= 0; i--)
     {
         if (BuffInfo[i].SourceType == sourceType)
         {
             RemoveBuff(BuffInfo[i]);
         }
     }
 }
Exemple #8
0
 public BuffItem(BigEndianReader reader)
 {
     _SourceType = (BuffSourceType)reader.ReadInt16();
     reader.ReadInt16();             // unknown
     _IconID     = reader.ReadInt16();
     _QueueIndex = reader.ReadInt16();
     reader.ReadInt32();             // unknown
     _Duration = reader.ReadInt16();
     reader.ReadBytes(3);            // unknown
     _TitleCliloc        = reader.ReadInt32();
     _SecondaryCliloc    = reader.ReadInt32();
     _TernaryCliloc      = reader.ReadInt32();
     _TitleArguments     = reader.ReadUnicodeString();
     _SecondaryArguments = reader.ReadUnicodeString();
     _TernaryArguments   = reader.ReadUnicodeString();
 }
Exemple #9
0
 public bool ContainsBuff(Buff buff, BuffSourceType sourceType)
 {
     return(BuffInfo.Find(item => item.Buff == buff && item.SourceType == sourceType) != null);
 }
 public static bool IsSaveData(this BuffSourceType buffSourceType)
 {
     return(buffSourceType == BuffSourceType.Adventure || buffSourceType == BuffSourceType.Estate);
 }
Exemple #11
0
 public BuffItem( BigEndianReader reader )
 {
     _SourceType = (BuffSourceType) reader.ReadInt16();
     reader.ReadInt16(); // unknown
     _IconID = reader.ReadInt16();
     _QueueIndex = reader.ReadInt16();
     reader.ReadInt32(); // unknown
     _Duration = reader.ReadInt16();
     reader.ReadBytes( 3 ); // unknown
     _TitleCliloc = reader.ReadInt32();
     _SecondaryCliloc = reader.ReadInt32();
     _TernaryCliloc = reader.ReadInt32();
     _TitleArguments = reader.ReadUnicodeString();
     _SecondaryArguments = reader.ReadUnicodeString();
     _TernaryArguments = reader.ReadUnicodeString();
 }
Exemple #12
0
 public BuffInfo(BuffDurationType durationType, BuffSourceType sourceType)
 {
     DurationType = durationType;
     SourceType   = sourceType;
 }
Exemple #13
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);
    }