config

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Koolo      *KooloCfg
	Characters map[string]*CharacterCfg
	Version    = "dev"
)
View Source
var AvailableRecipes = []string{

	"Perfect Amethyst",
	"Perfect Diamond",
	"Perfect Emerald",
	"Perfect Ruby",
	"Perfect Sapphire",
	"Perfect Topaz",
	"Perfect Skull",
	"Token of Absolution",
	"Upgrade El",
	"Upgrade Eld",
	"Upgrade Tir",
	"Upgrade Nef",
	"Upgrade Eth",
	"Upgrade Ith",
	"Upgrade Tal",
	"Upgrade Ral",
	"Upgrade Ort",
	"Upgrade Thul",
	"Upgrade Amn",
	"Upgrade Sol",
	"Upgrade Shael",
	"Upgrade Dol",
	"Upgrade Hel",
	"Upgrade Io",
	"Upgrade Lum",
	"Upgrade Ko",
	"Upgrade Fal",
	"Upgrade Lem",
	"Upgrade Pul",
	"Upgrade Um",
	"Upgrade Mal",
	"Upgrade Ist",
	"Upgrade Gul",
	"Upgrade Vex",
	"Upgrade Ohm",
	"Upgrade Lo",
	"Upgrade Sur",
	"Upgrade Ber",
	"Upgrade Jah",
	"Upgrade Cham",
}

Functions

func CreateFromTemplate added in v0.4.0

func CreateFromTemplate(name string) error

func GetCurrentDisplayScale added in v0.4.0

func GetCurrentDisplayScale() float64

func Load

func Load() error

Load reads the config.ini file and returns a Config struct filled with data from the ini file

func ReplaceGameSettings added in v0.4.0

func ReplaceGameSettings() error

func SaveSupervisorConfig added in v0.4.0

func SaveSupervisorConfig(supervisorName string, config *CharacterCfg) error

func ValidateAndSaveConfig added in v0.4.0

func ValidateAndSaveConfig(config KooloCfg) error

Types

type BeltColumns added in v0.4.0

type BeltColumns [4]string

func (BeltColumns) Total added in v0.4.0

func (bm BeltColumns) Total(potionType data.PotionType) int

type CharacterCfg added in v0.4.0

type CharacterCfg struct {
	MaxGameLength   int    `yaml:"maxGameLength"`
	Username        string `yaml:"username"`
	Password        string `yaml:"password"`
	AuthMethod      string `yaml:"authMethod"`
	AuthToken       string `yaml:"authToken"`
	Realm           string `yaml:"realm"`
	CharacterName   string `yaml:"characterName"`
	CommandLineArgs string `yaml:"commandLineArgs"`
	KillD2OnStop    bool   `yaml:"killD2OnStop"`
	ClassicMode     bool   `yaml:"classicMode"`
	CloseMiniPanel  bool   `yaml:"closeMiniPanel"`

	Health struct {
		HealingPotionAt     int `yaml:"healingPotionAt"`
		ManaPotionAt        int `yaml:"manaPotionAt"`
		RejuvPotionAtLife   int `yaml:"rejuvPotionAtLife"`
		RejuvPotionAtMana   int `yaml:"rejuvPotionAtMana"`
		MercHealingPotionAt int `yaml:"mercHealingPotionAt"`
		MercRejuvPotionAt   int `yaml:"mercRejuvPotionAt"`
		ChickenAt           int `yaml:"chickenAt"`
		MercChickenAt       int `yaml:"mercChickenAt"`
	} `yaml:"health"`
	Inventory struct {
		InventoryLock [][]int     `yaml:"inventoryLock"`
		BeltColumns   BeltColumns `yaml:"beltColumns"`
	} `yaml:"inventory"`
	Character struct {
		Class         string `yaml:"class"`
		UseMerc       bool   `yaml:"useMerc"`
		StashToShared bool   `yaml:"stashToShared"`
		UseTeleport   bool   `yaml:"useTeleport"`
	} `yaml:"character"`
	Game struct {
		MinGoldPickupThreshold int                   `yaml:"minGoldPickupThreshold"`
		ClearTPArea            bool                  `yaml:"clearTPArea"`
		Difficulty             difficulty.Difficulty `yaml:"difficulty"`
		RandomizeRuns          bool                  `yaml:"randomizeRuns"`
		Runs                   []Run                 `yaml:"runs"`
		Pindleskin             struct {
			SkipOnImmunities []stat.Resist `yaml:"skipOnImmunities"`
		} `yaml:"pindleskin"`
		Cows struct {
			OpenChests bool `yaml:"openChests"`
		}
		Pit struct {
			MoveThroughBlackMarsh bool `yaml:"moveThroughBlackMarsh"`
			OpenChests            bool `yaml:"openChests"`
			FocusOnElitePacks     bool `yaml:"focusOnElitePacks"`
			OnlyClearLevel2       bool `yaml:"onlyClearLevel2"`
		} `yaml:"pit"`
		Andariel struct {
			ClearRoom bool `yaml:"clearRoom"`
		}
		StonyTomb struct {
			OpenChests        bool `yaml:"openChests"`
			FocusOnElitePacks bool `yaml:"focusOnElitePacks"`
		} `yaml:"stony_tomb"`
		Mausoleum struct {
			OpenChests        bool `yaml:"openChests"`
			FocusOnElitePacks bool `yaml:"focusOnElitePacks"`
		} `yaml:"mausoleum"`
		AncientTunnels struct {
			OpenChests        bool `yaml:"openChests"`
			FocusOnElitePacks bool `yaml:"focusOnElitePacks"`
		} `yaml:"ancient_tunnels"`
		DrifterCavern struct {
			OpenChests        bool `yaml:"openChests"`
			FocusOnElitePacks bool `yaml:"focusOnElitePacks"`
		} `yaml:"drifter_cavern"`
		Mephisto struct {
			KillCouncilMembers bool `yaml:"killCouncilMembers"`
			OpenChests         bool `yaml:"openChests"`
		} `yaml:"mephisto"`
		Tristram struct {
			ClearPortal       bool `yaml:"clearPortal"`
			FocusOnElitePacks bool `yaml:"focusOnElitePacks"`
		} `yaml:"tristram"`
		Nihlathak struct {
			ClearArea bool `yaml:"clearArea"`
		} `yaml:"nihlathak"`
		Diablo struct {
			KillDiablo        bool `yaml:"killDiablo"`
			FullClear         bool `yaml:"fullClear"`
			FocusOnElitePacks bool `yaml:"focusOnElitePacks"`
		} `yaml:"diablo"`
		Baal struct {
			KillBaal    bool `yaml:"killBaal"`
			DollQuit    bool `yaml:"dollQuit"`
			SoulQuit    bool `yaml:"soulQuit"`
			ClearFloors bool `yaml:"clearFloors"`
			OnlyElites  bool `yaml:"onlyElites"`
		} `yaml:"baal"`
		Eldritch struct {
			KillShenk bool `yaml:"killShenk"`
		} `yaml:"eldritch"`
		TerrorZone struct {
			FocusOnElitePacks bool          `yaml:"focusOnElitePacks"`
			SkipOnImmunities  []stat.Resist `yaml:"skipOnImmunities"`
			SkipOtherRuns     bool          `yaml:"skipOtherRuns"`
			Areas             []area.ID     `yaml:"areas"`
		} `yaml:"terror_zone"`
		Leveling struct {
			EnsurePointsAllocation bool `yaml:"ensurePointsAllocation"`
			EnsureKeyBinding       bool `yaml:"ensureKeyBinding"`
		} `yaml:"leveling"`
		Quests struct {
			ClearDen       bool `yaml:"clearDen"`
			RescueCain     bool `yaml:"rescueCain"`
			RetrieveHammer bool `yaml:"retrieveHammer"`
			GetCube        bool `yaml:"getCube"`
			KillRadament   bool `yaml:"killRadament"`
			RetrieveBook   bool `yaml:"retrieveBook"`
			KillIzual      bool `yaml:"killIzual"`
			KillShenk      bool `yaml:"killShenk"`
			RescueAnya     bool `yaml:"rescueAnya"`
			KillAncients   bool `yaml:"killAncients"`
		} `yaml:"quests"`
	} `yaml:"game"`
	Companion struct {
		Enabled          bool   `yaml:"enabled"`
		Leader           bool   `yaml:"leader"`
		LeaderName       string `yaml:"leaderName"`
		Attack           bool   `yaml:"attack"`
		FollowLeader     bool   `yaml:"followLeader"`
		GameNameTemplate string `yaml:"gameNameTemplate"`
		GamePassword     string `yaml:"gamePassword"`
	} `yaml:"companion"`
	Gambling struct {
		Enabled bool        `yaml:"enabled"`
		Items   []item.Name `yaml:"items"`
	} `yaml:"gambling"`
	CubeRecipes struct {
		Enabled        bool     `yaml:"enabled"`
		EnabledRecipes []string `yaml:"enabledRecipes"`
	} `yaml:"cubing"`
	BackToTown struct {
		NoHpPotions     bool `yaml:"noHpPotions"`
		NoMpPotions     bool `yaml:"noMpPotions"`
		MercDied        bool `yaml:"mercDied"`
		EquipmentBroken bool `yaml:"equipmentBroken"`
	} `yaml:"backtotown"`
	Runtime struct {
		Rules nip.Rules   `yaml:"-"`
		Drops []data.Item `yaml:"-"`
	} `yaml:"-"`
}

type KooloCfg added in v0.4.0

type KooloCfg struct {
	Debug struct {
		Log         bool `yaml:"log"`
		Screenshots bool `yaml:"screenshots"`
		RenderMap   bool `yaml:"renderMap"`
	} `yaml:"debug"`
	FirstRun              bool   `yaml:"firstRun"`
	UseCustomSettings     bool   `yaml:"useCustomSettings"`
	GameWindowArrangement bool   `yaml:"gameWindowArrangement"`
	LogSaveDirectory      string `yaml:"logSaveDirectory"`
	D2LoDPath             string `yaml:"D2LoDPath"`
	D2RPath               string `yaml:"D2RPath"`
	Discord               struct {
		Enabled                      bool   `yaml:"enabled"`
		EnableGameCreatedMessages    bool   `yaml:"enableGameCreatedMessages"`
		EnableNewRunMessages         bool   `yaml:"enableNewRunMessages"`
		EnableRunFinishMessages      bool   `yaml:"enableRunFinishMessages"`
		EnableDiscordChickenMessages bool   `yaml:"enableDiscordChickenMessages"`
		ChannelID                    string `yaml:"channelId"`
		Token                        string `yaml:"token"`
	} `yaml:"discord"`
	Telegram struct {
		Enabled bool   `yaml:"enabled"`
		ChatID  int64  `yaml:"chatId"`
		Token   string `yaml:"token"`
	}
}

type Run added in v0.4.0

type Run string
const (
	CountessRun         Run = "countess"
	AndarielRun         Run = "andariel"
	AncientTunnelsRun   Run = "ancient_tunnels"
	MausoleumRun        Run = "mausoleum"
	SummonerRun         Run = "summoner"
	DurielRun           Run = "duriel"
	MephistoRun         Run = "mephisto"
	CouncilRun          Run = "council"
	EldritchRun         Run = "eldritch"
	PindleskinRun       Run = "pindleskin"
	NihlathakRun        Run = "nihlathak"
	TristramRun         Run = "tristram"
	LowerKurastRun      Run = "lower_kurast"
	LowerKurastChestRun Run = "lower_kurast_chest"
	StonyTombRun        Run = "stony_tomb"
	PitRun              Run = "pit"
	ArachnidLairRun     Run = "arachnid_lair"
	TalRashaTombsRun    Run = "tal_rasha_tombs"
	BaalRun             Run = "baal"
	DiabloRun           Run = "diablo"
	CowsRun             Run = "cows"
	LevelingRun         Run = "leveling"
	QuestsRun           Run = "quests"
	TerrorZoneRun       Run = "terror_zone"
	ThreshsocketRun     Run = "threshsocket"
	DrifterCavernRun    Run = "drifter_cavern"
	EnduguRun           Run = "endugu"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL