Documentation ¶
Index ¶
- Constants
- func BehaviorIs[T EntityBehavior](behavior EntityBehavior) bool
- func TicksToSampleOffset(sr beep.SampleRate, t Ticks) int
- type BrokenTileBehavior
- func (tb *BrokenTileBehavior) Appearance(t *Tile, y int, b *bundle.Bundle, tiles *ebiten.Image) draw.Node
- func (tb *BrokenTileBehavior) CanEnter(t *Tile, e *Entity) bool
- func (tb *BrokenTileBehavior) Clone() TileBehavior
- func (tb *BrokenTileBehavior) Flip()
- func (tb *BrokenTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
- func (tb *BrokenTileBehavior) Step(t *Tile, s *State)
- type Chip
- type ChipPlaque
- type ColumnInfo
- type CrackedTileBehavior
- func (tb *CrackedTileBehavior) Appearance(t *Tile, y int, b *bundle.Bundle, tiles *ebiten.Image) draw.Node
- func (tb *CrackedTileBehavior) CanEnter(t *Tile, e *Entity) bool
- func (tb *CrackedTileBehavior) Clone() TileBehavior
- func (tb *CrackedTileBehavior) Flip()
- func (tb *CrackedTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
- func (tb *CrackedTileBehavior) Step(t *Tile, s *State)
- type Damage
- type Decoration
- type DecorationID
- type Direction
- type Element
- type Emotion
- type Entity
- func (e *Entity) Appearance(b *bundle.Bundle) draw.Node
- func (e *Entity) ApplyHit(h Hit)
- func (e *Entity) CanMoveTo(tilePos TilePos, s *State) bool
- func (e *Entity) Clone() *Entity
- func (e *Entity) DoubleDamage() bool
- func (e *Entity) Facing() Direction
- func (e *Entity) FinishMove(s *State)
- func (e *Entity) Flip()
- func (e *Entity) ID() EntityID
- func (e *Entity) MoveDirectly(tilePos TilePos, s *State) bool
- func (e *Entity) RemoveFlashing(s *State)
- func (e *Entity) SetBehaviorImmediate(behavior EntityBehavior, s *State)
- func (e *Entity) StartMove(tilePos TilePos, s *State) bool
- func (e *Entity) Step(s *State)
- func (e *Entity) UseChip(s *State) bool
- type EntityBehavior
- type EntityBehaviorState
- type EntityBehaviorTraits
- type EntityID
- type EntityPerTickState
- type EntityTraits
- type Field
- type Flashing
- type ForcedMovement
- type ForcedMovementState
- type ForcedMovementType
- type Hit
- type HitResolution
- type HoleTileBehavior
- func (tb *HoleTileBehavior) Appearance(t *Tile, y int, b *bundle.Bundle, tiles *ebiten.Image) draw.Node
- func (tb *HoleTileBehavior) CanEnter(t *Tile, e *Entity) bool
- func (tb *HoleTileBehavior) Clone() TileBehavior
- func (tb *HoleTileBehavior) Flip()
- func (tb *HoleTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
- func (tb *HoleTileBehavior) Step(t *Tile, s *State)
- type IceTileBehavior
- func (tb *IceTileBehavior) Appearance(t *Tile, y int, b *bundle.Bundle, tiles *ebiten.Image) draw.Node
- func (tb *IceTileBehavior) CanEnter(t *Tile, e *Entity) bool
- func (tb *IceTileBehavior) Clone() TileBehavior
- func (tb *IceTileBehavior) Flip()
- func (tb *IceTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
- func (tb *IceTileBehavior) Step(t *Tile, s *State)
- type Intent
- type NormalTileBehavior
- func (tb *NormalTileBehavior) Appearance(t *Tile, y int, b *bundle.Bundle, tiles *ebiten.Image) draw.Node
- func (tb *NormalTileBehavior) CanEnter(t *Tile, e *Entity) bool
- func (tb *NormalTileBehavior) Clone() TileBehavior
- func (tb *NormalTileBehavior) Flip()
- func (tb *NormalTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
- func (tb *NormalTileBehavior) Step(t *Tile, s *State)
- type RoadTileBehavior
- func (tb *RoadTileBehavior) Appearance(t *Tile, y int, b *bundle.Bundle, tiles *ebiten.Image) draw.Node
- func (tb *RoadTileBehavior) CanEnter(t *Tile, e *Entity) bool
- func (tb *RoadTileBehavior) Clone() TileBehavior
- func (tb *RoadTileBehavior) Flip()
- func (tb *RoadTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
- func (tb *RoadTileBehavior) Step(t *Tile, s *State)
- type Sound
- type SoundID
- type State
- func (s *State) Appearance(b *bundle.Bundle) draw.Node
- func (s *State) ApplyHit(owner *Entity, pos TilePos, h Hit) bool
- func (s *State) AttachDecoration(d *Decoration)
- func (s *State) AttachEntity(e *Entity)
- func (s *State) AttachSound(snd *Sound)
- func (s *State) Clone() *State
- func (s *State) EntitiesAt(pos TilePos) []*Entity
- func (s *State) Flip()
- func (s *State) StartTimestop(e *Entity, timestopBehavior TimestopBehavior)
- type Ticks
- type Tile
- func (t *Tile) Appearance(y int, b *bundle.Bundle) draw.Node
- func (t *Tile) CanEnter(e *Entity) bool
- func (t *Tile) Clone() *Tile
- func (t *Tile) ElapsedTime() Ticks
- func (t *Tile) Flip()
- func (t *Tile) OnLeave(e *Entity, s *State)
- func (t *Tile) ReplaceBehavior(b TileBehavior, s *State)
- func (t *Tile) Step(s *State)
- type TileBehavior
- type TileBehaviorState
- type TilePos
- type Timestop
- type TimestopBehavior
Constants ¶
View Source
const ( TileRenderedWidth = 40 TileRenderedHeight = 24 )
View Source
const TileCols = 8
View Source
const TileRows = 5
Variables ¶
This section is empty.
Functions ¶
func BehaviorIs ¶
func BehaviorIs[T EntityBehavior](behavior EntityBehavior) bool
func TicksToSampleOffset ¶
func TicksToSampleOffset(sr beep.SampleRate, t Ticks) int
Types ¶
type BrokenTileBehavior ¶
type BrokenTileBehavior struct {
// contains filtered or unexported fields
}
func (*BrokenTileBehavior) Appearance ¶
func (*BrokenTileBehavior) CanEnter ¶
func (tb *BrokenTileBehavior) CanEnter(t *Tile, e *Entity) bool
func (*BrokenTileBehavior) Clone ¶
func (tb *BrokenTileBehavior) Clone() TileBehavior
func (*BrokenTileBehavior) Flip ¶
func (tb *BrokenTileBehavior) Flip()
func (*BrokenTileBehavior) OnLeave ¶
func (tb *BrokenTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
func (*BrokenTileBehavior) Step ¶
func (tb *BrokenTileBehavior) Step(t *Tile, s *State)
type Chip ¶
type Chip struct { Index int Name string BaseDamage int MakeBehavior func(damage Damage) EntityBehavior }
type ChipPlaque ¶
type ColumnInfo ¶
func (*ColumnInfo) Clone ¶
func (c *ColumnInfo) Clone() *ColumnInfo
type CrackedTileBehavior ¶
type CrackedTileBehavior struct { }
func (*CrackedTileBehavior) Appearance ¶
func (*CrackedTileBehavior) CanEnter ¶
func (tb *CrackedTileBehavior) CanEnter(t *Tile, e *Entity) bool
func (*CrackedTileBehavior) Clone ¶
func (tb *CrackedTileBehavior) Clone() TileBehavior
func (*CrackedTileBehavior) Flip ¶
func (tb *CrackedTileBehavior) Flip()
func (*CrackedTileBehavior) OnLeave ¶
func (tb *CrackedTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
func (*CrackedTileBehavior) Step ¶
func (tb *CrackedTileBehavior) Step(t *Tile, s *State)
type Decoration ¶
type Decoration struct { ElapsedTime Ticks RunsInTimestop bool IsFlipped bool Type bundle.DecorationType TilePos TilePos Offset image.Point // contains filtered or unexported fields }
func (*Decoration) Appearance ¶
func (d *Decoration) Appearance(b *bundle.Bundle) draw.Node
func (*Decoration) Clone ¶
func (d *Decoration) Clone() *Decoration
func (*Decoration) Flip ¶
func (d *Decoration) Flip()
func (*Decoration) ID ¶
func (d *Decoration) ID() DecorationID
func (*Decoration) Step ¶
func (d *Decoration) Step()
type DecorationID ¶
type DecorationID uint64
type Entity ¶
type Entity struct { ElapsedTime Ticks MaxLifeTime Ticks RunsInTimestop bool BehaviorState EntityBehaviorState NextBehavior EntityBehavior IsPendingDestruction bool Intent Intent LastIntent Intent TilePos TilePos FutureTilePos TilePos ForcedMovementState ForcedMovementState IsAlliedWithAnswerer bool IsFlipped bool IsDead bool Element Element HP int MaxHP int DisplayHP int Traits EntityTraits PowerShotChargeTime Ticks ConfusedTimeLeft Ticks BlindedTimeLeft Ticks ImmobilizedTimeLeft Ticks Flashing Flashing InvincibleTimeLeft Ticks Emotion Emotion HitResolution HitResolution PerTickState EntityPerTickState Chips []*Chip ChipUseQueued bool DragLockoutTimeLeft Ticks ChipUseLockoutTimeLeft Ticks RoadLockoutTimeLeft Ticks ChipPlaque ChipPlaque // contains filtered or unexported fields }
func (*Entity) DoubleDamage ¶
func (*Entity) FinishMove ¶
func (*Entity) RemoveFlashing ¶
func (*Entity) SetBehaviorImmediate ¶
func (e *Entity) SetBehaviorImmediate(behavior EntityBehavior, s *State)
SetBehaviorImmediate sets the entity's behavior immediately to the next state and steps once. You probably don't want to call this: you should probably use NextBehavior instead.
type EntityBehavior ¶
type EntityBehaviorState ¶
type EntityBehaviorState struct { Behavior EntityBehavior ElapsedTime Ticks }
func (EntityBehaviorState) Clone ¶
func (s EntityBehaviorState) Clone() EntityBehaviorState
type EntityBehaviorTraits ¶
type EntityBehaviorTraits struct {
CanBeCountered bool
}
type EntityPerTickState ¶
type EntityPerTickState struct {
WasHit bool
}
type EntityTraits ¶
type Field ¶
type Field struct { Tiles []*Tile ColumnInfo []*ColumnInfo }
type ForcedMovement ¶
type ForcedMovement struct { Type ForcedMovementType Direction Direction }
type ForcedMovementState ¶
type ForcedMovementState struct { ForcedMovement ForcedMovement ElapsedTime Ticks }
type ForcedMovementType ¶
type ForcedMovementType int
const ( ForcedMovementTypeNone ForcedMovementType = 0 ForcedMovementTypeSlide ForcedMovementType = 1 ForcedMovementTypeSmallDrag ForcedMovementType = 2 ForcedMovementTypeBigDrag ForcedMovementType = 2 )
func (ForcedMovementType) IsDrag ¶
func (t ForcedMovementType) IsDrag() bool
type Hit ¶
type Hit struct { TotalDamage int FlashTime Ticks ParalyzeTime Ticks ConfuseTime Ticks BlindTime Ticks ImmobilizeTime Ticks FreezeTime Ticks BubbleTime Ticks Flinch bool ForcedMovement ForcedMovement Element Element CanCounter bool RemovesFullSynchro bool SecondaryElementSword bool GuardPiercing bool RemovesFlashing bool }
type HitResolution ¶
type HoleTileBehavior ¶
type HoleTileBehavior struct { }
func (*HoleTileBehavior) Appearance ¶
func (*HoleTileBehavior) Clone ¶
func (tb *HoleTileBehavior) Clone() TileBehavior
func (*HoleTileBehavior) Flip ¶
func (tb *HoleTileBehavior) Flip()
func (*HoleTileBehavior) OnLeave ¶
func (tb *HoleTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
func (*HoleTileBehavior) Step ¶
func (tb *HoleTileBehavior) Step(t *Tile, s *State)
type IceTileBehavior ¶
type IceTileBehavior struct {
// contains filtered or unexported fields
}
func (*IceTileBehavior) Appearance ¶
func (*IceTileBehavior) Clone ¶
func (tb *IceTileBehavior) Clone() TileBehavior
func (*IceTileBehavior) Flip ¶
func (tb *IceTileBehavior) Flip()
func (*IceTileBehavior) Step ¶
func (tb *IceTileBehavior) Step(t *Tile, s *State)
type NormalTileBehavior ¶
type NormalTileBehavior struct { }
func (*NormalTileBehavior) Appearance ¶
func (*NormalTileBehavior) CanEnter ¶
func (tb *NormalTileBehavior) CanEnter(t *Tile, e *Entity) bool
func (*NormalTileBehavior) Clone ¶
func (tb *NormalTileBehavior) Clone() TileBehavior
func (*NormalTileBehavior) Flip ¶
func (tb *NormalTileBehavior) Flip()
func (*NormalTileBehavior) OnLeave ¶
func (tb *NormalTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
func (*NormalTileBehavior) Step ¶
func (tb *NormalTileBehavior) Step(t *Tile, s *State)
type RoadTileBehavior ¶
type RoadTileBehavior struct {
Direction Direction
}
func (*RoadTileBehavior) Appearance ¶
func (*RoadTileBehavior) Clone ¶
func (tb *RoadTileBehavior) Clone() TileBehavior
func (*RoadTileBehavior) Flip ¶
func (tb *RoadTileBehavior) Flip()
func (*RoadTileBehavior) OnLeave ¶
func (tb *RoadTileBehavior) OnLeave(t *Tile, e *Entity, s *State)
func (*RoadTileBehavior) Step ¶
func (tb *RoadTileBehavior) Step(t *Tile, s *State)
type Sound ¶
type State ¶
type State struct { ElapsedTime Ticks RandSource *syncrand.Source Field *Field Entities map[EntityID]*Entity Decorations map[DecorationID]*Decoration Sounds map[SoundID]*Sound Timestop *Timestop CounterPlaqueTimeLeft Ticks // contains filtered or unexported fields }
func (*State) AttachDecoration ¶
func (s *State) AttachDecoration(d *Decoration)
func (*State) AttachEntity ¶
func (*State) AttachSound ¶
func (*State) EntitiesAt ¶
func (*State) StartTimestop ¶
func (s *State) StartTimestop(e *Entity, timestopBehavior TimestopBehavior)
type Ticks ¶
type Ticks int
const DefaultFlashTime Ticks = 119
This is maybe 1 frame shorter than expected?
const DefaultParalyzeTime Ticks = 149
Apparently this is 1 frame shorter than expected - BN6 will remove paralyze if timeLeft - 1 == 0, but we only remove it if timeLeft = 0.
type Tile ¶
type Tile struct { BehaviorState TileBehaviorState TilePos TilePos IsFlipped bool IsHighlighted bool Reserver EntityID IsAlliedWithAnswerer bool }
func (*Tile) ElapsedTime ¶
func (*Tile) ReplaceBehavior ¶
func (t *Tile) ReplaceBehavior(b TileBehavior, s *State)
type TileBehavior ¶
type TileBehaviorState ¶
type TileBehaviorState struct { Behavior TileBehavior ElapsedTime Ticks }
func (TileBehaviorState) Clone ¶
func (s TileBehaviorState) Clone() TileBehaviorState
type Timestop ¶
type Timestop struct { Parent *Timestop Owner EntityID Behavior TimestopBehavior BehaviorElapsedTime Ticks IsPendingDestruction bool }
type TimestopBehavior ¶
type TimestopBehavior interface { clone.Cloner[TimestopBehavior] Step(t *Timestop, s *State) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.