Example #1
0
 public List<CLNS.BoundingBox> GetAllBoxes(CLNS.BoxType boxType)
 {
     return boxes.SelectMany(item => item.Value).ToList().FindAll(item => item.GetBoxType() == boxType);
 }
Example #2
0
        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);
        }
Example #3
0
 public List<CLNS.BoundingBox> GetCurrentBoxes(CLNS.BoxType boxType)
 {
     return (boxes.ContainsKey(currentFrame) ? boxes[currentFrame].FindAll(item => item.GetBoxType() == boxType) : new List<CLNS.BoundingBox>());
 }
Example #4
0
 private float TargetBodyY(Entity target, Entity entity, CLNS.AttackBox attack)
 {
     float y1 = entity.GetPosY();
     return (y1) - (attack.GetRect().Height / 1.5f) + (attack.GetOffset().Y);
 }
Example #5
0
        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);
        }
Example #6
0
        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());
            }
        }
Example #7
0
 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;
     }
 }