index 8ffb589787109f0a7ccf680e619b87c4dea97ea4..393e07d6fa7f426cfad03d5b3f83f82033ed89bf 100644 (file)
FColor: TRGB;
FCurrentAnimation: Byte;
FAnimState: TAnimationState;
FColor: TRGB;
FCurrentAnimation: Byte;
FAnimState: TAnimationState;
- FPainSounds: TModelSoundArray;
- FDieSounds: TModelSoundArray;
- FSlopSound: Byte;
FCurrentWeapon: Byte;
FFlag: Byte;
FCurrentWeapon: Byte;
FFlag: Byte;
- FFlagPoint: TDFPoint;
- FFlagAngle: SmallInt;
- FFlagAnim: TAnimation; // !!! TAnimationState
- FFire: Boolean;
FFireCounter: Byte;
FID: Integer;
FFireCounter: Byte;
FID: Integer;
procedure SetColor(Red, Green, Blue: Byte);
procedure SetWeapon(Weapon: Byte);
procedure SetFlag(Flag: Byte);
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 PlaySound(SoundType, Level: Byte; X, Y: Integer): Boolean;
procedure Update();
function GetName (): String;
published
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;
public
property Color: TRGB read FColor write FColor;
property Direction: TDirection read FDirection write FDirection;
property Animation: Byte read FCurrentAnimation;
property Weapon: Byte read FCurrentWeapon;
public
property Color: TRGB read FColor write FColor;
-
property AnimState: TAnimationState read FAnimState;
property CurrentAnimation: Byte read FCurrentAnimation;
property AnimState: TAnimationState read FAnimState;
property CurrentAnimation: Byte read FCurrentAnimation;
-
property CurrentWeapon: Byte read FCurrentWeapon;
property CurrentWeapon: Byte read FCurrentWeapon;
-
property Flag: Byte read FFlag;
property Flag: Byte read FFlag;
- property FlagAnim: TAnimation read FFlagAnim;
- property FlagAngle: SmallInt read FFlagAngle;
- property FlagPoint: TDFPoint read FFlagPoint;
-
property ID: Integer read FID;
end;
property ID: Integer read FID;
end;
with PlayerModelsArray[a] do
begin
with PlayerModelsArray[a] do
begin
- Result.FPainSounds := PainSounds;
- Result.FDieSounds := DieSounds;
- Result.FSlopSound := SlopSound;
-
- Result.FFlagPoint := FlagPoint;
- Result.FFlagAngle := FlagAngle;
Result.FID := a;
Result.FID := a;
-
Result.ChangeAnimation(A_STAND, True);
Result.ChangeAnimation(A_STAND, True);
-
Break;
end;
end;
Break;
end;
end;
if SoundType = MODELSOUND_PAIN then
begin
if SoundType = MODELSOUND_PAIN then
begin
- if FPainSounds = nil then Exit;
+ if PlayerModelsArray[FID].PainSounds = nil then Exit;
- for a := 0 to High(FPainSounds) do
- if FPainSounds[a].Level = Level then
+ for a := 0 to High(PlayerModelsArray[FID].PainSounds) do
+ if PlayerModelsArray[FID].PainSounds[a].Level = Level then
begin
begin
- SetLength(TempArray, Length(TempArray)+1);
- TempArray[High(TempArray)] := FPainSounds[a].ID;
+ SetLength(TempArray, Length(TempArray) + 1);
+ TempArray[High(TempArray)] := PlayerModelsArray[FID].PainSounds[a].ID;
end;
end
else
begin
end;
end
else
begin
- if (Level in [2, 3, 5]) and (FSlopSound > 0) then
+ if (Level in [2, 3, 5]) and (PlayerModelsArray[FID].SlopSound > 0) then
begin
g_Sound_PlayExAt('SOUND_MONSTER_SLOP', X, Y);
begin
g_Sound_PlayExAt('SOUND_MONSTER_SLOP', X, Y);
- if FSlopSound = 1 then
+ if PlayerModelsArray[FID].SlopSound = 1 then
begin
Result := True;
Exit;
end;
end;
begin
Result := True;
Exit;
end;
end;
- if FDieSounds = nil then Exit;
+ if PlayerModelsArray[FID].DieSounds = nil then Exit;
- for a := 0 to High(FDieSounds) do
- if FDieSounds[a].Level = Level then
+ for a := 0 to High(PlayerModelsArray[FID].DieSounds) do
+ if PlayerModelsArray[FID].DieSounds[a].Level = Level then
begin
begin
- SetLength(TempArray, Length(TempArray)+1);
- TempArray[High(TempArray)] := FDieSounds[a].ID;
+ SetLength(TempArray, Length(TempArray) + 1);
+ TempArray[High(TempArray)] := PlayerModelsArray[FID].DieSounds[a].ID;
end;
if (TempArray = nil) and (Level = 5) then
begin
end;
if (TempArray = nil) and (Level = 5) then
begin
FColor.B := Blue;
end;
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.SetFlag(Flag: Byte);
-var
- tid: DWORD;
-begin
- FFlag := Flag;
-
- FFlagAnim.Free();
- FFlagAnim := nil;
+ 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;
- case Flag of
- FLAG_RED: g_Frames_Get(tid, 'FRAMES_FLAG_RED');
- FLAG_BLUE: g_Frames_Get(tid, 'FRAMES_FLAG_BLUE');
- else Exit;
+ function TPlayerModel.GetFire (): Boolean;
+ begin
+ Result := FFireCounter > 0
end;
end;
- FFlagAnim := TAnimation.Create(tid, True, 8);
-end;
+ procedure TPlayerModel.SetFlag (Flag: Byte);
+ begin
+ FFlag := Flag
+ end;
- procedure TPlayerModel.SetWeapon(Weapon: Byte);
+ procedure TPlayerModel.SetWeapon (Weapon: Byte);
begin
begin
- FCurrentWeapon := Weapon;
+ FCurrentWeapon := Weapon
end;
function TPlayerModel.GetBlood (): TModelBlood;
end;
function TPlayerModel.GetBlood (): TModelBlood;
begin
if FAnimState <> nil then
FAnimState.Update;
begin
if FAnimState <> nil then
FAnimState.Update;
- if FFlagAnim <> nil then
- FFlagAnim.Update;
if FFireCounter > 0 then
Dec(FFireCounter)
if FFireCounter > 0 then
Dec(FFireCounter)
- else
- FFire := False
end;
procedure g_PlayerModel_LoadAll;
end;
procedure g_PlayerModel_LoadAll;