-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Changes * Config options added to enable Corpses and a custom decay time for corpses, with a message to room of decaying * When mobs/players die, they drop corpses behind * Customized description when looking at corpses * `bury` command to force clean-up corpses * unit tests
- Loading branch information
Showing
30 changed files
with
653 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ help: | |
- character | ||
- pets | ||
- train | ||
- bury | ||
communication: | ||
- emote | ||
- say | ||
|
8 changes: 8 additions & 0 deletions
8
_datafiles/world/default/templates/character/description-corpse.template
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,8 @@ | ||
|
||
<ansi fg="black-bold">.:</ansi> <ansi fg="8">{{ .Name }} corpse</ansi> | ||
┌─ <ansi fg="black-bold">.:</ansi><ansi fg="20">Description</ansi> ────────────────────────────────────────────────────────────┐ | ||
<ansi fg="red-bold">☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠</ansi> | ||
<ansi fg="8">{{ splitstring .GetDescription 72 " "}}</ansi> | ||
<ansi fg="red-bold">☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠</ansi> | ||
<ansi fg="8">This is a corpse. They are dead.</ansi> | ||
└────────────────────────────────────────────────────────────────────────────┘ |
12 changes: 6 additions & 6 deletions
12
_datafiles/world/default/templates/character/description.template
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
|
||
<ansi fg="black-bold">.:</ansi> <ansi fg="username">{{ .Character.Name }}</ansi> (<ansi fg="{{ .Character.AlignmentName }}">{{ .Character.AlignmentName }}</ansi>) | ||
{{- $tnl := .Character.XPTNL -}} | ||
{{- $pct := (pct .Character.Experience $tnl ) -}} | ||
{{- $exp := printf "%d/%d (%d%%)" .Character.Experience $tnl $pct }} | ||
<ansi fg="black-bold">.:</ansi> <ansi fg="username">{{ .Name }}</ansi> (<ansi fg="{{ .AlignmentName }}">{{ .AlignmentName }}</ansi>) | ||
{{- $tnl := .XPTNL -}} | ||
{{- $pct := (pct .Experience $tnl ) -}} | ||
{{- $exp := printf "%d/%d (%d%%)" .Experience $tnl $pct }} | ||
┌─ <ansi fg="black-bold">.:</ansi><ansi fg="20">Description</ansi> ────────────────────────────────────────────────────────────┐ | ||
{{ splitstring .Character.GetDescription 72 " "}} | ||
{{ .Character.GetHealthAppearance }} | ||
{{ splitstring .GetDescription 72 " "}} | ||
{{ .GetHealthAppearance }} | ||
└────────────────────────────────────────────────────────────────────────────┘ |
18 changes: 9 additions & 9 deletions
18
_datafiles/world/default/templates/character/status-lite.template
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
|
||
<ansi fg="black-bold">.:</ansi> <ansi fg="username">{{ .Character.Name }}</ansi> the {{ profession .Character }} | ||
{{- $tnl := .Character.XPTNL -}} | ||
{{- $pct := (pct .Character.Experience $tnl ) -}} | ||
{{- $exp := printf "%d/%d (%d%%)" .Character.Experience $tnl $pct }} | ||
<ansi fg="black-bold">.:</ansi> <ansi fg="username">{{ .Name }}</ansi> the {{ profession . }} | ||
{{- $tnl := .XPTNL -}} | ||
{{- $pct := (pct .Experience $tnl ) -}} | ||
{{- $exp := printf "%d/%d (%d%%)" .Experience $tnl $pct }} | ||
┌─ <ansi fg="black-bold">.:</ansi><ansi fg="20">Info</ansi> ──────────────────────┐ ┌─ <ansi fg="black-bold">.:</ansi><ansi fg="20">Attributes</ansi> ───────────────────────────┐ | ||
│ <ansi fg="yellow">Health: </ansi>{{ printf "%-10d" .Character.Health }} <ansi fg="yellow">Max: </ansi>{{ printf "%-6d" .Character.HealthMax.Value }}│ │ <ansi fg="yellow">Strength: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Strength.Value (.Character.StatMod "strength") }} <ansi fg="yellow">Vitality: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Vitality.Value (.Character.StatMod "vitality") }} │ | ||
<ansi fg="yellow">Mana: </ansi>{{ printf "%-10d" .Character.Mana }} <ansi fg="yellow">Max: </ansi>{{ printf "%-6d" .Character.ManaMax.Value }} <ansi fg="yellow">Speed: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Speed.Value (.Character.StatMod "speed") }} <ansi fg="yellow">Mysticism: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Mysticism.Value (.Character.StatMod "mysticism") }} | ||
<ansi fg="yellow">Armor: </ansi>{{ printf "%-22s" ( printf "%d" (.Character.GetDefense)) }} <ansi fg="yellow">Smarts: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Smarts.Value (.Character.StatMod "smarts") }} <ansi fg="yellow">Percept: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Perception.Value (.Character.StatMod "perception") }} | ||
<ansi fg="yellow">Level: </ansi>{{ printf "%-22d" .Character.Level }} | ||
│ <ansi fg="yellow">Gold: </ansi>{{ printf "%-22s" (numberFormat .Character.Gold) }}│ │ │ | ||
│ <ansi fg="yellow">Health: </ansi>{{ printf "%-10d" .Health }} <ansi fg="yellow">Max: </ansi>{{ printf "%-6d" .HealthMax.Value }}│ │ <ansi fg="yellow">Strength: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Strength.Value (.StatMod "strength") }} <ansi fg="yellow">Vitality: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Vitality.Value (.StatMod "vitality") }} │ | ||
<ansi fg="yellow">Mana: </ansi>{{ printf "%-10d" .Mana }} <ansi fg="yellow">Max: </ansi>{{ printf "%-6d" .ManaMax.Value }} <ansi fg="yellow">Speed: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Speed.Value (.StatMod "speed") }} <ansi fg="yellow">Mysticism: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Mysticism.Value (.StatMod "mysticism") }} | ||
<ansi fg="yellow">Armor: </ansi>{{ printf "%-22s" ( printf "%d" (.GetDefense)) }} <ansi fg="yellow">Smarts: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Smarts.Value (.StatMod "smarts") }} <ansi fg="yellow">Percept: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Perception.Value (.StatMod "perception") }} | ||
<ansi fg="yellow">Level: </ansi>{{ printf "%-22d" .Level }} | ||
│ <ansi fg="yellow">Gold: </ansi>{{ printf "%-22s" (numberFormat .Gold) }}│ │ │ | ||
└───────────────────────────────┘ └──────────────────────────────────────────┘ |
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,9 @@ | ||
<ansi fg="black-bold">.:</ansi> <ansi fg="magenta">Help for </ansi><ansi fg="command">bury</ansi> | ||
|
||
The <ansi fg="command">bury</ansi> command cleans up corpses from the room. | ||
|
||
<ansi fg="yellow">Usage: </ansi> | ||
|
||
<ansi fg="command">bury rat corpse</ansi> | ||
|
||
|
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 |
---|---|---|
|
@@ -27,6 +27,7 @@ help: | |
- character | ||
- pets | ||
- train | ||
- bury | ||
communication: | ||
- emote | ||
- say | ||
|
8 changes: 8 additions & 0 deletions
8
_datafiles/world/empty/templates/character/description-corpse.template
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,8 @@ | ||
|
||
<ansi fg="black-bold">.:</ansi> <ansi fg="8">{{ .Name }} corpse</ansi> | ||
┌─ <ansi fg="black-bold">.:</ansi><ansi fg="20">Description</ansi> ────────────────────────────────────────────────────────────┐ | ||
<ansi fg="red-bold">☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠</ansi> | ||
<ansi fg="8">{{ splitstring .GetDescription 72 " "}}</ansi> | ||
<ansi fg="red-bold">☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠ ☠</ansi> | ||
<ansi fg="8">This is a corpse. They are dead.</ansi> | ||
└────────────────────────────────────────────────────────────────────────────┘ |
12 changes: 6 additions & 6 deletions
12
_datafiles/world/empty/templates/character/description.template
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
|
||
<ansi fg="black-bold">.:</ansi> <ansi fg="username">{{ .Character.Name }}</ansi> (<ansi fg="{{ .Character.AlignmentName }}">{{ .Character.AlignmentName }}</ansi>) | ||
{{- $tnl := .Character.XPTNL -}} | ||
{{- $pct := (pct .Character.Experience $tnl ) -}} | ||
{{- $exp := printf "%d/%d (%d%%)" .Character.Experience $tnl $pct }} | ||
<ansi fg="black-bold">.:</ansi> <ansi fg="username">{{ .Name }}</ansi> (<ansi fg="{{ .AlignmentName }}">{{ .AlignmentName }}</ansi>) | ||
{{- $tnl := .XPTNL -}} | ||
{{- $pct := (pct .Experience $tnl ) -}} | ||
{{- $exp := printf "%d/%d (%d%%)" .Experience $tnl $pct }} | ||
┌─ <ansi fg="black-bold">.:</ansi><ansi fg="20">Description</ansi> ────────────────────────────────────────────────────────────┐ | ||
{{ splitstring .Character.GetDescription 72 " "}} | ||
{{ .Character.GetHealthAppearance }} | ||
{{ splitstring .GetDescription 72 " "}} | ||
{{ .GetHealthAppearance }} | ||
└────────────────────────────────────────────────────────────────────────────┘ |
18 changes: 9 additions & 9 deletions
18
_datafiles/world/empty/templates/character/status-lite.template
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
|
||
<ansi fg="black-bold">.:</ansi> <ansi fg="username">{{ .Character.Name }}</ansi> the {{ profession .Character }} | ||
{{- $tnl := .Character.XPTNL -}} | ||
{{- $pct := (pct .Character.Experience $tnl ) -}} | ||
{{- $exp := printf "%d/%d (%d%%)" .Character.Experience $tnl $pct }} | ||
<ansi fg="black-bold">.:</ansi> <ansi fg="username">{{ .Name }}</ansi> the {{ profession . }} | ||
{{- $tnl := .XPTNL -}} | ||
{{- $pct := (pct .Experience $tnl ) -}} | ||
{{- $exp := printf "%d/%d (%d%%)" .Experience $tnl $pct }} | ||
┌─ <ansi fg="black-bold">.:</ansi><ansi fg="20">Info</ansi> ──────────────────────┐ ┌─ <ansi fg="black-bold">.:</ansi><ansi fg="20">Attributes</ansi> ───────────────────────────┐ | ||
│ <ansi fg="yellow">Health: </ansi>{{ printf "%-10d" .Character.Health }} <ansi fg="yellow">Max: </ansi>{{ printf "%-6d" .Character.HealthMax.Value }}│ │ <ansi fg="yellow">Strength: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Strength.Value (.Character.StatMod "strength") }} <ansi fg="yellow">Vitality: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Vitality.Value (.Character.StatMod "vitality") }} │ | ||
<ansi fg="yellow">Mana: </ansi>{{ printf "%-10d" .Character.Mana }} <ansi fg="yellow">Max: </ansi>{{ printf "%-6d" .Character.ManaMax.Value }} <ansi fg="yellow">Speed: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Speed.Value (.Character.StatMod "speed") }} <ansi fg="yellow">Mysticism: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Mysticism.Value (.Character.StatMod "mysticism") }} | ||
<ansi fg="yellow">Armor: </ansi>{{ printf "%-22s" ( printf "%d" (.Character.GetDefense)) }} <ansi fg="yellow">Smarts: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Smarts.Value (.Character.StatMod "smarts") }} <ansi fg="yellow">Percept: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Character.Stats.Perception.Value (.Character.StatMod "perception") }} | ||
<ansi fg="yellow">Level: </ansi>{{ printf "%-22d" .Character.Level }} | ||
│ <ansi fg="yellow">Gold: </ansi>{{ printf "%-22s" (numberFormat .Character.Gold) }}│ │ │ | ||
│ <ansi fg="yellow">Health: </ansi>{{ printf "%-10d" .Health }} <ansi fg="yellow">Max: </ansi>{{ printf "%-6d" .HealthMax.Value }}│ │ <ansi fg="yellow">Strength: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Strength.Value (.StatMod "strength") }} <ansi fg="yellow">Vitality: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Vitality.Value (.StatMod "vitality") }} │ | ||
<ansi fg="yellow">Mana: </ansi>{{ printf "%-10d" .Mana }} <ansi fg="yellow">Max: </ansi>{{ printf "%-6d" .ManaMax.Value }} <ansi fg="yellow">Speed: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Speed.Value (.StatMod "speed") }} <ansi fg="yellow">Mysticism: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Mysticism.Value (.StatMod "mysticism") }} | ||
<ansi fg="yellow">Armor: </ansi>{{ printf "%-22s" ( printf "%d" (.GetDefense)) }} <ansi fg="yellow">Smarts: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Smarts.Value (.StatMod "smarts") }} <ansi fg="yellow">Percept: </ansi>{{ printf "%-4d<ansi fg=\"statmod\">(%-3d)</ansi>" .Stats.Perception.Value (.StatMod "perception") }} | ||
<ansi fg="yellow">Level: </ansi>{{ printf "%-22d" .Level }} | ||
│ <ansi fg="yellow">Gold: </ansi>{{ printf "%-22s" (numberFormat .Gold) }}│ │ │ | ||
└───────────────────────────────┘ └──────────────────────────────────────────┘ |
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,9 @@ | ||
<ansi fg="black-bold">.:</ansi> <ansi fg="magenta">Help for </ansi><ansi fg="command">bury</ansi> | ||
|
||
The <ansi fg="command">bury</ansi> command cleans up corpses from the room. | ||
|
||
<ansi fg="yellow">Usage: </ansi> | ||
|
||
<ansi fg="command">bury rat corpse</ansi> | ||
|
||
|
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.