Documentation ¶
Index ¶
- Constants
- Variables
- func Colorize(color ANSIColor, a any) string
- func ColorizeRainbow(str string) string
- func DoAdmin(e *Entity, w *World, tokens []string)
- func DoAlias(e *Entity, _ *World, tokens []string)
- func DoAttack(e *Entity, w *World, tokens []string)
- func DoBuy(e *Entity, w *World, tokens []string)
- func DoChangeJob(e *Entity, w *World, tokens []string)
- func DoConsider(e *Entity, w *World, tokens []string)
- func DoDrop(e *Entity, w *World, tokens []string)
- func DoEquip(e *Entity, w *World, tokens []string)
- func DoEquipment(e *Entity, _ *World, _ []string)
- func DoGet(e *Entity, w *World, tokens []string)
- func DoGive(e *Entity, w *World, tokens []string)
- func DoInventory(e *Entity, _ *World, _ []string)
- func DoLearnSkill(e *Entity, w *World, tokens []string)
- func DoList(e *Entity, w *World, tokens []string)
- func DoListCommands(e *Entity, _ *World, _ []string)
- func DoListJobs(e *Entity, w *World, tokens []string)
- func DoListSkills(e *Entity, w *World, tokens []string)
- func DoLook(e *Entity, w *World, tokens []string)
- func DoMove(e *Entity, w *World, tokens []string)
- func DoPracticeSkill(e *Entity, w *World, tokens []string)
- func DoPut(e *Entity, w *World, tokens []string)
- func DoQuit(e *Entity, w *World, _ []string)
- func DoRaiseStat(e *Entity, w *World, tokens []string)
- func DoSave(e *Entity, w *World, _ []string)
- func DoSay(e *Entity, w *World, tokens []string)
- func DoSell(e *Entity, w *World, tokens []string)
- func DoSit(e *Entity, w *World, _ []string)
- func DoSkill(e *Entity, w *World, tokens []string)
- func DoSleep(e *Entity, w *World, _ []string)
- func DoStand(e *Entity, w *World, _ []string)
- func DoStatus(e *Entity, w *World, tokens []string)
- func DoTell(e *Entity, w *World, tokens []string)
- func DoUnalias(e *Entity, _ *World, tokens []string)
- func DoUnequip(e *Entity, w *World, tokens []string)
- func DoUse(e *Entity, w *World, tokens []string)
- func DoWake(e *Entity, w *World, _ []string)
- func DoWho(e *Entity, w *World, _ []string)
- func DoYell(e *Entity, w *World, tokens []string)
- func GameLoop(w *World, handler *SessionHandler)
- func GetEquipmentSlotDescription(slot EquipSlot) string
- func GetJobXPForNextJobLevel(e *Entity) int
- func GetPercentProgressToNextJobLevel(e *Entity) int
- func GetPercentProgressToNextLevel(e *Entity) int
- func GetXPForNextLevel(e *Entity) int
- func GroupDescriptionsFromMap[TKey comparable, TValue any](m map[TKey]TValue, filterFn func(TKey, TValue) bool, ...) []string
- func GroupDescriptionsFromSlice[TValue any](s []TValue, filterFn func(TValue) bool, descFn func(TValue) string) []string
- func IsMaxJobLevel(e *Entity) bool
- func IsMaxLevel(e *Entity) bool
- func IsReadyForJobLevelUp(e *Entity) bool
- func IsReadyForLevelUp(e *Entity) bool
- func LoadAssets(w *World, projectRoot string)
- func ProcessCommand(e *Entity, w *World, tokens []string) bool
- func RegisterGlobalLuaBindings(L *lua.LState, w *World)
- func RunScript(w *World, filePath string) error
- func SearchList[TItem Matchable](query SearchQuery, items []TItem, filter func(TItem) bool) []TItem
- func SearchMap[TKey comparable, TItem Matchable](query SearchQuery, items map[TKey]TItem, filter func(TItem) bool) []TItem
- type ANSIColor
- type ActionFunc
- type AdvantageType
- type ApplyStatusEffectConfig
- type ArmorConfig
- type AsyncCallback
- type AttackConfig
- type CastingData
- type CastingList
- type ChangeStateEvent
- type CombatData
- type CombatList
- type CommandDesc
- type CommandList
- type CommandMap
- type Condition
- type DamageContext
- type Database
- type DeathMode
- type DeathMudConfig
- type Descriptive
- type Dice
- func (d *Dice) Add(num int) Dice
- func (d *Dice) Average() int
- func (d *Dice) CriticalRoll() int
- func (d *Dice) IsZero() bool
- func (d *Dice) MarshalJSON() ([]byte, error)
- func (d *Dice) Roll() int
- func (d *Dice) String() string
- func (d *Dice) StringColorized(color ANSIColor) string
- func (d *Dice) UnmarshalJSON(data []byte) (err error)
- type Direction
- type Element
- type Entity
- func (e *Entity) AddItem(item *Item)
- func (e *Entity) AddStatusEffect(statusType StatusEffectMask, duration utils.Seconds) bool
- func (e *Entity) AllItems() []*Item
- func (e *Entity) CanBeSeenBy(viewer *Entity) bool
- func (e *Entity) CanSee() bool
- func (e *Entity) Describe() string
- func (e *Entity) DescribeEquipment() string
- func (e *Entity) DescribeInventory() string
- func (e *Entity) DescribeStatus() string
- func (e *Entity) DescribeStatusEffects() string
- func (e *Entity) Equip(item *Item) (EquipSlot, []*Item, bool)
- func (e *Entity) Gender() Gender
- func (e *Entity) GetName() string
- func (e *Entity) GetNameCapitalized() string
- func (e *Entity) GetNamePluralized(count int, includeCount bool) string
- func (e *Entity) GetWeapon() (*WeaponConfig, *EquipmentConfig, bool)
- func (e *Entity) HasStatusEffect(status StatusEffectMask) bool
- func (e *Entity) IsEnemyOf(e2 *Entity) bool
- func (e *Entity) ItemWeight() int
- func (e *Entity) MatchesKeyword(keyword string) bool
- func (e *Entity) RemoveItem(item *Item)
- func (e *Entity) RemoveStatusEffect(statusType StatusEffectMask, permanent bool) bool
- func (e *Entity) RoomId() RoomId
- func (e *Entity) SearchItems(query SearchQuery) []*Item
- func (e *Entity) SetData(data *EntityData, w *World)
- func (e *Entity) SkillTriggers(state EntityState) []*SkillTriggerConfig
- func (e *Entity) State() EntityState
- func (e *Entity) Unequip(item *Item) bool
- type EntityConfig
- type EntityConfigList
- type EntityContainer
- type EntityData
- type EntityFlagMask
- type EntityId
- type EntityList
- type EntityScripts
- type EntityState
- type EntityTypeDeathConfig
- type EquipSlot
- type EquipmentConfig
- type EquipmentDataMap
- type FileSystemDatabase
- type GameState
- type Gender
- type Item
- func (i *Item) AddItem(i2 *Item)
- func (i *Item) AllItems() []*Item
- func (i *Item) CanBeSeenBy(viewer *Entity) bool
- func (i *Item) Describe() string
- func (i *Item) DescribeContents() string
- func (i *Item) GetName() string
- func (i *Item) GetNameCapitalized() string
- func (i *Item) GetNamePluralized(count int, includeCount bool) string
- func (i *Item) ItemWeight() int
- func (i *Item) MatchesKeyword(keyword string) bool
- func (i *Item) RemoveAllFromContainer() ItemList
- func (i *Item) RemoveItem(item *Item)
- func (i *Item) RoomId() RoomId
- func (i *Item) SearchItems(query SearchQuery) []*Item
- func (i *Item) SetData(data *ItemData, w *World)
- func (i *Item) Value() int
- type ItemConfig
- type ItemConfigList
- type ItemContainer
- type ItemData
- type ItemFlagMask
- type ItemId
- type ItemList
- type ItemScripts
- type ItemsOnDeath
- type Job
- type JobBonusStat
- type JobConfig
- type JobData
- type JobTier
- type JobTypeMask
- type JobsMudConfig
- type LearnedSkill
- type LoggedOutState
- type LoginState
- type LoginSubState
- type Matchable
- type MudConfig
- type Named
- type NamedObservable
- type NounConfig
- type Observable
- type ObservableDescriptor
- type ObservableNameDescriptor
- type Ownership
- type Player
- type PlayerCharacterData
- type PlayerData
- type PlayerId
- type PlayerPromptProvider
- type PlayerSessionData
- type PlayingState
- type Position
- type Race
- type Range
- type Room
- func (r *Room) AddEntity(e *Entity)
- func (r *Room) AddItem(i *Item)
- func (r *Room) AllEntities() []*Entity
- func (r *Room) AllItems() []*Item
- func (r *Room) Describe(subject *Entity) string
- func (r *Room) GetName() string
- func (r *Room) GetNameCapitalized() string
- func (r *Room) GetNamePluralized(count int, includeCount bool) string
- func (r *Room) IsExitOpen(dir Direction) bool
- func (r *Room) ItemWeight() int
- func (r *Room) RemoveEntity(e *Entity)
- func (r *Room) RemoveItem(i *Item)
- func (r *Room) SearchEntities(query SearchQuery) []*Entity
- func (r *Room) SearchItems(query SearchQuery) []*Item
- type RoomConfig
- type RoomConfigList
- type RoomExitConfig
- type RoomExitsConfig
- type RoomId
- type RoomPresence
- type SavingThrowConfig
- type SearchQuery
- type SendBuilder
- func (b *SendBuilder) Colorized(c ANSIColor) *SendBuilder
- func (b *SendBuilder) Ignore(e *Entity) *SendBuilder
- func (b *SendBuilder) Restricted(r SendRestrictionsMask) *SendBuilder
- func (b *SendBuilder) Send()
- func (b *SendBuilder) Subject(s NamedObservable) *SendBuilder
- func (b *SendBuilder) ToEntityRoom(w *World, e *Entity) *SendBuilder
- func (b *SendBuilder) ToPlayer(e *Entity) *SendBuilder
- func (b *SendBuilder) ToRoom(r *Room) *SendBuilder
- func (b *SendBuilder) ToWorld(w *World) *SendBuilder
- type SendDestination
- type SendDestinationPlayer
- type SendDestinationRoom
- type SendDestinationWorld
- type SendRestrictionsMask
- type SessionHandler
- type SessionHandlerSystem
- type Shop
- type ShopConfig
- type Size
- type SkillAttack
- type SkillAttackType
- type SkillConfig
- type SkillPreReqs
- type SkillScripts
- type SkillTargetType
- type SkillTriggerConfig
- type SkillType
- type Skills
- type SkillsData
- type SkillsMudConfig
- type SpawnerType
- type Speed
- type StatMap
- type StatType
- type StateId
- type Stats
- func (s *Stats) Add(stat StatType, delta int)
- func (s *Stats) AddMod(stat StatType, mod int)
- func (s *Stats) Condition() Condition
- func (s *Stats) ConditionLongString(e *Entity) string
- func (s *Stats) ConditionShortString() string
- func (s *Stats) Diff(other map[StatType]int) map[StatType]int
- func (s *Stats) Get(stat StatType) int
- func (s *Stats) GetFloat(stat StatType) float64
- func (s *Stats) MaxStatType(stats ...StatType) StatType
- func (s *Stats) RemoveMod(stat StatType, mod int)
- func (s *Stats) Set(stat StatType, val int)
- func (s *Stats) Snapshot() map[StatType]int
- type StatsConfig
- type StatusDataMap
- type StatusEffect
- type StatusEffectConfig
- type StatusEffectConfigBuilder
- type StatusEffectData
- type StatusEffectDuration
- type StatusEffectMask
- type StatusEffects
- type System
- type SystemUpdater
- type UpdateSystem
- type Vocab
- type WeaponConfig
- type WeaponType
- type World
- func (w *World) AddEntity(e *Entity, roomId RoomId)
- func (w *World) AddEntityConfig(cfg *EntityConfig)
- func (w *World) AddItem(i *Item, roomId RoomId)
- func (w *World) AddItemConfig(cfg *ItemConfig)
- func (w *World) AddJobConfig(cfg *JobConfig)
- func (w *World) AddRoom(r *Room) *Room
- func (w *World) AddSession(s *server.Session)
- func (w *World) AddSkillConfig(cfg *SkillConfig)
- func (w *World) CreatePlayerCharacter(name string, pass string, player *Player) *Entity
- func (w *World) EntryRoomId() RoomId
- func (w *World) LogoutPlayer(p *Player)
- func (w *World) OnPlayerInput(p *Player, input string) StateId
- func (w *World) RemoveEntity(eid EntityId)
- func (w *World) RemoveSession(sid server.SessionId)
- func (w *World) SavePlayerCharacter(pid PlayerId)
- func (w *World) SetEntryRoomId(id RoomId)
- func (w *World) TryGetEntityByPlayerId(id PlayerId) (*Entity, bool)
- func (w *World) TryGetEntityConfig(key string) (*EntityConfig, bool)
- func (w *World) TryGetItemConfig(key string) (*ItemConfig, bool)
- func (w *World) TryGetJobConfig(jobType JobTypeMask) (*JobConfig, bool)
- func (w *World) TryGetSkillConfig(key string) (*SkillConfig, bool)
- func (w *World) TryLoadPlayerCharacter(name string, player *Player) (*Entity, error)
- type WorldConfig
- type Zone
- type ZoneConfig
- type ZoneId
- type ZoneSpawner
- type ZoneSpawnerConfig
Constants ¶
View Source
const ( Color_None ANSIColor = "" Color_Black ANSIColor = "black" Color_Red ANSIColor = "red" Color_Green ANSIColor = "green" Color_Yellow ANSIColor = "yellow" Color_Blue ANSIColor = "blue" Color_Magenta ANSIColor = "magenta" Color_Cyan ANSIColor = "cyan" Color_White ANSIColor = "white" Color_DimBlack ANSIColor = "dim black" Color_DimRed ANSIColor = "dim red" Color_DimGreen ANSIColor = "dim green" Color_DimYellow ANSIColor = "dim yellow" Color_DimBlue ANSIColor = "dim blue" Color_DimMagenta ANSIColor = "dim magenta" Color_DimCyan ANSIColor = "dim cyan" Color_DimWhite ANSIColor = "dim white" Color_BrightBlack ANSIColor = "bright black" Color_BrightRed ANSIColor = "bright red" Color_BrightGreen ANSIColor = "bright green" Color_BrightYellow ANSIColor = "bright yellow" Color_BrightBlue ANSIColor = "bright blue" Color_BrightMagenta ANSIColor = "bright magenta" Color_BrightCyan ANSIColor = "bright cyan" Color_BrightWhite ANSIColor = "bright white" Color_Prompt = Color_BrightGreen Color_Positive = Color_Green Color_Negative = Color_Red Color_NegativeBld = Color_Red Color_Neutral = Color_Yellow Color_NeutralBld = Color_BrightYellow Color_PositiveBld = Color_BrightGreen Color_Header = Color_BrightCyan Color_SubHeader = Color_Cyan Color_Entities = Color_BrightWhite Color_Items = Color_BrightWhite Color_Enum = Color_BrightWhite Color_Stat = Color_Cyan Color_PlayerDam = Color_Green Color_EnemyDam = Color_Red Color_StatusEffects = Color_Yellow Color_Cnd_Hurt = Color_Red Color_Cnd_LightHurt = Color_Yellow Color_Cnd_Healthy = Color_Green )
View Source
const ( MaxLevel = 100 MaxStatValue = 99 SightRange = 12 )
View Source
const (
InvalidId = 0
)
View Source
const PlayerEntityKey = "_player"
View Source
const PlayerFileExtension = ".ply"
View Source
const PlayersDirectory = "players"
View Source
const (
ScriptFileExtension = ".lua"
)
View Source
const (
StatusEffectDuration_Permanent = 0
)
Variables ¶
View Source
var CellsPerSecondSpeedLookup = []float64{
0,
2.5,
3.33,
6.66,
10,
}
Converts Speed enum to number of cells that entity can traverse per second
View Source
var D10 = &Dice{1, 10, 0}
View Source
var D100 = &Dice{1, 100, 0}
View Source
var D12 = &Dice{1, 12, 0}
View Source
var D20 = &Dice{1, 20, 0}
View Source
var D4 = &Dice{1, 4, 0}
View Source
var D6 = &Dice{1, 6, 0}
View Source
var D8 = &Dice{1, 8, 0}
View Source
var DefenderElementModifierLookup = [][][]float64{
{
{1, 1, 1, 1, 1, 1, 1, 1, 0.25, 1},
{1, 0.25, 1, 0.5, 1.75, 1, 1, 1, 1, 1},
{1, 1, 1, 1.5, 0.5, 1.25, 1, 1, 1, 1},
{1, 1.5, 0.5, 0.25, 1, 1.25, 1, 1, 1, 1},
{1, 0.5, 1.5, 1, 0.25, 1.25, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 0, 1, 0.5, 1, 0.5},
{1, 0.75, 0.75, 0.75, 0.75, 0.75, 0, 1.25, 0.75, 1},
{1, 1, 1, 1, 1, 0.5, 1.25, 0, 0.75, 0},
{0.25, 1, 1, 1, 1, 1, 1, 1, 1.25, 1},
{1, 1, 1, 1.25, 1, -0.25, 1.5, -0.25, 1, 0},
},
{
{1, 1, 1, 1, 1, 1, 1, 1, 0, 1},
{1, 0, 1, 0.25, 1.75, 0.75, 1, 1, 0.75, 0.75},
{1, 1, 0.5, 1.75, 0.25, 1.25, 1, 1, 0.75, 0.75},
{1, 1.75, 0.25, 0, 1, 1.25, 1, 1, 0.75, 0.75},
{1, 0.25, 1.75, 1, 0, 1.25, 1, 1, 0.75, 0.75},
{1, 1, 1, 1, 1, 0, 1, 0.25, 0.75, 0.25},
{1, 0.5, 0.5, 0.5, 0.5, 0.5, -0.25, 1.5, 0.5, 1.25},
{1, 0.75, 0.75, 0.75, 0.75, 0.25, 1.5, -0.25, 0.5, 0},
{0.25, 1, 1, 1, 1, 0.75, 1, 1, 1.5, 1},
{1, 1, 1, 1.5, 1, -0.5, 1.75, -0.5, 1.25, 0},
},
{
{1, 1, 1, 1, 1, 1, 1, 1, 0, 1},
{1, -0.25, 1, 0, 2, 0.5, 1, 1, 0.5, 0.5},
{1, 1, 0, 2, 0, 1, 1, 1, 0.5, 0.5},
{1, 2, 0, -0.25, 1, 1, 1, 1, 0.5, 0.5},
{1, 0, 2, 1, -0.25, 1, 1, 1, 0.5, 0.5},
{1, 1, 1, 1, 1, 0, 1.25, 0, 0.5, 0},
{1, 0.25, 0.25, 0.25, 0.25, 0.25, -0.5, 1.75, 0.25, 1.5},
{1, 0.5, 0.5, 0.5, 0.5, 0, 1.75, -0.5, 0.25, 0},
{0, 1, 1, 1, 1, 0.5, 1, 1, 1.75, 1},
{1, 1.25, 1, 1.75, 1, -0.75, 2, -0.75, 1.5, 0},
},
{
{1, 1, 1, 1, 1, 1, 1, 1, 0, 1},
{1, -0.5, 1, 0, 2, 0.25, 0.75, 0.75, 0.25, 0.25},
{1, 1, -0.25, 2, 0, 0.75, 0.75, 0.75, 0.25, 0.25},
{1, 2, 0, -0.5, 1, 0.75, 0.75, 0.75, 0.25, 0.25},
{1, 0, 2, 1, -0.5, 0.75, 0.75, 0.75, 0.25, 0.25},
{1, 0.75, 0.75, 0.75, 0.75, 0, 1.25, -0.25, 0.25, -0.25},
{1, 0, 0, 0, 0, 0, -1, 2, 0, 1.75},
{1, 0.25, 0.25, 0.25, 0.25, -0.25, 2, -1, 0, 0},
{0, 1, 1, 1, 1, 0.25, 1, 1, 2, 1},
{1, 1.5, 0.5, 2, 1, -1, 2, -1, 1.75, 0},
},
}
Map of defending element to attacking element multiplier (by defending element level) = [DefElemLevel][DefElem][AtkElem]Mult
View Source
var DefenderSizeModifierLookup = [][]float64{
{1, 1, 0.75, 0.75, 0.75, 0.75, 0.5, 0.75, 1, 1, 0.75, 1, 1, 0.75, 0.75},
{1, 0.75, 1, 0.75, 0.75, 1, 0.75, 1, 1, 1, 1, 1, 0.75, 1, 1},
{1, 0.5, 0.75, 1, 1, 1, 1, 1, 1, 0.75, 0.75, 0.5, 0.5, 0.75, 0.5},
}
Determines damage modification multiplier when attacking entity of specified size with weapon type = Size[WeaponType]Mult
View Source
var JobXPLookup = [][]int{
{
0,
0,
10,
28,
56,
96,
187,
338,
543,
811,
1151,
},
{
0,
0,
30,
73,
131,
207,
323,
503,
723,
995,
1331,
1851,
2455,
3154,
3956,
4904,
6029,
7697,
9634,
11860,
14900,
18888,
24452,
30724,
37745,
46859,
58332,
73622,
90513,
109083,
132312,
160671,
197149,
236865,
279953,
332370,
394865,
473025,
557200,
647604,
755215,
881130,
1035071,
1226852,
1431203,
1679555,
1965767,
2352138,
2761933,
3244025,
3753621,
},
{
0,
0,
144,
328,
612,
960,
1563,
2450,
3546,
5144,
7684,
11360,
15650,
20596,
27275,
36767,
49537,
63881,
79886,
100528,
127962,
163070,
201647,
243853,
296561,
363532,
446220,
535764,
632433,
750254,
895175,
1069376,
1256053,
1455637,
1694254,
1980620,
2317767,
2676202,
3056578,
3504263,
4031252,
4641498,
5286234,
6079769,
7001579,
8108337,
9369292,
10856596,
12414253,
14404885,
16488271,
},
}
Amount of Job XP needed for each job level = [JobType][JobLevel]
View Source
var Preamble = strings.ReplaceAll(` ________ ________ _____ ______ ___ ___ ________ |\ __ \|\ __ \|\ _ \ _ \|\ \|\ \|\ ___ \ \ \ \|\ \ \ \|\ \ \ \\\__\ \ \ \ \\\ \ \ \_|\ \ \ \ _ _\ \ \\\ \ \ \\|__| \ \ \ \\\ \ \ \ \\ \ \ \ \\ \\ \ \\\ \ \ \ \ \ \ \ \\\ \ \ \_\\ \ \ \__\\ _\\ \_______\ \__\ \ \__\ \_______\ \_______\ \|__|\|__|\|_______|\|__| \|__|\|_______|\|_______| `, "\n", utils.NewLine)
View Source
var StatusEffectConfigs = map[StatusEffectMask]*StatusEffectConfig{ StatusType_Poison: NewStatusEffectConfigBuilder(). Build(), StatusType_Blind: NewStatusEffectConfigBuilder(). WithEntityFlag(EFlag_Blind). Build(), StatusType_Invisible: NewStatusEffectConfigBuilder(). WithEntityFlag(EFlag_Invisible). Build(), }
View Source
var XPLookup = []int{
0,
0,
9,
25,
50,
86,
163,
275,
428,
628,
881,
1201,
1586,
2076,
2661,
3361,
4191,
5161,
6281,
7541,
8961,
10581,
12441,
14431,
16671,
19175,
22125,
25551,
29485,
33959,
40848,
48843,
58017,
68442,
80190,
94157,
109932,
127610,
147287,
169060,
199603,
233815,
271880,
313982,
360305,
413331,
471750,
535791,
605683,
681656,
784124,
899378,
1028070,
1170854,
1328382,
1506566,
1702866,
1918064,
2152943,
2408284,
2738472,
3104386,
3507610,
3949726,
4432316,
4969264,
5554455,
6189733,
6876944,
7617932,
8543332,
10017078,
11611136,
13330064,
15178419,
17160759,
19390872,
21777034,
24324451,
27038329,
30244489,
33925513,
37947985,
42325009,
47069689,
52195129,
57962401,
64166401,
70821865,
77943529,
85546129,
95284849,
106934809,
120578329,
138917629,
162754429,
198412429,
247099429,
305234429,
405234427,
}
Amount of XP needed for each level
Functions ¶
func ColorizeRainbow ¶
func DoChangeJob ¶
func DoConsider ¶
func DoEquipment ¶
func DoInventory ¶
func DoLearnSkill ¶
func DoListCommands ¶
func DoListJobs ¶
func DoListSkills ¶
func DoPracticeSkill ¶
func DoRaiseStat ¶
func GameLoop ¶
func GameLoop(w *World, handler *SessionHandler)
func GetJobXPForNextJobLevel ¶
func GetXPForNextLevel ¶
func GroupDescriptionsFromMap ¶
func GroupDescriptionsFromMap[TKey comparable, TValue any](m map[TKey]TValue, filterFn func(TKey, TValue) bool, descFn func(TKey, TValue) string) []string
func IsMaxJobLevel ¶
func IsMaxLevel ¶
func IsReadyForJobLevelUp ¶
func IsReadyForLevelUp ¶
func LoadAssets ¶
func SearchList ¶
func SearchList[TItem Matchable](query SearchQuery, items []TItem, filter func(TItem) bool) []TItem
func SearchMap ¶
func SearchMap[TKey comparable, TItem Matchable](query SearchQuery, items map[TKey]TItem, filter func(TItem) bool) []TItem
Types ¶
type ActionFunc ¶
type AdvantageType ¶
type AdvantageType int
type ApplyStatusEffectConfig ¶
type ApplyStatusEffectConfig struct { Type StatusEffectMask Duration utils.Seconds Save *SavingThrowConfig }
type ArmorConfig ¶
type AsyncCallback ¶
type AsyncCallback struct {
// contains filtered or unexported fields
}
type AttackConfig ¶
type CastingData ¶
type CastingData struct {
// contains filtered or unexported fields
}
func (*CastingData) Valid ¶
func (c *CastingData) Valid(e *Entity) bool
type CastingList ¶
func (*CastingList) EndCasting ¶
func (c *CastingList) EndCasting(e *Entity)
func (*CastingList) StartCasting ¶
func (c *CastingList) StartCasting(e *Entity, time utils.Seconds, target *Entity, skill *SkillConfig, level int) bool
type ChangeStateEvent ¶
type ChangeStateEvent struct {
// contains filtered or unexported fields
}
type CombatData ¶
type CombatData struct {
// contains filtered or unexported fields
}
func (*CombatData) Valid ¶
func (c *CombatData) Valid(e *Entity) bool
type CombatList ¶
func (*CombatList) EndCombat ¶
func (c *CombatList) EndCombat(e *Entity)
func (*CombatList) StartCombat ¶
func (c *CombatList) StartCombat(e *Entity, tgt *Entity, distance float64) bool
type CommandDesc ¶
type CommandDesc struct {
// contains filtered or unexported fields
}
type DamageContext ¶
type DamageContext int
const ( DamCtx_Melee DamageContext = iota DamCtx_Bleeding DamCtx_Poison DamCtx_Skill DamCtx_Admin DamageContext = 999 )
type Database ¶
type Database interface { DoesPlayerExist(id string) bool SavePlayer(id string, data *PlayerCharacterData) error LoadPlayer(id string) (*PlayerCharacterData, error) }
type DeathMudConfig ¶
type DeathMudConfig struct { Mode DeathMode Players *EntityTypeDeathConfig Monsters *EntityTypeDeathConfig }
type Descriptive ¶
type Descriptive interface {
Describe() string
}
type Dice ¶
func (*Dice) CriticalRoll ¶
func (*Dice) MarshalJSON ¶
func (*Dice) StringColorized ¶
func (*Dice) UnmarshalJSON ¶
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
func NewEntity ¶
func NewEntity(cfg *EntityConfig) *Entity
func SearchEntities ¶
func SearchEntities(query SearchQuery, self *Entity, containers ...EntityContainer) []*Entity
func TryGetEntityByName ¶
func (*Entity) AddStatusEffect ¶
func (e *Entity) AddStatusEffect(statusType StatusEffectMask, duration utils.Seconds) bool
func (*Entity) CanBeSeenBy ¶
func (*Entity) DescribeEquipment ¶
func (*Entity) DescribeInventory ¶
func (*Entity) DescribeStatus ¶
func (*Entity) DescribeStatusEffects ¶
func (*Entity) GetNameCapitalized ¶
func (*Entity) GetNamePluralized ¶
func (*Entity) GetWeapon ¶
func (e *Entity) GetWeapon() (*WeaponConfig, *EquipmentConfig, bool)
func (*Entity) HasStatusEffect ¶
func (e *Entity) HasStatusEffect(status StatusEffectMask) bool
func (*Entity) ItemWeight ¶
func (*Entity) MatchesKeyword ¶
func (*Entity) RemoveItem ¶
func (*Entity) RemoveStatusEffect ¶
func (e *Entity) RemoveStatusEffect(statusType StatusEffectMask, permanent bool) bool
func (*Entity) SearchItems ¶
func (e *Entity) SearchItems(query SearchQuery) []*Item
func (*Entity) SetData ¶
func (e *Entity) SetData(data *EntityData, w *World)
func (*Entity) SkillTriggers ¶
func (e *Entity) SkillTriggers(state EntityState) []*SkillTriggerConfig
func (*Entity) State ¶
func (e *Entity) State() EntityState
type EntityConfig ¶
type EntityConfig struct { Key string Name string Gender Gender Keywords []string RoomDesc string FullDesc string DropTable *utils.ChanceTable[string] Stats *StatsConfig Attack *AttackConfig SkillTriggers map[EntityState][]*SkillTriggerConfig Flags EntityFlagMask // contains filtered or unexported fields }
func (*EntityConfig) Init ¶
func (cfg *EntityConfig) Init()
type EntityConfigList ¶
type EntityConfigList []*EntityConfig
type EntityContainer ¶
type EntityContainer interface { AddEntity(entity *Entity) SearchEntities(query SearchQuery) []*Entity AllEntities() []*Entity RemoveEntity(entity *Entity) }
type EntityData ¶
type EntityData struct { Key string RoomId RoomId `json:",omitempty"` Job *JobData `json:",omitempty"` Skills *SkillsData `json:",omitempty"` Stats StatMap `json:",omitempty"` Inventory []*ItemData `json:",omitempty"` Equipped EquipmentDataMap `json:",omitempty"` Statuses StatusDataMap `json:",omitempty"` }
type EntityFlagMask ¶
const ( EFlag_Stationary EntityFlagMask = 1 << iota // Cannot move EFlag_Scavenger // Pick up items on the ground EFlag_UsesEquipment // Can use equipment EFlag_Blind // Cannot see EFlag_Invisible // Cannot be seen EFlag_Aggro // Attacks enemies on sight EFlag_AssistAll // Assist all mobs who are being fought by players EFlag_AssistSame // Assist mobs of the same type who are being fought by players EFlag_CanLeaveZone // Will wander out of initial zone EFlag_Pacifist // Won't attack EFlag_Uninterruptable // Skills can't be interrupted EFlag_Detector // Can detect hidden entities // TODO: EFlags: Implement EFlag_Talks // Can talk )
func ParseEntityFlag ¶
func ParseEntityFlag(str string) (EntityFlagMask, error)
func (*EntityFlagMask) Has ¶
func (m *EntityFlagMask) Has(flag EntityFlagMask) bool
func (*EntityFlagMask) MarshalJSON ¶
func (m *EntityFlagMask) MarshalJSON() ([]byte, error)
func (*EntityFlagMask) String ¶
func (m *EntityFlagMask) String() string
func (*EntityFlagMask) Strings ¶
func (m *EntityFlagMask) Strings() []string
func (*EntityFlagMask) UnmarshalJSON ¶
func (m *EntityFlagMask) UnmarshalJSON(data []byte) (err error)
type EntityList ¶
type EntityList []*Entity
type EntityScripts ¶
type EntityScripts struct {
// contains filtered or unexported fields
}
func NewEntityScripts ¶
func NewEntityScripts(L *lua.LState, tbl *lua.LTable) *EntityScripts
type EntityState ¶
type EntityState int
const ( EState_Idle EntityState = iota EState_Combat )
func ParseEntityState ¶
func ParseEntityState(str string) (EntityState, error)
type EntityTypeDeathConfig ¶
type EntityTypeDeathConfig struct { Corpses bool Items ItemsOnDeath }
type EquipSlot ¶
const ( EqSlot_None EquipSlot = 1 << iota // Slot flags EqSlot_Head_High EqSlot_Head_Mid EqSlot_Head_Low EqSlot_Garment EqSlot_Armor EqSlot_Feet EqSlot_Accessory_1 EqSlot_Accessory_2 EqSlot_Held_L EqSlot_Held_R // Special flags EqSlot_Accessory EqSlot_Held_1H EqSlot_Held_2H = EqSlot_Held_L | EqSlot_Held_R )
func ParseEquipSlot ¶
func (*EquipSlot) MarshalJSON ¶
type EquipmentConfig ¶
type EquipmentConfig struct { Slot EquipSlot Stats StatMap StatusEffect StatusEffectMask Armor *ArmorConfig Weapon *WeaponConfig RequiredLevel int Upgradable bool }
type EquipmentDataMap ¶
func (*EquipmentDataMap) MarshalJSON ¶
func (m *EquipmentDataMap) MarshalJSON() ([]byte, error)
func (*EquipmentDataMap) UnmarshalJSON ¶
func (m *EquipmentDataMap) UnmarshalJSON(data []byte) (err error)
type FileSystemDatabase ¶
type FileSystemDatabase struct {
// contains filtered or unexported fields
}
func NewFileSystemDatabase ¶
func NewFileSystemDatabase(path string) *FileSystemDatabase
func (*FileSystemDatabase) DoesPlayerExist ¶
func (db *FileSystemDatabase) DoesPlayerExist(id string) bool
func (*FileSystemDatabase) LoadPlayer ¶
func (db *FileSystemDatabase) LoadPlayer(id string) (*PlayerCharacterData, error)
func (*FileSystemDatabase) SavePlayer ¶
func (db *FileSystemDatabase) SavePlayer(id string, data *PlayerCharacterData) error
type Gender ¶
type Gender uint8
func (Gender) GetObjectPronoun ¶
func (Gender) GetPossessivePronoun ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
func NewItem ¶
func NewItem(cfg *ItemConfig) *Item
func SearchItems ¶
func SearchItems(query SearchQuery, containers ...ItemContainer) []*Item
func (*Item) CanBeSeenBy ¶
func (*Item) DescribeContents ¶
func (*Item) GetNameCapitalized ¶
func (*Item) GetNamePluralized ¶
func (*Item) ItemWeight ¶
func (*Item) MatchesKeyword ¶
func (*Item) RemoveAllFromContainer ¶
func (*Item) RemoveItem ¶
func (*Item) SearchItems ¶
func (i *Item) SearchItems(query SearchQuery) []*Item
type ItemConfig ¶
type ItemConfig struct { Key string Name string NamePlural string Keywords []string RoomDesc string FullDesc string Flags ItemFlagMask Equipment *EquipmentConfig BuyPrice int SellPrice int Weight int // contains filtered or unexported fields }
func (*ItemConfig) GetName ¶
func (cfg *ItemConfig) GetName() string
func (*ItemConfig) GetNameCapitalized ¶
func (cfg *ItemConfig) GetNameCapitalized() string
func (*ItemConfig) GetNamePluralized ¶
func (cfg *ItemConfig) GetNamePluralized(count int, includeCount bool) string
func (*ItemConfig) Init ¶
func (cfg *ItemConfig) Init()
func (*ItemConfig) MatchesKeyword ¶
func (cfg *ItemConfig) MatchesKeyword(keyword string) bool
func (*ItemConfig) Stackable ¶
func (cfg *ItemConfig) Stackable() bool
type ItemConfigList ¶
type ItemConfigList []*ItemConfig
type ItemContainer ¶
type ItemFlagMask ¶
const ( IFlag_Container ItemFlagMask = 1 << iota // Can contain other items IFlag_NoStorage // Cannot be used for storage (i.e. can't add contents to them) IFlag_Light // Light the room that they're in IFlag_Environmental // Can't be picked up IFlag_Crumbles // Crumble when picked up IFlag_Usable // Item can be used ('use' command) IFlag_Consumable // Item is consumed when used )
func ParseItemFlag ¶
func ParseItemFlag(str string) (ItemFlagMask, error)
func (*ItemFlagMask) Has ¶
func (m *ItemFlagMask) Has(flag ItemFlagMask) bool
func (*ItemFlagMask) MarshalJSON ¶
func (m *ItemFlagMask) MarshalJSON() ([]byte, error)
func (*ItemFlagMask) String ¶
func (m *ItemFlagMask) String() string
func (*ItemFlagMask) UnmarshalJSON ¶
func (m *ItemFlagMask) UnmarshalJSON(data []byte) (err error)
type ItemScripts ¶
type ItemScripts struct {
// contains filtered or unexported fields
}
func NewItemScripts ¶
func NewItemScripts(L *lua.LState, tbl *lua.LTable) *ItemScripts
type ItemsOnDeath ¶
type ItemsOnDeath int
const ( ItemsOnDeath_Drop ItemsOnDeath = iota ItemsOnDeath_Destroy ItemsOnDeath_Retain )
func ParseItemsOnDeath ¶
func ParseItemsOnDeath(str string) (ItemsOnDeath, error)
func (*ItemsOnDeath) UnmarshalJSON ¶
func (d *ItemsOnDeath) UnmarshalJSON(data []byte) (err error)
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
func (*Job) CanLearnSkill ¶
type JobBonusStat ¶
type JobConfig ¶
type JobConfig struct { Name string JobType JobTypeMask JobTier JobTier Base JobTypeMask AspdBase map[WeaponType]int MaxHPMod float64 MaxSPMod float64 CarryingCapacityMod int BonusStats []JobBonusStat // contains filtered or unexported fields }
func (*JobConfig) IsJobTypeOrAncestor ¶
func (cfg *JobConfig) IsJobTypeOrAncestor(jobType JobTypeMask) bool
type JobData ¶
type JobData struct {
JobType JobTypeMask
}
type JobTypeMask ¶
const ( JobType_Novice JobTypeMask = 1 << iota JobType_Swordman JobType_Mage JobType_Archer JobType_Merchant JobType_Thief JobType_Acolyte JobType_Knight JobType_Crusader JobType_Wizard JobType_Sage JobType_Hunter JobType_Bard JobType_Dancer JobType_Blacksmith JobType_Alchemist JobType_Assassin JobType_Rogue JobType_Priest JobType_Monk JobType_Num JobType_All )
func ParseJobTypeMask ¶
func ParseJobTypeMask(str string) (JobTypeMask, error)
func (*JobTypeMask) MarshalJSON ¶
func (jt *JobTypeMask) MarshalJSON() ([]byte, error)
func (*JobTypeMask) String ¶
func (jt *JobTypeMask) String() string
func (*JobTypeMask) UnmarshalJSON ¶
func (jt *JobTypeMask) UnmarshalJSON(data []byte) (err error)
type JobsMudConfig ¶
type JobsMudConfig struct {
IgnoreJobRequirements bool
}
type LearnedSkill ¶
type LoggedOutState ¶
type LoggedOutState struct {
// contains filtered or unexported fields
}
func (*LoggedOutState) OnEnter ¶
func (s *LoggedOutState) OnEnter()
func (*LoggedOutState) OnExit ¶
func (s *LoggedOutState) OnExit()
func (*LoggedOutState) ProcessInput ¶
func (s *LoggedOutState) ProcessInput(_ string) StateId
func (*LoggedOutState) StateId ¶
func (s *LoggedOutState) StateId() StateId
type LoginState ¶
type LoginState struct {
// contains filtered or unexported fields
}
func (*LoginState) OnEnter ¶
func (s *LoginState) OnEnter()
func (*LoginState) OnExit ¶
func (s *LoginState) OnExit()
func (*LoginState) ProcessInput ¶
func (s *LoginState) ProcessInput(input string) StateId
func (*LoginState) StateId ¶
func (s *LoginState) StateId() StateId
type LoginSubState ¶
type LoginSubState int
const ( LSS_EnterName LoginSubState = iota LSS_NewUserConfName LSS_NewUserEnterPass LSS_NewUserConfPass LSS_RetUserEnterPass LSS_SelectInitialStats LSS_ConfirmInitialStats )
type MudConfig ¶
type MudConfig struct { ConfigRoot string Death *DeathMudConfig Jobs *JobsMudConfig Skills *SkillsMudConfig ItemDropRateMultiplier float64 XPRateMultiplier float64 JobXPRateMultiplier float64 GameSpeedMultiplier float64 LootOwnershipDurationSeconds float64 LuaAPIFile string // (Optional) dot delimeted file path to Lua API script }
type NamedObservable ¶
type NamedObservable interface { Observable Named }
type NounConfig ¶
type Observable ¶
type ObservableDescriptor ¶
func ObservableName ¶
func ObservableName(o NamedObservable) ObservableDescriptor
func ObservableNameCap ¶
func ObservableNameCap(o NamedObservable) ObservableDescriptor
type ObservableNameDescriptor ¶
type ObservableNameDescriptor struct {
// contains filtered or unexported fields
}
func (ObservableNameDescriptor) Desc ¶
func (d ObservableNameDescriptor) Desc(observer *Entity) string
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
func (*Player) SetData ¶
func (p *Player) SetData(data *PlayerData)
type PlayerCharacterData ¶
type PlayerCharacterData struct { Player *PlayerData Character *EntityData }
type PlayerData ¶
type PlayerPromptProvider ¶
type PlayerPromptProvider struct {
// contains filtered or unexported fields
}
func (*PlayerPromptProvider) Prompt ¶
func (pp *PlayerPromptProvider) Prompt() string
type PlayerSessionData ¶
type PlayerSessionData struct {
// contains filtered or unexported fields
}
type PlayingState ¶
type PlayingState struct {
// contains filtered or unexported fields
}
func (*PlayingState) OnEnter ¶
func (s *PlayingState) OnEnter()
func (*PlayingState) OnExit ¶
func (s *PlayingState) OnExit()
func (*PlayingState) ProcessInput ¶
func (s *PlayingState) ProcessInput(input string) StateId
func (*PlayingState) StateId ¶
func (s *PlayingState) StateId() StateId
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
func (*Room) AllEntities ¶
func (*Room) GetNameCapitalized ¶
func (*Room) GetNamePluralized ¶
func (*Room) IsExitOpen ¶
func (*Room) ItemWeight ¶
func (*Room) RemoveEntity ¶
func (*Room) RemoveItem ¶
func (*Room) SearchEntities ¶
func (r *Room) SearchEntities(query SearchQuery) []*Entity
func (*Room) SearchItems ¶
func (r *Room) SearchItems(query SearchQuery) []*Item
type RoomConfig ¶
type RoomConfig struct { Id RoomId Name string Desc string Exits RoomExitsConfig }
type RoomConfigList ¶
type RoomConfigList []*RoomConfig
type RoomExitConfig ¶
type RoomExitsConfig ¶
type RoomPresence ¶
type RoomPresence interface {
RoomId() RoomId
}
type SavingThrowConfig ¶
type SearchQuery ¶
func NewSearchQuery ¶
func NewSearchQuery(keyword string, count int) SearchQuery
func (SearchQuery) IsEmpty ¶
func (s SearchQuery) IsEmpty() bool
type SendBuilder ¶
type SendBuilder struct {
// contains filtered or unexported fields
}
func Write ¶
func Write(format string, args ...any) *SendBuilder
func (*SendBuilder) Colorized ¶
func (b *SendBuilder) Colorized(c ANSIColor) *SendBuilder
func (*SendBuilder) Ignore ¶
func (b *SendBuilder) Ignore(e *Entity) *SendBuilder
func (*SendBuilder) Restricted ¶
func (b *SendBuilder) Restricted(r SendRestrictionsMask) *SendBuilder
func (*SendBuilder) Send ¶
func (b *SendBuilder) Send()
func (*SendBuilder) Subject ¶
func (b *SendBuilder) Subject(s NamedObservable) *SendBuilder
func (*SendBuilder) ToEntityRoom ¶
func (b *SendBuilder) ToEntityRoom(w *World, e *Entity) *SendBuilder
func (*SendBuilder) ToPlayer ¶
func (b *SendBuilder) ToPlayer(e *Entity) *SendBuilder
func (*SendBuilder) ToRoom ¶
func (b *SendBuilder) ToRoom(r *Room) *SendBuilder
func (*SendBuilder) ToWorld ¶
func (b *SendBuilder) ToWorld(w *World) *SendBuilder
type SendDestination ¶
type SendDestination interface {
Send(b *SendBuilder)
}
type SendDestinationPlayer ¶
type SendDestinationPlayer struct {
// contains filtered or unexported fields
}
func (SendDestinationPlayer) Send ¶
func (d SendDestinationPlayer) Send(b *SendBuilder)
type SendDestinationRoom ¶
type SendDestinationRoom struct {
// contains filtered or unexported fields
}
func (SendDestinationRoom) Send ¶
func (d SendDestinationRoom) Send(b *SendBuilder)
type SendDestinationWorld ¶
type SendDestinationWorld struct {
// contains filtered or unexported fields
}
func (SendDestinationWorld) Send ¶
func (d SendDestinationWorld) Send(b *SendBuilder)
type SendRestrictionsMask ¶
const ( SendRst_None SendRestrictionsMask = 0 SendRst_CanSee SendRestrictionsMask = 1 << iota )
func (*SendRestrictionsMask) Has ¶
func (m *SendRestrictionsMask) Has(flag SendRestrictionsMask) bool
type SessionHandler ¶
type SessionHandler struct {
// contains filtered or unexported fields
}
func NewSessionHandler ¶
func NewSessionHandler(world *World, events <-chan server.SessionEvent) *SessionHandler
func (*SessionHandler) ChangeGameState ¶
func (s *SessionHandler) ChangeGameState(sid server.SessionId, id StateId)
func (*SessionHandler) HandleEvent ¶
func (s *SessionHandler) HandleEvent(sessionEvt server.SessionEvent)
type SessionHandlerSystem ¶
type SessionHandlerSystem struct {
// contains filtered or unexported fields
}
type Shop ¶
type Shop struct {
// contains filtered or unexported fields
}
func NewShop ¶
func NewShop(cfg *ShopConfig) *Shop
type ShopConfig ¶
type SkillAttack ¶
type SkillAttack struct { AtkType SkillAttackType // Type of attack (weapon, mag) AtkBonus float64 // Attack multiplier MAtkBonus float64 // Magic Attack multiplier HitBonus float64 // Hit multiplier Element Element // Element of attack Delay utils.Seconds // Delay until attack triggers // contains filtered or unexported fields }
type SkillAttackType ¶
type SkillAttackType int
const ( SkillAttackType_Physical SkillAttackType = iota SkillAttackType_Magic )
func ParseSkillAttackType ¶
func ParseSkillAttackType(str string) (SkillAttackType, error)
func (*SkillAttackType) String ¶
func (dt *SkillAttackType) String() string
type SkillConfig ¶
type SkillConfig struct { Key string Name string Type SkillType TargetType SkillTargetType Range int CastTimes []utils.Seconds CastDelays []utils.Seconds SPCosts []int MaxLevel int Job JobTypeMask PreReqs *SkillPreReqs Desc string // contains filtered or unexported fields }
func (*SkillConfig) SPCost ¶
func (cfg *SkillConfig) SPCost(level int) int
func (*SkillConfig) SelectableLevel ¶
func (cfg *SkillConfig) SelectableLevel() bool
type SkillPreReqs ¶
type SkillScripts ¶
type SkillScripts struct {
// contains filtered or unexported fields
}
func NewSkillScripts ¶
func NewSkillScripts(L *lua.LState, tbl *lua.LTable) *SkillScripts
type SkillTargetType ¶
type SkillTargetType int
const ( SkillTargetType_None SkillTargetType = iota SkillTargetType_Self SkillTargetType_Single_Ally SkillTargetType_Single_Enemy SkillTargetType_Single_Entity SkillTargetType_All_Enemies )
func ParseSkillTargetType ¶
func ParseSkillTargetType(str string) (SkillTargetType, error)
func (*SkillTargetType) String ¶
func (s *SkillTargetType) String() string
type SkillTriggerConfig ¶
type Skills ¶
type Skills struct {
// contains filtered or unexported fields
}
func (*Skills) KnowsSkill ¶
func (*Skills) SetData ¶
func (s *Skills) SetData(data *SkillsData)
func (*Skills) SkillLevel ¶
func (*Skills) SkillMastered ¶
type SkillsData ¶
type SkillsData struct {
Learned []*LearnedSkill
}
type SkillsMudConfig ¶
type SpawnerType ¶
type SpawnerType int
const ( Spawner_Entity SpawnerType = iota Spawner_Item )
func ParseSpawnerType ¶
func ParseSpawnerType(str string) (SpawnerType, error)
type StatType ¶
type StatType int
func ParseStatType ¶
func (*StatType) MarshalJSON ¶
func (*StatType) UnmarshalJSON ¶
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
func (*Stats) ConditionLongString ¶
func (*Stats) ConditionShortString ¶
func (*Stats) MaxStatType ¶
type StatsConfig ¶
type StatsConfig struct { HP int Size Size Speed Speed Element Element ElementLevel int Race Race Mov int Str int Agi int Vit int Int int Dex int Luk int Level int Hit100 int // Monster Only: HIT value required for making 100% chance hit on monster Flee95 int // Monster Only: FLEE value required for making 95% chance dodge on monster XPValue int JobXPValue int }
type StatusDataMap ¶
type StatusDataMap map[StatusEffectMask]*StatusEffectData
func (*StatusDataMap) MarshalJSON ¶
func (m *StatusDataMap) MarshalJSON() ([]byte, error)
func (*StatusDataMap) UnmarshalJSON ¶
func (m *StatusDataMap) UnmarshalJSON(data []byte) (err error)
type StatusEffect ¶
type StatusEffect struct {
// contains filtered or unexported fields
}
type StatusEffectConfig ¶
type StatusEffectConfig struct {
EntityFlags EntityFlagMask
}
type StatusEffectConfigBuilder ¶
type StatusEffectConfigBuilder struct {
// contains filtered or unexported fields
}
func NewStatusEffectConfigBuilder ¶
func NewStatusEffectConfigBuilder() *StatusEffectConfigBuilder
func (*StatusEffectConfigBuilder) Build ¶
func (b *StatusEffectConfigBuilder) Build() *StatusEffectConfig
func (*StatusEffectConfigBuilder) WithEntityFlag ¶
func (b *StatusEffectConfigBuilder) WithEntityFlag(f EntityFlagMask) *StatusEffectConfigBuilder
type StatusEffectData ¶
type StatusEffectDuration ¶
type StatusEffectDuration int
type StatusEffectMask ¶
const ( // TODO Implement StatusType_Poison StatusEffectMask = 1 << iota StatusType_Blind StatusType_Invisible )
func ParseStatusEffectType ¶
func ParseStatusEffectType(str string) (StatusEffectMask, error)
func (*StatusEffectMask) Has ¶
func (m *StatusEffectMask) Has(status StatusEffectMask) bool
func (*StatusEffectMask) MarshalJSON ¶
func (m *StatusEffectMask) MarshalJSON() ([]byte, error)
func (*StatusEffectMask) String ¶
func (m *StatusEffectMask) String() string
func (*StatusEffectMask) UnmarshalJSON ¶
func (m *StatusEffectMask) UnmarshalJSON(data []byte) (err error)
type StatusEffects ¶
type StatusEffects struct {
// contains filtered or unexported fields
}
type SystemUpdater ¶
type UpdateSystem ¶
type UpdateSystem struct {
// contains filtered or unexported fields
}
type Vocab ¶
type Vocab struct {
// contains filtered or unexported fields
}
func (*Vocab) GetNoun ¶
func (v *Vocab) GetNoun(key string) *NounConfig
type WeaponConfig ¶
type WeaponType ¶
type WeaponType int
const ( WeaponType_Fist WeaponType = iota WeaponType_Dagger WeaponType_Sword_1H WeaponType_Sword_2H WeaponType_Spear_1H WeaponType_Spear_2H WeaponType_Axe_1H WeaponType_Axe_2H WeaponType_Mace_1H WeaponType_Mace_2H WeaponType_Staff_1H WeaponType_Staff_2H WeaponType_Bow WeaponType_Knuckle WeaponType_Musical WeaponType_Whip WeaponType_Book WeaponType_Katar WeaponType_Gun WeaponType_Huuma_Shuriken )
func ParseWeaponType ¶
func ParseWeaponType(str string) (WeaponType, error)
func (WeaponType) Ranged ¶
func (w WeaponType) Ranged() bool
type World ¶
func (*World) AddEntityConfig ¶
func (w *World) AddEntityConfig(cfg *EntityConfig)
func (*World) AddItemConfig ¶
func (w *World) AddItemConfig(cfg *ItemConfig)
func (*World) AddJobConfig ¶
func (*World) AddSession ¶
func (*World) AddSkillConfig ¶
func (w *World) AddSkillConfig(cfg *SkillConfig)
func (*World) CreatePlayerCharacter ¶
func (*World) EntryRoomId ¶
func (*World) LogoutPlayer ¶
func (*World) RemoveEntity ¶
func (*World) RemoveSession ¶
func (*World) SavePlayerCharacter ¶
func (*World) SetEntryRoomId ¶
func (*World) TryGetEntityByPlayerId ¶
func (*World) TryGetEntityConfig ¶
func (w *World) TryGetEntityConfig(key string) (*EntityConfig, bool)
func (*World) TryGetItemConfig ¶
func (w *World) TryGetItemConfig(key string) (*ItemConfig, bool)
func (*World) TryGetJobConfig ¶
func (w *World) TryGetJobConfig(jobType JobTypeMask) (*JobConfig, bool)
func (*World) TryGetSkillConfig ¶
func (w *World) TryGetSkillConfig(key string) (*SkillConfig, bool)
type WorldConfig ¶
type WorldConfig struct {
// contains filtered or unexported fields
}
type Zone ¶
type Zone struct {
// contains filtered or unexported fields
}
func NewZone ¶
func NewZone(cfg *ZoneConfig) *Zone
type ZoneConfig ¶
type ZoneConfig struct { Id ZoneId Name string MinRoomId RoomId MaxRoomId RoomId Spawners []*ZoneSpawnerConfig }
type ZoneSpawner ¶
type ZoneSpawner struct {
// contains filtered or unexported fields
}
func NewZoneSpawner ¶
func NewZoneSpawner(cfg *ZoneSpawnerConfig) *ZoneSpawner
func (*ZoneSpawner) Spawn ¶
func (s *ZoneSpawner) Spawn(z *Zone, w *World)
func (*ZoneSpawner) UpdateActive ¶
func (s *ZoneSpawner) UpdateActive(time utils.Seconds)
type ZoneSpawnerConfig ¶
type ZoneSpawnerConfig struct { Type SpawnerType Spawns *utils.WeightedTableConfig[string] MaxActive int RoomIds []RoomId Cooldown utils.Seconds }
Source Files ¶
- asset-loading.go
- async.go
- combat-calculations.go
- combat.go
- commands-admin.go
- commands-advancement.go
- commands-combat.go
- commands-comm.go
- commands-info.go
- commands-move.go
- commands-obj.go
- commands-shop.go
- commands.go
- config.go
- db.go
- descriptive.go
- dice.go
- element.go
- entity-flags.go
- entity-scripts.go
- entity.go
- equipment.go
- game-loop.go
- game-states.go
- gender.go
- item-flags.go
- item-scripts.go
- item.go
- job.go
- lua-bindings.go
- observable.go
- player.go
- preamble.go
- race.go
- range.go
- room.go
- search.go
- send.go
- session-handler.go
- shop.go
- skill-scripts.go
- skill.go
- spawner.go
- stats-calculations.go
- stats-lookups.go
- stats.go
- status-effects.go
- util.go
- vocab.go
- world.go
- zone.go
Click to show internal directories.
Click to hide internal directories.