private void Angle() { if (this.motion == EvilEye.MOTION.up) { if (this.CanRight) { this.motion = EvilEye.MOTION.right; } else if (this.CanDown) { this.motion = EvilEye.MOTION.down; } else { if (!this.CanLeft) { return; } this.motion = EvilEye.MOTION.left; } } else if (this.motion == EvilEye.MOTION.right) { if (this.CanDown) { this.motion = EvilEye.MOTION.down; } else if (this.CanLeft) { this.motion = EvilEye.MOTION.left; } else { if (!this.CanUP) { return; } this.motion = EvilEye.MOTION.up; } } else if (this.motion == EvilEye.MOTION.down) { if (this.CanLeft) { this.motion = EvilEye.MOTION.left; } else if (this.CanUP) { this.motion = EvilEye.MOTION.up; } else { if (!this.CanRight) { return; } this.motion = EvilEye.MOTION.right; } } else { if (this.motion != EvilEye.MOTION.left) { return; } if (this.CanUP) { this.motion = EvilEye.MOTION.up; } else if (this.CanRight) { this.motion = EvilEye.MOTION.right; } else if (this.CanDown) { this.motion = EvilEye.MOTION.down; } } }
protected override void Moving() { this.neutlal = true; if (!this.attacknow) { float speed = 1f; switch (this.version) { case 0: speed = 2f; break; case 1: speed = 0.3f; break; case 2: speed = 0.5f; break; } int angle = 0; switch (this.motion) { case EvilEye.MOTION.up: if (!this.CanUP && !this.slideInit) { this.Angle(); break; } break; case EvilEye.MOTION.down: if (!this.CanDown && !this.slideInit) { this.Angle(); break; } break; case EvilEye.MOTION.left: if (!this.CanLeft && !this.slideInit) { this.Angle(); break; } break; case EvilEye.MOTION.right: if (!this.CanRight && !this.slideInit) { this.Angle(); break; } break; } switch (this.motion) { case EvilEye.MOTION.up: angle = 2; break; case EvilEye.MOTION.down: angle = 3; break; case EvilEye.MOTION.left: angle = this.union == Panel.COLOR.blue ? 0 : 1; break; case EvilEye.MOTION.right: angle = this.union == Panel.COLOR.blue ? 1 : 0; break; } if ((this.CanUP || this.CanDown || (this.CanLeft || this.CanRight)) && (this.parent.nowscene != SceneBattle.BATTLESCENE.end && !this.HeviSand) || this.slideInit) { if (this.version == 0 && !this.attacked) { foreach (CharacterBase characterBase in this.parent.AllChara()) { if (characterBase.union == this.UnionEnemy && characterBase.position.Y == this.position.Y) { this.attacked = true; EYEBall eyeBall = new EYEBall(this.sound, this.parent, this.position.X, this.position.Y, this.union, this.Power, 2, this.positionDirect, ChipBase.ELEMENT.normal, 16); eyeBall.positionDirect.Y += 8f; eyeBall.breakinvi = false; this.parent.attacks.Add(eyeBall); break; } } } if (this.SlideMove(speed, angle)) { this.SlideMoveEnd(); this.PositionDirectSet(); if ((this.CanUP || this.CanDown || (this.CanLeft || this.CanRight)) && this.parent.nowscene != SceneBattle.BATTLESCENE.end && !this.HeviSand) { bool flag = false; switch (this.motion) { case EvilEye.MOTION.up: if (!this.CanUP) { flag = true; break; } break; case EvilEye.MOTION.down: if (!this.CanDown) { flag = true; break; } break; case EvilEye.MOTION.left: if (!this.CanLeft) { flag = true; break; } break; case EvilEye.MOTION.right: if (!this.CanRight) { flag = true; break; } break; } this.attacked = false; if (flag) { EvilEye.MOTION motion = this.motion; this.Angle(); this.attacked = false; if (motion == this.motion) { } } ++this.moving; this.moveend = false; if (this.moving >= this.moveMany && this.version > 0) { this.moving = 0; this.attacknow = true; this.frame = 0; } } } else if (this.moveflame) { if (this.frame >= 12) { this.frame = 0; } this.animationpoint.X = this.AnimeMove(this.frame / 3).X; } } else { this.positionre = this.position; this.PositionDirectSet(); this.Angle(); } } else if (this.moveflame) { this.animationpoint.X = this.attackanimation ? 4 : 5; this.attackanimation = !this.attackanimation; if (this.frame == 5) { this.counterTiming = true; } if (this.frame == 15) { this.counterTiming = false; AttackBase attackBase = new EYEBall(this.sound, this.parent, this.position.X, this.position.Y, this.union, this.Power, 2, this.positionDirect, ChipBase.ELEMENT.normal, 4); attackBase.positionDirect.Y += 8f; this.parent.attacks.Add(attackBase); } else if (this.frame > 30) { this.attacknow = false; this.animationpoint.X = 0; } } this.FlameControl(); this.MoveAftar(); }