Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Commit

Permalink
Game: Add NoTarget cheat
Browse files Browse the repository at this point in the history
  • Loading branch information
binarymaster committed May 18, 2015
1 parent 21df2e4 commit 433f123
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
13 changes: 13 additions & 0 deletions DF Sources/g_main.pas
Expand Up @@ -117,6 +117,8 @@ procedure Cheat();
c13 = 'PURELOVE';
c14_1 = 'ZCDJ'; // ßÑÂÎ
c14_2 = 'JLTY'; // ÎÄÅÍ
c15 = 'CASPER';
c16 = 'ZCDJQ'; // ßÑÂÎÉ
begin
if (not gGameOn) or (not gCheats) or ((gGameSettings.GameType <> GT_SINGLE) and
(gGameSettings.GameMode <> GM_COOP) and (not gDebugMode))
Expand Down Expand Up @@ -219,6 +221,17 @@ procedure Cheat();
if gPlayer1 <> nil then gPlayer1.GiveItem(ITEM_JETPACK);
if gPlayer2 <> nil then gPlayer2.GiveItem(ITEM_JETPACK);
end
// CASPER ïîçâîëÿåò õîäèòü ñêâîçü ñòåíû
else if Copy(charbuff, 11, 6) = c15 then
begin
// TODO
end
// ßÑÂÎÉ ñêðûâàåò îò ãëàç ìîíñòðîâ
else if Copy(charbuff, 12, 5) = c16 then
begin
if gPlayer1 <> nil then gPlayer1.NoTarget := not gPlayer1.NoTarget;
if gPlayer2 <> nil then gPlayer2.NoTarget := not gPlayer2.NoTarget;
end
else Exit;

g_Sound_PlayEx(s);
Expand Down
6 changes: 4 additions & 2 deletions DF Sources/g_monsters.pas
Expand Up @@ -2022,7 +2022,8 @@ procedure TMonster.Update();
// Åñëè åñòü èãðîê ðÿäîì, ïðîñûïàåìñÿ è èäåì ê íåìó:
if (gPlayers <> nil) then
for a := 0 to High(gPlayers) do
if (gPlayers[a] <> nil) and (gPlayers[a].Live) then
if (gPlayers[a] <> nil) and (gPlayers[a].Live)
and (not gPlayers[a].NoTarget) then
with gPlayers[a] do
if g_Look(@FObj, @Obj, FDirection) then
begin
Expand Down Expand Up @@ -3325,7 +3326,8 @@ function TMonster.findNewPrey(): Boolean;
// Èùåì áëèæàéøåãî èãðîêà â êà÷åñòâå öåëè:
if gPlayers <> nil then
for a := 0 to High(gPlayers) do
if (gPlayers[a] <> nil) and (gPlayers[a].Live) then
if (gPlayers[a] <> nil) and (gPlayers[a].Live)
and (not gPlayers[a].NoTarget) then
begin
l2 := Abs(gPlayers[a].GameX-FObj.X)+
Abs(gPlayers[a].GameY-FObj.Y);
Expand Down
3 changes: 3 additions & 0 deletions DF Sources/g_player.pas
Expand Up @@ -142,6 +142,7 @@ TPlayer = class (TObject)
FJetSoundOff: TPlayableSound;
FJetSoundFly: TPlayableSound;
FGodMode: Boolean;
FNoTarget: Boolean;

function CollideLevel(XInc, YInc: Integer): Boolean;
function StayOnStep(XInc, YInc: Integer): Boolean;
Expand Down Expand Up @@ -246,6 +247,7 @@ TPlayer = class (TObject)
property MonsterKills: Integer read FMonsterKills write FMonsterKills;
property Secrets: Integer read FSecrets;
property GodMode: Boolean read FGodMode write FGodMode;
property NoTarget: Boolean read FNoTarget write FNoTarget;
property Live: Boolean read FLive write FLive;
property Flag: Byte read FFlag;
property Team: Byte read FTeam write FTeam;
Expand Down Expand Up @@ -2794,6 +2796,7 @@ procedure TPlayer.Reset(Force: Boolean);

FTime[T_RESPAWN] := 0;
FGodMode := False;
FNoTarget := False;
FFrags := 0;
FKills := 0;
FMonsterKills := 0;
Expand Down

0 comments on commit 433f123

Please sign in to comment.