|
|
procedure TFrmMain.AttackTarget (target: TActor);
var
tdir, dx, dy, hitmsg: integer;
begin
hitmsg := CM_HIT;
if UseItems[U_WEAPON].S.StdMode = 6 then hitmsg := CM_HEAVYHIT;
tdir := GetNextDirection (Myself.XX, Myself.YY, target.XX, target.YY);
if (abs(Myself.XX-target.XX) <= 1) and (abs(Myself.YY-target.YY) <= 1) and (not target.Death) then begin
if CanNextAction and ServerAcceptNextAction and CanNextHit then begin
if BoNextTimeFireHit and (Myself.Abil.MP >= 7) then begin
BoNextTimeFireHit := FALSE;
hitmsg := CM_FIREHIT;
end else
if BoNextTimePowerHit then begin //颇况 酒咆牢 版快, 抗档八过
BoNextTimePowerHit := FALSE;
hitmsg := CM_POWERHIT;
end else
if BoCanWideHit and (Myself.Abil.MP >= 3) then begin //and (TargetInSwordWideAttackRange (tdir)) then begin //氛 酒咆牢 版快, 馆岿八过
hitmsg := CM_WIDEHIT;
end else
if BoCanLongHit and (TargetInSwordLongAttackRange (tdir)) then begin //氛 酒咆牢 版快, 绢八贱
hitmsg := CM_LONGHIT;
end;
//if ((target.Race <> 0) and (target.Race <> RCC_GUARD)) or (ssShift in Shift) then //荤恩阑 角荐肺 傍拜窍绰 巴阑 阜澜
Myself.SendMsg (hitmsg, Myself.XX, Myself.YY, tdir, 0, 0, '', 0);
LatestHitTime := GetTickCount;
end;
LastAttackTime := GetTickCount;
end else begin
//厚档甫 甸绊 乐栏搁
//if (UseItems[U_WEAPON].S.Shape = 6) and (target <> nil) then begin
// Myself.SendMsg (CM_THROW, Myself.XX, Myself.YY, tdir, integer(target), 0, '', 0);
// TargetCret := nil; //茄锅父 傍拜
//end else begin
ChrAction := caWalk;
GetBackPosition (target.XX, target.YY, tdir, dx, dy);
TargetX := dx;
TargetY := dy;
//end;
end;
end;
如果我用StdMode=6的武器打怪时,只有偶尔会出现HEAVYHIT效果,大多数情况是Walk的效果。我把这句
if UseItems[U_WEAPON].S.StdMode = 6 then hitmsg := CM_HEAVYHIT;
注释掉以后,能正常出现HIT效果了,可我总是不甘心,那位朋友给指点一下呀,谢谢! |
|