📄 magiceff.pas
字号:
shx := (g_MySelf.m_nRx * UNITX + g_MySelf.m_nShiftX) - FireMyselfX;
shy := (g_MySelf.m_nRy * UNITY + g_MySelf.m_nShiftY) - FireMyselfY;
if not FixedEffect then begin
if (ServerMagicid = 81) or (ServerMagicid = 82) or (ServerMagicid = 83) or (magnumber = 47) then begin
img := EffectBase;
d := ImgLib.GetCachedImage (img + curframe, px, py);
end else begin
img := EffectBase + FLYBASE + Dir16 * 10;
d := ImgLib.GetCachedImage (img + curframe, px, py);
end;
if d <> nil then begin
DrawBlend (surface,
FlyX + px - UNITX div 2 - shx,
FlyY + py - UNITY div 2 - shy,
d, 1);
end;
end else begin
//磐瘤绰芭
img := MagExplosionBase + curframe; //EXPLOSIONBASE;
d := ImgLib.GetCachedImage (img, px, py);
if d <> nil then begin
DrawBlend (surface,
FlyX + px - UNITX div 2,
FlyY + py - UNITY div 2,
d, 1);
end;
end;
end;
end;
{------------------------------------------------------------}
// TFlyingAxe : 朝酒啊绰 档尝
{------------------------------------------------------------}
constructor TFlyingAxe.Create (id, effnum, sx, sy, tx, ty: integer; mtype: TMagicType; Recusion: Boolean; anitime: integer);
begin
inherited Create (id, effnum, sx, sy, tx, ty, mtype, Recusion, anitime);
FlyImageBase := FLYOMAAXEBASE;
ReadyFrame := 65;
end;
procedure TFlyingAxe.DrawEff (surface: TDirectDrawSurface);
var
img: integer;
d: TDirectDrawSurface;
shx, shy: integer;
begin
if m_boActive and ((Abs(FlyX-fireX) > ReadyFrame) or (Abs(FlyY-fireY) > ReadyFrame)) then begin
shx := (g_MySelf.m_nRx * UNITX + g_MySelf.m_nShiftX) - FireMyselfX;
shy := (g_MySelf.m_nRy * UNITY + g_MySelf.m_nShiftY) - FireMyselfY;
if not FixedEffect then begin
//
img := FlyImageBase + Dir16 * 10;
d := ImgLib.GetCachedImage (img + curframe, px, py);
if d <> nil then begin
//舅颇喉珐爹窍瘤 臼澜
surface.Draw (FlyX + px - UNITX div 2 - shx,
FlyY + py - UNITY div 2 - shy,
d.ClientRect, d, TRUE);
end;
end else begin
{//沥瘤, 档尝俊 嘛腮 葛嚼.
img := FlyImageBase + Dir16 * 10;
d := ImgLib.GetCachedImage (img, px, py);
if d <> nil then begin
//舅颇喉珐爹窍瘤 臼澜
surface.Draw (FlyX + px - UNITX div 2,
FlyY + py - UNITY div 2,
d.ClientRect, d, TRUE);
end; }
end;
end;
end;
{------------------------------------------------------------}
// TFlyingArrow :
{------------------------------------------------------------}
procedure TFlyingArrow.DrawEff (surface: TDirectDrawSurface);
var
img: integer;
d: TDirectDrawSurface;
shx, shy: integer;
begin
//(**6岿菩摹
if m_boActive and ((Abs(FlyX-fireX) > 40) or (Abs(FlyY-fireY) > 40)) then begin
//*)
(**捞傈
if Active then begin //and ((Abs(FlyX-fireX) > 65) or (Abs(FlyY-fireY) > 65)) then begin
//*)
shx := (g_MySelf.m_nRx * UNITX + g_MySelf.m_nShiftX) - FireMyselfX;
shy := (g_MySelf.m_nRy * UNITY + g_MySelf.m_nShiftY) - FireMyselfY;
if not FixedEffect then begin
//朝酒啊绰芭
img := FlyImageBase + Dir16; // * 10;
d := ImgLib.GetCachedImage (img + curframe, px, py);
//(**6岿菩摹
if d <> nil then begin
//舅颇喉珐爹窍瘤 臼澜
surface.Draw (FlyX + px - UNITX div 2 - shx,
FlyY + py - UNITY div 2 - shy - 46,
d.ClientRect, d, TRUE);
end;
//**)
(***捞傈
if d <> nil then begin
//舅颇喉珐爹窍瘤 臼澜
surface.Draw (FlyX + px - UNITX div 2 - shx,
FlyY + py - UNITY div 2 - shy,
d.ClientRect, d, TRUE);
end;
//**)
end;
end;
end;
{--------------------------------------------------------}
constructor TCharEffect.Create (effbase, effframe: integer; target: TObject);
begin
inherited Create (111, effbase,
TActor(target).m_nCurrX, TActor(target).m_nCurrY,
TActor(target).m_nCurrX, TActor(target).m_nCurrY,
mtExplosion,
FALSE,
0);
TargetActor := target;
frame := effframe;
NextFrameTime := 30;
end;
function TCharEffect.Run: Boolean;
begin
Result := TRUE;
if GetTickCount - steptime > longword(NextFrameTime) then begin
steptime := GetTickCount;
Inc (curframe);
if curframe > start+frame-1 then begin
curframe := start+frame-1;
Result := FALSE;
end;
end;
end;
procedure TCharEffect.DrawEff (surface: TDirectDrawSurface);
var
d: TDirectDrawSurface;
begin
if TargetActor <> nil then begin
Rx := TActor(TargetActor).m_nRx;
Ry := TActor(TargetActor).m_nRy;
PlayScene.ScreenXYfromMCXY (Rx, Ry, FlyX, FlyY);
FlyX := FlyX + TActor(TargetActor).m_nShiftX;
FlyY := FlyY + TActor(TargetActor).m_nShiftY;
d := ImgLib.GetCachedImage (EffectBase + curframe, px, py);
if d <> nil then begin
DrawBlend (surface,
FlyX + px - UNITX div 2,
FlyY + py - UNITY div 2,
d, 1);
end;
end;
end;
{--------------------------------------------------------}
constructor TMapEffect.Create (effbase, effframe: integer; x, y: integer);
begin
inherited Create (111, effbase,
x, y,
x, y,
mtExplosion,
FALSE,
0);
TargetActor := nil;
frame := effframe;
NextFrameTime := 30;
RepeatCount := 0;
end;
function TMapEffect.Run: Boolean;
begin
Result := TRUE;
if GetTickCount - steptime > longword(NextFrameTime) then begin
steptime := GetTickCount;
Inc (curframe);
if curframe > start+frame-1 then begin
curframe := start+frame-1;
if RepeatCount > 0 then begin
Dec (RepeatCount);
curframe := start;
end else
Result := FALSE;
end;
end;
end;
procedure TMapEffect.DrawEff (surface: TDirectDrawSurface);
var
d: TDirectDrawSurface;
begin
Rx := TargetX;
Ry := TargetY;
PlayScene.ScreenXYfromMCXY (Rx, Ry, FlyX, FlyY);
d := ImgLib.GetCachedImage (EffectBase + curframe, px, py);
if d <> nil then begin
DrawBlend (surface,
FlyX + px - UNITX div 2,
FlyY + py - UNITY div 2,
d, 1);
end;
end;
{--------------------------------------------------------}
constructor TScrollHideEffect.Create (effbase, effframe: integer; x, y: integer; target: TObject);
begin
inherited Create (effbase, effframe, x, y);
//TargetCret := TActor(target);//在出现有人用随机之类时,将设置目标
end;
function TScrollHideEffect.Run: Boolean;
begin
Result := inherited Run;
if frame = 7 then
if g_TargetCret <> nil then
PlayScene.DeleteActor (g_TargetCret.m_nRecogId);
end;
{--------------------------------------------------------}
constructor TLightingEffect.Create (effbase, effframe: integer; x, y: integer);
begin
end;
function TLightingEffect.Run: Boolean;
begin
Result:=False;//Jacky
end;
{--------------------------------------------------------}
constructor TFireGunEffect.Create (effbase, sx, sy, tx, ty: integer);
begin
inherited Create (111, effbase,
sx, sy,
tx, ty, //TActor(target).XX, TActor(target).m_nCurrY,
mtFireGun,
TRUE,
0);
NextFrameTime := 50;
FillChar (FireNodes, sizeof(TFireNode)*FIREGUNFRAME, #0);
OutofOil := FALSE;
firetime := GetTickCount;
end;
function TFireGunEffect.Run: Boolean;
var
i, fx, fy: integer;
allgone: Boolean;
begin
Result := TRUE;
if GetTickCount - steptime > longword(NextFrameTime) then begin
Shift;
steptime := GetTickCount;
//if not FixedEffect then begin //格钎俊 嘎瘤 臼疽栏搁
if not OutofOil then begin
if (abs(RX-TActor(MagOwner).m_nRx) >= 5) or (abs(RY-TActor(MagOwner).m_nRy) >= 5) or (GetTickCount - firetime > 800) then
OutofOil := TRUE;
for i:=FIREGUNFRAME-2 downto 0 do begin
FireNodes[i].FireNumber := FireNodes[i].FireNumber + 1;
FireNodes[i+1] := FireNodes[i];
end;
FireNodes[0].FireNumber := 1;
FireNodes[0].x := FlyX;
FireNodes[0].y := FlyY;
end else begin
allgone := TRUE;
for i:=FIREGUNFRAME-2 downto 0 do begin
if FireNodes[i].FireNumber <= FIREGUNFRAME then begin
FireNodes[i].FireNumber := FireNodes[i].FireNumber + 1;
FireNodes[i+1] := FireNodes[i];
allgone := FALSE;
end;
end;
if allgone then Result := FALSE;
end;
end;
end;
procedure TFireGunEffect.DrawEff (surface: TDirectDrawSurface);
var
i, num, shx, shy, firex, firey, prx, pry, img: integer;
d: TDirectDrawSurface;
begin
prx := -1;
pry := -1;
for i:=0 to FIREGUNFRAME-1 do begin
if (FireNodes[i].FireNumber <= FIREGUNFRAME) and (FireNodes[i].FireNumber > 0) then begin
shx := (g_MySelf.m_nRx * UNITX + g_MySelf.m_nShiftX) - FireMyselfX;
shy := (g_MySelf.m_nRy * UNITY + g_MySelf.m_nShiftY) - FireMyselfY;
img := EffectBase + (FireNodes[i].FireNumber - 1);
d := ImgLib.GetCachedImage (img, px, py);
if d <> nil then begin
firex := FireNodes[i].x + px - UNITX div 2 - shx;
firey := FireNodes[i].y + py - UNITY div 2 - shy;
if (firex <> prx) or (firey <> pry) then begin
prx := firex;
pry := firey;
DrawBlend (surface, firex, firey, d, 1);
end;
end;
end;
end;
end;
{--------------------------------------------------------}
constructor TThuderEffect.Create (effbase, tx, ty: integer; target: TObject);
begin
inherited Create (111, effbase,
tx, ty,
tx, ty, //TActor(target).XX, TActor(target).m_nCurrY,
mtThunder,
FALSE,
0);
TargetActor := target;
end;
procedure TThuderEffect.DrawEff (surface: TDirectDrawSurface);
var
img, px, py: integer;
d: TDirectDrawSurface;
begin
img := EffectBase;
d := ImgLib.GetCachedImage (img + curframe, px, py);
if d <> nil then begin
DrawBlend (surface,
FlyX + px - UNITX div 2,
FlyY + py - UNITY div 2,
d, 1);
end;
end;
{--------------------------------------------------------}
constructor TLightingThunder.Create (effbase, sx, sy, tx, ty: integer; target: TObject);
begin
inherited Create (111, effbase,
sx, sy,
tx, ty, //TActor(target).XX, TActor(target).m_nCurrY,
mtLightingThunder,
FALSE,
0);
TargetActor := target;
end;
procedure TLightingThunder.DrawEff (surface: TDirectDrawSurface);
var
img, sx, sy, px, py, shx, shy: integer;
d: TDirectDrawSurface;
begin
img := EffectBase + Dir16 * 10;
if curframe < 6 then begin
shx := (g_MySelf.m_nRx * UNITX + g_MySelf.m_nShiftX) - FireMyselfX;
shy := (g_MySelf.m_nRy * UNITY + g_MySelf.m_nShiftY) - FireMyselfY;
d := ImgLib.GetCachedImage (img + curframe, px, py);
if d <> nil then begin
PlayScene.ScreenXYfromMCXY (TActor(MagOwner).m_nRx,
TActor(MagOwner).m_nRy,
sx,
sy);
DrawBlend (surface,
sx + px - UNITX div 2,
sy + py - UNITY div 2,
d, 1);
end;
end;
{if (curframe < 10) and (TargetActor <> nil) then begin
d := ImgLib.GetCachedImage (EffectBase + 17*10 + curframe, px, py);
if d <> nil then begin
PlayScene.ScreenXYfromMCXY (TActor(TargetActor).RX,
TActor(TargetActor).RY,
sx,
sy);
DrawBlend (surface,
sx + px - UNITX div 2,
sy + py - UNITY div 2,
d, 1);
end;
end;}
end;
{--------------------------------------------------------}
constructor TExploBujaukEffect.Create (effbase, sx, sy, tx, ty: integer; target: TObject);
begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -