raw

package
v1.111.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package raw はゲームのローデータ定義とユーティリティを提供する。

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidEnumType = errors.New("enumに無効な値が指定された")

ErrInvalidEnumType はenumに無効な値が指定された場合のエラー

Functions

func NewKeyNotFoundError added in v1.87.0

func NewKeyNotFoundError(key, collection string) error

NewKeyNotFoundError creates a new KeyNotFoundError

Types

type Attack added in v1.21.0

type Attack struct {
	Accuracy       int    // 命中率
	Damage         int    // 攻撃力
	AttackCount    int    // 攻撃回数
	Element        string // 攻撃属性
	AttackCategory string // 攻撃種別
}

Attack は攻撃性能の設定

type Attributes added in v1.19.0

type Attributes struct {
	Vitality  int
	Strength  int
	Sensation int
	Dexterity int
	Agility   int
	Defense   int
}

Attributes はキャラクターの能力値

type Card added in v1.21.0

type Card struct {
	Cost        int
	TargetGroup string
	TargetNum   string
}

Card はカードアイテムの設定

type CommandTable added in v1.61.0

type CommandTable struct {
	Name    string
	Entries []CommandTableEntry `toml:"entries"`
}

CommandTable はコマンドテーブル

func (CommandTable) SelectByWeight added in v1.61.0

func (ct CommandTable) SelectByWeight() string

SelectByWeight は重みで選択する

type CommandTableEntry added in v1.61.0

type CommandTableEntry struct {
	Card   string
	Weight float64
}

CommandTableEntry はコマンドテーブルのエントリ

type Consumable

type Consumable struct {
	UsableScene string
	TargetGroup string
	TargetNum   string
}

Consumable は消費可能なアイテムの設定

type DropTable added in v1.65.0

type DropTable struct {
	Name    string
	XpBase  float64
	Entries []DropTableEntry `toml:"entries"`
}

DropTable はドロップテーブル

func (DropTable) SelectByWeight added in v1.65.0

func (ct DropTable) SelectByWeight() string

SelectByWeight は重みで選択する

type DropTableEntry added in v1.65.0

type DropTableEntry struct {
	Material string
	Weight   float64
}

DropTableEntry はドロップテーブルのエントリ

type EquipBonus added in v1.20.0

type EquipBonus struct {
	Vitality  int
	Strength  int
	Sensation int
	Dexterity int
	Agility   int
}

EquipBonus は装備ボーナスの設定

type Image added in v1.63.0

type Image struct {
	SheetName   string
	SheetNumber *int
}

Image はresourceのspriteシートから画像を特定するために必要な情報

type Item

type Item struct {
	Name            string
	Description     string
	InflictsDamage  int
	SpriteSheetName string
	SpriteKey       string
	Consumable      *Consumable
	ProvidesHealing *ProvidesHealing
	Wearable        *Wearable
	EquipBonus      *EquipBonus
	Card            *Card
	Attack          *Attack
}

Item はアイテムのローデータ

type KeyNotFoundError added in v1.87.0

type KeyNotFoundError struct {
	Key        string
	Collection string
}

KeyNotFoundError represents an error when a key is not found in a collection

func (KeyNotFoundError) Error added in v1.87.0

func (e KeyNotFoundError) Error() string

type LightSourceRaw added in v1.111.0

type LightSourceRaw struct {
	Radius  gc.Tile
	Color   color.RGBA
	Enabled bool
}

LightSourceRaw は光源のローデータ定義

type Master added in v1.70.1

type Master struct {
	Raws              Raws
	ItemIndex         map[string]int
	MaterialIndex     map[string]int
	RecipeIndex       map[string]int
	MemberIndex       map[string]int
	CommandTableIndex map[string]int
	DropTableIndex    map[string]int
	SpriteSheetIndex  map[string]int
	TileIndex         map[string]int
	PropIndex         map[string]int
}

Master はローデータを管理し、効率的な検索のためのインデックスを提供する

func Load

func Load(entityMetadataContent string) (Master, error)

Load は文字列からローデータを読み込む

func LoadFromFile

func LoadFromFile(path string) (Master, error)

LoadFromFile はファイルからローデータを読み込む

func (*Master) GenerateEnemy added in v1.70.1

func (rw *Master) GenerateEnemy(name string) (gc.EntitySpec, error)

GenerateEnemy は指定された名前の敵のゲームコンポーネントを生成する

func (*Master) GenerateItem added in v1.70.1

func (rw *Master) GenerateItem(name string, locationType gc.ItemLocationType) (gc.EntitySpec, error)

GenerateItem は指定された名前のアイテムのゲームコンポーネントを生成する

func (*Master) GenerateMaterial added in v1.70.1

func (rw *Master) GenerateMaterial(name string, amount int, locationType gc.ItemLocationType) (gc.EntitySpec, error)

GenerateMaterial は指定された名前の素材のゲームコンポーネントを生成する

func (*Master) GeneratePlayer added in v1.96.0

func (rw *Master) GeneratePlayer(name string) (gc.EntitySpec, error)

GeneratePlayer は指定された名前のプレイヤーのゲームコンポーネントを生成する

func (*Master) GenerateProp added in v1.110.2

func (rw *Master) GenerateProp(name string) (gc.EntitySpec, error)

GenerateProp は指定された名前の置物のゲームコンポーネントを生成する

func (*Master) GenerateRecipe added in v1.70.1

func (rw *Master) GenerateRecipe(name string) (gc.EntitySpec, error)

GenerateRecipe は指定された名前のレシピのゲームコンポーネントを生成する

func (*Master) GenerateTile added in v1.106.0

func (rw *Master) GenerateTile(name string) (TileRaw, error)

GenerateTile は指定された名前のタイルを生成する

func (*Master) GetCommandTable added in v1.70.1

func (rw *Master) GetCommandTable(name string) (CommandTable, error)

GetCommandTable は指定された名前のコマンドテーブルを取得する

func (*Master) GetDropTable added in v1.70.1

func (rw *Master) GetDropTable(name string) (DropTable, error)

GetDropTable は指定された名前のドロップテーブルを取得する

func (*Master) GetProp added in v1.110.2

func (rw *Master) GetProp(name string) (PropRaw, error)

GetProp は指定された名前の置物の設定を取得する

type Material

type Material struct {
	Name            string
	Description     string
	SpriteSheetName string
	SpriteKey       string
}

Material は素材アイテムの情報

type Member

type Member struct {
	Name            string
	Player          *bool
	Attributes      Attributes
	SpriteSheetName string
	SpriteKey       string
}

Member はメンバーの情報

type PropRaw added in v1.110.2

type PropRaw struct {
	Name            string
	Description     string
	SpriteSheetName string
	SpriteKey       string
	BlockPass       bool
	BlockView       bool
	LightSource     *LightSourceRaw
}

PropRaw は置物のローデータ定義

type ProvidesHealing added in v1.20.1

type ProvidesHealing struct {
	ValueType ValueType
	Amount    int
	Ratio     float64
}

ProvidesHealing は回復効果を提供する構造体

type Raws

type Raws struct {
	Items         []Item
	Materials     []Material
	Recipes       []Recipe
	Members       []Member
	CommandTables []CommandTable
	DropTables    []DropTable
	SpriteSheets  []SpriteSheet
	Tiles         []TileRaw
	Props         []PropRaw
}

Raws は全てのローデータを格納する構造体

type Recipe

type Recipe struct {
	Name   string
	Inputs []RecipeInput
}

Recipe はレシピの情報

type RecipeInput

type RecipeInput struct {
	Name   string
	Amount int
}

RecipeInput は合成の元になる素材

type SpriteSheet added in v1.63.0

type SpriteSheet struct {
	Name string
}

SpriteSheet はスプライトシートの情報を保持する

type TileRaw added in v1.106.0

type TileRaw struct {
	Name        string
	Description string
	Walkable    bool
}

TileRaw はタイルのローデータ定義

type ValueType added in v1.20.1

type ValueType string

ValueType は値のタイプを表す

const (
	// PercentageType はパーセンテージタイプを表す
	PercentageType ValueType = "PERCENTAGE"
	// NumeralType は数値タイプを表す
	NumeralType ValueType = "NUMERAL"
)

func (ValueType) Valid added in v1.20.1

func (enum ValueType) Valid() error

Valid はValueTypeの値が有効かどうかを検証する

type Wearable

type Wearable struct {
	Defense           int
	EquipmentCategory string
}

Wearable は装備可能アイテムの設定

Jump to

Keyboard shortcuts

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