?? axemon.pas
字號:
{============================== THuSuABi =============================}
// 傾薦酒厚
{--------------------------}
procedure THuSuABi.LoadSurface;
begin
inherited LoadSurface;
if m_boUseEffect then
EffectSurface := FrmMain.WMon3Img.GetCachedImage (DEATHFIREEFFECTBASE + m_nCurrentFrame-m_nStartFrame, ax, ay);
end;
{============================== TGasKuDeGi =============================}
// 措屈備單扁 (啊膠筋綽 備單扁)
{--------------------------}
constructor TGasKuDeGi.Create;
begin
inherited Create;
AttackEffectSurface := nil;
DieEffectSurface := nil;
m_boUseEffect := FALSE;
BoUseDieEffect := FALSE;
end;
procedure TGasKuDeGi.CalcActorFrame;
var
pm: PTMonsterAction;
actor: TActor;
haircount, scx, scy, stx, sty: integer;
meff: TCharEffect;
begin
m_nCurrentFrame := -1;
m_nBodyOffset := GetOffset (m_wAppearance);
pm := GetRaceByPM (m_btRace,m_wAppearance);
if pm = nil then exit;
case m_nCurrentAction of
SM_TURN:
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 := pm.ActStand.frame;
Shift (m_btDir, 0, 0, 1);
end;
SM_WALK:
begin
m_nStartFrame := pm.ActWalk.start + m_btDir * (pm.ActWalk.frame + pm.ActWalk.skip);
m_nEndFrame := m_nStartFrame + pm.ActWalk.frame - 1;
m_dwFrameTime := pm.ActWalk.ftime;
m_dwStartTime := GetTickCount;
m_nMaxTick := pm.ActWalk.UseTick;
m_nCurTick := 0;
//WarMode := FALSE;
m_nMoveStep := 1;
if m_nCurrentAction = SM_WALK then
Shift (m_btDir, m_nMoveStep, 0, m_nEndFrame-m_nStartFrame+1)
else //sm_backstep
Shift (GetBack(m_btDir), m_nMoveStep, 0, m_nEndFrame-m_nStartFrame+1);
end;
SM_HIT,
SM_LIGHTING:
begin
m_nStartFrame := pm.ActAttack.start + m_btDir * (pm.ActAttack.frame + pm.ActAttack.skip);
m_nEndFrame := m_nStartFrame + pm.ActAttack.frame - 1;
m_dwFrameTime := pm.ActAttack.ftime;
m_dwStartTime := GetTickCount;
//WarMode := TRUE;
m_dwWarModeTime := GetTickCount;
Shift (m_btDir, 0, 0, 1);
m_boUseEffect := TRUE;
firedir := m_btDir;
m_nEffectFrame := m_nStartFrame;
m_nEffectStart := m_nStartFrame;
if m_btRace = 20 then m_nEffectEnd := m_nEndFrame + 1
else m_nEffectEnd := m_nEndFrame;
m_dwEffectStartTime := GetTickCount;
m_dwEffectFrameTime := m_dwFrameTime;
//16規氫牢 付過 汲瀝
actor := PlayScene.FindActor (m_nTargetRecog);
if actor <> nil then begin
PlayScene.ScreenXYfromMCXY (m_nCurrX, m_nCurrY, scx, scy);
PlayScene.ScreenXYfromMCXY (actor.m_nCurrX, actor.m_nCurrY, stx, sty);
fire16dir := GetFlyDirection16 (scx, scy, stx, sty);
//meff := TCharEffect.Create (ZOMBILIGHTINGEXPBASE, 12, actor); //嘎綽 葷恩 瓤苞
//meff.ImgLib := FrmMain.WMon5Img;
//meff.NextFrameTime := 50;
//PlayScene.EffectList.Add (meff);
end else
fire16dir := firedir * 2;
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 := m_dwStruckFrameTime; //pm.ActStruck.ftime;
m_dwStartTime := GetTickCount;
end;
SM_DEATH:
begin
m_nStartFrame := pm.ActDie.start + m_btDir * (pm.ActDie.frame + pm.ActDie.skip);
m_nEndFrame := m_nStartFrame + pm.ActDie.frame - 1;
m_nStartFrame := m_nEndFrame; //
m_dwFrameTime := pm.ActDie.ftime;
m_dwStartTime := GetTickCount;
end;
SM_NOWDEATH:
begin
m_nStartFrame := pm.ActDie.start + m_btDir * (pm.ActDie.frame + pm.ActDie.skip);
m_nEndFrame := m_nStartFrame + pm.ActDie.frame - 1;
m_dwFrameTime := pm.ActDie.ftime;
m_dwStartTime := GetTickCount;
{
if m_btRace = 40 then
BoUseDieEffect := TRUE;
}
if (m_btRace = 40) or (m_btRace = 65) or (m_btRace = 66) or (m_btRace = 67) or (m_btRace = 68) or (m_btRace = 69) then
BoUseDieEffect := TRUE;
end;
SM_SKELETON:
begin
m_nStartFrame := pm.ActDeath.start;
m_nEndFrame := m_nStartFrame + pm.ActDeath.frame - 1;
m_dwFrameTime := pm.ActDeath.ftime;
m_dwStartTime := GetTickCount;
end;
end;
end;
function TGasKuDeGi.GetDefaultFrame (wmode: Boolean): integer;
var
cf, dr: integer;
pm: PTMonsterAction;
begin
Result:=0;//jacky
pm := GetRaceByPM (m_btRace,m_wAppearance);
if pm = nil then exit;
if m_boDeath then begin
if m_boSkeleton then
Result := pm.ActDeath.start
else Result := pm.ActDie.start + m_btDir * (pm.ActDie.frame + pm.ActDie.skip) + (pm.ActDie.frame - 1);
end else begin
m_nDefFrameCount := pm.ActStand.frame;
if m_nCurrentDefFrame < 0 then cf := 0
else if m_nCurrentDefFrame >= pm.ActStand.frame then cf := 0
else cf := m_nCurrentDefFrame;
Result := pm.ActStand.start + m_btDir * (pm.ActStand.frame + pm.ActStand.skip) + cf;
end;
end;
procedure TGasKuDeGi.LoadSurface;
begin
inherited LoadSurface;
case m_btRace of
//攻擊效果
16://洞蛆
begin
if m_boUseEffect then
AttackEffectSurface := FrmMain.WMon3Img.GetCachedImage (
KUDEGIGASBASE-1 + (firedir * 10) + m_nEffectFrame-m_nEffectStart, //啊膠綽 貿瀾 茄橇飯瀾 詞霸 矯累竊.
ax, ay);
end;
20://火焰沃瑪
begin
if m_boUseEffect then
AttackEffectSurface := FrmMain.WMon4Img.GetCachedImage (
COWMONFIREBASE + (firedir * 10) + m_nEffectFrame-m_nEffectStart, //
ax, ay);
end;
21://沃瑪教主
begin
if m_boUseEffect then
AttackEffectSurface := FrmMain.WMon4Img.GetCachedImage (
COWMONLIGHTBASE + (firedir * 10) + m_nEffectFrame-m_nEffectStart, //
ax, ay);
end;
24:
begin
if m_boUseEffect then
AttackEffectSurface := FrmMain.WMonImg.GetCachedImage (
SUPERIORGUARDBASE + (m_btDir * 8) + m_nEffectFrame-m_nEffectStart, //
ax, ay);
end;
40://僵尸1
begin
if m_boUseEffect then begin
AttackEffectSurface := FrmMain.WMon5Img.GetCachedImage (
ZOMBILIGHTINGBASE + (fire16dir * 10) + m_nEffectFrame-m_nEffectStart, //
ax, ay);
end;
if BoUseDieEffect then begin
DieEffectSurface := FrmMain.WMon5Img.GetCachedImage (
ZOMBIDIEBASE + m_nCurrentFrame-m_nStartFrame, //
bx, by);
end;
end;
52://楔蛾
begin
if m_boUseEffect then
AttackEffectSurface := FrmMain.WMon4Img.GetCachedImage (
MOTHPOISONGASBASE + (firedir * 10) + m_nEffectFrame-m_nEffectStart, //
ax, ay);
end;
53://糞蟲
begin
if m_boUseEffect then
AttackEffectSurface := FrmMain.WMon3Img.GetCachedImage (
DUNGPOISONGASBASE + (firedir * 10) + m_nEffectFrame-m_nEffectStart, //
ax, ay);
end;
64: begin
if m_boUseEffect then begin
AttackEffectSurface := FrmMain.WMon20Img.GetCachedImage (
720 + (firedir * 10) + m_nEffectFrame-m_nEffectStart, //
ax, ay);
end;
end;
65: begin
if BoUseDieEffect then begin
DieEffectSurface:= FrmMain.WMon20Img.GetCachedImage (
350 + m_nCurrentFrame-m_nStartFrame, bx, by);
end;
end;
66: begin
if BoUseDieEffect then begin
DieEffectSurface:= FrmMain.WMon20Img.GetCachedImage (
1600 + m_nCurrentFrame-m_nStartFrame, bx, by);
end;
end;
67: begin
if BoUseDieEffect then begin
DieEffectSurface:= FrmMain.WMon20Img.GetCachedImage (
1160 + (m_btDir * 10) + m_nCurrentFrame-m_nStartFrame, bx, by);
end;
end;
68: begin
if BoUseDieEffect then begin
DieEffectSurface:= FrmMain.WMon20Img.GetCachedImage (
1600 + m_nCurrentFrame-m_nStartFrame, bx, by);
end;
end;
end;
end;
procedure TGasKuDeGi.Run;
var
prv: integer;
m_dwEffectFrameTimetime, m_dwFrameTimetime: longword;
begin
if (m_nCurrentAction = SM_WALK) or (m_nCurrentAction = SM_BACKSTEP) or (m_nCurrentAction = SM_RUN) or (m_nCurrentAction = SM_HORSERUN) then exit;
m_boMsgMuch := FALSE;
if m_MsgList.Count >= 2 then m_boMsgMuch := TRUE;
//
RunActSound (m_nCurrentFrame - m_nStartFrame);
RunFrameAction (m_nCurrentFrame - m_nStartFrame);
if m_boUseEffect then begin
if m_boMsgMuch then m_dwEffectFrameTimetime := Round(m_dwEffectFrameTime * 2 / 3)
else m_dwEffectFrameTimetime := m_dwEffectFrameTime;
if GetTickCount - m_dwEffectStartTime > m_dwEffectFrameTimetime then begin
m_dwEffectStartTime := GetTickCount;
if m_nEffectFrame < m_nEffectEnd then begin
Inc (m_nEffectFrame);
end else begin
m_boUseEffect := FALSE;
end;
end;
end;
prv := m_nCurrentFrame;
if m_nCurrentAction <> 0 then begin
if (m_nCurrentFrame < m_nStartFrame) or (m_nCurrentFrame > m_nEndFrame) then
m_nCurrentFrame := m_nStartFrame;
if m_boMsgMuch then m_dwFrameTimetime := Round(m_dwFrameTime * 2 / 3)
else m_dwFrameTimetime := m_dwFrameTime;
if GetTickCount - m_dwStartTime > m_dwFrameTimetime then begin
if m_nCurrentFrame < m_nEndFrame then begin
Inc (m_nCurrentFrame);
m_dwStartTime := GetTickCount;
end else begin
m_nCurrentAction := 0;
BoUseDieEffect := FALSE;
end;
end;
m_nCurrentDefFrame := 0;
m_dwDefFrameTime := GetTickCount;
end else begin
if GetTickCount - m_dwSmoothMoveTime > 200 then begin
if GetTickCount - m_dwDefFrameTime > 500 then begin
m_dwDefFrameTime := GetTickCount;
Inc (m_nCurrentDefFrame);
if m_nCurrentDefFrame >= m_nDefFrameCount then
m_nCurrentDefFrame := 0;
end;
DefaultMotion;
end;
end;
if prv <> m_nCurrentFrame then begin
m_dwLoadSurfaceTime := GetTickCount;
LoadSurface;
end;
end;
procedure TGasKuDeGi.DrawChr (dsurface: TDirectDrawSurface; dx, dy: integer; blend: Boolean;boFlag:Boolean);
var
idx: integer;
d: TDirectDrawSurface;
ceff: TColorEffect;
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;
ceff := GetDrawEffectValue;
if m_BodySurface <> nil then
DrawEffSurface (dsurface, m_BodySurface, dx + m_nPx + m_nShiftX, dy + m_nPy + m_nShiftY, blend, ceff);
end;
procedure TGasKuDeGi.DrawEff (dsurface: TDirectDrawSurface; dx, dy: integer);
var
idx: integer;
d: TDirectDrawSurface;
ceff: TColorEffect;
begin
if m_boUseEffect then
if AttackEffectSurface <> nil then begin
DrawBlend (dsurface,
dx + ax + m_nShiftX,
dy + ay + m_nShiftY,
AttackEffectSurface, 1);
end;
if BoUseDieEffect then
if DieEffectSurface <> nil then begin
DrawBlend (dsurface,
dx + bx + m_nShiftX,
dy + by + m_nShiftY,
DieEffectSurface, 1);
end;
end;
{-----------------------------------------------------------}
function TFireCowFaceMon.Light: integer;
var
l: integer;
begin
l := m_nChrLight;
if l < 2 then begin
if m_boUseEffect then
l := 2;
end;
Result := l;
end;
function TCowFaceKing.Light: integer;
var
l: integer;
begin
l := m_nChrLight;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -