Exemple #1
0
 public EvtLevelBuffState(LevelBuffType levelBuff, LevelBuffState state, LevelBuffSide side, uint ownerRuntimeID)
 {
     this.levelBuff = levelBuff;
     this.state     = state;
     this.side      = side;
     this.sourceId  = ownerRuntimeID;
 }
Exemple #2
0
 public void Setup(bool enteringTimeSlow, float duration, LevelBuffSide side, bool notStartEffect)
 {
     this._enteringTimeSlow = enteringTimeSlow;
     this._duration         = duration;
     base.levelBuffSide     = side;
     this._notStartEffect   = notStartEffect;
 }
Exemple #3
0
        public void MPRequestStartLevelBuff(LevelBuffType type, LevelBuffSide side, uint ownerID, bool allowRefresh, bool enteringSlow, bool notStartEffect, float duration, int instancedAbilityID, int actionLocalID)
        {
            BaseLevelBuff witchTimeLevelBuff;
            LevelBuffType type2 = type;

            if (type2 == LevelBuffType.WitchTime)
            {
                witchTimeLevelBuff = base.witchTimeLevelBuff;
            }
            else if (type2 == LevelBuffType.StopWorld)
            {
                witchTimeLevelBuff = base.stopWorldLevelBuff;
            }
            else
            {
                witchTimeLevelBuff = null;
            }
            bool useMaxDuration = allowRefresh;

            if (witchTimeLevelBuff.isActive)
            {
                if (type == LevelBuffType.WitchTime)
                {
                    bool flag2 = base.witchTimeLevelBuff.Refresh(duration, side, ownerID, enteringSlow, useMaxDuration, notStartEffect);
                    if (flag2)
                    {
                        Singleton <EventManager> .Instance.FireEvent(new EvtLevelBuffState(type, LevelBuffState.Switch, base.witchTimeLevelBuff.levelBuffSide, ownerID), MPEventDispatchMode.Normal);

                        this.DestroyLevelBuffEffect(type);
                        this.CreateLevelBuffEffect(type, ownerID, instancedAbilityID, actionLocalID);
                    }
                    this.SendLevelBuffResponse(!flag2 ? LevelBuffAction.SameSideExtend : LevelBuffAction.SwitchSide, type, enteringSlow, notStartEffect, ownerID, base.witchTimeLevelBuff.levelBuffSide, instancedAbilityID, actionLocalID);
                }
                else if (type == LevelBuffType.StopWorld)
                {
                }
            }
            else
            {
                if (type == LevelBuffType.WitchTime)
                {
                    base.witchTimeLevelBuff.ownerID = ownerID;
                    base.witchTimeLevelBuff.Setup(enteringSlow, duration, side, notStartEffect);
                }
                else if (type == LevelBuffType.StopWorld)
                {
                    base.stopWorldLevelBuff.ownerID = ownerID;
                    base.stopWorldLevelBuff.Setup(enteringSlow, duration, ownerID);
                }
                base.AddPlugin(witchTimeLevelBuff);
                witchTimeLevelBuff.isActive = true;
                this.CreateLevelBuffEffect(type, ownerID, instancedAbilityID, actionLocalID);
                this.SendLevelBuffResponse(LevelBuffAction.Add, type, enteringSlow, notStartEffect, ownerID, witchTimeLevelBuff.levelBuffSide, instancedAbilityID, actionLocalID);
                Singleton <EventManager> .Instance.FireEvent(new EvtLevelBuffState(type, LevelBuffState.Start, side, ownerID), MPEventDispatchMode.Normal);
            }
        }
Exemple #4
0
 public virtual bool Refresh(float duration, LevelBuffSide side, uint ownerID, bool enteringTimeSlow, bool useMaxDuration, bool notStartEffect)
 {
     if (side == base.levelBuffSide)
     {
         this.ExtendDuration(duration, enteringTimeSlow, useMaxDuration);
         return(false);
     }
     this.SwitchSide(enteringTimeSlow, duration, side, ownerID, notStartEffect);
     return(true);
 }
 public override bool Refresh(float duration, LevelBuffSide side, uint ownerID, bool enteringTimeSlow, bool useMaxDuration, bool notStartEffect)
 {
     if (!this.IsPvP() && (base.levelBuffSide == LevelBuffSide.FromAvatar))
     {
         return(base.Refresh(duration, side, ownerID, enteringTimeSlow, useMaxDuration, notStartEffect));
     }
     if ((ownerID != base.ownerID) && Singleton <LevelManager> .Instance.gameMode.IsEnemy(ownerID, base.ownerID))
     {
         this.SwitchSide(enteringTimeSlow, duration, LevelBuffSide.FromAvatar, ownerID, notStartEffect);
         return(true);
     }
     base.ExtendDuration(duration, enteringTimeSlow, useMaxDuration);
     return(false);
 }
Exemple #6
0
        public virtual void SwitchSide(bool enteringTimeSlow, float duration, LevelBuffSide side, uint newOwnerID, bool notStartEffect)
        {
            if (this._enteringTimeSlow)
            {
                this.Setup(false, duration, side, notStartEffect);
                this.DoWitchTimeStart();
                this._enteringTimeSlow = false;
            }
            else
            {
                this._enteringTimeSlow = false;
                this._duration         = duration;
                this._timer            = this._duration;
                this.RemoveWitchTimeSlowedBySide();
                base.levelBuffSide = side;
                base.ownerID       = newOwnerID;
                this.ActStartParticleEffect();
                this.ApplyWitchTimeSlowedBySide();
                Singleton <StageManager> .Instance.GetPerpStage().PopRenderingData(this._witchTimeStageEffectStackIx);

                this.PushRenderingDataBySide();
            }
        }
Exemple #7
0
        private void SendLevelBuffResponse(LevelBuffAction action, LevelBuffType type, bool enteringSlow, bool notStartEffect, uint ownerID, LevelBuffSide side, int instancedAbilityID = 0, int actionLocalID = 0)
        {
            MPSendPacketContainer pc = Singleton <MPManager> .Instance.CreateSendPacket <Packet_Level_ResultLevelBuff>();

            bool flag  = enteringSlow;
            bool flag2 = notStartEffect;
            Offset <Packet_Level_ResultLevelBuff> offset = Packet_Level_ResultLevelBuff.CreatePacket_Level_ResultLevelBuff(pc.builder, action, 0, (byte)side, flag, flag2, ownerID, (byte)instancedAbilityID, (byte)actionLocalID);

            pc.Finish <Packet_Level_ResultLevelBuff>(offset);
            Singleton <MPManager> .Instance.SendReliableToOthers(0x21800001, pc);
        }
Exemple #8
0
        public void MPResponseHandleLevelBuff(LevelBuffAction action, LevelBuffType type, bool enteringSlow, bool notStartEffect, uint ownerID, LevelBuffSide side, int instancedAbilityID, int actionLocalID)
        {
            BaseLevelBuff witchTimeLevelBuff;
            LevelBuffType type2 = type;

            if (type2 == LevelBuffType.WitchTime)
            {
                witchTimeLevelBuff = base.witchTimeLevelBuff;
            }
            else if (type2 == LevelBuffType.StopWorld)
            {
                witchTimeLevelBuff = base.stopWorldLevelBuff;
            }
            else
            {
                witchTimeLevelBuff = null;
            }
            switch (action)
            {
            case LevelBuffAction.Add:
                if (type != LevelBuffType.WitchTime)
                {
                    if (type == LevelBuffType.StopWorld)
                    {
                        base.stopWorldLevelBuff.Setup(enteringSlow, 10f, ownerID);
                    }
                    break;
                }
                base.witchTimeLevelBuff.Setup(enteringSlow, 10f, side, notStartEffect);
                break;

            case LevelBuffAction.Remove:
                this.StopLevelBuff(witchTimeLevelBuff);
                return;

            case LevelBuffAction.SwitchSide:
                base.witchTimeLevelBuff.SwitchSide(enteringSlow, 10f, side, ownerID, notStartEffect);
                this.DestroyLevelBuffEffect(type);
                this.CreateLevelBuffEffect(type, ownerID, instancedAbilityID, actionLocalID);
                Singleton <EventManager> .Instance.FireEvent(new EvtLevelBuffState(type, LevelBuffState.Switch, base.witchTimeLevelBuff.levelBuffSide, ownerID), MPEventDispatchMode.Normal);

                return;

            case LevelBuffAction.SameSideExtend:
                witchTimeLevelBuff.ownerID = ownerID;
                base.witchTimeLevelBuff.ExtendDuration(10f, enteringSlow, true);
                return;

            default:
                return;
            }
            witchTimeLevelBuff.ownerID = ownerID;
            base.AddPlugin(witchTimeLevelBuff);
            witchTimeLevelBuff.isActive = true;
            this.CreateLevelBuffEffect(type, ownerID, instancedAbilityID, actionLocalID);
            Singleton <EventManager> .Instance.FireEvent(new EvtLevelBuffState(type, LevelBuffState.Start, base.witchTimeLevelBuff.levelBuffSide, ownerID), MPEventDispatchMode.Normal);
        }