summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c2a61ca)
raw | patch | inline | side by side (parent: c2a61ca)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 16 Jan 2022 17:22:21 +0000 (20:22 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 16 Jan 2022 17:22:21 +0000 (20:22 +0300) |
src/game/g_player.pas | patch | blob | history | |
src/game/g_playermodel.pas | patch | blob | history | |
src/game/opengl/r_playermodel.pas | patch | blob | history |
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index c2605a092509cd28d1f5bbf36c64a5e7fb7a1014..72766a7600dfb533dcd8ba085812a85f0c2d3d3a 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
if (FModel.AnimState.Played or ((not FActionChanged) and (FModel.Animation = A_WALK)))
then SetAction(A_STAND, True);
- if not ((FModel.Animation = A_WALK) and (Abs(FObj.Vel.X) < 4) and not FModel.Fire) then FModel.Update;
+ if not ((FModel.Animation = A_WALK) and (Abs(FObj.Vel.X) < 4) and not FModel.GetFire()) then FModel.Update;
for b := Low(FKeys) to High(FKeys) do
if FKeys[b].Time = 0 then FKeys[b].Pressed := False else Dec(FKeys[b].Time);
index 34fc9e71ef620206bbe9a4eda0a0f21923294519..393e07d6fa7f426cfad03d5b3f83f82033ed89bf 100644 (file)
FAnimState: TAnimationState;
FCurrentWeapon: Byte;
FFlag: Byte;
- FFire: Boolean;
FFireCounter: Byte;
FID: Integer;
procedure SetColor(Red, Green, Blue: Byte);
procedure SetWeapon(Weapon: Byte);
procedure SetFlag(Flag: Byte);
- procedure SetFire(Fire: Boolean);
+ procedure SetFire (Fire: Boolean);
+ function GetFire (): Boolean;
function PlaySound(SoundType, Level: Byte; X, Y: Integer): Boolean;
procedure Update();
function GetName (): String;
published
- property Fire: Boolean read FFire;
property Direction: TDirection read FDirection write FDirection;
property Animation: Byte read FCurrentAnimation;
property Weapon: Byte read FCurrentWeapon;
FColor.B := Blue;
end;
-procedure TPlayerModel.SetFire(Fire: Boolean);
-begin
- FFire := Fire;
- if FFire then
- FFireCounter := PlayerModelsArray[FID].ModelSpeed[A_ATTACK] * PlayerModelsArray[FID].Anim[TDirection.D_RIGHT, A_ATTACK].Frames
- else
- FFireCounter := 0
-end;
+ procedure TPlayerModel.SetFire (Fire: Boolean);
+ begin
+ if Fire then
+ FFireCounter := PlayerModelsArray[FID].ModelSpeed[A_ATTACK] * PlayerModelsArray[FID].Anim[TDirection.D_RIGHT, A_ATTACK].Frames
+ else
+ FFireCounter := 0
+ end;
+
+ function TPlayerModel.GetFire (): Boolean;
+ begin
+ Result := FFireCounter > 0
+ end;
procedure TPlayerModel.SetFlag (Flag: Byte);
begin
FAnimState.Update;
if FFireCounter > 0 then
Dec(FFireCounter)
- else
- FFire := False
end;
procedure g_PlayerModel_LoadAll;
index b90ed0514249c89a076237d89b6016c38bef7740..0914bd007798e7991277bddd9ee3c43cae32b4cc 100644 (file)
else
pos := W_POS_NORMAL;
- if (pm.CurrentAnimation in [A_ATTACK, A_ATTACKUP, A_ATTACKDOWN]) or pm.Fire then
+ if (pm.CurrentAnimation in [A_ATTACK, A_ATTACKUP, A_ATTACKDOWN]) or pm.GetFire() then
act := W_ACT_FIRE
else
act := W_ACT_NORMAL;