Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions _datafiles/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ ShopRestockRate: 6 hours
# varied.
# Note: see _datafiles/combat-messages/*
ConsistentAttackMessages: true
# - CorpsesEnabled -
# If set to true, corpses are left behind by players or mobs that are killed.
CorpsesEnabled: true
# - CorpseDecayTime -
# How long until corpses crumble to dust (Go away).
CorpseDecayTime: 1 hour
# - MaxAltCharacters -
# How many characters beyond their original character can they create? Players
# can swap between characters and work on them independently if this is set
Expand Down
7 changes: 5 additions & 2 deletions _datafiles/world/default/ansi-aliases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ color8:
username: 93 # Bright yellow
username-aggro: red
username-downed: 90 # Bright black
mobname: 14
mobname: 14
mobname-aggro: 91 # Bright red
mobname-downed: red
petname: 3
Expand Down Expand Up @@ -156,6 +156,8 @@ color8:
script-text: 10
broadcast-prefix: 8
broadcast-body: 13
mob-corpse: 8
user-corpse: 8
color256:
table-title: 2
userid: black
Expand Down Expand Up @@ -306,4 +308,5 @@ color256:
script-text: 155
broadcast-prefix: 135
broadcast-body: 164

mob-corpse: 67
user-corpse: 143
1 change: 1 addition & 0 deletions _datafiles/world/default/keywords.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ help:
- character
- pets
- train
- bury
communication:
- emote
- say
Expand Down
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>
└────────────────────────────────────────────────────────────────────────────┘
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 }}
└────────────────────────────────────────────────────────────────────────────┘
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) }}│ │ │
└───────────────────────────────┘ └──────────────────────────────────────────┘
9 changes: 9 additions & 0 deletions _datafiles/world/default/templates/help/bury.template
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>


7 changes: 5 additions & 2 deletions _datafiles/world/empty/ansi-aliases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ color8:
username: 93 # Bright yellow
username-aggro: red
username-downed: 90 # Bright black
mobname: 14
mobname: 14
mobname-aggro: 91 # Bright red
mobname-downed: red
petname: 3
Expand Down Expand Up @@ -156,6 +156,8 @@ color8:
script-text: 10
broadcast-prefix: 8
broadcast-body: 13
mob-corpse: 8
user-corpse: 8
color256:
table-title: 2
userid: black
Expand Down Expand Up @@ -306,4 +308,5 @@ color256:
script-text: 155
broadcast-prefix: 135
broadcast-body: 164

mob-corpse: 67
user-corpse: 143
1 change: 1 addition & 0 deletions _datafiles/world/empty/keywords.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ help:
- character
- pets
- train
- bury
communication:
- emote
- say
Expand Down
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>
└────────────────────────────────────────────────────────────────────────────┘
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 }}
└────────────────────────────────────────────────────────────────────────────┘
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) }}│ │ │
└───────────────────────────────┘ └──────────────────────────────────────────┘
9 changes: 9 additions & 0 deletions _datafiles/world/empty/templates/help/bury.template
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>


4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ require (
github.com/dop251/goja v0.0.0-20231027120936-b396bb4c349d
github.com/gorilla/websocket v1.5.3
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/stretchr/testify v1.8.0
)

require (
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/text v0.3.8 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
Expand Down
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4M
github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic=
github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
Expand Down Expand Up @@ -39,6 +40,9 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand Down Expand Up @@ -77,5 +81,6 @@ gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST
gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading
Loading