internal void DoHit(NSkillHitInfo hit) { if (hit.isBullet || !this.Define.Bullet) { this.DoHit(hit.hitId, hit.Damages); } }
private void CastBullet(NSkillHitInfo hitInfo) { Context.Battle.AddHitInfo(hitInfo); Log.InfoFormat("Skill[{0}].CastBullet[{1}] Target:{2}", this.Define.Name, this.Define.BulletResource, this.Context.Target.Name); Bullet bullet = new Bullet(this, this.Context.Target, hitInfo); this.Bullets.Add(bullet); }
NSkillHitInfo InitHitInfo(bool isBullet) { NSkillHitInfo hitInfo = new NSkillHitInfo(); hitInfo.casterId = this.Context.Caster.entityId; hitInfo.skillId = this.Info.Id; hitInfo.hitId = this.Hit; hitInfo.isBullet = isBullet; return(hitInfo); }
public Bullet(Skill skill, Creature target, NSkillHitInfo hitInfo) { this.skill = skill; this.hitInfo = hitInfo; int distance = skill.Owner.Distance(target); if (TimeMode) { duration = distance / this.skill.Define.BulletSpeed; } Log.InfoFormat(" Bullet.CastBullet[{0}] casterId:[1] Distance:[2] Time;{3}", this.skill.Define.Name, hitInfo.casterId, distance, this.duration); }
public Bullet(Skill skill, Creature target, SkillBridge.Message.NSkillHitInfo hitInfo) { this.skill = skill; this.hitInfo = hitInfo; int distance = skill.Owner.Distance(target); if (TimeMode) { duration = distance / this.skill.Define.BulletSpeed; } Log.InfoFormat("Bullet [{0}].CastBullet[{1}] Target:{2} Distance:{3} Time:{4}", this.skill.Define.Name, this.skill.Define.BulletResource, target.Name, distance, duration); }
public void DoHit(NSkillHitInfo hitInfo) { Context.Battle.AddHitInfo(hitInfo); Log.InfoFormat("Skill{0}.DoHit[{1}] IsBullet:{2}", this.Define.Name, hitInfo.hitId, hitInfo.isBullet); if (this.Define.AOERange > 0) { this.HitRange(hitInfo); } if (this.Define.CastTarget == Common.Battle.TargetType.Target) { this.HitTarget(Context.Target, hitInfo); } }
public void DoHit() { NSkillHitInfo hitInfo = InitHitInfo(false); Log.InfoFormat("Skill{0}.DoHit", this.Define.Name, this.Status); this.Hit++; if (this.Define.Bullet) { CastBullet(hitInfo); return; } DoHit(hitInfo); }
private void DoHit() { NSkillHitInfo hitInfo = this.InitHitInfo(false); Log.InfoFormat("Skill[{0}].DoHit[{1}]", this.Define.Name, this.Hit); this.Hit++; if (this.Define.Bullet) { CastBullet(hitInfo); return; } DoHit(hitInfo); }
void HitTarget(Creature target, NSkillHitInfo hit) { if (this.Define.CastTarget == Common.Battle.TargetType.Self && (target != Context.Caster)) { return; } else if (target == Context.Caster) { return; } NDamageInfo damage = this.CalcSkillDamage(Context.Caster, target); Log.InfoFormat("Skill{0}.HitTarget[{1}] Damage;{2} Crit:[3]", this.Define.Name, target.Name, damage.Damage, damage.Crit); target.DoDamage(damage, Context.Caster); hit.Damages.Add(damage); this.AddBuff(TriggerType.SkillHit, target); }
private void HitRange(NSkillHitInfo hit) { Vector3Int pos; if (this.Define.CastTarget == TargetType.Target) { pos = Context.Target.Position; } else if (this.Define.CastTarget == TargetType.Position) { pos = Context.Position; } else { pos = this.Owner.Position; } List <Creature> units = this.Context.Battle.FindUnitsInMapRange(pos, this.Define.AOERange); foreach (var target in units) { this.HitTarget(target, hit); } }
public void AddHitInfo(NSkillHitInfo hit) { this.Hits.Add(hit); }
public void DoSkillHit(NSkillHitInfo hit) { var skill = this.SkillMgr.GetSkill(hit.skillId); skill.DoHit(hit); }
internal void AddHitInfo(NSkillHitInfo hit) { this.Hits.Add(hit); }