Ejemplo n.º 1
0
    public void CalculateBuff()
    {
        mBuffInfoList.Clear();
        EventPackage eventPackage = FacadeSingleton.Instance.RetrieveData(ConstVal.Package_Event) as EventPackage;
        UserPackage  userPackage  = FacadeSingleton.Instance.RetrieveData(ConstVal.Package_User) as UserPackage;
        //cooperation
        int num = userPackage.GetManorPersonNumber();

        if (num >= 2)
        {
            NBuffInfo buff = new NBuffInfo();
            buff.type     = NBuffType.Cooperation;
            buff.configID = num;
            mBuffInfoList.Add(buff);
        }
        //world event
        var infoList = eventPackage.GetCurEventList();

        foreach (var info in infoList)
        {
            NBuffInfo buff = new NBuffInfo();
            buff.type     = NBuffType.WorldEvent;
            buff.configID = info.configID;
            mBuffInfoList.Add(buff);
        }
    }
Ejemplo n.º 2
0
    public override void DrawCell(int index, int count = 0)
    {
        base.DrawCell(index, count);
        var dataList = dynamicPackage.GetBuffList();

        if (index >= dataList.Count)
        {
            return;
        }
        info = dataList[index];
        // set icon
        if (info.type == NBuffType.WorldEvent)
        {
            WORLD_EVENTS config = eventPackage.GetEventConfigDataByConfigID(info.configID);
            iconSprite.spriteName = config.EventIcon;
        }
        else if (info.type == NBuffType.Cooperation)
        {
            if (info.configID == 2)
            {
                iconSprite.spriteName = "efficiency1";
            }
            else if (info.configID == 3)
            {
                iconSprite.spriteName = "efficiency2";
            }
            else if (info.configID == 4)
            {
                iconSprite.spriteName = "efficiency3";
            }
        }
        OpenSmallWindow(info);
    }
Ejemplo n.º 3
0
 void OpenSmallWindow(NBuffInfo info)
 {
     if (info.type == NBuffType.WorldEvent)
     {
         WORLD_EVENTS config = eventPackage.GetEventConfigDataByConfigID(info.configID);
         iconSprite.spriteName = config.EventIcon;
     }
 }
Ejemplo n.º 4
0
        internal void DoBuffAction(NBuffInfo buff)
        {
            switch (buff.Action)
            {
            case BuffAction.Add:
                this.AddBuff(buff.buffId, buff.buffType, buff.casterId);
                break;

            case BuffAction.Remove:
                this.RemoveBuff(buff.buffId);
                break;

            case BuffAction.Hit:
                this.DoDamage(buff.Damage, false);
                break;
            }
        }
Ejemplo n.º 5
0
        private void OnAdd()
        {
            if (this.Define.Effect != Common.Battle.BuffEffect.None)
            {
                this.Owner.EffectMgr.AddBuffEffect(this.Define.Effect);
            }
            AddAttr();
            NBuffInfo buff = new NBuffInfo()
            {
                buffId   = this.BuffId,
                buffType = this.Define.ID,
                casterId = this.Context.Caster.entityId,
                ownerId  = this.Owner.entityId,
                Action   = BuffACTION.Add,
            };

            Context.Battle.AddBuffAction(buff);
        }
Ejemplo n.º 6
0
        private void DeBuffDamage()
        {
            this.hit++;
            NDamageInfo damage = this.CalcBuffDamage(Context.Caster);

            Log.InfoFormat("Buff[{0}].DoBuffDamage[{1}] Damage:{2} Crit:{3}", this.Define.Name, this.Owner.Name, damage.Damage, damage.Crit);
            this.Owner.DoDamage(damage, Context.Caster);
            NBuffInfo buff = new NBuffInfo()
            {
                buffId   = this.BuffId,
                buffType = this.Define.ID,
                casterId = this.Context.Caster.entityId,
                ownerId  = this.Owner.entityId,
                Action   = BuffACTION.Hit,
            };

            Context.Battle.AddBuffAction(buff);
        }
Ejemplo n.º 7
0
        private void OnRemove()
        {
            RemoveAttr();
            Stoped = true;
            if (this.Define.Effect != Common.Battle.BuffEffect.None)
            {
                this.Owner.EffectMgr.RemoveEffect(this.Define.Effect);
            }
            NBuffInfo buff = new NBuffInfo()
            {
                buffId   = this.BuffId,
                buffType = this.Define.ID,
                casterId = this.Context.Caster.entityId,
                ownerId  = this.Owner.entityId,
                Action   = BuffACTION.Remove,
            };

            Context.Battle.AddBuffAction(buff);
        }
Ejemplo n.º 8
0
 internal void AddBuffAction(NBuffInfo buff)
 {
     this.BuffActions.Add(buff);
 }