Exemplo n.º 1
0
        public static bool CheckCampType(VBio self, CampType campType, VBio target)
        {
            if ((campType & CampType.Self) > 0 &&
                target == self)
            {
                return(true);
            }

            if ((campType & CampType.Allied) > 0 &&
                target.property.team == self.property.team &&
                target != self)
            {
                return(true);
            }

            if ((campType & CampType.Hostile) > 0 &&
                target.property.team != self.property.team &&
                target.property.team != 2)
            {
                return(true);
            }

            if ((campType & CampType.Neutral) > 0 &&
                target.property.team == 2)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
 public void HandleDamage(VBuff buff, VBio target, float damage)
 {
     foreach (KeyValuePair <string, VBSBase> kv in this._buffStates)
     {
         kv.Value.OnDamage(buff, target, damage);
     }
 }
Exemplo n.º 3
0
 public static bool CanAttack(VBio attacker, VBio target, CampType campType, EntityFlag targetFlag)
 {
     return(!target.isDead &&
            target.property.stealth <= 0 &&                 //不在隐身状态下
            CheckCampType(attacker, campType, target) &&
            CheckTargetFlag(targetFlag, target));
 }
Exemplo n.º 4
0
 public void HandleHurt(VBuff buff, VBio caster, float damage)
 {
     foreach (KeyValuePair <string, VBSBase> kv in this._buffStates)
     {
         kv.Value.OnHurt(buff, caster, damage);
     }
     UIEvent.Hurt(buff, caster, this, damage);
 }
Exemplo n.º 5
0
 internal void OnAddedToBattle(string rid, string skillId, int lvl, VBio caster, VBio target, Vector3 targetPoint)
 {
     this._rid        = rid;
     this._data       = ModelFactory.GetBuffData(Utils.GetIDFromRID(this._rid));
     this.skillData   = ModelFactory.GetSkillData(skillId);
     this.caster      = caster;
     this.target      = target;
     this.targetPoint = targetPoint;
     this.property.Init(this._data);
     this.ApplyLevel(lvl);
 }
Exemplo n.º 6
0
 public void HandleDie(VBio killer)
 {
     if (this is VPlayer)
     {
         (( VPlayer )this).SetTracingTarget(null);
         this.battle.camera.BSCOn();
     }
     else if (VPlayer.instance.tracingTarget == this)
     {
         VPlayer.instance.SetTracingTarget(null);
     }
     UIEvent.EntityDie(this, killer);
 }
Exemplo n.º 7
0
        public static bool CheckTargetFlag(EntityFlag targetFlag, VBio target)
        {
            if ((targetFlag & EntityFlag.Hero) > 0 &&
                (target.flag & EntityFlag.Hero) > 0)
            {
                return(true);
            }

            if ((targetFlag & EntityFlag.SmallPotato) > 0 &&
                (target.flag & EntityFlag.SmallPotato) > 0)
            {
                return(true);
            }

            if ((targetFlag & EntityFlag.Structure) > 0 &&
                (target.flag & EntityFlag.Structure) > 0)
            {
                return(true);
            }

            if ((targetFlag & EntityFlag.Missile) > 0 &&
                (target.flag & EntityFlag.Missile) > 0)
            {
                return(true);
            }

            if ((targetFlag & EntityFlag.Effect) > 0 &&
                (target.flag & EntityFlag.Effect) > 0)
            {
                return(true);
            }

            if ((targetFlag & EntityFlag.Item) > 0 &&
                (target.flag & EntityFlag.Item) > 0)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 8
0
 public static bool IsNeutral(VBio a)
 {
     return(a.property.team == 2);
 }
Exemplo n.º 9
0
 public static bool IsHostile(VBio a, VBio b)
 {
     return(a.property.team != b.property.team);
 }
Exemplo n.º 10
0
 public static bool IsAllied(VBio a, VBio b)
 {
     return(a.property.team == b.property.team);
 }
Exemplo n.º 11
0
 public void SetTracingTarget(VBio target)
 {
     this.tracingTarget?.RedRef(false);
     this.tracingTarget = target;
     this.tracingTarget?.AddRef(false);
 }