axemon.pas
来自「2009最新 传奇汉化0599代码 传奇汉化」· PAS 代码 · 共 1,933 行 · 第 1/5 页
PAS
1,933 行
if m_boUseEffect then
l := 2;
end;
Result := l;
end;
{-----------------------------------------------------------}
//procedure TZombiLighting.Run;
{-----------------------------------------------------------}
procedure TSculptureMon.CalcActorFrame;
var
pm: PTMonsterAction;
haircount: integer;
begin
m_nCurrentFrame := -1;
m_nBodyOffset := GetOffset (m_wAppearance);
pm := GetRaceByPM (m_btRace,m_wAppearance);
if pm = nil then exit;
m_boUseEffect := FALSE;
case m_nCurrentAction of
SM_TURN:
begin
if (m_nState and STATE_STONE_MODE) <> 0 then begin
if (m_btRace = 48) or (m_btRace = 49) then
m_nStartFrame := pm.ActDeath.start // + Dir * (pm.ActDeath.frame + pm.ActDeath.skip)
else
m_nStartFrame := pm.ActDeath.start + m_btDir * (pm.ActDeath.frame + pm.ActDeath.skip);
m_nEndFrame := m_nStartFrame;
m_dwFrameTime := pm.ActDeath.ftime;
m_dwStartTime := GetTickCount;
m_nDefFrameCount := pm.ActDeath.frame;
end else 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;
end;
Shift (m_btDir, 0, 0, 1);
end;
SM_WALK, SM_BACKSTEP:
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_DIGUP: //叭扁 绝澜, SM_DIGUP, 规氢 绝澜.
begin
if (m_btRace = 48) or (m_btRace = 49) then begin
m_nStartFrame := pm.ActDeath.start;
end else begin
m_nStartFrame := pm.ActDeath.start + m_btDir * (pm.ActDeath.frame + pm.ActDeath.skip);
end;
m_nEndFrame := m_nStartFrame + pm.ActDeath.frame - 1;
m_dwFrameTime := pm.ActDeath.ftime;
m_dwStartTime := GetTickCount;
//WarMode := FALSE;
Shift (m_btDir, 0, 0, 1);
end;
SM_HIT:
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;
if m_btRace = 49 then begin
m_boUseEffect := TRUE;
firedir := m_btDir;
m_nEffectFrame := 0; //startframe;
m_nEffectStart := 0; //startframe;
m_nEffectEnd := m_nEffectStart + 8;
m_dwEffectStartTime := GetTickCount;
m_dwEffectFrameTime := m_dwFrameTime;
end;
Shift (m_btDir, 0, 0, 1);
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;
end;
end;
end;
procedure TSculptureMon.LoadSurface;
begin
inherited LoadSurface;
case m_btRace of
48, 49:
begin
if m_boUseEffect then
AttackEffectSurface := FrmMain.WMon7Img.GetCachedImage (
SCULPTUREFIREBASE + (firedir * 10) + m_nEffectFrame-m_nEffectStart, //
ax, ay);
end;
end;
end;
function TSculptureMon.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
Result := pm.ActDie.start + m_btDir * (pm.ActDie.frame + pm.ActDie.skip) + (pm.ActDie.frame - 1);
end else begin
if (m_nState and STATE_STONE_MODE) <> 0 then begin
case m_btRace of
47: Result := pm.ActDeath.start + m_btDir * (pm.ActDeath.frame + pm.ActDeath.skip);
48, 49: Result := pm.ActDeath.start;
end;
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;
end;
procedure TSculptureMon.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;
end;
procedure TSculptureMon.Run;
var
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;
if m_boUseEffect then begin
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;
inherited Run;
end;
{ TBanyaGuardMon }
procedure TBanyaGuardMon.CalcActorFrame;
var
pm: PTMonsterAction;
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_HIT: 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;
m_dwWarModeTime := GetTickCount;
Shift (m_btDir, 0, 0, 1);
m_boUseEffect := TRUE;
m_nEffectFrame := m_nStartFrame;
m_nEffectStart := m_nStartFrame;
m_nEffectEnd := m_nEndFrame;
m_dwEffectStartTime := GetTickCount;
m_dwEffectFrameTime := m_dwFrameTime;
end;
SM_LIGHTING: begin
m_nStartFrame := pm.ActCritical.start + m_btDir * (pm.ActCritical.frame + pm.ActCritical.skip);
m_nEndFrame := m_nStartFrame + pm.ActCritical.frame - 1;
m_dwFrameTime := pm.ActCritical.ftime;
m_dwStartTime := GetTickCount;
m_nCurEffFrame:=0;
m_boUseEffect := TRUE;
m_dwWarModeTime := GetTickCount;
Shift (m_btDir, 0, 0, 1);
// if (m_btRace = 71) or (m_btRace = 101) then begin
if (m_btRace <> 78) and (m_btRace <> 70) and (m_btRace <> 101) then begin //this hopefully fixes deva , 78 = omaking he's the only mob that uses this that CANT do effect while casting magic
m_boUseEffect := TRUE;
m_nEffectFrame := m_nStartFrame;
m_nEffectStart := m_nStartFrame;
m_nEffectEnd := m_nEndFrame;
m_dwEffectStartTime := GetTickCount;
m_dwEffectFrameTime := m_dwFrameTime;
end;
if m_btRace = 78 then
m_boUseEffect:=FALSE;
end;
//SM_NOWDEATH: begin
//end;
else begin
inherited;
end;
end;
end;
constructor TBanyaGuardMon.Create;
begin
inherited;
n26C:=nil;
end;
procedure TBanyaGuardMon.DrawEff(dsurface: TDirectDrawSurface; dx,
dy: integer);
begin
inherited;
if m_boUseEffect and (n26C <> nil) then begin
DrawBlend (dsurface,dx + ax + m_nShiftX,dy + ay + m_nShiftY,n26C, 1);
end;
end;
procedure TBanyaGuardMon.LoadSurface;
begin
inherited;
if bo260 then begin
case m_btRace of
70: begin //left guard
AttackEffectSurface := FrmMain.WMon21Img.GetCachedImage (
2320 + m_nCurrentFrame - m_nStartFrame,
n264, n268);
end;
101: begin //right guard
AttackEffectSurface := FrmMain.WMon21Img.GetCachedImage (
2870 + (m_btDir * 10) + m_nCurrentFrame - m_nStartFrame,
n264, n268);
end;
78: begin //omaking
AttackEffectSurface := FrmMain.WMon22Img.GetCachedImage (
3120 + (m_btDir * 20) + m_nCurrentFrame - m_nStartFrame,
n264, n268);
end;
end;
end else begin
if m_boUseEffect then begin
case m_btRace of
101: begin //rightguard
if m_nCurrentAction = SM_HIT then begin
n26C := FrmMain.WMon21Img.GetCachedImage (
2780 + (m_btDir * 10) + m_nEffectFrame - m_nEffectStart,
ax, ay);
end;
if m_nCurrentAction = SM_LIGHTING then begin
n26C := FrmMain.WMon21Img.GetCachedImage (
2960 + (m_btDir * 10) + m_nEffectFrame - m_nEffectStart,
ax, ay);
end;
end;
70: begin //leftguard
if m_nCurrentAction = SM_HIT then begin
n26C := FrmMain.WMon21Img.GetCachedImage (
2230 + (m_btDir * 10) + m_nEffectFrame - m_nEffectStart,
ax, ay);
end;
end;
71: begin //MTK
case m_nCurrentAction of
SM_HIT: begin //close range attack
n26C := FrmMain.WMon21Img.GetCachedImage (
{2780} 3490 + (m_btDir * 10) + m_nEffectFrame - m_nEffectStart,
ax, ay);
end;
end;
end;
72: begin
if m_nCurrentAction = SM_HIT then begin
n26C := FrmMain.WMon21Img.GetCachedImage (
3490 + (m_btDir * 10) + m_nEffectFrame - m_nEffectStart,
ax, ay);
end;
end;
78: begin
if m_nCurrentAction = SM_HIT then begin
n26C := FrmMain.WMon22Img.GetCachedImage (
3440 + (m_btDir * 10) + m_nEffectFrame - m_nEffectStart,
ax, ay);
end;
end;
end;
end;
end;
end;
procedure TBanyaGuardMon.Run;
var
prv: integer;
m_dwEffectFrameTimetime, m_dwFrameTimetime: longword;
bo11:Boolean;
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;
m_boUseEffect := FALSE;
bo260:=False;
end;
if m_nCurrentAction = SM_LIGHTING then begin
if (m_nCurrentFrame - m_nStartFrame) = 4 then begin
if (m_btRace = 101) then begin //RightGuard
PlayScene.NewMagic (Self,1,1,m_nCurrX,m_nCurrY,m_nTargetX,m_nTargetY,m_nTargetRecog,mtFly,True,20,bo11);
PlaySound (m_nMagicFireSound);
end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?