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); }
public void HandleDamage(VBuff buff, VBio target, float damage) { foreach (KeyValuePair <string, VBSBase> kv in this._buffStates) { kv.Value.OnDamage(buff, target, damage); } }
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)); }
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); }
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); }
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); }
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); }
public static bool IsNeutral(VBio a) { return(a.property.team == 2); }
public static bool IsHostile(VBio a, VBio b) { return(a.property.team != b.property.team); }
public static bool IsAllied(VBio a, VBio b) { return(a.property.team == b.property.team); }
public void SetTracingTarget(VBio target) { this.tracingTarget?.RedRef(false); this.tracingTarget = target; this.tracingTarget?.AddRef(false); }