starrail

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 2 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

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              localization.HashNameAble `json:"AvatarName"`
	AvatarFullName          localization.HashNameAble `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

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

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      int64
}

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 localization.HashNameAble `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, nill 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"`
	Platform         string            `json:"platform"`
}

type RawEquipmentFlatData

type RawEquipmentFlatData struct {
	Props []RawEquipmentFlatProp `json:"props"`
	Name  int64                  `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 RawHonkaiUser

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

func (*RawHonkaiUser) GetTtl

func (user *RawHonkaiUser) GetTtl() int

func (*RawHonkaiUser) ToUser

func (user *RawHonkaiUser) ToUser() *User

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 int64              `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 Relic

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

func (*Relic) GetHash

func (relic *Relic) GetHash() string

func (*Relic) Name

func (relic *Relic) Name() string

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 *RawHonkaiUser) *User

type UserCharacter

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

Jump to

Keyboard shortcuts

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