|
楼主 |
发表于 2020-5-7 17:16:54
|
显示全部楼层
ACT版
同样搜索
动作校验与验证
覆盖
function actorMove(){
speedRecovery();
//动作效验与修正
if(!_sf.actionLock && !_sf.skillChant){
if(isSquat && !isRSquat && !isJump){
var size = character.getValidSize(0);
var rect = character.getCharactersRect(character.x,character.y,size[0],size[1]);
if(Math.abs(character.isCanMoveUpDown(rect.left,rect.right,rect.top,true,rect)) <= 2){
isSquat = false;
character.resetValidSize();
}
}
if(isAtk){
if(isSquat){
character.setAction(8,false,true,true);
}else if(isJump && Math.abs( _sf.Speed[0]) >= _sf.GravityNum + 0.1){
character.setAction(7,false,true,true);
}else if(isMove){
character.setAction(11,false,true,true);
}else{
if(RV.NowSet.findArmsId(RV.GameData.actor.equips.arms).type == 1 && Coo.generalist_on){
character.setAction(generalist.action,false,true,true); //modify
}
character.setAction(6,false,true,true);
}
isAtk = false;
}else if(isSquat){//下蹲场合
waitJump();
if(jumpWait == 0){
jumpTimes = 0;
}
isJump = false;
character.setAction(5,true);
}else if(isJump && _sf.Speed[0] < 0){//起跳场合
character.setAction(1,false);
}else if(isJump && _sf.Speed[0] >= 0){//准备落地场合
isJump = false;
character.setAction(2,false);
}else if(!character.IsInSand && _sf.Speed[0] >= _sf.GravityNum + 0.1){//落地场合
character.setAction(2,false);
}else if(isRun && isMove){//跑动场合
waitJump();
isJump = false;
if(jumpWait == 0){
jumpTimes = 0;
}
character.setAction(4,false);
}else if(isMove){//行走场合
waitJump();
isJump = false;
if(jumpWait == 0){
jumpTimes = 0;
}
character.setAction(3,false);
}else{//站立场合
waitJump();
if(jumpWait == 0){
jumpTimes = 0;
}
isJump = false;
character.setAction(0,false);
}
}
if(_sf.IsGravity){
var tempSand = 0;
if(character.BlockBelow >= 2000){
tempSand = character.BlockBelow;
}else if(character.BlockContact >= 2000){
tempSand = character.BlockContact;
}
if(tempSand >= 3000) {
character.IsInSand = true;
character.SandNum = (tempSand - 3000) / 100;
}else if(tempSand >= 2000){
character.IsInSand = true;
character.SandNum = (tempSand - 2000) / 100;
}else{
character.IsInSand = false;
}
if(character.IsInSand){//如果角色在沙地中,则给一个较大的缓冲阻力
_sf.Speed[0] += character.SandNum;
if(_sf.Speed[0] > character.SandNum){
_sf.Speed[0] = character.SandNum;
}
}else{
_sf.Speed[0] += _sf.GravityNum;
}
}
character.resetPublicBlock();
character.y += _sf.Speed[0];
character.x += _sf.Speed[1];
moveWait += Math.abs(_sf.Speed[1]);
if(moveWait > 10){
moveWait = 0;
if(_sf.camp == 0){
RV.GameData.step += 1;
}
_sf.moveNum += 1;
}
if(RV.NowSet.setAll.ctrlUpDown == 1 && !_sf.IsGravity){
moveWaitUD += Math.abs(_sf.Speed[0]);
if(moveWaitUD > 10){
moveWaitUD = 0;
if(_sf.camp == 0){
RV.GameData.step += 1;
}
_sf.moveNum += 1;
}
}
//if(character.CannotMoveX && !isJumpBlock()){
// _sf.Speed[1] = 0;
//}
if(character.CannotMoveY && !isJumpBlock()){
_sf.Speed[0] = 0;
}
} |
|