📄 playscn.pas
字号:
fridx := fridx + (m_nAniCount mod (ani + (ani*anitick))) div (1+anitick);
end;
if (Map.m_MArr[i, j].btDoorOffset and $80) > 0 then begin
if (Map.m_MArr[i, j].btDoorIndex and $7F) > 0 then
fridx := fridx + (Map.m_MArr[i, j].btDoorOffset and $7F);
end;
fridx := fridx - 1;
DSurface := GetObjs (wunit, fridx);
if DSurface <> nil then begin
if (DSurface.Width = 48) and (DSurface.Height = 32) then begin
mmm := m + UNITY - DSurface.Height;
if (n+DSurface.Width > 0) and (n <= SCREENWIDTH) and (mmm + DSurface.Height > 0) and (mmm < drawingbottomline) then begin
m_ObjSurface.Draw (n, mmm, DSurface.ClientRect, Dsurface, TRUE)
end else begin
if mmm < drawingbottomline then begin
m_ObjSurface.Draw (n, mmm, DSurface.ClientRect, DSurface, TRUE)
end;
end;
end;
end;
end;
end;
Inc (n, UNITX);
end;
Inc (m, UNITY);
end;
for k:=0 to m_GroundEffectList.Count-1 do begin
meff := TMagicEff(m_GroundEffectList[k]);
//if j = (meff.Ry - Map.BlockTop) then begin
meff.DrawEff (m_ObjSurface);
if g_boViewFog then begin
AddLight (meff.Rx, meff.Ry, 0, 0, meff.light, FALSE);
end;
end;
except
DebugOutStr ('105');
end;
try
m := defy - UNITY;
for j:=(Map.m_ClientRect.Top - Map.m_nBlockTop) to (Map.m_ClientRect.Bottom - Map.m_nBlockTop + LONGHEIGHT_IMAGE) do begin
if j < 0 then begin Inc (m, UNITY); continue; end;
n := defx-UNITX*2;
for i:=(Map.m_ClientRect.Left - Map.m_nBlockLeft-2) to (Map.m_ClientRect.Right - Map.m_nBlockLeft+2) do begin
if (i >= 0) and (i < LOGICALMAPUNIT*3) and (j >= 0) and (j < LOGICALMAPUNIT*3) then begin
fridx := (Map.m_MArr[i, j].wFrImg) and $7FFF;
if fridx > 0 then begin
blend := FALSE;
wunit := Map.m_MArr[i, j].btArea;
ani := Map.m_MArr[i, j].btAniFrame;
if (ani and $80) > 0 then begin
blend := TRUE;
ani := ani and $7F;
end;
if ani > 0 then begin
anitick := Map.m_MArr[i, j].btAniTick;
fridx := fridx + (m_nAniCount mod (ani + (ani*anitick))) div (1+anitick);
end;
if (Map.m_MArr[i, j].btDoorOffset and $80) > 0 then begin
if (Map.m_MArr[i, j].btDoorIndex and $7F) > 0 then
fridx := fridx + (Map.m_MArr[i, j].btDoorOffset and $7F);
end;
fridx := fridx - 1;
if not blend then begin
DSurface := GetObjs (wunit, fridx);
if DSurface <> nil then begin
if (DSurface.Width <> 48) or (DSurface.Height <> 32) then begin
mmm := m + UNITY - DSurface.Height;
if (n+DSurface.Width > 0) and (n <= SCREENWIDTH) and (mmm + DSurface.Height > 0) and (mmm < drawingbottomline) then begin
m_ObjSurface.Draw (n, mmm, DSurface.ClientRect, Dsurface, TRUE)
end else begin
if mmm < drawingbottomline then begin
m_ObjSurface.Draw (n, mmm, DSurface.ClientRect, DSurface, TRUE)
end;
end;
end;
end;
end else begin
DSurface := GetObjsEx (wunit, fridx, ax, ay);
if DSurface <> nil then begin
mmm := m + ay - 68; //UNITY - DSurface.Height;
if (n > 0) and (mmm + DSurface.Height > 0) and (n + Dsurface.Width < SCREENWIDTH) and (mmm < drawingbottomline) then begin
DrawBlend (m_ObjSurface, n+ax-2, mmm, DSurface, 1);
end else begin
if mmm < drawingbottomline then begin
DrawBlend (m_ObjSurface, n+ax-2, mmm, DSurface, 1);
end;
end;
end;
end;
end;
end;
Inc (n, UNITX);
end;
if (j <= (Map.m_ClientRect.Bottom - Map.m_nBlockTop)) and (not g_boServerChanging) then begin
for k:=0 to EventMan.EventList.Count-1 do begin
evn := TClEvent (EventMan.EventList[k]);
if j = (evn.m_nY - Map.m_nBlockTop) then begin
evn.DrawEvent (m_ObjSurface,
(evn.m_nX-Map.m_ClientRect.Left)*UNITX + defx,
m);
end;
end;
if g_boDrawDropItem then begin
for k:=0 to g_DropedItemList.Count-1 do begin
DropItem := PTDropItem (g_DropedItemList[k]);
if DropItem <> nil then begin
if j = (DropItem.y - Map.m_nBlockTop) then begin
if DropItem.Looks < 10000 then begin
d := g_WDnItemImages.Images[DropItem.Looks];
end else
d := g_WDecoImages.Images[DropItem.Looks - 10000];
if d <> nil then begin
ix := (DropItem.x-Map.m_ClientRect.Left) * UNITX + defx + SOFFX; // + actor.ShiftX;
iy := m; // + actor.ShiftY;
if (DropItem = g_FocusItem) and (DropItem.Looks < 10000) then begin//second part is a temp fix to stop client from crashing on big deco items
g_ImgMixSurface.Draw (0, 0, d.ClientRect, d, FALSE);
DrawEffect (0, 0, d.Width, d.Height, g_ImgMixSurface, ceBright);
m_ObjSurface.Draw (ix + HALFX-(d.Width div 2),
iy + HALFY-(d.Height div 2),
d.ClientRect,
g_ImgMixSurface, TRUE);
end else begin
m_ObjSurface.Draw (ix + HALFX-(d.Width div 2),
iy + HALFY-(d.Height div 2),
d.ClientRect,
d, TRUE);
end;
end;
end;
end;
end;
end;
for k:=0 to m_ActorList.Count-1 do begin
actor := m_ActorList[k];
if (j = actor.m_nRy-Map.m_nBlockTop-actor.m_nDownDrawLevel) then begin
actor.m_nSayX := (actor.m_nRx-Map.m_ClientRect.Left)*UNITX + defx + actor.m_nShiftX + 24;
if actor.m_boDeath then
actor.m_nSayY := m + UNITY + actor.m_nShiftY + 16 - 60 + (actor.m_nDownDrawLevel * UNITY)
else actor.m_nSayY := m + UNITY + actor.m_nShiftY + 16 - 95 + (actor.m_nDownDrawLevel * UNITY);
actor.DrawChr (m_ObjSurface, (actor.m_nRx-Map.m_ClientRect.Left)*UNITX + defx,
m + (actor.m_nDownDrawLevel * UNITY),
FALSE,True);
end;
end;
for k:=0 to m_FlyList.Count-1 do begin
meff := TMagicEff(m_FlyList[k]);
if j = (meff.Ry - Map.m_nBlockTop) then
meff.DrawEff (m_ObjSurface);
end;
end;
Inc (m, UNITY);
end;
except
DebugOutStr ('106');
end;
try
if g_boViewFog then begin
m := defy - UNITY*4;
for j:=(Map.m_ClientRect.Top - Map.m_nBlockTop - 4) to (Map.m_ClientRect.Bottom - Map.m_nBlockTop + LONGHEIGHT_IMAGE) do begin
if j < 0 then begin Inc (m, UNITY); continue; end;
n := defx-UNITX*5;
for i:=(Map.m_ClientRect.Left - Map.m_nBlockLeft-5) to (Map.m_ClientRect.Right - Map.m_nBlockLeft+5) do begin
if (i >= 0) and (i < LOGICALMAPUNIT*3) and (j >= 0) and (j < LOGICALMAPUNIT*3) then begin
idx := Map.m_MArr[i, j].btLight;
if idx > 0 then begin
AddLight (i+Map.m_nBlockLeft, j+Map.m_nBlockTop, 0, 0, idx, FALSE);
end;
end;
Inc (n, UNITX);
end;
Inc (m, UNITY);
end;
if m_ActorList.Count > 0 then begin
for k:=0 to m_ActorList.Count-1 do begin
actor := m_ActorList[k];
if (actor = g_MySelf) or (actor.Light > 0) then
AddLight (actor.m_nRx, actor.m_nRy, actor.m_nShiftX, actor.m_nShiftY, actor.Light, actor=g_MySelf);
end;
end else begin
if g_MySelf <> nil then
AddLight (g_MySelf.m_nRx, g_MySelf.m_nRy, g_MySelf.m_nShiftX, g_MySelf.m_nShiftY, g_MySelf.Light, TRUE);
end;
end;
except
DebugOutStr ('107');
end;
if not g_boServerChanging then begin
try
if not g_boCheckBadMapMode then
if g_MySelf.m_nState and $00800000 = 0 then
g_MySelf.DrawChr (m_ObjSurface, (g_MySelf.m_nRx-Map.m_ClientRect.Left)*UNITX+defx, (g_MySelf.m_nRy - Map.m_ClientRect.Top-1)*UNITY+defy, TRUE,FALSE);
if (g_FocusCret <> nil) then begin
if IsValidActor (g_FocusCret) and (g_FocusCret <> g_MySelf) then
// if (actor.m_btRace <> 81) or (FocusCret.State and $00800000 = 0) then
if (g_FocusCret.m_nState and $00800000 = 0) then
g_FocusCret.DrawChr (m_ObjSurface,
(g_FocusCret.m_nRx - Map.m_ClientRect.Left)*UNITX+defx,
(g_FocusCret.m_nRy - Map.m_ClientRect.Top-1)*UNITY+defy, TRUE,FALSE);
end;
if (g_MagicTarget <> nil) then begin
if IsValidActor (g_MagicTarget) and (g_MagicTarget <> g_MySelf) then
if g_MagicTarget.m_nState and $00800000 = 0 then
g_MagicTarget.DrawChr (m_ObjSurface,
(g_MagicTarget.m_nRx-Map.m_ClientRect.Left)*UNITX+defx,
(g_MagicTarget.m_nRy - Map.m_ClientRect.Top-1)*UNITY+defy, TRUE,FALSE);
end;
except
DebugOutStr ('108');
end;
end;
try
for k:=0 to m_ActorList.Count-1 do begin
actor := m_ActorList[k];
actor.DrawEff (m_ObjSurface,
(actor.m_nRx-Map.m_ClientRect.Left)*UNITX + defx,
(actor.m_nRy-Map.m_ClientRect.Top-1)*UNITY + defy);
end;
for k:=0 to m_EffectList.Count-1 do begin
meff := TMagicEff(m_EffectList[k]);
//if j = (meff.Ry - Map.BlockTop) then begin
meff.DrawEff (m_ObjSurface);
if g_boViewFog then begin
AddLight (meff.Rx, meff.Ry, 0, 0, meff.Light, FALSE);
end;
end;
if g_boViewFog then begin
for k:=0 to EventMan.EventList.Count-1 do begin
evn := TClEvent (EventMan.EventList[k]);
if evn.m_nLight > 0 then
AddLight (evn.m_nX, evn.m_nY, 0, 0, evn.m_nLight, FALSE);
end;
end;
except
DebugOutStr ('109');
end;
try
for k:=0 to g_DropedItemList.Count-1 do begin
DropItem := PTDropItem (g_DropedItemList[k]);
if DropItem <> nil then begin
if GetTickCount - DropItem.FlashTime > g_dwDropItemFlashTime{5 * 1000} then begin
DropItem.FlashTime := GetTickCount;
DropItem.BoFlash := TRUE;
DropItem.FlashStepTime := GetTickCount;
DropItem.FlashStep := 0;
end;
ix:=(DropItem.x - Map.m_ClientRect.Left) * UNITX + defx + SOFFX;
iy:=(DropItem.y - Map.m_ClientRect.Top - 1) * UNITY + defy + SOFFY;
if DropItem.BoFlash then begin
if GetTickCount - DropItem.FlashStepTime >= 20 then begin
DropItem.FlashStepTime := GetTickCount;
Inc (DropItem.FlashStep);
end;
if (DropItem.FlashStep >= 0) and (DropItem.FlashStep < 10) then begin
DSurface := g_WMainImages.GetCachedImage (FLASHBASE + DropItem.FlashStep, ax, ay);
DrawBlend (m_ObjSurface, ix + ax, iy + ay, DSurface, 1);
end else DropItem.BoFlash := FALSE;
end;
ShowItem:=GetShowItem(DropItem.Name);
if (DropItem <> g_FocusItem) and (((ShowItem <> nil) and (ShowItem.boShowName)) or g_boShowAllItem) then begin
//显示地面物品名称
if ShowItem <> nil then begin
nFColor:=ShowItem.nFColor;
nBColor:=ShowItem.nBColor;
end else begin
nFColor:=clWhite;
nBColor:=clBlack;
end;
with m_ObjSurface.Canvas do begin
SetBkMode (Handle, TRANSPARENT);
BoldTextOut(m_ObjSurface,
ix + HALFX - TextWidth(DropItem.Name) div 2,
iy + HALFY - TextHeight(DropItem.Name) * 2,// div 2,
nFColor,
nBColor,
DropItem.Name);
Release;
end;
end;
end;
end;
except
DebugOutStr('110');
end;
try
g_boViewFog:=TRUE; //免蜡
if g_boViewFog and not g_boForceNotViewFog then begin
ApplyLightMap;
DrawFog (m_ObjSurface, m_PFogScreen, m_nFogWidth);
MSurface.Draw (SOFFX, SOFFY, m_ObjSurface.ClientRect, m_ObjSurface, FALSE);
end else begin
if g_MySelf.m_boDeath then //人物死亡,显示黑白画面
DrawEffect (0, 0, m_ObjSurface.Width, m_ObjSurface.Height, m_ObjSurface, g_DeathColorEffect{ceGrayScale});
MSurface.Draw (SOFFX, SOFFY, m_ObjSurface.ClientRect, m_ObjSurface, FALSE);
end;
except
DebugOutStr ('111');
end;
if g_boViewMiniMap then
DrawMiniMap (MSurface);
SetBkMode (MSurface.Canvas.Handle, TRANSPARENT);
if not(g_boSkillSetting) then begin
if (g_boViewMiniMap = TRUE) and (g_nMiniMapIndex <> -1) then
BoldTextOut (MSurface, 706, 125, clGreen, clBlack, '[Ctrl快捷键]')
else
BoldTextOut (MSurface, 706, 6, clGreen, clBlack, '[Ctrl快捷键]')
end else begin
if (g_boViewMiniMap = TRUE) and (g_nMiniMapIndex <> -1) then
BoldTextOut (MSurface, 706, 125, clGreen, clBlack, '[~快捷键]')
else
BoldTextOut (MSurface, 706, 6, clGreen, clBlack, '[~快捷键]');
end;
{if (g_boViewMiniMap = TRUE) and (g_nMiniMapIndex <> -1) then begin
BoldTextOut (MSurface, 706, 139, clYellow, clBlack, IntToStr(g_nAttatckMode))
end else begin
BoldTextOut (MSurface, 706, 20, clYellow, clBlack, IntToStr(g_MySelf.m_btAttatckMode))
end; }
MSurface.Canvas.Release;
if g_boViewMap then
DrawMap (MSurface)
end;
{-------------------------------------------------------}
//cx, cy, tx, ty
procedure TPlayScene.NewMagic (aowner: TActor;
magid, magnumb{Effect}, cx, cy, tx, ty, targetcode: integer;
mtype: TMagicType; //EffectType
Recusion: Boolean;
anitime: integer;
var bofly: Boolean);
var
i, scx, scy, sctx, scty, effnum: integer;
meff, meff2: TMagicEff;
target: TActor;
wimg: TWMImages;
begin
bofly := FALSE;
if magid <> 111 then //
for i:=0 to m_EffectList.Count-1 do
if TMagicEff(m_EffectList[i]).ServerMagicId = magid then
exit; //
ScreenXYfromMCXY (cx, cy, scx, scy);
ScreenXYfromMCXY (tx, ty, sctx, scty);
if magnumb > 0 then GetEffectBase (magnumb-1, 0, wimg, effnum) //magnumb{Effect}
else effnum := -magnumb;
target := FindActor (targetcode);
meff := nil;
meff2 := nil;
case mtype of //EffectType
mtReady, mtFly, mtFlyAxe: begin
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.TargetActor := target;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -