summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: da68968)
raw | patch | inline | side by side (parent: da68968)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 9 Jun 2022 20:31:36 +0000 (23:31 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 08:41:56 +0000 (11:41 +0300) |
src/game/renders/opengl/r_map.pas | patch | blob | history |
index a87abcf15e742582596d3b388efd7ac04f5d8b7e..d33433860f5f24f12268f9996eda4e884fc53e99 100644 (file)
end;
end;
- procedure r_Map_DrawPlayerModel (pm: TPlayerModel; x, y: Integer);
+ procedure r_Map_DrawPlayerModel (pm: TPlayerModel; x, y: Integer; alpha: Byte);
var a, pos, act, xx, yy, angle: Integer; d: TDirection; flip: Boolean; t: TGLMultiTexture; tex: TGLTexture; c: TRGB;
begin
a := pm.CurrentAnimation;
if r_Map_GetPlayerModelTex(pm.id, a, d, flip) then
begin
t := Models[pm.id].anim[d, a].base;
- r_Draw_MultiTextureRepeat(t, pm.AnimState, x, y, t.width, t.height, flip, 255, 255, 255, 255, false);
+ r_Draw_MultiTextureRepeat(t, pm.AnimState, x, y, t.width, t.height, flip, 255, 255, 255, alpha, false);
t := Models[pm.id].anim[d, a].mask;
if t <> nil then
begin
c := pm.Color;
- r_Draw_MultiTextureRepeat(t, pm.AnimState, x, y, t.width, t.height, flip, c.r, c.g, c.b, 255, false);
+ r_Draw_MultiTextureRepeat(t, pm.AnimState, x, y, t.width, t.height, flip, c.r, c.g, c.b, alpha, false);
end;
end;
end;
procedure r_Map_DrawPlayer (p, drawed: TPlayer);
- var fX, fY, fSlope, ax, ay, w, h: Integer; b, flip: Boolean; t: TGLMultiTexture;
+ var fX, fY, fSlope, ax, ay, w, h: Integer; b, flip: Boolean; t: TGLMultiTexture; alpha: Byte;
begin
if p.alive then
begin
// TODO fix lerp
//p.obj.Lerp(gLerpFactor, fX, fY);
fSlope := nlerp(p.SlopeOld, p.obj.slopeUpLeft, gLerpFactor);
+
+ (* punch effect *)
if p.PunchAnim.IsValid() and p.PunchAnim.enabled then
begin
b := R_BERSERK in p.FRulez;
r_Draw_MultiTextureRepeat(t, p.PunchAnim, fx + ax, fy + fSlope + ay, t.width, t.height, flip, 255, 255, 255, 255, false)
end;
end;
+
+ (* invulnerability effect *)
if (InvulPenta <> nil) and (p.FMegaRulez[MR_INVUL] > gTime) and ((p <> drawed) or (p.SpawnInvul >= gTime)) then
begin
w := InvulPenta.width;
ay := p.Obj.Rect.Y + (p.Obj.Rect.Height div 2) - (h div 2) - 7; // ???
r_Draw_Texture(InvulPenta, fx + ax, fy + ay + fSlope, w, h, false, 255, 255, 255, 255, false);
end;
- // TODO draw it with transparency
- r_Map_DrawPlayerModel(p.Model, fX, fY + fSlope);
+
+ (* invisibility effect *)
+ alpha := 255;
+ if p.FMegaRulez[MR_INVIS] > gTime then
+ begin
+ if (drawed <> nil) and ((p = drawed) or ((p.Team = drawed.Team) and (gGameSettings.GameMode <> GM_DM))) then
+ begin
+ if (p.FMegaRulez[MR_INVIS] - gTime <= 2100) and not ODD((p.FMegaRulez[MR_INVIS] - gTime) div 300) then
+ alpha := 55;
+ end
+ else
+ alpha := 1; // ???
+ end;
+
+ r_Map_DrawPlayerModel(p.Model, fX, fY + fSlope, alpha);
end;
// TODO draw g_debug_frames
// TODO draw chat bubble
if (p <> nil) and (p.state <> CORPSE_STATE_REMOVEME) and (p.model <> nil) then
begin
p.obj.Lerp(gLerpFactor, fX, fY);
- r_Map_DrawPlayerModel(p.model, fX, fY);
+ r_Map_DrawPlayerModel(p.model, fX, fY, 255);
end;
end;
end;