public void AttackSkill(SkillGenerics skill) { DynamicSolid Dsolid = (box as DynamicSolid); HitSolid hit = null; Solid tDynamic = null; if (HitPool.PoolSize > 0) { HitPool.GetFromPool(out hit); skill.UpdateThrow(hit, this); hit.Visibility = Windows.UI.Xaml.Visibility.Visible; } else { if (skill.Active) { hit = skill.Throw(this); } InterfaceManager.instance.CanvasChunck01.Children.Add(hit); } if (hit == null) { return; } tDynamic = hit.Interaction(); if (!(tDynamic == null || tDynamic.MyEnt == null)) { if (skill.tipobuff == SkillTypeBuff.debuff) { tDynamic.MyEnt.InsereStatus(skill); } double dano = skill.UseSkill(this, tDynamic.MyEnt); tDynamic.MyEnt.BeHit(dano, this); } }
public void Attack(SkillGenerics skill) { if (!CanAtk) { return; } DynamicSolid Dsolid = (box as DynamicSolid); HitSolid hit = null; DynamicSolid tDynamic = null; double hitboxSize = 50; double speeed = Ranged == true ? 4 : 0; if (HitPool.PoolSize > 0)//verificar a pool { HitPool.GetFromPool(out hit); hit.speed = speeed; hit.Yi = box.Yi; hit.Who = box as DynamicSolid; hit.Visibility = Windows.UI.Xaml.Visibility.Visible; if (Dsolid.lastHorizontalDirection == 1) { hit.Xi = box.Xf; } else if (Dsolid.lastHorizontalDirection == -1) { hit.Xi = box.Xi - hitboxSize; } hit.Start(null, null); //.alive = true; } else { if (Dsolid.lastHorizontalDirection == 1) { hit = new HitSolid(box.Xf + 10, box.Yi + 20, hitboxSize, box.Height / 2, box as DynamicSolid, speeed); hit.Start(null, null);//hit.alive = true; } else if (Dsolid.lastHorizontalDirection == -1) { hit = new HitSolid(box.Xi - hitboxSize - 10, box.Yi + 20, hitboxSize, box.Height / 2, box as DynamicSolid, speeed); hit.Start(null, null);//hit.alive = true; } InterfaceManager.instance.CanvasChunck01.Children.Add(hit); } if (hit == null) { return; } Solid s = hit.Interaction(); if (!(tDynamic == null || tDynamic.MyEnt == null)) { if (skill != null) { tDynamic.MyEnt.BeHit(skill.UseSkill(this, tDynamic.MyEnt), this); } else { tDynamic.MyEnt.BeHit(Hit(0), this); } //hit.speed = 0; } AtkT = 0; Attacking = false; }