Documentation
¶
Index ¶
- Constants
- Variables
- type Amounter
- type Attack
- type AttackType
- type Attribute
- type Attributes
- type BattleCommand
- type BlockPass
- type BlockView
- type Camera
- type Card
- type Col
- type CommandTable
- type Components
- type Consumable
- type Description
- type ElementType
- type EquipBonus
- type EquipmentChanged
- type EquipmentSlotNumber
- type EquipmentType
- type FactionAllyData
- type FactionEnemyData
- type FactionType
- type GameComponentList
- type GridElement
- type InParty
- type InflictsDamage
- type Item
- type ItemLocationType
- type LocationEquipped
- type LocationInBackpack
- type LocationNone
- type LocationOnField
- type Material
- type Name
- type NumeralAmount
- type Operator
- type Pixel
- type Pool
- type Pools
- type Position
- type ProvidesHealing
- type RatioAmount
- type Recipe
- type RecipeInput
- type Renderable
- type Row
- type TargetGroupType
- type TargetNumType
- type TargetType
- type UsableSceneType
- type Wall
- type Warp
- type Wearable
Constants ¶
const ( WarpModeNext = warpMode("NEXT") WarpModeEscape = warpMode("ESCAPE") )
const ( TargetSingle = TargetNumType("SINGLE") TargetAll = TargetNumType("ALL") )
const ( TargetGroupAlly = TargetGroupType("ALLY") // 味方 TargetGroupEnemy = TargetGroupType("ENEMY") // 敵 TargetGroupCard = TargetGroupType("CARD") // カード TargetGroupNone = TargetGroupType("NONE") // なし )
const ( UsableSceneBattle = UsableSceneType("BATTLE") // 戦闘 UsableSceneField = UsableSceneType("FIELD") // フィールド UsableSceneAny = UsableSceneType("ANY") // いつでも )
const ( AttackSword = AttackType("SWORD") // 刀剣 AttackSpear = AttackType("SPEAR") // 長物 AttackHandgun = AttackType("HANDGUN") // 拳銃 AttackRifle = AttackType("RIFLE") // 小銃 AttackFist = AttackType("FIST") // 格闘 AttackCanon = AttackType("CANON") // 大砲 )
const ( EquipmentHead = EquipmentType("HEAD") // 頭部 EquipmentTorso = EquipmentType("TORSO") // 胴体 EquipmentLegs = EquipmentType("LEGS") // 脚 EquipmentJewelry = EquipmentType("JEWELRY") // アクセサリ )
Variables ¶
var ErrInvalidEnumType = errors.New("enumに無効な値が指定された")
Functions ¶
This section is empty.
Types ¶
type Attack ¶ added in v1.21.0
type Attack struct { Accuracy int // 命中率 Damage int // 攻撃力 AttackCount int // 攻撃回数 Element ElementType // 攻撃属性 AttackCategory AttackType // 攻撃種別 }
攻撃の性質。攻撃毎にこの数値と作用対象のステータスを加味して、最終的なダメージ量を決定する
type AttackType ¶ added in v1.21.0
type AttackType string
武器種別 種別によって適用する計算式が異なる
func (AttackType) String ¶ added in v1.21.0
func (at AttackType) String() string
func (AttackType) Valid ¶ added in v1.21.0
func (enum AttackType) Valid() error
type Attribute ¶ added in v1.19.0
type Attribute struct { Base int // 固有の値 Modifier int // 装備などで変動する値 Total int // 足し合わせた現在値。算出される値のメモ }
変動するパラメータ値
type Attributes ¶ added in v1.19.0
type Attributes struct { Vitality Attribute // 体力。丈夫さ、持久力、しぶとさ。HPやSPに影響する Strength Attribute // 筋力。主に近接攻撃のダメージに影響する Sensation Attribute // 感覚。主に射撃攻撃のダメージに影響する Dexterity Attribute // 器用。攻撃時の命中率に影響する Agility Attribute // 敏捷。回避率、行動の速さに影響する Defense Attribute // 防御。被弾ダメージを軽減させる }
エンティティが持つステータス値。各種計算式で使う
type BattleCommand ¶ added in v1.52.0
type Card ¶ added in v1.21.0
type Card struct { TargetType TargetType Cost int }
カードは戦闘中に選択するコマンド 攻撃、防御、回復など、人に影響を及ぼすものをアクションカードという
type Components ¶
type Components struct { // general ================ Name *ecs.SliceComponent Description *ecs.SliceComponent // item ================ Item *ecs.NullComponent Consumable *ecs.SliceComponent Pools *ecs.SliceComponent Attack *ecs.SliceComponent Material *ecs.SliceComponent Recipe *ecs.SliceComponent Wearable *ecs.SliceComponent Attributes *ecs.SliceComponent Card *ecs.SliceComponent ItemLocationInBackpack *ecs.NullComponent ItemLocationEquipped *ecs.SliceComponent ItemLocationOnField *ecs.NullComponent ItemLocationNone *ecs.NullComponent // field ================ Operator *ecs.NullComponent Camera *ecs.SliceComponent Wall *ecs.NullComponent Warp *ecs.SliceComponent Position *ecs.SliceComponent GridElement *ecs.SliceComponent SpriteRender *ecs.SliceComponent BlockView *ecs.NullComponent BlockPass *ecs.NullComponent // member ================ InParty *ecs.NullComponent FactionAlly *ecs.NullComponent FactionEnemy *ecs.NullComponent // event ================ BattleCommand *ecs.SliceComponent EquipmentChanged *ecs.NullComponent ProvidesHealing *ecs.SliceComponent InflictsDamage *ecs.SliceComponent // battle ================ CommandTable *ecs.SliceComponent }
componentsを溜めるスライス群 Join時はこのフィールドでクエリする
type Consumable ¶
type Consumable struct { UsableScene UsableSceneType TargetType TargetType }
消耗品。一度使うとなくなる
type ElementType ¶ added in v1.21.0
type ElementType string
攻撃属性
const ( ElementTypeNone ElementType = "NONE" ElementTypeFire ElementType = "FIRE" ElementTypeThunder ElementType = "THUNDER" ElementTypeChill ElementType = "CHILL" ElementTypePhoton ElementType = "PHOTON" )
func (ElementType) String ¶ added in v1.21.0
func (et ElementType) String() string
func (ElementType) Valid ¶ added in v1.21.0
func (enum ElementType) Valid() error
type EquipBonus ¶ added in v1.20.0
装備品のオプショナルな性能。武器・防具で共通する
type EquipmentType ¶ added in v1.14.0
type EquipmentType string
装備品種別
func (EquipmentType) String ¶ added in v1.14.0
func (es EquipmentType) String() string
func (EquipmentType) Valid ¶ added in v1.16.0
func (enum EquipmentType) Valid() error
type FactionAllyData ¶ added in v1.53.0
type FactionAllyData struct{}
func (FactionAllyData) String ¶ added in v1.53.0
func (c FactionAllyData) String() string
type FactionEnemyData ¶ added in v1.53.0
type FactionEnemyData struct{}
func (FactionEnemyData) String ¶ added in v1.53.0
func (c FactionEnemyData) String() string
type FactionType ¶ added in v1.53.0
================ 所属派閥。絶対的な指定
var ( // 味方(プレイヤー側) FactionAlly FactionType = FactionAllyData{} // 敵性(プレイヤーと敵対) FactionEnemy FactionType = FactionEnemyData{} )
type GameComponentList ¶ added in v1.48.0
type GameComponentList struct { // general ================ Name *Name Description *Description // item ================ Item *Item Consumable *Consumable Pools *Pools Attack *Attack Material *Material Recipe *Recipe Wearable *Wearable Attributes *Attributes Card *Card ItemLocationType *ItemLocationType // field ================ Operator *Operator Camera *Camera Wall *Wall Warp *Warp Position *Position GridElement *GridElement SpriteRender *ec.SpriteRender BlockView *BlockView BlockPass *BlockPass // member ================ InParty *InParty FactionType *FactionType // event ================ BattleCommand *BattleCommand EquipmentChanged *EquipmentChanged ProvidesHealing *ProvidesHealing InflictsDamage *InflictsDamage // battle ================ CommandTable *CommandTable }
コンポーネントのリストが格納されたオブジェクト。 この構造体を元にエンティティに対してコンポーネントを作成する。 フィールドの型や値に応じて、対応するECSコンポーネントを取得する。
type GridElement ¶
TODO: 縦横の型を共通にする。タイル単位だということがわかればよい。TileUnitとか フィールド上にグリッドに沿って存在する。静的なステージオブジェクトに使う スプライトはグリッドに沿って配置する +---- | | | | | | -----
type InflictsDamage ¶
type InflictsDamage struct {
Amount int
}
ダメージを与える性質 直接的な数値が作用し、ステータスなどは考慮されない
type ItemLocationType ¶ added in v1.53.0
================ アイテムの場所
var ( // バックパック内 ItemLocationInBackpack ItemLocationType = LocationInBackpack{} // 味方が装備中 ItemLocationEquipped ItemLocationType = LocationEquipped{} // フィールド上 ItemLocationOnField ItemLocationType = LocationOnField{} // いずれにも存在しない。マスター用 ItemLocationNone ItemLocationType = LocationNone{} )
type LocationEquipped ¶ added in v1.53.0
type LocationEquipped struct { Owner ecs.Entity EquipmentSlot EquipmentSlotNumber }
func (LocationEquipped) String ¶ added in v1.53.0
func (c LocationEquipped) String() string
type LocationInBackpack ¶ added in v1.53.0
type LocationInBackpack struct{}
func (LocationInBackpack) String ¶ added in v1.53.0
func (c LocationInBackpack) String() string
type LocationNone ¶ added in v1.53.0
type LocationNone struct{}
func (LocationNone) String ¶ added in v1.53.0
func (c LocationNone) String() string
type LocationOnField ¶ added in v1.53.0
type LocationOnField struct{}
func (LocationOnField) String ¶ added in v1.53.0
func (c LocationOnField) String() string
type Material ¶
type Material struct {
Amount int
}
合成素材 アイテムとの違い: - 個々のインスタンスで性能の違いはなく、単に数量だけを見る - 複数の単位で扱うのでAmountを持つ。x3を合成で使ったりする
type NumeralAmount ¶ added in v1.20.1
type NumeralAmount struct {
Numeral int
}
絶対量指定
func (NumeralAmount) Amount ¶ added in v1.20.1
func (na NumeralAmount) Amount()
func (NumeralAmount) Calc ¶ added in v1.20.1
func (na NumeralAmount) Calc() int
type Position ¶ added in v1.28.0
フィールド上に座標をもって存在する。移動体に対して使う スプライトはこの位置に中心を合わせて配置する ----- | | | + | | | -----
type ProvidesHealing ¶
type ProvidesHealing struct {
Amount Amounter
}
回復する性質 直接的な数値が作用し、ステータスなどは考慮されない
type RatioAmount ¶ added in v1.20.1
type RatioAmount struct {
Ratio float64
}
倍率指定
func (RatioAmount) Amount ¶ added in v1.20.1
func (ra RatioAmount) Amount()
func (RatioAmount) Calc ¶ added in v1.20.1
func (ra RatioAmount) Calc(base int) int
type TargetGroupType ¶ added in v1.61.0
type TargetGroupType string
使用者から見たターゲットの種別。相対的な指定なので、所有者が敵グループだと対象グループは逆転する
func (TargetGroupType) Valid ¶ added in v1.61.0
func (enum TargetGroupType) Valid() error
type TargetNumType ¶ added in v1.16.0
type TargetNumType string
ターゲット数
func (TargetNumType) Valid ¶ added in v1.16.0
func (enum TargetNumType) Valid() error
type TargetType ¶
type TargetType struct { TargetGroup TargetGroupType TargetNum TargetNumType }
選択対象
type UsableSceneType ¶
type UsableSceneType string
使えるシーン
func (UsableSceneType) Valid ¶ added in v1.16.0
func (enum UsableSceneType) Valid() error
type Wearable ¶
type Wearable struct { Defense int // 防御力 EquipmentCategory EquipmentType // 装備部位 EquipBonus EquipBonus // ステータスへのボーナス }
装備品。キャラクタが装備することでパラメータを変更できる