Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$CLEO}
- const
- // variables
- currentAnimID = 0@ // int
- modelClump = 1@ // RpClump*
- FUNC_blendAnimation = 2@ // int
- gameVersion = 3@
- timer = 16@
- // constants
- KEY_SWITCH = 77
- KEY_LEFT = 188
- KEY_RIGHT = 190
- KEY_APPLYANIM = 191
- KEY_RESET = 16
- TIME_FOR_SWITCH = 120
- ANIM_RATE = 8.0
- end
- goto @begin
- :drawNumber
- 03F0: enable_text_draw 1
- 01E3: text_1number_styled 'NUMBER' currentAnimID 70 ms 3
- return
- :applyCurrentAnimToPlayer
- 05E6: modelClump = actor $3 struct
- modelClump += 0x4C
- 05E0: modelClump = read_memory modelClump size 4 virtual_protect 1
- 05E5: gameVersion = game_version
- if
- gameVersion == 0
- then
- FUNC_blendAnimation = 0x403710
- else
- FUNC_blendAnimation = 0x403710
- end
- 05E1: call 0x403710 num_params 4 pop 4 8.0 currentAnimID 0 modelClump
- return
- :begin
- currentAnimID = 0
- while true
- wait 0
- if
- 0256: player 0 defined
- then
- if
- 05EE: key_pressed KEY_SWITCH
- then
- while 05EE: key_pressed KEY_SWITCH
- wait 0
- if
- 8256: not player 0 defined
- then
- goto @begin
- end
- end
- // here we go
- while true
- wait 0
- gosub @drawNumber
- if
- 8256: not player 0 defined
- then
- goto @begin
- end
- if
- 05EE: key_pressed KEY_SWITCH
- then
- while 05EE: key_pressed KEY_SWITCH
- wait 0
- end
- goto @begin
- end
- if
- 05EE: key_pressed KEY_LEFT
- then
- timer = 0
- while 05EE: key_pressed KEY_LEFT
- wait 0
- gosub @drawNumber
- if
- 8256: not player 0 defined
- then
- goto @begin
- end
- if
- timer > TIME_FOR_SWITCH
- then
- break
- end
- end
- if
- currentAnimID > 0
- then
- currentAnimID -= 1
- end
- else if
- 05EE: key_pressed KEY_RIGHT
- then
- while 05EE: key_pressed KEY_RIGHT
- wait 0
- gosub @drawNumber
- if
- 8256: not player 0 defined
- then
- goto @begin
- end
- if
- timer > TIME_FOR_SWITCH
- then
- break
- end
- end
- currentAnimID += 1
- end
- end
- if
- 05EE: key_pressed KEY_RESET
- then
- while 05EE: key_pressed KEY_RESET
- wait 0
- gosub @drawNumber
- if
- 8256: not player 0 defined
- then
- goto @begin
- end
- end
- currentAnimID = 0
- gosub @applyCurrentAnimToPlayer
- end
- if
- 05EE: key_pressed KEY_APPLYANIM
- then
- while 05EE: key_pressed KEY_APPLYANIM
- wait 0
- gosub @drawNumber
- if
- 8256: not player 0 defined
- then
- goto @begin
- end
- end
- gosub @applyCurrentAnimToPlayer
- end
- end
- end
- else
- goto @begin
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement