public List<CLNS.BoundingBox> GetAllBoxes(CLNS.BoxType boxType) { return boxes.SelectMany(item => item.Value).ToList().FindAll(item => item.GetBoxType() == boxType); }
public void AddBox(int frame, CLNS.BoundingBox box) { if (!boxes.ContainsKey(frame - 1)) { boxes.Add(frame - 1, new List<CLNS.BoundingBox>()); } boxes[frame - 1].Add(box); boxes[frame - 1][boxes[frame - 1].Count - 1].SetFrame(frame); }
public List<CLNS.BoundingBox> GetCurrentBoxes(CLNS.BoxType boxType) { return (boxes.ContainsKey(currentFrame) ? boxes[currentFrame].FindAll(item => item.GetBoxType() == boxType) : new List<CLNS.BoundingBox>()); }
private float TargetBodyY(Entity target, Entity entity, CLNS.AttackBox attack) { float y1 = entity.GetPosY(); return (y1) - (attack.GetRect().Height / 1.5f) + (attack.GetOffset().Y); }
private float TargetBodyX(Entity target, Entity entity, CLNS.AttackBox attack) { float x1 = (target.GetPosX() + (target.GetWidth() / 4)); if (entity.GetPosX() >= target.GetPosX() + (target.GetWidth() / 4)) { x1 = (target.GetPosX() + (target.GetWidth() / 4)); } else if (entity.GetPosX() <= target.GetPosX() + (target.GetWidth() / 4)) { x1 = (target.GetPosX() - (target.GetWidth() / 4)); } return x1 + (attack.GetOffset().X / 2); }
private void OnHit(Entity target, Entity entity, CLNS.AttackBox attackBox) { if (target != entity) { hitCount++; hiteffect1.CreateInstance().Play(); target.Toss(-25 * attackBox.GetHitStrength()); //target.MoveY(-125 * attackBox.GetHitStrength()); } }
private void OnAttack(Entity entity, Entity target, CLNS.AttackBox attackBox) { if (entity != target) { ComboAttack.Chain attackChain = entity.GetDefaultAttackChain(); attackChain.IncrementMoveIndex(attackBox.GetComboStep()); entity.GetAttackInfo().hitPauseTime = 3000f; } }