Skip to content

Commit 17b2900

Browse files
committed
Updated BeaRLibItems.dll.
1 parent d02a584 commit 17b2900

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

BeaRLibItems.dll

512 Bytes
Binary file not shown.

BeaRLibItems.pas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Item = record
2121
SlotID: Integer;
2222
Equipment: Integer;
2323
Price: Integer;
24+
Color: Cardinal;
2425
end;
2526

2627
// Library

uItem.pas

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,9 @@ class procedure TItems.Make(ID: Byte; var AItem: Item);
10981098
AItem.ItemID := ID;
10991099
AItem.SlotID := Ord(ItemBase[TItemEnum(ID)].SlotType);
11001100
AItem.Stack := ItemBase[TItemEnum(ID)].MaxStack;
1101+
// Color
1102+
AItem.Color := ItemBase[TItemEnum(ID)].Color;
1103+
//AItem.Color := Math.RandomRange($FF888888, $FFFFFFFF);
11011104
// Defense
11021105
if (AItem.Stack = 1) and (ItemBase[TItemEnum(ID)].Defense.Min > 0) then
11031106
AItem.Defense := Math.EnsureRange
@@ -1224,7 +1227,8 @@ procedure TItems.Render(AX, AY: Byte);
12241227
var
12251228
MapID: Byte;
12261229
I, Count: Integer;
1227-
Color: Cardinal;
1230+
FColor: Cardinal;
1231+
FSymbol: Char;
12281232
FItem: Item;
12291233
begin
12301234
MapID := Ord(Map.Current);
@@ -1239,10 +1243,16 @@ procedure TItems.Render(AX, AY: Byte);
12391243
Y := FItem.Y - Player.Y + AY + View.Top;
12401244
if not Game.Wizard and (Player.GetDist(FItem.X, FItem.Y) > Player.Vision)
12411245
then
1242-
Color := clFog
1246+
begin
1247+
FColor := clFog;
1248+
FSymbol := '?';
1249+
end
12431250
else
1244-
Color := ItemBase[TItemEnum(FItem.ItemID)].Color;
1245-
Terminal.Print(X, Y, ItemBase[TItemEnum(FItem.ItemID)].Symbol, Color);
1251+
begin
1252+
FColor := FItem.Color; // ItemBase[TItemEnum(FItem.ItemID)].Color;
1253+
FSymbol := ItemBase[TItemEnum(FItem.ItemID)].Symbol;
1254+
end;
1255+
Terminal.Print(X, Y, FSymbol, FColor);
12461256
end;
12471257
end;
12481258

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

17851795
if IsRender then
17861796
begin
1787-
Terminal.ForegroundColor(D.Color);
1797+
Terminal.ForegroundColor(AItem.Color);
17881798
Terminal.Print(X, Y + I, D.Symbol);
17891799
end
17901800
else

0 commit comments

Comments
 (0)