-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
14 changed files
with
458 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
(* A glowing pixie in a jar - Light source *) | ||
|
||
unit pixie_jar; | ||
|
||
{$mode fpc}{$H+} | ||
|
||
interface | ||
|
||
(* Create a pixie jar *) | ||
procedure createPixieJar; | ||
(* Item cannot be equipped *) | ||
procedure useItem; | ||
|
||
implementation | ||
|
||
uses | ||
items, ui, globalUtils, map, player_stats, entities; | ||
|
||
procedure createPixieJar; | ||
var | ||
duration, r, c: smallint; | ||
begin | ||
(* Choose random location on the map *) | ||
repeat | ||
r := globalutils.randomRange(3, (MAXROWS - 3)); | ||
c := globalutils.randomRange(3, (MAXCOLUMNS - 3)); | ||
(* choose a location that is not a wall or occupied *) | ||
until (maparea[r][c].Blocks = False) and (maparea[r][c].Occupied = False); | ||
|
||
duration := randomRange(150, 160); | ||
SetLength(itemList, length(itemList) + 1); | ||
with itemList[High(itemList)] do | ||
begin | ||
itemID := High(itemList); | ||
itemName := 'Pixie in a jar'; | ||
itemDescription := 'glowing source of light'; | ||
itemArticle := 'a'; | ||
itemType := itmLightSource; | ||
itemMaterial := matGlass; | ||
useID := 13; | ||
glyph := chr(232); | ||
glyphColour := 'yellow'; | ||
inView := False; | ||
posX := c; | ||
posY := r; | ||
NumberOfUses := duration; | ||
onMap := True; | ||
throwable := False; | ||
throwDamage := 0; | ||
dice := 0; | ||
adds := 0; | ||
discovered := False; | ||
Inc(indexID); | ||
end; | ||
end; | ||
|
||
procedure useItem; | ||
begin | ||
ui.displayMessage('You pick up the Pixie in the jar.'); | ||
if (entityList[0].visionRange < player_stats.maxVisionRange) then | ||
entityList[0].visionRange := player_stats.maxVisionRange; | ||
end; | ||
|
||
end. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.