?? herbactor.pas
字號(hào):
haircount: integer;
begin
m_boUseEffect := FALSE;
m_nCurrentFrame := -1;
m_nBodyOffset := GetOffset (m_wAppearance);
pm := GetRaceByPM (m_btRace,m_wAppearance);
if pm = nil then exit;
m_sUserName := ' ';
case m_nCurrentAction of
SM_NOWDEATH:
begin
m_nStartFrame := pm.ActDie.start;
m_nEndFrame := m_nStartFrame + pm.ActDie.frame - 1;
m_dwFrameTime := pm.ActDie.ftime;
m_dwStartTime := GetTickCount;
Shift (m_btDir, 0, 0, 1);
m_boUseEffect := TRUE;
ApplyDoorState (dsBroken); //框流老 薦 樂(lè)霸
end;
SM_STRUCK:
begin
m_nStartFrame := pm.ActStruck.start + m_btDir * (pm.ActStruck.frame + pm.ActStruck.skip);
m_nEndFrame := m_nStartFrame + pm.ActStruck.frame - 1;
m_dwFrameTime := pm.ActStand.ftime;
m_dwStartTime := GetTickCount;
Shift (m_btDir, 0, 0, 1);
end;
SM_DIGUP: //鞏 凱覆
begin
m_nStartFrame := pm.ActAttack.start;
m_nEndFrame := m_nStartFrame + pm.ActAttack.frame - 1;
m_dwFrameTime := pm.ActAttack.ftime;
m_dwStartTime := GetTickCount;
ApplyDoorState (dsOpen); //框流老 薦 樂(lè)霸
end;
SM_DIGDOWN: //鞏 摧塞
begin
m_nStartFrame := pm.ActCritical.start;
m_nEndFrame := m_nStartFrame + pm.ActCritical.frame - 1;
m_dwFrameTime := pm.ActCritical.ftime;
m_dwStartTime := GetTickCount;
BoDoorOpen := FALSE;
m_boHoldPlace := TRUE;
ApplyDoorState (dsClose); //給框流烙
end;
SM_DEATH:
begin
m_nStartFrame := pm.ActDie.start + pm.ActDie.frame - 1;
m_nEndFrame := m_nStartFrame;
m_nDefFrameCount := 0;
ApplyDoorState (dsBroken); //框流老 薦 樂(lè)霸
end;
else //規(guī)氫撈 絕瀾...
begin
if m_btDir < 3 then begin
m_nStartFrame := pm.ActStand.start + m_btDir * (pm.ActStand.frame + pm.ActStand.skip);
m_nEndFrame := m_nStartFrame; // + pm.ActStand.frame - 1;
m_dwFrameTime := pm.ActStand.ftime;
m_dwStartTime := GetTickCount;
m_nDefFrameCount := 0; //pm.ActStand.frame;
Shift (m_btDir, 0, 0, 1);
BoDoorOpen := FALSE;
m_boHoldPlace := TRUE;
ApplyDoorState (dsClose); //給框流撈霸
end else begin
m_nStartFrame := pm.ActCritical.start; //凱妨樂(lè)綽 惑怕
m_nEndFrame := m_nStartFrame;
m_nDefFrameCount := 0;
BoDoorOpen := TRUE;
m_boHoldPlace := FALSE;
ApplyDoorState (dsOpen); //吧闌 薦 樂(lè)瀾
end;
end;
end;
end;
function TCastleDoor.GetDefaultFrame (wmode: Boolean): integer;
var
pm: PTMonsterAction;
begin
Result:=0;//jacky
m_nBodyOffset := GetOffset (m_wAppearance);
pm := GetRaceByPM (m_btRace,m_wAppearance);
if pm = nil then exit;
if m_boDeath then begin
Result := pm.ActDie.start + pm.ActDie.frame - 1;
m_nDownDrawLevel := 2;
end else begin
if BoDoorOpen then begin
m_nDownDrawLevel := 2;
Result := pm.ActCritical.start; // + Dir * (pm.ActStand.frame + pm.ActStand.skip);
end else begin
m_nDownDrawLevel := 1;
Result := pm.ActStand.start + m_btDir * (pm.ActStand.frame + pm.ActStand.skip);
end;
end;
end;
procedure TCastleDoor.ActionEnded;
begin
if m_nCurrentAction = SM_DIGUP then begin //鞏凱覆
BoDoorOpen := TRUE;
m_boHoldPlace := FALSE;
end;
// if CurrentAction = SM_DIGDOWN then
// DefaultMotion;
end;
procedure TCastleDoor.Run;
begin
if (Map.m_nCurUnitX <> oldunitx) or (Map.m_nCurUnitY <> oldunity) then begin
if m_boDeath then ApplyDoorState (dsBroken)
else if BoDoorOpen then ApplyDoorState (dsOpen)
else ApplyDoorState (dsClose);
end;
oldunitx := Map.m_nCurUnitX;
oldunity := Map.m_nCurUnitY;
inherited Run;
end;
procedure TCastleDoor.DrawChr (dsurface: TDirectDrawSurface; dx, dy: integer; blend: Boolean;boFlag:Boolean);
begin
inherited DrawChr (dsurface, dx, dy, blend,False);
if m_boUseEffect and not blend then
if EffectSurface <> nil then begin
DrawBlend (dsurface,
dx + ax + m_nShiftX,
dy + ay + m_nShiftY,
EffectSurface, 1);
end;
end;
{----------------------------------------------------------------------}
//己寒
constructor TWallStructure.Create;
begin
inherited Create;
m_btDir := 0;
EffectSurface := nil;
BrokenSurface := nil;
bomarkpos := FALSE;
//DownDrawLevel := 1;
end;
var
pm: PTMonsterAction;
haircount: integer;
begin
m_boUseEffect := FALSE;
m_nCurrentFrame := -1;
m_nBodyOffset := GetOffset (m_wAppearance);
pm := GetRaceByPM (m_btRace,m_wAppearance);
if pm = nil then exit;
m_sUserName := ' ';
deathframe := 0;
m_boUseEffect := FALSE;
case m_nCurrentAction of
SM_NOWDEATH:
begin
m_nStartFrame := pm.ActDie.start;
m_nEndFrame := m_nStartFrame + pm.ActDie.frame - 1;
m_dwFrameTime := pm.ActDie.ftime;
m_dwStartTime := GetTickCount;
deathframe := pm.ActStand.start + m_btDir;
Shift (m_btDir, 0, 0, 1);
m_boUseEffect := TRUE;
end;
SM_DEATH:
begin
m_nStartFrame := pm.ActDie.start + pm.ActDie.frame - 1;
m_nEndFrame := m_nStartFrame;
m_nDefFrameCount := 0;
end;
SM_DIGUP: //葛嚼撈 函版瞪錠 付促
begin
m_nStartFrame := pm.ActDie.start;
m_nEndFrame := m_nStartFrame + pm.ActDie.frame - 1;
m_dwFrameTime := pm.ActDie.ftime;
m_dwStartTime := GetTickCount;
deathframe := pm.ActStand.start + m_btDir;
m_boUseEffect := TRUE;
end;
else //規(guī)氫撈 絕瀾...
begin
m_nStartFrame := pm.ActStand.start + m_btDir; // * (pm.ActStand.frame + pm.ActStand.skip);
m_nEndFrame := m_nStartFrame; // + pm.ActStand.frame - 1;
m_dwFrameTime := pm.ActStand.ftime;
m_dwStartTime := GetTickCount;
m_nDefFrameCount := 0; //pm.ActStand.frame;
Shift (m_btDir, 0, 0, 1);
m_boHoldPlace := TRUE;
end;
end;
end;
procedure TWallStructure.LoadSurface;
var
mimg: TWMImages;
begin
mimg := GetMonImg (m_wAppearance);
if deathframe > 0 then begin //(CurrentAction = SM_NOWDEATH) or (CurrentAction = SM_DEATH) then begin
m_BodySurface := mimg.GetCachedImage (GetOffset (m_wAppearance) + deathframe, m_nPx, m_nPy);
end else begin
inherited LoadSurface;
end;
BrokenSurface := mimg.GetCachedImage (GetOffset (m_wAppearance) + 8 + m_btDir, bx, by);
if m_boUseEffect then begin
if m_wAppearance = 901 then
EffectSurface := mimg.GetCachedImage (WALLLEFTBROKENEFFECTBASE + (m_nCurrentFrame - m_nStartFrame), ax, ay)
else
EffectSurface := mimg.GetCachedImage (WALLRIGHTBROKENEFFECTBASE + (m_nCurrentFrame - m_nStartFrame), ax, ay);
end;
end;
function TWallStructure.GetDefaultFrame (wmode: Boolean): integer;
var
pm: PTMonsterAction;
begin
Result:=0;//jacky
m_nBodyOffset := GetOffset (m_wAppearance);
pm := GetRaceByPM (m_btRace,m_wAppearance);
if pm = nil then exit;
Result := pm.ActStand.start + m_btDir; // * (pm.ActStand.frame + pm.ActStand.skip);
end;
procedure TWallStructure.DrawChr (dsurface: TDirectDrawSurface; dx, dy: integer; blend: Boolean;boFlag:Boolean);
begin
inherited DrawChr (dsurface, dx, dy, blend,boFlag);
if (BrokenSurface <> nil) and (not blend) then begin
dsurface.Draw (dx + bx + m_nShiftX,
dy + by + m_nShiftY,
BrokenSurface.ClientRect,
BrokenSurface, TRUE);
end;
if m_boUseEffect and (not blend) then begin
if EffectSurface <> nil then begin
DrawBlend (dsurface,
dx + ax + m_nShiftX,
dy + ay + m_nShiftY,
EffectSurface, 1);
end;
end;
end;
procedure TWallStructure.Run;
begin
if m_boDeath then begin
if bomarkpos then begin
Map.MarkCanWalk (m_nCurrX, m_nCurrY, TRUE);
bomarkpos := FALSE;
end;
end else begin
if not bomarkpos then begin
Map.MarkCanWalk (m_nCurrX, m_nCurrY, FALSE);
bomarkpos := TRUE;
end;
end;
PlayScene.SetActorDrawLevel (self, 0);
inherited Run;
end;
{ TMineMon }
procedure TMineMon.CalcActorFrame;
begin
inherited;
end;
constructor TMineMon.Create;
begin
inherited;
end;
procedure TCentipedeKingMon.DrawEff(dsurface: TDirectDrawSurface; dx,
dy: integer);
var
idx: integer;
d: TDirectDrawSurface;
ceff: TColorEffect;
begin
if m_boUseEffect then
if AttackEffectSurface <> nil then
DrawBlend (dsurface,dx + ax + m_nShiftX,dy + ay + m_nShiftY,AttackEffectSurface, 1);
end;
procedure TCentipedeKingMon.LoadEffect;
begin
if m_boUseEffect then
AttackEffectSurface := FrmMain.WMon15Img.GetCachedImage (
100 + m_nEffectFrame-m_nEffectStart, //啊膠綽 貿(mào)瀾 茄橇飯瀾 詞霸 矯累竊.
ax, ay);
end;
procedure TCentipedeKingMon.LoadSurface;
begin
inherited LoadSurface;
LoadEffect();
end;
function TMineMon.GetDefaultFrame(wmode: Boolean): integer;
begin
end;
{ TBigHeartMon }
procedure TBigHeartMon.CalcActorFrame;
begin
m_btDir:=0;
inherited CalcActorFrame;
end;
{ TSpiderHouseMon }
procedure TSpiderHouseMon.CalcActorFrame;
begin
m_btDir:=0;
inherited CalcActorFrame;
end;
procedure TCentipedeKingMon.Run;
begin
if (m_nCurrentAction = SM_WALK) or
(m_nCurrentAction = SM_BACKSTEP) or
(m_nCurrentAction = SM_HORSERUN) or
(m_nCurrentAction = SM_RUN)
then exit;
if BoUseDieEffect then begin
if (m_nCurrentFrame - m_nStartFrame) >= 5 then begin
BoUseDieEffect:=False;
m_boUseEffect:=True;
m_dwEffectStartTime:=GetTickCount();
m_nEffectFrame:=0;
LoadEffect();
end;
end;
if m_boUseEffect then begin
if (GetTickCount - m_dwEffectStartTime) > m_dwEffectFrameTime then begin
m_dwEffectStartTime:=GetTickCount();
if m_nEffectFrame < m_nEffectEnd then begin
Inc(m_nEffectFrame);
LoadEffect();
end else m_boUseEffect:=False;
end;
end;
inherited;
end;
{ TDragonBody }
procedure TDragonBody.CalcActorFrame;
var
pm: PTMonsterAction;
begin
m_btDir:=0;
m_boUseMagic:=False;
m_nCurrentFrame:= -1;
m_nBodyOffset := GetOffset(m_wAppearance);
pm := GetRaceByPM (m_btRace,m_wAppearance);
if pm = nil then exit;
if m_nCurrentAction = SM_DIGUP then begin
m_nMaxTick:=pm.ActWalk.ftime;
m_nCurTick:=0;
m_nMoveStep:=1;
Shift (m_btDir, 0, 0, 1);
end;
m_nStartFrame:=0;
m_nEndFrame:=1;
m_dwFrameTime:=400;
m_dwStartTime:=GetTickCount();
end;
procedure TDragonBody.DrawEff(dsurface: TDirectDrawSurface; dx,
dy: integer);
//0x0046C3C0
begin
if not (m_btDir in [0..7]) then exit;
if GetTickCount - m_dwLoadSurfaceTime > 60 * 1000 then begin
m_dwLoadSurfaceTime := GetTickCount;
LoadSurface; //bodysurface殿撈 loadsurface甫 促矯 何福瘤 臼酒 皋葛府啊 橇府登綽 巴闌 阜瀾
end;
if m_BodySurface <> nil then
DrawBlend (dsurface,dx + m_nPx + m_nShiftX,dy + m_nPy + m_nShiftY,m_BodySurface, 1);
end;
procedure TDragonBody.LoadSurface;
begin
m_BodySurface := FrmMain.WDragonImg.GetCachedImage(GetOffset(m_wAppearance),m_nPx,m_nHpy);
end;
end.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -