summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Oneko.cs2
-rw-r--r--OnekoLocal.cs20
2 files changed, 15 insertions, 7 deletions
diff --git a/Oneko.cs b/Oneko.cs
index dfb00fb..31652ed 100644
--- a/Oneko.cs
+++ b/Oneko.cs
@@ -120,7 +120,7 @@ abstract class Oneko : Drawable
static protected readonly OnekoAnimation Idle = new(Idle1, Idle1, 1);
static protected readonly OnekoAnimation Alert = new(Alert1, Alert1, 1);
static protected readonly OnekoAnimation Yawn = new(Yawn1, Yawn1, 1);
- static protected readonly OnekoAnimation Clean = new(Clean1, Clean1, 1);
+ static protected readonly OnekoAnimation Clean = new(Idle1, Clean1, 1);
static protected readonly OnekoAnimation ScratchSelf = new(Scratch1, Scratch2, 1);
static protected readonly OnekoAnimation Sleep = new(Sleep1, Sleep2, 10);
static protected readonly OnekoAnimation RunUp = new(RunUp1, RunUp2, 1);
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