diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index afd5b7af33fbbf7a596800a70fa1e721ee957c3d..300979a87de4011a595a4d59af4704d9132f74a3 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
procedure positionChanged (); //WARNING! call this after entity position was changed, or coldet will not work right!
procedure getMapBox (out x, y, w, h: Integer); inline;
+ procedure moveBy (dx, dy: Integer); inline;
public
property Vel: TPoint2i read FObj.Vel;
Obj: TObj;
procedure getMapBox (out x, y, w, h: Integer); inline;
+ procedure moveBy (dx, dy: Integer); inline;
procedure positionChanged (); inline; //WARNING! call this after entity position was changed, or coldet will not work right!
end;
Obj: TObj;
procedure getMapBox (out x, y, w, h: Integer); inline;
+ procedure moveBy (dx, dy: Integer); inline;
procedure positionChanged (); inline; //WARNING! call this after entity position was changed, or coldet will not work right!
end;
procedure LoadState(var Mem: TBinMemoryReader);
procedure getMapBox (out x, y, w, h: Integer); inline;
-
procedure moveBy (dx, dy: Integer); inline;
procedure positionChanged (); inline; //WARNING! call this after entity position was changed, or coldet will not work right!
- property Obj: TObj read FObj;
+ function ObjPtr (): PObj; inline;
+
+ property Obj: TObj read FObj; // copies object
property State: Byte read FState;
property Mess: Boolean read FMess;
end;
h := Obj.Rect.Height;
end;
+procedure TGib.moveBy (dx, dy: Integer); inline;
+begin
+ if (dx <> 0) or (dy <> 0) then
+ begin
+ Obj.X += dx;
+ Obj.Y += dy;
+ positionChanged();
+ end;
+end;
+
+
procedure TShell.getMapBox (out x, y, w, h: Integer); inline;
begin
x := Obj.X;
h := Obj.Rect.Height;
end;
+procedure TShell.moveBy (dx, dy: Integer); inline;
+begin
+ if (dx <> 0) or (dy <> 0) then
+ begin
+ Obj.X += dx;
+ Obj.Y += dy;
+ positionChanged();
+ end;
+end;
+
procedure TGib.positionChanged (); inline; begin end;
procedure TShell.positionChanged (); inline; begin end;
+
procedure g_Player_DrawCorpses();
var
i: Integer;
if mon = nil then
s := '?'
else
- s := g_Monsters_GetKilledBy(mon.MonsterType);
+ s := g_Mons_GetKilledByTypeId(mon.MonsterType);
case KillType of
K_HARDKILL:
if not (R_BERSERK in FRulez) then
begin
Include(FRulez, R_BERSERK);
- if FBFGFireCounter = -1 then
+ if gBerserkAutoswitch and (FBFGFireCounter = -1) then
begin
FCurrWeap := WEAPON_KASTET;
resetWeaponQueue();
FModel.SetWeapon(WEAPON_KASTET);
end;
if gFlash <> 0 then
+ begin
Inc(FPain, 100);
if gFlash = 2 then Inc(FPickup, 5);
+ end;
FBerserk := gTime+30000;
Result := True;
remove := True;
if FKeys[b].Time = 0 then FKeys[b].Pressed := False else Dec(FKeys[b].Time);
end;
+
procedure TPlayer.getMapBox (out x, y, w, h: Integer); inline;
begin
x := FObj.X+PLAYER_RECT.X;
h := PLAYER_RECT.Height;
end;
+
+procedure TPlayer.moveBy (dx, dy: Integer); inline;
+begin
+ if (dx <> 0) or (dy <> 0) then
+ begin
+ FObj.X += dx;
+ FObj.Y += dy;
+ positionChanged();
+ end;
+end;
+
+
function TPlayer.Collide(X, Y: Integer; Width, Height: Word): Boolean;
begin
Result := g_Collide(FObj.X+PLAYER_RECT.X,
inherited;
end;
+function TCorpse.ObjPtr (): PObj; inline; begin result := @FObj; end;
+
procedure TCorpse.positionChanged (); inline; begin end;
procedure TCorpse.moveBy (dx, dy: Integer); inline;
h := PLAYER_CORPSERECT.Height;
end;
+
procedure TCorpse.Damage(Value: Word; vx, vy: Integer);
var
pm: TPlayerModel;