summaryrefslogtreecommitdiff
path: root/OnekoLocal.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OnekoLocal.cs')
-rw-r--r--OnekoLocal.cs20
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