diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index d03247cdc5e4e3f2505078aa28ccd5f165f70f55..a0496da85e63e8314c938bcea0aa18bd7a957495 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
FObj: TObj;
FXTo, FYTo: Integer;
FSpectatePlayer: Integer;
+ FFirePainTime: Integer;
FSavedState: TPlayerSavedState;
function FullInLift(XInc, YInc: Integer): Integer;
{procedure CollideItem();}
procedure FlySmoke(Times: DWORD = 1);
+ procedure OnFireFlame(Times: DWORD = 1);
function GetAmmoByWeapon(Weapon: Byte): Word;
procedure SetAction(Action: Byte; Force: Boolean = False);
procedure OnDamage(Angle: SmallInt); virtual;
FPing: Word;
FLoss: Byte;
FDummy: Boolean;
+ FFireTime: Integer;
constructor Create(); virtual;
destructor Destroy(); override;
procedure RealizeCurrentWeapon();
procedure JetpackOn;
procedure JetpackOff;
+ procedure CatchFire();
property Name: String read FName write FName;
property Model: TPlayerModel read FModel;
FLoss := 0;
FSavedState.WaitRecall := False;
FShellTimer := -1;
+ FFireTime := 0;
+ FFirePainTime := 0;
FActualModelName := 'doomer';
WEAPON_FLAMETHROWER:
if FAmmo[A_FUEL] > 0 then
begin
+ g_Weapon_flame(wx, wy, xd, yd, FUID);
FReloading[FCurrWeap] := WEAPON_RELOAD[FCurrWeap];
Dec(FAmmo[A_FUEL]);
FFireAngle := FAngle;
FJetSoundOff.PlayAt(FObj.X, FObj.Y);
end;
+procedure TPlayer.CatchFire();
+begin
+ FFireTime := 360;
+ if g_Game_IsNet and g_Game_IsServer then
+ MH_SEND_PlayerStats(FUID);
+end;
+
procedure TPlayer.Jump();
begin
if gFly or FJetpack then
end else if FAir < AIR_DEF then
FAir := AIR_DEF;
+ if FFireTime > 0 then
+ begin
+ if BodyInLiquid(0, 0) then
+ begin
+ FFireTime := 0;
+ FFirePainTime := 0;
+ end
+ else
+ begin
+ OnFireFlame(1);
+ if FFirePainTime <= 0 then
+ begin
+ if g_Game_IsServer then
+ Damage(5, 0, 0, 0, HIT_FLAME);
+ FFirePainTime := 18;
+ end;
+ FFirePainTime := FFirePainTime - 1;
+ FFireTime := FFireTime - 1;
+ if (FFireTime = 0) and g_Game_IsNet and g_Game_IsServer then
+ MH_SEND_PlayerStats(FUID);
+ end;
+ end;
+
if FDamageBuffer > 0 then
begin
if FDamageBuffer >= 9 then
WEAPON_FLAMETHROWER:
begin
+ g_Weapon_flame(wx, wy, xd, yd, FUID, WID);
FFireAngle := FAngle;
f := True;
end;
end;
end;
+procedure TPlayer.OnFireFlame(Times: DWORD = 1);
+var
+ id, i: DWORD;
+ Anim: TAnimation;
+begin
+ if (Random(10) = 1) and (Times = 1) then
+ Exit;
+
+ if g_Frames_Get(id, 'FRAMES_FLAME') then
+ begin
+ for i := 1 to Times do
+ begin
+ Anim := TAnimation.Create(id, False, 3);
+ Anim.Alpha := 0;
+ g_GFX_OnceAnim(Obj.X+Obj.Rect.X+Random(Obj.Rect.Width+Times*2)-(Anim.Width div 2),
+ Obj.Y+8+Random(8+Times*2), Anim, ONCEANIM_SMOKE);
+ Anim.Free();
+ end;
+ end;
+end;
+
procedure TPlayer.PauseSounds(Enable: Boolean);
begin
FSawSound.Pause(Enable);