public CharacterNPC(NPC _NPC, double xi, double yi, double width, double height, double speed) { box = new DynamicSolid(xi, yi, width, height, speed); MyNPC = _NPC; box.PointerPressed += InteractWith; InterfaceManager.instance.CanvasChunck01.Children.Add(box); Load(); }
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); } }
}//monta as imagens na box do Mob public void Spawn(double x, double y)//cria o mob na tela { box = new DynamicSolid(x, y, Matriz.scale * 2, Matriz.scale * 2, Run); box.MyEnt = this; Load(); }
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; }
public EntEvent(DynamicSolid boxs) { EntBox = boxs; }