genshinartis

package module
v0.0.0-...-e4a2078 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: GPL-3.0 Imports: 6 Imported by: 1

README

genshinartis

Go library to generate (and export) Genshin artifacts

Documentation

Index

Constants

View Source
const (
	Physical = iota
	Pyro
	Hydro
	Anemo
	Electro
	Dendro
	Cryo
	Geo
)
View Source
const (
	SlotFlower artifactSlot = iota
	SlotPlume
	SlotSands
	SlotGoblet
	SlotCirclet
)
View Source
const (
	HP stat = iota
	ATK
	DEF
	HPP
	ATKP
	DEFP
	EnergyRecharge
	ElementalMastery
	CritRate
	CritDmg
	PyroDMG
	ElectroDMG
	CryoDMG
	HydroDMG
	AnemoDMG
	GeoDMG
	DendroDMG
	PhysDMG
	HealingBonus

	GlobalDMGBonus
	BaseDMGIncrease
)
View Source
const AverageDropsPerDomainRun = 1.065
View Source
const BossBase4Chance = 1.0 / 3.0
View Source
const DomainBase4Chance = 1.0 / 5.0
View Source
const DomainExtraArtifactChance = 0.065
View Source
const MaxSubstats = 4
View Source
const StrongboxBase4Chance = 1.0 / 3.0

Variables

View Source
var AllArtifactSets = []artifactSet{
	"GladiatorsFinale",
	"WanderersTroupe",
	"Thundersoother",
	"ThunderingFury",
	"MaidenBeloved",
	"ViridescentVenerer",
	"CrimsonWitchOfFlames",
	"Lavawalker",
	"NoblesseOblige",
	"BloodstainedChivalry",
	"ArchaicPetra",
	"RetracingBolide",
	"BlizzardStrayer",
	"HeartOfDepth",
	"TenacityOfTheMillelith",
	"PaleFlame",
	"EmblemOfSeveredFate",
	"ShimenawasReminiscence",
	"HuskOfOpulentDreams",
	"OceanHuedClam",
	"EchoesOfAnOffering",
	"VermillionHereafter",
	"DeepwoodMemories",
	"GildedDreams",
	"DesertPavilionChronicle",
	"FlowerOfParadiseLost",
	"NymphsDream",
	"VourukashasGlow",
	"MarechausseeHunter",
	"GoldenTroupe",
	"SongOfDaysPast",
	"NighttimeWhispersInTheEchoingWoods",
}

5* sets only though

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Set           artifactSet
	Slot          artifactSlot
	MainStat      stat
	MainStatValue float32
	SubStats      [MaxSubstats]*ArtifactSubstat
	IsFourLiner   bool
}

func RandomArtifact

func RandomArtifact(base4Chance float32) *Artifact

func RandomArtifactFromDomain

func RandomArtifactFromDomain(setA, setB string) *Artifact

func RandomArtifactOfSet

func RandomArtifactOfSet(set string, base4Chance float32) *Artifact

func RandomArtifactOfSlot

func RandomArtifactOfSlot(slot artifactSlot, base4Chance float32) *Artifact

func RemoveTrashArtifacts

func RemoveTrashArtifacts(arts []*Artifact,
	subValue map[stat]float32,
	n int) []*Artifact

RemoveTrashArtifacts processes a slice of artifacts and keeps the best ones that have the correct mainstat subValue: To know which artifacts are more desirable n: Amount of artifacts to keep for every set, slot and main stat (example: n = 10, it will keep at most 10 gladiator atk sands)

func (Artifact) String

func (a Artifact) String() string

type ArtifactSubstat

type ArtifactSubstat struct {
	Stat  stat
	Rolls int
	Value float32
}

func (*ArtifactSubstat) String

func (s *ArtifactSubstat) String() string

type GOODArtifact

type GOODArtifact struct {
	Set      string        `json:"setKey"`
	Rarity   int           `json:"rarity"`
	Level    int           `json:"level"`
	Slot     string        `json:"slotKey"`
	MainStat string        `json:"mainStatKey"`
	Subs     []GOODSubstat `json:"substats"`
	Location string        `json:"location"`
	Lock     bool          `json:"lock"`
}

type GOODExport

type GOODExport struct {
	Artifacts []GOODArtifact `json:"artifacts"`
	Format    string         `json:"format"`
	Version   int            `json:"version"`
	Source    string         `json:"source"`
}

func ExportToGOOD

func ExportToGOOD(arts []*Artifact) GOODExport

type GOODSubstat

type GOODSubstat struct {
	Stat  string  `json:"key"`
	Value float32 `json:"value"`
}

Jump to

Keyboard shortcuts

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