📄 axemon.pas
字号:
if Death then begin
if Skeleton then
Result := pm.ActDeath.start
else Result := pm.ActDie.start + Dir * (pm.ActDie.frame + pm.ActDie.skip) + (pm.ActDie.frame - 1);
end else begin
defframecount := pm.ActStand.frame;
if currentdefframe < 0 then cf := 0
else if currentdefframe >= pm.ActStand.frame then cf := 0
else cf := currentdefframe;
Result := pm.ActStand.start + Dir * (pm.ActStand.frame + pm.ActStand.skip) + cf;
end;
end;
procedure TGasKuDeGi.LoadSurface;
begin
inherited LoadSurface;
case Race of
//阁胶磐
16:
begin
if BoUseEffect then
AttackEffectSurface := FrmMain.WMon3Img.GetCachedImage (
KUDEGIGASBASE-1 + (firedir * 10) + effectframe-effectstart, //啊胶绰 贸澜 茄橇饭澜 词霸 矫累窃.
ax, ay);
end;
20:
begin
if BoUseEffect then
AttackEffectSurface := FrmMain.WMon4Img.GetCachedImage (
COWMONFIREBASE + (firedir * 10) + effectframe-effectstart, //
ax, ay);
end;
21:
begin
if BoUseEffect then
AttackEffectSurface := FrmMain.WMon4Img.GetCachedImage (
COWMONLIGHTBASE + (firedir * 10) + effectframe-effectstart, //
ax, ay);
end;
40:
begin
if BoUseEffect then begin
AttackEffectSurface := FrmMain.WMon5Img.GetCachedImage (
ZOMBILIGHTINGBASE + (fire16dir * 10) + effectframe-effectstart, //
ax, ay);
end;
if BoUseDieEffect then begin
DieEffectSurface := FrmMain.WMon5Img.GetCachedImage (
ZOMBIDIEBASE + currentframe-startframe, //
bx, by);
end;
end;
52:
begin
if BoUseEffect then
AttackEffectSurface := FrmMain.WMon4Img.GetCachedImage (
MOTHPOISONGASBASE + (firedir * 10) + effectframe-effectstart, //
ax, ay);
end;
53:
begin
if BoUseEffect then
AttackEffectSurface := FrmMain.WMon3Img.GetCachedImage (
DUNGPOISONGASBASE + (firedir * 10) + effectframe-effectstart, //
ax, ay);
end;
end;
end;
procedure TGasKuDeGi.Run;
var
prv: integer;
effectframetimetime, frametimetime: longword;
begin
if (CurrentAction = SM_WALK) or (CurrentAction = SM_BACKSTEP) or (CurrentAction = SM_RUN) then exit;
msgmuch := FALSE;
if MsgList.Count >= 2 then msgmuch := TRUE;
//荤款靛 瓤苞
RunActSound (currentframe - startframe);
RunFrameAction (currentframe - startframe);
if BoUseEffect then begin
if msgmuch then effectframetimetime := Round(effectframetime * 2 / 3)
else effectframetimetime := effectframetime;
if GetTickCount - effectstarttime > effectframetimetime then begin
effectstarttime := GetTickCount;
if effectframe < effectend then begin
Inc (effectframe);
end else begin
BoUseEffect := FALSE;
end;
end;
end;
prv := currentframe;
if CurrentAction <> 0 then begin
if (currentframe < startframe) or (currentframe > endframe) then
currentframe := startframe;
if msgmuch then frametimetime := Round(frametime * 2 / 3)
else frametimetime := frametime;
if GetTickCount - starttime > frametimetime then begin
if currentframe < endframe then begin
Inc (currentframe);
starttime := GetTickCount;
end else begin
//悼累捞 场巢.
CurrentAction := 0; //悼累 肯丰
BoUseDieEffect := FALSE;
end;
end;
currentdefframe := 0;
defframetime := GetTickCount;
end else begin
if GetTickCount - smoothmovetime > 200 then begin
if GetTickCount - defframetime > 500 then begin
defframetime := GetTickCount;
Inc (currentdefframe);
if currentdefframe >= defframecount then
currentdefframe := 0;
end;
DefaultMotion;
end;
end;
if prv <> currentframe then begin
loadsurfacetime := GetTickCount;
LoadSurface;
end;
end;
procedure TGasKuDeGi.DrawChr (dsurface: TDirectDrawSurface; dx, dy: integer; blend: Boolean);
var
idx: integer;
d: TDirectDrawSurface;
ceff: TColorEffect;
begin
if not (Dir in [0..7]) then exit;
if GetTickCount - loadsurfacetime > 60 * 1000 then begin
loadsurfacetime := GetTickCount;
LoadSurface; //bodysurface殿捞 loadsurface甫 促矫 何福瘤 臼酒 皋葛府啊 橇府登绰 巴阑 阜澜
end;
ceff := GetDrawEffectValue;
if BodySurface <> nil then
DrawEffSurface (dsurface, BodySurface, dx + px + ShiftX, dy + py + ShiftY, blend, ceff);
end;
procedure TGasKuDeGi.DrawEff (dsurface: TDirectDrawSurface; dx, dy: integer);
var
idx: integer;
d: TDirectDrawSurface;
ceff: TColorEffect;
begin
if BoUseEffect then
if AttackEffectSurface <> nil then begin
DrawBlend (dsurface,
dx + ax + ShiftX,
dy + ay + ShiftY,
AttackEffectSurface, 1);
end;
if BoUseDieEffect then
if DieEffectSurface <> nil then begin
DrawBlend (dsurface,
dx + bx + ShiftX,
dy + by + ShiftY,
DieEffectSurface, 1);
end;
end;
{-----------------------------------------------------------}
function TFireCowFaceMon.Light: integer;
var
l: integer;
begin
l := ChrLight;
if l < 2 then begin
if BoUseEffect then
l := 2;
end;
Result := l;
end;
function TCowFaceKing.Light: integer;
var
l: integer;
begin
l := ChrLight;
if l < 2 then begin
if BoUseEffect then
l := 2;
end;
Result := l;
end;
{-----------------------------------------------------------}
//procedure TZombiLighting.Run;
{-----------------------------------------------------------}
procedure TSculptureMon.CalcActorFrame;
var
pm: PTMonsterAction;
haircount: integer;
begin
currentframe := -1;
BodyOffset := GetOffset (Appearance);
pm := RaceByPM (Race);
if pm = nil then exit;
BoUseEffect := FALSE;
case CurrentAction of
SM_TURN:
begin
if (State and STATE_STONE_MODE) <> 0 then begin
if (Race = 48) or (Race = 49) then
startframe := pm.ActDeath.start // + Dir * (pm.ActDeath.frame + pm.ActDeath.skip)
else
startframe := pm.ActDeath.start + Dir * (pm.ActDeath.frame + pm.ActDeath.skip);
endframe := startframe;
frametime := pm.ActDeath.ftime;
starttime := GetTickCount;
defframecount := pm.ActDeath.frame;
end else 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;
end;
Shift (Dir, 0, 0, 1);
end;
SM_WALK, 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;
//WarMode := FALSE;
movestep := 1;
if CurrentAction = SM_WALK then
Shift (Dir, movestep, 0, endframe-startframe+1)
else //sm_backstep
Shift (GetBack(Dir), movestep, 0, endframe-startframe+1);
end;
SM_DIGUP: //叭扁 绝澜, SM_DIGUP, 规氢 绝澜.
begin
if (Race = 48) or (Race = 49) then begin
startframe := pm.ActDeath.start;
end else begin
startframe := pm.ActDeath.start + Dir * (pm.ActDeath.frame + pm.ActDeath.skip);
end;
endframe := startframe + pm.ActDeath.frame - 1;
frametime := pm.ActDeath.ftime;
starttime := GetTickCount;
//WarMode := FALSE;
Shift (Dir, 0, 0, 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;
if Race = 49 then begin
BoUseEffect := TRUE;
firedir := Dir;
effectframe := 0; //startframe;
effectstart := 0; //startframe;
effectend := effectstart + 8;
effectstarttime := GetTickCount;
effectframetime := frametime;
end;
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;
end;
SM_DEATH:
begin
startframe := pm.ActDie.start + Dir * (pm.ActDie.frame + pm.ActDie.skip);
endframe := startframe + pm.ActDie.frame - 1;
startframe := endframe; //
frametime := pm.ActDie.ftime;
starttime := GetTickCount;
end;
SM_NOWDEATH:
begin
startframe := pm.ActDie.start + Dir * (pm.ActDie.frame + pm.ActDie.skip);
endframe := startframe + pm.ActDie.frame - 1;
frametime := pm.ActDie.ftime;
starttime := GetTickCount;
end;
end;
end;
procedure TSculptureMon.LoadSurface;
begin
inherited LoadSurface;
case Race of
48, 49:
begin
if BoUseEffect then
AttackEffectSurface := FrmMain.WMon7Img.GetCachedImage (
SCULPTUREFIREBASE + (firedir * 10) + effectframe-effectstart, //
ax, ay);
end;
end;
end;
function TSculptureMon.GetDefaultFrame (wmode: Boolean): integer;
var
cf, dr: integer;
pm: PTMonsterAction;
begin
pm := RaceByPM (Race);
if pm = nil then exit;
if Death then begin
Result := pm.ActDie.start + Dir * (pm.ActDie.frame + pm.ActDie.skip) + (pm.ActDie.frame - 1);
end else begin
if (State and STATE_STONE_MODE) <> 0 then begin
case Race of
47: Result := pm.ActDeath.start + Dir * (pm.ActDeath.frame + pm.ActDeath.skip);
48, 49: Result := pm.ActDeath.start;
end;
end else begin
defframecount := pm.ActStand.frame;
if currentdefframe < 0 then cf := 0
else if currentdefframe >= pm.ActStand.frame then cf := 0
else cf := currentdefframe;
Result := pm.ActStand.start + Dir * (pm.ActStand.frame + pm.ActStand.skip) + cf;
end;
end;
end;
procedure TSculptureMon.DrawEff (dsurface: TDirectDrawSurface; dx, dy: integer);
var
idx: integer;
d: TDirectDrawSurface;
ceff: TColorEffect;
begin
if BoUseEffect then
if AttackEffectSurface <> nil then begin
DrawBlend (dsurface,
dx + ax + ShiftX,
dy + ay + ShiftY,
AttackEffectSurface, 1);
end;
end;
procedure TSculptureMon.Run;
var
effectframetimetime, frametimetime: longword;
begin
if (CurrentAction = SM_WALK) or (CurrentAction = SM_BACKSTEP) or (CurrentAction = SM_RUN) then exit;
if BoUseEffect then begin
effectframetimetime := effectframetime;
if GetTickCount - effectstarttime > effectframetimetime then begin
effectstarttime := GetTickCount;
if effectframe < effectend then begin
Inc (effectframe);
end else begin
BoUseEffect := FALSE;
end;
end;
end;
inherited Run;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -