index 9690b745bd93ac05cfde1b9b75fbb2dfa25cda33..777453a119a19d7e2b168bcc4598e8cfeb7e2993 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
implementation
uses
+ {$IFNDEF HEADLESS}
+ g_menu,
+ {$ENDIF}
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;
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;
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
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);
// Если есть - сохраняем
- if anim then FAnim[i, TDirection.D_RIGHT].SaveState(st);
+ if anim then FAnim[i, TDirection.D_RIGHT].SaveState(st, 0, False);
end;
end;
procedure TMonster.LoadState (st: TStream);
var
i: Integer;
- b: Byte;
- anim: Boolean;
+ b, alpha: Byte;
+ anim, blending: Boolean;
begin
assert(st <> nil);
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
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);
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;
end;