Skip to content

Commit

Permalink
Updated BeaRLibItems.dll.
Browse files Browse the repository at this point in the history
  • Loading branch information
devapromix committed Sep 28, 2017
1 parent d02a584 commit 17b2900
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Binary file modified BeaRLibItems.dll
Binary file not shown.
1 change: 1 addition & 0 deletions BeaRLibItems.pas
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Item = record
SlotID: Integer;
Equipment: Integer;
Price: Integer;
Color: Cardinal;
end;

// Library
Expand Down
20 changes: 15 additions & 5 deletions uItem.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,9 @@ class procedure TItems.Make(ID: Byte; var AItem: Item);
AItem.ItemID := ID;
AItem.SlotID := Ord(ItemBase[TItemEnum(ID)].SlotType);
AItem.Stack := ItemBase[TItemEnum(ID)].MaxStack;
// Color
AItem.Color := ItemBase[TItemEnum(ID)].Color;
//AItem.Color := Math.RandomRange($FF888888, $FFFFFFFF);
// Defense
if (AItem.Stack = 1) and (ItemBase[TItemEnum(ID)].Defense.Min > 0) then
AItem.Defense := Math.EnsureRange
Expand Down Expand Up @@ -1224,7 +1227,8 @@ procedure TItems.Render(AX, AY: Byte);
var
MapID: Byte;
I, Count: Integer;
Color: Cardinal;
FColor: Cardinal;
FSymbol: Char;
FItem: Item;
begin
MapID := Ord(Map.Current);
Expand All @@ -1239,10 +1243,16 @@ procedure TItems.Render(AX, AY: Byte);
Y := FItem.Y - Player.Y + AY + View.Top;
if not Game.Wizard and (Player.GetDist(FItem.X, FItem.Y) > Player.Vision)
then
Color := clFog
begin
FColor := clFog;
FSymbol := '?';
end
else
Color := ItemBase[TItemEnum(FItem.ItemID)].Color;
Terminal.Print(X, Y, ItemBase[TItemEnum(FItem.ItemID)].Symbol, Color);
begin
FColor := FItem.Color; // ItemBase[TItemEnum(FItem.ItemID)].Color;
FSymbol := ItemBase[TItemEnum(FItem.ItemID)].Symbol;
end;
Terminal.Print(X, Y, FSymbol, FColor);
end;
end;

Expand Down Expand Up @@ -1784,7 +1794,7 @@ function TItems.RenderInvItem(X, Y, I: Integer; AItem: Item;

if IsRender then
begin
Terminal.ForegroundColor(D.Color);
Terminal.ForegroundColor(AItem.Color);
Terminal.Print(X, Y + I, D.Symbol);
end
else
Expand Down

0 comments on commit 17b2900

Please sign in to comment.