📄 playscn.pas
字号:
meff.Light := 2;
end;
27: begin //群体治疗术
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.MagExplosionBase := 1800;
meff.TargetActor := nil; //target;
meff.NextFrameTime := 80;
meff.ExplosionFrame := 10;
meff.Light := 3;
end;
30: begin //圣言术
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.MagExplosionBase := 3930;
meff.TargetActor := target;
meff.NextFrameTime := 80;
meff.ExplosionFrame := 16;
meff.Light := 3;
end;
31: begin //冰咆哮
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.MagExplosionBase := 3850;
meff.TargetActor := nil; //target;
meff.NextFrameTime := 80;
meff.ExplosionFrame := 20;
meff.Light := 3;
end;
34: begin //灭天火
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.MagExplosionBase := 140;
meff.TargetActor := target; //target;
meff.NextFrameTime := 80;
meff.ExplosionFrame := 20;
meff.Light := 3;
if wimg <> nil then
meff.ImgLib:=wimg;
end;
40: begin // 净化术
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.MagExplosionBase := 620;
meff.TargetActor := nil; //target;
meff.NextFrameTime := 100;
meff.ExplosionFrame := 20;
meff.Light := 3;
if wimg <> nil then
meff.ImgLib:=wimg;
end;
45: begin //火龙气焰
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.MagExplosionBase := 920;
meff.TargetActor := nil; //target;
meff.NextFrameTime := 100;
meff.ExplosionFrame := 20;
meff.Light := 3;
if wimg <> nil then
meff.ImgLib:=wimg;
end;
47: begin //飓风破
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.MagExplosionBase := 1010;
meff.TargetActor := nil; //target;
meff.NextFrameTime := 100;
meff.ExplosionFrame := 20;
meff.Light := 3;
if wimg <> nil then
meff.ImgLib:=wimg;
end;
48: begin //血咒
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.MagExplosionBase := 1060;
meff.TargetActor := nil; //target;
meff.NextFrameTime := 50;
meff.ExplosionFrame := 40;
meff.Light := 3;
if wimg <> nil then
meff.ImgLib:=wimg;
end;
49: begin //骷髅咒
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.MagExplosionBase := 1110;
meff.TargetActor := nil; //target;
meff.NextFrameTime := 100;
meff.ExplosionFrame := 10;
meff.Light := 3;
if wimg <> nil then
meff.ImgLib:=wimg;
end;
else begin //默认
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.TargetActor := target;
meff.NextFrameTime := 80;
end;
end;
mtFireWind:
meff := nil; //瓤苞 绝澜
mtFireGun: //拳堪规荤
meff := TFireGunEffect.Create (930, scx, scy, sctx, scty);
mtThunder: begin
//meff := TThuderEffect.Create (950, sctx, scty, nil); //target);
meff := TThuderEffect.Create (10, sctx, scty, nil); //target);
meff.ExplosionFrame := 6;
meff.ImgLib := g_WMagic2Images;
end;
mtLightingThunder:
meff := TLightingThunder.Create (970, scx, scy, sctx, scty, target);
mtExploBujauk: begin
case magnumb of
10: begin //
meff := TExploBujaukEffect.Create (1160, scx, scy, sctx, scty, target);
meff.MagExplosionBase := 1360;
end;
17: begin //
meff := TExploBujaukEffect.Create (1160, scx, scy, sctx, scty, target);
meff.MagExplosionBase := 1540;
end;
end;
bofly := TRUE;
end;
mtBujaukGroundEffect: begin
meff := TBujaukGroundEffect.Create (1160, magnumb, scx, scy, sctx, scty);
case magnumb of
11: meff.ExplosionFrame := 16; //
12: meff.ExplosionFrame := 16; //
46: meff.ExplosionFrame := 24;
end;
bofly := TRUE;
end;
mtKyulKai: begin
meff := nil; //TKyulKai.Create (1380, scx, scy, sctx, scty);
end;
mt12: begin
end;
mt13: begin
meff := TMagicEff.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
if meff <> nil then begin
case magnumb of
32: begin
meff.ImgLib := FrmMain.WMon21Img;
meff.MagExplosionBase:=3580;
meff.TargetActor := target;
meff.Light := 3;
meff.NextFrameTime := 20;
end;
37: begin
meff.ImgLib := FrmMain.WMon22Img;
meff.MagExplosionBase:=3520;
meff.TargetActor := target;
meff.Light := 5;
meff.NextFrameTime := 20;
end;
end;
end;
end;
mt14: begin
meff := TThuderEffect.Create (140, sctx, scty, nil); //target);
meff.ExplosionFrame := 10;
meff.ImgLib := g_WMagic2Images;
end;
mt15: begin
meff := TFlyingBug.Create (magid, effnum, scx, scy, sctx, scty, mtype, Recusion, anitime);
meff.TargetActor := target;
bofly:=True;
end;
mt16: begin
end;
end;
if (meff = nil) then exit;
meff.TargetRx := tx;
meff.TargetRy := ty;
if meff.TargetActor <> nil then begin
meff.TargetRx := TActor(meff.TargetActor).m_nCurrX;
meff.TargetRy := TActor(meff.TargetActor).m_nCurrY;
end;
meff.MagOwner := aowner;
m_EffectList.Add (meff);
end;
procedure TPlayScene.DelMagic (magid: integer);
var
i: integer;
begin
for i:=0 to m_EffectList.Count-1 do begin
if TMagicEff(m_EffectList[i]).ServerMagicId = magid then begin
TMagicEff(m_EffectList[i]).Free;
m_EffectList.Delete (i);
break;
end;
end;
end;
//cx, cy, tx, ty : 甘狼 谅钎
function TPlayScene.NewFlyObject (aowner: TActor; cx, cy, tx, ty, targetcode: integer; mtype: TMagicType): TMagicEff;
var
i, scx, scy, sctx, scty: integer;
meff: TMagicEff;
begin
ScreenXYfromMCXY (cx, cy, scx, scy);
ScreenXYfromMCXY (tx, ty, sctx, scty);
case mtype of
mtFlyArrow: meff := TFlyingArrow.Create (1, 1, scx, scy, sctx, scty, mtype, TRUE, 0);
mt12: meff := TFlyingFireBall.Create (1, 1, scx, scy, sctx, scty, mtype, TRUE, 0);
mt15: meff := TFlyingBug.Create (1, 1, scx, scy, sctx, scty, mtype, TRUE, 0);
else meff := TFlyingAxe.Create (1, 1, scx, scy, sctx, scty, mtype, TRUE, 0);
end;
meff.TargetRx := tx;
meff.TargetRy := ty;
meff.TargetActor := FindActor (targetcode);
meff.MagOwner := aowner;
m_FlyList.Add (meff);
Result := meff;
end;
//傈扁筋绰 粱厚狼 付过贸烦 辨霸 唱啊绰 付过
//effnum: 阿 锅龋付促 Base啊 促 促福促.
{function NewStaticMagic (aowner: TActor; tx, ty, targetcode, effnum: integer);
var
i, scx, scy, sctx, scty, effbase: integer;
meff: TMagicEff;
begin
ScreenXYfromMCXY (cx, cy, scx, scy);
ScreenXYfromMCXY (tx, ty, sctx, scty);
case effnum of
1: effbase := 340; //粱厚狼 扼捞飘醋狼 矫累 困摹
else exit;
end;
meff := TLightingEffect.Create (effbase, 1, 1, scx, scy, sctx, scty, mtype, TRUE, 0);
meff.TargetRx := tx;
meff.TargetRy := ty;
meff.TargetActor := FindActor (targetcode);
meff.MagOwner := aowner;
FlyList.Add (meff);
Result := meff;
end; }
{-------------------------------------------------------}
//甘 谅钎拌肺 伎 吝居狼 胶农赴 谅钎甫 掘绢晨
{procedure TPlayScene.ScreenXYfromMCXY (cx, cy: integer; var sx, sy: integer);
begin
if Myself = nil then exit;
sx := -UNITX*2 - Myself.ShiftX + AAX + 14 + (cx - Map.ClientRect.Left) * UNITX + UNITX div 2;
sy := -UNITY*3 - Myself.ShiftY + (cy - Map.ClientRect.Top) * UNITY + UNITY div 2;
end; }
procedure TPlayScene.ScreenXYfromMCXY (cx, cy: integer; var sx, sy: integer);
begin
if g_MySelf = nil then exit;
{$IF SWH = SWH800}
sx := (cx-g_MySelf.m_nRx)*UNITX + 364 + UNITX div 2 - g_MySelf.m_nShiftX;
sy := (cy-g_MySelf.m_nRy)*UNITY + 192 + UNITY div 2 - g_MySelf.m_nShiftY;
{$ELSEIF SWH = SWH1024}
sx := (cx-g_MySelf.m_nRx)*UNITX + 485{364} + UNITX div 2 - g_MySelf.m_nShiftX;
sy := (cy-g_MySelf.m_nRy)*UNITY + 270{192} + UNITY div 2 - g_MySelf.m_nShiftY;
{$IFEND}
end;
//屏幕座标 mx, my转换成ccx, ccy地图座标
procedure TPlayScene.CXYfromMouseXY (mx, my: integer; var ccx, ccy: integer);
begin
if g_MySelf = nil then exit;
{$IF SWH = SWH800}
ccx := Round((mx - 364 + g_MySelf.m_nShiftX - UNITX) / UNITX) + g_MySelf.m_nRx;
ccy := Round((my - 192 + g_MySelf.m_nShiftY - UNITY) / UNITY) + g_MySelf.m_nRy;
{$ELSEIF SWH = SWH1024}
ccx := Round((mx - 485{364} + g_MySelf.m_nShiftX - UNITX) / UNITX) + g_MySelf.m_nRx;
ccy := Round((my - 270{192} + g_MySelf.m_nShiftY - UNITY) / UNITY) + g_MySelf.m_nRy;
{$IFEND}
end;
//拳搁谅钎肺 某腐磐, 侨伎 窜困肺 急琶..
function TPlayScene.GetCharacter (x, y, wantsel: integer; var nowsel: integer; liveonly: Boolean): TActor;
var
k, i, ccx, ccy, dx, dy: integer;
a: TActor;
begin
Result := nil;
nowsel := -1;
CXYfromMouseXY (x, y, ccx, ccy);
for k:=ccy+8 downto ccy-1 do begin
for i:=m_ActorList.Count-1 downto 0 do
if TActor(m_ActorList[i]) <> g_MySelf then begin
a := TActor(m_ActorList[i]);
if (not liveonly or not a.m_boDeath) and (a.m_boHoldPlace) and (a.m_boVisible) then begin
if a.m_nCurrY = k then begin
//歹 承篮 裹困肺 急琶登霸
dx := (a.m_nRx-Map.m_ClientRect.Left)*UNITX + m_nDefXX + a.m_nPx + a.m_nShiftX;
dy := (a.m_nRy-Map.m_ClientRect.Top-1)*UNITY + m_nDefYY + a.m_nPy + a.m_nShiftY;
if a.CheckSelect (x-dx, y-dy) then begin
Result := a;
Inc (nowsel);
if nowsel >= wantsel then
exit;
end;
end;
end;
end;
end;
end;
//取得鼠标所指坐标的角色
function TPlayScene.GetAttackFocusCharacter (x, y, wantsel: integer; var nowsel: integer; liveonly: Boolean): TActor;
var
k, i, ccx, ccy, dx, dy, centx, centy: integer;
a: TActor;
begin
Result := GetCharacter (x, y, wantsel, nowsel, liveonly);
if Result = nil then begin
nowsel := -1;
CXYfromMouseXY (x, y, ccx, ccy);
for k:=ccy+8 downto ccy-1 do begin
for i:=m_ActorList.Count-1 downto 0 do
if TActor(m_ActorList[i]) <> g_MySelf then begin
a := TActor(m_ActorList[i]);
if (not liveonly or not a.m_boDeath) and (a.m_boHoldPlace) and (a.m_boVisible) then begin
if a.m_nCurrY = k then begin
//
dx := (a.m_nRx-Map.m_ClientRect.Left)*UNITX + m_nDefXX + a.m_nPx + a.m_nShiftX;
dy := (a.m_nRy-Map.m_ClientRect.Top-1)*UNITY+ m_nDefYY + a.m_nPy + a.m_nShiftY;
if a.CharWidth > 40 then centx := (a.CharWidth - 40) div 2
else centx := 0;
if a.CharHeight > 70 then centy := (a.CharHeight - 70) div 2
else centy := 0;
if (x-dx >= centx) and (x-dx <= a.CharWidth-centx) and (y-dy >= centy) and (y-dy <= a.CharHeight-centy) then begin
Result := a;
Inc (nowsel);
if nowsel >= wantsel then
exit;
end;
end;
end;
end;
end;
end;
end;
function TPlayScene.IsSelectMyself (x, y: integer): Boolean;
var
k, i, ccx, ccy, dx, dy: integer;
begin
Result := FALSE;
CXYfromMouseXY (x, y, ccx, ccy);
for k:=ccy+2 downto ccy-1 do begin
if g_MySelf.m_nCurrY = k then begin
//歹 承篮 裹困肺 急琶登霸
dx:=(g_MySelf.m_nRx - Map.m_ClientRect.Left) * UNITX + m_nDefXX + g_MySelf.m_nPx + g_MySelf.m_nShiftX;
dy:=(g_MySelf.m_nRy - Map.m_ClientRect.Top - 1) * UNITY + m_nDefYY + g_MySelf.m_nPy + g_MySelf.m_nShiftY;
if g_MySelf.CheckSelect (x-dx, y-dy) then begin
Result := TRUE;
exit;
end;
end;
end;
end;
//取得指定座标地面物品
// x,y 为屏幕座标
function TPlayScene.GetDropItems (x, y: integer; var inames: string): PTDropItem; //拳搁谅钎肺 酒捞袍
var
k, i, ccx, ccy, ssx, ssy, dx, dy: integer;
DropItem:PTDropItem;
s: TDirectDrawSurface;
c: byte;
begin
Result := nil;
CXYfr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -