Пример #1
0
 public JellyfishAttack(Enemy parent, AttackValueRadius tentacle, LayerMask targetLayer) : base(parent)
 {
     this.tentacle       = new AttackSet(tentacle, new CircleAreaAttack(tentacle.CD, tentacle.DetectRadius, targetLayer));
     this.tentacle.value = tentacle;
     this.targetLayer    = targetLayer;
     jf = (Jellyfish)Parent;
     jf.OnTentacleAnimFined += TentacleAnimationFin;
 }
 public CannibalFlowerAttack(Enemy parent, AttackValueRadius needle, AttackValueRadius bite, LayerMask targetLayer, List <Collider2D> needles) : base(parent)
 {
     this.targetLayer = targetLayer;
     this.needles.AddRange(needles);
     attacks.Add(this.needle = new AttackSet(needle, new CircleAreaAttack(needle.CD, needle.DetectRadius, targetLayer, this.NeedleAttacking)));
     attacks.Add(this.bite   = new AttackSet(bite, new CircleAreaAttack(bite.CD, bite.DetectRadius, targetLayer)));
     cf = (CannibalFlower)Parent;
     cf.OnAnimationFinished += this.AnimFinished;
     GalaxySeeker.Physics2D.OverlapCircle(Parent.tf.position, Mathf.Infinity, targetLayer, ref target);
 }
Пример #3
0
 public KingCannibalFlowerAttack(Enemy parent, LayerMask targetLayer, float normalProbability, float specialProbability, AttackValue vineStingValue, AttackValue vineScratchValue, AttackValueRadius biteValue, AttackValueRadius vineValue, AttackValueRadius needleValue, List <Collider2D> vines, List <Collider2D> needles) : base(parent)
 {
     //set own to kcf
     kcf = (KingCannibalFlower)Parent;
     //set targetLayer and add vines collider and probability
     this.targetLayer = targetLayer;
     this.vines.AddRange(vines);
     this.needles.AddRange(needles);
     this.normalProbability  = normalProbability;
     this.specialProbability = specialProbability;
     //instantiation all attack and add to attacks
     attacks.Add(this.vineSting   = new AttackSet(vineStingValue, new BasicAttack(vineStingValue.CD, VineStingAttacking)));
     attacks.Add(this.vineScratch = new AttackSet(vineScratchValue, new BasicAttack(vineScratchValue.CD, VineScratchAttacking)));
     attacks.Add(this.bite        = new AttackSet(biteValue, new CircleAreaAttack(biteValue.CD, biteValue.DetectRadius, targetLayer)));
     attacks.Add(this.vine        = new AttackSet(vineValue, new CircleAreaAttack(vineValue.CD, vineValue.DetectRadius, targetLayer, VineAttacking)));
     attacks.Add(this.needle      = new AttackSet(needleValue, new CircleAreaAttack(needleValue.CD, needleValue.DetectRadius, targetLayer, NeedleAttacking)));
     //add attack to one they belong to
     specialAttacks.Add(vineScratch);
     specialAttacks.Add(vineSting);
     normalAttacks.Add(bite);
     normalAttacks.Add(needle);
     normalAttacks.Add(vine);
     //register the OnAnimationFinished on Parent for AnimFinished
     kcf.OnAnimationFinished += AnimFinished;
     //try to find the player on the scene
     GalaxySeeker.Physics2D.OverlapCircle(Parent.tf.position, Mathf.Infinity, targetLayer, ref targetTransform);
     if (targetTransform)
     {
         target = targetTransform.GetComponent <Character> ( );
     }
 }