Documentation ¶
Index ¶
- Constants
- Variables
- func GetTileIsoPosition(x, y int) (float64, float64)
- func GetTileIsoPositionFromCoordinate(x, y float64) (int, int)
- func GetTilePosition(x, y int) (float64, float64)
- func GetTilePositionFromCoordinate(x, y float64) (int, int)
- type Ability
- type AbilityDescription
- type AbilityType
- type Actor
- type ActorCommand
- type Camera
- type Combat
- func (c *Combat) AddReport(text string, icon *ebiten.Image, color color.NRGBA)
- func (cmb *Combat) CaptureChance() float64
- func (c *Combat) Draw(screen *ebiten.Image, geom ebiten.GeoM)
- func (c *Combat) GenerateEnemyAction() CombatAction
- func (c *Combat) Input(in inputs.Input)
- func (c *Combat) Refresh()
- func (c *Combat) RefreshAbilities()
- func (c *Combat) RefreshGlitchSwap()
- func (c *Combat) RefreshGlitchUse()
- func (c *Combat) SetAction(action CombatAction)
- func (c *Combat) SwapMenu(mode CombatMenuMode)
- func (c *Combat) Update(w *World, r *Room) (cmd commands.Command)
- type CombatAction
- type CombatActionAbility
- type CombatActionAttack
- type CombatActionBoost
- type CombatActionCapture
- type CombatActionDone
- type CombatActionFlee
- type CombatActionSwapGlitch
- type CombatActor
- type CombatLine
- type CombatMenu
- type CombatMenuItem
- type CombatMenuMode
- type CombatMenus
- type DrawMode
- type GlitchActor
- type Message
- type Prompt
- type Room
- func (r *Room) Activate()
- func (r *Room) AddActor(a Actor)
- func (r *Room) Center() (float64, float64)
- func (r *Room) CenterIso() (float64, float64)
- func (r *Room) Draw(screen *ebiten.Image, geom ebiten.GeoM)
- func (r *Room) DrawPost(screen, post *ebiten.Image, geom ebiten.GeoM)
- func (r *Room) DropInR() chan bool
- func (r *Room) FuncR(fnc func()) chan bool
- func (r *Room) GetActor(x, y int) Actor
- func (r *Room) GetActorByTag(tag string) Actor
- func (r *Room) GetTile(x, y int) *Tile
- func (r *Room) GetTilePositionFromCoordinate(x, y float64) (int, int)
- func (r *Room) GetTilePositionGeoM(x, y int) (g ebiten.GeoM, ratio float64)
- func (r *Room) HandlePendingCommands(w *World) (results []commands.Command)
- func (r *Room) Input(w *World, in inputs.Input) bool
- func (r *Room) PrependActor(a Actor)
- func (r *Room) RemoveActor(a Actor)
- func (r *Room) SetColor(c color.NRGBA)
- func (r *Room) Size() (int, int)
- func (r *Room) TileMessage(m Message)
- func (r *Room) TileMessageR(m Message) chan bool
- func (r *Room) ToFlat()
- func (r *Room) ToIso()
- func (r *Room) Update(w *World) []commands.Command
- func (r *Room) UpdateGlitchion()
- type Rooms
- type SpriteStack
- func (ss *SpriteStack) Draw(screen *ebiten.Image, geom ebiten.GeoM, mode DrawMode, ratio float64)
- func (ss *SpriteStack) DrawFlat(screen *ebiten.Image, geom ebiten.GeoM)
- func (ss *SpriteStack) DrawIso(screen *ebiten.Image, geom ebiten.GeoM)
- func (ss *SpriteStack) DrawMixed(screen *ebiten.Image, geom ebiten.GeoM, ratio float64)
- func (ss *SpriteStack) GeoM(geom ebiten.GeoM) ebiten.GeoM
- func (ss *SpriteStack) IsoGeoM(geom ebiten.GeoM) ebiten.GeoM
- func (ss *SpriteStack) SetSprite(sprite string)
- type Tile
- type World
- func (w *World) AddPrompt(items []string, msg string, cb func(int, string) bool, showExtra bool)
- func (w *World) Draw(screen *ebiten.Image)
- func (w *World) EnterRoom(room *Room)
- func (w *World) FuncR(fnc func()) chan bool
- func (w *World) Input(in inputs.Input)
- func (w *World) MessageR(msg Message) chan bool
- func (w *World) Update()
Constants ¶
View Source
const ( AbilityNone AbilityType = "" AbilityBlock = "BLOCK" AbilityPerfectHit = "PERFECT HIT" AbilityPerfectBlock = "PERFECT BLOCK" AbilityHardy = "HARDY" AbilityCleave = "CLEAVE" AbilityRandomDamage = "RANDOM DAMAGE" )
View Source
const ( AbilityDescriptionNone AbilityDescription = "" AbilityDescriptionBlock = "Block the next 2*Ability damage up to Turns." AbilityDescriptionPerfectHit = "Deal 2*Ability Tier damage on the next attacks up to Turns." AbilityDescriptionPerfectBlock = "Block the next 2*Ability Tier attacks up to Turns." AbilityDescriptionHardy = "Avoid becoming infected up to Turns." AbilityDescriptionCleave = "Halves enemy INTEGRITY, FIREWALL, or PENETRATION." AbilityDescriptionRandomDamage = "Deals random bonus damage up to Tier for Turns." )
Variables ¶
View Source
var AbilityDescriptions = map[AbilityType]AbilityDescription{ AbilityNone: AbilityDescriptionNone, AbilityBlock: AbilityDescriptionBlock, AbilityPerfectHit: AbilityDescriptionPerfectHit, AbilityPerfectBlock: AbilityDescriptionPerfectBlock, AbilityHardy: AbilityDescriptionHardy, AbilityCleave: AbilityDescriptionCleave, AbilityRandomDamage: AbilityDescriptionRandomDamage, }
Functions ¶
func GetTileIsoPosition ¶
func GetTilePosition ¶
Types ¶
type Ability ¶
type Ability struct { Name string Tier int Turns int Cooldown int // contains filtered or unexported fields }
func (*Ability) OnCooldown ¶
func (*Ability) ReduceCooldown ¶
func (b *Ability) ReduceCooldown()
type AbilityDescription ¶
type AbilityDescription string
type AbilityType ¶
type AbilityType string
type Actor ¶
type Actor interface { Update(r *Room) (cmd commands.Command) Ready() bool SetReady(bool) TakeTurn() (cmd commands.Command) Draw(screen *ebiten.Image, r *Room, geom ebiten.GeoM, drawMode DrawMode) DrawPost(screen, post *ebiten.Image, r *Room, geom ebiten.GeoM, drawMode DrawMode) SetPosition(int, int, int) Position() (int, int, int) Command(cmd commands.Command) Input(in inputs.Input) bool Hover(bool) Hovered() bool SetTag(string) Tag() string SetName(string) Name() string SpriteStack() *SpriteStack Interact(w *World, r *Room, other Actor) commands.Command Blocks() bool SetBlocks(bool) Ghosting() bool SetGhosting(bool) Glitch() bool }
type ActorCommand ¶
type Camera ¶
type Camera struct { Rotation float64 X float64 Y float64 W float64 H float64 Zoom float64 // contains filtered or unexported fields }
func (*Camera) SetPosition ¶
type Combat ¶
type Combat struct { Attacker CombatActor Defender CombatActor AutoCapture bool // contains filtered or unexported fields }
func NewCombat ¶
func NewCombat(w, h int, attacker, defender CombatActor) *Combat
func (*Combat) CaptureChance ¶
func (*Combat) GenerateEnemyAction ¶
func (c *Combat) GenerateEnemyAction() CombatAction
func (*Combat) RefreshAbilities ¶
func (c *Combat) RefreshAbilities()
func (*Combat) RefreshGlitchSwap ¶
func (c *Combat) RefreshGlitchSwap()
func (*Combat) RefreshGlitchUse ¶
func (c *Combat) RefreshGlitchUse()
func (*Combat) SetAction ¶
func (c *Combat) SetAction(action CombatAction)
func (*Combat) SwapMenu ¶
func (c *Combat) SwapMenu(mode CombatMenuMode)
type CombatAction ¶
type CombatAction interface { Done(c *Combat) (CombatAction, bool) Update(c *Combat) IsAttacker() bool }
type CombatActionAbility ¶
type CombatActionAbility struct {
// contains filtered or unexported fields
}
func (CombatActionAbility) Done ¶
func (c CombatActionAbility) Done(cmb *Combat) (CombatAction, bool)
func (CombatActionAbility) IsAttacker ¶
func (c CombatActionAbility) IsAttacker() bool
func (*CombatActionAbility) Update ¶
func (c *CombatActionAbility) Update(cmb *Combat)
type CombatActionAttack ¶
type CombatActionAttack struct {
// contains filtered or unexported fields
}
func (CombatActionAttack) Done ¶
func (c CombatActionAttack) Done(cmb *Combat) (CombatAction, bool)
func (CombatActionAttack) IsAttacker ¶
func (c CombatActionAttack) IsAttacker() bool
func (*CombatActionAttack) Update ¶
func (c *CombatActionAttack) Update(cmb *Combat)
type CombatActionBoost ¶
type CombatActionBoost struct {
// contains filtered or unexported fields
}
func (CombatActionBoost) Done ¶
func (c CombatActionBoost) Done(cmb *Combat) (CombatAction, bool)
func (CombatActionBoost) IsAttacker ¶
func (c CombatActionBoost) IsAttacker() bool
func (*CombatActionBoost) Update ¶
func (c *CombatActionBoost) Update(cmb *Combat)
type CombatActionCapture ¶
type CombatActionCapture struct {
// contains filtered or unexported fields
}
func (CombatActionCapture) Done ¶
func (c CombatActionCapture) Done(cmb *Combat) (CombatAction, bool)
func (CombatActionCapture) IsAttacker ¶
func (c CombatActionCapture) IsAttacker() bool
func (*CombatActionCapture) Try ¶
func (c *CombatActionCapture) Try(cmb *Combat) bool
func (*CombatActionCapture) Update ¶
func (c *CombatActionCapture) Update(cmb *Combat)
type CombatActionDone ¶
type CombatActionDone struct { Result commands.CombatResult // contains filtered or unexported fields }
func (CombatActionDone) Done ¶
func (c CombatActionDone) Done(combat *Combat) (CombatAction, bool)
func (CombatActionDone) IsAttacker ¶
func (c CombatActionDone) IsAttacker() bool
func (*CombatActionDone) Update ¶
func (c *CombatActionDone) Update(combat *Combat)
type CombatActionFlee ¶
type CombatActionFlee struct {
// contains filtered or unexported fields
}
func (CombatActionFlee) Done ¶
func (c CombatActionFlee) Done(cmb *Combat) (CombatAction, bool)
func (CombatActionFlee) IsAttacker ¶
func (c CombatActionFlee) IsAttacker() bool
func (*CombatActionFlee) Update ¶
func (c *CombatActionFlee) Update(cmb *Combat)
type CombatActionSwapGlitch ¶
type CombatActionSwapGlitch struct {
// contains filtered or unexported fields
}
func (CombatActionSwapGlitch) Done ¶
func (c CombatActionSwapGlitch) Done(cmb *Combat) (CombatAction, bool)
func (CombatActionSwapGlitch) IsAttacker ¶
func (c CombatActionSwapGlitch) IsAttacker() bool
func (*CombatActionSwapGlitch) Update ¶
func (c *CombatActionSwapGlitch) Update(cmb *Combat)
type CombatActor ¶
type CombatActor interface { Name() string CurrentStats() (pen int, fire int, inte int) MaxStats() (int, int, int) RestoreStats() ReduceDamage(int, int, int) (int, int, int) ApplyDamage(int, int, int) (int, int, int) ApplyBoost(int, int, int) (int, int, int) Level() int SetLevel(int) Exp() int AddExp(int) int ExpValue() int RollBoost() (pen, fire, inte int) RollAttack() (pen int) HasGlitch() bool SetGlitch(GlitchActor) Glitches() []GlitchActor CurrentGlitch() GlitchActor AddGlitch(GlitchActor) RemoveGlitch(GlitchActor) Killed() bool Kill() Captured() bool Capture() Penalize(pen, fire, inte int) ClearPenalties() }
type CombatLine ¶
type CombatLine struct {
// contains filtered or unexported fields
}
type CombatMenu ¶
type CombatMenu struct {
// contains filtered or unexported fields
}
type CombatMenuItem ¶
type CombatMenuItem struct { Glitch GlitchActor Icon *ebiten.Image SubIcon *ebiten.Image Text string Bounds image.Rectangle Disabled bool Trigger func() }
type CombatMenuMode ¶
type CombatMenuMode int
const ( CombatMenuModeMain CombatMenuMode = iota CombatMenuModeAttackStat CombatMenuModeBoostStat CombatMenuModeUseGlitch CombatMenuModeSwapGlitch )
type CombatMenus ¶
type CombatMenus struct {
// contains filtered or unexported fields
}
type GlitchActor ¶
type Prompt ¶
type Prompt struct { Message string Items []string Selected int // contains filtered or unexported fields }
Prompt system. It's kinda jank, but it works well enough for this project.
type Room ¶
type Room struct { Tiles [][]Tile Actors []Actor PendingCommands []ActorCommand TileMessages []Message Color color.NRGBA Darkness float64 DrawMode DrawMode OnUpdate func(*World, *Room) OnEnter func(*World, *Room) OnLeave func(*World, *Room) OnTurn func(*World, *Room) RoutineChan chan func() bool RoutineChans []func() bool Song string Name string Glitches int MaxGlitches int // contains filtered or unexported fields }
func (*Room) GetActorByTag ¶
func (*Room) GetTilePositionFromCoordinate ¶
func (*Room) GetTilePositionGeoM ¶
func (*Room) HandlePendingCommands ¶
func (*Room) PrependActor ¶
func (*Room) RemoveActor ¶
func (*Room) TileMessage ¶
func (*Room) TileMessageR ¶
func (*Room) UpdateGlitchion ¶
func (r *Room) UpdateGlitchion()
type SpriteStack ¶
type SpriteStack struct { LayerDistance float64 Alpha float32 Rotation float64 ExtraRotation float64 YScale float64 Highlight bool Shaded bool SkewX float64 SkewY float64 // contains filtered or unexported fields }
func NewSpriteStack ¶
func NewSpriteStack(sprite string) *SpriteStack
func (*SpriteStack) Draw ¶
func (ss *SpriteStack) Draw(screen *ebiten.Image, geom ebiten.GeoM, mode DrawMode, ratio float64)
func (*SpriteStack) DrawFlat ¶
func (ss *SpriteStack) DrawFlat(screen *ebiten.Image, geom ebiten.GeoM)
func (*SpriteStack) DrawIso ¶
func (ss *SpriteStack) DrawIso(screen *ebiten.Image, geom ebiten.GeoM)
func (*SpriteStack) DrawMixed ¶
func (ss *SpriteStack) DrawMixed(screen *ebiten.Image, geom ebiten.GeoM, ratio float64)
func (*SpriteStack) GeoM ¶
func (ss *SpriteStack) GeoM(geom ebiten.GeoM) ebiten.GeoM
func (*SpriteStack) IsoGeoM ¶
func (ss *SpriteStack) IsoGeoM(geom ebiten.GeoM) ebiten.GeoM
func (*SpriteStack) SetSprite ¶
func (ss *SpriteStack) SetSprite(sprite string)
type Tile ¶
type World ¶
type World struct { PlayerActor Actor Rooms []*Room LastRoom *Room Room *Room Camera *Camera RoutineChan chan func() bool RoutineChans []func() bool Messages []Message Prompts []*Prompt Combat *Combat Color color.NRGBA SkipMessages bool // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.