public override void OnUpdate(Status ks) { base.OnUpdate(ks); //FontUtility.DrawMiniString((int)Location.X - 9 + GameEngine.camera.X, (int)Location.Y + GameEngine.camera.Y, "" + AnimeSpeed, 0xffffff); if (!_isBattling) { // ReSharper disable once AssignmentInConditionalExpression if (_isBattling = Location.GetLengthTo(Parent.MainEntity.Location) < _startKyori) try { EventRuntime.AddScript(new EventScript(_startScript)); } catch (EventScript.EventScriptException ex) { EventRuntime.AddScript(new EventScript($@"[enstop] [mesbox:down] [mes:""エラー!\n{ex.Message.Replace(@"\", @"\\").Replace(@"""", @"\""")}""] [mesend] [enstart]")); } return; } switch (_nowBehavior) { case QueenBossBehaviorOption.Waiting1: if (Tick == 0) { Tick = 60; _nowBehavior = QueenBossBehaviorOption.ThrowWeaponToLeft; SetGraphic(16); } break; case QueenBossBehaviorOption.ThrowWeaponToLeft: if (Tick == 30) { SoundUtility.PlaySound(Sounds.ShootArrow); SetGraphic(17); Parent.Add( new EntityCircusBall(Location, Mpts, Map, Parent).SetEntityData( DynamicJson.Parse(DynamicJson.Serialize(new {SpeedX = -2.0f})))); } if (Tick == 0) { _nowBehavior = QueenBossBehaviorOption.MoveToLeft; SetAnime(0, 3, 8); Velocity.X = -1.6f; } break; case QueenBossBehaviorOption.MoveToLeft: if ((Location.X <= _left - 16) || (Location.X <= 0) || (CollisionLeft() == ObjectHitFlag.Hit)) { Tick = 60; _nowBehavior = QueenBossBehaviorOption.Waiting2; SetGraphic(6); Velocity.X = 0; } break; case QueenBossBehaviorOption.Waiting2: if (Tick == 0) { Tick = 60; _nowBehavior = QueenBossBehaviorOption.ThrowWeaponToRight; SetGraphic(18); } break; case QueenBossBehaviorOption.ThrowWeaponToRight: if (Tick == 30) { SoundUtility.PlaySound(Sounds.ShootArrow); Parent.Add( new EntityCircusBall(Location, Mpts, Map, Parent).SetEntityData( DynamicJson.Parse(DynamicJson.Serialize(new {SpeedX = 2.0f})))); SetGraphic(19); } if (Tick == 0) { _nowBehavior = QueenBossBehaviorOption.MoveToRight; SetAnime(6, 9, 8); Velocity.X = 1.6f; } break; case QueenBossBehaviorOption.MoveToRight: if (((Location.X >= _firstLoc.X) && (Location.X >= GameEngine.Map.Width - 1)) || (CollisionRight() == ObjectHitFlag.Hit)) { Tick = 60; _nowBehavior = QueenBossBehaviorOption.Waiting1; SetGraphic(6); Velocity.X = 0; } break; } Tick--; if (MutekiTime <= 0) return; MutekiTime--; }
public override void OnUpdate() { base.OnUpdate(); //FontUtility.DrawMiniString((int)Location.X - 9 + GameEngine.camera.X, (int)Location.Y + GameEngine.camera.Y, "" + AnimeSpeed, 0xffffff); if (!_isBattling) { // ReSharper disable once AssignmentInConditionalExpression if (_isBattling = Location.Distance(Parent.MainEntity.Location) < _startKyori) { try { EventRuntime.AddScript(new EventScript(_startScript)); } catch (EventScript.EventScriptException ex) { EventRuntime.AddScript(new EventScript($@"[enstop] [mesbox:down] [mes:""エラー!\n{ex.Message.Replace(@"\", @"\\").Replace(@"""", @"\""")}""] [mesend] [enstart]")); } } return; } switch (_nowBehavior) { case QueenBossBehaviorOption.Waiting1: if (Tick == 0) { Tick = 60; _nowBehavior = QueenBossBehaviorOption.ThrowWeaponToLeft; SetGraphic(16); } break; case QueenBossBehaviorOption.ThrowWeaponToLeft: if (Tick == 30) { DESound.Play(Sounds.ShootArrow); SetGraphic(17); Parent.Add( new EntityCircusBall(Location, Mpts, Map, Parent).SetEntityData( DynamicJson.Parse(DynamicJson.Serialize(new { SpeedX = -2.0f })))); } if (Tick == 0) { _nowBehavior = QueenBossBehaviorOption.MoveToLeft; SetAnime(0, 3, 8); Velocity.X = -1.6f; } break; case QueenBossBehaviorOption.MoveToLeft: if ((Location.X <= _left - 16) || (Location.X <= 0) || (CollisionLeft() == ColliderType.Land)) { Tick = 60; _nowBehavior = QueenBossBehaviorOption.Waiting2; SetGraphic(6); Velocity.X = 0; } break; case QueenBossBehaviorOption.Waiting2: if (Tick == 0) { Tick = 60; _nowBehavior = QueenBossBehaviorOption.ThrowWeaponToRight; SetGraphic(18); } break; case QueenBossBehaviorOption.ThrowWeaponToRight: if (Tick == 30) { DESound.Play(Sounds.ShootArrow); Parent.Add( new EntityCircusBall(Location, Mpts, Map, Parent).SetEntityData( DynamicJson.Parse(DynamicJson.Serialize(new { SpeedX = 2.0f })))); SetGraphic(19); } if (Tick == 0) { _nowBehavior = QueenBossBehaviorOption.MoveToRight; SetAnime(6, 9, 8); Velocity.X = 1.6f; } break; case QueenBossBehaviorOption.MoveToRight: if (((Location.X >= _firstLoc.X) && (Location.X >= Core.I.CurrentMap.Size.X - 1)) || (CollisionRight() == ColliderType.Land)) { Tick = 60; _nowBehavior = QueenBossBehaviorOption.Waiting1; SetGraphic(6); Velocity.X = 0; } break; } Tick--; if (MutekiTime <= 0) { return; } MutekiTime--; }