summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 42e2515)
raw | patch | inline | side by side (parent: 42e2515)
author | Stas'M <x86corez@gmail.com> | |
Wed, 12 Sep 2018 20:32:12 +0000 (23:32 +0300) | ||
committer | Stas'M <x86corez@gmail.com> | |
Tue, 18 Sep 2018 15:33:31 +0000 (18:33 +0300) |
Plus add separate animation for berserk
src/game/g_game.pas | patch | blob | history | |
src/game/g_player.pas | patch | blob | history |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index fec21e4be187f1ca06641aa67e0916dd5c9f5197..c38572befa771c29a3d575d8ddcf940aaf6dadf6 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
end;
g_Frames_CreateWAD(nil, 'FRAMES_TELEPORT', GameWAD+':TEXTURES\TELEPORT', 64, 64, 10, False);
- g_Frames_CreateWAD(nil, 'FRAMES_PUNCH', GameWAD+':TEXTURES\PUNCH', 64, 64, 4, False);
+ g_Frames_CreateWAD(nil, 'FRAMES_PUNCH', GameWAD+':WEAPONS\PUNCH', 64, 64, 4, False);
+ g_Frames_CreateWAD(nil, 'FRAMES_PUNCH_UP', GameWAD+':WEAPONS\PUNCH_UP', 64, 64, 4, False);
+ g_Frames_CreateWAD(nil, 'FRAMES_PUNCH_DN', GameWAD+':WEAPONS\PUNCH_DN', 64, 64, 4, False);
+ g_Frames_CreateWAD(nil, 'FRAMES_PUNCH_BERSERK', GameWAD+':WEAPONS\PUNCHB', 64, 64, 4, False);
+ g_Frames_CreateWAD(nil, 'FRAMES_PUNCH_BERSERK_UP', GameWAD+':WEAPONS\PUNCHB_UP', 64, 64, 4, False);
+ g_Frames_CreateWAD(nil, 'FRAMES_PUNCH_BERSERK_DN', GameWAD+':WEAPONS\PUNCHB_DN', 64, 64, 4, False);
g_Sound_CreateWADEx('SOUND_GAME_TELEPORT', GameWAD+':SOUNDS\TELEPORT');
g_Sound_CreateWADEx('SOUND_GAME_NOTELEPORT', GameWAD+':SOUNDS\NOTELEPORT');
g_Sound_CreateWADEx('SOUND_GAME_DOOROPEN', GameWAD+':SOUNDS\DOOROPEN');
g_Texture_Delete('TEXTURE_PLAYER_INVULPENTA');
g_Frames_DeleteByName('FRAMES_TELEPORT');
g_Frames_DeleteByName('FRAMES_PUNCH');
+ g_Frames_DeleteByName('FRAMES_PUNCH_UP');
+ g_Frames_DeleteByName('FRAMES_PUNCH_DN');
+ g_Frames_DeleteByName('FRAMES_PUNCH_BERSERK');
+ g_Frames_DeleteByName('FRAMES_PUNCH_BERSERK_UP');
+ g_Frames_DeleteByName('FRAMES_PUNCH_BERSERK_DN');
g_Sound_Delete('SOUND_GAME_TELEPORT');
g_Sound_Delete('SOUND_GAME_NOTELEPORT');
g_Sound_Delete('SOUND_GAME_DOOROPEN');
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 355ecf323985108f69d23d047c3a34399fb77dcc..736d22e1623ce2d1291825a49386cc63a75963c9 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
Mirror := TMirrorType.Horizontal;
if FPunchAnim <> nil then
+ begin
FPunchAnim.Draw(FObj.X+IfThen(Direction = TDirection.D_LEFT, 15-FObj.Rect.X, FObj.Rect.X-15),
FObj.Y+FObj.Rect.Y-11, Mirror);
+ if FPunchAnim.played then
+ begin
+ FPunchAnim.Free;
+ FPunchAnim := nil;
+ end;
+ end;
if (FMegaRulez[MR_INVUL] > gTime) and (gPlayerDrawn <> Self) then
if g_Texture_Get('TEXTURE_PLAYER_INVULPENTA', ID) then
procedure TPlayer.DoPunch();
var
id: DWORD;
+ st: String;
begin
- if FPunchAnim = nil then begin
- g_Frames_Get(id, 'FRAMES_PUNCH');
- FPunchAnim := TAnimation.Create(id, False, 1);
- end else
+ if FPunchAnim <> nil then begin
FPunchAnim.reset();
+ FPunchAnim.Free;
+ FPunchAnim := nil;
+ end;
+ st := 'FRAMES_PUNCH';
+ if R_BERSERK in FRulez then
+ st := st + '_BERSERK';
+ if FKeys[KEY_UP].Pressed then
+ st := st + '_UP'
+ else if FKeys[KEY_DOWN].Pressed then
+ st := st + '_DN';
+ g_Frames_Get(id, st);
+ FPunchAnim := TAnimation.Create(id, False, 1);
end;
procedure TPlayer.Fire();
case FCurrWeap of
WEAPON_KASTET:
begin
+ DoPunch();
if R_BERSERK in FRulez then
begin
//g_Weapon_punch(FObj.X+FObj.Rect.X, FObj.Y+FObj.Rect.Y, 75, FUID);
locobj.Accel.X := xd-wx;
locobj.Accel.y := yd-wy;
- DoPunch();
-
if g_Weapon_Hit(@locobj, 50, FUID, HIT_SOME) <> 0 then
g_Sound_PlayExAt('SOUND_WEAPON_HITBERSERK', FObj.X, FObj.Y)
else
case FCurrWeap of
WEAPON_KASTET:
begin
+ DoPunch();
if R_BERSERK in FRulez then
begin
//g_Weapon_punch(FObj.X+FObj.Rect.X, FObj.Y+FObj.Rect.Y, 75, FUID);
locobj.Accel.X := xd-wx;
locobj.Accel.y := yd-wy;
- DoPunch();
-
if g_Weapon_Hit(@locobj, 50, FUID, HIT_SOME) <> 0 then
g_Sound_PlayExAt('SOUND_WEAPON_HITBERSERK', FObj.X, FObj.Y)
else