summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0f4c081)
raw | patch | inline | side by side (parent: 0f4c081)
author | Dmitry D. Chernov <blackdoomer@yandex.ru> | |
Thu, 27 Jul 2023 19:01:49 +0000 (05:01 +1000) | ||
committer | Dmitry D. Chernov <blackdoomer@yandex.ru> | |
Thu, 27 Jul 2023 19:02:18 +0000 (05:02 +1000) |
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 2c158c4e2335c16dfa78df2323cd49f44b5677a6..0cca55387e1b518016faab9f0925fbc2b88c2b41 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
procedure g_Game_Announce_GoodShot(SpawnerUID: Word);
procedure g_Game_Announce_KillCombo(Param: Integer);
procedure g_Game_Announce_BodyKill(SpawnerUID: Word);
+procedure g_Game_Effect_Bubbles(fX, fY: Integer; count: Word; devX, devY: Byte; Silent: Boolean = False);
procedure g_Game_StartVote(Command, Initiator: string);
procedure g_Game_CheckVote;
procedure g_TakeScreenShot(Filename: string = '');
// saves a shitty CSV containing the game stats passed to it
procedure SaveGameStat(Stat: TEndCustomGameStat; Path: string);
-var
+var
s: TextFile;
dir, fname, map, mode, etime: String;
I: Integer;
// if it's a coop game: monsters killed, monsters total, secrets found, secrets total
// otherwise nothing
if Stat.GameMode in [GM_TDM, GM_CTF] then
- WriteLn(s,
+ WriteLn(s,
Format('red_score,blue_score' + LineEnding + '%d,%d', [Stat.TeamStat[TEAM_RED].Score, Stat.TeamStat[TEAM_BLUE].Score]))
else if Stat.GameMode in [GM_COOP, GM_SINGLE] then
WriteLn(s,
// if someone has a higher score, set it to that instead
gsScoreLimit := max(gsScoreLimit, b);
gGameSettings.ScoreLimit := gsScoreLimit;
-
+
if g_Game_IsNet then MH_SEND_GameSettings;
end;
end;
'p1_priority_kastet':
begin
if (Length(P) = 2) then
- gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
end;
'p2_priority_kastet':
begin
if (Length(P) = 2) then
- gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
- end;
+ gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ end;
'p1_priority_saw':
begin
if (Length(P) = 2) then
'p1_priority_pistol':
begin
if (Length(P) = 2) then
- gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ gPlayer1Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
end;
'p2_priority_pistol':
begin
if (Length(P) = 2) then
- gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
- end;
+ gPlayer2Settings.WeaponPreferences[WEAPON_KASTET] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ end;
'p1_priority_shotgun1':
begin
if (Length(P) = 2) then
begin
if (Length(P) = 2) then
gPlayer2Settings.WeaponPreferences[WEAPON_FLAMETHROWER] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
- end;
+ end;
'p1_priority_berserk':
begin
if (Length(P) = 2) then
- gPlayer1Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ gPlayer1Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
end;
'p2_priority_berserk':
begin
if (Length(P) = 2) then
- gPlayer2Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
- end;
+ gPlayer2Settings.WeaponPreferences[WP_LAST+1] := EnsureRange(StrToIntDef(P[1], WP_FIRST), WP_FIRST, WP_LAST+1);
+ end;
end;
end;
t := TEAM_RED
else if P[2] = 'blue' then
t := TEAM_BLUE
- else
+ else
t := TEAM_NONE;
if Length(P) = 3
DateTimeToString(date, 'yyyy-mm-dd-hh-nn-ss', t);
Filename := 'screenshot-' + date;
end;
-
+
name := e_CatPath(dir, Filename + '.png');
s := createDiskFile(name);
try
hahasnd[Random(3)].Play();
end;
+procedure g_Game_Effect_Bubbles (fX, fY: Integer; count: Word; devX, devY: Byte; Silent: Boolean);
+begin
+ g_GFX_Bubbles(fX, fY, count, devX, devY);
+ if not Silent then if Random(2) = 0
+ then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', fX, fY)
+ else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', fX, fY);
+end;
+
procedure g_Game_StartVote(Command, Initiator: string);
var
Need: Integer;
index d8adad853402974c802ba9bfbd3f58761809835e..ad887adfdd29d7e102c3a36069630eb0734437af 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
a, b, sx, sy, wx, wy, oldvelx: Integer;
st: Word;
o, co: TObj;
- fall, bubbles: Boolean;
+ fall: Boolean;
mon: TMonster;
mit: PMonster;
it: TMonsterGrid.Iter;
_end;
begin
fall := True;
- bubbles := True;
// Ìîíñòð ñòàòè÷åí ïîêà èäåò warmup
if (gLMSRespawn > LMS_RESPAWN_NONE) then exit;
// Âîçìîæíî, ñîçäàåì ïóçûðüêè â âîäå:
if WordBool(st and MOVE_INWATER) and (Random(32) = 0) then
- begin
case FMonsterType of
MONSTER_FISH:
- if Random(4) <> 0 then bubbles := False else
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
- FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
+ if Random(4) = 0 then
+ g_Game_Effect_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
+ FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
MONSTER_ROBO, MONSTER_BARREL:
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
- FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
+ g_Game_Effect_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
+ FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
else
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width-4),
- FObj.Y+FObj.Rect.Y + Random(4), 5, 4, 4);
+ g_Game_Effect_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width-4),
+ FObj.Y+FObj.Rect.Y + Random(4), 5, 4, 4);
end;
- if bubbles then if Random(2) = 0
- then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y)
- else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', FObj.X, FObj.Y);
- end;
// Åñëè ïðîøåë ïåðâûé êàäð àíèìàöèè âçðûâà áî÷êè, òî âçðûâ:
if FMonsterType = MONSTER_BARREL then
a, b, sx, sy, oldvelx: Integer;
st: Word;
o, co: TObj;
- fall, bubbles: Boolean;
+ fall: Boolean;
label
_end;
begin
sx := 0; // SHUT UP COMPILER
sy := 0;
fall := True;
- bubbles := True;
// Ìîíñòð ñòàòè÷åí ïîêà èäåò warmup
if (gLMSRespawn > LMS_RESPAWN_NONE) then exit;
// Âîçìîæíî, ñîçäàåì ïóçûðüêè â âîäå:
if WordBool(st and MOVE_INWATER) and (Random(32) = 0) then
- begin
case FMonsterType of
MONSTER_FISH:
- if Random(4) <> 0 then bubbles := False else
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
- FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
+ if Random(4) = 0 then
+ g_Game_Effect_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
+ FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
MONSTER_ROBO, MONSTER_BARREL:
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
- FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
+ g_Game_Effect_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width),
+ FObj.Y+FObj.Rect.Y + Random(4), 1, 0, 0);
else
- g_GFX_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width-4),
- FObj.Y+FObj.Rect.Y + Random(4), 5, 4, 4);
+ g_Game_Effect_Bubbles(FObj.X+FObj.Rect.X + Random(FObj.Rect.Width-4),
+ FObj.Y+FObj.Rect.Y + Random(4), 5, 4, 4);
end;
- if bubbles then if Random(2) = 0
- then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y)
- else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', FObj.X, FObj.Y);
- end;
// Åñëè ïðîøåë ïåðâûé êàäð àíèìàöèè âçðûâà áî÷êè, òî âçðûâ:
if FMonsterType = MONSTER_BARREL then
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 1468551a3c29fcd0ee26e32bc564ed7800559c2d..d0275d093fca62244370f201ff0cabb68bcb98f8 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
Team := BotList[num].team; // CTF / TDM
// Âûáèðàåì íàñòðîéêè áîòà èç ñïèñêà ïî íîìåðó èëè èìåíè:
- if lName = '' then
+ if lName = '' then
num := Random(Length(BotList))
else
begin
end;
if t = HIT_WATER then
- begin
- g_GFX_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2),
- FObj.Y+PLAYER_RECT.Y-4, value div 2, 8, 4);
- if Random(2) = 0
- then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y)
- else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', FObj.X, FObj.Y);
- end;
+ g_Game_Effect_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2),
+ FObj.Y+PLAYER_RECT.Y-4, value div 2, 8, 4);
end;
// Áóôåð óðîíà:
FAir := 0;
end
else if (FAir mod 31 = 0) and not blockmon then
- begin
- g_GFX_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2), FObj.Y+PLAYER_RECT.Y-4, 5+Random(6), 8, 4);
- if Random(2) = 0
- then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y)
- else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', FObj.X, FObj.Y);
- end;
+ g_Game_Effect_Bubbles(FObj.X+PLAYER_RECT.X+(PLAYER_RECT.Width div 2),
+ FObj.Y+PLAYER_RECT.Y-4, 5+Random(6), 8, 4);
end else if FAir < AIR_DEF then
FAir := AIR_DEF;
if BodyInLiquid(0, 0) then
begin
- g_GFX_Bubbles(Obj.X+Obj.Rect.X+(Obj.Rect.Width div 2)+Random(3)-1,
- Obj.Y+Obj.Rect.Height+8, 1, 8, 4);
- if Random(2) = 0
- then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', FObj.X, FObj.Y)
- else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', FObj.X, FObj.Y);
+ g_Game_Effect_Bubbles(Obj.X+Obj.Rect.X+(Obj.Rect.Width div 2)+Random(3)-1,
+ Obj.Y+Obj.Rect.Height+8, 1, 8, 4);
Exit;
end;
index 2509650d413b5ccc9af45f390ad91339bd4a30ad..f8e9e02dcef20c79c8806218c459f79aa8056a93 100644 (file)
--- a/src/game/g_triggers.pas
+++ b/src/game/g_triggers.pas
TRIGGER_EFFECT_DLIQUID: g_GFX_SimpleWater(X, Y, 1, VX, VY, 5, CR, CG, CB);
TRIGGER_EFFECT_BLOOD: g_GFX_Blood(X, Y, 1, VX, VY, 0, 0, CR, CG, CB);
TRIGGER_EFFECT_SPARK: g_GFX_Spark(X, Y, 1, GetAngle2(VX, VY), 0, 0);
- TRIGGER_EFFECT_BUBBLE:
- begin
- g_GFX_Bubbles(X, Y, 1, 0, 0);
- if not Silent then if Random(2) = 0
- then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', X, Y)
- else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', X, Y);
- end;
+ TRIGGER_EFFECT_BUBBLE: g_Game_Effect_Bubbles(X, Y, 1, 0, 0, Silent);
end;
end;
diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index f0fe29114071a4c6b9f5ce2f9b64ec678d387e77..86a9de5e15a45b072a8da158d9d981e84cc77dac 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
// Â âîäå øëåéô - ïóçûðè, â âîçäóõå øëåéô - äûì:
if WordBool(st and MOVE_INWATER) then
begin
- g_GFX_Bubbles(cx, cy, 1+Random(3), 16, 16);
- if Random(2) = 0
- then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', cx, cy)
- else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', cx, cy);
+ g_Game_Effect_Bubbles(cx, cy, 1+Random(3), 16, 16);
end
else if g_Frames_Get(_id, 'FRAMES_SMOKE') then
begin
end;
end
else
- begin
- g_GFX_Bubbles(cx, cy, 1+Random(3), 16, 16);
- if Random(2) = 0
- then g_Sound_PlayExAt('SOUND_GAME_BUBBLE1', cx, cy)
- else g_Sound_PlayExAt('SOUND_GAME_BUBBLE2', cx, cy);
- end;
+ g_Game_Effect_Bubbles(cx, cy, 1+Random(3), 16, 16);
+
ShotType := 0;
Continue;
end;