diff options
| author | Sarah B <git@sarahduck.ca> | 2023-12-24 22:58:59 -0800 |
|---|---|---|
| committer | Sarah B <git@sarahduck.ca> | 2023-12-24 22:58:59 -0800 |
| commit | 760fb20f4d248d19524392d2b8c3a3fcdb762453 (patch) | |
| tree | afa33078b167e619547b000d0cc225504a6cc4e6 /OnekoLocal.cs | |
| parent | 0bd51a156b56f661c794782e77c67d616d39f333 (diff) | |
AI Tweaks
Diffstat (limited to 'OnekoLocal.cs')
| -rw-r--r-- | OnekoLocal.cs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/OnekoLocal.cs b/OnekoLocal.cs index d8c40f3..bbe3c3b 100644 --- a/OnekoLocal.cs +++ b/OnekoLocal.cs @@ -98,9 +98,10 @@ class OnekoLocal : Oneko InactivityTimer += delta; Neko.Animation = Idle; - if (InactivityTimer > 3f) Neko.Animation = ScratchSelf; - if (InactivityTimer > 5f) Neko.Animation = Yawn; - if (InactivityTimer > 6f) Neko.Animation = Sleep; + if (InactivityTimer > 1.5f && InactivityTimer < 3f) Neko.Animation = Clean; + if (InactivityTimer > 5f) Neko.Animation = ScratchSelf; + if (InactivityTimer > 7f) Neko.Animation = Yawn; + if (InactivityTimer > 8f) Neko.Animation = Sleep; } public override void ExitState() => InactivityTimer = 0f; @@ -114,7 +115,10 @@ class OnekoLocal : Oneko public ChaseMouseState(OnekoLocal neko) : base(neko) { Mouse.Clicked += mouse => { - if (Random.Shared.NextSingle() > 0.4f) MouseToChase = mouse; + if (MouseToChase != mouse && Random.Shared.NextSingle() > 0.3f) { + AlertTimer = 0.5f; + MouseToChase = mouse; + } }; } @@ -146,6 +150,7 @@ class OnekoLocal : Oneko class ItchyState(OnekoLocal neko) : OnekoAIState(neko) { float ItchTimer = -1f; + bool Cleaning = false; public override int GetPriority() { @@ -153,11 +158,14 @@ class OnekoLocal : Oneko else return -1; } - public override void StartState() => ItchTimer = 0.6f + Random.Shared.NextSingle()*3f; + public override void StartState() { + ItchTimer = 1f + Random.Shared.NextSingle()*4f; + Cleaning = Random.Shared.NextSingle() > 0.5f; + } public override void Update(float delta) { ItchTimer -= delta; - Neko.Animation = ScratchSelf; + Neko.Animation = Cleaning ? Clean : ScratchSelf; } } }
\ No newline at end of file |
