X-Git-Url: https://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fg_triggers.pas;h=3a1bec2ccbf37a95c84c49de76b6da6bc45c10c0;hp=779a9a151238f73afceb3c1d8e91df2cb3494ed2;hb=HEAD;hpb=73adc74fdf77fba9f9b683fb8484ccc22ab75339 diff --git a/src/game/g_triggers.pas b/src/game/g_triggers.pas index 779a9a1..3a1bec2 100644 --- a/src/game/g_triggers.pas +++ b/src/game/g_triggers.pas @@ -725,37 +725,37 @@ begin TRIGGER_SHOT_IMP: begin - g_Weapon_ball1(wx, wy, dx, dy, 0, -1, True); + g_Weapon_ball1(wx, wy, dx, dy, 0, -1, True, False); snd := 'SOUND_WEAPON_FIREBALL'; end; TRIGGER_SHOT_PLASMA: begin - g_Weapon_Plasma(wx, wy, dx, dy, 0, -1, True); + g_Weapon_Plasma(wx, wy, dx, dy, 0, -1, True, False); snd := 'SOUND_WEAPON_FIREPLASMA'; end; TRIGGER_SHOT_SPIDER: begin - g_Weapon_aplasma(wx, wy, dx, dy, 0, -1, True); + g_Weapon_aplasma(wx, wy, dx, dy, 0, -1, True, False); snd := 'SOUND_WEAPON_FIREPLASMA'; end; TRIGGER_SHOT_CACO: begin - g_Weapon_ball2(wx, wy, dx, dy, 0, -1, True); + g_Weapon_ball2(wx, wy, dx, dy, 0, -1, True, False); snd := 'SOUND_WEAPON_FIREBALL'; end; TRIGGER_SHOT_BARON: begin - g_Weapon_ball7(wx, wy, dx, dy, 0, -1, True); + g_Weapon_ball7(wx, wy, dx, dy, 0, -1, True, False); snd := 'SOUND_WEAPON_FIREBALL'; end; TRIGGER_SHOT_MANCUB: begin - g_Weapon_manfire(wx, wy, dx, dy, 0, -1, True); + g_Weapon_manfire(wx, wy, dx, dy, 0, -1, True, False); snd := 'SOUND_WEAPON_FIREBALL'; end; @@ -767,13 +767,13 @@ begin TRIGGER_SHOT_ROCKET: begin - g_Weapon_Rocket(wx, wy, dx, dy, 0, -1, True); + g_Weapon_Rocket(wx, wy, dx, dy, 0, -1, True, False); snd := 'SOUND_WEAPON_FIREROCKET'; end; TRIGGER_SHOT_BFG: begin - g_Weapon_BFGShot(wx, wy, dx, dy, 0, -1, True); + g_Weapon_BFGShot(wx, wy, dx, dy, 0, -1, True, False); snd := 'SOUND_WEAPON_FIREBFG'; end; @@ -807,7 +807,7 @@ begin TRIGGER_SHOT_FLAME: begin - g_Weapon_flame(wx, wy, dx, dy, 0, -1, True); + g_Weapon_flame(wx, wy, dx, dy, 0, -1, True, False); snd := 'SOUND_GAME_BURNING'; end; @@ -884,7 +884,7 @@ begin 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: g_GFX_Bubbles(X, Y, 1, 0, 0); + TRIGGER_EFFECT_BUBBLE: g_Game_Effect_Bubbles(X, Y, 1, 0, 0, Silent); end; end; @@ -1705,7 +1705,7 @@ begin if ((tgcScoreAction = TRIGGER_SCORE_ACTION_ADD) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_RED) and (p.Team = TEAM_RED)) or ((tgcScoreAction = TRIGGER_SCORE_ACTION_ADD) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_BLUE) and (p.Team = TEAM_BLUE)) then begin - Inc(gTeamStat[TEAM_RED].Goals, tgcScoreCount); // Red Scores + Inc(gTeamStat[TEAM_RED].Score, tgcScoreCount); // Red Scores if tgcScoreCon then begin @@ -1732,7 +1732,7 @@ begin if ((tgcScoreAction = TRIGGER_SCORE_ACTION_SUB) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_RED) and (p.Team = TEAM_RED)) or ((tgcScoreAction = TRIGGER_SCORE_ACTION_SUB) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_BLUE) and (p.Team = TEAM_BLUE)) then begin - Dec(gTeamStat[TEAM_RED].Goals, tgcScoreCount); // Red Fouls + Dec(gTeamStat[TEAM_RED].Score, tgcScoreCount); // Red Fouls if tgcScoreCon then begin @@ -1759,7 +1759,7 @@ begin if ((tgcScoreAction = TRIGGER_SCORE_ACTION_ADD) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_RED) and (p.Team = TEAM_BLUE)) or ((tgcScoreAction = TRIGGER_SCORE_ACTION_ADD) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_BLUE) and (p.Team = TEAM_RED)) then begin - Inc(gTeamStat[TEAM_BLUE].Goals, tgcScoreCount); // Blue Scores + Inc(gTeamStat[TEAM_BLUE].Score, tgcScoreCount); // Blue Scores if tgcScoreCon then begin @@ -1786,7 +1786,7 @@ begin if ((tgcScoreAction = TRIGGER_SCORE_ACTION_SUB) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_RED) and (p.Team = TEAM_BLUE)) or ((tgcScoreAction = TRIGGER_SCORE_ACTION_SUB) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_BLUE) and (p.Team = TEAM_RED)) then begin - Dec(gTeamStat[TEAM_BLUE].Goals, tgcScoreCount); // Blue Fouls + Dec(gTeamStat[TEAM_BLUE].Score, tgcScoreCount); // Blue Fouls if tgcScoreCon then begin @@ -1817,7 +1817,7 @@ begin begin if (tgcScoreAction = TRIGGER_SCORE_ACTION_ADD) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_FORCE_RED) then begin - Inc(gTeamStat[TEAM_RED].Goals, tgcScoreCount); // Red Scores + Inc(gTeamStat[TEAM_RED].Score, tgcScoreCount); // Red Scores if tgcScoreCon then begin @@ -1835,7 +1835,7 @@ begin end; if (tgcScoreAction = TRIGGER_SCORE_ACTION_SUB) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_FORCE_RED) then begin - Dec(gTeamStat[TEAM_RED].Goals, tgcScoreCount); // Red Fouls + Dec(gTeamStat[TEAM_RED].Score, tgcScoreCount); // Red Fouls if tgcScoreCon then begin @@ -1853,7 +1853,7 @@ begin end; if (tgcScoreAction = TRIGGER_SCORE_ACTION_ADD) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_FORCE_BLUE) then begin - Inc(gTeamStat[TEAM_BLUE].Goals, tgcScoreCount); // Blue Scores + Inc(gTeamStat[TEAM_BLUE].Score, tgcScoreCount); // Blue Scores if tgcScoreCon then begin @@ -1871,7 +1871,7 @@ begin end; if (tgcScoreAction = TRIGGER_SCORE_ACTION_SUB) and (tgcScoreTeam = TRIGGER_SCORE_TEAM_FORCE_BLUE) then begin - Dec(gTeamStat[TEAM_BLUE].Goals, tgcScoreCount); // Blue Fouls + Dec(gTeamStat[TEAM_BLUE].Score, tgcScoreCount); // Blue Fouls if tgcScoreCon then begin @@ -1891,7 +1891,7 @@ begin end; end; // Âûèãðûø - if (tgcScoreAction = TRIGGER_SCORE_ACTION_WIN) and (gGameSettings.GoalLimit > 0) then + if (tgcScoreAction = TRIGGER_SCORE_ACTION_WIN) and (gGameSettings.ScoreLimit > 0) then begin // Ñâîåé èëè ÷óæîé êîìàíäû if (tgcScoreTeam in [TRIGGER_SCORE_TEAM_MINE_RED, TRIGGER_SCORE_TEAM_MINE_BLUE]) and (g_GetUIDType(ActivateUID) = UID_PLAYER) then @@ -1900,9 +1900,9 @@ begin if ((tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_RED) and (p.Team = TEAM_RED)) // Red Wins or ((tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_BLUE) and (p.Team = TEAM_BLUE)) then begin - if gTeamStat[TEAM_RED].Goals < SmallInt(gGameSettings.GoalLimit) then + if gTeamStat[TEAM_RED].Score < SmallInt(gGameSettings.ScoreLimit) then begin - gTeamStat[TEAM_RED].Goals := gGameSettings.GoalLimit; + gTeamStat[TEAM_RED].Score := gGameSettings.ScoreLimit; if tgcScoreCon then begin @@ -1925,9 +1925,9 @@ begin if ((tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_RED) and (p.Team = TEAM_BLUE)) // Blue Wins or ((tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_BLUE) and (p.Team = TEAM_RED)) then begin - if gTeamStat[TEAM_BLUE].Goals < SmallInt(gGameSettings.GoalLimit) then + if gTeamStat[TEAM_BLUE].Score < SmallInt(gGameSettings.ScoreLimit) then begin - gTeamStat[TEAM_BLUE].Goals := gGameSettings.GoalLimit; + gTeamStat[TEAM_BLUE].Score := gGameSettings.ScoreLimit; if tgcScoreCon then begin @@ -1953,24 +1953,24 @@ begin begin if (tgcScoreTeam = TRIGGER_SCORE_TEAM_FORCE_RED) then // Red Wins begin - if gTeamStat[TEAM_RED].Goals < SmallInt(gGameSettings.GoalLimit) then + if gTeamStat[TEAM_RED].Score < SmallInt(gGameSettings.ScoreLimit) then begin - gTeamStat[TEAM_RED].Goals := gGameSettings.GoalLimit; + gTeamStat[TEAM_RED].Score := gGameSettings.ScoreLimit; Result := True; end; end; if (tgcScoreTeam = TRIGGER_SCORE_TEAM_FORCE_BLUE) then // Blue Wins begin - if gTeamStat[TEAM_BLUE].Goals < SmallInt(gGameSettings.GoalLimit) then + if gTeamStat[TEAM_BLUE].Score < SmallInt(gGameSettings.ScoreLimit) then begin - gTeamStat[TEAM_BLUE].Goals := gGameSettings.GoalLimit; + gTeamStat[TEAM_BLUE].Score := gGameSettings.ScoreLimit; Result := True; end; end; end; end; // Ïðîèãðûø - if (tgcScoreAction = TRIGGER_SCORE_ACTION_LOOSE) and (gGameSettings.GoalLimit > 0) then + if (tgcScoreAction = TRIGGER_SCORE_ACTION_LOOSE) and (gGameSettings.ScoreLimit > 0) then begin // Ñâîåé èëè ÷óæîé êîìàíäû if (tgcScoreTeam in [TRIGGER_SCORE_TEAM_MINE_RED, TRIGGER_SCORE_TEAM_MINE_BLUE]) and (g_GetUIDType(ActivateUID) = UID_PLAYER) then @@ -1978,9 +1978,9 @@ begin p := g_Player_Get(ActivateUID); if ((tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_RED) and (p.Team = TEAM_BLUE)) // Red Wins or ((tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_BLUE) and (p.Team = TEAM_RED)) then - if gTeamStat[TEAM_RED].Goals < SmallInt(gGameSettings.GoalLimit) then + if gTeamStat[TEAM_RED].Score < SmallInt(gGameSettings.ScoreLimit) then begin - gTeamStat[TEAM_RED].Goals := gGameSettings.GoalLimit; + gTeamStat[TEAM_RED].Score := gGameSettings.ScoreLimit; if tgcScoreCon then if tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_RED then @@ -1999,9 +1999,9 @@ begin end; if ((tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_RED) and (p.Team = TEAM_RED)) // Blue Wins or ((tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_BLUE) and (p.Team = TEAM_BLUE)) then - if gTeamStat[TEAM_BLUE].Goals < SmallInt(gGameSettings.GoalLimit) then + if gTeamStat[TEAM_BLUE].Score < SmallInt(gGameSettings.ScoreLimit) then begin - gTeamStat[TEAM_BLUE].Goals := gGameSettings.GoalLimit; + gTeamStat[TEAM_BLUE].Score := gGameSettings.ScoreLimit; if tgcScoreCon then if tgcScoreTeam = TRIGGER_SCORE_TEAM_MINE_RED then @@ -2024,17 +2024,17 @@ begin begin if (tgcScoreTeam = TRIGGER_SCORE_TEAM_FORCE_BLUE) then // Red Wins begin - if gTeamStat[TEAM_RED].Goals < SmallInt(gGameSettings.GoalLimit) then + if gTeamStat[TEAM_RED].Score < SmallInt(gGameSettings.ScoreLimit) then begin - gTeamStat[TEAM_RED].Goals := gGameSettings.GoalLimit; + gTeamStat[TEAM_RED].Score := gGameSettings.ScoreLimit; Result := True; end; end; if (tgcScoreTeam = TRIGGER_SCORE_TEAM_FORCE_RED) then // Blue Wins begin - if gTeamStat[TEAM_BLUE].Goals < SmallInt(gGameSettings.GoalLimit) then + if gTeamStat[TEAM_BLUE].Score < SmallInt(gGameSettings.ScoreLimit) then begin - gTeamStat[TEAM_BLUE].Goals := gGameSettings.GoalLimit; + gTeamStat[TEAM_BLUE].Score := gGameSettings.ScoreLimit; Result := True; end; end; @@ -2105,7 +2105,7 @@ begin begin // Êèñëîòíûé óðîí íå íàíîñèòñÿ êîãäà åñòü êîñòþì // "Âîäÿíîé" óðîí íå íàíîñèòñÿ êîãäà åñòü êèñëîðîä - if not (((tgcKind = HIT_ACID) and (p.FMegaRulez[MR_SUIT] > gTime)) or + if not (((tgcKind = HIT_ACID) and (p.FPowerups[MR_SUIT] > gTime)) or ((tgcKind = HIT_WATER) and (p.Air > 0))) then p.Damage(tgcAmount, 0, 0, 0, tgcKind); if (tgcKind = HIT_FLAME) then p.CatchFire(0); @@ -2349,14 +2349,14 @@ begin // Íå ñîçäàâàòü âûõîä, åñëè èãðà áåç âûõîäà if (aTrigger.TriggerType = TRIGGER_EXIT) and - (not LongBool(gGameSettings.Options and GAME_OPTION_ALLOWEXIT)) then + (not (TGameOption.ALLOW_EXIT in gGameSettings.Options)) then begin aTrigger.TriggerType := TRIGGER_NONE; end; // Åñëè ìîíñòðû çàïðåùåíû, îòìåíÿåì òðèããåð if (aTrigger.TriggerType = TRIGGER_SPAWNMONSTER) and - (not LongBool(gGameSettings.Options and GAME_OPTION_MONSTERS)) and + (not (TGameOption.MONSTERS in gGameSettings.Options)) and (gGameSettings.GameType <> GT_SINGLE) then begin aTrigger.TriggerType := TRIGGER_NONE;