summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 273168a)
raw | patch | inline | side by side (parent: 273168a)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 27 Sep 2018 21:51:35 +0000 (00:51 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 27 Sep 2018 21:51:35 +0000 (00:51 +0300) |
src/game/g_player.pas | patch | blob | history | |
src/game/g_playermodel.pas | patch | blob | history |
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 94c28712ff81fb6f4a079882de8f355c0ed847fd..37855534ce95709865ca86e096452c26670d63d5 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
@@ -1611,11 +1611,13 @@ procedure g_Player_CreateGibs(fX, fY: Integer; ModelName: string; fColor: TRGB);
var
a: Integer;
GibsArray: TGibsArray;
+ Blood: TModelBlood;
begin
if (gGibs = nil) or (Length(gGibs) = 0) then
Exit;
if not g_PlayerModel_GetGibs(ModelName, GibsArray) then
Exit;
+ Blood := g_PlayerModel_GetBlood(ModelName);
for a := 0 to High(GibsArray) do
with gGibs[CurrentGib] do
if gBloodCount > 0 then
g_GFX_Blood(fX, fY, 16*gBloodCount+Random(5*gBloodCount), -16+Random(33), -16+Random(33),
- Random(48), Random(48), 150, 0, 0);
+ Random(48), Random(48), Blood.R, Blood.G, Blood.B, Blood.Kind);
if CurrentGib >= High(gGibs) then
CurrentGib := 0
g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)+8,
FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2),
Count div 2, 3, -1, 16, (PLAYER_RECT.Height*2 div 3),
- 150, 0, 0);
+ FModel.Blood.R, FModel.Blood.G, FModel.Blood.B, FModel.Blood.Kind);
g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2)-8,
FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2),
Count div 2, -3, -1, 16, (PLAYER_RECT.Height*2) div 3,
- 150, 0, 0);
+ FModel.Blood.R, FModel.Blood.G, FModel.Blood.B, FModel.Blood.Kind);
end;
procedure TPlayer.MakeBloodVector(Count: Word; VelX, VelY: Integer);
g_GFX_Blood(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2),
FObj.Y+PLAYER_RECT.Y+(PLAYER_RECT.Height div 2),
Count, VelX, VelY, 16, (PLAYER_RECT.Height*2) div 3,
- 150, 0, 0);
+ FModel.Blood.R, FModel.Blood.G, FModel.Blood.B, FModel.Blood.Kind);
end;
procedure TPlayer.QueueWeaponSwitch(Weapon: Byte);
procedure TCorpse.Damage(Value: Word; vx, vy: Integer);
var
pm: TPlayerModel;
+ Blood: TModelBlood;
begin
if FState = CORPSE_STATE_REMOVEME then
Exit;
end
else
begin
+ Blood := g_PlayerModel_GetBlood(FModelName);
FObj.Vel.X := FObj.Vel.X + vx;
FObj.Vel.Y := FObj.Vel.Y + vy;
g_GFX_Blood(FObj.X+PLAYER_CORPSERECT.X+(PLAYER_CORPSERECT.Width div 2),
FObj.Y+PLAYER_CORPSERECT.Y+(PLAYER_CORPSERECT.Height div 2),
Value, vx, vy, 16, (PLAYER_CORPSERECT.Height*2) div 3,
- 150, 0, 0);
+ Blood.R, Blood.G, Blood.B, Blood.Kind);
end;
end;
index af85837aaa8a16e9c88514b2bdf1e5de26c6be97..acc89b26571f32665b37684b9ba4042999e8e938 100644 (file)
uses
{$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
- MAPDEF, g_textures, g_basic, g_weapons, e_graphics, utils,
+ MAPDEF, g_textures, g_basic, g_weapons, e_graphics, utils, g_gfx,
ImagingTypes, Imaging, ImagingUtility;
const
HaveWeapon: Boolean;
end;
+ TModelBlood = record
+ R, G, B, Kind: Byte;
+ end;
+
TModelSound = record
ID: DWORD;
Level: Byte;
FName: String;
FDirection: TDirection;
FColor: TRGB;
+ FBlood: TModelBlood;
FCurrentAnimation: Byte;
FAnim: Array [TDirection.D_LEFT..TDirection.D_RIGHT] of Array [A_STAND..A_LAST] of TAnimation;
FMaskAnim: Array [TDirection.D_LEFT..TDirection.D_RIGHT] of Array [A_STAND..A_LAST] of TAnimation;
public
property Color: TRGB read FColor write FColor;
+ property Blood: TModelBlood read FBlood;
end;
procedure g_PlayerModel_LoadData();
function g_PlayerModel_Load(FileName: String): Boolean;
function g_PlayerModel_GetNames(): SSArray;
function g_PlayerModel_GetInfo(ModelName: String): TModelInfo;
+function g_PlayerModel_GetBlood(ModelName: String): TModelBlood;
function g_PlayerModel_Get(ModelName: String): TPlayerModel;
function g_PlayerModel_GetAnim(ModelName: String; Anim: Byte; var _Anim, _Mask: TAnimation): Boolean;
function g_PlayerModel_GetGibs(ModelName: String; var Gibs: TGibsArray): Boolean;
PainSounds: TModelSoundArray;
DieSounds: TModelSoundArray;
SlopSound: Byte;
+ Blood: TModelBlood;
end;
const
Description := config.ReadStr('Model', 'description', '');
end;
+ with PlayerModelsArray[ID] do
+ begin
+ Blood.R := MAX(0, MIN(255, config.ReadInt('Blood', 'R', 150)));
+ Blood.G := MAX(0, MIN(255, config.ReadInt('Blood', 'G', 0)));
+ Blood.B := MAX(0, MIN(255, config.ReadInt('Blood', 'B', 0)));
+ case config.ReadStr('Blood', 'Kind', 'NORMAL') of
+ 'NORMAL': Blood.Kind := BLOOD_NORMAL;
+ 'SPARKS': Blood.Kind := BLOOD_SPARKS;
+ else
+ Blood.Kind := BLOOD_NORMAL
+ end
+ end;
+
for b := A_STAND to A_LAST do
begin
aname := s+'_RIGHTANIM'+IntToStr(b);
with PlayerModelsArray[a] do
begin
Result.FName := Info.Name;
+ Result.FBlood := Blood;
for b := A_STAND to A_LAST do
begin
end;
end;
+function g_PlayerModel_GetBlood(ModelName: string): TModelBlood;
+var
+ a: Integer;
+begin
+ Result.R := 150;
+ Result.G := 0;
+ Result.B := 0;
+ Result.Kind := BLOOD_NORMAL;
+ if PlayerModelsArray = nil then Exit;
+
+ for a := 0 to High(PlayerModelsArray) do
+ if PlayerModelsArray[a].Info.Name = ModelName then
+ begin
+ Result := PlayerModelsArray[a].Blood;
+ Break;
+ end;
+end;
+
procedure g_PlayerModel_FreeData();
var
i: DWORD;