//|////////////////////////////////////////////////////////////////|//
//|                                                                |//
//| DogsLife - Version 2.52                                        |//
//| Copyright (C) 2001-2003 by DogsBody & Ratchet Software         |//
//| All Rights Reserved                                            |//
//|                                                                |//
//| The DogsLife behavior software is provided AS IS without       |//
//| any warranty, expressed or implied.   This includes without    |//
//| limitation the fitfulness for a particular purpose or          |//
//| application.   People using the software bear all risk as to   |//
//| its quality and performance.   The user of the software is     |//
//| responsible for any damages whether direct, indirect, special, |//
//| incidental or consequential arising from a failure of this     |//
//| program to operate in any manner desired.                      |//
//|                                                                |//
//| DogsLife is free software and MAY NOT be sold under any        |//
//| circumstances, seperately or bundled.                          |//
//|                                                                |//
//|////////////////////////////////////////////////////////////////|//
//|                                                                |//
//| Please do not edit YART blocks manually (in a text editor).    |//
//| Only use YART for customizing DogsLife.  There are special     |//
//| code blocks which must be managed carefully.                   |//
//|                                                                |//
//|////////////////////////////////////////////////////////////////|//
:G_Main
CALL:G_STARTUP
:MAINLOOP
PUSH:Context
PUSH:102
LT
POP:reTempVar0
PUSH:Context
PUSH:107
GT
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
SET:Context:103
ENDIF
CASE:102:CALL:G_RESTMODE
CASE:103:CALL:G_SLEEPPOS
CASE:104:CALL:G_SITPOS
CASE:105:CALL:G_STANDPOS
CASE:106:CALL:G_WALK_ABOUT
CASE:107:CALL:G_SOCCER
GO:MAINLOOP
:G_ATTENTION_HANDLER
SET:pet:0
SET:praise:0
SET:scold:0
WAIT:1
CALL:G_YART_Sensors
IF:Context:!=:101:THEN
RET:Context
ENDIF
CALL:G_YART_Vision
IF:Context:!=:101:THEN
RET:Context
ENDIF
IF:Tail_R_LONG:>:0:THEN
SET:Tail_R_LONG:0
SET:sitonly:1
CALL:G_UPDATE_PAUSEBAR
ENDIF
IF:Tail_U_LONG:>:0:THEN
SET:Tail_U_LONG:0
SET:sitonly:0
CALL:G_UPDATE_PAUSEBAR
ENDIF
IF:Tail_RollR:||:Tail_RollL:THEN
ADD:pet:2
SET:maxtime6:32767
SET:Tail_RollR:0
SET:Tail_RollL:0
SET:Tail_U_ON:0
SET:Tail_D_ON:0
SET:Tail_R_ON:0
SET:Tail_L_ON:0
SET:back_count:0
RET:111
ENDIF
SET:reTempVar0:Tail_U_ON
LIOR:reTempVar0:Tail_D_ON
LIOR:reTempVar0:Tail_R_ON
LIOR:reTempVar0:Tail_L_ON
IF:reTempVar0:<>:0:THEN
SET:maxtime6:1
SET:Tail_U_ON:0
SET:Tail_D_ON:0
SET:Tail_R_ON:0
SET:Tail_L_ON:0
SET:back_count:0
ENDIF
IF:maxtime6:<:0:THEN
SET:maxtime6:32767
SET:Tail_U_ON:0
SET:Tail_D_ON:0
SET:Tail_R_ON:0
SET:Tail_L_ON:0
SET:back_count:0
ADD:scold:2
RET:113
ENDIF
IF:Head_Hit:>:0:THEN
ADD:scold:1
SET:Head_Hit:0
SET:back_count:0
RET:113
ENDIF
IF:Head_ON:>:0:THEN
ADD:praise:1
SET:Head_ON:0
SET:back_count:0
RET:112
ENDIF
CALL:G_VOICECMD
CASE:114:GO:AH_VOICECMD
CALL:G_YART_HearSound
IF:Context:!=:101:THEN
RET:Context
ENDIF
IF:AP_Rhythm:>:0:THEN
SET:VoiceCmd:999
SET:VoiceLevel:3
SET:VoicePitch:3
SET:VoiceHorz:0
SET:VoiceDictID:VoiceCmd
SET:AP_Rhythm:0
GO:AH_VOICECMD
ENDIF
IF:AP_Tone:>:0:THEN
CALL:G_TONECMD
CASE:1:GO:AH_VOICECMD
ENDIF
RET:100
:AH_VOICECMD
CALL:G_YART_VoiceCmd_Attention
IF:Context:!=:101:THEN
RET:Context
ENDIF
SET:back_count:0
PUSH:VoiceCmd
PUSH:9
EQ
POP:reTempVar0
PUSH:VoiceCmd
PUSH:1041
EQ
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
PUSH:VoiceDictID
PUSH:149
GE
POP:reTempVar0
PUSH:VoiceDictID
PUSH:150
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:CALL:G_INC_BOYGIRL
PUSH:VoiceDictID
PUSH:151
GE
POP:reTempVar0
PUSH:VoiceDictID
PUSH:154
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:CALL:G_DEC_BOYGIRL
RET:112
ENDIF
IF:VoiceCmd:==:1085:THEN
CALL:G_INC_BOYGIRL
RET:112
ENDIF
IF:VoiceCmd:==:1086:THEN
CALL:G_DEC_BOYGIRL
RET:112
ENDIF
IF:VoiceCmd:==:15:THEN
SET:maxtime8:60
RET:112
ENDIF
IF:VoiceCmd:==:47:THEN
PUSH:VoiceDictID
PUSH:160
GE
POP:reTempVar0
PUSH:VoiceDictID
PUSH:161
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:CALL:G_INC_BOYGIRL
PUSH:VoiceDictID
PUSH:162
GE
POP:reTempVar0
PUSH:VoiceDictID
PUSH:165
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:CALL:G_DEC_BOYGIRL
RET:113
ENDIF
IF:VoiceCmd:==:1087:THEN
CALL:G_INC_BOYGIRL
RET:113
ENDIF
IF:VoiceCmd:==:1088:THEN
CALL:G_DEC_BOYGIRL
RET:113
ENDIF
SWITCH:VoiceCmd
CASE:1:CALL:G_DEC_SAD_MOOD
CASE:25:CALL:G_DEC_SAD_MOOD
CASE:26:CALL:G_DEC_SAD_MOOD
CASE:28:RET:4
CASE:0x40F:RET:2
IF:VoiceCmd:==:22:THEN
IF:Posture1:!=:4:THEN
CALL:G_TAKE_A_PICTURE
ENDIF
RET:100
ENDIF
RET:114
:G_CLEAR_SENSORS
SET:Head_Pat:0
SET:Head_Hit:0
SET:Head_ON:0
SET:Back_ON:0
SET:Jaw_ON:0
SET:Jaw_LONG:0
SET:RFLeg_ON:0
SET:LFLeg_ON:0
SET:RRLeg_ON:0
SET:LRLeg_ON:0
RET:1
//++CALL G_DEC_HAPPY_MOOD // Decrease Happiness
:G_DEC_HAPPY_MOOD
SUB:mood_happy:1
IF:mood_happy:>:10:THEN
SET:mood_happy:10
ENDIF
IF:mood_happy:<:0:THEN
SET:mood_happy:0
ENDIF
RET:1
//++CALL G_DEC_MAD_MOOD // Decrease Anger
:G_DEC_MAD_MOOD
SUB:mood_mad:1
CALL:G_INIT_MOOD_TIMER
IF:mood_mad:>:10:THEN
SET:mood_mad:10
ENDIF
IF:mood_mad:<:0:THEN
SET:mood_mad:0
ENDIF
RET:1
//++CALL G_DEC_SAD_MOOD // Decrease Sadness
:G_DEC_SAD_MOOD
SUB:mood_sad:1
CALL:G_INIT_MOOD_TIMER
IF:mood_sad:>:10:THEN
SET:mood_sad:10
ENDIF
IF:mood_sad:<:0:THEN
SET:mood_sad:0
ENDIF
RET:1
:G_DEC_TIRED_MOOD
IF:mood_tired:<:1:THEN
SET:mood_tired:0
RET:1
ENDIF
SUB:mood_tired:1
IF:mood_tired:<:1:THEN
CALL:G_DEC_ENDURE
ENDIF
RET:1
:G_GO_BACK
CALL:G_VOICE_HIT
IF:mood_mad:>:5:THEN
PLAY:ACTION:MOVE.MOVE.SLOW:180:100
WAIT
RET:1
ENDIF
IF:mood_happy:>:5:THEN
PLAY:ACTION:MOVE.MOVE.NORMAL:180:300
WAIT
RET:1
ENDIF
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:MOVE.MOVE.SLOW:180:200
CASE:2:PLAY:ACTION:MOVE.MOVE.NORMAL:180:200
CASE:3:PLAY:ACTION:MOVE.MOVE.NORMAL:180:200
CALL:G_WAITZERO
RET:1
:G_GO_FORWARD
LOCAL:gf_temp:0
CALL:G_VOICE_HIT
WAIT:1
SET:init_wait:Wait
PUSH:Posture1
PUSH:1
EQ
POP:reTempVar0
PUSH:Posture1
PUSH:4
EQ
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
LNOT:reTempVar0:reTempVar0
IF:reTempVar0:<>:0:THEN
PLAY:ACTION:STAND
ENDIF
PLAY:ACTION:MOVE.HEAD.NORMAL:0:-15
CALL:G_WAIT
IF:mood_mad:>:5:THEN
PLAY:ACTION:MOVE.MOVE.SLOW:0:250
ELSE
IF:mood_happy:>:5:THEN
PLAY:ACTION:WALK:0:500
ELSE
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:MOVE.MOVE.SLOW:0:400
CASE:2:PLAY:ACTION:MOVE.MOVE.NORMAL:0:400
ENDIF
ENDIF
:GF_WAITLOOP
PUSH:gf_temp
PUSH:120
GT
POP:reTempVar0
PUSH:Distance
PUSH:200
LT
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
PUSH:Distance
PUSH:800
GT
POP:reTempVar2
LIOR:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:GF_STOPWALK
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:GF_STOPWALK
IF:Wait:>:0:THEN
ADD:gf_temp:1
WAIT:100
GO:GF_WAITLOOP
ENDIF
RET:1
:GF_STOPWALK
SET:init_wait:Wait
PLAY:ACTION:WALK:0:0
CALL:G_WAIT
RET:1
:G_GO_LEFT
CALL:G_VOICE_HIT
RND:pan:30:60
IF_1ST:mood_tired:>:8:1184
IF_1ST:mood_mad:>:5:1184
IF_1ST:mood_happy:<=:5:1180
RND:temp:0:100
IF_1ST:temp:<:90:1178
RND:pan:90:180
:1178
ADD:pan:45
PLAY:ACTION:MOVE.TURN.NORMAL:pan
WAIT
RET:1
:1180
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:MOVE.TURN.SLOW:pan
CASE:2:PLAY:ACTION:MOVE.TURN.NORMAL:pan
CASE:3:PLAY:ACTION:MOVE.TURN.NORMAL:pan
WAIT
RET:1
:1184
SUB:pan:20
PLAY:ACTION:MOVE.TURN.SLOW:pan
WAIT
RET:1
:G_GO_RIGHT
CALL:G_VOICE_HIT
RND:pan:-30:-60
IF_1ST:mood_tired:>:8:1200
IF_1ST:mood_mad:>:5:1200
IF_1ST:mood_happy:<=:5:1196
RND:temp:0:100
IF_1ST:temp:<:90:1194
RND:pan:-90:-180
:1194
ADD:pan:-45
PLAY:ACTION:MOVE.TURN.NORMAL:pan
WAIT
RET:1
:1196
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:MOVE.TURN.SLOW:pan
CASE:2:PLAY:ACTION:MOVE.TURN.NORMAL:pan
CASE:3:PLAY:ACTION:MOVE.TURN.NORMAL:pan
WAIT
RET:1
:1200
SUB:pan:-20
PLAY:ACTION:MOVE.TURN.SLOW:pan
WAIT
RET:1
:G_HAPPYDANCE
:1203
RND:temp:0:9
IF_1ST:temp:=:last_happydance:1203
IF_1ST:temp:=:last_happydance2:1203
WAIT:1
SET:init_wait:Wait
SWITCH:temp
CASE:0:PLAY:ACTION:O2_CUTE_SMILE1
CASE:1:PLAY:ACTION:O2_CUTE_SWING1
CASE:2:PLAY:ACTION:O2_CUTE_SWING2
CASE:3:PLAY:ACTION:O2_DANCE_STAND1
CASE:4:PLAY:ACTION:O2_DANCE_STAND2
CASE:5:PLAY:ACTION:O2_LETSPLAY1
CASE:6:PLAY:ACTION:O2_LETSPLAY2
CASE:7:PLAY:ACTION:O2_DANCE_STAND6
CASE:8:PLAY:ACTION:O2_DANCE_STAND3
CASE:9:PLAY:ACTION:O2_DANCE_STAND5
SET:last_happydance2:last_happydance
SET:last_happydance:temp
CALL:G_WAIT_AWARE
RET:1
//++CALL G_INC_HAPPY_MOOD // Increase Happiness
:G_INC_HAPPY_MOOD
IF:mood_happy:>:2:THEN
CALL:G_DEC_SAD_MOOD
ENDIF
ADD:mood_happy:1
IF:mood_happy:>:10:THEN
SET:mood_happy:10
ENDIF
IF:mood_happy:<:0:THEN
SET:mood_happy:0
ENDIF
RET:1
//++CALL G_INC_MAD_MOOD // Increase Anger
:G_INC_MAD_MOOD
IF:mood_mad:>:5:THEN
CALL:G_INC_SAD_MOOD
ENDIF
ADD:mood_mad:1
CALL:G_INIT_MOOD_TIMER
IF:mood_mad:>:10:THEN
SET:mood_mad:10
ENDIF
IF:mood_mad:<:0:THEN
SET:mood_mad:0
ENDIF
RET:1
//++CALL G_INC_SAD_MOOD // Increase Sadness
:G_INC_SAD_MOOD
ADD:mood_sad:1
CALL:G_INIT_MOOD_TIMER
IF:mood_sad:>:10:THEN
SET:mood_sad:10
ENDIF
IF:mood_sad:<:0:THEN
SET:mood_sad:0
ENDIF
RET:1
:G_KARATE_CHOP
CALL:G_VOICE_HIT
SET:rndbase:950
SET:rndcount:3
SET:lastact1:last_karateact
SET:lastact2:last_karateact
CALL:F_BEHAVIOR_RNDN
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
SWITCH:rndnum
CASE:950:PLAY:ACTION:O2_KARATE1
CASE:951:PLAY:ACTION:O2_KARATE2
CASE:952:PLAY:ACTION:O2_KARATE3
SET:last_karateact:rndnum
CALL:G_WAITZERO
ENDIF
RET:1
:G_LAZY_GOLEFT
IF:sitonly:==:0:THEN
IF:mood_happy:>:3:1275
CALL:G_RANDOM1/3
CASE:1:GO:1275
ENDIF
CALL:G_VOICE_HIT
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:MOVE.HEAD.SLOW:90:0
CASE:2:PLAY:ACTION:MOVE.HEAD.NORMAL:90:0
CASE:3:PLAY:ACTION:MOVE.HEAD.NORMAL:90:0
WAIT
RET:1
:1275
CALL:G_GO_LEFT
RET:2
:G_LAZY_GORIGHT
IF:sitonly:==:0:THEN
IF:mood_happy:>:3:1287
CALL:G_RANDOM1/3
CASE:1:GO:1287
ENDIF
CALL:G_VOICE_HIT
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:MOVE.HEAD.SLOW:-90:0
CASE:2:PLAY:ACTION:MOVE.HEAD.NORMAL:-90:0
CASE:3:PLAY:ACTION:MOVE.HEAD.NORMAL:-90:0
WAIT
RET:1
:1287
CALL:G_GO_RIGHT
RET:2
:G_NEED2REST
CALL:F_NEED2REST
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
RET:1
ENDIF
RET:2
:F_NEED2REST
PUSH:Batt_Rest
PUSH:25
LT
POP:reTempVar0
LIOR:reTempVar0:0
PUSH:Batt_Temp
PUSH:45
GT
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
PUSH:Posture1
PUSH:5
EQ
POP:reTempVar2
PUSH:Posture1
PUSH:255
EQ
POP:reTempVar3
LIOR:reTempVar2:reTempVar3
LIOR:reTempVar0:reTempVar2
PUSH:Posture1
PUSH:7
EQ
POP:reTempVar4
LIOR:reTempVar0:reTempVar4
RETURN:reTempVar0
:G_PRAISE
LOCAL:maxloop:10
CALL:G_DEC_SAD_MOOD
PUSH:mood_happy
PUSH:2
LT
POP:reTempVar0
PUSH:reTempVar0
CALL:F_RND100
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar1
PUSH:50
LT
POP:reTempVar2
IF:reTempVar0:||:reTempVar2:THEN
:reTempLbl0
RND:rndnum:0:5
SET:reTempVar0:maxloop
SUB:maxloop:1
PUSH:rndnum
PUSH:last_praiseact
NE
POP:reTempVar0
PUSH:rndnum
PUSH:last_praiseact2
NE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:maxloop
PUSH:0
LT
POP:reTempVar2
LIOR:reTempVar0:reTempVar2
IF:reTempVar0:==:0:reTempLbl0
ELSE
:reTempLbl1
RND:rndnum:100:102
SET:reTempVar0:maxloop
SUB:maxloop:1
PUSH:rndnum
PUSH:last_praiseact
NE
POP:reTempVar0
PUSH:rndnum
PUSH:last_praiseact2
NE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:maxloop
PUSH:0
LT
POP:reTempVar2
LIOR:reTempVar0:reTempVar2
IF:reTempVar0:==:0:reTempLbl1
ENDIF
WAIT:1
SET:init_wait:Wait
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_PRAISED1
CASE:1:PLAY:ACTION:O2_PRAISED2
CASE:2:PLAY:ACTION:O2_PRAISED3
CASE:3:PLAY:ACTION:O2_PRAISED4
CASE:4:PLAY:ACTION:O2_PRAISED5
CASE:5:PLAY:ACTION:O2_PRAISED6
CASE:100:PLAY:ACTION:O2_PRAISED7
CASE:101:PLAY:ACTION:O2_PRAISED8
CASE:102:PLAY:ACTION:O2_PRAISED9
SET:last_praiseact2:last_praiseact
SET:last_praiseact:rndnum
CALL:G_WAIT
CALL:G_INC_HAPPY_MOOD
CALL:G_DEC_MAD_MOOD
CALL:G_BEHAVIOR_PRAISE
RET:1
:G_PRAISE_REST
CALL:G_DEC_SAD_MOOD
IF_1ST:mood_happy:<:2:1361
IF_1ST:mood_happy:<:5:1371
IF_1ST:mood_happy:<:8:1370
CALL:G_RANDOM4
CASE:1:GO:1361
CASE:2:GO:1355
CASE:3:GO:1346
:1332
RND:rndnum:300:305
WAIT:1
SET:init_wait:Wait
IF_1ST:rndnum:=:last_praiseact:1332
IF_1ST:rndnum:=:last_praiseact2:1332
SWITCH:rndnum
CASE:300:PLAY:ACTION:O2_HAPPY_ANY7
CASE:301:PLAY:ACTION:O2_HAPPY_ANY8
CASE:302:PLAY:ACTION:O2_HAPPY_ANY9
CASE:303:PLAY:ACTION:O2_HAPPY_ANY10
CASE:304:PLAY:ACTION:O2_HAPPY_ANY11
CASE:305:PLAY:ACTION:O2_HAPPY_ANY12
:1336
SET:last_praiseact2:last_praiseact
SET:last_praiseact:rndnum
VSAVE:boygirl
CALL:G_WAIT
CALL:G_INC_HAPPY_MOOD
CALL:G_DEC_MAD_MOOD
CALL:G_BEHAVIOR_PRAISE
RET:1
:1346
RND:rndnum:200:205
WAIT:1
SET:init_wait:Wait
IF_1ST:rndnum:=:last_praiseact:1346
IF_1ST:rndnum:=:last_praiseact2:1346
SWITCH:rndnum
CASE:200:PLAY:ACTION:O2_HAPPY_ANY1
CASE:201:PLAY:ACTION:O2_HAPPY_ANY2
CASE:202:PLAY:ACTION:O2_HAPPY_ANY3
CASE:203:PLAY:ACTION:O2_HAPPY_ANY4
CASE:204:PLAY:ACTION:O2_HAPPY_ANY5
CASE:205:PLAY:ACTION:O2_HAPPY_ANY6
GO:1336
:1355
RND:rndnum:100:102
WAIT:1
SET:init_wait:Wait
IF_1ST:rndnum:=:last_praiseact:1355
IF_1ST:rndnum:=:last_praiseact2:1355
SWITCH:rndnum
CASE:100:PLAY:ACTION:O2_PRAISED7
CASE:101:PLAY:ACTION:O2_PRAISED8
CASE:102:PLAY:ACTION:O2_PRAISED9
GO:1336
:1361
RND:rndnum:0:5
WAIT:1
SET:init_wait:Wait
IF_1ST:rndnum:=:last_praiseact:1361
IF_1ST:rndnum:=:last_praiseact2:1361
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_PRAISED1
CASE:1:PLAY:ACTION:O2_PRAISED2
CASE:2:PLAY:ACTION:O2_PRAISED3
CASE:3:PLAY:ACTION:O2_PRAISED4
CASE:4:PLAY:ACTION:O2_PRAISED5
CASE:5:PLAY:ACTION:O2_PRAISED6
GO:1336
:1370
CALL:G_RANDOM3
CASE:1:GO:1361
CASE:2:GO:1355
GO:1346
:1371
CALL:G_RANDOM2
CASE:1:GO:1361
GO:1355
:G_QUERY_HUNGRY
WAIT:1
SET:init_wait:Wait
IF:Batt_Rest:>=:50:THEN
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_NO1
CASE:2:PLAY:ACTION:O2_NO2
CALL:G_WAIT_AWARE
RET:1
ENDIF
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_YES_OK1
CASE:2:PLAY:ACTION:O2_YES_OK2
CALL:G_WAIT_AWARE
CALL:G_RANDOM2
CASE:2:RET:1
IF:Batt_Rest:<:35:THEN
PLAY:ACTION:O2_HUNGRY_LOT
ELSE
PLAY:ACTION:O2_HUNGRY_LITTLE
ENDIF
CALL:G_WAIT_AWARE
RET:2
:G_QUERY_MOOD
WAIT:1
SET:init_wait:Wait
PUSH:Batt_Rest
PUSH:35
GE
POP:reTempVar0
PUSH:mood_mad
PUSH:1
LT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:mood_sad
PUSH:1
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_YES_OK1
CASE:2:PLAY:ACTION:O2_YES_OK2
CALL:G_WAIT_AWARE
RET:1
ENDIF
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_NO1
CASE:2:PLAY:ACTION:O2_NO2
CALL:G_WAIT_AWARE
RND:rndnum:0:100
IF:rndnum:<:50:THEN
RET:1
ENDIF
IF:Batt_Rest:<:35:THEN
PLAY:ACTION:O2_HUNGRY_LOT
CALL:G_WAIT
RET:1
ENDIF
IF:mood_mad:>:4:THEN
CALL:G_TANTRUM
RET:1
ENDIF
IF:mood_sad:>:4:THEN
CALL:G_SAD
RET:1
ELSE
RND:TIMER_CLEAREYES:2:5
SET:Eye_L1:1
SET:Eye_R1:1
ENDIF
RET:1
:G_QUERY_TIRED
WAIT:1
SET:init_wait:Wait
IF:mood_tired:>:5:THEN
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_YES_OK1
CASE:2:PLAY:ACTION:O2_YES_OK2
CALL:G_WAIT_AWARE
RET:1
ENDIF
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_NO1
CASE:2:PLAY:ACTION:O2_NO2
CALL:G_WAIT_AWARE
RET:1
:G_RANDOM1/3
RND:rndnum:0:100
CSET:rndnum:<:33:1
CSET:rndnum:>=:33:2
RET:Context
:G_RANDOM2
RND:rndnum:0:100
CSET:rndnum:<:50:1
CSET:rndnum:>=:50:2
RET:Context
:F_RND2
RND:rndnum:0:100
PUSH:rndnum
PUSH:50
GT
POP:reTempVar0
RETURN:reTempVar0
:G_RANDOM3
RND:rndnum:0:100
CSET:rndnum:<:33:1
CSET:rndnum:<:66:2
CSET:rndnum:>=:66:3
RET:Context
:G_RANDOM4
RND:rndnum:0:100
CSET:rndnum:<:25:1
CSET:rndnum:<:50:2
CSET:rndnum:<:75:3
CSET:rndnum:>=:75:4
RET:Context
:G_RANDOM6
RND:rndnum:0:60
CSET:rndnum:<:10:1
CSET:rndnum:<:20:2
CSET:rndnum:<:30:3
CSET:rndnum:<:40:4
CSET:rndnum:<:50:5
CSET:rndnum:>=:50:6
RET:Context
:G_SAD
RND:rndnum:0:13
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_SAD_ANY1
CASE:1:PLAY:ACTION:O2_SAD_ANY2
CASE:2:PLAY:ACTION:O2_SAD_ANY3
CASE:3:PLAY:ACTION:O2_SAD_ANY4
CASE:4:PLAY:ACTION:O2_SAD_ANY5
CASE:5:PLAY:ACTION:O2_SAD_ANY6
CASE:6:PLAY:ACTION:O2_SAD_ANY7
CASE:7:PLAY:ACTION:O2_SAD_ANY8
CASE:8:PLAY:ACTION:O2_SAD_ANY9
CASE:9:PLAY:ACTION:O2_SAD_ANY10
CASE:10:PLAY:ACTION:O2_SAD_ANY11
CASE:11:PLAY:ACTION:O2_SAD_ANY12
CASE:12:PLAY:ACTION:O2_SAD_ANY13
CASE:13:PLAY:ACTION:O2_SAD_ANY14
CALL:G_WAIT
RET:1
:G_SCOLD
:1496
IF_1ST:mood_mad:<=:5:1514
RND:rndnum:0:23
:4109
WAIT:1
SET:init_wait:Wait
IF_1ST:rndnum:=:last_scoldact:1496
IF_1ST:rndnum:=:last_scoldact2:1496
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_SCOLDED1
CASE:1:PLAY:ACTION:O2_SCOLDED2
CASE:2:PLAY:ACTION:O2_SCOLDED3
CASE:3:PLAY:ACTION:O2_SCOLDED4
CASE:4:PLAY:ACTION:O2_SCOLDED5
CASE:5:PLAY:ACTION:O2_SCOLDED6
CASE:6:PLAY:ACTION:O2_SCOLDED7
CASE:7:PLAY:ACTION:O2_SCOLDED8
CASE:8:PLAY:ACTION:O2_SCOLDED9
SET:last_scoldact2:last_scoldact
SET:last_scoldact:rndnum
CALL:G_WAIT
CALL:G_INC_MAD_MOOD
CALL:G_DEC_HAPPY_MOOD
CALL:G_BEHAVIOR_SCOLD
RET:1
:1514
RND:rndnum:0:8
GO:4109
:G_SCOLD_REST
:1517
IF_1ST:mood_mad:<=:5:1555
CALL:G_RANDOM1/3
CASE:1:GO:1551
:1519
RND:rndnum:0:23
:4110
WAIT:1
SET:init_wait:Wait
IF_1ST:rndnum:=:last_scoldact:1517
IF_1ST:rndnum:=:last_scoldact2:1517
IF_1ST:rndnum:<:10:1541
SWITCH:rndnum
CASE:9:PLAY:ACTION:O2_MAD_ANY1
CASE:10:PLAY:ACTION:O2_MAD_ANY2
CASE:11:PLAY:ACTION:O2_MAD_ANY3
CASE:12:PLAY:ACTION:O2_MAD_ANY4
CASE:13:PLAY:ACTION:O2_MAD_ANY5
CASE:14:PLAY:ACTION:O2_MAD_ANY6
CASE:15:PLAY:ACTION:O2_MAD_ANY7
CASE:16:PLAY:ACTION:O2_MAD_ANY8
CASE:17:PLAY:ACTION:O2_MAD_ANY9
CASE:18:PLAY:ACTION:O2_MAD_ANY10
CASE:19:PLAY:ACTION:O2_MAD_ANY11
CASE:20:PLAY:ACTION:O2_MAD_ANY12
CASE:21:PLAY:ACTION:O2_MAD_ANY13
CASE:22:PLAY:ACTION:O2_MAD_ANY14
:1523
SET:last_scoldact2:last_scoldact
SET:last_scoldact:rndnum
VSAVE:boygirl
CALL:G_WAIT
CALL:G_INC_MAD_MOOD
CALL:G_DEC_HAPPY_MOOD
CALL:G_BEHAVIOR_SCOLD
RET:1
:1541
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_SCOLDED1
CASE:1:PLAY:ACTION:O2_SCOLDED2
CASE:2:PLAY:ACTION:O2_SCOLDED3
CASE:3:PLAY:ACTION:O2_SCOLDED4
CASE:4:PLAY:ACTION:O2_SCOLDED5
CASE:5:PLAY:ACTION:O2_SCOLDED6
CASE:6:PLAY:ACTION:O2_SCOLDED7
CASE:7:PLAY:ACTION:O2_SCOLDED8
CASE:8:PLAY:ACTION:O2_SCOLDED9
GO:1523
:1551
IF_1ST:Posture1:<>:1:1519
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_BEENHIT1
CASE:2:PLAY:ACTION:O2_BEENHIT2
SET:rndnum:999
GO:1523
:1555
RND:rndnum:0:8
GO:4110
:G_STAND4BALL
PUSH:sitonly
PUSH:0
GT
POP:reTempVar0
PUSH:mood_tired
PUSH:9
GE
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
RET:115
ENDIF
CALL:G_STOP_HEADTAIL
IF:Posture1:==:2:THEN
PLAY:ACTION:TRACK_HEAD:PINK_BALL
WAIT:1000
SET:init_wait:Wait
PLAY:ACTION:stand_straight
CALL:G_WAIT
CALL:G_STOP_HEAD
ELSE
SET:pan:Head_Pan
SET:tilt:Head_Tilt
SUB:tilt:15
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:STAND
CALL:G_WAIT
PLAY:ACTION:MOVE.HEAD.NORMAL:pan:tilt
CALL:G_WAIT
ENDIF
IF:Pink_Ball:>:0:THEN
RET:107
ENDIF
CALL:G_SOCCER_SEARCH4BALL
CASE:1:RET:102
CASE:2:RET:107
RET:100
:G_START_TAILWAG_SLOW
RET:1
:G_START_TAILWAG_NORMAL
RET:1
:G_START_TAILWAG_FAST
RET:1
:G_STOP_TAILWAG
SET:tailwag:0
RET:1
:G_SURPRISE
RND:rndnum:0:12
WAIT:1
SET:init_wait:Wait
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_SURPRISE_ANY1
CASE:1:PLAY:ACTION:O2_SURPRISE_ANY2
CASE:2:PLAY:ACTION:O2_SURPRISE_ANY3
CASE:3:PLAY:ACTION:O2_SURPRISE_ANY4
CASE:4:PLAY:ACTION:O2_SURPRISE_ANY5
CASE:5:PLAY:ACTION:O2_SURPRISE_ANY6
CASE:6:PLAY:ACTION:O2_SURPRISE_ANY7
CASE:7:PLAY:ACTION:O2_SURPRISE_ANY8
CASE:8:PLAY:ACTION:O2_SURPRISE_ANY9
CASE:9:PLAY:ACTION:O2_SURPRISE_ANY10
CASE:10:PLAY:ACTION:O2_SURPRISE_ANY11
CASE:11:PLAY:ACTION:O2_SURPRISE_ANY12
CASE:12:PLAY:ACTION:O2_SURPRISE_ANY13
CALL:G_WAIT
RET:1
:G_TAKE_A_PICTURE
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:MOVE.HEAD.NORMAL:Head_Pan:0
CALL:G_WAIT_AWARE
PLAY:ACTION:O2_PHOTOSNAP
AP_SNAPSHOT
CALL:G_WAIT_AWARE
:3067
IF:AP_Snap_Ready:<=:0:THEN
WAIT:1
GO:3067
ENDIF
VLOAD:snapNum
AP_SAVEIMAGE:snapNum
ADD:snapNum:1
LAND:snapNum:7
VSAVE:snapNum
PLAY:ACTION+:happy_eyes
CALL:G_WAIT_AWARE
RET:1
:F_RECORD_NAME
ARG:vcmd_id
LOCAL:count
LOCAL:timeout
SET:timeout:100
SET:Back_ON:0
SET:Head_ON:0
:reTempLbl2
SET:reTempVar0:Head_ON
LNOT:reTempVar0:reTempVar0
SET:reTempVar1:Back_ON
LNOT:reTempVar1:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
WAIT:100
SUB:timeout:1
IF:timeout:==:0:THEN
SET:Horn_B:0
RETURN:1
ENDIF
SET:reTempVar0:timeout
AND:reTempVar0:3
IF:reTempVar0:==:0:THEN
SET:reTempVar0:timeout
AND:reTempVar0:4
SET:Horn_B:reTempVar0
ENDIF
GO:reTempLbl2
ENDIF
SET:Warn:1
SET:Horn_B:0
SET:timeout:100
SET:count:0
:reTempLbl3
SET:AP_VoiceRec_Result:-1
WAIT:100
AP_VOICEREC:vcmd_id
:reTempLbl4
WAIT:100
IF:timeout:&:3:THEN
SET:reTempVar0:timeout
AND:reTempVar0:4
SET:Horn_B:reTempVar0
LNOT:reTempVar0:reTempVar0
SET:Horn_O:reTempVar0
ENDIF
PUSH:AP_VoiceRec_Result
PUSH:-1
GT
POP:reTempVar0
SUB:timeout:1
PUSH:timeout
PUSH:0
LE
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
IF:reTempVar0:==:0:reTempLbl4
PUSH:AP_VoiceRec_Result
PUSH:1
EQ
POP:reTempVar0
PUSH:AP_VoiceRec_Result
PUSH:100
EQ
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
:reTempLbl5
WAIT:100
IF:timeout:&:3:THEN
SET:reTempVar0:timeout
AND:reTempVar0:4
SET:Horn_B:reTempVar0
LNOT:reTempVar0:reTempVar0
SET:Horn_O:reTempVar0
ENDIF
SUB:timeout:1
IF:timeout:>:0:reTempLbl5
SET:Horn_O:0
SET:Horn_B:0
SET:Warn:0
IF:AP_VoiceRec_Result:==:100:THEN
RETURN:0
ENDIF
RETURN:1
ENDIF
ADD:count:1
PUSH:count
PUSH:10
GE
POP:reTempVar0
PUSH:timeout
PUSH:0
LE
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
IF:reTempVar0:==:0:reTempLbl3
SET:Horn_O:0
SET:Horn_B:0
SET:Warn:0
RETURN:0
:F_PLAYBACK_NAME
ARG:vcmd_id
LOCAL:syn_size
AP_GETSYNVOICE:syn_voice:syn_size:vcmd_id
IF:syn_size:<=:0:THEN
RETURN:0
ENDIF
SET:AP_Replay_Result_Mode:0
INIT:MTN
CALL:G_WAITZERO
SET:AP_SynBite_Mode:1
AP_SETARRAYASRAM:syn_voice:0:syn_size
LOAD:SND:ram
CALL:G_WAITZERO
PLAY:MTN
CALL:G_WAITZERO
SET:AP_Use_Ram:0
SET:AP_SynBite_Mode:0
RETURN:1
:G_NAME_REGISTRATION
AP_GET:reTempVar0:behavior:31
LNOT:reTempVar0:reTempVar0
IF:reTempVar0:<>:0:THEN
PLAY:ACTION:O2_BEG_PET1
CALL:G_WAITZERO
PUSH:1
CALL:F_RECORD_NAME:1
POP:reTempVar0
IF:reTempVar0:<>:0:G_PLAYBACK_AIBONAME
ENDIF
PLAY:ACTION:O2_NOTHANKS
GO:G_WAITZERO
:G_OWNER_REGISTRATION
AP_GET:reTempVar0:behavior:31
LNOT:reTempVar0:reTempVar0
IF:reTempVar0:<>:0:THEN
PLAY:ACTION:O2_BEG_PET3
CALL:G_WAITZERO
PLAY:ACTION:LIE
CALL:G_WAITZERO
PUSH:256
CALL:F_RECORD_NAME:1
POP:reTempVar0
IF:reTempVar0:<>:0:G_PLAYBACK_OWNERNAME
ENDIF
PLAY:ACTION:O2_NOTHANKS
GO:G_WAITZERO
:G_PLAYBACK_AIBONAME
PUSH:1
CALL:F_PLAYBACK_NAME:1
POP:reTempVar0
RET:1
:G_PLAYBACK_OWNERNAME
PUSH:256
CALL:F_PLAYBACK_NAME:1
POP:reTempVar0
RET:1
:G_TANTRUM
WAIT:1
SET:init_wait:Wait
RND:rndnum:0:100
CSET:rndnum:<:10:1
CSET:rndnum:<:20:2
CSET:rndnum:<:30:3
CSET:rndnum:<:40:4
CSET:rndnum:<:50:5
CSET:rndnum:<:60:6
CSET:rndnum:<:70:7
CSET:rndnum:<:80:8
CSET:rndnum:<:90:9
CSET:rndnum:>=:90:10
CASE:1:PLAY:ACTION:O2_TEMPER_TANTRUM1
CASE:2:PLAY:ACTION:O2_TEMPER_TANTRUM2
CASE:3:PLAY:ACTION:O2_TEMPER_TANTRUM3
CASE:4:PLAY:ACTION:O2_TEMPER_TANTRUM4
CASE:5:PLAY:ACTION:O2_TEMPER_TANTRUM5
CASE:6:PLAY:ACTION:O2_TEMPER_TANTRUM6
CASE:7:PLAY:ACTION:O2_TEMPER_TANTRUM7
CASE:8:PLAY:ACTION:O2_CUTE_EXERCISE5
CASE:9:PLAY:ACTION:O2_CUTE_EXERCISE6
CASE:10:PLAY:ACTION:O2_AIBOZYA
CALL:G_WAIT
RET:1
:G_TONECMD
WAIT:1
IF_1ST:rcodeplus:>:0
IF_AND:AP_Tone:>:0:3110
RET:2
:3110
WAIT:1
SET:ToneCmd:AP_Tone
SET:AP_Tone:0
WAIT:1
SWITCH:ToneCmd
CASE:11:SET:VoiceCmd:27
CASE:12:SET:VoiceCmd:8
CASE:13:SET:VoiceCmd:36
CASE:23:SET:VoiceCmd:39
CASE:24:SET:VoiceCmd:24
CASE:25:SET:VoiceCmd:5
CASE:28:SET:VoiceCmd:34
CASE:29:SET:VoiceCmd:40
CASE:ELSE:RET:2
RET:1
:G_TWITCH_EARS
WAIT:1
SET:init_wait:Wait
IF:AiboType:==:210:THEN
RND:rndnum:0:100
IF:rndnum:<:33:THEN
SWITCH:VoiceHorz
CASE:2:PLAY:ACTION:O2_RIGHT_EAR_TWITCH3
CASE:4:PLAY:ACTION:O2_RIGHT_EAR_TWITCH3
CASE:8:PLAY:ACTION:O2_RIGHT_EAR_TWITCH3
CASE:32:PLAY:ACTION:O2_LEFT_EAR_TWITCH3
CASE:64:PLAY:ACTION:O2_LEFT_EAR_TWITCH3
CASE:128:PLAY:ACTION:O2_LEFT_EAR_TWITCH3
CASE:ELSE:PLAY:ACTION:O2_BOTH_EAR_TWITCH3
ELSE
PLAY:ACTION:O2_BOTH_EAR_TWITCH3
ENDIF
ELSE
PLAY:MWCID:4359
ENDIF
CALL:G_WAIT_AWARE
RET:1
:G_VOICE_HIT
CALL:G_TWITCH_EARS
CALL:G_STOP_TAILWAG
RET:1
:G_VOICECMD
LOCAL:hhit:0
WAIT:1
IF:AP_Voice_Cmd:==:0:THEN
RET:100
ENDIF
SET:reTempVar0:AP_Voice_Cmd
ADD:reTempVar0:base_voice_cmd
SET:VoiceCmd:reTempVar0
SET:VoiceLevel:AP_Voice_Level
SET:VoicePitch:AP_Voice_Pitch
SET:VoiceHorz:AP_Voice_Horz
SET:VoiceDictID:AP_Voice_DicID
SET:AP_Voice_Cmd:0
IF:VoiceLevel:<:2:THEN
SET:VoiceCmd:0
SET:VoiceLevel:0
RET:100
ENDIF
SWITCH:VoiceCmd
CASE:0x401:SET:VoiceCmd:1
CASE:0x402:SET:VoiceCmd:32
CASE:0x403:SET:VoiceCmd:18
CASE:0x404:SET:VoiceCmd:2
CASE:0x405:SET:VoiceCmd:12
CASE:0x406:SET:VoiceCmd:19
CASE:0x407:SET:VoiceCmd:13
CASE:0x412:SET:VoiceCmd:28
CASE:0x413:SET:VoiceCmd:3
CASE:0x415:SET:VoiceCmd:29
CASE:0x417:SET:VoiceCmd:37
CASE:0x41E:SET:VoiceCmd:27
CASE:0x41F:SET:VoiceCmd:36
CASE:0x420:SET:VoiceCmd:8
CASE:0x421:SET:VoiceCmd:40
CASE:0x422:SET:VoiceCmd:34
CASE:0x423:SET:VoiceCmd:39
CASE:0x424:SET:VoiceCmd:5
CASE:0x426:SET:VoiceCmd:24
CASE:0x437:SET:VoiceCmd:22
CASE:0x438:SET:VoiceCmd:14
CASE:0x439:SET:VoiceCmd:52
CASE:0x43A:SET:VoiceCmd:30
CASE:0x43B:SET:VoiceCmd:11
CASE:0x43C:SET:VoiceCmd:31
CASE:0x442:SET:VoiceCmd:21
CASE:0x436:SET:VoiceCmd:26
SET:maxtime12:20
AP_SCANCOUNT:vhcount:voicehist:0:4:VoiceDictID
AP_BMOVE:voicehist:0:1:3
AP_SET:VoiceDictID:voicehist:0
IF:vhcount:>:1:THEN
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:50:THEN
SET:VoiceCmd:0
SET:VoiceLevel:0
RET:100
ENDIF
ENDIF
SWITCH:VoiceCmd
CASE:12:SET:hhit:1
CASE:13:SET:hhit:1
CASE:33:SET:hhit:1
CASE:1:SET:hhit:1
CASE:19:SET:hhit:1
CASE:18:SET:hhit:1
CASE:0x40B:SET:hhit:1
CASE:0x41D:SET:hhit:1
CASE:0x40A:SET:hhit:1
CASE:0x408:SET:hhit:1
IF:hhit:<>:0:THEN
IF:maxtime11:>:0:THEN
SET:VoiceCmd:0
SET:VoiceLevel:0
RET:100
ELSE
SET:maxtime11:20
ENDIF
ENDIF
RET:114
:G_WAIT_ATTENTION
SET:reTempVar0:praise
ADD:reTempVar0:scold
IF:reTempVar0:>:0:THEN
RET:1
ENDIF
IF:Head_ON:<>:0:THEN
IOR:praise:1
SET:Head_ON:0
SET:back_count:0
ENDIF
IF:Head_Hit:<>:0:THEN
IOR:scold:1
SET:Head_Hit:0
SET:back_count:0
ENDIF
IF:Back_ON:<>:0:THEN
IOR:praise:2
SET:Back_ON:0
ADD:back_count:1
ENDIF
IF:Jaw_ON:<>:0:THEN
IOR:praise:4
SET:Jaw_ON:0
SET:back_count:0
ENDIF
IF:AP_Voice_Cmd:!=:0:THEN
IF:AP_Voice_Level:<:2:THEN
SET:AP_Voice_Cmd:0
ELSE
SET:reTempVar0:AP_Voice_Cmd
ADD:reTempVar0:base_voice_cmd
SWITCH:reTempVar0
CASE:9:GO:WA_GOODBOT
CASE:0x411:GO:WA_GOODBOT
CASE:28:GO:WA_BADBOT
CASE:47:GO:WA_BADBOT
CASE:0x40F:GO:WA_GOODBOT
CASE:0x43D:GO:WA_GOODBOT
CASE:0x43E:GO:WA_GOODBOT
CASE:0x43F:GO:WA_BADBOT
CASE:0x440:GO:WA_BADBOT
ENDIF
ENDIF
:WA_CHECK_ATTENTION
IF:praise:>:0:WA_PRAISE
IF:scold:>:0:WA_SCOLD
RET:1
:WA_SCOLD
RND:rndnum:0:8
IF_1ST:rndnum:=:last_scoldact:WA_SCOLD
IF_1ST:rndnum:=:last_scoldact2:WA_SCOLD
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_SCOLDED1
CASE:1:PLAY:ACTION:O2_SCOLDED2
CASE:2:PLAY:ACTION:O2_SCOLDED3
CASE:3:PLAY:ACTION:O2_SCOLDED4
CASE:4:PLAY:ACTION:O2_SCOLDED5
CASE:5:PLAY:ACTION:O2_SCOLDED6
CASE:6:PLAY:ACTION:O2_SCOLDED7
CASE:7:PLAY:ACTION:O2_SCOLDED8
CASE:8:PLAY:ACTION:O2_SCOLDED9
SET:last_scoldact2:last_scoldact
SET:last_scoldact:rndnum
RET:1
:WA_PRAISE
RND:rndnum:0:8
IF_1ST:rndnum:=:last_praiseact:WA_PRAISE
IF_1ST:rndnum:=:last_praiseact2:WA_PRAISE
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_PRAISED1
CASE:1:PLAY:ACTION:O2_PRAISED2
CASE:2:PLAY:ACTION:O2_PRAISED3
CASE:3:PLAY:ACTION:O2_PRAISED4
CASE:4:PLAY:ACTION:O2_PRAISED5
CASE:5:PLAY:ACTION:O2_PRAISED6
CASE:6:PLAY:ACTION:O2_PRAISED7
CASE:7:PLAY:ACTION:O2_PRAISED8
CASE:8:PLAY:ACTION:O2_PRAISED9
SET:last_praiseact2:last_praiseact
SET:last_praiseact:rndnum
RET:1
:WA_BADBOT
IOR:scold:8
SET:back_count:0
GO:WA_CHECK_ATTENTION
:WA_GOODBOT
IOR:praise:8
SET:back_count:0
GO:WA_CHECK_ATTENTION
:G_WAIT
LOCAL:w_temp:0
CALL:G_UPDATE_PAUSEBAR
:reTempLbl6
WAIT:250
PUSH:Wait
PUSH:0
LE
POP:reTempVar0
PUSH:Wait
PUSH:init_wait
LE
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
ADD:w_temp:1
PUSH:w_temp
PUSH:120
GE
POP:reTempVar2
LIOR:reTempVar0:reTempVar2
IF:reTempVar0:==:0:reTempLbl6
RET:1
:G_WAITZERO
LOCAL:wz_temp:0
:reTempLbl7
WAIT:250
PUSH:Wait
PUSH:0
LE
POP:reTempVar0
ADD:wz_temp:1
PUSH:wz_temp
PUSH:120
GE
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
IF:reTempVar0:==:0:reTempLbl7
RET:1
:G_WAIT_AWARE
LOCAL:wa_temp:0
CALL:G_UPDATE_PAUSEBAR
SET:praise:0
SET:scold:0
:reTempLbl8
ADD:wa_temp:1
WAIT:250
CALL:G_WAIT_ATTENTION
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Wait
PUSH:init_wait
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:wa_temp
PUSH:120
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:reTempLbl8
IF:praise:>:0:THEN
SET:Head_ON:0
SET:Back_ON:0
SET:Jaw_ON:0
ENDIF
IF:scold:>:0:THEN
SET:Head_Hit:0
ENDIF
PUSH:praise
PUSH:8
GE
POP:reTempVar0
PUSH:scold
PUSH:8
GE
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
SET:AP_Voice_Cmd:0
ENDIF
RET:1
:G_TAIL_TWEAKED
LOCAL:tt_temp:0
WAIT:1
PUSH:Tail_Pan
PUSH:15
LE
POP:reTempVar0
PUSH:Tail_Pan
PUSH:-15
GE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
RET:1
ENDIF
WAIT:1
PUSH:tailwag
PUSH:0
EQ
POP:reTempVar0
PUSH:Wait
PUSH:4
GE
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
RET:1
ENDIF
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:33:THEN
IF:mood_happy:>:5:THEN
SUB:mood_happy:2
RET:2
ENDIF
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:50:THEN
RET:3
ENDIF
SET:VoiceCmd:50
RET:4
ENDIF
WAIT:1
SET:tailwag:-1
SET:init_tailwait:Wait
PLAY:ACTION:O2_TAILWAG_HORZ3
WAIT:1000
PLAY:ACTION:PALONE.AUTO.TAILSTOP
:reTempLbl9
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Wait
PUSH:init_tailwait
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:tt_temp
PUSH:120
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
ADD:tt_temp:1
WAIT:250
GO:reTempLbl9
ENDIF
RET:1
:G_STOP_HEAD
LOCAL:init_stopwait
LOCAL:sh_temp:0
WAIT:1
SET:init_stopwait:Wait
PLAY:ACTION:MOVE.HEAD.NORMAL:Head_Pan:Head_Tilt
:reTempLbl10
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Wait
PUSH:init_stopwait
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:sh_temp
PUSH:120
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
ADD:sh_temp:1
WAIT:250
GO:reTempLbl10
ENDIF
RET:1
:G_STOP_HEADTAIL
CALL:G_STOP_HEAD
CALL:G_STOP_TAILWAG
RET:1
:F_ABS
ARG:value
IF:value:<:0:THEN
SET:reTempVar0:value
MUL:reTempVar0:-1
RETURN:reTempVar0
ELSE
RETURN:value
ENDIF
:F_SIGN
ARG:value
CSET:value:<:0:-1
CSET:value:==:0:0
CSET:value:>:0:1
RETURN:Context
:F_FAVCOLOR
LOCAL:temp
AP_COLORLVL:4:temp
CSET:temp:<:25:0
CSET:temp:>=:25:1
RETURN:Context
:F_UNFAVCOLOR
LOCAL:temp
AP_COLORLVL:5:temp
CSET:temp:<:25:0
CSET:temp:>=:25:1
RETURN:Context
:F_RND
ARG:start
ARG:end
LOCAL:f_temp
RND:f_temp:start:end
RETURN:f_temp
:F_RND100
LOCAL:f_temp
RND:f_temp:0:100
RETURN:f_temp
:G_STAND_UP
CALL:G_VOICE_HIT
WAIT:1
IF:sitonly:>:0:THEN
RET:115
ENDIF
PUSH:Posture1
PUSH:2
NE
POP:reTempVar0
PUSH:mood_tired
PUSH:5
GT
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
PUSH:mood_mad
PUSH:2
GT
POP:reTempVar2
LIOR:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
PLAY:ACTION:STAND
CALL:G_WAITZERO
RET:105
ENDIF
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:STAND
CASE:2:PLAY:ACTION:stand_quick
CALL:G_WAITZERO
RET:105
:G_SIT_DOWN
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:50:THEN
PLAY:ACTION:SIT
ELSE
PLAY:ACTION+:sit_quick
ENDIF
GO:G_WAITZERO
:G_INC_BOYGIRL
ADD:boygirl:1
IF:boygirl:>:3:THEN
SET:boygirl:3
ENDIF
RET:1
:G_DEC_BOYGIRL
SUB:boygirl:1
IF:boygirl:<:-3:THEN
SET:boygirl:-3
ENDIF
RET:1
:F_SEE_BALL
WAIT:1
IF:sitonly:>:0:THEN
RETURN:115
ENDIF
IF:Pink_Ball:==:0:THEN
RETURN:100
ENDIF
PUSH:soccer
PUSH:25
LT
POP:reTempVar0
PUSH:endure
PUSH:10
LT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:maxtime8
PUSH:0
LE
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
PUSH:mood_tired
PUSH:4
LT
POP:reTempVar0
PUSH:mood_mad
PUSH:3
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_DEC_SAD_MOOD
GO:F_SEE_TOWER
ELSE
RETURN:115
ENDIF
ENDIF
PUSH:soccer
PUSH:25
LT
POP:reTempVar0
PUSH:maxtime8
PUSH:0
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:soccer
PUSH:50
LT
POP:reTempVar2
PUSH:maxtime8
PUSH:0
LE
POP:reTempVar3
LAND:reTempVar2:reTempVar3
IF:reTempVar0:||:reTempVar2:THEN
PUSH:mood_tired
PUSH:6
LT
POP:reTempVar0
PUSH:mood_mad
PUSH:5
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_DEC_SAD_MOOD
GO:F_SEE_TOWER
ELSE
RETURN:115
ENDIF
ENDIF
PUSH:soccer
PUSH:50
LT
POP:reTempVar0
PUSH:maxtime8
PUSH:0
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:soccer
PUSH:75
LT
POP:reTempVar2
PUSH:maxtime8
PUSH:0
LE
POP:reTempVar3
LAND:reTempVar2:reTempVar3
IF:reTempVar0:||:reTempVar2:THEN
PUSH:mood_tired
PUSH:8
LT
POP:reTempVar0
PUSH:mood_mad
PUSH:6
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_DEC_SAD_MOOD
GO:F_SEE_TOWER
ELSE
RETURN:115
ENDIF
ENDIF
PUSH:mood_tired
PUSH:9
LT
POP:reTempVar0
PUSH:mood_mad
PUSH:8
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_DEC_SAD_MOOD
GO:F_SEE_TOWER
ENDIF
RETURN:115
:F_SEE_TOWER
:F_SEETOWER_SLEEPPOS
RETURN:107
:G_INC_ENDURE
IF:mood_tired:>:5:THEN
ADD:endure:2
IF:endure:>:50:THEN
SET:endure:50
ENDIF
VSAVE:endure
ENDIF
RET:1
:G_DEC_ENDURE
IF:mood_tired:<:5:THEN
SUB:endure:1
IF:endure:<:1:THEN
SET:endure:1
ENDIF
VSAVE:endure
ENDIF
RET:1
:G_SHUDDER
PUSH:mood_happy
PUSH:3
GT
POP:reTempVar0
PUSH:mood_mad
PUSH:1
LT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:reTempVar0
PUSH:reTempVar1
CALL:F_RND100
POP:reTempVar2
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar2
PUSH:20
LT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
PLAY:ACTION+:shudder
CALL:G_WAITZERO
RET:1
ENDIF
RET:2
:G_WALK_REQUEST
CALL:G_VOICE_HIT
IF:mood_mad:>:5:THEN
CALL:G_TANTRUM
RET:2
ENDIF
IF:sitonly:<=:0:THEN
IF:mood_tired:<=:4:THEN
RET:1
ENDIF
PUSH:mood_tired
PUSH:9
LT
POP:reTempVar0
PUSH:mood_mad
PUSH:1
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
IF:mood_happy:>=:3:THEN
CALL:G_INC_ENDURE
RET:1
ENDIF
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:66:THEN
RET:1
ENDIF
ENDIF
ENDIF
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_NO1
CASE:2:PLAY:ACTION:O2_NO2
CALL:G_WAITZERO
RET:2
:G_CHECK_STAYSIT
IF:sitonly:>:0:THEN
CALL:G_TWITCH_EARS
SET:init_wait:Wait
RND:rndnum:1:4
SWITCH:rndnum
CASE:1:PLAY:ACTION:O2_NOTHANKS
CASE:2:PLAY:ACTION:O2_NOT_ME
CASE:3:PLAY:ACTION:O2_NOWAY1
CASE:4:PLAY:ACTION:O2_NOWAY2
CALL:G_WAIT
RET:115
ENDIF
RET:100
:G_CHECK_SITONLY
IF:sitonly:>:0:THEN
RND:rndnum:0:100
IF:rndnum:<:50:THEN
RET:104
ELSE
RET:103
ENDIF
ENDIF
RET:100
:G_UPDATE_PAUSEBAR
SET:Warn:sitonly
WAIT:32
RET:1
HALT
:RCR_Init
ARG:_doPrint
SET:rcr_doPrint:_doPrint
IF:rcr_doPrint:!=:0:THEN
ENDIF
RETURN
:RCR_MoveHeadFast
ARG:pan
ARG:tilt
LOCAL:joints
AP_NEWARRAY:joints:2
AP_SETW:joints:0:tilt:pan
:reTempLbl11
AP_MOVEJOINTS:joints:0:3074:4
IF:AP_Move_Result:==:-1:reTempLbl11
AP_FREEARRAY:joints
RETURN
:RCR_PlaySynVoice
ARG:vcmd_id
LOCAL:syn_array
AP_NEWARRAY:syn_array:1000
LOCAL:syn_size
AP_GETSYNVOICE:syn_array:syn_size:vcmd_id
IF:syn_size:<=:0:THEN
RET:-1
ENDIF
LOCAL:bite_me:0
IF:AiboType:==:210:THEN
SET:bite_me:1
ENDIF
IF:rcr_doPrint:!=:0:THEN
ENDIF
PUSH:syn_array
PUSH:syn_size
PUSH:bite_me
CALL:RCR_PlaySynVoiceFromArray:3
AP_FREEARRAY:syn_array
RET:1
:RCR_PlaySynVoiceFromArray
ARG:syn_array
ARG:syn_array_size
ARG:bite_me
SET:AP_Replay_Result_Mode:0
IF:Wait:>:0:THEN
SET:Wait:0
ENDIF
INIT:MTN
WAIT
IF:bite_me:!=:0:THEN
SET:AP_SynBite_Mode:3
ELSE
SET:AP_SynBite_Mode:1
ENDIF
AP_SETARRAYASRAM:syn_array:0:syn_array_size
LOAD:SND:ram
WAIT
PLAY:MTN
WAIT
SET:AP_Use_Ram:0
SET:AP_SynBite_Mode:0
RETURN
:RCR_RecordVcmd
ARG:vcmd_id
IF:rcr_doPrint:!=:0:THEN
ENDIF
LOCAL:tries
FOR:tries:1:5
SET:Warn:1
AP_VOICEREC:vcmd_id
:reTempLbl12
IF:AP_VoiceRec_Result:==:-1:THEN
WAIT:10
GO:reTempLbl12
ENDIF
SET:Warn:0
IF:AP_VoiceRec_Result:==:1:THEN
IF:rcr_doPrint:!=:0:THEN
ENDIF
RET:1
ELSE
IF:AP_VoiceRec_Result:==:100:THEN
IF:rcr_doPrint:!=:0:THEN
ENDIF
RET:-1
ENDIF
ENDIF
NEXT
IF:rcr_doPrint:!=:0:THEN
ENDIF
RET:-1
:RCR_TakeAPicture
AP_SNAPSHOT
PLAY:ACTION:O2_PHOTOSNAP
WAIT
:reTempLbl13
WAIT:50
IF:AP_Snap_Ready:==:0:reTempLbl13
SET:Warn:1
LOCAL:picnum
VLOAD:picnum
AP_SAVEIMAGE:picnum
ADD:picnum:1
VSAVE:picnum
SET:Warn:0
RETURN
:RCR_SayDogsName
PUSH:1
CALL:RCR_PlaySynVoice:1
RETURN
:RCR_RecordDogsName
SET:Context:-55
PUSH:1
CALL:RCR_RecordVcmd:1
IF:rcr_doPrint:!=:0:THEN
ENDIF
IF:Context:==:1:THEN
CALL:RCR_SayDogsName
ELSE
PLAY:ACTION:WAVE_ERROR_SIT
WAIT
ENDIF
RETURN
:RCR_SayOwnersName
PUSH:256
CALL:RCR_PlaySynVoice:1
RETURN
:RCR_RecordOwnersName
SET:Context:-55
PUSH:256
CALL:RCR_RecordVcmd:1
IF:rcr_doPrint:!=:0:THEN
ENDIF
IF:Context:==:1:THEN
CALL:RCR_SayOwnersName
ELSE
PLAY:ACTION:WAVE_ERROR_SIT
WAIT
ENDIF
RETURN
:RCR_CheesyMimicMode
LOCAL:vcmd_id:257
LOCAL:mimic_count
FOR:mimic_count:1:10
SET:Warn:1
WAIT:250
SET:Warn:0
AP_VOICEREC:vcmd_id
:reTempLbl14
IF:AP_VoiceRec_Result:==:-1:THEN
WAIT:10
GO:reTempLbl14
ENDIF
IF:AP_VoiceRec_Result:==:1:THEN
PUSH:vcmd_id
CALL:RCR_PlaySynVoice:1
ENDIF
NEXT
RETURN
:G_GOTYART
IF:Posture1:==:4:THEN
PLAY:ACTION:STOP_WALK
ENDIF
PLAY:ACTION:MOVE.HEAD.NORMAL:Head_Pan:Head_Tilt
CALL:G_STOP_TAILWAG
CALL:G_WAITZERO
SET:init_wait:Wait
SET:result:116
RET:1
:G_YART_VOICEDONE
IF:result:==:116:THEN
SET:VoiceCmd:0
ENDIF
:G_YART_DONE
IF:result:==:116:THEN
CALL:G_WAIT
SWITCH:Posture1
CASE:7:SET:result:102
CASE:1:SET:result:105
CASE:2:SET:result:104
CASE:3:SET:result:103
CASE:4:SET:result:106
PUSH:sitonly
PUSH:0
GT
POP:reTempVar0
PUSH:Posture1
PUSH:1
EQ
POP:reTempVar1
PUSH:Posture1
PUSH:4
EQ
POP:reTempVar2
LIOR:reTempVar1:reTempVar2
IF:reTempVar0:&&:reTempVar1:THEN
SET:init_wait:Wait
PLAY:ACTION:SIT
CALL:G_WAIT
SET:result:104
ENDIF
ENDIF
RET:result
:G_YART_Startup_Once
SET:yart_last_favcolor:0
SET:yart_last_unfavcolor:0
SET:result:101
//{ "Main/Startup (once)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Startup_Recovery
SET:result:101
//{ "Main/Recovery (after fall-over)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Sensors
SET:result:101
IF:Head_Hit:<>:0:THEN
//{ "Sensor/Head Hit" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Head_Hit:0
ENDIF
ENDIF
IF:Head_Pat:<>:0:THEN
//{ "Sensor/Head Pat" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Head_Pat:0
ENDIF
ENDIF
IF:Head_LONG:<>:0:THEN
//{ "Sensor/Head Long Press" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Head_LONG:0
ENDIF
ENDIF
IF:Head_ON:<>:0:THEN
//{ "Sensor/Head Pressed" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Head_ON:0
ENDIF
ENDIF
IF:Head_OFF:<>:0:THEN
//{ "Sensor/Head Released" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Head_OFF:0
ENDIF
ENDIF
IF:Posture1:==:3:THEN
IF:RFLeg_ON:<>:0:THEN
//{ "Sensor/RF Paw (sleep position)" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:RFLeg_ON:0
ENDIF
ENDIF
IF:LFLeg_ON:<>:0:THEN
//{ "Sensor/LF Paw (sleep position)" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:LFLeg_ON:0
ENDIF
ENDIF
ENDIF
IF:Tail_U_ON:<>:0:THEN
//{ "Sensor/Tail Pushed Up" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Tail_U_ON:0
ENDIF
ENDIF
IF:Tail_D_ON:<>:0:THEN
//{ "Sensor/Tail Pushed Down" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Tail_D_ON:0
ENDIF
ENDIF
IF:Tail_R_ON:<>:0:THEN
//{ "Sensor/Tail Pushed Right" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Tail_R_ON:0
ENDIF
ENDIF
IF:Tail_L_ON:<>:0:THEN
//{ "Sensor/Tail Pushed Left" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Tail_L_ON:0
ENDIF
ENDIF
IF:Tail_RollR:<>:0:THEN
//{ "Sensor/Tail Rolled Right" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Tail_RollR:0
ENDIF
ENDIF
IF:Tail_RollL:<>:0:THEN
//{ "Sensor/Tail Rolled Left" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Tail_RollL:0
ENDIF
ENDIF
IF:Tail_Roll3:<>:0:THEN
//{ "Sensor/Tail Rolled Three Times" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:Tail_Roll3:0
ENDIF
ENDIF
GO:G_YART_DONE
:G_YART_Bored_Stand
SET:result:101
RND:rndnum:0:7
SWITCH:rndnum
CASE:0:GO:YI_StandRandom1
CASE:1:GO:YI_StandRandom2
CASE:2:GO:YI_StandRandom3
CASE:3:GO:YI_StandRandom4
CASE:4:GO:YI_StandRandom5
RET:result
:YI_StandRandom1
//{ "Stand Position/Bored Random#1" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YI_StandRandom2
//{ "Stand Position/Bored Random#2" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YI_StandRandom3
//{ "Stand Position/Bored Random#3" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YI_StandRandom4
//{ "Stand Position/Bored Random#4" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YI_StandRandom5
//{ "Stand Position/Bored Random#5" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Calm_Sit
SET:result:101
RND:rndnum:0:7
SWITCH:rndnum
CASE:0:GO:YC_SitRandom1
CASE:1:GO:YC_SitRandom2
CASE:2:GO:YC_SitRandom3
CASE:3:GO:YC_SitRandom4
CASE:4:GO:YC_SitRandom5
RET:result
:YC_SitRandom1
//{ "Sit Position/Calm Random#1" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YC_SitRandom2
//{ "Sit Position/Calm Random#2" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YC_SitRandom3
//{ "Sit Position/Calm Random#3" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YC_SitRandom4
//{ "Sit Position/Calm Random#4" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YC_SitRandom5
//{ "Sit Position/Calm Random#5" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Bored_Sit
SET:result:101
RND:rndnum:0:7
SWITCH:rndnum
CASE:0:GO:YB_SitRandom1
CASE:1:GO:YB_SitRandom2
CASE:2:GO:YB_SitRandom3
CASE:3:GO:YB_SitRandom4
CASE:4:GO:YB_SitRandom5
RET:result
:YB_SitRandom1
//{ "Sit Position/Bored Random#1" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YB_SitRandom2
//{ "Sit Position/Bored Random#2" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YB_SitRandom3
//{ "Sit Position/Bored Random#3" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YB_SitRandom4
//{ "Sit Position/Bored Random#4" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YB_SitRandom5
//{ "Sit Position/Bored Random#5" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Happy_Sit
SET:result:101
RND:rndnum:0:7
SWITCH:rndnum
CASE:0:GO:YH_SitRandom1
CASE:1:GO:YH_SitRandom2
CASE:2:GO:YH_SitRandom3
CASE:3:GO:YH_SitRandom4
CASE:4:GO:YH_SitRandom5
RET:result
:YH_SitRandom1
//{ "Sit Position/Happy Random#1" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SitRandom2
//{ "Sit Position/Happy Random#2" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SitRandom3
//{ "Sit Position/Happy Random#3" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SitRandom4
//{ "Sit Position/Happy Random#4" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SitRandom5
//{ "Sit Position/Happy Random#5" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Calm_Sleep
SET:result:101
RND:rndnum:0:7
SWITCH:rndnum
CASE:0:GO:YC_SleepRandom1
CASE:1:GO:YC_SleepRandom2
CASE:2:GO:YC_SleepRandom3
CASE:3:GO:YC_SleepRandom4
CASE:4:GO:YC_SleepRandom5
RET:result
:YC_SleepRandom1
//{ "Sleep Position/Calm Random#1" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YC_SleepRandom2
//{ "Sleep Position/Calm Random#2" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YC_SleepRandom3
//{ "Sleep Position/Calm Random#3" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YC_SleepRandom4
//{ "Sleep Position/Calm Random#4" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YC_SleepRandom5
//{ "Sleep Position/Calm Random#5" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Bored_Sleep
SET:result:101
RND:rndnum:0:7
SWITCH:rndnum
CASE:0:GO:YB_SleepRandom1
CASE:1:GO:YB_SleepRandom2
CASE:2:GO:YB_SleepRandom3
CASE:3:GO:YB_SleepRandom4
CASE:4:GO:YB_SleepRandom5
RET:result
:YB_SleepRandom1
//{ "Sleep Position/Bored Random#1" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YB_SleepRandom2
//{ "Sleep Position/Bored Random#2" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YB_SleepRandom3
//{ "Sleep Position/Bored Random#3" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YB_SleepRandom4
//{ "Sleep Position/Bored Random#4" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YB_SleepRandom5
//{ "Sleep Position/Bored Random#5" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Happy_Sleep
SET:result:101
RND:rndnum:0:7
SWITCH:rndnum
CASE:0:GO:YH_SleepRandom1
CASE:1:GO:YH_SleepRandom2
CASE:2:GO:YH_SleepRandom3
CASE:3:GO:YH_SleepRandom4
CASE:4:GO:YH_SleepRandom5
RET:result
:YH_SleepRandom1
//{ "Sleep Position/Happy Random#1" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SleepRandom2
//{ "Sleep Position/Happy Random#2" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SleepRandom3
//{ "Sleep Position/Happy Random#3" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SleepRandom4
//{ "Sleep Position/Happy Random#4" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SleepRandom5
//{ "Sleep Position/Happy Random#5" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_VoiceCmd_Attention
SET:result:101
SWITCH:VoiceCmd
CASE:1:GO:YVC_AIBO
CASE:0x411:GO:YVC_GoodAIBO
CASE:28:GO:YVC_DontDoThat
CASE:0x412:GO:YVC_DontDoThat
CASE:9:GO:YVC_GoodBOT
CASE:0x43D:GO:YVC_GoodBoy
CASE:0x43E:GO:YVC_GoodGirl
CASE:47:GO:YVC_BadBOT
CASE:0x43F:GO:YVC_BadBoy
CASE:0x440:GO:YVC_BadGirl
CASE:15:GO:YVC1_GoForIt
CASE:25:GO:YVC1_ILikeYou
CASE:0x40F:GO:YVC2_ThatsRight
RET:result
:G_YART_VoiceCmd
SET:result:101
SWITCH:VoiceCmd
CASE:1:GO:YVC_AIBO
CASE:0x401:GO:YVC_AIBO
CASE:19:GO:YVC_Hello
CASE:0x406:GO:YVC_Hello
CASE:18:GO:YVC_SayHello
CASE:0x403:GO:YVC_SayHello
CASE:12:GO:YVC_GoodMorning
CASE:0x405:GO:YVC_GoodMorning
CASE:13:GO:YVC_GoodNight
CASE:0x407:GO:YVC_GoodNight
CASE:14:GO:YVC_KarateChop
CASE:0x438:GO:YVC_KarateChop
CASE:30:GO:YVC_AreYouTired
CASE:0x43A:GO:YVC_AreYouTired
CASE:11:GO:YVC_AreYouHungry
CASE:0x43B:GO:YVC_AreYouHungry
CASE:3:GO:YVC_LetsPlay
CASE:0x413:GO:YVC_LetsPlay
CASE:2:GO:YVC_ShakePaw
CASE:10:GO:YVC_ShakePaw
CASE:0x404:GO:YVC_ShakePaw
CASE:37:GO:YVC_Pose
CASE:0x417:GO:YVC_Pose
CASE:52:GO:YVC_WalkAround
CASE:0x439:GO:YVC_WalkAround
CASE:34:GO:YVC_TurnLeft
CASE:0x422:GO:YVC_TurnLeft
CASE:40:GO:YVC_TurnRight
CASE:0x421:GO:YVC_TurnRight
CASE:39:GO:YVC_GoForward
CASE:0x423:GO:YVC_GoForward
CASE:5:GO:YVC_GoBackward
CASE:0x424:GO:YVC_GoBackward
CASE:27:GO:YVC_StandUp
CASE:0x41E:GO:YVC_StandUp
CASE:36:GO:YVC_LayDown
CASE:0x41F:GO:YVC_LayDown
CASE:8:GO:YVC_SitDown
CASE:0x420:GO:YVC_SitDown
CASE:29:GO:YVC_LetsDance
CASE:0x415:GO:YVC_LetsDance
CASE:21:GO:YVC_BeQuiet
CASE:0x442:GO:YVC_BeQuiet
CASE:22:GO:YVC_TakeAPicture
CASE:0x437:GO:YVC_TakeAPicture
CASE:31:GO:YVC_NameRegistration
CASE:0x43C:GO:YVC_NameRegistration
CASE:32:GO:YVC_WhatsYourName
CASE:0x402:GO:YVC_WhatsYourName
CASE:26:GO:YVC_ImHere
CASE:0x436:GO:YVC_ImHere
CASE:38:GO:YVC1_FindBall
CASE:16:GO:YVC1_KickBall
CASE:17:GO:YVC1_AreYouOK
CASE:33:GO:YVC1_GoodBye
CASE:6:GO:YVC1_OtherPaw
CASE:49:GO:YVC1_Roar
CASE:50:GO:YVC1_Meow
CASE:7:GO:YVC1_GetUp
CASE:0x416:GO:YVC2_ShowTime
CASE:0x40A:GO:YVC2_HeyAIBO
CASE:0x40B:GO:YVC2_Thanks
CASE:0x408:GO:YVC2_SeeYou
CASE:0x409:GO:YVC2_HowAreYou
CASE:0x40D:GO:YVC2_CheerUp
CASE:0x42E:GO:YVC2_ReadySetGo
CASE:0x414:GO:YVC2_SingSong
CASE:0x418:GO:YVC2_ClownAround
CASE:0x41D:GO:YVC2_HappyDay
CASE:0x425:GO:YVC2_GoAhead
CASE:0x429:GO:YVC2_PinkBall
CASE:0x42A:GO:YVC2_RightKick
CASE:0x42C:GO:YVC2_LeftKick
CASE:0x42B:GO:YVC2_RightTouch
CASE:0x42D:GO:YVC2_LeftTouch
CASE:0x40E:GO:YVC2_Banzai
CASE:0x419:GO:YVC2_ShowOff
CASE:0x42F:GO:YVC2_YouWon
CASE:0x430:GO:YVC2_YouLost
CASE:0x431:GO:YVC2_Action1
CASE:0x432:GO:YVC2_Action2
CASE:0x433:GO:YVC2_Action3
CASE:0x434:GO:YVC2_Action4
CASE:0x435:GO:YVC2_Action5
CASE:0x441:GO:YVC2_LetsTalk
CASE:0x40C:GO:YVC2_Sorry
CASE:0x41A:GO:YVC2_SayMessage
CASE:0x41B:GO:YVC2_LetsBeSecret
CASE:0x41C:GO:YVC2_OpenSesame
CASE:0x427:GO:YVC2_Faster
CASE:0x428:GO:YVC2_SlowDown
CASE:0x443:GO:YVC2_WhatsOwnersName
CASE:0x444:GO:YVC2_OwnerRegistration
CASE:0x445:GO:YVC2_FunctionCheck
RET:result
:YVC_AIBO
//{ "AIBO voice command/AIBO or <dog's name>" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_OwnerName
//{ "AIBO voice command/<owner's name>" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_WhatsYourName
//{ "AIBO voice command/What's your name?" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_SayHello
//{ "AIBO voice command/Say hello" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_ShakePaw
//{ "AIBO voice command/Shake paw" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_GoodMorning
//{ "AIBO voice command/Morning" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_Hello
//{ "AIBO voice command/Hello" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_GoodNight
//{ "AIBO voice command/Good night" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_ThatsWrong
//{ "AIBO voice command/That's wrong" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_GoodAIBO
//{ "AIBO voice command/Good AIBO" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_DontDoThat
//{ "AIBO voice command/Don't Do that" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_LetsPlay
//{ "AIBO voice command/Let's play!" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_StandUp
//{ "AIBO voice command/Stand up" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_LayDown
//{ "AIBO voice command/Lie down" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_SitDown
//{ "AIBO voice command/Sit down" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_TurnRight
//{ "AIBO voice command/Turn right" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_TurnLeft
//{ "AIBO voice command/Turn left" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_GoForward
//{ "AIBO voice command/Go forward" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_GoBackward
//{ "AIBO voice command/Go backward" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_Stop
//{ "AIBO voice command/Stop" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_SingSong
//{ "AIBO voice command/Sing a song" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_LetsDance
//{ "AIBO voice command/Dance, Let's Dance" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_Pose
//{ "AIBO voice command/Pose for me" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_TakeAPicture
//{ "AIBO voice command/Take a picture" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_KarateChop
//{ "AIBO voice command/Karate chop" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_WalkAround
//{ "AIBO voice command/Walk around" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_AreYouTired
//{ "AIBO voice command/Are you tired?" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_AreYouHungry
//{ "AIBO voice command/Are you hungry?" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_NameRegistration
//{ "AIBO voice command/Name registration" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_BeQuiet
//{ "AIBO voice command/Be quiet" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_GoodBOT
PUSH:VoiceDictID
PUSH:149
GE
POP:reTempVar0
PUSH:VoiceDictID
PUSH:150
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:YVC_GoodBoy
PUSH:VoiceDictID
PUSH:151
GE
POP:reTempVar0
PUSH:VoiceDictID
PUSH:154
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:YVC_GoodGirl
GO:G_YART_VOICEDONE
:YVC_GoodBoy
//{ "AIBO voice command/Good boy" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_GoodGirl
//{ "AIBO voice command/Good girl" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_BadBOT
PUSH:VoiceDictID
PUSH:160
GE
POP:reTempVar0
PUSH:VoiceDictID
PUSH:161
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:YVC_BadBoy
PUSH:VoiceDictID
PUSH:162
GE
POP:reTempVar0
PUSH:VoiceDictID
PUSH:165
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:YVC_BadGirl
GO:G_YART_VOICEDONE
:YVC_BadBoy
//{ "AIBO voice command/Bad boy" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_BadGirl
//{ "AIBO voice command/Bad girl" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC_ImHere
//{ "AIBO voice command/I'm here" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC1_GetUp
//{ "AIBO voice command/Get Up (life1)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC1_GoForIt
//{ "AIBO voice command/Go For It (life1)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC1_ILikeYou
//{ "AIBO voice command/I Like You (life1)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC1_OtherPaw
//{ "AIBO voice command/Other Paw (life1)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC1_GoodBye
//{ "AIBO voice command/Goodbye (life1)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC1_KickBall
//{ "AIBO voice command/Kick Ball (life1)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC1_FindBall
//{ "AIBO voice command/Find Ball (life1)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC1_AreYouOK
//{ "AIBO voice command/Are you OK? (life1)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC1_Roar
//{ "AIBO voice command/Roar, Roll Over (life1)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC1_Meow
//{ "AIBO voice command/Meow (life1)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_SeeYou
//{ "AIBO voice command/See you (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_HowAreYou
//{ "AIBO voice command/How are you? (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_HeyAIBO
//{ "AIBO voice command/Hey AIBO (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_Thanks
//{ "AIBO voice command/Thanks (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_Sorry
//{ "AIBO voice command/Sorry (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
:YVC2_CheerUp
//{ "AIBO voice command/Cheer up (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_Banzai
//{ "AIBO voice command/Banzai (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_ThatsRight
//{ "AIBO voice command/That's right (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_ShowTime
//{ "AIBO voice command/Show time (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_ShowOff
//{ "AIBO voice command/Show off (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_ClownAround
//{ "AIBO voice command/Clown around (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_SayMessage
//{ "AIBO voice command/Say message (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_LetsBeSecret
//{ "AIBO voice command/Let's be secret (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_OpenSesame
//{ "AIBO voice command/Open sesame (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_HappyDay
//{ "AIBO voice command/Happy day (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_Faster
//{ "AIBO voice command/Faster (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_SlowDown
//{ "AIBO voice command/Slow down (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_GoAhead
//{ "AIBO voice command/Go ahead (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_PinkBall
//{ "AIBO voice command/Pink ball (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_RightKick
//{ "AIBO voice command/Right leg kick (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_RightTouch
//{ "AIBO voice command/Right leg touch (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_LeftKick
//{ "AIBO voice command/Left leg kick (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_LeftTouch
//{ "AIBO voice command/Left leg touch (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_ReadySetGo
//{ "AIBO voice command/Ready set go (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_YouWon
//{ "AIBO voice command/You won (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_YouLost
//{ "AIBO voice command/You lost (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_Action1
//{ "AIBO voice command/Action one (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_Action2
//{ "AIBO voice command/Action two (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_Action3
//{ "AIBO voice command/Action three (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_Action4
//{ "AIBO voice command/Action four (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_Action5
//{ "AIBO voice command/Action five (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_LetsTalk
//{ "AIBO voice command/Let's talk (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_WhatsOwnersName
//{ "AIBO voice command/What's your owner's name (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_OwnerRegistration
//{ "AIBO voice command/Owner registration (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:YVC2_FunctionCheck
//{ "AIBO voice command/Function check (life2)" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_VOICEDONE
:G_YART_HearSound
SET:result:101
IF:AP_Loud:>:0:THEN
//{ "AIBO hears/Loud Sound" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:AP_Loud:0
ENDIF
ENDIF
IF:AP_AiboSound:>:0:THEN
//{ "AIBO hears/Another AIBO" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:AP_AiboSound:0
ENDIF
ENDIF
IF:AP_Rhythm:>:0:THEN
//{ "AIBO hears/Music & Rhythm" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:AP_Rhythm:0
ENDIF
ENDIF
IF:AP_Noise:>:0:THEN
//{ "AIBO hears/Noise" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:AP_Noise:0
ENDIF
ENDIF
GO:G_YART_DONE
:G_YART_Vision
SET:result:101
SET:yart_last_favcolor:yart_new_favcolor
SET:yart_last_unfavcolor:yart_new_unfavcolor
CALL:F_FAVCOLOR
POP:reTempVar0
SET:yart_new_favcolor:reTempVar0
CALL:F_UNFAVCOLOR
POP:reTempVar0
SET:yart_new_unfavcolor:reTempVar0
SET:reTempVar0:yart_last_favcolor
LNOT:reTempVar0:reTempVar0
IF:yart_new_favcolor:&&:reTempVar0:THEN
//{ "AIBO sees/Favorite Color (seen)" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
SET:reTempVar0:yart_new_favcolor
LNOT:reTempVar0:reTempVar0
IF:reTempVar0:&&:yart_last_favcolor:THEN
//{ "AIBO sees/Favorite Color (lost)" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
SET:reTempVar0:yart_last_unfavcolor
LNOT:reTempVar0:reTempVar0
IF:yart_new_unfavcolor:&&:reTempVar0:THEN
//{ "AIBO sees/Unliked Color (seen)" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
SET:reTempVar0:yart_new_unfavcolor
LNOT:reTempVar0:reTempVar0
IF:reTempVar0:&&:yart_last_unfavcolor:THEN
//{ "AIBO sees/Unliked Color (lost)" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
IF:AP_FaceDetect:>:0:THEN
IF:AP_FaceDetect:>:3:THEN
//{ "AIBO sees/Human Face (up close)" PRE
//[PRE]: CALL G_GOTYART
//}
ELSE
//{ "AIBO sees/Human Face (far away)" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
IF:result:==:116:THEN
SET:AP_FaceDetect:0
ENDIF
ENDIF
IF:AP_FaceDetect:<:0:THEN
//{ "AIBO sees/Human Face (lost)" PRE
//[PRE]: CALL G_GOTYART
//}
IF:result:==:116:THEN
SET:AP_FaceDetect:0
ENDIF
ENDIF
GO:G_YART_DONE
:G_YART_Walking_ObstacleFront
SET:result:101
RND:rndnum:0:7
IF:rndnum:<:5:THEN
//{ "Walking/Obstacle in front" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
GO:G_YART_DONE
:G_YART_Walking_ObstacleLeft
SET:result:101
RND:rndnum:0:7
IF:rndnum:<:5:THEN
//{ "Walking/Obstacle to left" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
GO:G_YART_DONE
:G_YART_Walking_ObstacleRight
SET:result:101
RND:rndnum:0:7
IF:rndnum:<:5:THEN
//{ "Walking/Obstacle to right" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
GO:G_YART_DONE
:G_YART_Walking_SeeCliff
SET:result:101
RND:rndnum:0:7
IF:rndnum:<:5:THEN
//{ "Walking/See Cliff (drop off)" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
GO:G_YART_DONE
:G_YART_Walking_SeeTable
SET:result:101
RND:rndnum:0:7
IF:rndnum:<:5:THEN
//{ "Walking/See Table Leg" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
GO:G_YART_DONE
:G_YART_Walking_Happy
SET:result:101
RND:rndnum:0:7
SWITCH:rndnum
CASE:0:GO:YH_WalkRandom1
CASE:1:GO:YH_WalkRandom2
CASE:2:GO:YH_WalkRandom3
CASE:3:GO:YH_WalkRandom4
CASE:4:GO:YH_WalkRandom5
RET:result
:YH_WalkRandom1
//{ "Walking/Happy Random#1" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_WalkRandom2
//{ "Walking/Happy Random#2" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_WalkRandom3
//{ "Walking/Happy Random#3" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_WalkRandom4
//{ "Walking/Happy Random#4" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_WalkRandom5
//{ "Walking/Happy Random#5" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Soccer_SeeBall
SET:result:101
//{ "Soccer/See ball" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Soccer_LoseBall
SET:result:101
RND:rndnum:0:7
IF:rndnum:<:5:THEN
//{ "Soccer/Lose ball" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
GO:G_YART_DONE
:G_YART_Soccer_GoodKick
SET:result:101
RND:rndnum:0:7
IF:rndnum:<:5:THEN
//{ "Soccer/Successful Kick" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
GO:G_YART_DONE
:G_YART_Soccer_MissedKick
SET:result:101
RND:rndnum:0:7
IF:rndnum:<:5:THEN
//{ "Soccer/Missed Kick" PRE
//[PRE]: CALL G_GOTYART
//}
ENDIF
GO:G_YART_DONE
:G_YART_Soccer_Happy
SET:result:101
RND:rndnum:0:7
SWITCH:rndnum
CASE:0:GO:YH_SoccerRandom1
CASE:1:GO:YH_SoccerRandom2
CASE:2:GO:YH_SoccerRandom3
CASE:3:GO:YH_SoccerRandom4
CASE:4:GO:YH_SoccerRandom5
RET:result
:YH_SoccerRandom1
//{ "Soccer/Happy Random#1" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SoccerRandom2
//{ "Soccer/Happy Random#2" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SoccerRandom3
//{ "Soccer/Happy Random#3" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SoccerRandom4
//{ "Soccer/Happy Random#4" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YH_SoccerRandom5
//{ "Soccer/Happy Random#5" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_YART_Soccer_Frustrated
SET:result:101
RND:rndnum:0:7
SWITCH:rndnum
CASE:0:GO:YF_SoccerRandom1
CASE:1:GO:YF_SoccerRandom2
CASE:2:GO:YF_SoccerRandom3
CASE:3:GO:YF_SoccerRandom4
CASE:4:GO:YF_SoccerRandom5
RET:result
:YF_SoccerRandom1
//{ "Soccer/Frustrated Random#1" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YF_SoccerRandom2
//{ "Soccer/Frustrated Random#2" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YF_SoccerRandom3
//{ "Soccer/Frustrated Random#3" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YF_SoccerRandom4
//{ "Soccer/Frustrated Random#4" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:YF_SoccerRandom5
//{ "Soccer/Frustrated Random#5" PRE
//[PRE]: CALL G_GOTYART
//}
GO:G_YART_DONE
:G_CUSTOM_SLEEP_VOICECMD
RET:101
:G_CUSTOM_SIT_VOICECMD
RET:101
:G_CUSTOM_STAND_VOICECMD
RET:101
:G_CUSTOM_WALK_VOICECMD
RET:101
:G_CUSTOM_WALK_OBSTACLE
RET:101
:G_CUSTOM_SOCCER_KICK
RET:101
:G_STARTUP
WAIT:1
SET:temp:Status
WAIT
CLR:SENSORS
SET:Seed:Sec
SET:dogslife:250
SET:sitonly:0
SET:behavior:1
SET:kickhist:2
SET:kickcheck:3
SET:colorarray:4
SET:trackarray:5
SET:syn_voice:6
SET:voicehist:7
WAIT:1
IF:AP_Version:>=:dogslife:THEN
SET:rcodeplus:1
SET:AP_Voice_Cmd:0
ELSE
SET:rcodeplus:0
ENDIF
SET:base_voice_cmd:0
VLOAD:AP_Vocab
PUSH:AP_Vocab
PUSH:0
EQ
POP:reTempVar0
PUSH:AP_Vocab
PUSH:2
EQ
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
SET:base_voice_cmd:1024
ENDIF
CALL:G_NEED2REST
CASE:1:GO:STARTUP_INITMOOD
IF_1ST:temp:=:0:STARTUP_INITMOOD
RND:rndnum:0:100
IF:shudder:==:0:THEN
SET:shudder:1
IF:rndnum:<:50:THEN
PLAY:ACTION:O2_ATCLIFF
ELSE
PLAY:ACTION:O2_SHUDDER
ENDIF
WAIT
ENDIF
SET:shudder:0
PLAY:ACTION:WALK:0:0
WAIT
SET:d:Distance
WAIT:1000
SET:dd:Distance
AP_SET:123:behavior:3999
AP_SET:456:behavior:3998
AP_GET:temp:behavior:3999
IF:temp:!=:123:STARTUP_LOADVARS
CALL:G_YART_Startup_Recovery
CASE:102:RET:102
CASE:104:RET:104
CASE:103:RET:103
CASE:106:RET:106
RET:105
:STARTUP_INITMOOD
SET:mood_happy:0
SET:mood_mad:0
SET:mood_sad:0
SET:mood_curious:0
SET:mood_bored:0
SET:mood_tired:0
SET:last_happydance:-1
SET:last_happydance2:-1
SET:last_walkact:-1
SET:last_danceact:-1
SET:last_happyact:-1
SET:last_boredact:-1
SET:last_calmact:-1
SET:last_poseact:-1
SET:last_praiseact:-1
SET:last_praiseact2:-1
SET:last_scoldact:-1
SET:last_scoldact2:-1
SET:last_shakehand:0
SET:last_kick:-1
SET:maxtime1:32767
SET:maxtime2:32767
SET:maxtime3:32767
SET:maxtime4:32767
SET:maxtime5:32767
SET:maxtime6:32767
SET:maxtime7:900
SET:maxtime8:32767
SET:maxtime9:32767
SET:maxtime10:32767
SET:maxtime11:0
SET:maxtime12:20
SET:Warn:0
SET:Horn_O:0
SET:Horn_G:0
SET:Horn_B:0
:STARTUP_LOADVARS
SET:AP_Voice_Cmd:0
SET:VoiceCmd:0
VLOAD:boygirl
VLOAD:endure
VLOAD:soccer
IF:soccer:<:1:THEN
SET:soccer:30
ENDIF
IF:endure:<:1:THEN
SET:endure:20
ENDIF
IF:rcodeplus:>:0:THEN
AP_DIM:behavior:4000:1
AP_DIM:kickhist:1000
AP_DIM:kickcheck:100
AP_DIM:colorarray:3168
AP_DIM:trackarray:256
AP_DIM:syn_voice:1000
AP_DIM:voicehist:100
ENDIF
AP_GET:reTempVar0:behavior:27
IF:reTempVar0:==:0:THEN
AP_SET:3:behavior:27
ENDIF
AP_GET:reTempVar0:behavior:28
IF:reTempVar0:==:0:THEN
AP_SET:2:behavior:28
ENDIF
AP_GET:reTempVar0:behavior:29
IF:reTempVar0:==:0:THEN
AP_SET:2:behavior:29
ENDIF
AP_GET:reTempVar0:behavior:26
IF:reTempVar0:>:0:THEN
AP_GET:reTempVar0:behavior:27
AP_DEVCTL:1:reTempVar0
AP_GET:reTempVar0:behavior:28
AP_DEVCTL:2:reTempVar0
AP_GET:reTempVar0:behavior:29
AP_DEVCTL:3:reTempVar0
WAIT:500
ENDIF
FOR:i:0:3
AP_SET:-999:voicehist:i
NEXT
SET:supercore:0
SET:count:0
SET:Clock:0
:reTempLbl15
IF:Clock:<:1:THEN
GO:reTempLbl15
ENDIF
:reTempLbl16
IF:Clock:<:30:THEN
ADD:count:1
GO:reTempLbl16
ENDIF
IF:count:>:4000:THEN
SET:supercore:1
ENDIF
IF:supercore:<>:0:THEN
AP_DEVCTL:6:1
ENDIF
CALL:G_NEED2REST
CASE:1:RET:102
CALL:G_YART_Startup_Once
CASE:102:RET:102
CASE:105:RET:105
CASE:104:RET:104
CASE:106:RET:106
RET:103
:G_TIMERS
WAIT:1
IF:Clock:<:32:THEN
IF:Clock:>=:0:THEN
RET:1
ENDIF
ENDIF
SET:Clock:0
SET:reTempVar0:maxtime1
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime1:1
ENDIF
SET:reTempVar0:maxtime2
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime2:1
ENDIF
SET:reTempVar0:maxtime3
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime3:1
ENDIF
SET:reTempVar0:maxtime4
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime4:1
ENDIF
SET:reTempVar0:maxtime5
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime5:1
ENDIF
SET:reTempVar0:maxtime7
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime7:1
ENDIF
SET:reTempVar0:maxtime8
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime8:1
ENDIF
SET:reTempVar0:maxtime9
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime9:1
ENDIF
SET:reTempVar0:maxtime10
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime10:1
ENDIF
SET:reTempVar0:maxtime11
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime11:1
ENDIF
SET:reTempVar0:maxtime12
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime12:1
ENDIF
SET:reTempVar0:maxtime6
ADD:reTempVar0:1
IF:reTempVar0:>:0:THEN
SUB:maxtime6:1
ENDIF
IF:maxtime7:<:0:THEN
AP_GET:reTempVar0:behavior:22
IF:reTempVar0:<>:0:THEN
SET:maxtime7:32767
ELSE
SET:maxtime7:900
AP_GET:reTempVar0:behavior:50
SUB:reTempVar0:1
AP_SET:reTempVar0:behavior:50
AP_GET:reTempVar0:behavior:50
IF:reTempVar0:<:20:THEN
AP_SET:20:behavior:50
ENDIF
ENDIF
ENDIF
IF:maxtime12:<:0:THEN
SET:maxtime12:20
AP_BMOVE:voicehist:0:1:3
AP_SET:-999:voicehist:0
ENDIF
IF:maxtime5:<:0:THEN
SET:maxtime5:32767
SET:Horn_O:0
SET:Horn_B:0
SET:Horn_G:0
ENDIF
RET:1
:G_TIMER1
CALL:G_TIMERS
IF:maxtime1:<:0:THEN
RET:2
ENDIF
RET:1
:G_TIMER2
CALL:G_TIMERS
IF:maxtime2:<:0:THEN
RET:2
ENDIF
RET:1
:G_TIMER3
CALL:G_TIMERS
IF:maxtime3:<:0:THEN
RET:2
ENDIF
RET:1
:G_TIMER4
CALL:G_TIMERS
IF:maxtime4:<:0:THEN
RET:2
ENDIF
RET:1
:G_BORED_TIMER
CALL:G_TIMERS
IF:maxtime1:<:0:THEN
CALL:G_STOP_TAILWAG
RND:maxtime1:3:10
SUB:bored_count:1
RET:2
ENDIF
IF:maxtime4:<:0:THEN
SET:maxtime4:32767
CALL:G_INC_SAD_MOOD
ENDIF
PUSH:mood_sad
PUSH:0
GT
POP:reTempVar0
PUSH:mood_mad
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
IF:maxtime9:>:1000:THEN
CALL:G_INIT_MOOD_TIMER
ENDIF
IF:maxtime9:<:0:THEN
CALL:G_INIT_MOOD_TIMER
CALL:G_DEC_SAD_MOOD
CALL:G_DEC_MAD_MOOD
ENDIF
ENDIF
RET:1
:G_INIT_MOOD_TIMER
RND:maxtime9:30:60
RET:1
:G_LOOK_TIMER
CALL:G_TIMER2
CASE:1:RET:1
WAIT:1
RND:tilt:-40:10
RND:pan:-60:60
SET:look_wait:Wait
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:MOVE.HEAD.NORMAL:pan:tilt:10
CASE:2:PLAY:ACTION:MOVE.HEAD.SLOW:pan:tilt:10
RND:maxtime2:1:3
RET:1
:G_REST_TIMER
CALL:G_TIMER3
CASE:1:RET:1
RND:maxtime3:8:15
CALL:G_DEC_TIRED_MOOD
RET:1
:G_TIMER_TIRED
CALL:G_NEED2REST
CASE:1:RET:1
:reTempLbl17
IF:Clock:>:100:THEN
SUB:maxtime10:1
SUB:Clock:100
GO:reTempLbl17
ENDIF
CALL:G_TIMERS
IF:maxtime10:>=:0:THEN
RET:2
ENDIF
RND:maxtime10:5:10
ADD:maxtime10:endure
ADD:mood_tired:1
IF:mood_tired:>:10:THEN
SET:mood_tired:10
ENDIF
IF:mood_tired:>:9:THEN
RET:1
ENDIF
RET:2
:G_BEHAVIOR_DIFF
AP_GET:reTempVar0:behavior:rndbase:1
SET:rndend:reTempVar0
AP_GET:reTempVar0:behavior:rndbase:2
SET:lastact1:reTempVar0
AP_GET:reTempVar0:behavior:rndbase:3
SET:lastact2:reTempVar0
PUSH:rndnum
PUSH:lastact1
NE
POP:reTempVar0
PUSH:rndnum
PUSH:lastact2
NE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
RET:1
ENDIF
SET:reTempVar0:rndbase
ADD:reTempVar0:4
SET:index:reTempVar0
:reTempLbl18
IF:index:<=:rndnum:THEN
SET:reTempVar0:index
AP_GET:reTempVar1:behavior:reTempVar0
SET:temp:reTempVar1
ADD:index:1
PUSH:temp
PUSH:lastact1
NE
POP:reTempVar0
PUSH:temp
PUSH:lastact2
NE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:rndnum:temp
RET:1
ENDIF
GO:reTempLbl18
ENDIF
RET:1
:G_BEHAVIOR_LOG
IF:rndnum:>=:0:THEN
AP_GET:reTempVar0:behavior:16
ADD:reTempVar0:1
AND:reTempVar0:7
SET:index:reTempVar0
AP_SET:rndbase:behavior:index
AP_SET:index:behavior:16
AP_GET:reTempVar0:behavior:rndbase:2
SET:lastact1:reTempVar0
AP_GET:reTempVar0:behavior:rndbase:3
SET:lastact2:reTempVar0
PUSH:rndnum
PUSH:lastact1
NE
POP:reTempVar0
PUSH:rndnum
PUSH:lastact2
NE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
AP_SET:rndnum:behavior:rndbase:2
AP_SET:lastact1:behavior:rndbase:3
ENDIF
ENDIF
RET:1
:G_BEHAVIOR_ADD
AP_GET:reTempVar0:behavior:rndbase:1
SET:rndend:reTempVar0
SET:reTempVar0:rndend
SUB:reTempVar0:rndbase
SET:index:reTempVar0
IF:index:<:49:THEN
ADD:rndend:1
AP_SET:praise:behavior:rndend
AP_SET:rndend:behavior:rndbase:1
ENDIF
RET:1
:G_BEHAVIOR_SUB
SET:reTempVar0:rndbase
ADD:reTempVar0:4
SET:rndstart:reTempVar0
AP_GET:reTempVar0:behavior:rndbase:1
SET:rndend:reTempVar0
SET:index:rndend
:reTempLbl19
IF:index:>=:rndstart:THEN
AP_GET:reTempVar0:behavior:index
IF:reTempVar0:==:scold:THEN
:reTempLbl20
IF:index:<:rndend:THEN
AP_GET:reTempVar0:behavior:index:1
AP_SET:reTempVar0:behavior:index
ADD:index:1
GO:reTempLbl20
ENDIF
SUB:rndend:1
AP_SET:rndend:behavior:rndbase:1
RET:1
ENDIF
SUB:index:1
GO:reTempLbl19
ENDIF
RET:1
:G_BEHAVIOR_INIT
AP_GET:reTempVar0:behavior:rndbase
IF:reTempVar0:==:rndcount:THEN
RET:1
ENDIF
AP_SET:rndcount:behavior:rndbase
IF:rndcount:<:0:THEN
MUL:rndcount:-1
ENDIF
SET:reTempVar0:rndbase
SET:reTempVar1:rndcount
MUL:reTempVar1:2
ADD:reTempVar1:3
ADD:reTempVar0:reTempVar1
SET:rndend:reTempVar0
AP_SET:rndend:behavior:rndbase:1
SET:reTempVar0:rndbase
ADD:reTempVar0:4
SET:index:reTempVar0
SET:temp:rndbase
:reTempLbl21
IF:index:<:rndend:THEN
SET:reTempVar0:index
AP_SET:temp:behavior:reTempVar0
ADD:index:1
SET:reTempVar0:index
AP_SET:temp:behavior:reTempVar0
ADD:index:1
SET:reTempVar0:temp
ADD:temp:1
GO:reTempLbl21
ENDIF
RET:1
:G_BEHAVIOR_PRAISE
AP_GET:reTempVar0:behavior:16
SET:index:reTempVar0
AP_GET:reTempVar0:behavior:index
SET:rndbase:reTempVar0
AP_GET:reTempVar0:behavior:rndbase:2
SET:praise:reTempVar0
IF:rndbase:>=:50:THEN
AP_GET:reTempVar0:behavior:20
ADD:reTempVar0:1
AP_SET:reTempVar0:behavior:20
AP_GET:reTempVar0:behavior:18
ADD:reTempVar0:1
AP_SET:reTempVar0:behavior:18
CALL:G_BEHAVIOR_INIT
CALL:G_BEHAVIOR_ADD
ENDIF
RET:1
:G_BEHAVIOR_SCOLD
AP_GET:reTempVar0:behavior:16
SET:index:reTempVar0
AP_GET:reTempVar0:behavior:index
SET:rndbase:reTempVar0
AP_GET:reTempVar0:behavior:rndbase:2
SET:scold:reTempVar0
IF:rndbase:>=:50:THEN
AP_GET:reTempVar0:behavior:20
ADD:reTempVar0:1
AP_SET:reTempVar0:behavior:20
AP_GET:reTempVar0:behavior:19
ADD:reTempVar0:1
AP_SET:reTempVar0:behavior:19
CALL:G_BEHAVIOR_INIT
CALL:G_BEHAVIOR_SUB
ENDIF
RET:1
:G_BEHAVIOR_BORED
CALL:F_FAVCOLOR
POP:reTempVar0
IF:reTempVar0:>:0:THEN
CALL:G_DEC_SAD_MOOD
ELSE
CALL:F_UNFAVCOLOR
POP:reTempVar0
IF:reTempVar0:>:0:THEN
CALL:G_INC_SAD_MOOD
ENDIF
CALL:G_DEC_HAPPY_MOOD
ENDIF
AP_GET:reTempVar0:behavior:22
IF:reTempVar0:>:0:THEN
RET:1
ENDIF
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:2:THEN
FOR:temp:1:10
RND:rndnum:1:40
SET:reTempVar0:rndnum
MUL:reTempVar0:50
SET:rndbase:reTempVar0
AP_GET:reTempVar0:behavior:rndbase
SET:rndcount:reTempVar0
IF:rndcount:>:0:THEN
SET:reTempVar0:rndbase
SET:reTempVar1:rndcount
SUB:reTempVar1:1
ADD:reTempVar0:reTempVar1
RND:target:rndbase:reTempVar0
AP_SCANCOUNT:count:behavior:rndbase:rndcount:target
IF:count:<:2:THEN
AP_GET:reTempVar0:behavior:21
ADD:reTempVar0:1
AP_SET:reTempVar0:behavior:21
SET:praise:target
CALL:G_BEHAVIOR_ADD
RET:1
ENDIF
IF:count:>:2:THEN
AP_GET:reTempVar0:behavior:21
ADD:reTempVar0:1
AP_SET:reTempVar0:behavior:21
SET:scold:target
CALL:G_BEHAVIOR_SUB
RET:1
ENDIF
ENDIF
NEXT
ENDIF
RET:1
:F_BEHAVIOR_RNDN
CALL:F_BEHAVIOR_RND
LNOT
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
RETURN:0
ENDIF
CALL:G_BEHAVIOR_DIFF
CALL:G_BEHAVIOR_LOG
RETURN:1
:G_BEHAVIOR_RNDNM
CALL:F_BEHAVIOR_RND
LNOT
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
RET:3
ENDIF
AP_GET:reTempVar0:behavior:rndbase:1
SET:rndend:reTempVar0
AP_GET:reTempVar0:behavior:rndbase:2
SET:lastact1:reTempVar0
AP_GET:reTempVar0:behavior:rndbase:3
SET:lastact2:reTempVar0
PUSH:rndnum
PUSH:lastact1
EQ
POP:reTempVar0
PUSH:rndnum
PUSH:lastact2
NE
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:33:THEN
RET:1
ENDIF
CALL:G_BEHAVIOR_DIFF
ENDIF
CALL:G_BEHAVIOR_LOG
RET:2
:F_BEHAVIOR_RND
CALL:G_BEHAVIOR_INIT
SET:reTempVar0:rndbase
ADD:reTempVar0:4
SET:rndstart:reTempVar0
AP_GET:reTempVar0:behavior:rndbase:1
SET:rndend:reTempVar0
SET:rndnum:0
IF:rndend:>=:rndstart:THEN
RND:index:rndstart:rndend
AP_GET:reTempVar0:behavior:index
SET:rndnum:reTempVar0
RETURN:1
ENDIF
RETURN:0
:G_RESTMODE
IF:Posture1:==:4:THEN
PLAY:ACTION:STAND
WAIT
CLR:SENSORS
RND:bored_timer:30:60
RND:maxtime2:1:3
ENDIF
:1456
IF_1ST:Batt_Rest:<:25:1467
IF_1ST:40:>:45:1463
IF_1ST:Batt_Temp:>:45:1463
SWITCH:Posture1
CASE:7:GO:1461
CASE:5:GO:1461
CASE:255:GO:1461
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:THEN
RET:107
ENDIF
CALL:G_RANDOM2
CASE:1:RET:103
RET:104
:1461
CALL:G_STATIONPOS
:1462
GO:1456
:1463
PLAY:ACTION:LIE
WAIT
:1464
PLAY:ACTION+:panting
WAIT:10000
CALL:G_STATION_SHUTDOWN
WAIT:1
IF_1ST:Batt_Rest:<:25:1462
IF_1ST:40:<=:40
IF_AND:Batt_Temp:<=:40:1462
GO:1464
:1467
PLAY:ACTION+:hungry_empty
WAIT
PLAY:ACTION:CHGPOS.STATR.NORMAL
WAIT
PLAY:ACTION:PALONE.AUTO.TAILH
:1468
WAIT:5000
CALL:G_STATION_SHUTDOWN
WAIT:1
IF_1ST:Batt_Rest:<:25:1468
PLAY:ACTION:PALONE.AUTO.TAILSTOP
WAIT
GO:1456
:G_STATION_BORED
CALL:G_RANDOM4
CASE:1:GO:2907
CASE:2:GO:2906
CASE:3:GO:2905
CALL:G_STATION_PICKMEUP
WAIT
RET:1
:2905
PLAY:ACTION:O2_STATION_BORED3
WAIT
RET:1
:2906
PLAY:ACTION:O2_STATION_BORED2
WAIT
RET:1
:2907
PLAY:ACTION:O2_STATION_BORED1
WAIT
RET:1
:G_STATION_CALM
CALL:G_RANDOM6
CASE:1:PLAY:ACTION:O2_STATION_EXERCISE
CASE:2:PLAY:ACTION:O2_STATION_LOOK1
CASE:3:PLAY:ACTION:O2_STATION_LOOK2
CASE:4:PLAY:ACTION:O2_STATION_LOOK3
CASE:5:PLAY:ACTION:O2_STATION_LOOK4
CASE:6:PLAY:ACTION:O2_STATION_SNEEZE
WAIT
RET:1
:G_STATION_HUH?
CALL:G_VOICE_HIT
CALL:G_RANDOM4
CASE:1:PLAY:ACTION:O2_STATION_HUH1
CASE:2:PLAY:ACTION:O2_STATION_HUH2
CASE:3:PLAY:ACTION:O2_STATION_NO1
CASE:4:PLAY:ACTION:O2_STATION_NO2
WAIT
RET:1
:G_STATION_PICKMEUP
CALL:G_RANDOM6
CASE:1:PLAY:ACTION:O2_STATION_PICKMEUP1
CASE:2:PLAY:ACTION:O2_STATION_PICKMEUP2
CASE:3:PLAY:ACTION:O2_STATION_PICKMEUP3
CASE:4:PLAY:ACTION:O2_STATION_PICKMEUP4
CASE:5:PLAY:ACTION:O2_STATION_PICKMEUP5
CASE:6:PLAY:ACTION:O2_STATION_PICKMEUP6
WAIT
RET:1
:G_STATION_SHUTDOWN
WAIT:1
SET:init_wait:Wait
WAIT:1
IF_1ST:Posture1:=:5:2959
CALL:G_RANDOM6
CASE:1:PLAY:ACTION:O2_SLEEPY1
CASE:2:PLAY:ACTION:O2_SLEEPY2
CASE:3:PLAY:ACTION:O2_SLEEPY3
CASE:4:PLAY:ACTION:O2_SLEEPY4
CASE:5:PLAY:ACTION:O2_SLEEPY5
CASE:6:PLAY:ACTION:O2_SLEEPY6
:2943
CALL:G_WAIT_AWARE
WAIT:1
IF_1ST:Pink_Ball:=:0:2946
PLAY:ACTION:TRACK_HEAD:PINK_BALL
RET:2
:2946
CALL:G_VOICECMD
IF:Context:==:114:THEN
PUSH:VoiceCmd
PUSH:1
EQ
POP:reTempVar0
PUSH:VoiceCmd
PUSH:1034
EQ
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
PUSH:VoiceCmd
PUSH:3
EQ
POP:reTempVar2
LIOR:reTempVar0:reTempVar2
PUSH:VoiceCmd
PUSH:7
EQ
POP:reTempVar3
LIOR:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
CALL:G_TWITCH_EARS
RET:1
ENDIF
ENDIF
:2949
CALL:G_RANDOM1/3
CASE:1:GO:2953
:2950
RND:pan:-25:25
PLAY:ACTION:MOVE.HEAD.NORMAL:pan:-90
CALL:G_WAIT
WAIT:2000
HALT
EXIT
:2953
PLAY:ACTION:O2_STATION_SNORE
GO:2950
:2959
CALL:G_RANDOM4
CASE:1:PLAY:ACTION:O2_STATION_SLEEPY1
CASE:2:PLAY:ACTION:O2_STATION_SLEEPY2
CASE:3:PLAY:ACTION:O2_STATION_SLEEPY3
CASE:4:PLAY:ACTION:O2_STATION_SLEEPY4
GO:2943
:G_STATION_TALKING
CALL:G_RANDOM6
CASE:1:PLAY:ACTION:O2_STATION_TALKING1
CASE:2:PLAY:ACTION:O2_STATION_TALKING2
CASE:3:PLAY:ACTION:O2_STATION_TALKING3
CASE:4:PLAY:ACTION:O2_STATION_TALKING4
CASE:5:PLAY:ACTION:O2_STATION_TALKING5
CASE:6:PLAY:ACTION:O2_STATION_TALKING6
WAIT
RET:1
:G_STATION_VOICE_HANDLER
WAIT:1
SWITCH:VoiceCmd
CASE:38:GO:2992
CASE:16:GO:2992
CASE:0x429:GO:2992
CASE:0x42A:GO:2992
CASE:0x42C:GO:2992
CASE:0x42B:GO:2992
CASE:0x42D:GO:2992
CASE:1:GO:2990
CASE:0x40A:GO:2990
CASE:19:GO:2990
CASE:18:GO:2990
CASE:0x40B:GO:2990
CASE:0x41D:GO:2990
CASE:11:GO:2989
CASE:17:GO:2988
CASE:0x409:GO:2988
CASE:30:GO:2986
CASE:12:GO:2990
CASE:13:GO:2987
CASE:33:GO:2987
CASE:0x408:GO:2987
CASE:49:GO:2985
CASE:50:GO:2985
CASE:0x414:GO:2985
CASE:39:GO:2983
CASE:0x425:GO:2983
CASE:34:GO:2984
CASE:40:GO:2981
CASE:32:GO:2993
CASE:0x443:GO:2994
CASE:31:GO:2995
CASE:0x444:GO:2996
WAIT:1
IF:VoiceCmd:>:0:THEN
CALL:G_STATION_HUH?
ENDIF
RET:1
:2981
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:MOVE_HEAD:-90:0
:2982
CALL:G_WAIT_AWARE
RET:2
:2983
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:MOVE_HEAD:0:0
GO:2982
:2984
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:MOVE_HEAD:90:0
GO:2982
:2985
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:O2_STATION_SING
GO:2982
:2986
CALL:G_QUERY_TIRED
RET:2
:2987
CALL:G_STATION_SHUTDOWN
CASE:1:RET:2
RET:2
:2988
CALL:G_QUERY_MOOD
RET:2
:2989
CALL:G_QUERY_HUNGRY
CASE:1:RET:2
RET:2
:2990
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:O2_STATION_WINK
CALL:G_WAIT_AWARE
RET:2
:2992
CALL:G_VOICE_HIT
CALL:G_SOCCER_LOOK4BALL
CASE:2:RET:2
CALL:G_RANDOM2
CASE:1:PLAY:ACTION+:ummm
CASE:2:PLAY:ACTION:O2_OHWELL
WAIT
RET:2
:2993
CALL:G_PLAYBACK_AIBONAME
RET:2
:2994
CALL:G_PLAYBACK_OWNERNAME
RET:2
:2995
CALL:G_NAME_REGISTRATION
RET:2
:2996
CALL:G_OWNER_REGISTRATION
RET:2
:G_STATIONPOS
RND:bored_count:3:10
SET:nosecount:0
CALL:G_CLEAR_SENSORS
:3002
SET:Clock:0
RND:maxtime1:3:10
RND:maxtime2:0:2
RND:maxtime3:5:10
SET:tailwag:0
SET:tracking:0
IF:mood_happy:>:3:CALL:G_START_TAILWAG_SLOW
:3004
WAIT:1
IF_1ST:Batt_Rest:>=:20
IF_AND:40:<=:45
IF_AND:Batt_Temp:<=:45:3006
:3005
CALL:G_STOP_HEADTAIL
RET:1
:3006
WAIT:1
SWITCH:Posture1
CASE:7:GO:3007
CASE:5:GO:3007
CASE:255:GO:3007
GO:3005
:3007
CALL:G_REST_TIMER
WAIT:1
PUSH:tracking
PUSH:0
EQ
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
PLAY:ACTION:TRACK_HEAD:PINK_BALL
SET:tracking:1
ELSE
SET:tracking:0
ENDIF
:3010
CALL:G_SLEEP_ATTENTION
CASE:100:GO:3031
CASE:112:GO:3030
CASE:111:GO:3029
CASE:113:GO:3026
CASE:102:GO:3031
CASE:104:GO:3031
CASE:105:GO:3031
CASE:106:GO:3031
CASE:103:GO:3031
CALL:G_STATION_VOICE_HANDLER
CASE:1:GO:3013
CASE:2:GO:3012
:3012
ADD:change_thres:2
GO:3002
:3013
CALL:G_SLEEP_NOSE_SENSE
CALL:G_TIMER1
CASE:1:GO:3004
CALL:G_STOP_HEADTAIL
RND:maxtime1:3:10
SUB:bored_count:1
IF_1ST:rcodeplus:=:0:3018
IF_1ST:AP_Voice_Cmd:=:0:3018
IF_1ST:AP_Voice_Level:>=:2:3010
:3018
RND:rndnum:0:100
IF_1ST:rndnum:>=:90:3020
IF_1ST:rndnum:>:33
IF_AND:bored_count:<:3:3022
IF_1ST:rndnum:>:66
IF_AND:bored_count:>=:3
IF_AND:mood_happy:>:5:3021
:3020
CALL:G_STATION_CALM
ADD:change_thres:2
GO:3002
:3021
CALL:G_STATION_TALKING
ADD:change_thres:2
GO:3002
:3022
CALL:G_STATION_BORED
WAIT:1
CALL:F_FAVCOLOR
POP:reTempVar0
IF:reTempVar0:<>:0:3012
CALL:G_DEC_HAPPY_MOOD
CALL:G_BEHAVIOR_BORED
ADD:change_thres:2
GO:3002
:3026
CALL:G_SCOLD_REST
:3027
RND:bored_count:5:10
CALL:G_CLEAR_SENSORS
ADD:change_thres:2
GO:3002
:3029
CALL:G_SLEEP_PETTED
GO:3027
:3030
CALL:G_PRAISE_REST
GO:3027
:3031
CALL:G_LOOK_TIMER
GO:3013
:G_SLEEPPOS
CALL:G_INIT_SLEEPPOS
:SLEEP_LOOP
CALL:G_UPDATE_PAUSEBAR
SET:Clock:0
RND:maxtime1:3:10
RND:maxtime2:0:2
RND:maxtime3:5:10
SET:tailwag:0
SET:tilt:Head_Tilt
SET:pan:Head_Pan
IF:mood_happy:>:3:CALL:G_START_TAILWAG_SLOW
:2257
CALL:F_NEED2REST
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
CALL:G_STOP_TAILWAG
RET:102
ENDIF
WAIT:50
CALL:G_REST_TIMER
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:SLEEP_SEEBALL
:SLEEP_CHECKATTENTION
CALL:G_SLEEP_ATTENTION
CASE:100:GO:2289
CASE:112:GO:2288
CASE:111:GO:2287
CASE:113:GO:2284
CASE:103:GO:SLEEP_NEXTLOOP
CASE:102:RET:102
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
:SLEEP_PROCESSVOICE
CALL:G_YART_VoiceCmd
CASE:102:RET:102
CASE:103:GO:SLEEP_NEXTLOOP
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
CASE:107:RET:107
IF:sitonly:>:0:THEN
CALL:G_CUSTOM_SLEEP_VOICECMD
CASE:102:RET:102
CASE:103:GO:SLEEP_NEXTLOOP
CASE:104:RET:104
CASE:105:GO:SLEEP_NEXTLOOP
CASE:106:GO:SLEEP_NEXTLOOP
CASE:107:GO:SLEEP_NEXTLOOP
CASE:115:GO:SLEEP_NEXTLOOP
ELSE
CALL:G_CUSTOM_SLEEP_VOICECMD
CASE:102:RET:102
CASE:103:GO:SLEEP_NEXTLOOP
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
CASE:107:RET:107
CASE:115:GO:SLEEP_NEXTLOOP
ENDIF
CALL:G_SLEEP_VOICE_HANDLER
CASE:102:RET:102
CASE:103:GO:SLEEP_NEXTLOOP
CASE:104:RET:104
CASE:105:RET:105
CASE:107:RET:107
CASE:106:RET:106
:2265
CALL:G_SLEEP_NOSE_SENSE
CALL:G_BORED_TIMER
CASE:1:GO:2257
PUSH:AP_Voice_Cmd
PUSH:0
NE
POP:reTempVar0
PUSH:AP_Voice_Level
PUSH:2
GE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:SLEEP_CHECKATTENTION
RND:rndnum:0:100
PUSH:sitonly
PUSH:0
EQ
POP:reTempVar0
PUSH:rndnum
PUSH:10
LE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:mood_tired
PUSH:5
LE
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:bored_count
PUSH:1
LT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
RET:106
ENDIF
IF:rndnum:<=:20:THEN
SET:sleepsit:1
RET:104
ENDIF
IF_1ST:rndnum:<:change_thres:SLEEP_CHANGEPOS
IF:rndnum:<:90:THEN
RND:rndnum:0:100
PUSH:mood_sad
PUSH:5
GT
POP:reTempVar0
PUSH:rndnum
PUSH:mood_sad
PUSH:5
SUB
PUSH:10
MUL
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_SAD
GO:SLEEP_LOOP
ENDIF
PUSH:rndnum
PUSH:33
GT
POP:reTempVar0
PUSH:rndnum
PUSH:40
LT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:bored_count
PUSH:4
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:sleepstate:2
CALL:G_READBOOK
CASE:100:GO:SLEEP_LOOP
CASE:107:GO:SLEEP_SEEBALL
CASE:114:GO:SLEEP_PROCESSVOICE
ELSE
PUSH:rndnum
PUSH:33
GT
POP:reTempVar0
PUSH:bored_count
PUSH:3
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_YART_Bored_Sleep
CASE:102:RET:102
CASE:103:GO:SLEEP_LOOP
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
CALL:G_SLEEP_BORED
CALL:G_BEHAVIOR_BORED
ADD:change_thres:2
GO:SLEEP_LOOP
ENDIF
ENDIF
PUSH:rndnum
PUSH:66
GT
POP:reTempVar0
PUSH:bored_count
PUSH:3
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:mood_happy
PUSH:5
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
CALL:G_YART_Happy_Sleep
CASE:102:RET:102
CASE:103:GO:SLEEP_LOOP
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
CALL:G_SLEEP_HAPPY
ADD:change_thres:2
GO:SLEEP_LOOP
ENDIF
PUSH:rndnum
PUSH:66
GT
POP:reTempVar0
PUSH:bored_count
PUSH:3
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:mood_happy
PUSH:2
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
CALL:G_SLEEP_TAILSONG
ADD:change_thres:2
GO:SLEEP_LOOP
ENDIF
ENDIF
CALL:G_YART_Calm_Sleep
CASE:102:RET:102
CASE:103:GO:SLEEP_LOOP
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
CALL:G_SLEEP_CALM
:SLEEP_NEXTLOOP
ADD:change_thres:2
GO:SLEEP_LOOP
:SLEEP_CHANGEPOS
CALL:G_SLEEP_CHANGEPOS
GO:SLEEP_NEXTLOOP
:2284
CALL:G_SCOLD_REST
:2285
RND:bored_count:5:10
CALL:G_CLEAR_SENSORS
GO:SLEEP_NEXTLOOP
:2287
CALL:G_SLEEP_PETTED
GO:2285
:2288
CALL:G_PRAISE_REST
GO:2285
:2289
CALL:G_LOOK_TIMER
GO:2265
:SLEEP_SEEBALL
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar0
PUSH:reTempVar0
CALL:F_RND100
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar1
PUSH:25
LT
POP:reTempVar2
IF:reTempVar0:&&:reTempVar2:THEN
PLAY:ACTION:TRACK_HEAD:PINK_BALL
WAIT:1000
SET:kick_pan:Head_Pan
SET:kick_tilt:Head_Tilt
SET:swing_kick:0
PUSH:Head_Pan
CALL:F_ABS:1
PUSH:Head_Tilt
PUSH:35
PUSH:-40
PUSH:60
PUSH:-70
CALL:F_TRIANGLE_HIT:6
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
IF:Head_Pan:<:0:THEN
SET:swing_kick:100
ELSE
SET:swing_kick:101
ENDIF
ENDIF
PUSH:Head_Tilt
PUSH:-45
GT
POP:reTempVar0
PUSH:Head_Tilt
PUSH:-20
LT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:reTempVar0
PUSH:reTempVar1
PUSH:Head_Pan
CALL:F_ABS:1
POP:reTempVar2
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar2
PUSH:10
LT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
SET:swing_kick:102
ENDIF
SET:init_wait:Wait
SWITCH:swing_kick
CASE:100:PLAY:ACTION:kick_sleeppos_left
CASE:101:PLAY:ACTION:kick_sleeppos_right
CASE:102:PLAY:ACTION:kick_sleeppos_center
IF:swing_kick:>:0:THEN
CALL:G_WAIT
CALL:G_SOCCER_KICK_MOOD
ENDIF
ENDIF
CALL:G_STAND4BALL
CASE:100:RET:105
CASE:102:RET:102
CASE:107:RET:107
GO:SLEEP_CHECKATTENTION
:F_TRIANGLE_HIT
ARG:x
ARG:y
ARG:xul
ARG:yul
ARG:xlr
ARG:ylr
SET:Context:0
CSET:x:<:xul:1
CSET:x:>:xlr:1
CSET:y:>:ylr:1
IF:Context:<>:0:THEN
RETURN:0
ENDIF
PUSH:y
PUSH:x
PUSH:xul
SUB
PUSH:ylr
PUSH:yul
SUB
MUL
PUSH:xlr
PUSH:xul
SUB
DIV
PUSH:yul
ADD
LE
POP:reTempVar0
RETURN:reTempVar0
:G_INIT_SLEEPPOS
SET:sleepstate:0
SET:change_thres:40
SET:nosecount:0
SET:back_count:0
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:LIE
CALL:G_WAIT
CALL:G_CLEAR_SENSORS
WAIT:1
IF_1ST:sleepsit:>:0
IF_AND:bored_count:<:3:1247
IF_1ST:sleepsit:>:0:1246
RND:bored_count:3:10
:1246
SET:sleepsit:0
SET:tiltadj:Head_Tilt
RET:1
:1247
RND:bored_count:3:5
SET:sleepsit:0
SET:tiltadj:Head_Tilt
RET:1
:G_SLEEP_ATTENTION
CALL:G_ATTENTION_HANDLER
CASE:112:RET:112
CASE:111:RET:111
CASE:113:RET:113
CASE:114:RET:114
CASE:102:RET:102
CASE:103:RET:103
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
CALL:G_TAIL_TWEAKED
CASE:2:RET:112
CASE:3:RET:113
CASE:4:RET:114
WAIT:1
IF:RFLeg_ON:<>:0:THEN
ADD:pet:8
SET:RFLeg_ON:0
SET:back_count:0
ENDIF
IF:LFLeg_ON:<>:0:THEN
ADD:pet:16
SET:LFLeg_ON:0
SET:back_count:0
ENDIF
IF:sleepstate:!=:0:THEN
PUSH:RRLeg_3
PUSH:30
LT
POP:reTempVar0
PUSH:RRLeg_ON
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
ADD:pet:32
SET:RRLeg_ON:0
SET:back_count:0
ENDIF
PUSH:LRLeg_3
PUSH:30
LT
POP:reTempVar0
PUSH:LRLeg_ON
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
ADD:pet:64
SET:LRLeg_ON:0
SET:back_count:0
ENDIF
ENDIF
IF:pet:==:0:THEN
RET:100
ENDIF
RET:111
:G_SLEEP_BORED
:1954
SWITCH:sleepstate
CASE:0:GO:1986
CASE:1:GO:1975
CASE:2:GO:1963
SET:rndbase:250
SET:rndcount:2
SET:lastact1:last_boredact
SET:lastact2:last_boredact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1962
CASE:3:RET:1
IF_1ST:rndnum:=:250:1961
PLAY:ACTION:O2_HOWL_BELLY2
SET:last_boredact:rndnum
:4119
WAIT
RET:1
:1961
PLAY:ACTION:O2_HOWL_BELLY1
SET:last_boredact:rndnum
GO:4119
:1962
CALL:G_SLEEP_PICKPOS
GO:1954
:1963
SET:rndbase:200
SET:rndcount:8
SET:lastact1:last_boredact
SET:lastact2:last_boredact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1962
CASE:3:RET:1
SWITCH:rndnum
CASE:200:PLAY:ACTION:O2_ANYONE_THERE1
CASE:201:PLAY:ACTION:O2_ANYONE_THERE2
CASE:202:PLAY:ACTION:O2_ANYONE_THERE3
CASE:203:PLAY:ACTION:O2_ANYONE_THERE4
CASE:204:PLAY:ACTION:O2_BORED_SLEEP1
CASE:205:PLAY:ACTION:O2_HOWL_SLEEP1
CASE:206:PLAY:ACTION:O2_HOWL_SLEEP2
CASE:207:PLAY:ACTION:O2_PET_ME
SET:last_boredact:rndnum
WAIT
RET:1
:1975
SET:rndbase:150
SET:rndcount:7
SET:lastact1:last_boredact
SET:lastact2:last_boredact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1962
CASE:3:RET:1
SWITCH:rndnum
CASE:150:PLAY:ACTION:O2_BORED_SLEEP5
CASE:151:PLAY:ACTION:O2_BORED_SLEEP6
CASE:152:PLAY:ACTION:O2_BORED_SLEEP7
CASE:153:PLAY:ACTION:O2_BORED_SLEEP8
CASE:154:PLAY:ACTION:O2_BORED_SLEEP9
CASE:155:PLAY:ACTION:O2_BORED_SLEEP10
CASE:156:PLAY:ACTION:O2_TWITCHY
SET:last_boredact:rndnum
WAIT
RET:1
:1986
SET:rndbase:100
SET:rndcount:10
SET:lastact1:last_boredact
SET:lastact2:last_boredact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1962
CASE:3:RET:1
SWITCH:rndnum
CASE:100:PLAY:ACTION:O2_BORED_SLEEP2
CASE:101:PLAY:ACTION:O2_BORED_SLEEP3
CASE:102:PLAY:ACTION:O2_BORED_SLEEP4
CASE:103:PLAY:ACTION:O2_NOBI1
CASE:104:PLAY:ACTION:O2_NOBI2
CASE:105:PLAY:ACTION:O2_NOBI3
CASE:106:PLAY:ACTION:O2_WANT_ATTENTION_SLEEP1
CASE:107:PLAY:ACTION:O2_WANT_ATTENTION_SLEEP2
CASE:108:PLAY:ACTION:O2_IMPATIENT_SLEEP
CASE:109:GO:SLEEP_CALL_OWNERNAME
SET:last_boredact:rndnum
WAIT
RET:1
:SLEEP_CALL_OWNERNAME
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:10:G_PLAYBACK_OWNERNAME
RET:1
:G_SLEEP_CALM
:2001
SWITCH:sleepstate
CASE:0:GO:2036
CASE:1:GO:2023
CASE:2:GO:2019
SET:rndbase:700
SET:rndcount:10
SET:lastact1:last_calmact
SET:lastact2:last_calmact2
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:2018
CASE:3:RET:1
SWITCH:rndnum
CASE:700:PLAY:ACTION:O2_CONFUSED1
CASE:701:PLAY:ACTION:O2_CONFUSED2
CASE:702:PLAY:ACTION:O2_OHWELL
CASE:703:PLAY:ACTION:O2_BOTH_EAR_TWITCH4
CASE:704:PLAY:ACTION:O2_BOTH_EAR_TWITCH5
CASE:705:PLAY:ACTION:O2_WAVE_LEFT_BELLY1
CASE:706:PLAY:ACTION:O2_WAVE_LEFT_BELLY2
CASE:707:PLAY:ACTION:O2_WAVE_RIGHT_BELLY1
CASE:708:PLAY:ACTION:O2_WAVE_RIGHT_BELLY2
CASE:709:PLAY:ACTION:O2_THINKING_BELLY
CALL:G_WAITZERO
SET:last_calmact2:last_calmact
SET:last_calmact:rndnum
RET:1
:2018
CALL:G_SLEEP_PICKPOS
GO:2001
:2019
RND:rndnum:650:650
IF_1ST:rndnum:=:last_calmact:2018
IF_1ST:rndnum:=:last_calmact2:2018
PLAY:ACTION:O2_LOOKAROUND_SLEEP1
CALL:G_WAITZERO
SET:last_calmact2:last_calmact
SET:last_calmact:rndnum
RET:1
:2023
SET:rndbase:600
SET:rndcount:9
SET:lastact1:last_calmact
SET:lastact2:last_calmact2
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:2018
CASE:3:RET:1
SWITCH:rndnum
CASE:600:PLAY:ACTION:O2_PLAY_VIOLIN
CASE:601:PLAY:ACTION:O2_TAP_REARRIGHT
CASE:602:PLAY:ACTION:O2_SMOKING
CASE:603:PLAY:ACTION:O2_SNEEZE
CASE:604:PLAY:ACTION:O2_CUTE_BOXING
CASE:605:PLAY:ACTION:O2_SCRATCH_REAR
CASE:606:PLAY:ACTION:O2_DRINKING
CASE:607:PLAY:ACTION:O2_LOOKAROUND_SLEEP3
CASE:608:PLAY:ACTION:O2_EATING
CALL:G_WAITZERO
SET:last_calmact2:last_calmact
SET:last_calmact:rndnum
RET:1
:2036
SET:rndbase:550
SET:rndcount:8
SET:lastact1:last_calmact
SET:lastact2:last_calmact2
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:2018
CASE:3:RET:1
SWITCH:rndnum
CASE:550:PLAY:ACTION:O2_HICCUPS_SLEEP
CASE:551:PLAY:ACTION:O2_YOGA
CASE:552:PLAY:ACTION:O2_CUTE_EXERCISE1
CASE:553:PLAY:ACTION:O2_CUTE_EXERCISE2
CASE:554:PLAY:ACTION:O2_CUTE_EXERCISE4
CASE:555:PLAY:ACTION:O2_SCRATCH_LEFTEAR2
CASE:556:PLAY:ACTION:O2_THINKING_SLEEP
CASE:557:PLAY:ACTION:O2_LOOKAROUND_SLEEP2
CALL:G_WAITZERO
SET:last_calmact2:last_calmact
SET:last_calmact:rndnum
RET:1
:G_SLEEP_CHANGEPOS
CALL:G_SLEEP_PICKPOS
SWITCH:sleepstate
CASE:0:PLAY:ACTION:LIE
CASE:1:PLAY:ACTION:O2_SLEEPWIDE
CASE:2:PLAY:ACTION:O2_SLEEPFLAT
CASE:3:PLAY:ACTION:O2_BELLYPOS
SET:change_thres:15
WAIT
CALL:G_CLEAR_SENSORS
RET:1
:G_SLEEP_DANCE
:2060
SWITCH:sleepstate
CASE:0:GO:2086
CASE:1:GO:2077
CASE:2:GO:2073
SET:rndbase:900
SET:rndcount:6
SET:lastact1:last_danceact
SET:lastact2:last_danceact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:2072
CASE:3:RET:1
SWITCH:rndnum
CASE:900:PLAY:ACTION:O2_DANCE_BELLY1
CASE:901:PLAY:ACTION:O2_DANCE_BELLY2
CASE:902:PLAY:ACTION:O2_DANCE_BELLY3
CASE:903:PLAY:ACTION:O2_DANCE_BELLY4
CASE:904:PLAY:ACTION:O2_DANCE_BELLY5
CASE:905:PLAY:ACTION:O2_DANCE_BELLY6
SET:last_danceact:rndnum
WAIT
RET:1
:2072
CALL:G_SLEEP_PICKPOS
GO:2060
:2073
RND:rndnum:200:200
IF_1ST:rndnum:=:last_danceact:2072
PLAY:ACTION:O2_DANCE_SLEEP1
SET:last_danceact:rndnum
WAIT
RET:1
:2077
SET:rndbase:800
SET:rndcount:5
SET:lastact1:last_danceact
SET:lastact2:last_danceact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:2072
CASE:3:RET:1
SWITCH:rndnum
CASE:800:PLAY:ACTION:O2_DANCE_SLEEP5
CASE:801:PLAY:ACTION:O2_DANCE_SLEEP6
CASE:802:PLAY:ACTION:O2_DANCE_SLEEP7
CASE:803:PLAY:ACTION:O2_SONG_SLEEP1
CASE:804:PLAY:ACTION:O2_SONG_SLEEP2
SET:last_danceact:rndnum
WAIT
RET:1
:2086
SET:rndbase:750
SET:rndcount:6
SET:lastact1:last_danceact
SET:lastact2:last_danceact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:2072
CASE:3:RET:1
SWITCH:rndnum
CASE:750:PLAY:ACTION:O2_DANCE_SLEEP2
CASE:751:PLAY:ACTION:O2_DANCE_SLEEP3
CASE:752:PLAY:ACTION:O2_DANCE_SLEEP4
CASE:753:PLAY:ACTION:foot_loose
CASE:754:PLAY:ACTION:acdc_sleeppos
CASE:755:PLAY:ACTION:popgoes_sleeppos
SET:last_danceact:rndnum
WAIT
RET:1
:G_SLEEP_GREET
WAIT:1
SET:init_wait:Wait
CALL:G_RANDOM1/3
CASE:1:GO:2110
:2097
SWITCH:sleepstate
CASE:0:GO:2107
CASE:1:GO:2104
CALL:G_RANDOM4
CASE:1:PLAY:ACTION:O2_WAVE_LEFT_BELLY1
CASE:2:PLAY:ACTION:O2_WAVE_LEFT_BELLY2
CASE:3:PLAY:ACTION:O2_WAVE_RIGHT_BELLY1
CASE:4:PLAY:ACTION:O2_WAVE_RIGHT_BELLY2
SET:sleepstate:3
:2100
CALL:G_WAIT_AWARE
RET:1
:2104
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_SHYWAVE1
CASE:2:PLAY:ACTION:O2_SHYWAVE2
SET:sleepstate:1
GO:2100
:2107
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_WAVE_LEFT_SLEEP
CASE:2:PLAY:ACTION:O2_WAVE_RIGHT_SLEEP
SET:sleepstate:0
GO:2100
:2110
CALL:G_SLEEP_PICKPOS
GO:2097
:G_SLEEP_HAPPY
:2113
SWITCH:sleepstate
CASE:0:GO:2140
CASE:1:GO:2130
CASE:2:GO:2126
SET:rndbase:450
SET:rndcount:6
SET:lastact1:last_happyact
SET:lastact2:last_happyact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:2125
CASE:3:RET:1
SWITCH:rndnum
CASE:450:PLAY:ACTION:O2_DANCE_BELLY1
CASE:451:PLAY:ACTION:O2_DANCE_BELLY2
CASE:452:PLAY:ACTION:O2_DANCE_BELLY3
CASE:453:PLAY:ACTION:O2_DANCE_BELLY4
CASE:454:PLAY:ACTION:O2_DANCE_BELLY5
CASE:455:PLAY:ACTION:O2_DANCE_BELLY6
SET:last_happyact:rndnum
WAIT
RET:1
:2125
CALL:G_SLEEP_PICKPOS
GO:2113
:2126
RND:rndnum:400:400
IF_1ST:rndnum:=:last_happyact:2125
PLAY:ACTION:O2_DANCE_SLEEP1
SET:last_happyact:rndnum
WAIT
RET:1
:2130
SET:rndbase:350
SET:rndcount:6
SET:lastact1:last_happyact
SET:lastact2:last_happyact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:2125
CASE:3:RET:1
SWITCH:rndnum
CASE:350:PLAY:ACTION:O2_DANCE_SLEEP5
CASE:351:PLAY:ACTION:O2_DANCE_SLEEP6
CASE:352:PLAY:ACTION:O2_DANCE_SLEEP7
CASE:353:PLAY:ACTION:O2_LAUGH
CASE:354:PLAY:ACTION:O2_SONG_SLEEP1
CASE:355:PLAY:ACTION:O2_SONG_SLEEP2
SET:last_happyact:rndnum
WAIT
RET:1
:2140
SET:rndbase:300
SET:rndcount:3
SET:lastact1:last_happyact
SET:lastact2:last_happyact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:2125
CASE:3:RET:1
SWITCH:rndnum
CASE:300:PLAY:ACTION:O2_DANCE_SLEEP2
CASE:301:PLAY:ACTION:O2_DANCE_SLEEP3
CASE:302:PLAY:ACTION:O2_DANCE_SLEEP4
SET:last_happyact:rndnum
WAIT
RET:1
:G_SLEEP_NOSE_SENSE
WAIT:1
PUSH:Distance
PUSH:200
LT
POP:reTempVar0
PUSH:Head_Tilt
PUSH:-25
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:nosecount
PUSH:3
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:reTempVar0
PUSH:reTempVar1
PUSH:reTempVar2
CALL:F_RND100
POP:reTempVar3
POP:reTempVar2
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar3
PUSH:33
LT
POP:reTempVar4
LAND:reTempVar0:reTempVar4
IF:reTempVar0:<>:0:THEN
PUSH:Wait
PUSH:0
EQ
POP:reTempVar0
PUSH:Wait
PUSH:1
EQ
POP:reTempVar1
PUSH:tailwag
PUSH:0
GT
POP:reTempVar2
LAND:reTempVar1:reTempVar2
IF:reTempVar0:||:reTempVar1:THEN
SET:reTempVar0:nosecount
ADD:nosecount:1
SET:init_wait:Wait
CALL:G_RANDOM4
CASE:1:PLAY:ACTION:O2_LOOKAWAY_LEFT_SLEEP1
CASE:2:PLAY:ACTION:O2_LOOKAWAY_RIGHT_SLEEP1
CASE:3:PLAY:ACTION:sniff_once
CASE:4:PLAY:ACTION:sniff_twice
SET:sleepstate:0
CALL:G_WAIT_AWARE
ENDIF
ENDIF
RET:1
:G_SLEEP_PETTED
WAIT:1
SET:init_wait:Wait
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:O2_TUNE_PETTED1
CASE:2:PLAY:ACTION:O2_TUNE_PETTED2
CASE:3:GO:2160
CALL:G_WAIT
CALL:F_RND100
POP:reTempVar0
PUSH:mood_happy
PUSH:4
GT
POP:reTempVar1
IF:reTempVar1:!=:0:THEN
SET:reTempVar1:66
ELSE
SET:reTempVar1:33
ENDIF
IF:reTempVar0:>:reTempVar1:2167
:2160
WAIT:1
SET:init_wait:Wait
IF:back_count:>:4:THEN
RND:rndnum:0:1
SWITCH:rndnum
CASE:0:PLAY:ACTION+:petting_kick_sleep_left
CASE:1:PLAY:ACTION+:petting_kick_sleep_right
CALL:G_WAIT
SET:sleepstate:0
SET:last_petsong:999
SET:Back_ON:0
ELSE
:reTempLbl22
RND:rndnum:0:5
IF:rndnum:==:last_petsong:reTempLbl22
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_BEEN_PETTED15
CASE:0:SET:sleepstate:0
CASE:1:PLAY:ACTION:O2_BEEN_PETTED16
CASE:1:SET:sleepstate:0
CASE:2:PLAY:ACTION:O2_BEEN_PETTED17
CASE:2:SET:sleepstate:0
CASE:3:PLAY:ACTION:O2_BEEN_PETTED18
CASE:4:PLAY:ACTION:O2_BEEN_PETTED19
CASE:5:PLAY:ACTION:O2_BEEN_PETTED20
SET:last_petsong:rndnum
CALL:G_WAIT
ENDIF
:2167
CALL:G_INC_HAPPY_MOOD
CALL:G_DEC_MAD_MOOD
CALL:G_DEC_SAD_MOOD
RET:1
:G_SLEEP_PICKPOS
RND:rndnum:0:3
IF:rndnum:==:sleepstate:G_SLEEP_PICKPOS
SET:sleepstate:rndnum
RET:1
:G_SLEEP_TAILSONG
SET:rndbase:500
SET:rndcount:6
CALL:F_BEHAVIOR_RNDN
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
SWITCH:rndnum
CASE:500:PLAY:ACTION:O2_TAILWAG_SONG1
CASE:501:PLAY:ACTION:O2_TAILWAG_SONG2
CASE:502:PLAY:ACTION:O2_TAILWAG_SONG3
CASE:503:PLAY:ACTION:O2_TAILWAG_SONG4
CASE:504:PLAY:ACTION:O2_TAILWAG_SONG5
CASE:505:PLAY:ACTION:O2_TAILWAG_SONG6
SET:sleepstate:0
CALL:G_WAITZERO
ENDIF
RET:1
:G_SLEEP_VOICE_HANDLER
CALL:G_STOP_HEAD
SWITCH:VoiceCmd
CASE:999:GO:2222
CASE:52:GO:GSL_WALK
CASE:38:GO:GSL_FINDBALL
CASE:16:GO:GSL_FINDBALL
CASE:0x429:GO:GSL_FINDBALL
CASE:0x42A:GO:GSL_FINDBALL
CASE:0x42C:GO:GSL_FINDBALL
CASE:0x42B:GO:GSL_FINDBALL
CASE:0x42D:GO:GSL_FINDBALL
CASE:29:GO:2231
CASE:0x416:GO:2231
CASE:0x419:GO:2231
CASE:17:GO:2230
CASE:0x409:GO:2230
CASE:13:GO:2229
CASE:33:GO:2229
CASE:1:GO:2226
CASE:0x40A:GO:2226
CASE:12:GO:2226
CASE:19:GO:2226
CASE:0x40B:GO:2226
CASE:0x41D:GO:2226
CASE:18:GO:2226
CASE:30:GO:2225
CASE:36:GO:2223
CASE:49:GO:2223
CASE:11:GO:2221
CASE:49:GO:2220
CASE:50:GO:2220
CASE:0x414:GO:2220
CASE:34:GO:2219
CASE:39:GO:2218
CASE:40:GO:2217
CASE:5:GO:2216
CASE:7:GO:2215
CASE:27:GO:2215
CASE:8:GO:2213
CASE:2:GO:2211
CASE:10:GO:2211
CASE:6:GO:2209
CASE:3:GO:2208
CASE:14:GO:2207
CASE:0x40E:GO:2207
CASE:37:GO:2206
CASE:0x418:GO:2206
CASE:32:GO:2232
CASE:0x443:GO:2233
CASE:31:GO:2234
CASE:0x444:GO:2235
RET:115
:2206
CALL:G_SIT_POSE
RET:104
:2207
CALL:G_KARATE_CHOP
RET:104
:2208
CALL:G_Select_Game
RET:104
:2209
CALL:G_VOICE_HIT
CALL:G_SIT_OTHERHAND
RET:104
:2211
CALL:G_VOICE_HIT
CALL:G_SIT_SHAKEHANDS
RET:104
:2213
CALL:G_VOICE_HIT
PLAY:ACTION:SIT
CALL:G_WAITZERO
RET:104
:2215
CALL:G_CHECK_STAYSIT
CASE:115:RET:115
CALL:G_STAND_UP
RET:105
:2216
CALL:G_CHECK_STAYSIT
CASE:115:RET:115
CALL:G_GO_BACK
RET:105
:2217
CALL:G_LAZY_GORIGHT
CASE:1:RET:103
RET:105
:2218
CALL:G_CHECK_STAYSIT
CASE:115:RET:115
CALL:G_GO_FORWARD
RET:105
:2219
CALL:G_LAZY_GOLEFT
CASE:1:RET:103
RET:105
:2220
CALL:G_CHECK_STAYSIT
CASE:115:RET:115
CALL:G_STAND_BARK
RET:105
:2221
CALL:G_QUERY_HUNGRY
CASE:1:RET:103
RET:104
:2222
CALL:G_SLEEP_RHYTHM
RET:103
:2223
CALL:G_VOICE_HIT
AP_GET:reTempVar0:behavior:24
IF:reTempVar0:>:0:THEN
CALL:G_DEC_HAPPY_MOOD
CALL:G_INC_MAD_MOOD
CALL:G_INC_SAD_MOOD
PLAY:ACTION:O2_DONTWANNA4
CALL:G_WAITZERO
RET:103
ENDIF
IF:sitonly:==:0:THEN
SET:NoFallDown:1
PLAY:ACTION:playdead_sleep
CALL:G_WAITZERO
SET:NoFallDown:0
PLAY:MWCID:2514
CALL:G_WAITZERO
PLAY:ACTION:O2_SHUDDER
CALL:G_WAITZERO
RET:105
ENDIF
RET:103
:2225
CALL:G_QUERY_TIRED
RET:103
:2226
RND:rndnum:1:4
IF:rndnum:>:2:THEN
CALL:G_SLEEP_GREET
RET:103
ENDIF
WAIT:1
SET:init_wait:Wait
IF:rndnum:==:1:THEN
PLAY:ACTION:O2_HELLO_SLEEP
ELSE
SWITCH:VoiceHorz
CASE:1:PLAY:ACTION:hello_front
CASE:2:PLAY:ACTION:hello_right
CASE:4:PLAY:ACTION:hello_right
CASE:8:PLAY:ACTION:hello_right
CASE:16:PLAY:ACTION:hello_front
CASE:32:PLAY:ACTION:hello_left
CASE:64:PLAY:ACTION:hello_left
CASE:128:PLAY:ACTION:hello_left
ENDIF
CALL:G_WAIT_AWARE
RET:103
:2229
CALL:G_SLEEP_GREET
RET:103
:2230
CALL:G_QUERY_MOOD
RET:103
:2231
CALL:G_TWITCH_EARS
CALL:G_SLEEP_DANCE
RET:103
:2232
CALL:G_PLAYBACK_AIBONAME
RET:103
:2233
CALL:G_PLAYBACK_OWNERNAME
RET:103
:2234
CALL:G_NAME_REGISTRATION
RET:104
:2235
CALL:G_OWNER_REGISTRATION
IF:Posture1:==:2:THEN
RET:104
ENDIF
RET:103
:GSL_WALK
CALL:G_WALK_REQUEST
CASE:1:RET:106
RET:103
:GSL_FINDBALL
CALL:G_VOICE_HIT
PUSH:mood_tired
PUSH:9
GE
POP:reTempVar0
PUSH:mood_mad
PUSH:5
GT
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
PUSH:sitonly
PUSH:0
GT
POP:reTempVar2
LIOR:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
CALL:G_SOCCER_LOOK4BALL
RET:103
ENDIF
CALL:G_SOCCER_SEARCH4BALL
CASE:1:RET:102
CASE:3:GO:GSL_NOBALL
IF:mood_tired:>=:7:GSL_NOBALL
PUSH:Posture1
PUSH:1
EQ
POP:reTempVar0
PUSH:Posture1
PUSH:4
EQ
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
RET:107
ENDIF
SET:pan:Head_Pan
SET:tilt:Head_Tilt
SUB:tilt:tiltadj
SUB:tilt:15
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:STAND
CALL:G_WAIT_AWARE
PLAY:ACTION:MOVE.HEAD.NORMAL:pan:tilt
CALL:G_WAIT_AWARE
IF:Pink_Ball:!=:0:THEN
RET:107
ENDIF
CALL:G_SOCCER_SEARCH4BALL
CASE:1:RET:102
CASE:2:RET:107
RET:103
:GSL_NOBALL
IF:Posture1:<>:3:THEN
PLAY:ACTION:LIE
CALL:G_WAITZERO
ENDIF
RET:103
:G_SLEEP_RHYTHM
SET:rndbase:1850
SET:rndcount:4
CALL:G_BEHAVIOR_RNDNM
CASE:3:RET:1
SWITCH:rndnum
CASE:1850:PLAY:ACTION+:dancestep_aibosleep
CASE:1851:PLAY:ACTION+:dancestep_sleep1
CASE:1852:PLAY:ACTION+:dancestep_sleep2
CASE:1853:PLAY:ACTION+:dancestep_sleep3
WAIT
RET:1
:G_READBOOK
RND:rb_readtimer:15:45
:RB_STARTBOOK
PLAY:ACTION:reading_start
CALL:G_WAITZERO
SET:Clock:0
:RB_LOOP
WAIT:1
IF:Clock:<:0:THEN
SET:Clock:0
ENDIF
IF:Clock:>:32:THEN
SET:Clock:0
SUB:rb_readtimer:1
IF:rb_readtimer:<:0:RB_STOPBOOK
CALL:G_RB_PLAYSKIT
ENDIF
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:RB_SEEBALL
CALL:G_RB_ATTENTION
CASE:112:GO:RB_PRAISE
CASE:113:GO:RB_SCOLD
CASE:114:GO:RB_VOICE
GO:RB_LOOP
:RB_PRAISE
PLAY:ACTION:reading_stop
CALL:G_WAITZERO
CALL:G_PRAISE
GO:RB_STARTBOOK
:RB_SCOLD
PLAY:ACTION:reading_stop
CALL:G_WAITZERO
CALL:G_SCOLD
GO:RB_STARTBOOK
:RB_VOICE
SWITCH:VoiceCmd
CASE:1:GO:RB_DOVOICE
CASE:0x40A:GO:RB_DOVOICE
CASE:0x41D:GO:RB_DOVOICE
CASE:0x40B:GO:RB_DOVOICE
CASE:15:GO:RB_DOVOICE
CASE:0x40D:GO:RB_DOVOICE
CASE:0x42E:GO:RB_DOVOICE
CASE:24:GO:RB_STOPBOOK
CASE:52:GO:RB_DOVOICE
CASE:38:GO:RB_DOVOICE
CASE:16:GO:RB_DOVOICE
CASE:0x429:GO:RB_DOVOICE
CASE:0x42A:GO:RB_DOVOICE
CASE:0x42C:GO:RB_DOVOICE
CASE:0x42B:GO:RB_DOVOICE
CASE:0x42D:GO:RB_DOVOICE
CASE:29:GO:RB_DOVOICE
CASE:0x40E:GO:RB_DOVOICE
CASE:0x416:GO:RB_DOVOICE
CASE:0x419:GO:RB_DOVOICE
CASE:0x40C:GO:RB_DOVOICE
CASE:12:GO:RB_DOVOICE
CASE:13:GO:RB_DOVOICE
CASE:33:GO:RB_DOVOICE
CASE:0x408:GO:RB_DOVOICE
CASE:17:GO:RB_DOVOICE
CASE:30:GO:RB_DOVOICE
CASE:11:GO:RB_DOVOICE
CASE:36:GO:RB_DOVOICE
CASE:8:GO:RB_DOVOICE
CASE:49:GO:RB_DOVOICE
CASE:26:GO:RB_DOVOICE
CASE:32:GO:RB_DOVOICE
CASE:0x443:GO:RB_DOVOICE
CASE:31:GO:RB_DOVOICE
CASE:0x444:GO:RB_DOVOICE
CASE:0x431:GO:RB_DOVOICE
PLAY:ACTION:reading_annoyed
WAIT
GO:RB_LOOP
:RB_DOVOICE
PLAY:ACTION:reading_stop
CALL:G_WAITZERO
RET:114
:RB_STOPBOOK
PLAY:ACTION:reading_stop
CALL:G_WAITZERO
RET:100
:RB_SEEBALL
PLAY:ACTION:reading_stop
CALL:G_WAITZERO
RET:107
:G_RB_PLAYSKIT
RND:rndnum:1:105
CSET:rndnum:<:5:1
CSET:rndnum:<:10:2
CSET:rndnum:<:15:3
CSET:rndnum:<:20:4
CSET:rndnum:<:25:5
CSET:rndnum:<:48:6
CSET:rndnum:<:72:7
CSET:rndnum:<:97:8
CSET:rndnum:>=:97:9
CASE:1:PLAY:ACTION:reading_turnpage1
CASE:2:PLAY:ACTION:reading_turnpage2
CASE:3:PLAY:ACTION:reading_turnpage3
CASE:4:PLAY:ACTION:reading_turnpage4
CASE:5:PLAY:ACTION:reading_turnpage5
CASE:6:PLAY:ACTION:reading_scanpage
CASE:7:PLAY:ACTION:reading_scanpage2
CASE:8:PLAY:ACTION:reading_scanpage3
CASE:9:PLAY:ACTION:reading_scratch_ear
GO:G_WAITZERO
:G_RB_ATTENTION
SET:pet:0
SET:praise:0
SET:scold:0
WAIT:1
IF:Back_ON:>:0:THEN
ADD:pet:2
SET:Back_ON:0
ADD:back_count:1
RET:112
ENDIF
IF:AP_Voice_Cmd:!=:0:THEN
CALL:G_VOICECMD
CASE:114:GO:RBA_VOICECMD
ENDIF
IF:AP_Tone:>:0:THEN
CALL:G_TONECMD
CASE:1:GO:RBA_VOICECMD
ENDIF
RET:100
:RBA_VOICECMD
SET:back_count:0
WAIT:1
IF:VoiceCmd:==:9:THEN
IF:VoiceDictID:>=:149:THEN
IF:VoiceDictID:<=:150:THEN
CALL:G_INC_BOYGIRL
RET:112
ENDIF
ENDIF
IF:VoiceDictID:>=:151:THEN
IF:VoiceDictID:<=:154:THEN
CALL:G_DEC_BOYGIRL
RET:112
ENDIF
ENDIF
ENDIF
IF:VoiceCmd:==:47:THEN
IF:VoiceDictID:>=:160:THEN
IF:VoiceDictID:<=:161:THEN
CALL:G_INC_BOYGIRL
RET:113
ENDIF
ENDIF
IF:VoiceDictID:>=:162:THEN
IF:VoiceDictID:<=:165:THEN
CALL:G_DEC_BOYGIRL
RET:113
ENDIF
ENDIF
ENDIF
IF:VoiceCmd:==:1085:THEN
CALL:G_INC_BOYGIRL
RET:112
ENDIF
IF:VoiceCmd:==:1086:THEN
CALL:G_DEC_BOYGIRL
RET:112
ENDIF
IF:VoiceCmd:==:1087:THEN
CALL:G_INC_BOYGIRL
RET:113
ENDIF
IF:VoiceCmd:==:1088:THEN
CALL:G_DEC_BOYGIRL
RET:113
ENDIF
IF:VoiceCmd:==:28:THEN
RET:113
ENDIF
RET:114
:G_SITPOS
CALL:G_INIT_SITPOS
:SIT_LOOP
CALL:G_UPDATE_PAUSEBAR
SET:Clock:0
RND:maxtime1:3:10
RND:maxtime2:0:2
RND:maxtime3:5:10
SET:tailwag:0
SET:tilt:Head_Tilt
SET:pan:Head_Pan
IF:mood_happy:>:3:CALL:G_START_TAILWAG_SLOW
:1895
CALL:F_NEED2REST
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
CALL:G_STOP_TAILWAG
RET:102
ENDIF
WAIT:50
CALL:G_REST_TIMER
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:SIT_SEEBALL
:SIT_CHECKATTENTION
CALL:G_SIT_ATTENTION
CASE:100:GO:1927
CASE:112:GO:1926
CASE:111:GO:1925
CASE:113:GO:1922
CASE:104:GO:1902
CASE:102:RET:102
CASE:103:RET:103
CASE:105:RET:105
CASE:106:RET:106
:SIT_PROCESSVOICE
CALL:G_YART_VoiceCmd
CASE:102:RET:102
CASE:103:RET:103
CASE:105:RET:105
CASE:106:RET:106
CASE:104:GO:1902
IF:sitonly:>:0:THEN
CALL:G_CUSTOM_SIT_VOICECMD
CASE:103:RET:103
CASE:105:GO:1902
CASE:106:GO:1902
CASE:107:GO:1902
CASE:115:GO:1902
ELSE
CALL:G_CUSTOM_SIT_VOICECMD
CASE:103:RET:103
CASE:105:RET:105
CASE:106:RET:106
CASE:107:GO:SIT_SEEBALL
CASE:115:GO:1902
ENDIF
CALL:G_SIT_VOICE_HANDLER
CASE:115:GO:1903
CASE:106:RET:106
CASE:103:RET:103
CASE:107:RET:107
CASE:105:RET:105
CASE:104:RET:102
:1902
ADD:change_thres:2
GO:SIT_LOOP
:1903
CALL:G_SIT_NOSE_SENSE
CALL:G_BORED_TIMER
CASE:1:GO:1895
PUSH:AP_Voice_Cmd
PUSH:0
NE
POP:reTempVar0
PUSH:AP_Voice_Level
PUSH:2
GE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:SIT_CHECKATTENTION
RND:rndnum:0:100
PUSH:sitonly
PUSH:0
EQ
POP:reTempVar0
PUSH:rndnum
PUSH:10
LE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:mood_tired
PUSH:5
LE
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:bored_count
PUSH:1
LT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
RET:106
ENDIF
IF:rndnum:<=:10:THEN
SET:sleepsit:1
RET:103
ENDIF
IF:rndnum:<:change_thres:THEN
CALL:G_SIT_CHANGEPOS
ADD:change_thres:2
GO:SIT_LOOP
ENDIF
IF:rndnum:<:90:THEN
RND:rndnum:0:100
PUSH:mood_sad
PUSH:5
GT
POP:reTempVar0
PUSH:rndnum
PUSH:mood_sad
PUSH:5
SUB
PUSH:10
MUL
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_SAD
GO:SIT_LOOP
ENDIF
PUSH:rndnum
PUSH:33
GT
POP:reTempVar0
PUSH:bored_count
PUSH:3
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_YART_Bored_Sit
CASE:102:RET:102
CASE:103:RET:103
CASE:105:RET:105
CASE:106:RET:106
CASE:104:GO:SIT_LOOP
CALL:G_SIT_BORED
CALL:G_BEHAVIOR_BORED
ADD:change_thres:2
GO:SIT_LOOP
ENDIF
PUSH:rndnum
PUSH:66
GT
POP:reTempVar0
PUSH:bored_count
PUSH:3
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:mood_happy
PUSH:5
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
CALL:G_YART_Happy_Sit
CASE:102:RET:102
CASE:103:RET:103
CASE:105:RET:105
CASE:106:RET:106
CASE:104:GO:SIT_LOOP
CALL:G_SIT_HAPPY
ADD:change_thres:2
GO:SIT_LOOP
ENDIF
PUSH:rndnum
PUSH:66
GT
POP:reTempVar0
PUSH:bored_count
PUSH:3
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:mood_happy
PUSH:2
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
CALL:G_SIT_TAILSONG
ADD:change_thres:2
GO:SIT_LOOP
ENDIF
ENDIF
CALL:G_YART_Calm_Sit
CASE:102:RET:102
CASE:103:RET:103
CASE:105:RET:105
CASE:106:RET:106
CASE:104:GO:SIT_LOOP
CALL:G_SIT_CALM
ADD:change_thres:2
GO:SIT_LOOP
:1922
CALL:G_SCOLD_REST
:1923
RND:bored_count:5:10
CALL:G_CLEAR_SENSORS
ADD:change_thres:2
GO:SIT_LOOP
:1925
CALL:G_SIT_PETTED
GO:1923
:1926
CALL:G_PRAISE_REST
GO:1923
:1927
CALL:G_LOOK_TIMER
GO:1903
:SIT_SEEBALL
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar0
PUSH:reTempVar0
CALL:F_RND100
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar1
PUSH:25
LT
POP:reTempVar2
IF:reTempVar0:&&:reTempVar2:THEN
PLAY:ACTION:TRACK_HEAD:PINK_BALL
WAIT:1000
SET:kick_pan:Head_Pan
SET:kick_tilt:Head_Tilt
SET:swing_kick:0
PUSH:Head_Tilt
PUSH:-70
LT
POP:reTempVar0
PUSH:Head_Pan
PUSH:-30
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:swing_kick:200
ENDIF
PUSH:Head_Tilt
PUSH:-70
LT
POP:reTempVar0
PUSH:Head_Pan
PUSH:30
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:swing_kick:201
ENDIF
PUSH:Head_Tilt
PUSH:-65
LT
POP:reTempVar0
PUSH:Head_Pan
PUSH:5
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Head_Pan
PUSH:20
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:swing_kick:202
ENDIF
PUSH:Head_Tilt
PUSH:-65
LT
POP:reTempVar0
PUSH:Head_Pan
PUSH:-5
LT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Head_Pan
PUSH:-20
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:swing_kick:203
ENDIF
SET:init_wait:Wait
SWITCH:swing_kick
CASE:200:PLAY:ACTION:kick_sitpos_left
CASE:201:PLAY:ACTION:kick_sitpos_right
CASE:202:PLAY:ACTION:kick_sitpos_fwdleft
CASE:203:PLAY:ACTION:kick_sitpos_fwdright
IF:swing_kick:>:0:THEN
CALL:G_WAIT
CALL:G_SOCCER_KICK_MOOD
ENDIF
ENDIF
CALL:G_STAND4BALL
CASE:100:RET:105
CASE:102:RET:102
CASE:107:RET:107
GO:SIT_CHECKATTENTION
:G_INIT_SITPOS
WAIT:1
SET:sitstate:0
SET:change_thres:40
SET:nosecount:0
SET:back_count:0
SET:init_wait:Wait
PLAY:ACTION:SIT
SET:tilt:-25
SET:pan:0
CALL:G_WAIT
CALL:G_CLEAR_SENSORS
IF_1ST:sleepsit:>:0
IF_AND:bored_count:<:3:1238
IF_1ST:sleepsit:>:0:1237
RND:bored_count:3:10
:1237
SET:sleepsit:0
RET:1
:1238
RND:bored_count:3:5
SET:sleepsit:0
RET:1
:G_SIT_ATTENTION
CALL:G_ATTENTION_HANDLER
CASE:112:RET:112
CASE:111:RET:111
CASE:113:RET:113
CASE:114:RET:114
CASE:102:RET:102
CASE:103:RET:103
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
CALL:G_TAIL_TWEAKED
CASE:2:RET:112
CASE:3:RET:113
CASE:4:RET:114
IF:sitstate:!=:0:THEN
WAIT:1
IF:RRLeg_3:<:30:THEN
IF:RRLeg_ON:>:0:THEN
ADD:pet:32
SET:RRLeg_ON:0
SET:back_count:0
ENDIF
ENDIF
IF:LRLeg_3:<:30:THEN
IF:LRLeg_ON:>:0:THEN
ADD:pet:64
SET:LRLeg_ON:0
SET:back_count:0
ENDIF
ENDIF
ENDIF
IF:pet:==:0:THEN
RET:100
ENDIF
RET:111
:G_SIT_BORED
:1580
IF_1ST:sitstate:=:0:1589
SET:rndbase:1150
SET:rndcount:3
SET:lastact1:last_boredact
SET:lastact2:last_boredact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1588
CASE:3:RET:1
SWITCH:rndnum
CASE:1150:PLAY:ACTION:O2_BORED_SIT1
CASE:1151:PLAY:ACTION:O2_HOWL_SIT1
CASE:1152:PLAY:ACTION:O2_HOWL_SIT2
SET:last_boredact:rndnum
WAIT
PLAY:ACTION:SIT
WAIT
SET:sitstate:0
RET:1
:1588
CALL:G_SIT_PICKPOS
GO:1580
:1589
SET:rndbase:1100
SET:rndcount:13
SET:lastact1:last_boredact
SET:lastact2:last_boredact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1588
CASE:3:RET:1
IF_1ST:rndnum:=:1100
IF_AND:mood_tired:<:9:1605
SWITCH:rndnum
CASE:1101:PLAY:ACTION:O2_BORED_SIT2
CASE:1102:PLAY:ACTION:O2_BORED_SIT3
CASE:1103:PLAY:ACTION:O2_BEG_PET1
CASE:1104:PLAY:ACTION:O2_IMPATIENT_SIT1
CASE:1105:PLAY:ACTION:O2_IMPATIENT_SIT2
CASE:1106:PLAY:ACTION:O2_NOBI4
CASE:1107:PLAY:ACTION:O2_ANYONE_THERE5
CASE:1108:PLAY:ACTION:O2_SIGH
CASE:1109:PLAY:ACTION:O2_WANT_ATTENTION_SIT1
CASE:1110:PLAY:ACTION:O2_WANT_ATTENTION_SIT2
CASE:1111:PLAY:ACTION:O2_COMEON
CASE:1112:GO:SIT_CALL_OWNERNAME
:1594
SET:last_boredact:rndnum
SET:sitstate:0
WAIT
RET:1
:1605
IF_1ST:sitonly:>:0:1589
PLAY:ACTION:O2_BEG_BALL
GO:1594
:SIT_CALL_OWNERNAME
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:10:G_PLAYBACK_OWNERNAME
RET:1
:G_SIT_CALM
:1608
SWITCH:sitstate
CASE:0:GO:1633
CASE:1:GO:1620
SET:rndbase:1400
SET:rndcount:4
SET:lastact1:last_calmact
SET:lastact2:last_calmact2
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1619
CASE:2:GO:1612
RET:1
:1612
SWITCH:rndnum
CASE:1400:PLAY:ACTION:O2_EXERCISE5
CASE:1401:PLAY:ACTION:O2_EXERCISE6
CASE:1402:PLAY:ACTION:O2_EXERCISE7
CASE:1403:PLAY:ACTION:O2_EXERCISE8
GO:1634
:1619
CALL:G_SIT_PICKPOS
GO:1608
:1620
SET:rndbase:1350
SET:rndcount:9
SET:lastact1:last_calmact
SET:lastact2:last_calmact2
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1619
CASE:3:RET:1
SWITCH:rndnum
CASE:1350:PLAY:ACTION:O2_LOOKAROUND_SIT1
CASE:1351:PLAY:ACTION:O2_STRETCH1
CASE:1352:PLAY:ACTION:O2_SCRATCH_LEFTEAR
CASE:1353:PLAY:ACTION:O2_STRETCH2
CASE:1354:PLAY:ACTION:O2_SCRATCH_RIGHTEAR1
CASE:1355:PLAY:ACTION:O2_TAP_RIGHT
CASE:1356:PLAY:ACTION:O2_HICCUPS_SIT1
CASE:1357:PLAY:ACTION:O2_TAP_LEFT
CASE:1358:PLAY:ACTION:O2_HICCUPS_SIT2
GO:1634
:1633
SET:rndbase:1300
SET:rndcount:24
SET:lastact1:last_calmact
SET:lastact2:last_calmact2
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1619
CASE:3:RET:1
SWITCH:rndnum
CASE:1300:PLAY:ACTION:O2_CLEANPAW
CASE:1301:PLAY:ACTION:O2_LOOKBACK1
CASE:1302:PLAY:ACTION:O2_LOOKBACK2
CASE:1303:PLAY:ACTION:O2_LOOKAROUND_SIT2
CASE:1304:PLAY:ACTION:O2_LOOKAROUND_SIT3
CASE:1305:PLAY:ACTION:O2_SWATFLY
CASE:1306:PLAY:ACTION:O2_SCRATCH_RIGHTEAR2
CASE:1307:PLAY:ACTION:O2_SCRATCH_RIGHTEAR3
CASE:1308:PLAY:ACTION:O2_SCRATCH_LEFTEAR1
CASE:1309:PLAY:ACTION:O2_LOOKUP1
CASE:1310:PLAY:ACTION:O2_LOOKUP2
CASE:1311:PLAY:ACTION:O2_SCRATCH_MOUTH
CASE:1312:PLAY:ACTION:O2_SCRATCH_RIGHTCHEEK
CASE:1313:PLAY:ACTION:piano
CASE:1314:PLAY:ACTION:beethoven5
CASE:1315:PLAY:ACTION:Minuet1b
CASE:1316:PLAY:ACTION:scratch_rearend
CASE:1317:PLAY:ACTION:scratch_rearend2
CASE:1318:PLAY:ACTION:scratch_rearend3
CASE:1319:PLAY:ACTION:typing2
CASE:1320:PLAY:ACTION:drum_roll
CASE:1321:GO:1639
CASE:1322:GO:1638
CASE:1323:GO:1637
:1634
WAIT
SET:last_calmact2:last_calmact
SET:last_calmact:rndnum
RET:1
:1637
IF_1ST:Batt_Rest:<:50:1633
PLAY:ACTION:driving0
WAIT
PLAY:ACTION:driving1
GO:1634
:1638
PLAY:ACTION:typing
WAIT
PLAY:ACTION:sigh
WAIT
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:>:50:THEN
PLAY:ACTION+:answer_phone
ELSE
PLAY:ACTION+:answer_phone2
ENDIF
GO:1634
:1639
PLAY:ACTION:tea_buttonclick
WAIT
PLAY:ACTION:tea_cupsaucer
WAIT
PLAY:ACTION:tea_kettlewhistle
WAIT
PLAY:ACTION:tea_pour
WAIT
PLAY:ACTION:tea_stirring_cup
WAIT
PLAY:ACTION:tea_slurp
GO:1634
:G_SIT_SHOWTIME
SET:rndbase:2000
SET:rndcount:18
CALL:G_BEHAVIOR_RNDNM
CASE:1:RET:1
CASE:3:RET:1
SWITCH:rndnum
CASE:2000:PLAY:ACTION:piano
CASE:2001:PLAY:ACTION:beethoven5
CASE:2002:PLAY:ACTION:scratch_rearend
CASE:2003:PLAY:ACTION:typing2
CASE:2004:PLAY:ACTION:O2_DANCE_SIT1
CASE:2005:PLAY:ACTION:O2_DANCE_SIT2
CASE:2006:PLAY:ACTION:O2_DANCE_SIT3
CASE:2007:PLAY:ACTION:O2_DANCE_SIT4
CASE:2008:PLAY:ACTION:O2_DANCE_SIT5
CASE:2009:PLAY:ACTION:O2_DANCE_SIT6
CASE:2010:PLAY:ACTION:O2_KARATE1
CASE:2011:PLAY:ACTION:O2_KARATE2
CASE:2012:PLAY:ACTION:O2_KARATE3
CASE:2013:PLAY:ACTION:squeaky_trumpet
CASE:2014:PLAY:ACTION:addams_family
CASE:2015:PLAY:ACTION:Minuet1b
CASE:2016:GO:SIT_SHOWTIME_DRIVE
CASE:2017:GO:SIT_SHOWTIME_TYPING
WAIT
RET:1
:SIT_SHOWTIME_DRIVE
IF_1ST:Batt_Rest:<:50:G_SIT_SHOWTIME
PLAY:ACTION+:driving0
WAIT
PLAY:ACTION+:driving1
WAIT
RET:1
:SIT_SHOWTIME_TYPING
PLAY:ACTION+:typing
WAIT
PLAY:ACTION+:sigh
WAIT
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:>:50:THEN
PLAY:ACTION+:answer_phone
ELSE
PLAY:ACTION+:answer_phone2
ENDIF
WAIT
RET:1
:G_SIT_CHANGEPOS
CALL:G_SIT_PICKPOS
SWITCH:sitstate
CASE:0:PLAY:ACTION:SIT
CASE:1:PLAY:ACTION:O2_SITWIDE
CASE:ELSE:PLAY:ACTION:O2_SITFLAT
SET:change_thres:15
WAIT
CALL:G_CLEAR_SENSORS
RET:1
:G_SIT_DANCE
IF:sitstate:>:0:THEN
SET:rndbase:1550
SET:rndcount:4
SET:lastact1:last_danceact
SET:lastact2:last_danceact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1674
CASE:3:RET:1
SWITCH:rndnum
CASE:1550:PLAY:ACTION:O2_DANCE_SIT7
CASE:1551:PLAY:ACTION:O2_DANCE_SIT8
CASE:1552:PLAY:ACTION:O2_DANCE_SIT9
CASE:1553:PLAY:ACTION:O2_DANCE_SIT10
SET:last_danceact:rndnum
WAIT
RET:1
ENDIF
SET:rndbase:1500
SET:rndcount:7
SET:lastact1:last_danceact
SET:lastact2:last_danceact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:1674
CASE:3:RET:1
SWITCH:rndnum
CASE:1500:PLAY:ACTION:O2_DANCE_SIT1
CASE:1501:PLAY:ACTION:O2_DANCE_SIT2
CASE:1502:PLAY:ACTION:O2_DANCE_SIT3
CASE:1503:PLAY:ACTION:O2_DANCE_SIT4
CASE:1504:PLAY:ACTION:O2_DANCE_SIT5
CASE:1505:PLAY:ACTION:O2_DANCE_SIT6
CASE:1506:PLAY:ACTION:addams_family
SET:last_danceact:rndnum
WAIT
RET:1
:1674
CALL:G_SIT_PICKPOS
GO:G_SIT_DANCE
:G_SIT_HAPPY
IF:sitstate:==:0:THEN
SET:rndbase:1200
SET:rndcount:14
ELSE
SET:rndbase:1250
SET:rndcount:7
ENDIF
SET:lastact1:last_happyact
SET:lastact2:last_happyact
CALL:G_BEHAVIOR_RNDNM
CASE:1:GO:SH_PICKPOS
CASE:3:RET:1
AP_GET:reTempVar0:behavior:23
PUSH:reTempVar0
PUSH:1
EQ
POP:reTempVar1
AP_GET:reTempVar2:behavior:23
PUSH:reTempVar2
PUSH:0
EQ
POP:reTempVar3
PUSH:boygirl
PUSH:0
GE
POP:reTempVar4
LAND:reTempVar3:reTempVar4
LIOR:reTempVar1:reTempVar3
PUSH:rndnum
PUSH:1201
EQ
POP:reTempVar5
PUSH:rndnum
PUSH:1202
EQ
POP:reTempVar6
LIOR:reTempVar5:reTempVar6
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:G_SIT_HAPPY
SWITCH:rndnum
CASE:1200:GO:SH_DIALPHONE
CASE:1201:PLAY:ACTION:O2_KISS1
CASE:1202:PLAY:ACTION:O2_KISS2
CASE:1203:PLAY:ACTION:O2_DANCE_SIT1
CASE:1204:PLAY:ACTION:O2_DANCE_SIT2
CASE:1205:PLAY:ACTION:O2_DANCE_SIT3
CASE:1206:PLAY:ACTION:O2_DANCE_SIT4
CASE:1207:PLAY:ACTION:O2_DANCE_SIT5
CASE:1208:PLAY:ACTION:O2_DANCE_SIT6
CASE:1209:PLAY:ACTION:O2_DRUMS_SONG
CASE:1210:PLAY:ACTION:O2_LETSPLAY3
CASE:1211:PLAY:ACTION:O2_LETSPLAY4
CASE:1212:PLAY:ACTION:O2_LETSPLAY5
CASE:1213:PLAY:ACTION:O2_LETSPLAY6
CASE:1250:PLAY:ACTION:O2_CUTE_JOY1
CASE:1251:PLAY:ACTION:O2_CUTE_JOY2
CASE:1252:PLAY:ACTION:O2_DANCE_SIT7
CASE:1253:PLAY:ACTION:O2_DANCE_SIT8
CASE:1254:PLAY:ACTION:O2_DANCE_SIT9
CASE:1255:PLAY:ACTION:O2_DANCE_SIT10
CASE:1256:PLAY:ACTION:O2_DANCE_SIT11
:SH_WAIT4ACT
SET:last_happyact:rndnum
CALL:G_WAITZERO
RET:1
:SH_DIALPHONE
PLAY:ACTION+:dial_phone
CALL:G_WAITZERO
PLAY:ACTION+:dial_phone2
GO:SH_WAIT4ACT
:SH_PICKPOS
CALL:G_SIT_PICKPOS
GO:G_SIT_HAPPY
:G_SIT_NOSE_SENSE
WAIT:1
RND:rndnum:1:100
PUSH:Distance
PUSH:200
LT
POP:reTempVar0
PUSH:Head_Tilt
PUSH:-45
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:nosecount
PUSH:3
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:rndnum
PUSH:33
LT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
PUSH:Wait
PUSH:0
EQ
POP:reTempVar0
PUSH:Wait
PUSH:1
EQ
POP:reTempVar1
PUSH:tailwag
PUSH:0
GT
POP:reTempVar2
LAND:reTempVar1:reTempVar2
IF:reTempVar0:||:reTempVar1:THEN
SET:reTempVar0:nosecount
ADD:nosecount:1
SET:init_wait:Wait
IF:rndnum:<:8:THEN
PLAY:ACTION:sniff_once
CALL:G_WAIT
ELSE
IF:rndnum:<:16:THEN
PLAY:ACTION:sniff_twice
CALL:G_WAIT
ELSE
CALL:G_SIT_SHAKEHANDS
ENDIF
ENDIF
ENDIF
ENDIF
RET:1
:G_SIT_PETTED
CALL:G_RANDOM3
CASE:1:GO:1784
CASE:2:GO:1779
:1751
IF_1ST:back_count:>:4:1776
:1752
RND:rndnum:0:16
WAIT:1
SET:init_wait:Wait
IF_1ST:rndnum:=:last_petsong:1752
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_BEEN_PETTED1
CASE:1:PLAY:ACTION:O2_BEEN_PETTED8
CASE:2:PLAY:ACTION:O2_BEEN_PETTED2
CASE:3:PLAY:ACTION:O2_BEEN_PETTED9
CASE:4:PLAY:ACTION:O2_BEEN_PETTED3
CASE:5:PLAY:ACTION:O2_BEEN_PETTED10
CASE:6:PLAY:ACTION:O2_BEEN_PETTED4
CASE:7:PLAY:ACTION:O2_BEEN_PETTED11
CASE:8:PLAY:ACTION:O2_BEEN_PETTED5
CASE:9:PLAY:ACTION:O2_BEEN_PETTED12
CASE:10:PLAY:ACTION:O2_BEEN_PETTED6
CASE:11:PLAY:ACTION:O2_BEEN_PETTED13
CASE:12:PLAY:ACTION:O2_BEEN_PETTED7
CASE:13:PLAY:ACTION:O2_BEEN_PETTED14
CASE:14:PLAY:ACTION:O2_BEEN_PETTED18
CASE:15:PLAY:ACTION:O2_BEEN_PETTED19
CASE:16:PLAY:ACTION:O2_BEEN_PETTED20
SET:last_petsong:rndnum
CALL:G_WAIT
:1758
CALL:G_INC_HAPPY_MOOD
CALL:G_DEC_MAD_MOOD
CALL:G_DEC_SAD_MOOD
RET:1
:1776
WAIT:1
SET:init_wait:Wait
RND:rndnum:0:1
SWITCH:rndnum
CASE:0:PLAY:ACTION+:petting_kick_sit_left
CASE:1:PLAY:ACTION+:petting_kick_sit_right
SET:sleepstate:0
SET:last_petsong:999
CALL:G_WAIT
SET:Back_ON:0
GO:1758
:1779
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:O2_TUNE_PETTED2
:1780
CALL:G_WAIT
IF_1ST:mood_happy:>:4:1783
CALL:G_RANDOM1/3
CASE:1:GO:1751
GO:1758
:1783
CALL:G_RANDOM1/3
CASE:1:GO:1758
GO:1751
:1784
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:O2_TUNE_PETTED1
GO:1780
:G_SIT_PICKPOS
:1787
RND:rndnum:0:2
IF_1ST:rndnum:=:sleepstate:1787
SET:sitstate:rndnum
RET:1
:G_SIT_POSE
CALL:G_VOICE_HIT
IF_1ST:sitstate:<>:1:1804
CALL:G_RANDOM1/3
CASE:1:GO:1804
SET:rndbase:1050
SET:rndcount:3
CALL:F_BEHAVIOR_RNDN
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
WAIT:1
SET:init_wait:Wait
SWITCH:rndnum
CASE:1050:PLAY:ACTION:O2_POSE_SIT1
CASE:1051:PLAY:ACTION:O2_POSE_SIT2
CASE:1052:PLAY:ACTION:O2_POSE_SIT3
CALL:G_WAIT
SET:last_poseact:rndnum
SET:sitstate:1
ENDIF
RET:1
:1804
SET:rndbase:1000
SET:rndcount:5
CALL:F_BEHAVIOR_RNDN
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
WAIT:1
SET:init_wait:Wait
SWITCH:rndnum
CASE:1000:PLAY:ACTION:O2_POSE_ATLAS
CASE:1001:PLAY:ACTION:O2_POSE_MUSCLE
CASE:1002:PLAY:ACTION:O2_POSE_SUPERMAN
CASE:1003:PLAY:ACTION:O2_POSE_TAPAIR
CASE:1004:GO:G_SIT_HEADSTAND
CALL:G_WAIT
SET:last_poseact:rndnum
SET:sitstate:0
ENDIF
RET:1
:G_SIT_HEADSTAND
SET:NoFallDown:1
PLAY:ACTION:headstand_sit
CALL:G_WAIT
SET:NoFallDown:0
SET:last_poseact:rndnum
SET:sitstate:0
RET:1
:G_SIT_SHAKEHANDS
WAIT:1
SET:init_wait:Wait
CALL:G_RANDOM4
CASE:1:PLAY:ACTION:O2_SHAKERIGHT3
CASE:1:SET:last_shakehand:0
CASE:2:PLAY:ACTION:O2_SHAKERIGHT4
CASE:2:SET:last_shakehand:0
CASE:3:PLAY:ACTION:O2_SHAKELEFT3
CASE:3:SET:last_shakehand:1
CASE:4:PLAY:ACTION:O2_SHAKELEFT4
CASE:4:SET:last_shakehand:1
:G_WAITFOR_HANDSHAKE
CALL:G_WAIT
SET:timetrack:Sec
RND:maxtime:2:4
SET:RFLeg_ON:0
SET:LFLeg_ON:0
:reTempLbl23
IF:maxtime:>=:0:THEN
WAIT:1
PUSH:RFLeg_ON
PUSH:0
GT
POP:reTempVar0
PUSH:last_shakehand
PUSH:0
EQ
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:LFLeg_ON
PUSH:0
GT
POP:reTempVar2
PUSH:last_shakehand
PUSH:1
EQ
POP:reTempVar3
LAND:reTempVar2:reTempVar3
IF:reTempVar0:||:reTempVar2:THEN
CALL:G_PRAISE
PLAY:ACTION:SIT
CALL:G_WAIT
RET:1
ENDIF
SET:newtime:Sec
IF:newtime:!=:timetrack:THEN
SET:timetrack:newtime
SUB:maxtime:1
ENDIF
GO:reTempLbl23
ENDIF
PLAY:ACTION:SIT
CALL:G_SAD
CALL:G_INC_SAD_MOOD
CALL:G_DEC_HAPPY_MOOD
RET:1
:G_SIT_OTHERHAND
WAIT:1
SET:init_wait:Wait
IF:last_shakehand:>:0:THEN
SET:last_shakehand:0
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_SHAKERIGHT3
CASE:2:PLAY:ACTION:O2_SHAKERIGHT4
ELSE
SET:last_shakehand:1
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:O2_SHAKELEFT3
CASE:2:PLAY:ACTION:O2_SHAKELEFT4
ENDIF
GO:G_WAITFOR_HANDSHAKE
:G_SIT_TAILSONG
SET:rndbase:1450
SET:rndcount:3
CALL:F_BEHAVIOR_RNDN
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
SWITCH:rndnum
CASE:1450:PLAY:ACTION:O2_TAILWAG_SONG7
CASE:1451:PLAY:ACTION:O2_TAILWAG_SONG8
CASE:1452:PLAY:ACTION:O2_TAILWAG_SONG9
CALL:G_WAITZERO
ENDIF
RET:1
:G_SIT_VOICE_HANDLER
CALL:G_STOP_HEAD
SWITCH:VoiceCmd
CASE:999:GO:1860
CASE:52:GO:SVH_WALK_REQUEST
CASE:38:GO:SVH_FINDBALL
CASE:16:GO:SVH_FINDBALL
CASE:0x429:GO:SVH_FINDBALL
CASE:0x42A:GO:SVH_FINDBALL
CASE:0x42C:GO:SVH_FINDBALL
CASE:0x42B:GO:SVH_FINDBALL
CASE:0x42D:GO:SVH_FINDBALL
CASE:11:GO:1870
CASE:29:GO:1868
CASE:0x416:GO:1869
CASE:0x419:GO:1869
CASE:17:GO:1867
CASE:0x409:GO:1867
CASE:13:GO:1866
CASE:33:GO:1866
CASE:0x408:GO:1866
CASE:1:GO:1866
CASE:0x40A:GO:1866
CASE:12:GO:1866
CASE:19:GO:1866
CASE:0x40B:GO:1866
CASE:0x41D:GO:1866
CASE:18:GO:1866
CASE:8:GO:1865
CASE:14:GO:1864
CASE:0x40E:GO:1864
CASE:37:GO:1863
CASE:0x418:GO:1863
CASE:30:GO:1862
CASE:3:GO:1861
CASE:2:GO:1858
CASE:10:GO:1858
CASE:6:GO:1856
CASE:49:GO:1855
CASE:50:GO:1855
CASE:0x414:GO:1855
CASE:34:GO:1854
CASE:39:GO:1853
CASE:0x425:GO:1853
CASE:40:GO:1852
CASE:5:GO:1851
CASE:7:GO:1850
CASE:27:GO:1850
CASE:36:GO:1848
CASE:32:GO:1871
CASE:0x443:GO:1872
CASE:31:GO:1873
CASE:0x444:GO:1874
RET:115
:1848
CALL:G_VOICE_HIT
PLAY:ACTION:LIE
WAIT
RET:103
:1850
CALL:G_CHECK_STAYSIT
CASE:115:RET:104
CALL:G_STAND_UP
RET:105
:1851
CALL:G_CHECK_STAYSIT
CASE:115:RET:104
CALL:G_GO_BACK
RET:105
:1852
CALL:G_LAZY_GORIGHT
CASE:1:RET:104
RET:105
:1853
CALL:G_CHECK_STAYSIT
CASE:115:RET:104
CALL:G_GO_FORWARD
RET:105
:1854
CALL:G_LAZY_GOLEFT
CASE:1:RET:104
RET:105
:1855
CALL:G_CHECK_STAYSIT
CASE:115:RET:104
CALL:G_STAND_BARK
RET:105
:1856
CALL:G_VOICE_HIT
CALL:G_SIT_OTHERHAND
RET:104
:1858
CALL:G_VOICE_HIT
CALL:G_SIT_SHAKEHANDS
RET:104
:1860
CALL:G_SIT_RHYTHM
RET:104
:1861
CALL:G_Select_Game
RET:104
:1862
CALL:G_QUERY_TIRED
RET:104
:1863
CALL:G_SIT_POSE
RET:104
:1864
CALL:G_KARATE_CHOP
RET:104
:1865
CALL:G_SIT_HUH
RET:104
:1866
CALL:G_SIT_GREET
RET:104
:1867
CALL:G_QUERY_MOOD
RET:104
:1868
CALL:G_VOICE_HIT
CALL:G_SIT_DANCE
RET:104
:1869
CALL:G_VOICE_HIT
CALL:G_SIT_SHOWTIME
RET:104
:1870
CALL:G_QUERY_HUNGRY
RET:104
:1871
CALL:G_PLAYBACK_AIBONAME
RET:104
:1872
CALL:G_PLAYBACK_OWNERNAME
RET:104
:1873
CALL:G_NAME_REGISTRATION
RET:104
:1874
CALL:G_OWNER_REGISTRATION
IF:Posture1:==:2:THEN
RET:104
ENDIF
RET:103
:SVH_FINDBALL
CALL:G_VOICE_HIT
PUSH:mood_tired
PUSH:9
GE
POP:reTempVar0
PUSH:mood_mad
PUSH:5
GT
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
PUSH:sitonly
PUSH:0
GT
POP:reTempVar2
LIOR:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
CALL:G_SOCCER_LOOK4BALL
RET:104
ENDIF
CALL:G_SOCCER_SEARCH4BALL
CASE:1:RET:102
CASE:3:GO:SVH_FINDBALL_FAILED
IF:mood_tired:>=:7:THEN
GO:SVH_FINDBALL_FAILED
ENDIF
IF:searchmove:<>:0:THEN
RET:107
ENDIF
SET:tilt:Head_Tilt
SET:pan:Head_Pan
SET:init_wait:Wait
PLAY:ACTION:STAND
CALL:G_WAIT_AWARE
PLAY:ACTION:MOVE.HEAD.NORMAL:pan:tilt
CALL:G_WAIT_AWARE
IF:Pink_Ball:<>:0:THEN
RET:107
ENDIF
CALL:G_SOCCER_SEARCH4BALL
CASE:1:RET:102
CASE:2:RET:107
RET:104
:SVH_FINDBALL_FAILED
IF:Posture1:<>:2:CALL:G_SIT_DOWN
RET:104
:SVH_WALK_REQUEST
CALL:G_WALK_REQUEST
CASE:1:RET:106
RET:104
:G_SIT_GREET
WAIT:1
SET:sitstate:0
SET:init_wait:Wait
RND:rndnum:0:19
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_WINK_LEFT1
CASE:1:PLAY:ACTION:O2_WINK_LEFT2
CASE:2:PLAY:ACTION:O2_WINK_RIGHT1
CASE:3:PLAY:ACTION:O2_WINK_RIGHT2
CASE:4:PLAY:ACTION:O2_WAVE_RIGHT_SIT1
CASE:5:PLAY:ACTION:O2_WAVE_RIGHT_SIT2
CASE:6:PLAY:ACTION:O2_WAVE_RIGHT_SIT3
CASE:7:PLAY:ACTION:O2_WAVE_RIGHT_SIT5
CASE:8:PLAY:ACTION:O2_WAVE_RIGHT_SIT6
CASE:9:PLAY:ACTION:O2_WAVE_LEFT_SIT9
CASE:10:PLAY:ACTION:O2_WAVE_LEFT_SIT10
CASE:11:PLAY:ACTION:O2_WAVE_LEFT_SIT1
CASE:12:PLAY:ACTION:O2_WAVE_LEFT_SIT2
CASE:13:PLAY:ACTION:O2_WAVE_LEFT_SIT4
CASE:14:PLAY:ACTION:O2_WAVE_LEFT_SIT3
CASE:15:PLAY:ACTION:O2_WAVE_LEFT_SIT5
CASE:16:PLAY:ACTION:O2_WAVE_LEFT_SIT6
CASE:17:PLAY:ACTION:O2_WAVE_RIGHT_SIT4
CASE:17:SET:sitstate:1
CASE:18:PLAY:ACTION:O2_WAVE_LEFT_SIT7
CASE:18:SET:sitstate:1
CASE:19:PLAY:ACTION:O2_WAVE_LEFT_SIT8
CASE:19:SET:sitstate:1
GO:G_WAIT_AWARE
:G_SIT_HUH
CALL:G_VOICE_HIT
RND:rndnum:1:6
IF:rndnum:<:5:THEN
SET:sitstate:0
ENDIF
SWITCH:rndnum
CASE:1:PLAY:ACTION:O2_HUH_SIT1
CASE:2:PLAY:ACTION:O2_HUH_SIT2
CASE:3:PLAY:ACTION:O2_HUH_SIT3
CASE:4:PLAY:ACTION:O2_HUH_SIT4
CASE:5:PLAY:ACTION:O2_HUH_LEFT
CASE:6:PLAY:ACTION:O2_HUH_RIGHT
GO:G_WAITZERO
:G_SIT_RHYTHM
SET:rndbase:1900
SET:rndcount:7
CALL:G_BEHAVIOR_RNDNM
CASE:3:RET:1
SWITCH:rndnum
CASE:1900:PLAY:ACTION+:dancestep_aibosit_beat
CASE:1901:PLAY:ACTION+:dancestep_aibosit1
CASE:1902:PLAY:ACTION+:dancestep_aibosit2
CASE:1903:PLAY:ACTION+:dancestep_aibosit3
CASE:1904:PLAY:ACTION+:dancestep_sit_conduct1
CASE:1905:PLAY:ACTION+:dancestep_sit_conduct2
CASE:1906:PLAY:ACTION+:dancestep_sit_piano
GO:G_WAITZERO
:G_STANDPOS
CALL:G_CHECK_SITONLY
CASE:103:RET:103
CASE:104:RET:104
CALL:G_INIT_STANDPOS
:STAND_LOOP
SET:Clock:0
RND:maxtime1:3:10
RND:maxtime2:0:2
RND:maxtime3:5:10
SET:tailwag:0
IF:mood_happy:>:3:CALL:G_START_TAILWAG_SLOW
:2845
CALL:F_NEED2REST
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
CALL:G_STOP_TAILWAG
RET:102
ENDIF
IF:mood_tired:>=:10:THEN
IF:Posture1:==:1:THEN
RND:rndnum:0:100
SET:init_wait:Wait
IF:rndnum:<:50:THEN
PLAY:ACTION:SIT
ELSE
PLAY:ACTION+:sit_quick
ENDIF
CALL:G_WAIT
ENDIF
CALL:G_STOP_TAILWAG
RET:102
ENDIF
CALL:G_CHECK_SITONLY
CASE:103:RET:103
CASE:104:RET:104
CALL:G_REST_TIMER
WAIT:50
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:STAND_SEEBALL
:STAND_CHECKATTENTION
CALL:G_ATTENTION_HANDLER
CASE:100:GO:2868
CASE:112:GO:2867
CASE:111:GO:2866
CASE:113:GO:2863
CASE:105:GO:2854
CASE:102:RET:102
CASE:103:RET:103
CASE:104:RET:104
CASE:106:RET:106
:STAND_PROCESSVOICE
CALL:G_YART_VoiceCmd
CASE:102:RET:102
CASE:103:RET:103
CASE:104:RET:104
CASE:106:RET:106
CASE:105:GO:2854
CALL:G_CUSTOM_STAND_VOICECMD
CASE:103:RET:103
CASE:104:RET:104
CASE:105:RET:105
CASE:107:RET:107
CASE:115:GO:2854
CALL:G_STAND_VOICE_HANDLER
CASE:1:GO:STAND_LOOP
CASE:3:RET:106
CASE:4:RET:103
CASE:5:RET:104
CASE:6:RET:107
CASE:7:RET:102
:2854
CALL:G_BORED_TIMER
CASE:1:GO:2845
PUSH:AP_Voice_Cmd
PUSH:0
NE
POP:reTempVar0
PUSH:AP_Voice_Level
PUSH:2
GE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:STAND_CHECKATTENTION
RND:rndnum:0:100
IF:rndnum:>=:20:THEN
IF:rndnum:<:70:THEN
RET:106
ENDIF
IF:rndnum:<:90:THEN
RET:103
ENDIF
RET:104
ENDIF
CALL:G_YART_Bored_Stand
CASE:102:RET:102
CASE:103:RET:103
CASE:104:RET:104
CASE:106:RET:106
CASE:105:GO:2854
WAIT:1
CALL:G_BEHAVIOR_BORED
ADD:change_thres:2
GO:STAND_LOOP
:2863
CALL:G_SCOLD_REST
:2864
RND:bored_count:5:10
CALL:G_CLEAR_SENSORS
ADD:change_thres:2
GO:STAND_LOOP
:2866
CALL:G_STAND_PETTED
GO:2864
:2867
CALL:G_PRAISE_REST
GO:2864
:2868
CALL:G_TAIL_TWEAKED
CASE:2:GO:2867
CASE:3:GO:2863
CASE:4:GO:STAND_PROCESSVOICE
CALL:G_LOOK_TIMER
GO:2854
:STAND_SEEBALL
CALL:G_STOP_TAILWAG
RET:107
:G_INIT_STANDPOS
RND:bored_count:3:10
SET:back_count:0
SET:tilt:0
SET:pan:0
WAIT:1
IF:Posture1:!=:1:THEN
SET:init_wait:Wait
PLAY:ACTION:stand_straight
CALL:G_WAIT
ENDIF
CALL:G_CLEAR_SENSORS
RET:1
:G_STAND_BARK
CALL:G_VOICE_HIT
RND:rndnum:1:5
SWITCH:rndnum
CASE:1:PLAY:ACTION:O2_BARK
CASE:2:PLAY:ACTION:O2_BARK2
CASE:3:PLAY:ACTION:dog_1bark_stand
CASE:4:PLAY:ACTION:dog_2barks_stand
CASE:5:PLAY:ACTION:dog_3barks_stand
GO:G_WAITZERO
:G_STAND_DANCE
SET:rndbase:1600
SET:rndcount:6
CALL:F_BEHAVIOR_RNDN
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
SWITCH:rndnum
CASE:1600:PLAY:ACTION:O2_DANCE_STAND3
CASE:1601:PLAY:ACTION:O2_DANCE_STAND4
CASE:1602:PLAY:ACTION:O2_DANCE_STAND5
CASE:1603:PLAY:ACTION:O2_DANCE_STAND6
CASE:1604:PLAY:ACTION:pinkpanther
CASE:1605:GO:G_STAND_TWISTNSHOUT
SET:last_danceact:rndnum
WAIT
ENDIF
RET:1
:G_STAND_TWISTNSHOUT
SET:NoFallDown:1
PLAY:ACTION:twistnshout
WAIT
SET:NoFallDown:0
SET:last_danceact:rndnum
RET:1
:G_STAND_GREET
WAIT:1
SET:init_wait:Wait
CALL:G_RANDOM4
CASE:1:PLAY:ACTION:O2_WAVE_LEFT_STAND1
CASE:2:PLAY:ACTION:O2_WAVE_LEFT_STAND2
CASE:3:PLAY:ACTION:O2_WAVE_RIGHT_STAND1
CASE:4:PLAY:ACTION:O2_WAVE_RIGHT_STAND2
GO:G_WAIT
:G_STAND_HELLO
WAIT:1
SET:init_wait:Wait
CALL:G_RANDOM4
CASE:1:PLAY:ACTION:O2_HELLO_STAND1
CASE:2:PLAY:ACTION:O2_HELLO_STAND2
CASE:3:PLAY:ACTION:O2_HELLO_STAND3
CASE:4:PLAY:ACTION:O2_HELLO_STAND4
GO:G_WAIT
:G_STAND_HUH
CALL:G_VOICE_HIT
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:O2_SAYWHAT_LEFT
CASE:2:PLAY:ACTION:O2_SAYWHAT_RIGHT
CASE:3:PLAY:ACTION:O2_LEANRIGHT
GO:G_WAITZERO
:G_STAND_PETTED
WAIT:1
SET:init_wait:Wait
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:O2_TUNE_PETTED1
CASE:2:PLAY:ACTION:O2_TUNE_PETTED2
CASE:3:GO:2761
CALL:G_WAIT
CALL:F_RND100
POP:reTempVar0
PUSH:mood_happy
PUSH:4
GT
POP:reTempVar1
IF:reTempVar1:!=:0:THEN
SET:reTempVar1:66
ELSE
SET:reTempVar1:33
ENDIF
IF:reTempVar0:>:reTempVar1:2768
:2761
WAIT:1
SET:init_wait:Wait
IF:back_count:>:4:THEN
RND:rndnum:0:3
SWITCH:rndnum
CASE:0:PLAY:ACTION+:petting_kick_stand_left
CASE:1:PLAY:ACTION+:petting_kick_stand_right
CASE:2:PLAY:ACTION+:petting_kick_stand_left2
CASE:3:PLAY:ACTION+:petting_kick_stand_right2
SET:last_petsong:999
CALL:G_WAIT
SET:Back_ON:0
ELSE
:reTempLbl24
RND:rndnum:0:5
IF:rndnum:==:last_petsong:reTempLbl24
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_BEEN_PETTED18
CASE:1:PLAY:ACTION:O2_BEEN_PETTED19
CASE:2:PLAY:ACTION:O2_BEEN_PETTED20
CASE:3:PLAY:ACTION:O2_BEEN_PETTED21
CASE:4:PLAY:ACTION:O2_BEEN_PETTED22
CASE:5:PLAY:ACTION:O2_BEEN_PETTED23
SET:last_petsong:rndnum
CALL:G_WAIT
ENDIF
:2768
CALL:G_INC_HAPPY_MOOD
CALL:G_DEC_MAD_MOOD
CALL:G_DEC_SAD_MOOD
RET:1
:G_STAND_POSE
WAIT:1
SET:rndbase:1650
SET:rndcount:5
SET:lastact1:last_poseact
SET:lastact2:last_poseact
SET:init_wait:Wait
CALL:F_BEHAVIOR_RNDN
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
SWITCH:rndnum
CASE:1650:PLAY:ACTION:O2_POSE_MADONNA
CASE:1651:PLAY:ACTION:O2_POSE_WAVERIGHT
CASE:1652:PLAY:ACTION:O2_SMALL_BOW
CASE:1653:PLAY:ACTION:O2_SURPRISE_STAND
CASE:1654:GO:G_STAND_HEADSTAND
CALL:G_WAIT
ENDIF
RET:1
:G_STAND_HEADSTAND
SET:NoFallDown:1
PLAY:ACTION:headstand_stand
CALL:G_WAIT
SET:NoFallDown:0
RET:1
:G_STAND_VOICE_HANDLER
CALL:G_STOP_HEAD
WAIT:1
SWITCH:VoiceCmd
CASE:999:GO:2816
CASE:52:GO:2833
CASE:38:GO:2831
CASE:16:GO:2831
CASE:0x429:GO:2831
CASE:0x42A:GO:2831
CASE:0x42C:GO:2831
CASE:0x42B:GO:2831
CASE:0x42D:GO:2831
CASE:29:GO:2829
CASE:0x416:GO:2829
CASE:0x419:GO:2829
CASE:7:GO:2828
CASE:24:GO:2828
CASE:27:GO:2828
CASE:12:GO:2825
CASE:13:GO:2827
CASE:33:GO:2827
CASE:0x408:GO:2827
CASE:1:GO:2825
CASE:0x40A:GO:2825
CASE:19:GO:2825
CASE:0x40B:GO:2825
CASE:0x41D:GO:2825
CASE:18:GO:2825
CASE:17:GO:2824
CASE:0x409:GO:2824
CASE:39:GO:2823
CASE:0x425:GO:2823
CASE:34:GO:2822
CASE:5:GO:2821
CASE:40:GO:2820
CASE:37:GO:2819
CASE:0x418:GO:2819
CASE:49:GO:2818
CASE:50:GO:2818
CASE:0x414:GO:2818
CASE:30:GO:2817
CASE:11:GO:2815
CASE:2:GO:2814
CASE:10:GO:2812
CASE:6:GO:2806
CASE:14:GO:2811
CASE:0x40E:GO:2811
CASE:3:GO:2808
CASE:8:GO:2809
CASE:36:GO:2800
CASE:49:GO:2800
CASE:32:GO:2834
CASE:0x443:GO:2835
CASE:31:GO:2836
CASE:0x444:GO:2837
RET:2
:2800
CALL:G_VOICE_HIT
CALL:G_RANDOM2
CASE:1:GO:2805
IF_1ST:mood_happy:<:3:2805
PLAY:ACTION:O2_RESIGNATION
WAIT
CALL:G_DEC_HAPPY_MOOD
RET:4
:2805
PLAY:ACTION:LIE
WAIT
RET:4
:2806
CALL:G_VOICE_HIT
CALL:G_SIT_OTHERHAND
RET:5
:2808
CALL:G_Select_Game
RET:5
:2809
CALL:G_VOICE_HIT
RND:rndnum:0:100
IF:rndnum:<:50:THEN
PLAY:ACTION:SIT
ELSE
PLAY:ACTION+:sit_quick
ENDIF
WAIT
RET:5
:2811
CALL:G_KARATE_CHOP
RET:5
:2812
CALL:G_VOICE_HIT
CALL:G_SIT_SHAKEHANDS
RET:5
:2814
CALL:G_SHUDDER
CASE:1:RET:1
GO:2812
:2815
CALL:G_QUERY_HUNGRY
CASE:1:RET:1
RET:5
:2816
CALL:G_STAND_RHYTHM
RET:1
:2817
CALL:G_QUERY_TIRED
RET:1
:2818
CALL:G_STAND_BARK
RET:1
:2819
CALL:G_STAND_POSE
RET:1
:2820
CALL:G_GO_RIGHT
RET:1
:2821
CALL:G_GO_BACK
RET:1
:2822
CALL:G_GO_LEFT
RET:1
:2823
CALL:G_GO_FORWARD
RET:1
:2824
CALL:G_QUERY_MOOD
RET:1
:2825
CALL:G_RANDOM1/3
CASE:1:GO:2827
CALL:G_STAND_HELLO
RET:1
:2827
CALL:G_STAND_GREET
RET:1
:2828
CALL:G_STAND_HUH
RET:1
:2829
CALL:G_VOICE_HIT
CALL:G_STAND_DANCE
RET:1
:2831
CALL:G_VOICE_HIT
CALL:G_SOCCER_SEARCH4BALL
CASE:1:RET:7
CASE:2:RET:6
RET:1
:2833
CALL:G_WALK_REQUEST
CASE:1:RET:3
RET:1
:2834
CALL:G_PLAYBACK_AIBONAME
RET:1
:2835
CALL:G_PLAYBACK_OWNERNAME
RET:1
:2836
CALL:G_NAME_REGISTRATION
RET:5
:2837
CALL:G_OWNER_REGISTRATION
IF:Posture1:==:2:THEN
RET:5
ENDIF
RET:4
:G_STAND_RHYTHM
SET:rndbase:1950
SET:rndcount:6
CALL:G_BEHAVIOR_RNDNM
CASE:3:RET:1
:4097
SWITCH:rndnum
CASE:1950:PLAY:ACTION+:dancestep_aibostand1
CASE:1951:PLAY:ACTION+:dancestep_aibostand2
CASE:1952:PLAY:ACTION+:dancestep_aibostand3
CASE:1953:PLAY:ACTION+:dancestep_aibostand4
CASE:1954:PLAY:ACTION+:dancestep_stand1
CASE:1955:PLAY:ACTION+:dancestep_stand2
WAIT
RET:1
:G_WALK_ABOUT
CALL:G_CHECK_SITONLY
CASE:103:RET:103
CASE:104:RET:104
CALL:G_NEED2REST
CASE:1:RET:102
CALL:G_WAITZERO
PLAY:ACTION:STAND
CALL:G_WAITZERO
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:5:THEN
PLAY:ACTION:roadrunner
CALL:G_WAITZERO
ENDIF
CLR:SENSORS
SET:ex_pan_r:999
SET:ex_pan_l:999
RND:maxtime10:5:10
ADD:maxtime10:endure
WAIT:1
IF:Back_LONG:>:0:THEN
RET:102
ENDIF
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:THEN
RET:107
ENDIF
:WA_WALKLOOP
CALL:G_WALK_LOOK_AROUND
CASE:1:GO:3635
CASE:2:RET:107
CASE:3:GO:3634
CASE:4:GO:3633
CASE:5:RET:105
CASE:6:GO:WA_TURN
CASE:7:GO:WA_WALKING
:WA_FOUNDCLIFF
CALL:G_WALK_FOUND_CLIFF
CASE:109:GO:WA_WALKLOOP
CASE:107:RET:107
CASE:102:GO:3635
CASE:103:GO:3634
CASE:104:GO:3633
CASE:105:RET:105
:WA_WALKING
CALL:G_WALK_WALKING
CASE:1:GO:WA_OBSTACLE
CASE:2:GO:3635
CASE:3:RET:107
CASE:4:GO:3634
CASE:5:GO:3633
CASE:6:RET:105
GO:WA_FOUNDCLIFF
:WA_TURN
CALL:G_WALK_TURN?
CASE:1:GO:3635
CASE:3:GO:3634
CASE:4:GO:3633
CASE:5:RET:105
CASE:6:GO:WA_WALKING
CASE:7:GO:WA_FOUNDCLIFF
:WA_OBSTACLE
CALL:G_CUSTOM_WALK_OBSTACLE
CASE:103:RET:103
CASE:104:RET:104
CASE:105:RET:105
CASE:107:RET:107
GO:WA_WALKLOOP
:3633
CALL:G_DEC_ENDURE
RET:104
:3634
CALL:G_DEC_ENDURE
RET:103
:3635
CALL:G_INC_ENDURE
RET:102
:G_WAIT_WALK
IF:Wait:>:init_walkwait:THEN
CALL:G_WALK_ATTENTION_HANDLER
CASE:103:RET:2
CASE:102:RET:3
CASE:107:RET:4
CASE:104:RET:5
CASE:108:RET:7
CASE:105:RET:6
WAIT:100
GO:G_WAIT_WALK
ENDIF
RET:1
:G_WALK_ATTENTION_HANDLER
CALL:G_TIMER_TIRED
CASE:1:RET:102
CALL:G_CHECK_SITONLY
CASE:103:RET:103
CASE:104:RET:104
CALL:G_ATTENTION_HANDLER
CASE:112:GO:3254
CASE:111:GO:3254
CASE:113:GO:3253
CASE:102:RET:102
CASE:103:RET:103
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:100
CASE:100:RET:100
:WAH_PROCESSVOICE
CALL:G_YART_VoiceCmd
CASE:102:RET:102
CASE:103:RET:103
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:100
CALL:G_CUSTOM_WALK_VOICECMD
CASE:103:RET:103
CASE:104:RET:104
CASE:105:RET:105
CASE:107:RET:107
CASE:115:RET:100
SWITCH:VoiceCmd
CASE:12:GO:3210
CASE:13:GO:3210
CASE:33:GO:3210
CASE:1:GO:3210
CASE:19:GO:3210
CASE:18:GO:3210
CASE:38:GO:3210
CASE:16:GO:3210
CASE:29:GO:3210
CASE:7:GO:3210
CASE:27:GO:3210
CASE:17:GO:3210
CASE:39:GO:3210
CASE:5:GO:3210
CASE:34:GO:3210
CASE:40:GO:3210
CASE:37:GO:3210
CASE:49:GO:3210
CASE:50:GO:3210
CASE:30:GO:3210
CASE:11:GO:3210
CASE:24:GO:3210
CASE:8:GO:3210
CASE:2:GO:3210
CASE:10:GO:3210
CASE:6:GO:3210
CASE:14:GO:3210
CASE:3:GO:3210
CASE:36:GO:3210
CASE:31:GO:3210
CASE:32:GO:3210
CASE:0x40B:GO:3210
CASE:0x41D:GO:3210
CASE:0x40A:GO:3210
CASE:0x408:GO:3210
CASE:0x409:GO:3210
CASE:0x414:GO:3210
CASE:0x418:GO:3210
CASE:0x41D:GO:3210
CASE:0x425:GO:3210
CASE:0x40E:GO:3210
CASE:0x416:GO:3210
CASE:0x419:GO:3210
CASE:0x429:GO:3210
CASE:0x42A:GO:3210
CASE:0x42C:GO:3210
CASE:0x42B:GO:3210
CASE:0x42D:GO:3210
CASE:0x444:GO:3210
CASE:0x443:GO:3210
RET:100
:3210
IF:Wait:>:0:THEN
IF:walking:==:0:THEN
SET:dd:d
SET:pan:Head_Pan
PLAY:ACTION:MOVE.HEAD.NORMAL:pan:0
PLAY:ACTION:PALONE.AUTO.TAILSTOP
ENDIF
IF:walking:==:1:THEN
PLAY:ACTION:MOVE.MOVE.NORMAL:0:0
ENDIF
IF:walking:==:2:THEN
STOP
WAIT
ENDIF
CALL:G_WAITZERO
ENDIF
SWITCH:VoiceCmd
CASE:38:GO:3248
CASE:16:GO:3248
CASE:0x429:GO:3248
CASE:0x42A:GO:3248
CASE:0x42C:GO:3248
CASE:0x42B:GO:3248
CASE:0x42D:GO:3248
CASE:29:GO:3246
CASE:0x416:GO:3246
CASE:0x419:GO:3246
CASE:7:GO:3245
CASE:27:GO:3245
CASE:12:GO:3242
CASE:1:GO:3242
CASE:19:GO:3242
CASE:18:GO:3242
CASE:0x40B:GO:3242
CASE:0x41D:GO:3242
CASE:0x40A:GO:3242
CASE:13:GO:3244
CASE:33:GO:3244
CASE:0x408:GO:3244
CASE:17:GO:3241
CASE:0x409:GO:3241
CASE:39:GO:3240
CASE:0x425:GO:3240
CASE:5:GO:3238
CASE:34:GO:3239
CASE:40:GO:3237
CASE:37:GO:3236
CASE:0x418:GO:3236
CASE:49:GO:3235
CASE:50:GO:3235
CASE:0x414:GO:3235
CASE:30:GO:3234
CASE:11:GO:3232
CASE:24:GO:3231
CASE:8:GO:3229
CASE:2:GO:3227
CASE:10:GO:3227
CASE:6:GO:3224
CASE:14:GO:3226
CASE:0x40E:GO:3226
CASE:3:GO:3223
CASE:36:GO:3217
CASE:32:GO:3255
CASE:0x443:GO:3256
CASE:31:GO:3257
CASE:0x444:GO:3258
RET:100
:3217
CALL:G_VOICE_HIT
CALL:G_RANDOM2
CASE:1:GO:3222
IF_1ST:mood_sad:>:2:3222
IF_1ST:mood_happy:<:3:3222
PLAY:ACTION:O2_RESIGNATION
WAIT
CALL:G_DEC_HAPPY_MOOD
RET:103
:3222
PLAY:ACTION:LIE
WAIT
RET:103
:3223
CALL:G_Select_Game
RET:104
:3224
CALL:G_VOICE_HIT
CALL:G_SIT_OTHERHAND
RET:104
:3226
CALL:G_KARATE_CHOP
RET:104
:3227
CALL:G_VOICE_HIT
CALL:G_SIT_SHAKEHANDS
RET:104
:3229
CALL:G_VOICE_HIT
RND:rndnum:0:100
IF:rndnum:<:50:THEN
PLAY:ACTION:SIT
ELSE
PLAY:ACTION+:sit_quick
ENDIF
WAIT
RET:104
:3231
CALL:G_VOICE_HIT
RET:108
:3232
CALL:G_QUERY_HUNGRY
CASE:2:RET:104
RET:105
:3234
CALL:G_QUERY_TIRED
RET:105
:3235
CALL:G_STAND_BARK
RET:105
:3236
CALL:G_STAND_POSE
RET:105
:3237
CALL:G_GO_RIGHT
RET:105
:3238
CALL:G_GO_BACK
RET:105
:3239
CALL:G_GO_LEFT
RET:105
:3240
CALL:G_GO_FORWARD
RET:105
:3241
CALL:G_QUERY_MOOD
RET:105
:3242
CALL:G_RANDOM1/3
CASE:1:GO:3244
CALL:G_STAND_HELLO
RET:105
:3244
CALL:G_STAND_GREET
RET:105
:3245
CALL:G_STAND_HUH
RET:105
:3246
CALL:G_VOICE_HIT
CALL:G_STAND_DANCE
RET:105
:3248
CALL:G_VOICE_HIT
IF:walking:!=:2:THEN
CALL:G_SOCCER_SEARCH4BALL
CASE:1:RET:102
CASE:2:RET:107
ENDIF
RET:105
:3253
CALL:G_SCOLD
RET:100
:3254
CALL:G_PRAISE
RET:100
:3255
CALL:G_PLAYBACK_AIBONAME
RET:105
:3256
CALL:G_PLAYBACK_OWNERNAME
RET:105
:3257
CALL:G_NAME_REGISTRATION
RET:104
:3258
CALL:G_OWNER_REGISTRATION
IF:Posture1:==:2:THEN
RET:104
ENDIF
RET:103
:G_WALK_CHECK_DIST
SET:turn_timeout:12
SET:init_walkwait:0
:3264
PLAY:ACTION:MOVE_HEAD:0:0
WAIT
:WCD_LOOP
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:THEN
RET:3
ENDIF
IF:turn_timeout:<=:0:WCD_GIVEUP
CALL:G_WALK_ATTENTION_HANDLER
CASE:103:RET:4
CASE:102:RET:7
CASE:107:RET:3
CASE:104:RET:5
CASE:108:RET:6
CASE:105:RET:6
WAIT:1
IF:Distance:<:500:THEN
SUB:turn_timeout:1
PLAY:ACTION:TURN:pan
SET:walking:1
CALL:G_WAIT_WALK
CASE:1:GO:WCD_LOOP
CASE:2:RET:4
CASE:3:RET:7
CASE:4:RET:3
CASE:5:RET:5
CASE:6:RET:6
RET:6
ENDIF
CALL:G_WAITZERO
IF:Posture1:!=:4:THEN
PLAY:ACTION:CHGPOS.WALK.NORMAL
CALL:G_WAITZERO
ENDIF
PLAY:ACTION:MOVE_HEAD:0:-15
:reTempLbl25
WAIT:1
IF:Distance:<:200:THEN
CALL:G_WAITZERO
GO:WCD_ATTENTION
ENDIF
IF:Wait:>:0:reTempLbl25
WAIT:500
SET:d:Distance
IF:d:>:850:THEN
RET:1
ENDIF
IF:d:>=:200:THEN
RET:2
ENDIF
:WCD_ATTENTION
CALL:G_WALK_ATTENTION_HANDLER
CASE:103:RET:4
CASE:102:RET:7
CASE:107:RET:3
CASE:104:RET:5
CASE:108:RET:6
CASE:105:RET:6
IF:turn_timeout:<=:0:WCD_GIVEUP
SUB:turn_timeout:1
PLAY:ACTION:TURN:pan
SET:walking:1
CALL:G_WAIT_WALK
CASE:2:RET:4
CASE:3:RET:7
CASE:4:RET:3
CASE:5:RET:5
CASE:6:RET:6
CASE:7:RET:6
WAIT:1
IF:Distance:<:200:WCD_ATTENTION
IF:Distance:<:850:THEN
PLAY:ACTION:MOVE_HEAD:0:0
CALL:G_WAITZERO
GO:WCD_LOOP
ENDIF
RET:1
:WCD_GIVEUP
CALL:G_RANDOM2
CASE:1:PLAY:ACTION+:ummm
CASE:2:PLAY:ACTION:O2_OHWELL
CALL:G_WAITZERO
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:50:THEN
RET:4
ENDIF
RET:5
:G_WALK_FOUND_CLIFF
SET:RFLeg_ON:0
SET:LFLeg_ON:0
SET:RRLeg_ON:0
SET:LRLeg_ON:0
PLAY:ACTION:MOVE.MOVE.NORMAL:0:0
PLAY:ACTION:PALONE.AUTO.TAILSTOP
PLAY:ACTION:MOVE.HEAD.NORMAL:0:-15
WAIT
CALL:G_BEING_HELD
CASE:2:RET:102
WAIT:1
IF:Distance:<:200:THEN
RET:109
ENDIF
IF:Distance:>=:800:THEN
GO:WFC_CLIFFACT
ENDIF
WAIT:1
SET:ex_pan_r:Head_Pan
SET:ex_pan_l:ex_pan_r
SUB:ex_pan_r:15
ADD:ex_pan_l:15
SET:map_state:0
SET:map_d:Distance
SET:fall_edge_tilt:0
SET:rise_edge_tilt:0
SET:fall_edge_dist:0
SET:rise_edge_dist:0
SET:walkcount:0
PLAY:ACTION:MOVE.HEAD.SLOW:0:0
:3300
CALL:G_WALK_UPDATE_CLIFF_MAP
WAIT:1
IF_1ST:map_state:=:2:3315
IF_1ST:Wait:>:0:3300
IF_1ST:map_state:<>:0:WFC_CLIFFACT
PLAY:ACTION:MOVE.HEAD.SLOW:0:-50
:3303
CALL:G_WALK_UPDATE_CLIFF_MAP
WAIT:1
IF_1ST:map_state:=:2:3315
IF_1ST:Wait:>:0:3303
IF_1ST:map_state:<>:0:WFC_CLIFFACT
IF:Posture1:!=:4:THEN
PLAY:ACTION:CHGPOS.WALK.NORMAL
WAIT
ENDIF
PLAY:ACTION:MOVE_HEAD:0:-15
WAIT
WAIT:500
IF:Distance:<:200:THEN
RET:109
ENDIF
PUSH:Distance
PUSH:800
GE
POP:reTempVar0
PUSH:walkcount
PUSH:3
GE
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
GO:WFC_CLIFFACT
ENDIF
IF:mood_tired:>:8:THEN
PLAY:ACTION:MOVE.MOVE.SLOW:0:300
ELSE
PLAY:ACTION:WALK:0:300
ENDIF
ADD:walkcount:1
SET:pan:-45
:reTempLbl26
WAIT:1
SET:d:Distance
IF:d:<:200:THEN
PLAY:ACTION:MOVE.MOVE.NORMAL:0:0
WAIT
RET:109
ENDIF
IF:d:>=:800:THEN
PLAY:ACTION:MOVE.MOVE.NORMAL:0:0
WAIT
GO:WFC_CLIFFACT
ENDIF
IF:Wait:>:0:reTempLbl26
GO:3298
:3315
PLAY:ACTION:MOVE_HEAD:0:0
WAIT
:WFC_CLIFFACT
CALL:G_YART_Walking_SeeCliff
CASE:102:RET:102
CASE:103:RET:103
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
CALL:G_CLIFFACT
:3298
CALL:G_WALK_CHECK_DIST
CASE:1:GO:G_WALK_FOUND_CLIFF
CASE:2:RET:106
CASE:3:RET:107
CASE:4:RET:103
CASE:5:RET:104
CASE:6:RET:105
RET:102
:G_WALK_GONOW
WAIT:1
PUSH:tailwag
PUSH:0
GT
POP:reTempVar0
PUSH:Wait
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
PLAY:ACTION:PALONE.AUTO.TAILSTOP
ENDIF
SET:tailwag:0
IF:mood_sad:<:2:THEN
PLAY:ACTION+:happy_eyes
WAIT
ENDIF
CALL:G_INC_HAPPY_MOOD
CALL:G_DEC_SAD_MOOD
CALL:G_WALK_ATTENTION_HANDLER
CASE:103:RET:8
CASE:102:RET:5
CASE:107:RET:4
CASE:104:RET:7
CASE:108:RET:6
CASE:105:RET:6
IF:pan:<:-10:THEN
ADD:pan:-10
SET:init_walkwait:0
PLAY:ACTION:TURN:pan
PLAY:ACTION:MOVE_HEAD:0:0
SET:pan:-45
ELSE
IF:pan:>:10:THEN
ADD:pan:10
SET:init_walkwait:0
PLAY:ACTION:TURN:pan
PLAY:ACTION:MOVE_HEAD:0:0
SET:pan:45
ELSE
RND:pan:0:1
MUL:pan:90
SUB:pan:45
SET:init_walkwait:0
PLAY:ACTION:MOVE_HEAD:0:0
WAIT
ENDIF
ENDIF
CALL:G_WAIT_WALK
CASE:2:RET:8
CASE:3:RET:5
CASE:4:RET:4
CASE:5:RET:7
CASE:6:RET:6
CASE:7:RET:6
WAIT:1
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:THEN
RET:4
ENDIF
IF:Distance:>=:500:THEN
CALL:G_WALK_CHECK_DIST
CASE:1:RET:2
CASE:2:RET:3
CASE:3:RET:4
CASE:4:RET:8
CASE:5:RET:7
CASE:6:RET:6
RET:5
ENDIF
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:20:THEN
PLAY:ACTION+:mad_eyes
WAIT
CALL:G_DEC_HAPPY_MOOD
CALL:G_DEC_HAPPY_MOOD
CALL:G_INC_MAD_MOOD
ENDIF
:3335
SET:left_done:0
SET:right_done:0
SET:gonow:0
RET:1
:G_WALK_LOOK_AROUND
WAIT:1
IF:Wait:>:0:THEN
STOP
WAIT
ENDIF
CLR:SENSORS
WAIT
SET:left_done:0
SET:right_done:0
RND:dirsel:0:100
SET:walking:0
:3354
SET:tailwag:0
SET:gonow:1
PUSH:mood_happy
PUSH:1
GT
POP:reTempVar0
PUSH:mood_sad
PUSH:1
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
IF:mood_happy:>:5:THEN
CALL:G_START_TAILWAG_FAST
ELSE
CALL:G_START_TAILWAG_NORMAL
ENDIF
ENDIF
:3357
IF_1ST:dirsel:<:43:3371
IF_1ST:dirsel:<:86:3364
CALL:G_WALK_FINDTABLE
CASE:107:GO:3363
CASE:102:GO:3362
CASE:105:RET:5
CASE:104:RET:4
CASE:103:RET:3
CASE:109:GO:3360
SET:left_done:0
SET:right_done:0
SET:ex_pan_r:999
SET:ex_pan_l:999
RND:dirsel:0:79
GO:3354
:3360
PUSH:pan
PUSH:-10
GE
POP:reTempVar0
PUSH:pan
PUSH:10
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
RET:7
ENDIF
CALL:G_TIMER_TIRED
CASE:1:RET:1
RET:6
:3362
CALL:G_STOP_TAILWAG
RET:1
:3363
CALL:G_STOP_TAILWAG
RET:2
:3364
SET:right_done:1
SET:sofs:0
SET:eofs:-90
CALL:G_WALK_SCAN
CASE:1:GO:3374
CASE:2:GO:3363
CASE:4:GO:3362
CASE:5:RET:5
CASE:6:RET:4
CASE:7:RET:3
SET:right_dd:dd
SET:right_pan:pan
:3367
IF_1ST:left_done:=:0:3371
IF_1ST:right_done:<=:0:3364
IF_1ST:left_dd:>:right_dd:3370
SET:dd:right_dd
SET:pan:right_pan
PLAY:ACTION:PALONE.AUTO.TAILSTOP
PLAY:ACTION:MOVE.HEAD.NORMAL:0:0
WAIT
GO:3360
:3370
SET:dd:left_dd
SET:pan:left_pan
PLAY:ACTION:PALONE.AUTO.TAILSTOP
PLAY:ACTION:MOVE.HEAD.NORMAL:0:0
WAIT
GO:3360
:3371
SET:left_done:1
SET:sofs:0
SET:eofs:90
CALL:G_WALK_SCAN
CASE:1:GO:3374
CASE:2:GO:3363
CASE:4:GO:3362
CASE:5:RET:5
CASE:6:RET:4
CASE:7:RET:3
SET:left_dd:dd
SET:left_pan:pan
GO:3367
:3374
CALL:G_WALK_GONOW
CASE:1:GO:3357
CASE:2:RET:8
CASE:3:RET:7
CASE:4:GO:3363
CASE:5:RET:1
CASE:6:RET:5
CASE:7:RET:4
RET:3
:G_WALK_SCAN
SET:dd:0
SET:pan:0
WAIT:1
SET:init_lookwait:Wait
PLAY:ACTION:MOVE.HEAD.NORMAL:eofs:0
SET:walking:0
:3485
CALL:G_NEED2REST
CASE:1:RET:4
CALL:G_WALK_ATTENTION_HANDLER
CASE:103:RET:7
CASE:102:RET:4
CASE:107:RET:2
CASE:104:RET:6
CASE:108:RET:5
CASE:105:RET:5
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:THEN
RET:2
ENDIF
WAIT:1
IF:Wait:<=:init_lookwait:THEN
RET:3
ENDIF
SET:d:Distance
SET:p:Head_Pan
PUSH:d
PUSH:500
GE
POP:reTempVar0
IF:gonow:&&:reTempVar0:THEN
SET:dd:d
SET:pan:p
PLAY:ACTION:MOVE.HEAD.NORMAL:pan:0
PLAY:ACTION:PALONE.AUTO.TAILSTOP
WAIT
RET:1
ENDIF
CALL:G_WALK_UPDATE_BEST_DISTANCE
GO:3485
:G_WALK_TURN?
CALL:G_NEED2REST
CASE:1:RET:1
WAIT
SET:init_walkwait:0
IF_1ST:dd:<:200:3513
IF_1ST:pan:<:-15:3511
IF_1ST:pan:>:15:3512
CALL:G_RANDOM6
CASE:1:RET:6
CASE:2:GO:3512
CASE:3:GO:3511
CASE:4:GO:3510
CASE:5:GO:3509
SET:pan:45
PLAY:ACTION:TURN:90
:3507
CALL:G_WAIT_WALK
CASE:2:RET:3
CASE:3:RET:1
CASE:4:RET:2
CASE:5:RET:4
CASE:6:RET:5
CASE:7:RET:5
CALL:G_WALK_CHECK_DIST
CASE:1:RET:7
CASE:2:RET:6
CASE:3:RET:2
CASE:4:RET:3
CASE:5:RET:4
CASE:6:RET:5
RET:1
:3509
SET:pan:-45
PLAY:ACTION:TURN:-90
GO:3507
:3510
SET:pan:45
PLAY:ACTION:TURN:180
GO:3507
:3511
SET:pan:-45
PLAY:ACTION:TURN:pan
GO:3507
:3512
SET:pan:45
PLAY:ACTION:TURN:pan
GO:3507
:3513
PLAY:ACTION+:ummm
WAIT
PLAY:ACTION:WALK:180:300
WAIT
SET:ex_pan_r:-20
SET:ex_pan_l:20
CALL:G_WALK_LOOK_AROUND
CASE:1:RET:1
CASE:2:RET:2
CASE:3:RET:3
CASE:4:RET:4
CASE:5:RET:5
CASE:7:RET:6
CASE:8:RET:7
IF_1ST:pan:<:-15:3511
IF_1ST:pan:>:15:3512
SET:pan:45
PLAY:ACTION:TURN:180
GO:3507
:G_WALK_UPDATE_BEST_DISTANCE
IF:d:<:dd:3526
IF_1ST:p:>:ex_pan_r
IF_AND:p:<:ex_pan_l:3526
SET:dd:d
SET:pan:p
:3526
RET:1
:G_WALK_UPDATE_CLIFF_MAP
WAIT:1
SET:d:Distance
SET:t:Head_Tilt
SET:delta:map_d
SUB:delta:d
SWITCH:map_state
CASE:0:GO:3536
CASE:1:GO:3534
CASE:3:GO:3532
:3531
SET:map_d:d
RET:1
:3532
IF_1ST:delta:<=:50:3531
SET:map_state:2
SET:rise_edge_tilt:t
SET:rise_edge_dist:d
SET:map_d:d
RET:1
:3534
IF_1ST:delta:>=:-50:3531
SET:map_state:2
SET:fall_edge_tilt:t
SET:fall_edge_dist:d
SET:map_d:d
RET:1
:3536
IF_1ST:delta:>:50
IF_AND:map_d:<:400:3538
IF_1ST:delta:<:-50
IF_AND:map_d:<:400:3537
SET:map_d:d
RET:1
:3537
SET:map_state:3
SET:fall_edge_tilt:t
SET:fall_edge_dist:d
SET:map_d:d
RET:1
:3538
SET:map_state:1
SET:rise_edge_tilt:t
SET:rise_edge_dist:d
SET:map_d:d
RET:1
:G_WALK_WALKACT
RND:rndnum:0:100
IF:rndnum:>:33:THEN
RET:100
ENDIF
PUSH:mood_happy
PUSH:2
GE
POP:reTempVar0
PUSH:mood_sad
PUSH:2
LE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:mood_mad
PUSH:1
LE
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
CALL:G_YART_Walking_Happy
IF:Context:!=:101:THEN
RET:Context
ENDIF
ENDIF
SET:rndbase:1700
SET:rndcount:18
CALL:F_BEHAVIOR_RNDN
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
IF:rndnum:<:1705:THEN
PLAY:ACTION:STOP_WALK
WAIT
SWITCH:rndnum
CASE:1700:GO:WALKACT_SCRATCH_LEFT
CASE:1701:GO:WALKACT_SCRATCH_LEFT
CASE:1702:GO:WALKACT_SCRATCH_RIGHT
CASE:1703:GO:WALKACT_SCRATCH_RIGHT
CASE:1704:PLAY:ACTION+:sticky_floor
CALL:G_WAITZERO
RET:100
ENDIF
PUSH:mood_happy
PUSH:2
LT
POP:reTempVar0
PUSH:mood_sad
PUSH:2
GT
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
PUSH:mood_mad
PUSH:1
GT
POP:reTempVar2
LIOR:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
RET:100
ENDIF
PLAY:ACTION:STOP_WALK
CALL:G_WAITZERO
SWITCH:rndnum
CASE:1705:PLAY:ACTION:O2_CUTE_SMILE1
CASE:1706:PLAY:ACTION:O2_CUTE_SWING1
CASE:1707:PLAY:ACTION:O2_CUTE_SWING2
CASE:1708:PLAY:ACTION:O2_DANCE_STAND4
CASE:1709:PLAY:ACTION:O2_DANCE_STAND5
CASE:1710:PLAY:ACTION:O2_DANCE_STAND6
CASE:1711:PLAY:ACTION:digging
CASE:1712:PLAY:ACTION:digging2
CASE:1713:PLAY:ACTION:digging3
CASE:1714:PLAY:ACTION:digging4
CASE:1715:PLAY:ACTION:digging5
CASE:1716:PLAY:ACTION:digging6
CASE:1717:PLAY:ACTION:motorcycle
CALL:G_WAITZERO
ENDIF
RET:100
:WALKACT_SCRATCH_RIGHT
SWITCH:rndnum
CASE:1702:PLAY:ACTION+:scratch_rear_right
CASE:1703:PLAY:ACTION+:scratch_rear_ear_right
CALL:G_WAITZERO
CALL:G_RANDOM1/3
CASE:2:RET:1
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:O2_RIGHT_EAR_TWITCH1
CASE:2:PLAY:ACTION:O2_RIGHT_EAR_TWITCH2
CASE:3:PLAY:ACTION:O2_RIGHT_EAR_TWITCH3
GO:G_WAITZERO
:WALKACT_SCRATCH_LEFT
SWITCH:rndnum
CASE:1700:PLAY:ACTION+:scratch_rear_left
CASE:1701:PLAY:ACTION+:scratch_rear_ear_left
CALL:G_WAITZERO
CALL:G_RANDOM1/3
CASE:2:RET:1
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:O2_LEFT_EAR_TWITCH1
CASE:2:PLAY:ACTION:O2_LEFT_EAR_TWITCH2
CASE:3:PLAY:ACTION:O2_LEFT_EAR_TWITCH3
GO:G_WAITZERO
:G_WALK_WALKING
CALL:G_NEED2REST
CASE:1:RET:2
:WW_STARTWALK
CALL:G_WALK_ATTENTION_HANDLER
CASE:103:RET:4
CASE:102:RET:2
CASE:107:RET:3
CASE:104:RET:5
CASE:108:RET:6
CASE:105:RET:6
IF:Posture1:!=:4:THEN
PLAY:ACTION:CHGPOS.WALK.NORMAL
CALL:G_WAITZERO
ENDIF
PLAY:ACTION:MOVE_HEAD:0:-15
CALL:G_WAITZERO
WAIT:500
SET:ex_pan_r:999
SET:ex_pan_l:999
CALL:G_WALK_ATTENTION_HANDLER
CASE:103:RET:4
CASE:102:RET:2
CASE:107:RET:3
CASE:104:RET:5
CASE:108:RET:6
CASE:105:RET:6
IF:Back_ON:>:0:THEN
RET:2
ENDIF
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:THEN
RET:3
ENDIF
SET:d:Distance
IF:d:<:200:THEN
CALL:G_WALK_TOO_CLOSE
CASE:103:RET:4
CASE:102:RET:2
CASE:104:RET:5
CASE:108:RET:6
CASE:105:RET:6
RET:1
ENDIF
IF:d:>=:800:THEN
STOP
RET:7
ENDIF
IF:mood_tired:>:8:THEN
PLAY:ACTION:MOVE.MOVE.SLOW:0:-1
ELSE
PLAY:ACTION:WALK:0:-1
ENDIF
SET:RFLeg_ON:0
SET:LFLeg_ON:0
SET:RRLeg_ON:0
SET:LRLeg_ON:0
SET:walking:1
RND:pan:0:1
MUL:pan:50
SUB:pan:25
SET:look_state:0
SET:Clock:0
RND:maxtime1:5:20
RND:maxtime2:0:2
:WW_WALKLOOP
WAIT:1
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:WW_STOPWALK
IF:Distance:<:200:THEN
CALL:G_WALK_TOO_CLOSE
CASE:103:RET:4
CASE:102:RET:2
CASE:104:RET:5
CASE:108:RET:6
CASE:105:RET:6
RET:1
ENDIF
IF:Distance:>:800:THEN
PUSH:Head_Pan
PUSH:-15
GE
POP:reTempVar0
PUSH:Head_Pan
PUSH:15
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
RET:7
ENDIF
IF:Distance:>:725:THEN
RET:7
ENDIF
ENDIF
PUSH:AP_Voice_Cmd
PUSH:0
EQ
POP:reTempVar0
PUSH:Clock
PUSH:32
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
GO:WW_WALKLOOP
ENDIF
CALL:G_WALK_TIMER
CASE:1:GO:WW_WALKLOOP
CASE:2:RET:4
CASE:3:RET:3
CASE:4:GO:WW_STOPWALK
CASE:5:RET:1
CASE:6:RET:5
CASE:7:RET:6
RND:rndnum:0:100
IF:rndnum:>=:10:WW_STARTWALK
RET:6
:WW_STOPWALK
PLAY:ACTION:WALK:0:0
CALL:G_WAITZERO
CALL:F_SEE_BALL
POP:reTempVar0
IF:reTempVar0:==:107:THEN
RET:3
ENDIF
RET:2
:G_CLIFFACT
CALL:G_RANDOM3
CASE:1:PLAY:ACTION+:testfloor
CASE:2:PLAY:ACTION:O2_ATCLIFF
CASE:3:PLAY:ACTION:O2_SHUDDER
CALL:G_WAITZERO
CALL:G_RANDOM4
CASE:1:GO:1108
CASE:2:GO:1107
CASE:3:GO:1106
PLAY:ACTION:TURN:-180
CALL:G_WAITZERO
SET:pan:-45
SET:lastmove:1
RET:1
:1106
PLAY:ACTION:TURN:180
CALL:G_WAITZERO
SET:pan:45
SET:lastmove:0
RET:1
:1107
PLAY:ACTION:TURN:120
CALL:G_WAITZERO
SET:pan:45
SET:lastmove:0
RET:1
:1108
PLAY:ACTION:TURN:-120
CALL:G_WAITZERO
SET:pan:-45
SET:lastmove:1
RET:1
:G_WALK_TIMER
IF_1ST:Posture1:==:7:3738
IF_1ST:Posture1:==:5:3738
IF_1ST:Posture1:==:255:3738
IF_1ST:Back_LONG:>:0:3738
IF_1ST:Batt_Rest:<:25:3738
IF_1ST:40:>:45:3738
IF_1ST:Batt_Temp:>:45:3738
CALL:G_WALK_ATTENTION_HANDLER
CASE:103:RET:2
CASE:102:RET:4
CASE:107:RET:3
CASE:104:RET:6
CASE:108:RET:7
CASE:105:RET:8
IF:maxtime1:<=:0:THEN
CALL:G_WALK_WALKACT
CASE:103:RET:2
CASE:102:RET:4
CASE:104:RET:6
CASE:105:RET:8
RET:5
ENDIF
IF:maxtime2:<=:0:THEN
IF:look_state:<:2:THEN
MUL:pan:-1
ADD:look_state:1
SET:maxtime2:2
PLAY:ACTION:MOVE_HEAD:pan:-15
ELSE
SET:look_state:0
RND:maxtime2:2:3
PLAY:ACTION:MOVE_HEAD:0:-15
ENDIF
SET:RFLeg_ON:0
SET:LFLeg_ON:0
SET:RRLeg_ON:0
SET:LRLeg_ON:0
ENDIF
RET:1
:3738
RET:4
:G_WALK_TOO_CLOSE
STOP
WAIT:1
SET:ex_pan_r:Head_Pan
SET:ex_pan_l:ex_pan_r
SUB:ex_pan_r:15
ADD:ex_pan_l:15
RND:rndnum:0:100
IF:Head_Pan:>:5:THEN
SET:ex_pan_r:15
ENDIF
IF:Head_Pan:<:-5:THEN
SET:ex_pan_l:15
ENDIF
IF:rndnum:<:80:THEN
RET:109
ENDIF
IF:Head_Pan:>:5:THEN
CALL:G_YART_Walking_ObstacleLeft
IF:Context:!=:101:THEN
RET:Context
ENDIF
CALL:G_RANDOM3
CASE:1:PLAY:ACTION+:sniff_left
CASE:2:PLAY:ACTION+:sniff2_left
CASE:3:PLAY:ACTION+:sniff3_left
CALL:G_WAITZERO
RET:109
ENDIF
IF:Head_Pan:<:-5:THEN
CALL:G_YART_Walking_ObstacleRight
IF:Context:!=:101:THEN
RET:Context
ENDIF
CALL:G_RANDOM3
CASE:1:PLAY:ACTION+:sniff_right
CASE:2:PLAY:ACTION+:sniff2_right
CASE:3:PLAY:ACTION+:sniff3_right
CALL:G_WAITZERO
RET:109
ENDIF
CALL:G_YART_Walking_ObstacleFront
IF:Context:!=:101:THEN
RET:Context
ENDIF
PLAY:ACTION:sniff_ahead
CALL:G_WAITZERO
RET:109
:G_BEING_HELD
SET:last_heldact:-1
SET:last_heldact2:-1
WAIT:1
IF_1ST:RFLeg_ON:>:0:1096
IF_1ST:LFLeg_ON:>:0:1096
IF_1ST:RRLeg_ON:>:0:1096
IF_1ST:LRLeg_ON:>:0:1096
SET:RFLeg_ON:0
SET:LFLeg_ON:0
SET:RRLeg_ON:0
SET:LRLeg_ON:0
WAIT:1000
IF_1ST:RFLeg_ON:>:0:1096
IF_1ST:LFLeg_ON:>:0:1096
IF_1ST:RRLeg_ON:>:0:1096
IF_1ST:LRLeg_ON:>:0:1096
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:O2_SURPRISE1
CASE:2:PLAY:ACTION:O2_SURPRISE2
CASE:3:PLAY:ACTION:O2_SURPRISE3
CALL:G_WAITZERO
PLAY:ACTION:MOVE.HEAD.NORMAL:40:-15
CALL:G_WAITZERO
WAIT:500
PLAY:ACTION:MOVE.HEAD.NORMAL:-40:-15
CALL:G_WAITZERO
WAIT:500
PLAY:ACTION:MOVE.HEAD.NORMAL:0:-90
CALL:G_WAITZERO
WAIT:500
IF_1ST:Distance:<:200:1096
PLAY:ACTION:O2_BELLYPOS
CALL:G_WAITZERO
:BH_INITTIMER
RND:timer:5:30
:1048
CALL:G_NEED2REST
CASE:1:RET:2
CALL:G_SLEEP_ATTENTION
CASE:100:GO:1051
CASE:112:GO:1093
CASE:111:GO:1092
CASE:113:GO:1089
CASE:102:GO:1051
CASE:103:GO:1051
CASE:104:GO:1051
CASE:106:GO:1051
CASE:105:GO:1051
CALL:G_STATION_VOICE_HANDLER
CASE:2:GO:BH_INITTIMER
:1051
SUB:timer:1
WAIT:100
IF_1ST:timer:>=:1:1048
RND:rndnum:0:100
IF:rndnum:<:20:THEN
PLAY:ACTION:MOVE.HEAD.NORMAL:0:-90
CALL:G_WAITZERO
IF:Distance:<:200:THEN
RET:1
ENDIF
ENDIF
IF:rndnum:<:80:THEN
RND:tilt:-40:10
RND:pan:-60:60
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:MOVE.HEAD.NORMAL:pan:tilt
CASE:2:PLAY:ACTION:MOVE.HEAD.NORMAL:pan:tilt
CASE:3:PLAY:ACTION:MOVE.HEAD.SLOW:pan:tilt
CALL:G_WAITZERO
WAIT:500
IF_1ST:Distance:>=:200:BH_INITTIMER
PLAY:ACTION:MOVE.HEAD.NORMAL:0:-90
CALL:G_WAITZERO
SET:tilt:Head_Tilt
SET:pan:Head_Pan
IF_1ST:Distance:<:200:1096
PLAY:ACTION:MOVE.HEAD.NORMAL:pan:tilt
CALL:G_WAITZERO
GO:BH_INITTIMER
ENDIF
:1055
RND:rndnum:0:17
IF_1ST:rndnum:=:last_heldact:1055
IF_1ST:rndnum:=:last_heldact2:1055
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_DANCE_BELLY1
CASE:1:PLAY:ACTION:O2_DANCE_BELLY2
CASE:2:PLAY:ACTION:O2_DANCE_BELLY3
CASE:3:PLAY:ACTION:O2_DANCE_BELLY4
CASE:4:PLAY:ACTION:O2_DANCE_BELLY5
CASE:5:PLAY:ACTION:O2_DANCE_BELLY6
CASE:6:PLAY:ACTION:O2_THINKING_BELLY
CASE:7:PLAY:ACTION:O2_HOWL_BELLY1
CASE:8:PLAY:ACTION:O2_HOWL_BELLY2
CASE:9:PLAY:ACTION:O2_CONFUSED1
CASE:10:PLAY:ACTION:O2_CONFUSED2
CASE:11:PLAY:ACTION:O2_OHWELL
CASE:12:PLAY:ACTION:O2_BOTH_EAR_TWITCH4
CASE:13:PLAY:ACTION:O2_BOTH_EAR_TWITCH5
CASE:14:PLAY:ACTION:O2_WAVE_LEFT_BELLY1
CASE:15:PLAY:ACTION:O2_WAVE_LEFT_BELLY2
CASE:16:PLAY:ACTION:O2_WAVE_RIGHT_BELLY1
CASE:ELSE:PLAY:ACTION:O2_WAVE_RIGHT_BELLY2
SET:last_heldact2:last_heldact
SET:last_heldact:rndnum
CALL:G_WAITZERO
GO:BH_INITTIMER
:1089
CALL:G_SCOLD_REST
RND:bored_count:5:10
CALL:G_CLEAR_SENSORS
GO:1048
:1092
CALL:G_SLEEP_PETTED
RND:bored_count:5:10
CALL:G_CLEAR_SENSORS
GO:1048
:1093
CALL:G_PRAISE_REST
RND:bored_count:5:10
CALL:G_CLEAR_SENSORS
GO:1048
:1096
RET:1
:G_WALK_FINDTABLE
LOCAL:temp:0
CALL:G_NEED2REST
CASE:1:RET:102
SET:pan:0
SET:dd:0
RND:rndnum:0:100
IF:rndnum:<:50:WFT_LOOKRIGHT
:WFT_LOOKLEFT
SET:panadjust:-5
ADD:temp:1
IF:temp:>:2:WFT_LOOKAHEAD
WAIT:1
SET:wft_initwait:Wait
PLAY:ACTION:MOVE.HEAD.SLOW:75:0
CALL:G_WFT_SCAN
CASE:100:GO:WFT_LOOKRIGHT
CASE:1000:GO:WFT_SEE_TABLE
RET:Context
:WFT_LOOKRIGHT
SET:panadjust:5
ADD:temp:1
IF:temp:>:2:WFT_LOOKAHEAD
WAIT:1
SET:wft_initwait:Wait
PLAY:ACTION:MOVE.HEAD.SLOW:-75:0
CALL:G_WFT_SCAN
CASE:100:GO:WFT_LOOKLEFT
CASE:1000:GO:WFT_SEE_TABLE
RET:Context
:WFT_LOOKAHEAD
WAIT:1
SET:wft_initwait:Wait
PLAY:ACTION:MOVE.HEAD.SLOW:0:0
CALL:G_WFT_SCAN
CASE:100:GO:WFT_NO_TABLE
CASE:1000:GO:WFT_SEE_TABLE
RET:Context
:WFT_NO_TABLE
STOP
WAIT
PLAY:ACTION:MOVE_HEAD:0:0
WAIT
RND:rndnum:0:100
IF:rndnum:>:75:THEN
PLAY:ACTION+:antsy
WAIT
ELSE
IF:rndnum:>:50:THEN
PLAY:ACTION:O2_BOTH_EAR_TWITCH2
WAIT
ENDIF
ENDIF
CALL:G_DEC_HAPPY_MOOD
RET:109
:WFT_SEE_TABLE
CALL:G_WFT_MOVECLOSER
IF:Context:!=:1001:THEN
RET:Context
ENDIF
CALL:G_YART_Walking_SeeTable
IF:Context:!=:101:THEN
RET:Context
ENDIF
CALL:G_INC_HAPPY_MOOD
SET:temp:5
:WFT_PICKACT
SUB:temp:1
IF:temp:>:0:THEN
SET:rndbase:1750
SET:rndcount:11
SET:lastact1:-1
SET:lastact2:-1
CALL:F_BEHAVIOR_RNDN
POP:reTempVar0
IF:reTempVar0:<>:0:WFT_FIRE
ENDIF
CALL:G_DEC_HAPPY_MOOD
CALL:G_INC_SAD_MOOD
PLAY:ACTION+:sad_eyes
WAIT
RET:110
:WFT_FIRE
AP_GET:reTempVar0:behavior:23
PUSH:reTempVar0
PUSH:1
EQ
POP:reTempVar1
AP_GET:reTempVar2:behavior:23
PUSH:reTempVar2
PUSH:0
EQ
POP:reTempVar3
PUSH:boygirl
PUSH:0
GE
POP:reTempVar4
LAND:reTempVar3:reTempVar4
LIOR:reTempVar1:reTempVar3
PUSH:rndnum
PUSH:1752
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
AP_GET:reTempVar6:behavior:23
PUSH:reTempVar6
PUSH:2
EQ
POP:reTempVar7
AP_GET:reTempVar8:behavior:23
PUSH:reTempVar8
PUSH:0
EQ
POP:reTempVar9
PUSH:boygirl
PUSH:0
LT
POP:reTempVar10
LAND:reTempVar9:reTempVar10
LIOR:reTempVar7:reTempVar9
PUSH:rndnum
PUSH:1752
GT
POP:reTempVar11
LAND:reTempVar7:reTempVar11
IF:reTempVar1:||:reTempVar7:THEN
GO:WFT_PICKACT
ENDIF
IF:rndnum:==:1750:THEN
SUB:table_pan:45
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION:STAND
WAIT
PLAY:ACTION+:sniff_left
ENDIF
IF:rndnum:==:1751:THEN
ADD:table_pan:45
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION:STAND
WAIT
PLAY:ACTION+:sniff_right
ENDIF
IF:rndnum:==:1752:THEN
SET:reTempVar0:rndnum
MOD:reTempVar0:1
IF:reTempVar0:<>:0:THEN
ADD:table_pan:200
ELSE
SUB:table_pan:200
ENDIF
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION+:piddle_girl
ENDIF
IF:rndnum:==:1753:THEN
SUB:table_pan:120
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION+:piddle_left
ENDIF
IF:rndnum:==:1754:THEN
ADD:table_pan:120
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION+:piddle_right
ENDIF
IF:rndnum:==:1755:THEN
SUB:table_pan:120
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION+:piddle2_left
ENDIF
IF:rndnum:==:1756:THEN
ADD:table_pan:120
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION+:piddle2_right
ENDIF
IF:rndnum:==:1757:THEN
SUB:table_pan:45
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION:STAND
WAIT
PLAY:ACTION+:sniff_left
WAIT
PLAY:ACTION:TURN:-90
WAIT
PLAY:ACTION+:piddle3_left
ENDIF
IF:rndnum:==:1758:THEN
ADD:table_pan:45
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION:STAND
WAIT
PLAY:ACTION+:sniff_right
WAIT
PLAY:ACTION:TURN:90
WAIT
PLAY:ACTION+:piddle3_right
ENDIF
IF:rndnum:==:1759:THEN
SUB:table_pan:120
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION+:piddle4_left
ENDIF
IF:rndnum:==:1760:THEN
ADD:table_pan:120
PLAY:ACTION:TURN:table_pan
WAIT
PLAY:ACTION+:piddle4_right
ENDIF
WAIT
RET:110
:G_WFT_SCAN
SET:lastpan:-1
SET:lastdist:-1
SET:rise_edge_pan:-1
SET:rise_edge_dist:-1
SET:fall_edge_pan:-1
SET:fall_edge_dist:-1
SET:mapmode:0
SET:Clock:0
SET:Distance:0
:reTempLbl27
IF:Wait:>:wft_initwait:THEN
WAIT:1
SET:d:Distance
SET:p:Head_Pan
IF:Clock:>:16:THEN
CALL:G_WALK_ATTENTION_HANDLER
CASE:103:RET:103
CASE:102:RET:102
CASE:107:RET:107
CASE:104:RET:104
CASE:108:RET:105
CASE:105:RET:105
SET:Clock:0
ENDIF
IF:Pink_Ball:>:0:THEN
RET:107
ENDIF
IF:d:>:0:THEN
CALL:G_WALK_UPDATE_BEST_DISTANCE
SET:Distance:0
IF:lastdist:>:0:THEN
SET:reTempVar0:lastdist
SUB:reTempVar0:d
SET:temp:reTempVar0
PUSH:mapmode
PUSH:0
EQ
POP:reTempVar0
PUSH:temp
PUSH:50
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:d
PUSH:400
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:rise_edge_dist:d
SET:reTempVar0:p
ADD:reTempVar0:lastpan
DIV:reTempVar0:2
SET:rise_edge_pan:reTempVar0
SET:mapmode:1
ENDIF
IF:mapmode:==:1:THEN
SET:reTempVar0:p
SUB:reTempVar0:rise_edge_pan
SET:pandelta:reTempVar0
PUSH:pandelta
PUSH:30
LE
POP:reTempVar0
PUSH:pandelta
PUSH:-30
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:temp
PUSH:-50
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:mapmode:2
SET:fall_edge_dist:d
SET:reTempVar0:p
ADD:reTempVar0:lastpan
DIV:reTempVar0:2
SET:fall_edge_pan:reTempVar0
SET:reTempVar0:fall_edge_pan
SET:reTempVar1:pandelta
DIV:reTempVar1:2
SUB:reTempVar0:reTempVar1
ADD:reTempVar0:panadjust
SET:table_pan:reTempVar0
RET:1000
ENDIF
ENDIF
ENDIF
SET:lastdist:d
SET:lastpan:p
ENDIF
WAIT:1
GO:reTempLbl27
ENDIF
RET:100
:G_WFT_MOVECLOSER
STOP
WAIT
PLAY:ACTION:MOVE.HEAD.NORMAL:table_pan:0
WAIT
WAIT:500
SET:dist:Distance
IF:fall_edge_dist:<:d:THEN
SET:dist:fall_edge_dist
ENDIF
IF:rise_edge_dist:<:d:THEN
SET:dist:rise_edge_dist
ENDIF
IF:dist:<:150:THEN
RET:1001
ENDIF
IF:table_pan:>:25:WFT_TURN2TABLE
IF:table_pan:<:-25:WFT_TURN2TABLE
SUB:dist:100
PLAY:ACTION:WALK:0:dist
SET:maxtime1:10
SET:mindist:200
CALL:G_WFT_WALKFWD
CASE:100:RET:1001
RET:Context
:WFT_TURN2TABLE
SET:map_state:0
SET:fall_edge_pan:0
SET:rise_edge_pan:0
SET:fall_edge_dist:0
SET:rise_edge_dist:0
SET:init_lookwait:0
PLAY:ACTION:TURN:table_pan
IF:table_pan:>:40:THEN
PLAY:ACTION:MOVE_HEAD:90:0
GO:WFT_INITMAP_RIGHT
ENDIF
IF:table_pan:>:0:THEN
PLAY:ACTION:MOVE_HEAD:45:0
GO:WFT_INITMAP_RIGHT
ENDIF
IF:table_pan:>:-40:THEN
PLAY:ACTION:MOVE_HEAD:-45:0
GO:WFT_INITMAP_LEFT
ENDIF
PLAY:ACTION:MOVE_HEAD:-90:0
:WFT_INITMAP_LEFT
WAIT
SET:wft_initwait:0
PLAY:ACTION:MOVE.HEAD.SLOW:45:0
CALL:G_WFT_SCAN
CASE:1000:GO:G_WFT_MOVECLOSER
CASE:100:GO:WFT_LOSTTABLE
RET:Context
:WFT_INITMAP_RIGHT
WAIT
SET:wft_initwait:0
PLAY:ACTION:MOVE.HEAD.SLOW:-45:0
CALL:G_WFT_SCAN
CASE:1000:GO:G_WFT_MOVECLOSER
CASE:100:GO:WFT_LOSTTABLE
RET:Context
:WFT_LOSTTABLE
SET:table_pan:0
RET:1001
:G_WFT_WALKFWD
SET:Clock:0
:3593
WAIT:1
IF:Pink_Ball:>:0:THEN
CALL:G_STOP_WALK
RET:107
ENDIF
IF:Wait:>:0:THEN
IF:Distance:>:mindist:THEN
CALL:G_NEED2REST
CASE:1:GO:3597
CALL:G_TIMER1
CASE:1:GO:3593
ENDIF
ENDIF
CALL:G_STOP_WALK
RET:100
:3597
CALL:G_STOP_WALK
RET:102
:G_STOP_WALK
WAIT:1
IF_1ST:Wait:<=:0:3043
PLAY:ACTION:WALK:0:1
WAIT
:3043
RET:1
:G_Select_Game
CALL:G_TWITCH_EARS
PLAY:ACTION:game_intro
CALL:G_WAITZERO
CALL:G_CLEAR_SENSORS
SET:Warn:0
SET:Clock:0
SET:gs_state:0
SET:gs_select:0
SET:gs_update_interval:32
SET:gs_timeout_count:42
SET:LRLeg_ON:0
SET:RRLeg_ON:0
SET:Tail_L_ON:0
SET:Tail_R_ON:0
SET:Tail_D_ON:0
SET:Tail_U_ON:0
CALL:G_SG_SETUPEYES
:SG_LOOP
WAIT:1
PUSH:RRLeg_ON
PUSH:0
GT
POP:reTempVar0
PUSH:LRLeg_ON
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
SET:RRLeg_ON:0
SET:LRLeg_ON:0
SET:gs_state:1
ADD:gs_select:1
IF:gs_select:>:2:THEN
SET:gs_select:0
ENDIF
CALL:G_SG_SETUPEYES
ENDIF
PUSH:Head_ON
PUSH:0
GT
POP:reTempVar0
SET:reTempVar1:Tail_U_ON
LIOR:reTempVar1:Tail_D_ON
LIOR:reTempVar1:Tail_R_ON
LIOR:reTempVar1:Tail_L_ON
IF:reTempVar0:||:reTempVar1:SG_GOTGAME
IF:Clock:>=:gs_update_interval:THEN
SET:Clock:0
IF:gs_state:==:0:THEN
ADD:gs_select:1
IF:gs_select:>:2:THEN
SET:gs_select:0
ENDIF
CALL:G_SG_SETUPEYES
ENDIF
SUB:gs_timeout_count:1
IF:gs_timeout_count:==:0:THEN
IF:gs_state:==:0:THEN
AP_GET:reTempVar0:behavior:30
SET:gs_favgame:reTempVar0
RND:rndnum:0:100
IF:rndnum:<:50:THEN
SET:gs_select:gs_favgame
ELSE
PUSH:gs_favgame
PUSH:2
NE
POP:reTempVar0
ADD:reTempVar0:1
SET:gs_select:reTempVar0
PUSH:rndnum
PUSH:75
LT
POP:reTempVar0
PUSH:gs_favgame
PUSH:0
NE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:gs_select:0
ENDIF
ENDIF
CALL:G_SG_SETUPEYES
ENDIF
PLAY:ACTION:game_timeout
CALL:G_WAITZERO
GO:SG_GOTGAME
ENDIF
PUSH:gs_timeout_count
PUSH:32
LE
POP:reTempVar0
PUSH:Wait
PUSH:0
EQ
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
PLAY:ACTION:game_beep
ENDIF
SWITCH:gs_timeout_count
CASE:28:SET:gs_update_interval:16
CASE:24:SET:gs_update_interval:8
CASE:16:SET:gs_update_interval:4
ENDIF
GO:SG_LOOP
:SG_GOTGAME
SET:reTempVar0:Tail_U_ON
LIOR:reTempVar0:Tail_D_ON
LIOR:reTempVar0:Tail_R_ON
LIOR:reTempVar0:Tail_L_ON
PUSH:reTempVar0
CALL:F_NEED2REST
POP:reTempVar1
POP:reTempVar0
IF:reTempVar0:||:reTempVar1:THEN
SET:gs_select:-1
ENDIF
SET:Tail_L_ON:0
SET:Tail_R_ON:0
SET:Tail_D_ON:0
SET:Tail_U_ON:0
SET:Horn_B:0
SET:Horn_G:0
SET:Horn_O:0
WAIT:500
CALL:G_WAITZERO
IF:gs_select:==:0:G_RPS_Game
IF:gs_select:==:1:G_TicTacToe_Game
IF:gs_select:==:2:G_Touch4_Game
PLAY:ACTION:game_quit
GO:G_WAITZERO
:G_SG_SETUPEYES
PUSH:gs_select
PUSH:0
EQ
POP:reTempVar0
SET:Horn_O:reTempVar0
PUSH:gs_select
PUSH:1
EQ
POP:reTempVar0
SET:Horn_G:reTempVar0
PUSH:gs_select
PUSH:2
EQ
POP:reTempVar0
SET:Horn_B:reTempVar0
WAIT:1
RET:1
:G_RPS_Game
PLAY:ACTION+:rps_intro2
CALL:G_WAITZERO
CALL:G_CLEAR_SENSORS
SET:win_count:0
SET:tie_count:0
SET:lose_count:0
RND:limit:3:6
WAIT:500
SET:Tail_L_ON:0
SET:Tail_R_ON:0
SET:Tail_D_ON:0
SET:Tail_U_ON:0
:RPS_NEWROUND
SET:Head_Hit:0
SET:Head_ON:0
SET:Jaw_ON:0
PLAY:ACTION+:rps_countdown
CALL:G_WAITZERO
RND:last_rps:0:2
SWITCH:last_rps
CASE:0:PLAY:ACTION+:rps_rock
CASE:1:PLAY:ACTION+:rps_paper
CASE:2:PLAY:ACTION+:rps_scissors
SET:Head_Hit:0
SET:Head_ON:0
SET:Jaw_ON:0
CALL:G_WAITZERO
RND:timeout:20:40
:RPS_LOOP
CALL:G_UPDATE_PAUSEBAR
WAIT:100
SET:reTempVar0:Tail_U_ON
LIOR:reTempVar0:Tail_D_ON
LIOR:reTempVar0:Tail_R_ON
LIOR:reTempVar0:Tail_L_ON
PUSH:reTempVar0
CALL:F_NEED2REST
POP:reTempVar1
POP:reTempVar0
IF:reTempVar0:||:reTempVar1:G_RPS_ENDGAME
IF:Head_Hit:>:0:RPS_TIE
IF:Head_ON:>:0:RPS_WIN
IF:timeout:<:0:RPS_LOSE
IF:Pink_Ball:>:0:THEN
SWITCH:last_rps
CASE:0:GO:RPS_TIE
CASE:1:GO:RPS_WIN
CASE:2:GO:RPS_LOSE
ENDIF
CALL:F_FAVCOLOR
POP:reTempVar0
IF:reTempVar0:>:0:THEN
SWITCH:last_rps
CASE:0:GO:RPS_LOSE
CASE:1:GO:RPS_TIE
CASE:2:GO:RPS_WIN
ENDIF
CALL:F_UNFAVCOLOR
POP:reTempVar0
IF:reTempVar0:>:0:THEN
SWITCH:last_rps
CASE:0:GO:RPS_WIN
CASE:1:GO:RPS_LOSE
CASE:2:GO:RPS_TIE
ENDIF
SUB:timeout:1
SET:Head_Hit:0
SET:Head_ON:0
SET:Jaw_ON:0
CALL:G_RPS_ATTENTION
CASE:117:GO:G_RPS_ENDGAME
CASE:112:CALL:G_PRAISE
CASE:113:CALL:G_SCOLD
CASE:114:GO:RPS_VOICE
GO:RPS_LOOP
:RPS_VOICE
SWITCH:VoiceCmd
CASE:24:GO:G_RPS_ENDGAME
CASE:38:GO:RPS_DOVOICE
CASE:16:GO:RPS_DOVOICE
CASE:0x429:GO:RPS_DOVOICE
CASE:0x42A:GO:RPS_DOVOICE
CASE:0x42C:GO:RPS_DOVOICE
CASE:0x42B:GO:RPS_DOVOICE
CASE:0x42D:GO:RPS_DOVOICE
CASE:36:GO:RPS_DOVOICE
CASE:13:GO:RPS_DOVOICE
CASE:33:GO:RPS_DOVOICE
CASE:0x408:GO:RPS_DOVOICE
CASE:0x42F:GO:RPS_WIN
CASE:0x430:GO:RPS_LOSE
CALL:G_WAITZERO
GO:RPS_LOOP
:RPS_DOVOICE
SET:reTempVar0:VoiceCmd
SUB:reTempVar0:base_voice_cmd
SET:AP_Voice_Cmd:reTempVar0
SET:AP_Voice_Level:2
GO:G_RPS_ENDGAME
:RPS_LOSE
CALL:G_RPS_LOST_GAME
SET:temp:lose_count
GO:RPS_CHECKLIMIT
:RPS_WIN
CALL:G_RPS_WON_GAME
SET:temp:win_count
IF:win_count:>:2:THEN
AP_SET:0:behavior:30
ENDIF
GO:RPS_CHECKLIMIT
:RPS_TIE
CALL:G_RPS_TIE_GAME
SET:temp:tie_count
:RPS_CHECKLIMIT
IF:temp:<:limit:RPS_NEWROUND
IF:tie_count:>=:limit:G_RPS_TIE_ENDGAME
IF:win_count:>:lose_count:G_RPS_WON_ENDGAME
GO:G_RPS_LOST_ENDGAME
:G_RPS_LOST_GAME
ADD:lose_count:1
CALL:G_DEC_HAPPY_MOOD
CALL:G_INC_MAD_MOOD
CALL:G_RANDOM3
CASE:1:PLAY:ACTION+:rps_lose1
CASE:2:PLAY:ACTION+:rps_lose2
CASE:3:PLAY:ACTION+:rps_lose3
GO:G_WAITZERO
:G_RPS_WON_GAME
ADD:win_count:1
CALL:G_INC_HAPPY_MOOD
CALL:G_DEC_MAD_MOOD
CALL:G_RANDOM3
CASE:1:PLAY:ACTION+:rps_win1
CASE:2:PLAY:ACTION+:rps_win2
CASE:3:PLAY:ACTION+:rps_win3
GO:G_WAITZERO
:G_RPS_TIE_GAME
ADD:tie_count:1
CALL:G_DEC_HAPPY_MOOD
CALL:G_RANDOM3
CASE:1:PLAY:ACTION+:rps_tie1
CASE:2:PLAY:ACTION+:rps_tie2
CASE:3:PLAY:ACTION+:rps_tie3
GO:G_WAITZERO
:G_RPS_ENDGAME
PLAY:ACTION+:rps_close
GO:G_WAITZERO
:G_RPS_LOST_ENDGAME
CALL:G_RPS_ENDGAME
RND:rndnum:0:2
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_NOT_ME
CASE:1:PLAY:ACTION:O2_DONTWANNA1
CASE:2:PLAY:ACTION:O2_NOTHANKS
GO:G_WAITZERO
:G_RPS_WON_ENDGAME
CALL:G_RPS_ENDGAME
RND:rndnum:0:2
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_POUNCE1
CASE:1:PLAY:ACTION:O2_CUTE_BANZAI1
CASE:2:PLAY:ACTION:O2_SALUTE2
GO:G_WAITZERO
:G_RPS_TIE_ENDGAME
CALL:G_RPS_ENDGAME
RND:rndnum:0:2
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_BORED_SIT2
CASE:1:PLAY:ACTION:O2_IMPATIENT_SIT1
CASE:2:PLAY:ACTION:O2_IMPATIENT_SIT2
CALL:G_WAITZERO
PLAY:ACTION:SIT
GO:G_WAITZERO
:G_RPS_ATTENTION
SET:pet:0
SET:praise:0
SET:scold:0
WAIT:1
SET:reTempVar0:Tail_U_ON
LIOR:reTempVar0:Tail_D_ON
LIOR:reTempVar0:Tail_R_ON
LIOR:reTempVar0:Tail_L_ON
PUSH:reTempVar0
CALL:F_NEED2REST
POP:reTempVar1
POP:reTempVar0
IF:reTempVar0:||:reTempVar1:THEN
ADD:pet:2
ADD:back_count:1
RET:117
ENDIF
IF:AP_Voice_Cmd:!=:0:THEN
CALL:G_VOICECMD
CASE:114:GO:RPSA_VOICECMD
ENDIF
IF:AP_Tone:>:0:THEN
CALL:G_TONECMD
CASE:1:GO:RPSA_VOICECMD
ENDIF
RET:100
:RPSA_VOICECMD
SET:back_count:0
WAIT:1
IF:VoiceCmd:==:9:THEN
IF:VoiceDictID:>=:149:THEN
IF:VoiceDictID:<=:150:THEN
CALL:G_INC_BOYGIRL
RET:112
ENDIF
ENDIF
IF:VoiceDictID:>=:151:THEN
IF:VoiceDictID:<=:154:THEN
CALL:G_DEC_BOYGIRL
RET:112
ENDIF
ENDIF
ENDIF
IF:VoiceCmd:==:47:THEN
IF:VoiceDictID:>=:160:THEN
IF:VoiceDictID:<=:161:THEN
CALL:G_INC_BOYGIRL
RET:113
ENDIF
ENDIF
IF:VoiceDictID:>=:162:THEN
IF:VoiceDictID:<=:165:THEN
CALL:G_DEC_BOYGIRL
RET:113
ENDIF
ENDIF
ENDIF
IF:VoiceCmd:==:1085:THEN
CALL:G_INC_BOYGIRL
RET:112
ENDIF
IF:VoiceCmd:==:1086:THEN
CALL:G_DEC_BOYGIRL
RET:112
ENDIF
IF:VoiceCmd:==:1087:THEN
CALL:G_INC_BOYGIRL
RET:113
ENDIF
IF:VoiceCmd:==:1088:THEN
CALL:G_DEC_BOYGIRL
RET:113
ENDIF
IF:VoiceCmd:==:15:THEN
SET:maxtime8:60
RET:112
ENDIF
IF:VoiceCmd:==:28:THEN
RET:113
ENDIF
IF:VoiceCmd:==:22:THEN
IF:Posture1:!=:4:THEN
CALL:G_TAKE_A_PICTURE
ENDIF
RET:100
ENDIF
RET:114
:G_TicTacToe_Game
PUSH:0
CALL:F_TTT_Adjust_Skill:1
POP:reTempVar0
SET:ttt_distvalid:0
SET:ttt:trackarray
SET:ttt_pan1:-999
SET:ttt_tilt1:-999
SET:ttt_pan2:-999
SET:ttt_tilt2:-999
SET:last_pan:-999
SET:last_tilt:-999
SET:game_count:0
SET:win_count:0
SET:lose_count:0
SET:tie_count:0
RND:limit:3:6
SET:Tail_L_ON:0
SET:Tail_R_ON:0
SET:Tail_D_ON:0
SET:Tail_U_ON:0
PLAY:ACTION:ttt_intro2
CALL:G_WAITZERO
:reTempLbl28
IF:Head_ON:>:0:THEN
SET:Head_ON:0
WAIT:200
GO:reTempLbl28
ENDIF
CALL:F_TTT_Calibrate
LNOT
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
RET:1
ENDIF
CALL:F_RND2
POP:reTempVar0
SET:aibo_first:reTempVar0
:TTT_NEWROUND
SET:ttt_turn:0
FOR:temp:0:9
AP_SET:0:ttt:temp
NEXT
IF:aibo_first:<>:0:THEN
SET:aibo_first:0
PLAY:ACTION:ttt_me_first
CALL:G_WAITZERO
GO:TTT_AIBOMOVE
ELSE
SET:aibo_first:1
PLAY:ACTION:ttt_you_first
CALL:G_WAITZERO
ENDIF
SET:reTempVar0:Tail_U_ON
LIOR:reTempVar0:Tail_D_ON
LIOR:reTempVar0:Tail_R_ON
LIOR:reTempVar0:Tail_L_ON
PUSH:reTempVar0
CALL:F_NEED2REST
POP:reTempVar1
POP:reTempVar0
IF:reTempVar0:||:reTempVar1:G_RPS_ENDGAME
:TTT_USERMOVE
CALL:F_TTT_User_Move
POP:reTempVar0
SWITCH:reTempVar0
CASE:117:GO:G_RPS_ENDGAME
CASE:2000:GO:TTT_WONGAME
ADD:ttt_turn:1
CALL:F_TTT_EvalGame
POP:reTempVar0
SET:temp:reTempVar0
IF:reTempVar0:<>:0:THEN
IF:temp:>=:limit:THEN
IF:tie_count:>=:limit:G_RPS_TIE_ENDGAME
IF:win_count:>:lose_count:G_RPS_WON_ENDGAME
GO:G_RPS_LOST_ENDGAME
ENDIF
SET:reTempVar0:limit
MUL:reTempVar0:2
IF:game_count:>:reTempVar0:THEN
IF:win_count:>:lose_count:G_RPS_WON_ENDGAME
IF:tie_count:>:lose_count:G_RPS_TIE_ENDGAME
GO:G_RPS_LOST_ENDGAME
ENDIF
GO:TTT_NEWROUND
ENDIF
:TTT_AIBOMOVE
CALL:G_TTT_Aibo_Move
ADD:ttt_turn:1
CALL:F_TTT_EvalGame
POP:reTempVar0
SET:temp:reTempVar0
IF:reTempVar0:<>:0:THEN
IF:temp:>=:limit:THEN
IF:tie_count:>=:limit:G_RPS_TIE_ENDGAME
IF:win_count:>:lose_count:G_RPS_WON_ENDGAME
GO:G_RPS_LOST_ENDGAME
ENDIF
SET:reTempVar0:limit
MUL:reTempVar0:2
IF:game_count:>:reTempVar0:THEN
IF:win_count:>:lose_count:G_RPS_WON_ENDGAME
IF:tie_count:>:lose_count:G_RPS_TIE_ENDGAME
GO:G_RPS_LOST_ENDGAME
ENDIF
GO:TTT_NEWROUND
ENDIF
GO:TTT_USERMOVE
:TTT_WONGAME
PUSH:1
CALL:F_TTT_Adjust_Skill:1
POP:reTempVar0
CALL:G_RPS_WON_GAME
IF:win_count:>=:limit:THEN
IF:tie_count:>=:limit:G_RPS_TIE_ENDGAME
IF:win_count:>:lose_count:G_RPS_WON_ENDGAME
GO:G_RPS_LOST_ENDGAME
ENDIF
GO:TTT_NEWROUND
:F_TTT_EvalGame
LOCAL:winpos:-1
PUSH:10
CALL:F_TTT_Win:1
POP:reTempVar0
SET:winpos:reTempVar0
IF:reTempVar0:<>:0:THEN
ADD:game_count:1
PUSH:1
CALL:F_TTT_Adjust_Skill:1
POP:reTempVar0
CALL:G_RPS_WON_GAME
IF:win_count:>:2:THEN
AP_SET:1:behavior:30
ENDIF
RETURN:win_count
ENDIF
PUSH:1
CALL:F_TTT_Win:1
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
ADD:game_count:1
PUSH:10
CALL:F_TTT_Adjust_Skill:1
POP:reTempVar0
CALL:G_RPS_LOST_GAME
RETURN:lose_count
ENDIF
IF:ttt_turn:>:8:THEN
ADD:game_count:1
PUSH:5
CALL:F_TTT_Adjust_Skill:1
POP:reTempVar0
CALL:G_RPS_TIE_GAME
RETURN:tie_count
ENDIF
RETURN:0
:F_TTT_Adjust_Skill
ARG:delta
AP_GET:reTempVar0:behavior:50
SET:skillttt:reTempVar0
PUSH:skillttt
PUSH:20
LT
POP:reTempVar0
PUSH:skillttt
PUSH:95
GT
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
SET:temp:60
ENDIF
SET:reTempVar0:skillttt
ADD:reTempVar0:delta
SET:skillttt:reTempVar0
IF:skillttt:<:20:THEN
SET:skillttt:20
ENDIF
IF:skillttt:>:95:THEN
SET:skillttt:95
ENDIF
AP_SET:skillttt:behavior:50
RETURN:0
:F_TTT_Calibrate
LOCAL:cstate:0
LOCAL:temp
SET:Warn:0
SET:Head_ON:0
SET:Clock:0
SET:timeout:120
SET:timetick:60
SET:tickcount:0
PLAY:ACTION:MOVE.HEAD.NORMAL:0:-70
WAIT
:reTempLbl29
IF:1:<>:0:THEN
WAIT:100
SET:reTempVar0:Tail_U_ON
LIOR:reTempVar0:Tail_D_ON
LIOR:reTempVar0:Tail_R_ON
LIOR:reTempVar0:Tail_L_ON
PUSH:reTempVar0
CALL:F_NEED2REST
POP:reTempVar1
POP:reTempVar0
IF:reTempVar0:||:reTempVar1:THEN
SET:Tail_L_ON:0
SET:Tail_R_ON:0
SET:Tail_D_ON:0
SET:Tail_U_ON:0
SET:Warn:0
CALL:G_WAITZERO
CALL:G_RPS_ENDGAME
RETURN:0
ENDIF
IF:Clock:>:7:THEN
SET:Clock:0
ADD:tickcount:1
CALL:F_TTT_User_Timeout
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
SET:Warn:0
CALL:G_WAITZERO
CALL:G_RPS_LOST_ENDGAME
RETURN:0
ENDIF
ENDIF
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar0
PUSH:Wait
PUSH:0
EQ
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
PLAY:ACTION:TRACK_HEAD:PINK_BALL
ENDIF
CALL:G_TTT_GetBallPos
POP:reTempVar0
IF:cstate:==:0:THEN
IF:tickcount:>:1:THEN
SET:reTempVar0:Warn
LNOT:reTempVar0:reTempVar0
SET:Warn:reTempVar0
SET:Horn_G:Pink_Ball
SET:tickcount:0
ENDIF
ELSE
IF:tickcount:>:0:THEN
SET:reTempVar0:Warn
LNOT:reTempVar0:reTempVar0
SET:Warn:reTempVar0
PUSH:pan
PUSH:ttt_pan1
SUB
CALL:F_ABS:1
PUSH:20
GT
POP:reTempVar0
PUSH:reTempVar0
PUSH:tilt
PUSH:ttt_tilt1
SUB
CALL:F_ABS:1
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar1
PUSH:20
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:ttt_pan1
PUSH:0
GT
POP:reTempVar3
PUSH:pan
PUSH:0
LT
POP:reTempVar4
LAND:reTempVar3:reTempVar4
LAND:reTempVar0:reTempVar3
PUSH:ttt_pan1
PUSH:0
LT
POP:reTempVar5
PUSH:pan
PUSH:0
GT
POP:reTempVar6
LAND:reTempVar5:reTempVar6
LIOR:reTempVar0:reTempVar5
SET:Horn_G:reTempVar0
SET:tickcount:0
ENDIF
ENDIF
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar0
PUSH:Wait
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:reTempVar0:Head_Pan
ADD:reTempVar0:Pink_Ball_H
SET:last_pan:reTempVar0
SET:reTempVar0:Head_Tilt_2
MUL:reTempVar0:2
ADD:reTempVar0:Pink_Ball_V
SET:last_tilt:reTempVar0
ENDIF
IF:cstate:>:10:THEN
PUSH:Head_ON
PUSH:0
GT
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Wait
PUSH:0
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:ttt_distvalid
PUSH:1
GT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
PLAY:ACTION:ttt_calib
WAIT:500
SET:ttt_pan2:pan
SET:ttt_tilt2:tilt
SET:Warn:0
SET:Horn_G:0
PLAY:ACTION:MOVE.HEAD.NORMAL:ttt_pan2:ttt_tilt2
CALL:G_WAITZERO
IF:ttt_pan2:<:ttt_pan1:THEN
SET:temp:ttt_pan2
SET:ttt_pan2:ttt_pan1
SET:ttt_pan1:temp
ENDIF
IF:ttt_tilt2:<:ttt_tilt1:THEN
SET:temp:ttt_tilt2
SET:ttt_tilt2:ttt_tilt1
SET:ttt_tilt1:temp
ENDIF
PUSH:ttt_pan2
PUSH:ttt_pan1
SUB
PUSH:20
GT
POP:reTempVar0
PUSH:ttt_tilt2
PUSH:ttt_tilt1
SUB
PUSH:20
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
PUSH:ttt_pan1
CALL:F_ABS:1
POP:reTempVar0
DIV:reTempVar0:6
SET:temp:reTempVar0
SET:reTempVar0:ttt_pan1
ADD:reTempVar0:temp
SET:ttt_pan1:reTempVar0
SET:reTempVar0:ttt_pan2
SUB:reTempVar0:temp
SET:ttt_pan2:reTempVar0
SET:reTempVar0:ttt_tilt1
PUSH:reTempVar0
PUSH:ttt_tilt1
CALL:F_ABS:1
POP:reTempVar1
POP:reTempVar0
DIV:reTempVar1:10
ADD:reTempVar0:reTempVar1
SET:ttt_tilt1:reTempVar0
SET:reTempVar0:ttt_tilt2
PUSH:reTempVar0
PUSH:ttt_tilt2
CALL:F_ABS:1
POP:reTempVar1
POP:reTempVar0
DIV:reTempVar1:15
SUB:reTempVar0:reTempVar1
SET:ttt_tilt2:reTempVar0
RETURN:1
ENDIF
RETURN:0
ENDIF
ENDIF
IF:cstate:==:10:THEN
SET:Head_ON:0
SET:cstate:11
ENDIF
PUSH:cstate
PUSH:0
GT
POP:reTempVar0
PUSH:cstate
PUSH:10
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
ADD:cstate:1
ENDIF
IF:cstate:==:0:THEN
PUSH:Head_ON
PUSH:0
GT
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Wait
PUSH:0
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:ttt_distvalid
PUSH:1
GT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
PLAY:ACTION:ttt_calib
WAIT:500
SET:cstate:1
SET:ttt_pan1:pan
SET:ttt_tilt1:tilt
SET:timeout:120
SET:timetick:60
ENDIF
ENDIF
GO:reTempLbl29
ENDIF
RETURN:0
:F_TTT_User_Move
LOCAL:usermove:-1
LOCAL:result:100
SET:timeout:120
SET:timetick:60
SET:last_usermove:-999
SET:Head_ON:0
SET:Jaw_ON:0
IF:last_pan:>:-999:THEN
PLAY:ACTION:MOVE.HEAD.NORMAL:last_pan:last_tilt
CALL:G_WAITZERO
WAIT:100
IF:Pink_Ball:==:0:THEN
SET:reTempVar0:ttt_tilt1
ADD:reTempVar0:ttt_tilt2
DIV:reTempVar0:2
PLAY:ACTION:MOVE.HEAD.NORMAL:0:reTempVar0
CALL:G_WAITZERO
ENDIF
ENDIF
AP_SET:-999:ttt:20
AP_SET:-999:ttt:21
AP_SET:-999:ttt:22
AP_SET:-999:ttt:23
SET:Clock:0
:TTT_USERLOOP
IF:Clock:>:8:THEN
SET:Clock:0
CALL:F_TTT_User_Timeout
POP:reTempVar0
IF:reTempVar0:<>:0:TTT_ENDGAME
ENDIF
WAIT:100
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar0
PUSH:Wait
PUSH:0
EQ
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
PLAY:ACTION:TRACK_HEAD:PINK_BALL
ENDIF
IF:Pink_Ball:==:0:THEN
IF:usermove:>=:0:THEN
SET:Horn_O:0
ENDIF
SET:usermove:-1
ELSE
CALL:F_TTT_Compute_Square
POP:reTempVar0
SET:usermove:reTempVar0
IF:usermove:>=:0:THEN
AP_GET:reTempVar0:ttt:21
AP_SET:reTempVar0:ttt:20
AP_GET:reTempVar0:ttt:22
AP_SET:reTempVar0:ttt:21
AP_SET:usermove:ttt:22
ENDIF
PUSH:usermove
PUSH:0
GE
POP:reTempVar0
PUSH:usermove
PUSH:last_usermove
NE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:last_usermove:usermove
AP_GET:reTempVar0:ttt:usermove
PUSH:reTempVar0
PUSH:0
NE
POP:reTempVar1
SET:Horn_O:reTempVar1
ENDIF
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar0
PUSH:Wait
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:reTempVar0:Head_Pan
ADD:reTempVar0:Pink_Ball_H
SET:last_pan:reTempVar0
SET:reTempVar0:Head_Tilt_2
MUL:reTempVar0:2
ADD:reTempVar0:Pink_Ball_V
SET:last_tilt:reTempVar0
ENDIF
ENDIF
CALL:G_RPS_ATTENTION
CASE:114:GO:TTT_VOICE
CASE:117:GO:TTT_ENDGAME
CASE:112:CALL:G_PRAISE
CASE:113:CALL:G_SCOLD
SET:reTempVar0:Tail_U_ON
LIOR:reTempVar0:Tail_D_ON
LIOR:reTempVar0:Tail_R_ON
LIOR:reTempVar0:Tail_L_ON
PUSH:reTempVar0
CALL:F_NEED2REST
POP:reTempVar1
POP:reTempVar0
IF:reTempVar0:||:reTempVar1:TTT_ENDGAME
IF:Jaw_ON:>:0:THEN
CALL:G_PRAISE
WAIT:500
SET:Jaw_ON:0
ENDIF
AP_GET:reTempVar0:ttt:20
PUSH:reTempVar0
AP_GET:reTempVar1:ttt:21
PUSH:reTempVar1
NE
POP:reTempVar2
AP_GET:reTempVar3:ttt:21
PUSH:reTempVar3
AP_GET:reTempVar4:ttt:22
PUSH:reTempVar4
NE
POP:reTempVar5
LIOR:reTempVar2:reTempVar5
PUSH:ttt_distvalid
PUSH:6
LT
POP:reTempVar6
LIOR:reTempVar2:reTempVar6
PUSH:Pink_Ball
PUSH:0
EQ
POP:reTempVar7
LIOR:reTempVar2:reTempVar7
IF:reTempVar2:<>:0:THEN
SET:Head_ON:0
SET:usermove:-1
ELSE
IF:usermove:>=:0:THEN
AP_GET:reTempVar0:ttt:usermove
IF:reTempVar0:!=:0:THEN
SET:usermove:-1
ENDIF
ENDIF
PUSH:Head_ON
PUSH:0
GT
POP:reTempVar0
PUSH:usermove
PUSH:0
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:init_wait:Wait
PLAY:ACTION:rps_huh
CALL:G_WAIT
ENDIF
ENDIF
PUSH:Head_ON
PUSH:0
GT
POP:reTempVar0
PUSH:usermove
PUSH:0
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
IF:reTempVar0:==:0:TTT_USERLOOP
AP_SET:1:ttt:usermove
SET:init_wait:Wait
PLAY:ACTION:ttt_calib
CALL:G_WAIT
SET:result:100
:TTT_USERDONE
SET:Horn_O:0
SET:reTempVar0:Head_Tilt_2
MUL:reTempVar0:2
PLAY:ACTION:MOVE.HEAD.NORMAL:Head_Pan:reTempVar0
CALL:G_WAITZERO
RETURN:result
:TTT_VOICE
SWITCH:VoiceCmd
CASE:24:GO:TTT_ENDGAME
CASE:38:GO:TTT_DOVOICE
CASE:16:GO:TTT_DOVOICE
CASE:0x429:GO:TTT_DOVOICE
CASE:0x42A:GO:TTT_DOVOICE
CASE:0x42C:GO:TTT_DOVOICE
CASE:0x42B:GO:TTT_DOVOICE
CASE:0x42D:GO:TTT_DOVOICE
CASE:36:GO:TTT_DOVOICE
CASE:13:GO:TTT_DOVOICE
CASE:33:GO:TTT_DOVOICE
CASE:0x408:GO:TTT_DOVOICE
CASE:0x42F:GO:TTT_USER_RESIGNED
CASE:0x430:GO:TTT_SAYWHAT
GO:TTT_USERLOOP
:TTT_DOVOICE
SET:reTempVar0:VoiceCmd
SUB:reTempVar0:base_voice_cmd
SET:AP_Voice_Cmd:reTempVar0
SET:AP_Voice_Level:2
SET:result:117
GO:TTT_USERDONE
:TTT_ENDGAME
SET:result:117
GO:TTT_USERDONE
:TTT_USER_RESIGNED
SET:result:2000
GO:TTT_USERDONE
:TTT_SAYWHAT
PLAY:ACTION:rps_huh
CALL:G_WAITZERO
GO:TTT_USERLOOP
:F_TTT_User_Timeout
IF:timeout:>:0:THEN
SUB:timeout:1
IF:timeout:==:timetick:THEN
IF:timeout:>:28:THEN
SET:reTempVar0:timetick
SUB:reTempVar0:8
SET:timetick:reTempVar0
ELSE
IF:timeout:>:12:THEN
SET:reTempVar0:timetick
SUB:reTempVar0:4
SET:timetick:reTempVar0
ELSE
IF:timeout:>:4:THEN
SET:reTempVar0:timetick
SUB:reTempVar0:2
SET:timetick:reTempVar0
ELSE
SET:reTempVar0:timetick
SUB:reTempVar0:1
SET:timetick:reTempVar0
ENDIF
ENDIF
ENDIF
IF:timetick:>:0:THEN
PLAY:ACTION:ttt_timetick
ELSE
PLAY:ACTION:ttt_timeout
ENDIF
ENDIF
ENDIF
PUSH:timeout
PUSH:1
LT
POP:reTempVar0
RETURN:reTempVar0
:G_TTT_GetBallPos
LOCAL:average_dist:0
IF:Pink_Ball:==:0:THEN
SET:ttt_distvalid:0
RET:1
ENDIF
ADD:ttt_distvalid:1
IF:ttt_distvalid:>:6:THEN
SET:ttt_distvalid:6
ENDIF
FOR:i:1:3
SET:reTempVar0:average_dist
AP_GET:reTempVar1:ttt:11:i
AP_SET:reTempVar1:ttt:10:i
ADD:reTempVar0:reTempVar1
SET:average_dist:reTempVar0
NEXT
WAIT:64
SET:reTempVar0:average_dist
AP_SET:Pink_Ball_D:ttt:10:4
ADD:reTempVar0:Pink_Ball_D
DIV:reTempVar0:200
SET:dist:reTempVar0
SET:reTempVar0:Head_Tilt_2
MUL:reTempVar0:2
ADD:reTempVar0:Pink_Ball_V
ADD:reTempVar0:dist
SET:tilt:reTempVar0
SET:reTempVar0:Head_Pan
ADD:reTempVar0:Pink_Ball_H
SET:pan:reTempVar0
RET:1
:F_TTT_Compute_Square
LOCAL:rowbase:0
LOCAL:panlimit:0
IF:Pink_Ball:==:0:THEN
SET:ttt_distvalid:0
RETURN:-1
ENDIF
CALL:G_TTT_GetBallPos
SET:rowbase:3
IF:tilt:<:ttt_tilt1:THEN
SET:rowbase:6
ELSE
IF:tilt:>:ttt_tilt2:THEN
SET:rowbase:0
ENDIF
ENDIF
PUSH:ttt_pan1
CALL:F_ABS:1
POP:reTempVar0
SET:panlimit:reTempVar0
PUSH:ttt_pan2
CALL:F_ABS:1
POP:reTempVar0
IF:reTempVar0:<:panlimit:THEN
PUSH:ttt_pan2
CALL:F_ABS:1
POP:reTempVar0
SET:panlimit:reTempVar0
ENDIF
SET:reTempVar0:panlimit
DIV:reTempVar0:2
SET:panlimit:reTempVar0
IF:pan:>:panlimit:THEN
RETURN:rowbase
ENDIF
SET:reTempVar0:panlimit
MUL:reTempVar0:-1
IF:pan:<:reTempVar0:THEN
SET:reTempVar0:rowbase
ADD:reTempVar0:2
RETURN:reTempVar0
ENDIF
SET:reTempVar0:rowbase
ADD:reTempVar0:1
RETURN:reTempVar0
:G_TTT_Thinking
PUSH:Clock
PUSH:63
GT
POP:reTempVar0
PUSH:Wait
PUSH:0
EQ
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:Clock:0
PLAY:ACTION:ttt_thinking
ENDIF
RET:1
:G_TTT_Aibo_Move
LOCAL:aibo_move
CALL:F_TTT_PickMove
POP:reTempVar0
SET:aibo_move:reTempVar0
CALL:G_WAITZERO
IF:aibo_move:>=:0:THEN
AP_SET:10:ttt:aibo_move
ENDIF
SWITCH:aibo_move
CASE:0:PLAY:ACTION:ttt_pick_upperleft
CASE:1:PLAY:ACTION:ttt_pick_uppercenter
CASE:2:PLAY:ACTION:ttt_pick_upperright
CASE:3:PLAY:ACTION:ttt_pick_centerleft
CASE:4:PLAY:ACTION:ttt_pick_centersquare
CASE:5:PLAY:ACTION:ttt_pick_centerright
CASE:6:PLAY:ACTION:ttt_pick_lowerleft
CASE:7:PLAY:ACTION:ttt_pick_lowercenter
CASE:8:PLAY:ACTION:ttt_pick_lowerright
GO:G_WAITZERO
:F_TTT_PickMove
LOCAL:i
LOCAL:j
LOCAL:k
LOCAL:near_win
LOCAL:possible_win
IF:ttt_turn:>:8:THEN
RETURN:-1
ENDIF
CALL:F_RND2
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
FOR:i:0:2
PUSH:i
PUSH:10
CALL:F_TTT_CheckHorz:2
POP:reTempVar0
SET:j:reTempVar0
IF:reTempVar0:>=:0:THEN
RETURN:j
ENDIF
PUSH:i
PUSH:10
CALL:F_TTT_CheckVert:2
POP:reTempVar0
SET:j:reTempVar0
IF:reTempVar0:>=:0:THEN
RETURN:j
ENDIF
NEXT
ELSE
FOR:i:0:2
PUSH:2
PUSH:i
SUB
PUSH:10
CALL:F_TTT_CheckHorz:2
POP:reTempVar0
SET:j:reTempVar0
IF:reTempVar0:>=:0:THEN
RETURN:j
ENDIF
PUSH:2
PUSH:i
SUB
PUSH:10
CALL:F_TTT_CheckVert:2
POP:reTempVar0
SET:j:reTempVar0
IF:reTempVar0:>=:0:THEN
RETURN:j
ENDIF
NEXT
ENDIF
PUSH:10
CALL:F_TTT_CheckDiagonal:1
POP:reTempVar0
SET:j:reTempVar0
IF:reTempVar0:>=:0:THEN
RETURN:j
ENDIF
CALL:F_RND2
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
FOR:i:0:2
PUSH:i
PUSH:1
CALL:F_TTT_CheckHorz:2
POP:reTempVar0
SET:j:reTempVar0
IF:reTempVar0:>=:0:THEN
RETURN:j
ENDIF
PUSH:i
PUSH:1
CALL:F_TTT_CheckVert:2
POP:reTempVar0
SET:j:reTempVar0
IF:reTempVar0:>=:0:THEN
RETURN:j
ENDIF
NEXT
ELSE
FOR:i:0:2
PUSH:2
PUSH:i
SUB
PUSH:1
CALL:F_TTT_CheckHorz:2
POP:reTempVar0
SET:j:reTempVar0
IF:reTempVar0:>=:0:THEN
RETURN:j
ENDIF
PUSH:2
PUSH:i
SUB
PUSH:1
CALL:F_TTT_CheckVert:2
POP:reTempVar0
SET:j:reTempVar0
IF:reTempVar0:>=:0:THEN
RETURN:j
ENDIF
NEXT
ENDIF
PUSH:1
CALL:F_TTT_CheckDiagonal:1
POP:reTempVar0
SET:j:reTempVar0
IF:reTempVar0:>=:0:THEN
RETURN:j
ENDIF
IF:ttt_turn:==:0:THEN
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:skillttt:THEN
RND:rndnum:0:4
SET:reTempVar0:rndnum
MUL:reTempVar0:2
RETURN:reTempVar0
ENDIF
RND:rndnum:0:8
RETURN:rndnum
ENDIF
PUSH:ttt_turn
PUSH:2
LE
POP:reTempVar0
PUSH:reTempVar0
CALL:F_RND100
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar1
PUSH:skillttt
LT
POP:reTempVar2
AP_GET:reTempVar3:ttt:4
PUSH:reTempVar3
PUSH:0
EQ
POP:reTempVar4
LAND:reTempVar2:reTempVar4
IF:reTempVar0:&&:reTempVar2:THEN
IF:ttt_turn:==:1:THEN
RETURN:4
ENDIF
AP_GET:reTempVar0:ttt:0
PUSH:reTempVar0
PUSH:10
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:2
PUSH:reTempVar2
PUSH:10
EQ
POP:reTempVar3
LIOR:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:6
PUSH:reTempVar4
PUSH:10
EQ
POP:reTempVar5
LIOR:reTempVar1:reTempVar5
AP_GET:reTempVar6:ttt:8
PUSH:reTempVar6
PUSH:10
EQ
POP:reTempVar7
LIOR:reTempVar1:reTempVar7
IF:reTempVar1:<>:0:THEN
RETURN:4
ENDIF
AP_GET:reTempVar0:ttt:1
PUSH:reTempVar0
PUSH:10
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:7
PUSH:reTempVar2
PUSH:0
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:7
PUSH:reTempVar4
PUSH:10
EQ
POP:reTempVar5
AP_GET:reTempVar6:ttt:1
PUSH:reTempVar6
PUSH:0
EQ
POP:reTempVar7
LAND:reTempVar5:reTempVar7
IF:reTempVar1:||:reTempVar5:THEN
RETURN:4
ENDIF
AP_GET:reTempVar0:ttt:3
PUSH:reTempVar0
PUSH:10
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:5
PUSH:reTempVar2
PUSH:0
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:5
PUSH:reTempVar4
PUSH:10
EQ
POP:reTempVar5
AP_GET:reTempVar6:ttt:3
PUSH:reTempVar6
PUSH:0
EQ
POP:reTempVar7
LAND:reTempVar5:reTempVar7
IF:reTempVar1:||:reTempVar5:THEN
RETURN:4
ENDIF
ENDIF
PUSH:ttt_turn
PUSH:3
EQ
POP:reTempVar0
AP_GET:reTempVar1:ttt:4
PUSH:reTempVar1
PUSH:10
EQ
POP:reTempVar2
IF:reTempVar0:&&:reTempVar2:THEN
AP_GET:reTempVar0:ttt:0
PUSH:reTempVar0
PUSH:1
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:8
PUSH:reTempVar2
PUSH:1
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
SET:i:reTempVar1
AP_GET:reTempVar0:ttt:2
PUSH:reTempVar0
PUSH:1
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:6
PUSH:reTempVar2
PUSH:1
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
SET:j:reTempVar1
IF:i:||:j:THEN
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:skillttt:THEN
:reTempLbl30
RND:rndnum:0:3
SET:reTempVar0:rndnum
MUL:reTempVar0:2
ADD:reTempVar0:1
SET:rndnum:reTempVar0
AP_GET:reTempVar0:ttt:rndnum
IF:reTempVar0:<>:0:reTempLbl30
RETURN:rndnum
ENDIF
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:50:THEN
SET:reTempVar0:0
SET:reTempVar1:i
MUL:reTempVar1:2
ADD:reTempVar0:reTempVar1
RETURN:reTempVar0
ELSE
SET:reTempVar0:6
SET:reTempVar1:j
MUL:reTempVar1:2
ADD:reTempVar0:reTempVar1
RETURN:reTempVar0
ENDIF
ENDIF
ENDIF
FOR:i:0:9
AP_GET:reTempVar0:ttt:i
PUSH:reTempVar0
PUSH:0
EQ
POP:reTempVar1
PUSH:reTempVar0
PUSH:reTempVar1
CALL:F_RND100
POP:reTempVar2
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar2
PUSH:skillttt
LT
POP:reTempVar3
IF:reTempVar1:&&:reTempVar3:THEN
SET:k:0
FOR:j:0:9
PUSH:i
PUSH:j
NE
POP:reTempVar0
AP_GET:reTempVar1:ttt:j
PUSH:reTempVar1
PUSH:0
EQ
POP:reTempVar2
IF:reTempVar0:&&:reTempVar2:THEN
CALL:G_TTT_Thinking
AP_SET:1:ttt:i
AP_SET:1:ttt:j
SET:reTempVar0:k
PUSH:reTempVar0
PUSH:1
CALL:F_TTT_Win:1
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar1
PUSH:0
GT
POP:reTempVar2
ADD:reTempVar0:reTempVar2
SET:k:reTempVar0
AP_SET:0:ttt:i
AP_SET:0:ttt:j
IF:k:>:1:THEN
RETURN:i
ENDIF
ENDIF
NEXT
ENDIF
NEXT
SET:near_win:-1
SET:possible_win:-1
FOR:i:0:9
AP_GET:reTempVar0:ttt:i
PUSH:reTempVar0
PUSH:0
EQ
POP:reTempVar1
PUSH:reTempVar0
PUSH:reTempVar1
CALL:F_RND100
POP:reTempVar2
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar2
PUSH:skillttt
LT
POP:reTempVar3
IF:reTempVar1:&&:reTempVar3:THEN
SET:k:0
FOR:j:0:9
PUSH:i
PUSH:j
NE
POP:reTempVar0
AP_GET:reTempVar1:ttt:j
PUSH:reTempVar1
PUSH:0
EQ
POP:reTempVar2
IF:reTempVar0:&&:reTempVar2:THEN
CALL:G_TTT_Thinking
AP_SET:10:ttt:i
AP_SET:10:ttt:j
PUSH:10
CALL:F_TTT_Win:1
POP:reTempVar0
IF:reTempVar0:>:0:THEN
SET:reTempVar0:k
ADD:k:1
PUSH:possible_win
PUSH:0
LT
POP:reTempVar0
PUSH:reTempVar0
CALL:F_RND100
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar1
PUSH:50
GT
POP:reTempVar2
IF:reTempVar0:||:reTempVar2:THEN
SET:possible_win:i
ENDIF
ENDIF
AP_SET:0:ttt:i
AP_SET:0:ttt:j
PUSH:k
PUSH:1
GT
POP:reTempVar0
PUSH:near_win
PUSH:0
LT
POP:reTempVar1
PUSH:reTempVar0
PUSH:reTempVar1
CALL:F_RND100
POP:reTempVar2
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar2
PUSH:50
GT
POP:reTempVar3
LIOR:reTempVar1:reTempVar3
IF:reTempVar0:&&:reTempVar1:THEN
SET:near_win:i
ENDIF
ENDIF
NEXT
ENDIF
NEXT
IF:near_win:>=:0:THEN
RETURN:near_win
ENDIF
IF:possible_win:>=:0:THEN
RETURN:possible_win
ENDIF
:reTempLbl31
RND:rndnum:0:8
AP_GET:reTempVar0:ttt:rndnum
IF:reTempVar0:<>:0:reTempLbl31
RETURN:rndnum
:F_TTT_CheckHorz
ARG:row
ARG:player
LOCAL:j
SET:reTempVar0:row
MUL:reTempVar0:3
SET:j:reTempVar0
CALL:G_TTT_Thinking
AP_GET:reTempVar0:ttt:j
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:j:1
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:j:2
PUSH:reTempVar4
PUSH:0
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
SET:reTempVar0:j
ADD:reTempVar0:2
RETURN:reTempVar0
ENDIF
AP_GET:reTempVar0:ttt:j
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:j:2
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:j:1
PUSH:reTempVar4
PUSH:0
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
SET:reTempVar0:j
ADD:reTempVar0:1
RETURN:reTempVar0
ENDIF
AP_GET:reTempVar0:ttt:j:1
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:j:2
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:j
PUSH:reTempVar4
PUSH:0
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
RETURN:j
ENDIF
RETURN:-1
:F_TTT_CheckVert
ARG:col
ARG:player
CALL:G_TTT_Thinking
AP_GET:reTempVar0:ttt:col
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:col:3
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:col:6
PUSH:reTempVar4
PUSH:0
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
SET:reTempVar0:col
ADD:reTempVar0:6
RETURN:reTempVar0
ENDIF
AP_GET:reTempVar0:ttt:col
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:col:3
PUSH:reTempVar2
PUSH:0
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:col:6
PUSH:reTempVar4
PUSH:player
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
SET:reTempVar0:col
ADD:reTempVar0:3
RETURN:reTempVar0
ENDIF
AP_GET:reTempVar0:ttt:col
PUSH:reTempVar0
PUSH:0
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:col:3
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:col:6
PUSH:reTempVar4
PUSH:player
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
RETURN:col
ENDIF
RETURN:-1
:F_TTT_CheckDiagonal
ARG:player
CALL:G_TTT_Thinking
AP_GET:reTempVar0:ttt:0
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:4
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:8
PUSH:reTempVar4
PUSH:0
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
RETURN:8
ENDIF
AP_GET:reTempVar0:ttt:0
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:4
PUSH:reTempVar2
PUSH:0
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:8
PUSH:reTempVar4
PUSH:player
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
RETURN:4
ENDIF
AP_GET:reTempVar0:ttt:0
PUSH:reTempVar0
PUSH:0
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:4
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:8
PUSH:reTempVar4
PUSH:player
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
RETURN:0
ENDIF
AP_GET:reTempVar0:ttt:2
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:4
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:6
PUSH:reTempVar4
PUSH:0
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
RETURN:6
ENDIF
AP_GET:reTempVar0:ttt:2
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:4
PUSH:reTempVar2
PUSH:0
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:6
PUSH:reTempVar4
PUSH:player
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
RETURN:4
ENDIF
AP_GET:reTempVar0:ttt:2
PUSH:reTempVar0
PUSH:0
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:4
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:6
PUSH:reTempVar4
PUSH:player
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
RETURN:2
ENDIF
RETURN:-1
:F_TTT_Win
ARG:player
LOCAL:i:0
LOCAL:j:0
FOR:i:0:2
AP_GET:reTempVar0:ttt:j
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:j:1
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:j:2
PUSH:reTempVar4
PUSH:player
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
SET:reTempVar0:i
ADD:reTempVar0:1
RETURN:reTempVar0
ENDIF
AP_GET:reTempVar0:ttt:i
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:i:3
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:i:6
PUSH:reTempVar4
PUSH:player
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
SET:reTempVar0:i
ADD:reTempVar0:4
RETURN:reTempVar0
ENDIF
ADD:j:3
NEXT
AP_GET:reTempVar0:ttt:0
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:4
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:8
PUSH:reTempVar4
PUSH:player
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
RETURN:7
ENDIF
AP_GET:reTempVar0:ttt:2
PUSH:reTempVar0
PUSH:player
EQ
POP:reTempVar1
AP_GET:reTempVar2:ttt:4
PUSH:reTempVar2
PUSH:player
EQ
POP:reTempVar3
LAND:reTempVar1:reTempVar3
AP_GET:reTempVar4:ttt:6
PUSH:reTempVar4
PUSH:player
EQ
POP:reTempVar5
LAND:reTempVar1:reTempVar5
IF:reTempVar1:<>:0:THEN
RETURN:8
ENDIF
RETURN:0
:G_Touch4_Game
PLAY:ACTION:t4_intro2
CALL:G_WAITZERO
SET:t4_wrongcount:0
RND:limit:3:6
:T4_GAMESTART
CALL:G_CLEAR_SENSORS
SET:t4_gamenum:0
SWITCH:t4_gamenum
CASE:0:SET:t4_start_moves:3
CASE:1:SET:t4_start_moves:6
CASE:2:SET:t4_start_moves:10
SWITCH:t4_gamenum
CASE:0:SET:t4_max_moves:20
CASE:1:SET:t4_max_moves:30
CASE:2:SET:t4_max_moves:40
SWITCH:t4_gamenum
CASE:0:SET:t4_speed:0
CASE:1:SET:t4_speed:3
CASE:2:SET:t4_speed:9
SET:t4_moves:0
:reTempLbl32
IF:t4_moves:<:t4_start_moves:THEN
RND:rndnum:1:4
SET:reTempVar0:t4_moves
AP_SET:rndnum:trackarray:reTempVar0
ADD:t4_moves:1
GO:reTempLbl32
ENDIF
:GT4_ROUND
SET:reTempVar0:Tail_U_ON
LIOR:reTempVar0:Tail_D_ON
LIOR:reTempVar0:Tail_R_ON
LIOR:reTempVar0:Tail_L_ON
PUSH:reTempVar0
CALL:F_NEED2REST
POP:reTempVar1
POP:reTempVar0
IF:reTempVar0:||:reTempVar1:GT4_ENDGAME
CALL:GT4_REVIEWMOVES
SET:t4_matchnum:0
:reTempLbl33
PUSH:t4_matchnum
PUSH:0
GE
POP:reTempVar0
PUSH:t4_matchnum
PUSH:t4_moves
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:t4_usermove:0
SET:timeout:63
:reTempLbl34
PUSH:t4_usermove
PUSH:0
EQ
POP:reTempVar0
SUB:timeout:1
PUSH:timeout
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
WAIT:32
SET:reTempVar0:Tail_U_ON
LIOR:reTempVar0:Tail_D_ON
LIOR:reTempVar0:Tail_R_ON
LIOR:reTempVar0:Tail_L_ON
PUSH:reTempVar0
CALL:F_NEED2REST
POP:reTempVar1
POP:reTempVar0
IF:reTempVar0:||:reTempVar1:GT4_ENDGAME
CALL:G_RPS_ATTENTION
CASE:117:GO:GT4_ENDGAME
CASE:112:CALL:G_PRAISE
CASE:113:CALL:G_SCOLD
IF:Context:==:114:THEN
SWITCH:VoiceCmd
CASE:24:GO:TTT_ENDGAME
CASE:38:GO:TTT_DOVOICE
CASE:16:GO:TTT_DOVOICE
CASE:0x429:GO:TTT_DOVOICE
CASE:0x42A:GO:TTT_DOVOICE
CASE:0x42C:GO:TTT_DOVOICE
CASE:0x42B:GO:TTT_DOVOICE
CASE:0x42D:GO:TTT_DOVOICE
CASE:36:GO:TTT_DOVOICE
CASE:13:GO:TTT_DOVOICE
CASE:33:GO:TTT_DOVOICE
CASE:0x408:GO:TTT_DOVOICE
ENDIF
IF:LFLeg_ON:>:0:THEN
SET:LFLeg_ON:0
SET:t4_usermove:1
ENDIF
IF:LRLeg_ON:>:0:THEN
SET:LRLeg_ON:0
SET:t4_usermove:2
ENDIF
IF:RFLeg_ON:>:0:THEN
SET:RFLeg_ON:0
SET:t4_usermove:3
ENDIF
IF:RRLeg_ON:>:0:THEN
SET:RRLeg_ON:0
SET:t4_usermove:4
ENDIF
GO:reTempLbl34
ENDIF
IF:timeout:<=:0:THEN
RND:rndnum:0:2
SWITCH:rndnum
CASE:0:PLAY:ACTION:t4_tooslow0
CASE:1:PLAY:ACTION:t4_tooslow1
CASE:2:PLAY:ACTION:t4_tooslow2
CALL:G_WAITZERO
SET:reTempVar0:t4_wrongcount
ADD:t4_wrongcount:1
IF:t4_wrongcount:>=:limit:THEN
PLAY:ACTION:t4_endgame
CALL:G_WAITZERO
RET:2
ENDIF
GO:T4_GAMESTART
ENDIF
AP_GET:reTempVar0:trackarray:t4_matchnum
IF:reTempVar0:==:t4_usermove:THEN
SWITCH:t4_usermove
CASE:1:PLAY:ACTION:t4_correct_lf
CASE:2:PLAY:ACTION:t4_correct_lr
CASE:3:PLAY:ACTION:t4_correct_rf
CASE:4:PLAY:ACTION:t4_correct_rr
CALL:G_WAITZERO
ELSE
RND:rndnum:0:2
SWITCH:rndnum
CASE:0:PLAY:ACTION:t4_wrong0
CASE:1:PLAY:ACTION:t4_wrong1
CASE:2:PLAY:ACTION:t4_wrong2
CALL:G_WAITZERO
SET:reTempVar0:t4_wrongcount
ADD:t4_wrongcount:1
IF:t4_wrongcount:>=:limit:THEN
PLAY:ACTION:t4_endgame
CALL:G_WAITZERO
RET:3
ENDIF
GO:T4_GAMESTART
ENDIF
SET:reTempVar0:t4_matchnum
ADD:t4_matchnum:1
GO:reTempLbl33
ENDIF
SET:t4_wrongcount:0
RND:rndnum:0:2
IF:t4_moves:>=:t4_max_moves:THEN
SWITCH:rndnum
CASE:0:PLAY:ACTION:t4_wingame0
CASE:1:PLAY:ACTION:t4_wingame1
CASE:2:PLAY:ACTION:t4_wingame2
CALL:G_WAITZERO
PLAY:ACTION:t4_endgame
CALL:G_WAITZERO
RND:rndnum:0:2
SWITCH:rndnum
CASE:0:PLAY:ACTION:O2_POUNCE1
CASE:1:PLAY:ACTION:O2_CUTE_BANZAI1
CASE:2:PLAY:ACTION:O2_SALUTE2
GO:G_WAITZERO
ENDIF
SWITCH:rndnum
CASE:0:PLAY:ACTION:t4_winround0
CASE:1:PLAY:ACTION:t4_winround1
CASE:2:PLAY:ACTION:t4_winround2
CALL:G_WAITZERO
RND:rndnum:1:4
SET:reTempVar0:t4_moves
AP_SET:rndnum:trackarray:reTempVar0
ADD:t4_moves:1
SET:reTempVar0:t4_speed
ADD:t4_speed:1
GO:GT4_ROUND
:GT4_DOVOICE
SET:reTempVar0:VoiceCmd
SUB:reTempVar0:base_voice_cmd
SET:AP_Voice_Cmd:reTempVar0
SET:AP_Voice_Level:2
:GT4_ENDGAME
PLAY:ACTION:t4_endgame
CALL:G_WAITZERO
RET:1
:GT4_REVIEWMOVES
LOCAL:count:0
LOCAL:speed
:reTempLbl35
IF:count:<:t4_moves:THEN
SET:reTempVar0:Tail_U_ON
LIOR:reTempVar0:Tail_D_ON
LIOR:reTempVar0:Tail_R_ON
LIOR:reTempVar0:Tail_L_ON
PUSH:reTempVar0
CALL:F_NEED2REST
POP:reTempVar1
POP:reTempVar0
IF:reTempVar0:||:reTempVar1:THEN
RET:1
ENDIF
SET:reTempVar0:count
AP_GET:reTempVar1:trackarray:reTempVar0
ADD:count:1
SWITCH:reTempVar1
CASE:1:SET:Horn_B:1
CASE:2:SET:Horn_R:1
CASE:2:SET:Horn_B:1
CASE:3:SET:Horn_G:1
CASE:4:SET:Horn_O:1
PLAY:ACTION:t4_review
SET:reTempVar0:t4_speed
DIV:reTempVar0:3
SET:speed:reTempVar0
IF:speed:>:6:THEN
WAIT:150
ELSE
SWITCH:speed
CASE:0:WAIT:800
CASE:1:WAIT:700
CASE:2:WAIT:600
CASE:3:WAIT:500
CASE:4:WAIT:400
CASE:5:WAIT:300
CASE:6:WAIT:200
ENDIF
SET:Horn_B:0
SET:Horn_G:0
SET:Horn_O:0
IF:speed:>:5:THEN
WAIT:100
ELSE
SWITCH:speed
CASE:0:WAIT:250
CASE:1:WAIT:225
CASE:2:WAIT:200
CASE:3:WAIT:175
CASE:4:WAIT:150
CASE:5:WAIT:125
ENDIF
GO:reTempLbl35
ENDIF
RET:1
:G_SOCCER
CALL:G_CHECK_SITONLY
CASE:103:RET:103
CASE:104:RET:104
CALL:G_SOCCER_POSTURE
SET:scale:10
PLAY:ACTION:TRACK_HEAD:PINK_BALL
WAIT:500
SET:lastmove:-1
SET:kick_tilt:999
SET:kick_pan:999
SET:miss_count:0
RND:maxtime10:5:10
ADD:maxtime10:endure
IF:Pink_Ball:<=:0:THEN
RET:106
ENDIF
SET:pan:Head_Pan
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
CALL:G_STOP_HEAD
CALL:G_YART_Soccer_SeeBall
IF:Context:!=:101:THEN
PUSH:Posture1
PUSH:1
EQ
POP:reTempVar0
PUSH:Posture1
PUSH:4
EQ
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
LNOT:reTempVar0:reTempVar0
IF:reTempVar0:<>:0:THEN
PLAY:ACTION:STAND
CALL:G_WAIT
ENDIF
ELSE
SET:init_wait:Wait
AP_GET:reTempVar0:behavior:25
SWITCH:reTempVar0
CASE:0:PLAY:ACTION:O2_TUNE_SEEBALL
CASE:1:PLAY:ACTION:dog_1bark_anypos
CALL:G_WAIT
ENDIF
CALL:G_SOCCER_POSTURE
WAIT:1
PUSH:Head_Pan
PUSH:10
LE
POP:reTempVar0
PUSH:Head_Pan
PUSH:-10
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
STOP
PLAY:ACTION+:happy_eyes
WAIT
PLAY:ACTION+:pounce
WAIT
ENDIF
:2305
WAIT:1
IF:Pink_Ball:>:0:THEN
CALL:G_SOCCER_ATTENTION_HANDLER
CASE:103:GO:SOCCER_MUSTLAYDOWN
CASE:104:GO:SOCCER_MUSTSITDOWN
CASE:102:GO:2307
CASE:107:GO:2311
CASE:100:GO:2311
CASE:108:RET:105
ENDIF
:2306
CALL:G_CHECK_SITONLY
CASE:103:RET:103
CASE:104:RET:104
CALL:G_SOCCER_SEARCH4BALL
CASE:2:GO:2305
CASE:3:GO:SOCCER_LOSTBALL
:2307
CALL:G_TURN_AWAY
CALL:G_INC_ENDURE
RET:102
:2311
PLAY:ACTION:TRACK_HEAD:PINK_BALL
WAIT:1000
SET:scale:10
SET:ballhint:0
:2312
WAIT:1
IF_1ST:Pink_Ball:<=:0:2306
CALL:G_SOCCER_TRACK_BALL
CASE:103:GO:SOCCER_MUSTLAYDOWN
CASE:104:GO:SOCCER_MUSTSITDOWN
CASE:102:GO:2307
CASE:2000:GO:2318
CASE:2002:GO:2315
CASE:2006:GO:2306
CASE:105:RET:105
:2314
CALL:G_SOCCER_BALLABOVE
CASE:1:GO:2307
CASE:2:RET:106
GO:2312
:2315
WAIT:1
SET:pan:Head_Pan
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
CALL:G_SOCCER_KICK_BALL
CASE:2:GO:2307
CASE:3:GO:2306
CASE:4:GO:2314
CASE:103:RET:103
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
CALL:F_NEED2REST
POP:reTempVar0
IF:reTempVar0:<>:0:2307
GO:2305
:2318
WAIT:1
SET:init_wait:Wait
PLAY:ACTION+:mad_eyes
WAIT:200
PLAY:ACTION:WALK:180:200
SET:lastmove:3
CALL:G_WAIT_AWARE
CALL:F_NEED2REST
POP:reTempVar0
IF:reTempVar0:<>:0:2307
GO:2305
:SOCCER_MUSTLAYDOWN
CALL:G_DEC_ENDURE
RET:103
:SOCCER_MUSTSITDOWN
CALL:G_DEC_ENDURE
RET:104
:SOCCER_LOSTBALL
CALL:G_YART_Soccer_LoseBall
IF:Context:!=:101:THEN
RET:Context
ENDIF
RET:106
:G_SOCCER_BALLABOVE
CALL:F_NEED2REST
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
RET:1
ENDIF
SET:above_angle:0
SET:last_teasedact:-1
SET:last_teasedact2:-1
SET:actcount:0
RND:tease:100:300
:2329
CALL:G_SOCCER_START_TRACK
:2330
WAIT:1
IF:Pink_Ball:>:0:THEN
CALL:F_HEAD_TILT
POP:reTempVar0
IF:reTempVar0:>=:above_angle:2333
RET:3
ENDIF
RET:2
:2333
PLAY:ACTION+:happy_eyes
CALL:G_START_TAILWAG_NORMAL
RND:impat:20:50
:2334
CALL:G_CHECK_SITONLY
CASE:103:RET:2
CASE:104:RET:2
WAIT:100
SUB:tease:1
SUB:impat:1
WAIT:1
CALL:F_HEAD_TILT
PUSH:above_angle
GE
POP:reTempVar0
LAND:reTempVar0:Pink_Ball
LAND:reTempVar0:tease
IF:reTempVar0:<>:0:2342
CALL:F_HEAD_TILT
POP:reTempVar0
IF:reTempVar0:<:above_angle:2341
IF:Pink_Ball:=:0:2341
IF:tease:>:0:2341
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:MOVE_HEAD:0:0
CALL:G_WAIT_AWARE
SET:tailwag:0
:2338
WAIT:1
SET:init_wait:Wait
RND:angle:100:180
RND:temp:0:1
MUL:temp:2
MUL:temp:angle
SUB:temp:angle
IF:Head_Pan:>:0:THEN
RND:pan:-20:0
ELSE
RND:pan:0:20
ENDIF
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
PLAY:ACTION:MOVE_HEAD:pan:tilt
PLAY:ACTION:TURN:180
CALL:G_INC_MAD_MOOD
CALL:G_WAIT_AWARE
RET:2
:2341
WAIT:500
SET:init_wait:1
GO:2330
:2342
IF_1ST:impat:>:0:2334
WAIT:1
SET:pan:Head_Pan
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
SET:above_angle:0
CALL:G_SOCCER_STOP_TRACK
:2345
RND:temp:0:25
IF_1ST:temp:=:last_teasedact:2345
IF_1ST:temp:=:last_teasedact2:2345
IF_1ST:temp:<=:8:2370
IF_1ST:temp:<=:21:2353
IF_1ST:actcount:<:2:2345
IF_1ST:temp:=:22:2352
IF_1ST:temp:=:23:2351
IF_1ST:temp:=:24:2350
CALL:G_TANTRUM
SET:mood_mad:10
SET:mood_happy:0
GO:2338
:2350
PLAY:ACTION:O2_RESIGNATION
WAIT
GO:2338
:2351
CALL:G_INC_SAD_MOOD
PLAY:ACTION:O2_NOD_STAND
WAIT
GO:2338
:2352
PLAY:ACTION:O2_FRUSTRATED
WAIT
GO:2338
:2353
SWITCH:temp
CASE:9:PLAY:ACTION:O2_BEG_BALL
CASE:10:PLAY:ACTION:O2_NOBI4
CASE:11:PLAY:ACTION:SIT
CASE:12:PLAY:ACTION:O2_CUTE_BANZAI1
CASE:13:PLAY:ACTION:O2_COMEON
CASE:14:PLAY:ACTION:O2_IMPATIENT_SIT1
CASE:15:PLAY:ACTION:O2_IMPATIENT_SIT2
CASE:16:PLAY:ACTION:O2_LOOKAROUND_SIT3
CASE:17:PLAY:ACTION:O2_SIGH
CASE:18:PLAY:ACTION:O2_YOUSILLY1
CASE:19:PLAY:ACTION:O2_YOUSILLY2
CASE:20:PLAY:ACTION:O2_YOUSILLY3
CASE:ELSE:PLAY:ACTION:O2_YOUSILLY4
WAIT
SET:last_teasedact2:last_teasedact
SET:last_teasedact:temp
SET:above_angle:-25
ADD:actcount:1
:2356
CALL:G_DEC_HAPPY_MOOD
PLAY:ACTION:MOVE_HEAD:pan:tilt
WAIT
GO:2329
:2370
SWITCH:temp
CASE:0:PLAY:ACTION:O2_CUTE_SMILE1
CASE:1:PLAY:ACTION+:beg_leftpaw
CASE:2:PLAY:ACTION+:beg_rightpaw
CASE:3:PLAY:ACTION:O2_CUTE_BARK2
CASE:4:PLAY:ACTION:O2_LETSPLAY1
CASE:5:PLAY:ACTION:O2_LETSPLAY2
CASE:6:PLAY:ACTION:O2_LEANRIGHT
CASE:7:PLAY:ACTION:O2_WANTBALL
CASE:ELSE:PLAY:ACTION:O2_TUNE_JAWS
WAIT
SET:last_teasedact2:last_teasedact
SET:last_teasedact:temp
ADD:actcount:1
GO:2356
:2383
RET:3
:G_SOCCER_DIST2BALL
IF:Pink_Ball:==:0:THEN
RET:1
ENDIF
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
IF:tilt:>:20:THEN
SET:d:0
RET:3
ENDIF
IF:Head_Tilt:<:-10:THEN
PUSH:tilt
PUSH:-64
LE
POP:reTempVar0
PUSH:Head_Pan
PUSH:35
LT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Head_Pan
PUSH:-35
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:d:0
RET:4
ENDIF
ELSE
PUSH:tilt
PUSH:-75
LE
POP:reTempVar0
PUSH:Head_Pan
PUSH:35
LT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Head_Pan
PUSH:-35
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:d:0
RET:4
ENDIF
ENDIF
CSET:tilt:>:0:1
CSET:tilt:>:-20:2
CSET:tilt:>:-30:3
CSET:tilt:>:-40:4
CSET:tilt:>:-70:5
CASE:1:SET:d:250
CASE:2:SET:d:200
CASE:3:SET:d:150
CASE:4:SET:d:100
CASE:5:SET:d:50
RET:2
:G_SOCCER_INFER_BALL
SET:panr:pan
SET:panl:pan
SET:tiltd:tilt
SET:tiltu:tilt
SUB:panr:5
ADD:panl:5
SUB:tiltd:5
ADD:tiltu:5
SET:pan2:0
WAIT:1
IF:Head_Pan:<:panr:THEN
CALL:F_HEAD_TILT
POP:reTempVar0
IF:reTempVar0:>:tilt:THEN
SET:d:300
ELSE
SET:d:0
ENDIF
GO:G_SOCCER_SEARCHTURN
ENDIF
IF:Head_Pan:>:panl:THEN
CALL:F_HEAD_TILT
POP:reTempVar0
IF:reTempVar0:>:tilt:THEN
SET:d:300
ELSE
SET:d:0
ENDIF
GO:G_SOCCER_SEARCHTURN
ENDIF
CALL:F_HEAD_TILT
POP:reTempVar0
IF:reTempVar0:>:tiltu:THEN
SET:d:300
GO:G_SOCCER_SEARCHTURN
ENDIF
CALL:F_HEAD_TILT
POP:reTempVar0
IF:reTempVar0:>=:tiltd:THEN
RET:100
ENDIF
PLAY:ACTION:WALK:180:150
RET:100
:G_SOCCER_KICK_BALL
WAIT:1
CALL:G_SOCCER_POSTURE
IF:Pink_Ball:==:0:THEN
CALL:G_SOCCER_INFER_BALL
CASE:107:RET:1
RET:3
ENDIF
CALL:G_SOCCER_DIST2BALL
CASE:1:RET:3
CASE:2:RET:1
CASE:3:RET:4
WAIT:1
IF:Posture1:!=:1:THEN
WAIT:1
:reTempLbl36
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar0
PUSH:reTempVar0
CALL:F_HEAD_TILT
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar1
PUSH:-85
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:Wait
PUSH:0
NE
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
SET:init_wait:Wait
PLAY:ACTION:WALK:180:10
CALL:G_WAIT_AWARE
WAIT:500
GO:reTempLbl36
ENDIF
IF:Pink_Ball:==:0:THEN
RET:3
ENDIF
ENDIF
CALL:G_SOCCER_STOP_TRACK
CALL:G_CUSTOM_SOCCER_KICK
CASE:103:RET:103
CASE:104:RET:104
CASE:105:RET:105
CASE:106:RET:106
CALL:G_SOCCER_CLOSE_ENOUGH?
CASE:2000:RET:3
CASE:2001:GO:SKB_NOKICK
CALL:G_SOCCER_INIT_KICK
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:80:THEN
CALL:F_BEHAVIOR_RND
LNOT
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
RET:2
ENDIF
WAIT:1
IF:Pink_Ball:==:0:SKB_SURPRISE
IF:mood_mad:>:1:THEN
CALL:G_SKB_AIBOKICK
GO:SKB_RESUMETRACK
ENDIF
IF:rndnum:==:rndbase:THEN
PUSH:tilt
PUSH:-68
LE
POP:reTempVar0
PUSH:pan
PUSH:-30
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:pan
PUSH:30
LE
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:pan
PUSH:12
GE
POP:reTempVar3
PUSH:pan
PUSH:-12
LE
POP:reTempVar4
LIOR:reTempVar3:reTempVar4
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
CALL:G_SKB_AIBOKICK
GO:SKB_RESUMETRACK
ENDIF
PUSH:tilt
PUSH:-75
LE
POP:reTempVar0
PUSH:pan
PUSH:-30
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:pan
PUSH:30
LE
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:pan
PUSH:5
GE
POP:reTempVar3
PUSH:pan
PUSH:-5
LE
POP:reTempVar4
LIOR:reTempVar3:reTempVar4
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
CALL:G_SKB_AIBOKICK
GO:SKB_RESUMETRACK
ENDIF
ENDIF
ELSE
CALL:G_SOCCER_TOUCH_BALL
CASE:2000:GO:SKB_SURPRISE
CASE:2001:GO:SKB_NOKICK
ENDIF
CALL:G_SOCCER_CHECK_SWING
CASE:2001:GO:SKB_NOKICK
CALL:G_SOCCER_PLAY_SWING
CASE:2005:GO:SKB_WAIT4KICK
:SKB_NOKICK
SET:pan:999
SET:tilt:999
:SKB_RESUMETRACK
SET:init_wait:1
PLAY:ACTION:TRACK_HEAD:PINK_BALL
SUB:maxtime10:3
:SKB_WAIT4KICK
CALL:G_WAIT_AWARE
SET:kick_pan:pan
SET:kick_tilt:tilt
CALL:G_SOCCER_POSTURE
RET:1
:SKB_SMALLSTEP
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:WALK:0:10
CALL:G_WAIT_AWARE
:SKB_WALKPOSE_KICK
WAIT:1
IF:Head_Pan:>:0:THEN
SET:pan:Head_Pan
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
PLAY:ACTION:kick_front_left
SET:last_kick:1
ELSE
SET:pan:Head_Pan
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
PLAY:ACTION:kick_front_right
SET:last_kick:2
ENDIF
GO:SKB_RESUMETRACK
:SKB_SURPRISE
CALL:G_SURPRISE
RET:3
:G_SOCCER_KICK_MOOD
PUSH:kick_tilt
PUSH:999
GE
POP:reTempVar0
PUSH:kick_pan
PUSH:999
GE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
RET:2
ENDIF
WAIT:1
SET:pan:Head_Pan
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
SUB:kick_pan:pan
SUB:kick_tilt:tilt
PUSH:kick_pan
PUSH:15
GT
POP:reTempVar0
PUSH:kick_pan
PUSH:-15
LT
POP:reTempVar1
LIOR:reTempVar0:reTempVar1
PUSH:kick_tilt
PUSH:15
GT
POP:reTempVar2
LIOR:reTempVar0:reTempVar2
PUSH:kick_tilt
PUSH:-15
LT
POP:reTempVar3
LIOR:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
SET:miss_count:0
ADD:soccer:2
CALL:G_INC_HAPPY_MOOD
CALL:G_DEC_MAD_MOOD
CALL:F_RND100
PUSH:75
GE
POP:reTempVar0
PUSH:mood_happy
PUSH:4
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:mood_mad
PUSH:0
LE
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
CALL:G_YART_Soccer_Happy
IF:Context:==:101:CALL:G_HAPPYDANCE
GO:SKM_LOOK2BALL
ENDIF
CALL:G_YART_Soccer_GoodKick
IF:Context:==:101:THEN
WAIT:1
SET:init_wait:Wait
PLAY:ACTION+:happy_eyes
CALL:G_WAIT_AWARE
ENDIF
GO:SKM_DONE
ENDIF
ADD:miss_count:1
SUB:soccer:1
CALL:G_INC_MAD_MOOD
CALL:G_DEC_HAPPY_MOOD
CALL:F_RND100
PUSH:50
LT
POP:reTempVar0
PUSH:mood_mad
PUSH:4
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Posture1
PUSH:1
EQ
POP:reTempVar2
PUSH:Posture1
PUSH:4
EQ
POP:reTempVar3
LIOR:reTempVar2:reTempVar3
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
CALL:G_YART_Soccer_Frustrated
IF:Context:==:101:THEN
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:O2_FRUSTRATED
CALL:G_WAIT_AWARE
ENDIF
GO:SKM_LOOK2BALL
ENDIF
CALL:G_YART_Soccer_MissedKick
IF:Context:==:101:THEN
WAIT:1
SET:init_wait:Wait
PLAY:ACTION+:mad_eyes
CALL:G_WAIT_AWARE
ENDIF
:SKM_DONE
SET:kick_pan:999
SET:kick_tilt:999
CALL:G_SAVE_SOCCER
RET:1
:SKM_LOOK2BALL
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:MOVE.HEAD.NORMAL:pan:tilt
CALL:G_WAIT_AWARE
CALL:G_SOCCER_START_TRACK
GO:SKM_DONE
:G_SOCCER_LOOK4BALL
LOCAL:slb_temp:0
CALL:G_SOCCER_STOP_TRACK
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:MOVE_HEAD:0:-60
:reTempLbl37
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Wait
PUSH:init_wait
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Pink_Ball
PUSH:0
EQ
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:slb_temp
PUSH:600
LT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
ADD:slb_temp:1
WAIT:100
GO:reTempLbl37
ENDIF
IF:Pink_Ball:>:0:THEN
RET:107
ENDIF
IF:searchmode:==:0:THEN
PLAY:ACTION:SEARCH.HEAD.LOWCENT:PINK_BALL
ELSE
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:33:THEN
PLAY:ACTION:SEARCH.HEAD.FASTCENT:PINK_BALL
ELSE
PLAY:ACTION:SEARCH.HEAD.NORMALCENT:PINK_BALL
ENDIF
ENDIF
SET:slb_temp:0
:reTempLbl38
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Wait
PUSH:init_wait
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Pink_Ball
PUSH:0
EQ
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:slb_temp
PUSH:600
LT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
ADD:slb_temp:1
WAIT:100
GO:reTempLbl38
ENDIF
IF:Pink_Ball:>:0:THEN
RET:107
ENDIF
RET:100
:G_SOCCER_MOVE2BALL
CALL:G_SOCCER_POSTURE
CALL:G_SOCCER_DIST2BALL
CASE:1:GO:2520
CASE:3:RET:6
CASE:4:RET:5
WAIT:1
IF:Wait:==:0:THEN
PLAY:ACTION:TRACK_HEAD:PINK_BALL
WAIT:500
GO:G_SOCCER_MOVE2BALL
ENDIF
PUSH:Wait
PUSH:1
LT
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
EQ
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
WAIT:250
GO:G_SOCCER_MOVE2BALL
ENDIF
SET:dd:d
RND:temp:0:1
MUL:temp:Head_Pan
SET:lastmove:2
IF:last_walkmode:<:0:THEN
CALL:F_RND100
PUSH:80
GT
POP:reTempVar0
SET:last_walkmode:reTempVar0
ENDIF
PUSH:Head_Tilt
PUSH:-10
LT
POP:reTempVar0
LNOT:reTempVar0:reTempVar0
SET:relock_track:reTempVar0
IF:relock_track:<>:0:THEN
SET:pan:Head_Pan
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
ENDIF
PUSH:last_walkmode
PUSH:1
EQ
POP:reTempVar0
PUSH:d
PUSH:200
GE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
PLAY:ACTION:O2_STALK_WALK1:temp:d
ELSE
SET:last_walkmode:0
PLAY:ACTION:WALK:temp:d
ENDIF
IF:relock_track:<>:0:THEN
PLAY:ACTION:MOVE.HEAD.NORMAL:pan:tilt
WAIT:1000
PLAY:ACTION:TRACK_HEAD:PINK_BALL
WAIT:500
ENDIF
:2502
CALL:G_SOCCER_ATTENTION_HANDLER
CASE:103:RET:2
CASE:102:RET:1
CASE:104:RET:7
CASE:108:RET:8
CASE:105:RET:8
WAIT:1
IF:Pink_Ball:==:0:THEN
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:WALK:0:0
CALL:G_WAIT_AWARE
WAIT:200
RET:3
ENDIF
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
SET:pan:Head_Pan
IF:tilt:>=:20:THEN
RET:6
ENDIF
CALL:F_SOCCER_NEAR2BALL
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
SET:init_wait:Wait
PLAY:ACTION:WALK:0:0
CALL:G_WAIT_AWARE
CALL:G_SOCCER_PAN2BALL?
CASE:1:GO:G_SOCCER_MOVE2BALL
RET:5
ENDIF
IF:Wait:<=:1:THEN
CALL:G_SOCCER_PAN2BALL?
CASE:1:GO:G_SOCCER_MOVE2BALL
RET:5
ENDIF
PUSH:tilt
PUSH:-30
LT
POP:reTempVar0
PUSH:Head_Pan
PUSH:30
LT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Head_Pan
PUSH:-30
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:Distance
PUSH:800
GT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
WAIT:1
SET:init_wait:Wait
PLAY:ACTION+:sad_eyes
PLAY:ACTION:WALK:0:0
CALL:G_WAIT_AWARE
CALL:F_HEAD_TILT
PUSH:-30
LT
POP:reTempVar0
PUSH:Head_Pan
PUSH:30
LT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Head_Pan
PUSH:-30
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:Distance
PUSH:800
GT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
RET:4
ENDIF
GO:G_SOCCER_MOVE2BALL
ENDIF
GO:2502
:2520
WAIT:200
RET:3
:F_SOCCER_NEAR2BALL
WAIT:1
IF:Pink_Ball_D:<:75:THEN
RETURN:1
ENDIF
IF:last_walkmode:==:1:THEN
PUSH:tilt
PUSH:-50
LE
POP:reTempVar0
PUSH:pan
PUSH:-20
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:pan
PUSH:20
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
RETURN:1
ENDIF
PUSH:tilt
PUSH:-40
LE
POP:reTempVar0
PUSH:pan
PUSH:20
GE
POP:reTempVar1
PUSH:pan
PUSH:-20
LE
POP:reTempVar2
LIOR:reTempVar1:reTempVar2
LAND:reTempVar0:reTempVar1
RETURN:reTempVar0
ENDIF
PUSH:d
PUSH:100
GT
POP:reTempVar0
PUSH:tilt
PUSH:-50
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
RETURN:1
ENDIF
PUSH:mood_mad
PUSH:2
LT
POP:reTempVar0
PUSH:tilt
PUSH:-64
LE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:pan
PUSH:-35
GT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
PUSH:pan
PUSH:35
LT
POP:reTempVar3
LAND:reTempVar0:reTempVar3
IF:reTempVar0:<>:0:THEN
RETURN:1
ENDIF
PUSH:tilt
PUSH:-50
LE
POP:reTempVar0
PUSH:pan
PUSH:35
GT
POP:reTempVar1
PUSH:pan
PUSH:-35
LT
POP:reTempVar2
LIOR:reTempVar1:reTempVar2
LAND:reTempVar0:reTempVar1
RETURN:reTempVar0
:G_SOCCER_PAN2BALL?
PUSH:Head_Pan
PUSH:-35
LT
POP:reTempVar0
PUSH:Head_Pan
PUSH:35
GT
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
RET:2
ENDIF
RET:1
//++CALL G_SOCCER_SEARCH4BALL // Search for Ball
:G_SOCCER_SEARCH4BALL
SET:searchmode:1
SET:searchmove:0
CALL:G_SOCCER_LOOK4BALL
CASE:100:GO:2606
:SSB_LOOP
CALL:F_NEED2REST
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
RET:1
ENDIF
CALL:F_SEE_BALL
POP:reTempVar0
SWITCH:reTempVar0
CASE:115:RET:1
CASE:107:RET:2
:2600
SET:kick_tilt:999
SET:kick_pan:999
CALL:G_RANDOM3
CASE:1:PLAY:ACTION+:ummm
CASE:2:PLAY:ACTION:O2_OHWELL
CASE:3:PLAY:ACTION:O2_SAD8
WAIT
RET:3
:2606
PLAY:ACTION:WALK:180:200
WAIT
SET:lastmove:3
SET:kick_tilt:999
SET:searchmode:0
SET:searchmove:1
CALL:G_SOCCER_LOOK4BALL
CASE:107:GO:SSB_LOOP
IF:mood_mad:>:1:2600
PUSH:mood_happy
PUSH:3
GT
POP:reTempVar0
PUSH:ballhint
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:2611
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:33:2600
:2611
RND:sign:0:1
MUL:sign:2
SUB:sign:1
SWITCH:ballhint
CASE:1:SET:sign:1
SET:ballhint:0
RND:turndelta:90:150
MUL:turndelta:sign
SET:pan:turndelta
SET:d:0
SET:pan2:0
SET:searchmode:1
SET:kick_tilt:999
SET:searchmove:1
CALL:G_SOCCER_SEARCHTURN
CASE:107:GO:SSB_LOOP
PUSH:mood_happy
PUSH:5
LT
POP:reTempVar0
PUSH:reTempVar0
CALL:F_RND100
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar1
PUSH:50
LT
POP:reTempVar2
IF:reTempVar0:&&:reTempVar2:2600
SET:pan:270
MUL:pan:sign
SUB:pan:turndelta
CALL:G_SOCCER_SEARCHTURN
CASE:107:GO:SSB_LOOP
CALL:G_SOCCER_SEARCHTURN
CASE:107:GO:SSB_LOOP
GO:2600
:G_SOCCER_SEARCHTURN
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:33:THEN
PLAY:ACTION:MOVE.TURN.NORMAL:pan
ELSE
PLAY:ACTION:TURN:pan
ENDIF
:reTempLbl39
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
EQ
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
WAIT:1
GO:reTempLbl39
ENDIF
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_SOCCER_STOP_TRACK
RET:107
ENDIF
IF:d:>:0:THEN
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:33:THEN
PLAY:ACTION:MOVE.MOVE.NORMAL:0:d
ELSE
PLAY:ACTION:WALK:0:d
ENDIF
:reTempLbl40
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
EQ
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
WAIT:1
GO:reTempLbl40
ENDIF
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Distance
PUSH:200
LT
POP:reTempVar2
IF:reTempVar0:||:reTempVar2:THEN
CALL:G_SOCCER_STOP_TRACK
RET:107
ENDIF
ENDIF
IF:pan2:!=:0:THEN
CALL:F_RND100
POP:reTempVar0
IF:reTempVar0:<:33:THEN
PLAY:ACTION:MOVE.TURN.NORMAL:pan2
ELSE
PLAY:ACTION:TURN:pan2
ENDIF
:reTempLbl41
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
EQ
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
WAIT:1
GO:reTempLbl41
ENDIF
PUSH:Wait
PUSH:0
GT
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_SOCCER_STOP_TRACK
RET:107
ENDIF
ENDIF
GO:G_SOCCER_LOOK4BALL
:G_SOCCER_START_TRACK
:2648
WAIT:100
WAIT:1
IF_1ST:Wait:=:0:2651
IF_1ST:Wait:>:0
IF_AND:Pink_Ball:>:0:2652
WAIT:1000
GO:2648
:2651
PLAY:ACTION:TRACK_HEAD:PINK_BALL
WAIT:500
:2652
RET:1
:G_SOCCER_STOP_TRACK
WAIT:1
IF_1ST:Wait:>:0:2656
WAIT:100
RET:1
:2656
WAIT:500
WAIT:1
IF_1ST:Wait:<=:0:2660
STOP
CALL:G_WAITZERO
:2660
RET:1
:G_SOCCER_TRACK_BALL
SET:last_walkmode:-1
SET:walking:2
ADD:soccer:1
VSAVE:soccer
CALL:G_SOCCER_POSTURE
:STB_START_TRACKING
CALL:F_NEED2REST
POP:reTempVar0
IF:reTempVar0:<>:0:THEN
RET:102
ENDIF
CALL:G_SOCCER_KICK_MOOD
IF:mood_mad:>:6:THEN
RET:102
ENDIF
CALL:G_SOCCER_ATTENTION_HANDLER
CASE:103:RET:103
CASE:102:RET:102
CASE:104:RET:104
CASE:108:RET:2000
CASE:105:RET:2006
CALL:G_SOCCER_TURN2BALL
CASE:1:RET:102
CASE:2:RET:103
CASE:3:RET:2000
CASE:5:RET:104
CASE:6:RET:105
CASE:7:RET:2006
CALL:G_SOCCER_ATTENTION_HANDLER
CASE:103:RET:103
CASE:102:RET:102
CASE:104:RET:104
CASE:108:RET:105
CASE:105:RET:2006
CALL:G_SOCCER_MOVE2BALL
CASE:1:RET:102
CASE:2:RET:103
CASE:3:RET:2000
CASE:4:GO:2674
CASE:5:GO:2672
CASE:7:RET:104
CASE:8:RET:2006
WAIT:500
CALL:G_SOCCER_PAN2BALL?
CASE:1:RET:2007
GO:STB_START_TRACKING
:2672
WAIT:500
CALL:G_SOCCER_PAN2BALL?
CASE:1:RET:2002
GO:STB_START_TRACKING
:2674
CALL:G_SOCCER_STOP_TRACK
CALL:G_WALK_FOUND_CLIFF
CASE:1:RET:2000
CASE:2:RET:2000
CASE:3:RET:102
CASE:4:GO:STB_START_TRACKING
CASE:6:RET:104
CASE:7:RET:2006
RET:1
:G_SOCCER_TURN2BALL
WAIT:1
IF:Pink_Ball:==:0:THEN
RET:3
ENDIF
CALL:G_SOCCER_PAN2BALL?
CASE:1:RET:4
PUSH:Head_Pan
PUSH:0
LT
POP:reTempVar0
SET:lastmove:reTempVar0
CALL:G_SOCCER_POSTURE
CALL:G_SOCCER_START_TRACK
WAIT:1
SET:pan:Head_Pan
SET:init_turnwait:Wait
SET:last_walkmode:2
PLAY:ACTION:TURN:pan
:reTempLbl42
CALL:G_SOCCER_ATTENTION_HANDLER
CASE:103:RET:2
CASE:102:RET:1
CASE:107:RET:4
CASE:104:RET:5
CASE:108:RET:6
CASE:105:RET:7
WAIT:1
PUSH:Wait
PUSH:0
EQ
POP:reTempVar0
PUSH:Pink_Ball
PUSH:0
GT
POP:reTempVar1
PUSH:Wait
PUSH:init_turnwait
LE
POP:reTempVar2
LAND:reTempVar1:reTempVar2
LIOR:reTempVar0:reTempVar1
PUSH:reTempVar0
PUSH:reTempVar1
PUSH:reTempVar2
PUSH:Head_Pan
CALL:F_ABS:1
POP:reTempVar3
POP:reTempVar2
POP:reTempVar1
POP:reTempVar0
PUSH:reTempVar3
PUSH:10
LT
POP:reTempVar4
LIOR:reTempVar0:reTempVar4
IF:reTempVar0:==:0:reTempLbl42
PLAY:ACTION:TURN:0
SET:last_walkmode:-1
WAIT:1
IF:Pink_Ball:>:0:THEN
RET:4
ENDIF
RET:3
:G_SOCCER_CLOSE_ENOUGH?
WAIT:1
IF:Pink_Ball:==:0:THEN
RET:2000
ENDIF
IF:Pink_Ball_D:<:75:THEN
RET:2002
ENDIF
CALL:F_HEAD_TILT
PUSH:-64
LE
POP:reTempVar0
PUSH:Head_Pan
PUSH:-35
GT
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:Head_Pan
PUSH:35
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
RET:2002
ENDIF
RET:2001
:G_SOCCER_CHECK_SWING
SET:swing_kick:0
SET:kickcount:0
PUSH:pan
PUSH:-30
GE
POP:reTempVar0
PUSH:pan
PUSH:-15
LE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:tilt
PUSH:-64
LE
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:reTempVar0:kickcount
AP_SET:6:kickcheck:reTempVar0
SET:swing_kick:6
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:30
LE
POP:reTempVar0
PUSH:pan
PUSH:15
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:tilt
PUSH:-64
LE
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:reTempVar0:kickcount
AP_SET:6:kickcheck:reTempVar0
SET:swing_kick:6
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:-34
LT
POP:reTempVar0
PUSH:tilt
PUSH:-64
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:reTempVar0:kickcount
AP_SET:7:kickcheck:reTempVar0
SET:swing_kick:7
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:-18
LT
POP:reTempVar0
PUSH:tilt
PUSH:-64
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:reTempVar0:kickcount
AP_SET:7:kickcheck:reTempVar0
SET:swing_kick:7
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:34
GT
POP:reTempVar0
PUSH:tilt
PUSH:-64
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:reTempVar0:kickcount
AP_SET:8:kickcheck:reTempVar0
SET:swing_kick:8
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:18
GT
POP:reTempVar0
PUSH:tilt
PUSH:-64
LT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:reTempVar0:kickcount
AP_SET:8:kickcheck:reTempVar0
SET:swing_kick:8
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:-25
LT
POP:reTempVar0
PUSH:tilt
PUSH:-64
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:reTempVar0:kickcount
AP_SET:9:kickcheck:reTempVar0
SET:swing_kick:9
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:25
GT
POP:reTempVar0
PUSH:tilt
PUSH:-64
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:reTempVar0:kickcount
AP_SET:10:kickcheck:reTempVar0
SET:swing_kick:10
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:-18
LT
POP:reTempVar0
PUSH:tilt
PUSH:-64
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:reTempVar0:kickcount
AP_SET:11:kickcheck:reTempVar0
SET:swing_kick:11
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:18
GT
POP:reTempVar0
PUSH:tilt
PUSH:-64
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
SET:reTempVar0:kickcount
AP_SET:12:kickcheck:reTempVar0
SET:swing_kick:12
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:-5
LT
POP:reTempVar0
PUSH:pan
PUSH:-18
GE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:tilt
PUSH:-64
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:reTempVar0:kickcount
AP_SET:13:kickcheck:reTempVar0
SET:swing_kick:13
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:5
GT
POP:reTempVar0
PUSH:pan
PUSH:18
LE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:tilt
PUSH:-64
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:reTempVar0:kickcount
AP_SET:14:kickcheck:reTempVar0
SET:swing_kick:14
ADD:kickcount:1
ENDIF
PUSH:pan
PUSH:-5
GE
POP:reTempVar0
PUSH:pan
PUSH:5
LE
POP:reTempVar1
LAND:reTempVar0:reTempVar1
PUSH:tilt
PUSH:-60
LT
POP:reTempVar2
LAND:reTempVar0:reTempVar2
IF:reTempVar0:<>:0:THEN
SET:reTempVar0:kickcount
AP_SET:15:kickcheck:reTempVar0
SET:swing_kick:15
ADD:kickcount:1
ENDIF
IF:kickcount:==:1:THEN
RET:2004
ENDIF
IF:kickcount:>:0:THEN
SET:reTempVar0:kickcount
SUB:reTempVar0:1
RND:num:0:reTempVar0
AP_GET:reTempVar0:kickcheck:num
SET:swing_kick:reTempVar0
RET:2004
ENDIF
RET:2001
:G_SOCCER_PLAY_SWING
SET:init_wait:0
SWITCH:swing_kick
CASE:6:PLAY:ACTION+:kick_bellyflop_fwd
CASE:7:PLAY:ACTION+:kick_bellyflop_right
CASE:8:PLAY:ACTION+:kick_bellyflop_left
CASE:9:PLAY:ACTION+:aibostand_sidekick_right
CASE:10:PLAY:ACTION+:aibostand_sidekick_left
CASE:11:PLAY:ACTION+:aibostand_bigkick_right
CASE:12:PLAY:ACTION+:aibostand_bigkick_left
CASE:13:PLAY:ACTION:CONTACT.FRONT.HEADR
CASE:14:PLAY:ACTION:CONTACT.FRONT.HEADL
CASE:15:PLAY:ACTION:CONTACT.FRONT.HEAD
CASE:ELSE:RET:2001
SET:last_kick:swing_kick
SWITCH:swing_kick
CASE:7:SET:ballhint:2
CASE:8:SET:ballhint:1
CASE:9:SET:ballhint:2
CASE:10:SET:ballhint:1
CASE:11:SET:ballhint:2
CASE:12:SET:ballhint:1
CASE:13:SET:ballhint:2
CASE:14:SET:ballhint:1
RET:2005
:G_SOCCER_TOUCH_BALL
WAIT:1
IF:Pink_Ball:=:0:THEN
RET:2000
ENDIF
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
PUSH:tilt
PUSH:-60
LT
POP:reTempVar0
PUSH:tilt
PUSH:-70
GT
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
PUSH:Head_Pan
PUSH:15
GE
POP:reTempVar0
PUSH:Head_Pan
PUSH:30
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
PLAY:ACTION+:aibostand_touchball_left
GO:STB_LOOKATBALL
ENDIF
PUSH:Head_Pan
PUSH:-15
LE
POP:reTempVar0
PUSH:Head_Pan
PUSH:-30
GE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
PLAY:ACTION+:aibostand_touchball_right
GO:STB_LOOKATBALL
ENDIF
ENDIF
RET:2004
:STB_LOOKATBALL
WAIT
CALL:G_SOCCER_POSTURE
PLAY:ACTION:MOVE.HEAD.NORMAL:pan:tilt
WAIT
PLAY:ACTION:TRACK_HEAD:PINK_BALL
WAIT:1000
CALL:G_SOCCER_STOP_TRACK
GO:G_SOCCER_CLOSE_ENOUGH?
:G_SOCCER_INIT_KICK
WAIT:1
SET:pan:Head_Pan
CALL:F_HEAD_TILT
POP:reTempVar0
SET:tilt:reTempVar0
SET:rndbase:1800
SET:rndcount:2
AP_GET:reTempVar0:behavior:rndbase
IF:reTempVar0:!=:rndcount:THEN
CALL:G_BEHAVIOR_INIT
ADD:rndend:1
AP_SET:rndbase:behavior:rndend
ADD:rndend:1
AP_SET:rndbase:behavior:rndend
ADD:rndend:1
AP_SET:rndbase:behavior:rndend
ADD:rndend:1
AP_SET:rndbase:behavior:rndend
AP_SET:rndend:behavior:rndbase:1
ENDIF
RET:1
:G_SAVE_SOCCER
IF:soccer:<:1:THEN
SET:soccer:1
ENDIF
IF:soccer:>:100:THEN
SET:soccer:100
ENDIF
VSAVE:soccer
RET:1
:G_SOCCER_POSTURE
IF:Head_Tilt:>=:-10:THEN
CALL:F_HEAD_TILT
POP:reTempVar0
SET:sp_t:reTempVar0
SET:sp_p:Head_Pan
SET:sp_iw:Wait
IF:Posture1:==:4:THEN
PLAY:ACTION:MOVE.HEAD.NORMAL:sp_p:-70
:reTempLbl43
IF:Wait:>:sp_iw:THEN
WAIT:100
GO:reTempLbl43
ENDIF
IF:Head_Tilt:<:-10:THEN
PLAY:ACTION:MOVE.HEAD.NORMAL:sp_p:sp_t
:reTempLbl44
IF:Wait:>:sp_iw:THEN
WAIT:100
GO:reTempLbl44
ENDIF
RET:1
ENDIF
PLAY:ACTION:stand_straight
:reTempLbl45
IF:Wait:>:sp_iw:THEN
WAIT:100
GO:reTempLbl45
ENDIF
ENDIF
PLAY:ACTION:CHGPOS.WALK.NORMAL
:reTempLbl46
IF:Wait:>:sp_iw:THEN
WAIT:100
GO:reTempLbl46
ENDIF
PLAY:ACTION:MOVE.HEAD.NORMAL:sp_p:sp_t
:reTempLbl47
IF:Wait:>:sp_iw:THEN
WAIT:100
GO:reTempLbl47
ENDIF
ENDIF
RET:1
:G_TURN_AWAY
WAIT:1
SET:dir:-1
IF:Head_Pan:>:10:THEN
SET:dir:1
ENDIF
IF:Head_Pan:>=:-10:THEN
CALL:G_RANDOM2
CASE:1:SET:dir:1
CASE:2:SET:dir:-1
ENDIF
CALL:G_SOCCER_STOP_TRACK
RND:p:150:180
MUL:p:dir
WAIT:1
SET:init_wait:Wait
PLAY:ACTION:TURN:p
PLAY:ACTION:MOVE_HEAD:0:0
CALL:G_WAIT_AWARE
RET:1
:G_SKB_AIBOKICK
PUSH:pan
PUSH:0
GE
POP:reTempVar0
PUSH:pan
PUSH:20
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_RANDOM2
CASE:1:PLAY:ACTION:kick_center_left
CASE:2:PLAY:ACTION:kick_front_left
SET:ballhint:1
SET:last_kick:3
RET:1
ENDIF
IF:pan:>:20:THEN
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:kick_front2_left
CASE:2:PLAY:ACTION:kick_front3_left
CASE:3:PLAY:ACTION:kick_front4_left
SET:ballhint:1
SET:last_kick:3
RET:1
ENDIF
PUSH:pan
PUSH:-20
GE
POP:reTempVar0
PUSH:pan
PUSH:0
LE
POP:reTempVar1
IF:reTempVar0:&&:reTempVar1:THEN
CALL:G_RANDOM2
CASE:0:PLAY:ACTION:kick_center_right
CASE:1:PLAY:ACTION:kick_front_right
ELSE
CALL:G_RANDOM3
CASE:1:PLAY:ACTION:kick_front2_right
CASE:2:PLAY:ACTION:kick_front3_right
CASE:3:PLAY:ACTION:kick_front4_right
ENDIF
SET:ballhint:2
SET:last_kick:4
RET:1
:G_SOCCER_ATTENTION_HANDLER
LOCAL:lastpose:-999
LOCAL:lastx:-999
LOCAL:lasty:-999
IF:Pink_Ball:>:0:THEN
SET:lastpose:Posture1
SET:lastx:Head_Pan
CALL:F_HEAD_TILT
POP:reTempVar0
SET:lasty:reTempVar0
ENDIF
CALL:G_WALK_ATTENTION_HANDLER
IF:Context:!=:105:THEN
RET:Context
ENDIF
IF:Pink_Ball:>:0:THEN
RET:107
ENDIF
PUSH:lastx
PUSH:-999
GT
POP:reTempVar0
PUSH:lasty
PUSH:-999
GT
POP:reTempVar1
IF:reTempVar0:||:reTempVar1:THEN
IF:lastpose:==:4:CALL:G_SOCCER_POSTURE
SET:init_wait:Wait
PLAY:ACTION:MOVE.HEAD.NORMAL:lastx:lasty
CALL:G_WAIT
WAIT:200
IF:Pink_Ball:>:0:THEN
RET:107
ENDIF
ENDIF
RET:105
:F_HEAD_TILT
LOCAL:htilt:0
LOCAL:hfor
FOR:hfor:1:5
WAIT:64
ADD:htilt:Head_Tilt_2
ADD:htilt:Head_Tilt_2
ADD:htilt:Pink_Ball_V
NEXT
DIV:htilt:5
RETURN:htilt
