📄 actor.pas
字号:
var
nrace, npos: Integer;
begin
Result := 0;
nrace := appr div 10;
npos := appr mod 10;
case nrace of
0:
begin
Result := npos * 280;
end;
1: Result := npos * 230;
2, 3, 7..12, 14..16, 30, 33..37: Result := npos * 360; //
// 33:Result:=0;
4:
begin
Result := npos * 360; //
if npos = 1 then
Result := 600; //
end;
5: Result := npos * 430; //
6: Result := npos * 440; //
17: Result := npos * 350; //
18: case npos of
0: Result := 0;
1: Result := 520;
2: Result := 950;
end;
13:
case npos of
0: Result := 0;
1: Result := 360;
2: Result := 440;
3: Result := 550;
end;
31:
case npos of
0: Result := 0;
1: Result := 460;
2: Result := 820;
3: Result := 1180;
4: Result := 1540;
5: Result := 1900;
6: Result := 2257;
7: Result := 2700;
end;
32:
case npos of
0: Result := 0;
1: Result := 430;
2: Result := 1290;
3: Result := 1810;
end;
19: case npos of
0: Result := 0;
1: Result := 370;
2: Result := 810;
3: Result := 1250;
4: Result := 1630;
5: Result := 2010;
6: Result := 2390;
end;
20:
begin
Result := npos * 360;
case npos of
6: Result := 2350;
7: Result := 3060;
end;
end;
90: case npos of
0: Result := 80; //己巩
1: Result := 168;
2: Result := 184;
3: Result := 200;
end;
end;
end;
}
function GetOffset(appr: Integer): Integer;
var
nrace, npos: Integer;
begin
Result := 0;
nrace := appr div 10;
npos := appr mod 10;
Result := npos * 360;
case nrace of
0:
begin
Result := npos * 280;
end;
1:
Begin
Result := npos * 230;
End;
2, 3, 7..12, 14..16, 23..37: Result := npos * 360; //
4:
begin
Result := npos * 360; //
if npos = 1 then
Result := 600; //
end;
5:
Begin
// if npos<4 then
Result := npos * 430; //
End;
6:
Begin
// if npos<5 then
Result := npos * 440; //
End;
17: Result := npos * 350; //
18:
case npos of
0: Result := 0;
1: Result := 520;
2: Result := 950;
3: Result := 1574;
4: Result := 1934;
5: Result := 2294;
6: Result := 2654;
7: Result := 3014;
end;
19: case npos of
0: Result := 0;
1: Result := 370;
2: Result := 810;
3: Result := 1250;
4: Result := 1630;
5: Result := 2010;
6: Result := 2390;
end;
20:
begin
Result := npos * 360;
case npos of
4: Result := 1440;
5: Result := 1800;
6: Result := 2350;
7: Result := 3060;
end;
end;
21:
case npos of
0: Result := 0;
1: Result := 350;
2: Result := 460;
3: Result := 820;
4: Result := 1180;
5: Result := 1540;
6: Result := 1900;
7: Result := 2440;
9: Result := 2700;
end;
22:
case npos of
0: Result := 0;
1: Result := 430;
2: Result := 1290;
3: Result := 1810;
end;
13:
case npos of
0: Result := 0;
1: Result := 360;
2: Result := 440;
3: Result := 550;
end;
90: case npos of
0: Result := 80; //己巩
1: Result := 168;
2: Result := 184;
3: Result := 200;
end;
end;
end;
constructor TActor.Create;
begin
inherited Create;
MsgList := TList.Create;
RecogId := 0;
BodySurface := nil;
Fillchar(Abil, SizeOf(TAbility), 0);
gold := 0;
Visible := True;
BoHoldPlace := True;
//泅犁 柳青吝牢 悼累, 辆丰夌绢档 啊瘤绊 乐澜
//悼累狼 currentframe捞 endframe阑 逞菌栏搁 悼累捞 肯丰等巴栏肺 航
CurrentAction := 0;
ReverseFrame := False;
ShiftX := 0;
ShiftY := 0;
DownDrawLevel := 0;
currentframe := -1;
EFFECTFRAME := -1;
RealActionMsg.ident := 0;
UserName := '';
NameColor := clWhite;
SendQueryUserNameTime := 0; //GetTickCount;
WarMode := False;
WarModeTime := 0; //War mode肺 函版等 矫痢狼 矫埃
Death := False;
Skeleton := False;
BoDelActor := False;
BoDelActionAfterFinished := False;
ChrLight := 0;
MagLight := 0;
LockEndFrame := False;
smoothmovetime := 0; //GetTickCount;
genanicounttime := 0;
defframetime := 0;
loadsurfacetime := GetTickCount;
Grouped := False;
BoOpenHealth := False;
BoInstanceOpenHealth := False;
CurMagic.ServerMagicCode := 0;
//CurMagic.MagicSerial := 0;
SpellFrame := DEFSPELLFRAME;
normalsound := -1;
footstepsound := -1; //绝澜 //林牢傍牢版快, CM_WALK, CM_RUN
attacksound := -1;
weaponsound := -1;
strucksound := s_struck_body_longstick; //嘎阑锭 唱绰 家府 SM_STRUCK
struckweaponsound := -1;
screamsound := -1;
diesound := -1; //绝澜 //磷阑锭 唱绰 家府 SM_DEATHNOW
die2sound := -1;
end;
destructor TActor.Destroy;
begin
MsgList.Free;
inherited Destroy;
end;
procedure TActor.SendMsg(ident: Word; X, Y, cdir, Feature, State: Integer; Str:
string; Sound: Integer);
var
pmsg: PTChrMsg;
begin
New(pmsg);
pmsg.ident := ident;
pmsg.X := X;
pmsg.Y := Y;
pmsg.Dir := cdir;
pmsg.Feature := Feature;
pmsg.State := State;
pmsg.saying := Str;
pmsg.Sound := Sound;
MsgList.Add(pmsg);
end;
procedure TActor.UpdateMsg(ident: Word; X, Y, cdir, Feature, State: Integer;
Str: string; Sound: Integer);
var
i, n: Integer;
begin
if Self = MySelf then
begin
n := 0;
while True do
begin
if n >= MsgList.Count then
Break;
if (PTChrMsg(MsgList[n]).ident >= 3000) and //努扼捞攫飘俊辑 焊辰 皋技瘤绰
(PTChrMsg(MsgList[n]).ident <= 3099) or //公矫秦档 等促.
(PTChrMsg(MsgList[n]).ident = ident) //鞍篮扒 公矫
then
begin
Dispose(PTChrMsg(MsgList[n]));
MsgList.Delete(n);
end
else
Inc(n);
end;
SendMsg(ident, X, Y, cdir, Feature, State, Str, Sound);
end
else
begin
//if not ((ident = SM_STRUCK) and (MsgList.Count >= 2)) then //嘎绰 悼累 积帆
if MsgList.Count > 0 then
begin
for i := 0 to MsgList.Count - 1 do
begin
if PTChrMsg(MsgList[i]).ident = ident then
begin
Dispose(PTChrMsg(MsgList[i]));
MsgList.Delete(i);
Break;
end;
end;
end;
SendMsg(ident, X, Y, cdir, Feature, State, Str, Sound);
end;
end;
procedure TActor.CleanUserMsgs;
var
n: Integer;
begin
n := 0;
while True do
begin
if n >= MsgList.Count then
Break;
if (PTChrMsg(MsgList[n]).ident >= 3000) and //努扼捞攫飘俊辑 焊辰 皋技瘤绰
(PTChrMsg(MsgList[n]).ident <= 3099) //公矫秦档 等促.
then
begin
Dispose(PTChrMsg(MsgList[n]));
MsgList.Delete(n);
end
else
Inc(n);
end;
end;
procedure TActor.CalcActorFrame;
var
pm: PTMonsterAction;
begin
BoUseMagic := False;
currentframe := -1;
BodyOffset := GetOffset(Appearance);
pm := RaceByPM(Race);
if pm = nil then
Exit;
case CurrentAction of
SM_TURN:
begin
startframe := pm.ActStand.start + Dir * (pm.ActStand.frame +
pm.ActStand.skip);
endframe := startframe + pm.ActStand.frame - 1;
frametime := pm.ActStand.ftime;
starttime := GetTickCount;
defframecount := pm.ActStand.frame;
Shift(Dir, 0, 0, 1);
end;
SM_WALK, SM_RUSH, SM_RUSHKUNG, SM_BACKSTEP:
begin
startframe := pm.ActWalk.start + Dir * (pm.ActWalk.frame +
pm.ActWalk.skip);
endframe := startframe + pm.ActWalk.frame - 1;
frametime := pm.ActWalk.ftime;
starttime := GetTickCount;
maxtick := pm.ActWalk.usetick;
curtick := 0;
movestep := 1;
if CurrentAction = SM_BACKSTEP then
Shift(GetBack(Dir), movestep, 0, endframe - startframe + 1)
else
Shift(Dir, movestep, 0, endframe - startframe + 1);
end;
{SM_BACKSTEP:
begin
startframe := pm.ActWalk.start + (pm.ActWalk.frame - 1) + Dir * (pm.ActWalk.frame + pm.ActWalk.skip);
endframe := startframe - (pm.ActWalk.frame - 1);
frametime := pm.ActWalk.ftime;
starttime := GetTickCount;
maxtick := pm.ActWalk.UseTick;
curtick := 0;
movestep := 1;
Shift (GetBack(Dir), movestep, 0, endframe-startframe+1);
end;}
SM_HIT:
begin
startframe := pm.ActAttack.start + Dir * (pm.ActAttack.frame +
pm.ActAttack.skip);
endframe := startframe + pm.ActAttack.frame - 1;
frametime := pm.ActAttack.ftime;
starttime := GetTickCount;
//WarMode := TRUE;
WarModeTime := GetTickCount;
Shift(Dir, 0, 0, 1);
end;
SM_STRUCK:
begin
startframe := pm.ActStruck.start + Dir * (pm.ActStruck.frame +
pm.ActStruck.skip);
endframe := startframe + pm.ActStruck.frame - 1;
frametime := struckframetime; //pm.ActStruck.ftime;
starttime := GetTickCount;
Shift(Dir, 0, 0, 1);
end;
SM_DEATH:
begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -