starrail

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WINDOWS Platform = "Windows"
	ANDROID          = "Android"
	IOS              = "IOS"
	PS4              = "PS4"
	PS5              = "PS5"
)

Variables

This section is empty.

Functions

func PathFromRaw added in v0.1.3

func PathFromRaw(rawPath string) string

PathFromRaw returns the path used in game, from the raw path. Used internally, you can just use CharacterData.Path

Types

type CharacterData

type CharacterData struct {
	// 4 or 5
	Star int `json:"Rarity"`
	Path string
	// Internal name for the Path
	RawPath                 string      `json:"AvatarBaseType"`
	AvatarName              hash.String `json:"AvatarName"`
	AvatarFullName          hash.String `json:"AvatarFullname"`
	Element                 string      `json:"Element"`
	AvatarSideIconPath      string      `json:"AvatarSideIconPath"`
	AvatarCutinFrontImgPath string      `json:"AvatarCutinFrontImgPath"`
	RankIdList              []int       `json:"RankIDList"`
	SkillList               []int       `json:"SkillList"`
}

func (*CharacterData) FullName

func (d *CharacterData) FullName() string

FullName returns the localized AvatarFullName or Hash if not found

For some reason always returns the Hash. FullName isn't present in the GitHub file.

func (*CharacterData) Name

func (d *CharacterData) Name() string

Name returns the localized AvatarName or Hash if not found

type LightCone

type LightCone struct {
	LightConeID   int
	SuperImposion int
	Level         int
	// Also ascension
	Promotion int
	Stats     []LightConeStat
	Hash      string
}

func (*LightCone) GetHash

func (lightCone *LightCone) GetHash() string

func (*LightCone) Name

func (lightCone *LightCone) Name() string

type LightConeData added in v0.3.0

type LightConeData struct {
	Rarity int `json:"Rarity"`
	// Convert to Path with starrail.PathFromRaw
	RawPath       string      `json:"AvatarBaseType"`
	EquipmentName hash.String `json:"EquipmentName"`
	ImagePath     string      `json:"ImagePath"`
}

type LightConeStat

type LightConeStat struct {
	Stat  string
	Value float64
}

type Platform

type Platform string

type RawAvatarDetail

type RawAvatarDetail struct {
	AvatarId int `json:"avatarId"`
	Rank     int `json:"rank"`
	Level    int `json:"level"`
	// Ascension, 0 if level < 20
	Promotion     int               `json:"promotion,omitempty"`
	Equipment     *RawEquipmentInfo `json:"equipment,ompitempty"`
	SkillTreeList []RawSkillTree    `json:"skillTreeList"`
	RelicList     []RawRelic        `json:"relicList"`
}

type RawChallengeInfo

type RawChallengeInfo struct {
	ScheduleMaxLevel     int  `json:"scheduleMaxLevel"`
	ScheduleMaxGroupId   *int `json:"scheduleMaxGroupId,omitempty"`
	NoneScheduleMaxLevel *int `json:"noneScheduleMaxLevel,omitempty"`
	AbyssLevel           int  `json:"abyssLevel"`
	AbyssStarCount       int  `json:"abyssStarCount"`
}

type RawDetailInfo

type RawDetailInfo struct {
	HeadIcon         int               `json:"headIcon"`
	AvatarDetailList []RawAvatarDetail `json:"avatarDetailList"`
	NickName         string            `json:"nickname"`
	Level            int               `json:"level"`
	Signature        string            `json:"signature"`
	Uid              int               `json:"uid"`
	FriendCount      int               `json:"friendCount"`
	RecordInfo       RawRecordInfo     `json:"recordInfo"`
	WordlLevel       int               `json:"worldLevel"`
	IsDisplayAvatar  *bool             `json:"isDisplayAvatar,omitempty"`
	Platform         string            `json:"platform"`
}

type RawEquipmentFlatData

type RawEquipmentFlatData struct {
	Props []RawEquipmentFlatProp `json:"props"`
	Name  string                 `json:"name"`
}

type RawEquipmentFlatProp

type RawEquipmentFlatProp struct {
	Type  string  `json:"type"`
	Value float64 `json:"value"`
}

type RawEquipmentInfo

type RawEquipmentInfo struct {
	Tid   int `json:"tid"`
	Rank  int `json:"rank"`
	Level int `json:"level"`
	// Ascension
	Promotion         int                  `json:"promotion"`
	EquipmentFlatData RawEquipmentFlatData `json:"_flat"`
}

type RawRecordInfo

type RawRecordInfo struct {
	ChallengeInfo          RawChallengeInfo `json:"challengeInfo"`
	EquipmentCount         int              `json:"equipmentCount"`
	MaxRogueChallengeScore int              `json:"maxRogueChallengeScore"`
	AchievementCount       int              `json:"achievementCount"`
	AvatarCount            int              `json:"avatarCount"`
	BookCount              int              `json:"bookCount"`
	RelicCount             int              `json:"relicCount"`
	MusicCount             int              `json:"musicCount"`
}

type RawRelic

type RawRelic struct {
	Level         int              `json:"level"`
	MainAffixId   int              `json:"mainAffixId"`
	Type          int              `json:"type"`
	Tid           int              `json:"tid"`
	RelicFlatData RawRelicFlatData `json:"_flat"`
}

type RawRelicFlatData

type RawRelicFlatData struct {
	Props   []RawRelicFlatProp `json:"props"`
	SetName string             `json:"setName"`
	SetId   int                `json:"setId"`
}

type RawRelicFlatProp

type RawRelicFlatProp struct {
	Type  string  `json:"type"`
	Value float64 `json:"value"`
}

type RawSkillTree

type RawSkillTree struct {
	PointId int `json:"pointId"`
	Level   int `json:"level"`
}

type RawUser added in v0.6.0

type RawUser struct {
	DetailInfo RawDetailInfo `json:"detailInfo"`
	Ttl        int           `json:"ttl"`
	Uid        string        `json:"uid"`
}

func (*RawUser) GetTtl added in v0.6.0

func (user *RawUser) GetTtl() int

func (*RawUser) ToUser added in v0.6.0

func (user *RawUser) ToUser() *User

type Relic

type Relic struct {
	RelicID  int
	Level    int
	Type     RelicType
	MainStat RelicStat
	SubStats []RelicStat
	Hash     string
}

func (*Relic) GetHash

func (relic *Relic) GetHash() string

func (*Relic) Name

func (relic *Relic) Name() string

Name returns the localized name or hash

type RelicData added in v0.3.0

type RelicData struct {
	Rarity         int    `json:"Rarity"`
	Type           string `json:"Type"`
	MainAffixGroup int    `json:"MainAffixGroup"`
	SubAffixGroup  int    `json:"SubAffixGroup"`
	Icon           string `json:"Icon"`
	SetId          int    `json:"SetID"`
}

type RelicStat

type RelicStat struct {
	Stat  string
	Value float64
}

type RelicType

type RelicType int
const (
	HEAD RelicType = iota + 1
	HAND
	BODY
	FEET
	PLANAR
	ROPE
	UNKNOWN
)

func StarRailRelicTypeFromString added in v0.3.0

func StarRailRelicTypeFromString(t string) RelicType

type User

type User struct {
	NickName string
	// Between 1 and 70
	Level     int
	Signature string
	// This has to be parsed with EnkaNetworkApi#GetStarRailAvatarKey & EnkaiNetworkApi#GetStarRailIcon
	AvatarIconId     string
	Uid              int
	FriendCount      int
	EquilibriumLevel int
	// The highest planet(?) the user has unlocked in the simulated universe
	SimulatedUniverse int
	Platform          Platform
	Characters        []UserCharacter
}

func UserFromRaw

func UserFromRaw(rawUser *RawUser) *User

type UserCharacter

type UserCharacter struct {
	AvatarId  int
	Eidolon   int
	Level     int
	Ascension int
	LightCone *LightCone
	Relics    []Relic
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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