没啥好说的。。持续更新(也许),争取有一天不用手写cleo(其实已经不写了..)这是一种美好(或许?)的期望。
我试着让Kimi写了一个蓄力跳跃,还行,一遍过。
代码: {$CLEO .cs} 0000: repeat wait 0 until 0256: 0
// ========== 变量声明 ==========
var
0@:float // 蓄力值 0.0~1.0
1@:float // 玩家X
2@:float // 玩家Y
3@:float // 玩家Z
4@:float // 地面Z
5@:int // 状态 0=待机 1=蓄力中 2=跳跃后冷却
6@:float // 显示用百分比
7@:int // 指针临时
8@:float // 跳跃速度
9@:float // 蓄力增量
10@:float // 最大跳跃速度
11@:float // 临时计算
12@:float // 高度差
13@:int // 冷却计数
end
9@ = 0.015 // 每帧蓄力 10@ = 1.2 // 最大附加速度
03F0: enable_text_draw 1
// ========== 主循环 ========== :main wait 0
// 获取位置 0054: store_player $PLAYER_CHAR position_to 1@ 2@ 3@ 02CE: 4@ = ground_z 1@ 2@ 3@
// 计算高度差(判断是否落地) 12@ = 3@ 12@ -= 4@
// ========== 显示蓄力条 ========== if 5@ == 1 then 6@ = 0@ 6@ *= 100.0 0609: show_formatted_text_position 320.0 380.0 text "CHARGE: %.0f%%" 6@ 0609: show_formatted_text_position 320.0 395.0 text "================" 0@ end
if 5@ == 2 then 0609: show_formatted_text_position 320.0 380.0 text "JUMP!" 0@ end
// ========== 状态0: 待机,检测开始蓄力 ========== if 5@ == 0 then if 05EE: key_pressed 32 // Space then // 进入蓄力 5@ = 1 0@ = 0.0 // 防连发:等松开再检测(但蓄力需要按住,所以这里直接开始) end jump @main end
// ========== 状态1: 蓄力中 ========== if 5@ == 1 then // 检测是否还按着 if 05EE: key_pressed 32 then // 继续蓄力 0@ += 9@ if 0@ > 1.0 then 0@ = 1.0 end jump @main end
// 松开了,执行跳跃
8@ = 0.4 // 基础速度
11@ = 0@
11@ *= 10@ // 蓄力加成
8@ += 11@
// 写入Z轴速度 (CPed + 0x78)
0A96: 7@ = ped $PLAYER_ACTOR struct
7@ += 0x78
0A8C: write_memory 7@ size 4 value 8@ virtual_protect 0
5@ = 2
13@ = 0
jump @main
end
// ========== 状态2: 跳跃后冷却 ========== if 5@ == 2 then // 落地检测 if 12@ < 0.8 then 5@ = 0 0@ = 0.0 jump @main end
// 时间冷却(防连跳)
13@ += 1
if
13@ > 20
then
// 检测空格是否松开,松开了才能准备下一次
if
05EE: key_pressed 32
then
// 还按着,继续等
jump @main
end
// 松开了,可以准备下一次
5@ = 0
0@ = 0.0
end
jump @main
end
jump @main










