sm
服务器租用 996 87 无法下载点击此处反馈
/
查看: 1573|回复: 2

Delphi台湾2005源码小火炬传奇3引擎代码 [传奇3源码]

[复制链接]

826

主题

37

回帖

23万

积分

霸王教主

积分
237197
发表于 2022-4-22 22:45:43 | 显示全部楼层 |阅读模式
小火炬源码 2005传奇3台湾Delphi引擎代码
小火炬源码 2005传奇3台湾Delphi引擎代码
  1. //dis: 倔付唱 钢府 第肺..
  2. function GetBackPosition (cret: TCreature; var newx, newy: integer): Boolean;
  3. var
  4.    penv: TEnvirnoment;
  5. begin
  6.    penv := cret.PEnvir;
  7.    newx := cret.CX;
  8.    newy := cret.CY;
  9.    case cret.Dir of
  10.       DR_UP:      if newy < penv.MapHeight-1 then newy := newy+1;
  11.       DR_DOWN:    if newy > 0 then newy := newy-1;
  12.       DR_LEFT:    if newx < penv.MapWidth-1 then newx := newx+1;
  13.       DR_RIGHT:   if newx > 0 then newx := newx-1;
  14.       DR_UPLEFT:
  15.          begin
  16.             if (newx < penv.MapWidth-1) and (newy < penv.MapHeight-1) then begin
  17.                newx := newx + 1;
  18.                newy := newy + 1;
  19.             end;
  20.          end;
  21.       DR_UPRIGHT:
  22.          begin
  23.             if (newx < penv.MapWidth-1) and (newy > 0) then begin
  24.                newx := newx - 1;
  25.                newy := newy + 1;
  26.             end;
  27.          end;
  28.       DR_DOWNLEFT:
  29.          begin
  30.             if (newx > 0) and (newy < penv.MapHeight-1) then begin
  31.                newx := newx + 1;
  32.                newy := newy - 1;
  33.             end;
  34.          end;
  35.       DR_DOWNRIGHT:
  36.          begin
  37.             if (newx > 0) and (newy > 0) then begin
  38.                newx := newx - 1;
  39.                newy := newy - 1;
  40.             end;
  41.          end;
  42.    end;
  43.    Result := TRUE;
  44. end;

  45. //dis: 倔付唱 钢府 第肺..
  46. function GetNextPosition (penv: TEnvirnoment; sx, sy, dir, dis: integer; var newx, newy: integer): Boolean;
  47. begin
  48.    newx := sx;
  49.    newy := sy;
  50.    case dir of
  51.       DR_UP:      if newy > (dis-1) then newy := newy-dis;
  52.       DR_DOWN:    if newy < penv.MapHeight-dis then newy := newy+dis;
  53.       DR_LEFT:    if newx > (dis-1) then newx := newx-dis;
  54.       DR_RIGHT:   if newx < penv.MapWidth-dis then newx := newx+dis;
  55.       DR_UPLEFT:
  56.          begin
  57.             if (newx > dis-1) and (newy > dis-1) then begin
  58.                newx := newx - dis;
  59.                newy := newy - dis;
  60.             end;
  61.          end;
  62.       DR_UPRIGHT:
  63.          begin
  64.             if (newx > dis-1) and (newy < penv.MapHeight-dis) then begin
  65.                newx := newx + dis;
  66.                newy := newy - dis;
  67.             end;
  68.          end;
  69.       DR_DOWNLEFT:
  70.          begin
  71.             if (newx < penv.MapWidth-dis) and (newy > dis-1) then begin
  72.                newx := newx - dis;
  73.                newy := newy + dis;
  74.             end;
  75.          end;
  76.       DR_DOWNRIGHT:
  77.          begin
  78.             if (newx < penv.MapWidth-dis) and (newy < penv.MapHeight-dis) then begin
  79.                newx := newx + dis;
  80.                newy := newy + dis;
  81.             end;
  82.          end;
  83.    end;
  84.    if (sx = newx) and (sy = newy) then Result := FALSE
  85.    else Result := TRUE;
  86. end;

  87. function GetNextDirection (sx, sy, dx, dy: Integer): byte;
  88. var
  89.    flagx, flagy: integer;
  90. begin
  91.    Result := DR_DOWN;
  92.    if sx < dx then flagx := 1
  93.    else if sx = dx then flagx := 0
  94.    else flagx := -1;
  95.    if abs(sy-dy) > 2
  96.     then if (sx >= dx-1) and (sx <= dx+1) then flagx := 0;

  97.    if sy < dy then flagy := 1
  98.    else if sy = dy then flagy := 0
  99.    else flagy := -1;
  100.    if abs(sx-dx) > 2 then if (sy > dy-1) and (sy <= dy+1) then flagy := 0;

  101.    if (flagx = 0)  and (flagy = -1) then Result := DR_UP;
  102.    if (flagx = 1)  and (flagy = -1) then Result := DR_UPRIGHT;
  103.    if (flagx = 1)  and (flagy = 0)  then Result := DR_RIGHT;
  104.    if (flagx = 1)  and (flagy = 1)  then Result := DR_DOWNRIGHT;
  105.    if (flagx = 0)  and (flagy = 1)  then Result := DR_DOWN;
  106.    if (flagx = -1) and (flagy = 1)  then Result := DR_DOWNLEFT;
  107.    if (flagx = -1) and (flagy = 0)  then Result := DR_LEFT;
  108.    if (flagx = -1) and (flagy = -1) then Result := DR_UPLEFT;
  109. end;

  110. function GetHpMpRate (cret: TCreature): word;
  111. var
  112.    hrate, srate: byte;
  113. begin
  114.    if (cret.Abil.MaxHP <> 0) and (cret.Abil.MaxMP <> 0) then begin
  115.       Result := MakeWord (Round (cret.Abil.HP / cret.Abil.MaxHP * 100),
  116.                           Round (cret.Abil.MP / cret.Abil.MaxMP * 100));
  117.    end else begin
  118.       if (cret.Abil.MaxHP = 0) then hrate := 0
  119.       else hrate := Round (cret.Abil.HP / cret.Abil.MaxHP * 100);
  120.       if (cret.Abil.MaxMP = 0) then srate := 0
  121.       else srate := Round (cret.Abil.MP / cret.Abil.MaxMP * 100);
  122.       Result := MakeWord (hrate, srate);
  123.    end;
  124. end;

  125. function  IsTakeOnAvailable (useindex: integer; pstd: PTStdItem): Boolean;
  126. begin
  127.    Result := FALSE;
  128.    if pstd = nil then exit;
  129.    case useindex of
  130.       U_DRESS:
  131.          if pstd.StdMode in [10..11] then //巢磊 咯磊渴..
  132.             Result := TRUE;
  133.       U_WEAPON:
  134.          if (pstd.StdMode = 5) or (pstd.StdMode = 6) then
  135.             Result := TRUE;
  136.       U_RIGHTHAND:
  137.          if pstd.StdMode = 30 then begin //眯阂, 颇沸伐橇
  138.             Result := TRUE;
  139.          end;
  140.       U_NECKLACE:
  141.          if (pstd.StdMode = 19) or (pstd.StdMode = 20) or (pstd.StdMode = 21) then begin
  142.             Result := TRUE;
  143.          end;
  144.       U_HELMET:
  145.          if pstd.StdMode = 15 then begin
  146.             Result := TRUE;
  147.          end;
  148.       U_RINGL,
  149.       U_RINGR:
  150.          if (pstd.StdMode = 22) or (pstd.StdMode = 23) then begin
  151.             Result := TRUE;
  152.          end;
  153.       U_ARMRINGR:    //迫骂父..
  154.          if (pstd.StdMode = 24) or (pstd.StdMode = 26) then begin
  155.             Result := TRUE;
  156.          end;
  157.       U_ARMRINGL:    //迫骂, 何利/刀啊风..
  158.          if (pstd.StdMode = 24) or (pstd.StdMode = 25) or (pstd.StdMode = 26) then begin
  159.             Result := TRUE;
  160.          end;
  161.       // 2003/03/15 酒捞袍 牢亥配府 犬厘
  162.       U_BUJUK:
  163.          if (pstd.StdMode = 25) then begin
  164.             Result := TRUE;
  165.          end;
  166.       U_BELT:
  167.          if (pstd.StdMode = 54) then begin
  168.             Result := TRUE;
  169.          end;
  170.       U_BOOTS:
  171.          if (pstd.StdMode = 52) then begin
  172.             Result := TRUE;
  173.          end;
  174.       U_CHARM:
  175.          if (pstd.StdMode = 53) then begin
  176.             Result := TRUE;
  177.          end;
  178.    end;
  179. end;

  180. function  IsDCItem (uindex: integer): Boolean;
  181. var
  182.    pstd: PTStdItem;
  183. begin
  184.    pstd := UserEngine.GetStdItem (uindex);
  185.    if pstd.StdMode in [5, 6, 10, 11, 15, 19, 20, 21, 22, 23, 24, 26,52,53,54] then
  186.       Result := TRUE
  187.    else
  188.       Result := FALSE;
  189. end;

  190. function  IsUpgradeWeaponStuff (uindex: integer): Boolean;
  191. var
  192.    pstd: PTStdItem;
  193. begin
  194.    pstd := UserEngine.GetStdItem (uindex);
  195.    if pstd.StdMode in [19, 20, 21, 22, 23, 24, 26,52,53,54] then
  196.       Result := TRUE
  197.    else
  198.       Result := FALSE;
  199. end;

  200. function  GetMakeItemCondition (itemname: string): TStringList;
  201. var
  202.    i: integer;
  203. begin
  204.    Result := nil;
  205.    for i:=0 to MakeItemList.Count-1 do begin
  206.       if MakeItemList = itemname then begin
  207.          Result := TStringList (MakeItemList.Objects);
  208.          break;
  209.       end;
  210.    end;
  211. end;


  212. function  GetTurnDir (dir, rotatecount: integer): byte;
  213. begin
  214.    Result := (dir + rotatecount) mod 8;
  215. end;

  216. function  IsCheapStuff (stdmode: integer): Boolean;
  217. begin
  218.    if stdmode in [0..2] then Result := TRUE
  219.    else Result := FALSE;
  220. end;
  221. end.
复制代码

分享名称:台湾引擎小火炬源码.zip
分享链接:http://pan.zxdll.cn:88/#s/9bcaSMHg
访问密码:
游客,如果您要查看本帖隐藏内容请回复





上一篇:传奇3官方1.45引擎源代码 - 小火炬源码
下一篇:C3Mir3全套delphi代码+控件包 光通刺客4职业
回复

使用道具 举报

1

主题

20

回帖

289

积分

旋风流星刀

积分
289
发表于 2023-7-2 19:37:08 | 显示全部楼层
瞧瞧什么代码
回复 支持 反对

使用道具 举报

1

主题

542

回帖

2

积分

旋风流星刀

积分
2
发表于 2023-8-22 19:18:45 | 显示全部楼层
感谢分享
回复

使用道具 举报

© 2001-2024 Discuz! Team. Powered by Discuz! X3.5

GMT+8, 2024-9-17 03:25 , Processed in 0.309227 second(s), 57 queries 手机版|美林GM论坛 ( 蜀ICP备2020030293号-2 )|网站地图

禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.如遇版权问题,请及时QQ联系

快速回复 返回顶部 返回列表