index b97e48dec90db625917302dfb22e9bd6687dc8b9..97152525e5c4d7e688a5d433851128124f57bde4 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
implementation
uses
implementation
uses
+ {$IFDEF ENABLE_MENU}
+ g_menu,
+ {$ENDIF}
e_log, g_sound, g_gfx, g_player, g_game,
g_weapons, g_triggers, g_items, g_options,
e_log, g_sound, g_gfx, g_player, g_game,
g_weapons, g_triggers, g_items, g_options,
- g_console, g_map, Math, g_menu, wadreader,
+ g_console, g_map, Math, wadreader,
g_language, g_netmsg, idpool, utils, xstreams;
g_language, g_netmsg, idpool, utils, xstreams;
FAnim[a, TDirection.D_LEFT] := TAnimationState.Create(ANIMTABLE[a].loop, MONSTER_ANIMTABLE[MonsterType].AnimSpeed[a], MONSTER_ANIMTABLE[MonsterType].AnimCount[a]);
end;
if MonsterType = MONSTER_VILE then
FAnim[a, TDirection.D_LEFT] := TAnimationState.Create(ANIMTABLE[a].loop, MONSTER_ANIMTABLE[MonsterType].AnimSpeed[a], MONSTER_ANIMTABLE[MonsterType].AnimCount[a]);
end;
if MonsterType = MONSTER_VILE then
- vilefire := TAnimationState.Create(True, 2, 0); // !!! len
+ vilefire := TAnimationState.Create(True, 2, 8);
end;
function TMonster.Damage(aDamage: Word; VelX, VelY: Integer; SpawnerUID: Word; t: Byte): Boolean;
end;
function TMonster.Damage(aDamage: Word; VelX, VelY: Integer; SpawnerUID: Word; t: Byte): Boolean;
anim := (vilefire <> nil);
utils.writeBool(st, anim);
// Если есть - сохраняем:
anim := (vilefire <> nil);
utils.writeBool(st, anim);
// Если есть - сохраняем:
- if anim then vilefire.SaveState(st);
+ if anim then vilefire.SaveState(st, 0, False);
// Анимации
for i := ANIM_SLEEP to ANIM_PAIN do
begin
// Анимации
for i := ANIM_SLEEP to ANIM_PAIN do
begin
anim := (FAnim[i, TDirection.D_LEFT] <> nil);
utils.writeBool(st, anim);
// Если есть - сохраняем
anim := (FAnim[i, TDirection.D_LEFT] <> nil);
utils.writeBool(st, anim);
// Если есть - сохраняем
- if anim then FAnim[i, TDirection.D_LEFT].SaveState(st);
+ if anim then FAnim[i, TDirection.D_LEFT].SaveState(st, 0, False);
// Есть ли правая анимация
anim := (FAnim[i, TDirection.D_RIGHT] <> nil);
utils.writeBool(st, anim);
// Если есть - сохраняем
// Есть ли правая анимация
anim := (FAnim[i, TDirection.D_RIGHT] <> nil);
utils.writeBool(st, anim);
// Если есть - сохраняем
- if anim then FAnim[i, TDirection.D_RIGHT].SaveState(st);
+ if anim then FAnim[i, TDirection.D_RIGHT].SaveState(st, 0, False);
end;
end;
end;
end;
procedure TMonster.LoadState (st: TStream);
var
i: Integer;
procedure TMonster.LoadState (st: TStream);
var
i: Integer;
- b: Byte;
- anim: Boolean;
+ b, alpha: Byte;
+ anim, blending: Boolean;
begin
assert(st <> nil);
begin
assert(st <> nil);
if anim then
begin
Assert(vilefire <> nil, 'TMonster.LoadState: no vilefire anim');
if anim then
begin
Assert(vilefire <> nil, 'TMonster.LoadState: no vilefire anim');
- vilefire.LoadState(st);
+ vilefire.LoadState(st, alpha, blending);
end;
// Анимации
for i := ANIM_SLEEP to ANIM_PAIN do
end;
// Анимации
for i := ANIM_SLEEP to ANIM_PAIN do
if anim then
begin
Assert(FAnim[i, TDirection.D_LEFT] <> nil, 'TMonster.LoadState: no '+IntToStr(i)+'_left anim');
if anim then
begin
Assert(FAnim[i, TDirection.D_LEFT] <> nil, 'TMonster.LoadState: no '+IntToStr(i)+'_left anim');
- FAnim[i, TDirection.D_LEFT].LoadState(st);
+ FAnim[i, TDirection.D_LEFT].LoadState(st, alpha, blending);
end;
// Есть ли правая анимация
anim := utils.readBool(st);
end;
// Есть ли правая анимация
anim := utils.readBool(st);
if anim then
begin
Assert(FAnim[i, TDirection.D_RIGHT] <> nil, 'TMonster.LoadState: no '+IntToStr(i)+'_right anim');
if anim then
begin
Assert(FAnim[i, TDirection.D_RIGHT] <> nil, 'TMonster.LoadState: no '+IntToStr(i)+'_right anim');
- FAnim[i, TDirection.D_RIGHT].LoadState(st);
+ FAnim[i, TDirection.D_RIGHT].LoadState(st, alpha, blending);
end;
end;
// update cache
end;
end;
// update cache