⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 playscn.pas

📁 传奇客户端
💻 PAS
📖 第 1 页 / 共 5 页
字号:
      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
                  d := g_WDnItemImages.Images[DropItem.Looks];
                  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 then begin
                        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 //Jacky
            if (g_FocusCret.m_nState and $00800000 = 0) then //Jacky
               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:=False;      //Jacky 免蜡
   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 begin
      DrawMiniMap (MSurface);
   end;


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: 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;
   case mtype of  //EffectType
      mtReady, mtFly, mtFlyAxe: begin
        meff := TMagicEff.Create (magid{替为magnumb,击中后的效果改变了}, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
        meff.TargetActor := target;
        if magnumb = 39 then begin
          meff.frame := 4;
          if wimg <> nil then
            meff.ImgLib:=wimg;
        end;
        bofly := TRUE;
      end;
      mtExplosion:
        case magnumb of
          18: begin //诱惑之光
            meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
            meff.MagExplosionBase := 1570;
            meff.TargetActor := target;
            meff.NextFrameTime := 80;
          end;
          21: begin //爆裂火焰
            meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
            meff.MagExplosionBase := 1660;
            meff.TargetActor := nil; //target;
            meff.NextFrameTime := 80;
            meff.ExplosionFrame := 20;
            meff.Light := 3;
          end;
          26: begin //心灵启示
            meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
            meff.MagExplosionBase := 3990;
            meff.TargetActor := target;
            meff.NextFrameTime := 80;
            meff.ExplosionFrame := 10;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -