Improve emote personality system
- Replace dreamy emote with content face ( ˙▿˙) - Make blinks brief (1-2 seconds) instead of lasting full rotation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ CELEBRATION_DURATION = 5 # Seconds to show celebration after recovery
|
|||||||
# Emote variations with paired animations
|
# Emote variations with paired animations
|
||||||
OPTIMAL_EMOTES = [
|
OPTIMAL_EMOTES = [
|
||||||
("( ^_^)", "breathing"), # calm, content
|
("( ^_^)", "breathing"), # calm, content
|
||||||
("( ᵔᴥᵔ)", "floating"), # dreamy
|
("( ˙▿˙)", "floating"), # content
|
||||||
("(◕‿◕)", "bouncing"), # cheerful
|
("(◕‿◕)", "bouncing"), # cheerful
|
||||||
("( ・ω・)", "swaying"), # curious
|
("( ・ω・)", "swaying"), # curious
|
||||||
("( ˘▽˘)", "breathing"), # cozy
|
("( ˘▽˘)", "breathing"), # cozy
|
||||||
@@ -50,6 +50,9 @@ active_events = {} # id -> {priority, message, timestamp, ttl}
|
|||||||
# State tracking for personality
|
# State tracking for personality
|
||||||
previous_priority = 4
|
previous_priority = 4
|
||||||
celebrating_until = 0
|
celebrating_until = 0
|
||||||
|
blinking_until = 0
|
||||||
|
blink_emote = None
|
||||||
|
blink_animation = None
|
||||||
last_emote_change = 0
|
last_emote_change = 0
|
||||||
current_optimal_emote = OPTIMAL_EMOTES[0][0]
|
current_optimal_emote = OPTIMAL_EMOTES[0][0]
|
||||||
current_optimal_animation = OPTIMAL_EMOTES[0][1]
|
current_optimal_animation = OPTIMAL_EMOTES[0][1]
|
||||||
@@ -63,7 +66,8 @@ SLEEP_ANIMATION = "sleeping"
|
|||||||
|
|
||||||
def get_current_state():
|
def get_current_state():
|
||||||
"""Determine current state based on active events."""
|
"""Determine current state based on active events."""
|
||||||
global previous_priority, celebrating_until, last_emote_change, current_optimal_emote, current_optimal_animation
|
global previous_priority, celebrating_until, blinking_until, blink_emote, blink_animation
|
||||||
|
global last_emote_change, current_optimal_emote, current_optimal_animation
|
||||||
|
|
||||||
# Sleep mode overrides everything
|
# Sleep mode overrides everything
|
||||||
if is_sleeping:
|
if is_sleeping:
|
||||||
@@ -107,15 +111,19 @@ def get_current_state():
|
|||||||
if now < celebrating_until:
|
if now < celebrating_until:
|
||||||
# Celebration mode
|
# Celebration mode
|
||||||
emote, animation = CELEBRATION_EMOTE
|
emote, animation = CELEBRATION_EMOTE
|
||||||
|
elif now < blinking_until:
|
||||||
|
# Brief blink/wink (1-2 seconds)
|
||||||
|
emote = blink_emote
|
||||||
|
animation = blink_animation
|
||||||
else:
|
else:
|
||||||
# Rotate optimal emotes every 5 minutes, occasional idle expression
|
# Rotate optimal emotes every 5 minutes
|
||||||
if now - last_emote_change > 300:
|
if now - last_emote_change > 300:
|
||||||
last_emote_change = now
|
last_emote_change = now
|
||||||
# 15% chance of an idle expression (wink/blink)
|
current_optimal_emote, current_optimal_animation = random.choice(OPTIMAL_EMOTES)
|
||||||
|
# 15% chance of a brief blink/wink
|
||||||
if random.random() < 0.15:
|
if random.random() < 0.15:
|
||||||
current_optimal_emote, current_optimal_animation = random.choice(IDLE_EMOTES)
|
blink_emote, blink_animation = random.choice(IDLE_EMOTES)
|
||||||
else:
|
blinking_until = now + random.uniform(1, 2)
|
||||||
current_optimal_emote, current_optimal_animation = random.choice(OPTIMAL_EMOTES)
|
|
||||||
emote = current_optimal_emote
|
emote = current_optimal_emote
|
||||||
animation = current_optimal_animation
|
animation = current_optimal_animation
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user