summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dad4ab1)
raw | patch | inline | side by side (parent: dad4ab1)
author | Stas'M <x86corez@gmail.com> | |
Thu, 31 Jan 2019 18:39:28 +0000 (21:39 +0300) | ||
committer | Stas'M <x86corez@gmail.com> | |
Thu, 31 Jan 2019 18:39:28 +0000 (21:39 +0300) |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 12c9824f0ba05c9617745d5b57a47f9bfd49f12b..7d660aa599c1af3773962ac430b7a713f1dc8dce 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
g_Sound_CreateWADEx('SOUND_GAME_BULK2', GameWAD+':SOUNDS\BULK2');
g_Sound_CreateWADEx('SOUND_GAME_BUBBLE1', GameWAD+':SOUNDS\BUBBLE1');
g_Sound_CreateWADEx('SOUND_GAME_BUBBLE2', GameWAD+':SOUNDS\BUBBLE2');
+ g_Sound_CreateWADEx('SOUND_GAME_BURNING', GameWAD+':SOUNDS\BURNING');
g_Sound_CreateWADEx('SOUND_GAME_SWITCH1', GameWAD+':SOUNDS\SWITCH1');
g_Sound_CreateWADEx('SOUND_GAME_SWITCH0', GameWAD+':SOUNDS\SWITCH0');
g_Sound_CreateWADEx('SOUND_GAME_RADIO', GameWAD+':SOUNDS\RADIO');
g_Sound_Delete('SOUND_GAME_BULK2');
g_Sound_Delete('SOUND_GAME_BUBBLE1');
g_Sound_Delete('SOUND_GAME_BUBBLE2');
+ g_Sound_Delete('SOUND_GAME_BURNING');
g_Sound_Delete('SOUND_GAME_SWITCH1');
g_Sound_Delete('SOUND_GAME_SWITCH0');
diff --git a/src/game/g_net.pas b/src/game/g_net.pas
index 1007f0f0c3625816ffc97fa2237415cc75ce79d4..c5bce9648aa54223153106e3caf337bd21707018 100644 (file)
--- a/src/game/g_net.pas
+++ b/src/game/g_net.pas
e_log, e_msg, ENet, Classes, MAPDEF{$IFDEF USE_MINIUPNPC}, miniupnpc;{$ELSE};{$ENDIF}
const
- NET_PROTOCOL_VER = 177;
+ NET_PROTOCOL_VER = 178;
NET_MAXCLIENTS = 24;
NET_CHANS = 11;
diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index f5b30efa23c914c9ad02f9eee8c796e5df28fa6f..a060162f5460e7f36908a324c9eb0853cd12de54 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
NetOut.Write(Byte(FNoRespawn));
NetOut.Write(Byte(FJetpack));
NetOut.Write(FFireTime);
+ NetOut.Write(Byte(FFlaming));
end;
g_Net_Host_Send(ID, True, NET_CHAN_PLAYER);
PID: Word;
Pl: TPlayer;
I: Integer;
- OldJet: Boolean;
+ OldJet, Flam: Boolean;
NewTeam: Byte;
begin
PID := M.ReadWord();
OldJet := FJetpack;
FJetpack := M.ReadByte() <> 0;
FFireTime := M.ReadLongInt();
+ Flam := M.ReadByte() <> 0;
if OldJet and not FJetpack then
JetpackOff
else if not OldJet and FJetpack then
JetpackOn;
+ if FFlaming and not Flam then
+ FlamerOff;
if Team <> NewTeam then
Pl.ChangeTeam(NewTeam);
end;
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 5c8fdb77314a61498144dd214d708675eddc3a10..5d1f863faa686c667ec21470ffed524e700c4778 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
FSawSoundIdle: TPlayableSound;
FSawSoundHit: TPlayableSound;
FSawSoundSelect: TPlayableSound;
+ FFlameSoundOn: TPlayableSound;
+ FFlameSoundOff: TPlayableSound;
+ FFlameSoundWork: TPlayableSound;
FJetSoundOn: TPlayableSound;
FJetSoundOff: TPlayableSound;
FJetSoundFly: TPlayableSound;
FWantsInGame: Boolean;
FGhost: Boolean;
FPhysics: Boolean;
+ FFlaming: Boolean;
FJetpack: Boolean;
FActualModelName: string;
FClientID: SmallInt;
procedure SetLerp(XTo, YTo: Integer);
procedure QueueWeaponSwitch(Weapon: Byte);
procedure RealizeCurrentWeapon();
+ procedure FlamerOn;
+ procedure FlamerOff;
procedure JetpackOn;
procedure JetpackOff;
procedure CatchFire(Attacker: Word);
FSawSoundIdle := TPlayableSound.Create();
FSawSoundHit := TPlayableSound.Create();
FSawSoundSelect := TPlayableSound.Create();
+ FFlameSoundOn := TPlayableSound.Create();
+ FFlameSoundOff := TPlayableSound.Create();
+ FFlameSoundWork := TPlayableSound.Create();
FJetSoundFly := TPlayableSound.Create();
FJetSoundOn := TPlayableSound.Create();
FJetSoundOff := TPlayableSound.Create();
FSawSoundIdle.SetByName('SOUND_WEAPON_IDLESAW');
FSawSoundHit.SetByName('SOUND_WEAPON_HITSAW');
FSawSoundSelect.SetByName('SOUND_WEAPON_SELECTSAW');
+ FFlameSoundOn.SetByName('SOUND_WEAPON_FLAMEON');
+ FFlameSoundOff.SetByName('SOUND_WEAPON_FLAMEOFF');
+ FFlameSoundWork.SetByName('SOUND_WEAPON_FLAMEWORK');
FJetSoundFly.SetByName('SOUND_PLAYER_JETFLY');
FJetSoundOn.SetByName('SOUND_PLAYER_JETON');
FJetSoundOff.SetByName('SOUND_PLAYER_JETOFF');
FSawSoundIdle.Free();
FSawSoundHit.Free();
FSawSoundSelect.Free();
+ FFlameSoundOn.Free();
+ FFlameSoundOff.Free();
+ FFlameSoundWork.Free();
FJetSoundFly.Free();
FJetSoundOn.Free();
FJetSoundOff.Free();
if FAmmo[A_FUEL] > 0 then
begin
g_Weapon_flame(wx, wy, xd, yd, FUID);
+ FlamerOn;
FReloading[FCurrWeap] := WEAPON_RELOAD[FCurrWeap];
Dec(FAmmo[A_FUEL]);
FFireAngle := FAngle;
f := True;
DidFire := True;
+ end
+ else
+ begin
+ FlamerOff;
+ if g_Game_IsNet and g_Game_IsServer then MH_SEND_PlayerStats(FUID);
end;
end;
PANEL_WATER or PANEL_ACID1 or PANEL_ACID2, True);
end;
+procedure TPlayer.FlamerOn;
+begin
+ FFlameSoundOff.Stop();
+ FFlameSoundOff.SetPosition(0);
+ if FFlaming then
+ begin
+ if (not FFlameSoundOn.IsPlaying()) and (not FFlameSoundWork.IsPlaying()) then
+ FFlameSoundWork.PlayAt(FObj.X, FObj.Y);
+ end
+ else
+ begin
+ FFlameSoundOn.PlayAt(FObj.X, FObj.Y);
+ FFlaming := True;
+ end;
+end;
+
+procedure TPlayer.FlamerOff;
+begin
+ if FFlaming then
+ begin
+ FFlameSoundOn.Stop();
+ FFlameSoundOn.SetPosition(0);
+ FFlameSoundWork.Stop();
+ FFlameSoundWork.SetPosition(0);
+ FFlameSoundOff.PlayAt(FObj.X, FObj.Y);
+ FFlaming := False;
+ end;
+end;
+
procedure TPlayer.JetpackOn;
begin
FJetSoundFly.Stop;
FDamageBuffer := 0;
FJetpack := False;
FCanJetpack := False;
+ FFlaming := False;
FFireTime := 0;
FFirePainTime := 0;
FFireAttacker := 0;
if FKeys[KEY_RIGHT].Pressed then Run(TDirection.D_RIGHT);
//if FKeys[KEY_NEXTWEAPON].Pressed and AnyServer then NextWeapon();
//if FKeys[KEY_PREVWEAPON].Pressed and AnyServer then PrevWeapon();
- if FKeys[KEY_FIRE].Pressed and AnyServer then Fire();
+ if FKeys[KEY_FIRE].Pressed and AnyServer then Fire()
+ else
+ begin
+ if AnyServer then
+ begin
+ FlamerOff;
+ if NetServer then MH_SEND_PlayerStats(FUID);
+ end;
+ end;
if FKeys[KEY_OPEN].Pressed and AnyServer then Use();
if FKeys[KEY_JUMP].Pressed then Jump()
else
WEAPON_FLAMETHROWER:
begin
g_Weapon_flame(wx, wy, xd, yd, FUID, WID);
+ FlamerOn;
FFireAngle := FAngle;
f := True;
end;
FSawSoundIdle.Pause(Enable);
FSawSoundHit.Pause(Enable);
FSawSoundSelect.Pause(Enable);
+ FFlameSoundOn.Pause(Enable);
+ FFlameSoundOff.Pause(Enable);
+ FFlameSoundWork.Pause(Enable);
FJetSoundFly.Pause(Enable);
FJetSoundOn.Pause(Enable);
FJetSoundOff.Pause(Enable);
index e75d79fb0b57c10d93a2b5d89e1da756951b7300..1673cefedadeab37f1f565cd3b100a7a6684119c 100644 (file)
--- a/src/game/g_triggers.pas
+++ b/src/game/g_triggers.pas
TRIGGER_SHOT_FLAME:
begin
g_Weapon_flame(wx, wy, dx, dy, 0, -1, True);
- //snd := 'SOUND_WEAPON_FIREPLASMA';
+ snd := 'SOUND_GAME_BURNING';
end;
else exit;
diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 78965efd9378623329c16f2778abfd4daa412098..5505731729eb497613804cd78aa72d00886d96c8 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
g_Sound_CreateWADEx('SOUND_WEAPON_FIREBALL', GameWAD+':SOUNDS\FIREBALL');
g_Sound_CreateWADEx('SOUND_WEAPON_EXPLODEBALL', GameWAD+':SOUNDS\EXPLODEBALL');
g_Sound_CreateWADEx('SOUND_WEAPON_FIREREV', GameWAD+':SOUNDS\FIREREV');
+ g_Sound_CreateWADEx('SOUND_WEAPON_FLAMEON', GameWAD+':SOUNDS\STARTFLM');
+ g_Sound_CreateWADEx('SOUND_WEAPON_FLAMEOFF', GameWAD+':SOUNDS\STOPFLM');
+ g_Sound_CreateWADEx('SOUND_WEAPON_FLAMEWORK', GameWAD+':SOUNDS\WORKFLM');
g_Sound_CreateWADEx('SOUND_PLAYER_JETFLY', GameWAD+':SOUNDS\WORKJETPACK');
g_Sound_CreateWADEx('SOUND_PLAYER_JETON', GameWAD+':SOUNDS\STARTJETPACK');
g_Sound_CreateWADEx('SOUND_PLAYER_JETOFF', GameWAD+':SOUNDS\STOPJETPACK');
g_Sound_Delete('SOUND_WEAPON_FIREBALL');
g_Sound_Delete('SOUND_WEAPON_EXPLODEBALL');
g_Sound_Delete('SOUND_WEAPON_FIREREV');
+ g_Sound_Delete('SOUND_WEAPON_FLAMEON');
+ g_Sound_Delete('SOUND_WEAPON_FLAMEOFF');
+ g_Sound_Delete('SOUND_WEAPON_FLAMEWORK');
g_Sound_Delete('SOUND_PLAYER_JETFLY');
g_Sound_Delete('SOUND_PLAYER_JETON');
g_Sound_Delete('SOUND_PLAYER_JETOFF');