Documentation
¶
Index ¶
- Constants
- Variables
- func GetEquipmentNamesWithTypes(equipmentTypes []EquipmentType) []*string
- func GetRoomCost(kind RoomKind, size RoomSize, level int) int
- func InBounds(x, y, width, height, mx, my float64) bool
- func IntToFloat2(a, b int) (float64, float64)
- func Must[T any](v T, err error) T
- func PaddedIntString(i int, pad int) string
- func PanicIfErr(err error)
- type Activity
- type ActivityRequests
- type AudioController
- func (a *AudioController) MuteAll()
- func (a *AudioController) PauseRoomTracks()
- func (a *AudioController) PlayRoomTracks()
- func (a *AudioController) PlaySfx(name string, vol float64, pan float64)
- func (a *AudioController) SetBackgroundTrackVolPercent(volume float64)
- func (a *AudioController) SetPan(roomKind RoomKind, pan float64)
- func (a *AudioController) SetStoryPanVol(roomPanVol map[RoomKind]PanVol)
- func (a *AudioController) SetTitleTrackVolPercent(perc float64)
- func (a *AudioController) SetVol(roomKind RoomKind, volume float64)
- type BossPanel
- type ButtonPanel
- func (bp *ButtonPanel) Check(mx, my float64, kind UICheckKind) bool
- func (bp *ButtonPanel) Disable()
- func (bp *ButtonPanel) Draw(o *render.Options)
- func (bp *ButtonPanel) Enable()
- func (bp *ButtonPanel) Height() float64
- func (bp *ButtonPanel) Layout(parent UIElement, o *UIOptions)
- func (bp *ButtonPanel) Position() (float64, float64)
- func (bp *ButtonPanel) SetPosition(x, y float64)
- func (bp *ButtonPanel) SetSize(w, h float64)
- func (bp *ButtonPanel) Size() (float64, float64)
- func (bp *ButtonPanel) Update(o *UIOptions)
- func (bp *ButtonPanel) Width() float64
- func (bp *ButtonPanel) X() float64
- func (bp *ButtonPanel) Y() float64
- type ControlsPanel
- type Dude
- func (d *Dude) AddToInventory(eq *Equipment)
- func (d *Dude) AddXP(xp int)
- func (d *Dude) ApplyDamage(amount int) (int, bool)
- func (d *Dude) Cursify(roomLevel int)
- func (d *Dude) Draw(o *render.Options)
- func (d *Dude) DrawProfile(o *render.Options)
- func (d *Dude) Equip(eq *Equipment)
- func (d *Dude) Equipped() map[EquipmentType]*Equipment
- func (d *Dude) FullHeal()
- func (d *Dude) GetCalculatedStats() *Stats
- func (d *Dude) GetDamage() (int, bool)
- func (d *Dude) Gold() int
- func (d *Dude) Heal(amount int) int
- func (d *Dude) Inventory() []*Equipment
- func (d *Dude) IsDead() bool
- func (d *Dude) Level() int
- func (d *Dude) LevelUpEquipment(amount int, maxQuality EquipmentQuality)
- func (d *Dude) Name() string
- func (d *Dude) NextLevelXP() int
- func (d *Dude) Perkify(maxQuality PerkQuality)
- func (d *Dude) Position() (float64, float64)
- func (d *Dude) Profession() ProfessionKind
- func (d *Dude) RandomEquippedItem() *Equipment
- func (d *Dude) RestoreUses()
- func (d *Dude) Room() *Room
- func (d *Dude) Rotation() float64
- func (d *Dude) SetActivity(a DudeActivity)
- func (d *Dude) SetPosition(x, y float64)
- func (d *Dude) SetRoom(r *Room)
- func (d *Dude) SetRotation(r float64)
- func (d *Dude) Speed() float64
- func (d *Dude) Stats() *Stats
- func (d *Dude) SyncEquipment()
- func (d *Dude) TrapDamage(roomLevel int) Activity
- func (d *Dude) Trigger(e Event) Activity
- func (d *Dude) Unequip(t EquipmentType) *Equipment
- func (d *Dude) Update(story *Story, req *ActivityRequests)
- func (d *Dude) UpdateGold(amount int)
- func (d *Dude) XP() int
- type DudeActivity
- type DudeDeadActivity
- type DudeInfoPanel
- type DudePanel
- type Enemy
- func (e *Enemy) Damage(amount int) bool
- func (e *Enemy) Draw(o render.Options)
- func (e *Enemy) GetTarget(dudes []*Dude) *Dude
- func (e *Enemy) Gold() int
- func (e *Enemy) Hit() int
- func (e *Enemy) IsDead() bool
- func (e *Enemy) Name() string
- func (e *Enemy) RoomUpdate(r *Room)
- func (e *Enemy) Update(d *Dude)
- func (e *Enemy) XP() int
- type EnemyKind
- type Equipment
- func (e *Equipment) Activate(event Event)
- func (e *Equipment) CanEquip(p ProfessionKind) bool
- func (e *Equipment) ChangeQuality(delta int)
- func (e *Equipment) Description() string
- func (e *Equipment) FullName() string
- func (e *Equipment) GoldValue() int
- func (e *Equipment) Level() int
- func (e *Equipment) LevelDown()
- func (e *Equipment) LevelUp(maxQuality EquipmentQuality) bool
- func (e *Equipment) LevelWithQuality() int
- func (e *Equipment) Name() string
- func (e *Equipment) Quality() EquipmentQuality
- func (e *Equipment) RestoreUses() bool
- func (e *Equipment) Stats() *Stats
- func (e *Equipment) Type() EquipmentType
- func (e *Equipment) Update()
- func (e *Equipment) Uses() int
- type EquipmentDetailsPanel
- func (edp *EquipmentDetailsPanel) Check(mx, my float64, kind UICheckKind) bool
- func (edp *EquipmentDetailsPanel) Draw(o *render.Options)
- func (edp *EquipmentDetailsPanel) Layout(o *UIOptions)
- func (edp *EquipmentDetailsPanel) SetEquipment(equipment *Equipment)
- func (edp *EquipmentDetailsPanel) Update(o *UIOptions)
- type EquipmentPanel
- type EquipmentQuality
- type EquipmentType
- type Error
- type Event
- type EventCenterRoom
- type EventCombatRoom
- type EventDudeCrit
- type EventDudeDodge
- type EventDudeHit
- type EventDudeMiss
- type EventEndBoss
- type EventEndRoom
- type EventEnemyHit
- type EventEnterRoom
- type EventEquip
- type EventGlobalTick
- type EventGoldGain
- type EventGoldLoss
- type EventLeaveRoom
- type EventSell
- type EventStartBoss
- type EventUnequip
- type EventWaitRoom
- type FeedbackKind
- type FeedbackPopup
- type FloatingText
- type Game
- func (g *Game) AdjustCamera()
- func (g *Game) AdjustSpeed()
- func (g *Game) CheckUI() (bool, UICheckKind)
- func (g *Game) CursorPosition() (float64, float64)
- func (g *Game) Draw(screen *ebiten.Image)
- func (g *Game) DrawTower(screen *ebiten.Image)
- func (g *Game) GetAliveDudes() []*Dude
- func (g *Game) Init()
- func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)
- func (g *Game) SetAutoplay(autoplay bool)
- func (g *Game) ToggleAutoplay()
- func (g *Game) TogglePause()
- func (g *Game) Update() error
- func (g *Game) UpdateInfo()
- type GameInfoPanel
- type GameState
- type GameStateBuild
- func (s *GameStateBuild) Begin(g *Game)
- func (s *GameStateBuild) BuyDude(g *Game)
- func (s *GameStateBuild) BuyEquipment(g *Game)
- func (s *GameStateBuild) Draw(g *Game, screen *ebiten.Image)
- func (s *GameStateBuild) DudeCost(dudeCount int) int
- func (s *GameStateBuild) End(g *Game)
- func (s *GameStateBuild) EquipmentCost() int
- func (s *GameStateBuild) RerollCost() int
- func (s *GameStateBuild) RerollOptionalRooms(g *Game)
- func (s *GameStateBuild) RerollRooms(g *Game)
- func (s *GameStateBuild) RollRooms(g *Game)
- func (s *GameStateBuild) SellEquipment(g *Game, e *Equipment)
- func (s *GameStateBuild) TryPlaceRoom(g *Game) PlaceResult
- func (s *GameStateBuild) Update(g *Game) GameState
- type GameStateLose
- type GameStatePlay
- type GameStatePre
- type GameStateStart
- type GameStateWin
- type HintPopup
- type IPerk
- type Message
- type MessageKind
- type MessagePanel
- type MoveActivity
- type PanVol
- type PanelStyle
- type Perk
- type PerkFindGold
- type PerkGoldBoost
- type PerkHealOnCrit
- type PerkHealOnDodge
- type PerkHealOnGoldGain
- type PerkHealOnGoldLoss
- type PerkHealOnRoomEnter
- type PerkHealOnSell
- type PerkNone
- type PerkQuality
- type PerkStatBoost
- type PerkStickyFingers
- type PlaceResult
- type Profession
- type ProfessionKind
- type Room
- func (r *Room) AddDude(d *Dude)
- func (r *Room) AddDudeToCenter(a *Dude)
- func (r *Room) AddDudeToWaiting(a *Dude)
- func (r *Room) AreAllDudesWaiting(n int) bool
- func (r *Room) Draw(o *render.Options)
- func (r *Room) GetRoomEffect(e Event) Activity
- func (r *Room) IsDudeInCenter(a *Dude) bool
- func (r *Room) IsDudeWaiting(a *Dude) bool
- func (r *Room) RemoveDude(d *Dude)
- func (r *Room) RemoveDudeFromCenter(a *Dude)
- func (r *Room) RemoveDudesFromWaiting()
- func (r *Room) Reset()
- func (r *Room) RollLoot(luck int) *Equipment
- func (r *Room) Update(req *ActivityRequests, g *Game)
- type RoomBossCombatActivity
- type RoomCenterActivity
- type RoomCombatActivity
- type RoomDef
- type RoomEndActivity
- type RoomEndBossActivity
- type RoomEnterActivity
- type RoomInfoPanel
- type RoomKind
- type RoomLeaveActivity
- type RoomPanel
- type RoomSize
- type RoomStartBossActivity
- type RoomTemplate
- type RoomWaitActivity
- type SpeedPanel
- type Stat
- type Stats
- type StereoPanStream
- type Story
- func (s *Story) AddClouds()
- func (s *Story) AddDude(d *Dude)
- func (s *Story) AddPortal()
- func (s *Story) AddText(t FloatingText)
- func (s *Story) AngleFromCenter(x, y float64) float64
- func (s *Story) Complete() bool
- func (s *Story) DistanceFromCenter(x, y float64) float64
- func (s *Story) Draw(o *render.Options)
- func (s *Story) GetRoomCenterRad(roomIndex int) float64
- func (s *Story) IsInCenterOfRoom(rads float64, roomIndex int) bool
- func (s *Story) Open()
- func (s *Story) PlaceRoom(r *Room, index int) error
- func (s *Story) PositionFromCenter(rads float64, amount float64) (float64, float64)
- func (s *Story) RemoveClouds()
- func (s *Story) RemoveDoor()
- func (s *Story) RemoveDude(d *Dude)
- func (s *Story) RemovePortal()
- func (s *Story) RemoveRoom(index int) error
- func (s *Story) Reset()
- func (s *Story) RoomIndexFromAngle(rads float64) int
- func (s *Story) Update(req *ActivityRequests, g *Game)
- type StoryEnterNextActivity
- type Tower
- func (t *Tower) AddDude(d *Dude)
- func (t *Tower) AddDudes(dudes ...*Dude)
- func (t *Tower) AddStory(s *Story)
- func (t *Tower) ClearBodies()
- func (t *Tower) ClearTexts()
- func (t *Tower) Draw(o *render.Options)
- func (t *Tower) HasAliveDudes() bool
- func (t *Tower) RemoveDude(d *Dude)
- func (t *Tower) Reset()
- func (t *Tower) Update(req *ActivityRequests, g *Game)
- type TowerCompleteActivity
- type TowerLeaveActivity
- type Track
- type UI
- type UIButton
- func (b *UIButton) Check(mx, my float64, kind UICheckKind) bool
- func (b *UIButton) Draw(o *render.Options)
- func (b *UIButton) Height() float64
- func (b *UIButton) Layout(parent UIElement, o *UIOptions)
- func (b *UIButton) SetImage(name string)
- func (b *UIButton) SetPosition(x, y float64)
- func (b *UIButton) Size() (float64, float64)
- func (b *UIButton) Update(o *UIOptions)
- func (b *UIButton) Width() float64
- type UICheckKind
- type UIElement
- type UIImage
- type UIItemList
- func (l *UIItemList) AddItem(item UIElement)
- func (l *UIItemList) Check(mx, my float64, kind UICheckKind) bool
- func (l *UIItemList) Clear()
- func (l *UIItemList) Draw(o *render.Options)
- func (l *UIItemList) Layout(parent UIElement, o *UIOptions)
- func (l *UIItemList) RemoveItemByIndex(index int)
- func (l *UIItemList) Update(o *UIOptions)
- type UIOptions
- type UIPanel
- func (p *UIPanel) AddChild(child UIElement)
- func (p *UIPanel) Check(mx, my float64, kind UICheckKind) bool
- func (p *UIPanel) Draw(o *render.Options)
- func (p *UIPanel) Layout(parent UIElement, o *UIOptions)
- func (p *UIPanel) RemoveChild(child UIElement)
- func (p *UIPanel) SetStyle(style PanelStyle)
- func (p *UIPanel) Update(o *UIOptions)
- type UIText
- func (t *UIText) Check(mx, my float64, kind UICheckKind) bool
- func (t *UIText) Draw(o *render.Options)
- func (t *UIText) Layout(parent UIElement, o *UIOptions)
- func (t *UIText) SetScale(scale float64)
- func (t *UIText) SetSize(w, h float64)
- func (t *UIText) SetText(txt string)
- func (t *UIText) Update(o *UIOptions)
Constants ¶
const ( LargeOriginY = 44 HugeOriginY = 64 )
These origins are used to re-position a room "pie" image so that its center is in the appropriate place.
const ( ErrRoomIndexInvalid = Error("invalid room index") ErrRoomTooLarge = Error("room too large") ErrRoomNoSpace = Error("no space for room") ErrRoomNotPresent = Error("room not present") )
const ( DirectionVertical = iota DirectionHorizontal )
======== UIItemList ========
const AUDIO_FADE_IN_TICK = 60
const CombatTickrate = 30 // Tick combat every 30 ticks
const ENEMY_SCALE = 1.0
const PortalDistance = 44 // Distance from the center of the tower to the portal.
const PortalRotationHuge = 7.0 * -(math.Pi / 8) // Rotation of the portal.
const PortalRotationLarge = 7.0*-(math.Pi/8) - math.Pi/4.5 // Rotation of the portal.
const PortalRotationMedium = 7.0*-(math.Pi/8) - math.Pi/3.5 // Rotation of the portal.
const PortalRotationSmall = 7.0*-(math.Pi/8) - math.Pi/2.5 // Rotation of the portal.
const RoomPath = 53
const RoomStairsEntrance = 12
RoomStairsEntrance is the distance from the center that a room's stairs is expected to be at.
const StoryHeight = 28 // StoryHeight is used to space stories apart from each other vertically.
StoryHeight is the height of a story in da tower.
const StorySlices = 28 // The amount of slices used for the frame buffers, should be equal to maximum staxie slice count used in a story.
const StoryVGroupHeight = 162 // Framebuffer's maximum height for rendering.
const StoryVGroupWidth = 244 // Framebuffer's maximum width for rendering.
const StoryWallHeight = 9 // The height of the wall stack -- this is repeated 3 times to get the full height (roughly)
const TowerCenterX = StoryVGroupWidth/2 - 5 // Center of the tower. Have to offset lightly for some dumb reason...
const TowerCenterY = StoryVGroupHeight/2 - 5 // Center of the tower.
const TowerEntrance = 80
const TowerStairs = 60
const VOL_MULT = 1.75
Variables ¶
var ( FeedbackGeneric = FeedbackKind{255, 255, 255, 255} FeedbackGood = FeedbackKind{0, 255, 0, 255} FeedbackBad = FeedbackKind{255, 0, 0, 255} FeedbackWarning = FeedbackKind{255, 255, 0, 255} )
var RoomDefs = make(map[string]*RoomDef)
Functions ¶
func GetEquipmentNamesWithTypes ¶
func GetEquipmentNamesWithTypes(equipmentTypes []EquipmentType) []*string
func GetRoomCost ¶
Cost of the room scales with the story level With each level, the cost of the room increases by 25%
func IntToFloat2 ¶
func PaddedIntString ¶
func PanicIfErr ¶
func PanicIfErr(err error)
Types ¶
type ActivityRequests ¶
type ActivityRequests []Activity
func (*ActivityRequests) Add ¶
func (a *ActivityRequests) Add(act Activity)
type AudioController ¶
type AudioController struct {
// contains filtered or unexported fields
}
func NewAudioController ¶
func NewAudioController() *AudioController
func (*AudioController) MuteAll ¶
func (a *AudioController) MuteAll()
func (*AudioController) PauseRoomTracks ¶
func (a *AudioController) PauseRoomTracks()
func (*AudioController) PlayRoomTracks ¶
func (a *AudioController) PlayRoomTracks()
func (*AudioController) PlaySfx ¶
func (a *AudioController) PlaySfx(name string, vol float64, pan float64)
func (*AudioController) SetBackgroundTrackVolPercent ¶
func (a *AudioController) SetBackgroundTrackVolPercent(volume float64)
func (*AudioController) SetPan ¶
func (a *AudioController) SetPan(roomKind RoomKind, pan float64)
func (*AudioController) SetStoryPanVol ¶
func (a *AudioController) SetStoryPanVol(roomPanVol map[RoomKind]PanVol)
For the tracks that we have, set the volume and pan If the track doesn't exist, set it to 0 Allows muting rooms that are removed
func (*AudioController) SetTitleTrackVolPercent ¶
func (a *AudioController) SetTitleTrackVolPercent(perc float64)
func (*AudioController) SetVol ¶
func (a *AudioController) SetVol(roomKind RoomKind, volume float64)
type BossPanel ¶
type BossPanel struct {
// contains filtered or unexported fields
}
func MakeBossPanel ¶
func MakeBossPanel() BossPanel
type ButtonPanel ¶
type ButtonPanel struct {
// contains filtered or unexported fields
}
func MakeButtonPanel ¶
func MakeButtonPanel(font assets.Font, style PanelStyle) ButtonPanel
func (*ButtonPanel) Check ¶
func (bp *ButtonPanel) Check(mx, my float64, kind UICheckKind) bool
func (*ButtonPanel) Disable ¶
func (bp *ButtonPanel) Disable()
func (*ButtonPanel) Draw ¶
func (bp *ButtonPanel) Draw(o *render.Options)
func (*ButtonPanel) Enable ¶
func (bp *ButtonPanel) Enable()
func (*ButtonPanel) Height ¶
func (bp *ButtonPanel) Height() float64
func (*ButtonPanel) Layout ¶
func (bp *ButtonPanel) Layout(parent UIElement, o *UIOptions)
func (*ButtonPanel) Position ¶
func (bp *ButtonPanel) Position() (float64, float64)
func (*ButtonPanel) SetPosition ¶
func (bp *ButtonPanel) SetPosition(x, y float64)
func (*ButtonPanel) SetSize ¶
func (bp *ButtonPanel) SetSize(w, h float64)
func (*ButtonPanel) Size ¶
func (bp *ButtonPanel) Size() (float64, float64)
func (*ButtonPanel) Update ¶
func (bp *ButtonPanel) Update(o *UIOptions)
func (*ButtonPanel) Width ¶
func (bp *ButtonPanel) Width() float64
func (*ButtonPanel) X ¶
func (bp *ButtonPanel) X() float64
func (*ButtonPanel) Y ¶
func (bp *ButtonPanel) Y() float64
type ControlsPanel ¶
type ControlsPanel struct { render.Positionable render.Sizeable // contains filtered or unexported fields }
func MakeControlsPanel ¶
func MakeControlsPanel() ControlsPanel
func (*ControlsPanel) Check ¶
func (p *ControlsPanel) Check(mx, my float64, kind UICheckKind) bool
func (*ControlsPanel) Draw ¶
func (p *ControlsPanel) Draw(o *render.Options)
func (*ControlsPanel) Layout ¶
func (p *ControlsPanel) Layout(parent UIElement, o *UIOptions)
func (*ControlsPanel) Update ¶
func (p *ControlsPanel) Update(o *UIOptions)
type Dude ¶
type Dude struct {
// contains filtered or unexported fields
}
func NewDude ¶
func NewDude(pk ProfessionKind, level int) *Dude
func (*Dude) AddToInventory ¶
func (*Dude) Cursify ¶
Cursify the dude Rolls twice, once with wisdom, the other with luck, and takes the highest Has a chance to - Delevel equipment (high chance) - Delevel perk (medium chance) - Delevel dude (low chance)
func (*Dude) DrawProfile ¶
func (*Dude) Equipped ¶
func (d *Dude) Equipped() map[EquipmentType]*Equipment
func (*Dude) GetCalculatedStats ¶
Returns the stats of the dude with the equipment stats added
func (*Dude) LevelUpEquipment ¶
func (d *Dude) LevelUpEquipment(amount int, maxQuality EquipmentQuality)
func (*Dude) NextLevelXP ¶
func (*Dude) Perkify ¶
func (d *Dude) Perkify(maxQuality PerkQuality)
func (*Dude) Profession ¶
func (d *Dude) Profession() ProfessionKind
func (*Dude) RandomEquippedItem ¶
func (*Dude) RestoreUses ¶
func (d *Dude) RestoreUses()
func (*Dude) SetActivity ¶
func (d *Dude) SetActivity(a DudeActivity)
func (*Dude) SetPosition ¶
func (*Dude) SetRotation ¶
func (*Dude) Speed ¶
Scale speed with agility Thinkin we probably shouldn't calculate this like this...
func (*Dude) SyncEquipment ¶
func (d *Dude) SyncEquipment()
func (*Dude) TrapDamage ¶
func (*Dude) Unequip ¶
func (d *Dude) Unequip(t EquipmentType) *Equipment
func (*Dude) Update ¶
func (d *Dude) Update(story *Story, req *ActivityRequests)
func (*Dude) UpdateGold ¶
type DudeActivity ¶
type DudeActivity int
const ( Idle DudeActivity = iota FirstEntering // First entering the tower. StairsToUp StairsFromDown GoingUp // Entering the room from a staircase, this basically does the fancy slice offset/limiting. Centering // Move the dude to the center of the room. Moving // Move the dude counter-clockwise. Leaving // Move the dude to the stairs. GoingDown // Leaving the room to the stairs, opposite of GoingUp. EnterPortal Ded BornAgain Waiting // maybe some random shufflin about FightBoss )
type DudeDeadActivity ¶
type DudeDeadActivity struct {
// contains filtered or unexported fields
}
func (DudeDeadActivity) Apply ¶
func (d DudeDeadActivity) Apply()
func (DudeDeadActivity) Cb ¶
func (d DudeDeadActivity) Cb() func(success bool)
type DudeInfoPanel ¶
type DudeInfoPanel struct {
// contains filtered or unexported fields
}
func NewDudeInfoPanel ¶
func NewDudeInfoPanel() *DudeInfoPanel
func (*DudeInfoPanel) Check ¶
func (dip *DudeInfoPanel) Check(mx, my float64, kind UICheckKind) bool
func (*DudeInfoPanel) Draw ¶
func (dip *DudeInfoPanel) Draw(o *render.Options)
func (*DudeInfoPanel) Layout ¶
func (dip *DudeInfoPanel) Layout(o *UIOptions)
func (*DudeInfoPanel) SetDude ¶
func (dip *DudeInfoPanel) SetDude(dude *Dude)
func (*DudeInfoPanel) SyncDude ¶
func (dip *DudeInfoPanel) SyncDude()
func (*DudeInfoPanel) Update ¶
func (dip *DudeInfoPanel) Update(o *UIOptions)
type DudePanel ¶
type DudePanel struct {
// contains filtered or unexported fields
}
func MakeDudePanel ¶
func MakeDudePanel() DudePanel
func (*DudePanel) DudeToImage ¶
type Enemy ¶
type Enemy struct {
// contains filtered or unexported fields
}
func (*Enemy) RoomUpdate ¶
type Equipment ¶
An equipment is the stuff you get
func GetRandomEquipment ¶
func NewEquipment ¶
func NewEquipment(name string, level int, quality EquipmentQuality, perk IPerk) *Equipment
Fetches the equipment by name Used for creating equipment in the game. Should find the equipment by name from loaded equipment
func (*Equipment) CanEquip ¶
func (e *Equipment) CanEquip(p ProfessionKind) bool
func (*Equipment) ChangeQuality ¶
func (*Equipment) Description ¶
Description returns the description of the equipment.
func (*Equipment) LevelUp ¶
func (e *Equipment) LevelUp(maxQuality EquipmentQuality) bool
Levels up the weapon. If it hits 5 we can upgrade the quality
func (*Equipment) LevelWithQuality ¶
func (*Equipment) Quality ¶
func (e *Equipment) Quality() EquipmentQuality
Quality returns the quality of the equipment.
func (*Equipment) RestoreUses ¶
func (*Equipment) Stats ¶
An equipment's stats will be combined with the dude's stats after being scaled by the equipment's quality and level
func (*Equipment) Type ¶
func (e *Equipment) Type() EquipmentType
type EquipmentDetailsPanel ¶
type EquipmentDetailsPanel struct {
// contains filtered or unexported fields
}
func NewEquipmentDetailsPanel ¶
func NewEquipmentDetailsPanel(small bool) *EquipmentDetailsPanel
func (*EquipmentDetailsPanel) Check ¶
func (edp *EquipmentDetailsPanel) Check(mx, my float64, kind UICheckKind) bool
func (*EquipmentDetailsPanel) Draw ¶
func (edp *EquipmentDetailsPanel) Draw(o *render.Options)
func (*EquipmentDetailsPanel) Layout ¶
func (edp *EquipmentDetailsPanel) Layout(o *UIOptions)
func (*EquipmentDetailsPanel) SetEquipment ¶
func (edp *EquipmentDetailsPanel) SetEquipment(equipment *Equipment)
func (*EquipmentDetailsPanel) Update ¶
func (edp *EquipmentDetailsPanel) Update(o *UIOptions)
type EquipmentPanel ¶
type EquipmentPanel struct {
// contains filtered or unexported fields
}
func MakeEquipmentPanel ¶
func MakeEquipmentPanel() EquipmentPanel
func (*EquipmentPanel) Check ¶
func (ep *EquipmentPanel) Check(mx, my float64, kind UICheckKind) bool
func (*EquipmentPanel) Draw ¶
func (ep *EquipmentPanel) Draw(o *render.Options)
func (*EquipmentPanel) Layout ¶
func (ep *EquipmentPanel) Layout(o *UIOptions)
func (*EquipmentPanel) SetEquipment ¶
func (ep *EquipmentPanel) SetEquipment(equipment []*Equipment)
func (*EquipmentPanel) Update ¶
func (ep *EquipmentPanel) Update(o *UIOptions)
type EquipmentQuality ¶
type EquipmentQuality float32
const ( EquipmentQualityCommon EquipmentQuality = 0 EquipmentQualityUncommon EquipmentQuality = 1 EquipmentQualityRare EquipmentQuality = 2 EquipmentQualityEpic EquipmentQuality = 3 EquipmentQualityLegendary EquipmentQuality = 4 )
Number of uses for equipment
func (EquipmentQuality) Color ¶
func (eq EquipmentQuality) Color() ebiten.ColorScale
func (EquipmentQuality) String ¶
func (eq EquipmentQuality) String() string
func (EquipmentQuality) TextColor ¶
func (eq EquipmentQuality) TextColor() color.Color
type EquipmentType ¶
type EquipmentType string
const ( EquipmentTypeWeapon EquipmentType = "weapon" EquipmentTypeArmor EquipmentType = "armor" EquipmentTypeAccessory EquipmentType = "accessory" )
Type of equipment
func RandomEquipmentType ¶
func RandomEquipmentType() EquipmentType
func (EquipmentType) String ¶
func (et EquipmentType) String() string
type Event ¶
type Event interface {
String() string
}
Event represents when something in the game has happened, such as entering a room, a dude dying, etc.
type EventCenterRoom ¶
type EventCenterRoom struct {
// contains filtered or unexported fields
}
EventCenterRoom is triggered when a dude is roughly in the center of a room
func (EventCenterRoom) String ¶
func (e EventCenterRoom) String() string
type EventCombatRoom ¶
type EventCombatRoom struct {
// contains filtered or unexported fields
}
EventCombatRoom is triggered when combat should occur in a room.
func (EventCombatRoom) String ¶
func (e EventCombatRoom) String() string
type EventDudeCrit ¶
type EventDudeCrit struct {
// contains filtered or unexported fields
}
func (EventDudeCrit) String ¶
func (e EventDudeCrit) String() string
type EventDudeDodge ¶
type EventDudeDodge struct {
// contains filtered or unexported fields
}
func (EventDudeDodge) String ¶
func (e EventDudeDodge) String() string
type EventDudeHit ¶
type EventDudeHit struct {
// contains filtered or unexported fields
}
func (EventDudeHit) String ¶
func (e EventDudeHit) String() string
type EventDudeMiss ¶
type EventDudeMiss struct {
// contains filtered or unexported fields
}
func (EventDudeMiss) String ¶
func (e EventDudeMiss) String() string
type EventEndBoss ¶
type EventEndBoss struct {
// contains filtered or unexported fields
}
func (EventEndBoss) String ¶
func (e EventEndBoss) String() string
type EventEndRoom ¶
type EventEndRoom struct {
// contains filtered or unexported fields
}
EventEndRoom is triggered when a dude is near the end part of a room.
func (EventEndRoom) String ¶
func (e EventEndRoom) String() string
type EventEnemyHit ¶
type EventEnemyHit struct {
// contains filtered or unexported fields
}
func (EventEnemyHit) String ¶
func (e EventEnemyHit) String() string
type EventEnterRoom ¶
type EventEnterRoom struct {
// contains filtered or unexported fields
}
EventEnterRoom is triggered when a dude enters a room
func (EventEnterRoom) String ¶
func (e EventEnterRoom) String() string
type EventEquip ¶
type EventEquip struct {
// contains filtered or unexported fields
}
EventEquip is triggered when a dude equips an item
func (EventEquip) String ¶
func (e EventEquip) String() string
type EventGlobalTick ¶
type EventGlobalTick struct{}
EventGlobalTick is triggered every tick
func (EventGlobalTick) String ¶
func (e EventGlobalTick) String() string
type EventGoldGain ¶
type EventGoldGain struct {
// contains filtered or unexported fields
}
EventGoldGain occurs when a dude gains gold
func (EventGoldGain) String ¶
func (e EventGoldGain) String() string
type EventGoldLoss ¶
type EventGoldLoss struct {
// contains filtered or unexported fields
}
EventGoldGain occurs when a dude gains gold
func (EventGoldLoss) String ¶
func (e EventGoldLoss) String() string
type EventLeaveRoom ¶
type EventLeaveRoom struct {
// contains filtered or unexported fields
}
EventLeaveRoom is triggered when a dude leaves a room
func (EventLeaveRoom) String ¶
func (e EventLeaveRoom) String() string
type EventSell ¶
type EventSell struct {
// contains filtered or unexported fields
}
EventSell occurs when an equipment is sold
type EventStartBoss ¶
type EventStartBoss struct {
// contains filtered or unexported fields
}
func (EventStartBoss) String ¶
func (e EventStartBoss) String() string
type EventUnequip ¶
type EventUnequip struct {
// contains filtered or unexported fields
}
EventUnequip is triggered when a dude unequips an item
func (EventUnequip) String ¶
func (e EventUnequip) String() string
type EventWaitRoom ¶
type EventWaitRoom struct {
// contains filtered or unexported fields
}
func (EventWaitRoom) String ¶
func (e EventWaitRoom) String() string
type FeedbackKind ¶
type FeedbackPopup ¶
type FeedbackPopup struct {
// contains filtered or unexported fields
}
func MakeFeedbackPopup ¶
func MakeFeedbackPopup() FeedbackPopup
func (*FeedbackPopup) Draw ¶
func (fp *FeedbackPopup) Draw(o *render.Options)
func (*FeedbackPopup) Layout ¶
func (fp *FeedbackPopup) Layout(o *UIOptions)
func (*FeedbackPopup) Msg ¶
func (fp *FeedbackPopup) Msg(kind FeedbackKind, text string)
func (*FeedbackPopup) Update ¶
func (fp *FeedbackPopup) Update(o *UIOptions)
type FloatingText ¶
type FloatingText struct { render.Originable render.Positionable YOffset float64 // contains filtered or unexported fields }
func MakeFloatingText ¶
func (*FloatingText) Alive ¶
func (t *FloatingText) Alive() bool
func (*FloatingText) Draw ¶
func (t *FloatingText) Draw(o *render.Options)
func (*FloatingText) Update ¶
func (t *FloatingText) Update()
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func (*Game) AdjustCamera ¶
func (g *Game) AdjustCamera()
func (*Game) AdjustSpeed ¶
func (g *Game) AdjustSpeed()
func (*Game) CheckUI ¶
func (g *Game) CheckUI() (bool, UICheckKind)
func (*Game) CursorPosition ¶ added in v1.1.0
func (*Game) GetAliveDudes ¶
func (*Game) SetAutoplay ¶
func (*Game) ToggleAutoplay ¶
func (g *Game) ToggleAutoplay()
func (*Game) TogglePause ¶
func (g *Game) TogglePause()
func (*Game) UpdateInfo ¶
func (g *Game) UpdateInfo()
type GameInfoPanel ¶
type GameInfoPanel struct {
// contains filtered or unexported fields
}
func MakeGameInfoPanel ¶
func MakeGameInfoPanel() GameInfoPanel
func (*GameInfoPanel) Draw ¶
func (gip *GameInfoPanel) Draw(o *render.Options)
func (*GameInfoPanel) Layout ¶
func (gip *GameInfoPanel) Layout(o *UIOptions)
type GameStateBuild ¶
type GameStateBuild struct {
// contains filtered or unexported fields
}
func (*GameStateBuild) Begin ¶
func (s *GameStateBuild) Begin(g *Game)
func (*GameStateBuild) BuyDude ¶
func (s *GameStateBuild) BuyDude(g *Game)
func (*GameStateBuild) BuyEquipment ¶
func (s *GameStateBuild) BuyEquipment(g *Game)
func (*GameStateBuild) Draw ¶
func (s *GameStateBuild) Draw(g *Game, screen *ebiten.Image)
func (*GameStateBuild) DudeCost ¶
func (s *GameStateBuild) DudeCost(dudeCount int) int
Increase cost of dudes as the game progresses.
func (*GameStateBuild) End ¶
func (s *GameStateBuild) End(g *Game)
func (*GameStateBuild) EquipmentCost ¶
func (s *GameStateBuild) EquipmentCost() int
func (*GameStateBuild) RerollCost ¶
func (s *GameStateBuild) RerollCost() int
func (*GameStateBuild) RerollOptionalRooms ¶
func (s *GameStateBuild) RerollOptionalRooms(g *Game)
Re-roll optional rooms and keep any required rooms
func (*GameStateBuild) RerollRooms ¶
func (s *GameStateBuild) RerollRooms(g *Game)
func (*GameStateBuild) RollRooms ¶
func (s *GameStateBuild) RollRooms(g *Game)
func (*GameStateBuild) SellEquipment ¶
func (s *GameStateBuild) SellEquipment(g *Game, e *Equipment)
func (*GameStateBuild) TryPlaceRoom ¶
func (s *GameStateBuild) TryPlaceRoom(g *Game) PlaceResult
func (*GameStateBuild) Update ¶
func (s *GameStateBuild) Update(g *Game) GameState
type GameStateLose ¶
type GameStateLose struct {
// contains filtered or unexported fields
}
func (*GameStateLose) Begin ¶
func (s *GameStateLose) Begin(g *Game)
func (*GameStateLose) Draw ¶
func (s *GameStateLose) Draw(g *Game, screen *ebiten.Image)
func (*GameStateLose) End ¶
func (s *GameStateLose) End(g *Game)
func (*GameStateLose) Update ¶
func (s *GameStateLose) Update(g *Game) GameState
type GameStatePlay ¶
type GameStatePlay struct {
// contains filtered or unexported fields
}
func (*GameStatePlay) Begin ¶
func (s *GameStatePlay) Begin(g *Game)
func (*GameStatePlay) CollectGold ¶
func (s *GameStatePlay) CollectGold(g *Game)
For all dudes, remove their gold and add it to the player's gold.
func (*GameStatePlay) CollectInventory ¶
func (s *GameStatePlay) CollectInventory(g *Game)
For all dudes, remove their inventory and add it to player's inventory
func (*GameStatePlay) Draw ¶
func (s *GameStatePlay) Draw(g *Game, screen *ebiten.Image)
func (*GameStatePlay) End ¶
func (s *GameStatePlay) End(g *Game)
func (*GameStatePlay) Update ¶
func (s *GameStatePlay) Update(g *Game) GameState
type GameStatePre ¶
type GameStatePre struct {
// contains filtered or unexported fields
}
func (*GameStatePre) Begin ¶
func (s *GameStatePre) Begin(g *Game)
func (*GameStatePre) Draw ¶
func (s *GameStatePre) Draw(g *Game, screen *ebiten.Image)
func (*GameStatePre) End ¶
func (s *GameStatePre) End(g *Game)
func (*GameStatePre) Update ¶
func (s *GameStatePre) Update(g *Game) GameState
type GameStateStart ¶
type GameStateStart struct {
// contains filtered or unexported fields
}
func (*GameStateStart) Begin ¶
func (s *GameStateStart) Begin(g *Game)
func (*GameStateStart) Draw ¶
func (s *GameStateStart) Draw(g *Game, screen *ebiten.Image)
func (*GameStateStart) End ¶
func (s *GameStateStart) End(g *Game)
func (*GameStateStart) Update ¶
func (s *GameStateStart) Update(g *Game) GameState
type GameStateWin ¶
type GameStateWin struct {
// contains filtered or unexported fields
}
func (*GameStateWin) Begin ¶
func (s *GameStateWin) Begin(g *Game)
func (*GameStateWin) Draw ¶
func (s *GameStateWin) Draw(g *Game, screen *ebiten.Image)
func (*GameStateWin) DrawRainbow ¶
func (s *GameStateWin) DrawRainbow(screen *ebiten.Image, t string)
func (*GameStateWin) End ¶
func (s *GameStateWin) End(g *Game)
func (*GameStateWin) Update ¶
func (s *GameStateWin) Update(g *Game) GameState
type HintPopup ¶
type HintPopup struct {
// contains filtered or unexported fields
}
func MakeHintPopup ¶
func MakeHintPopup() HintPopup
type IPerk ¶
type IPerk interface { Check(Event) bool Name() string // Name of the perk String() string // Full name of the perk Description() string Quality() PerkQuality LevelUp(PerkQuality) LevelDown() }
IPerk is our interface for perks that can be applied to equipment, dudes, etc.
func GetRandomPerk ¶
func GetRandomPerk(quality PerkQuality) IPerk
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func AddMessage ¶
func AddMessage(kind MessageKind, text string) *Message
AddMessage adds a message to the message log
func GetMessages ¶
func GetMessages() []*Message
type MessageKind ¶
type MessageKind int
MessageKind is the kind of message that is being sent.
const ( // System Messages MessageDebug MessageKind = iota MessageUnknown MessageNeutral MessageLoot MessageGood MessageBad )
func (*MessageKind) Color ¶
func (mk *MessageKind) Color() color.Color
type MessagePanel ¶
type MessagePanel struct { render.Positionable // contains filtered or unexported fields }
func (*MessagePanel) Draw ¶
func (mp *MessagePanel) Draw(o *render.Options)
func (*MessagePanel) Layout ¶
func (mp *MessagePanel) Layout(o *UIOptions)
func (*MessagePanel) Update ¶
func (mp *MessagePanel) Update(o *UIOptions)
type MoveActivity ¶
type MoveActivity struct {
// contains filtered or unexported fields
}
func (MoveActivity) Apply ¶
func (m MoveActivity) Apply()
func (MoveActivity) Cb ¶
func (m MoveActivity) Cb() func(success bool)
type PanelStyle ¶
type PanelStyle int
const ( PanelStyleNormal PanelStyle = iota PanelStyleInteractive PanelStyleButton PanelStyleButtonDisabled PanelStyleBar PanelStyleTransparent PanelStyleButtonAttached )
type Perk ¶
type Perk struct { IPerk // contains filtered or unexported fields }
func (*Perk) Description ¶
func (*Perk) LevelUp ¶
func (p *Perk) LevelUp(maxQuality PerkQuality)
func (*Perk) Quality ¶
func (p *Perk) Quality() PerkQuality
type PerkFindGold ¶
type PerkFindGold struct {
*Perk
}
PerkFindGold finds gold based upon the quality of the perk. +0.25 per quality level per room.
func (PerkFindGold) Check ¶
func (p PerkFindGold) Check(e Event) bool
func (PerkFindGold) Description ¶
func (p PerkFindGold) Description() string
func (PerkFindGold) Name ¶
func (p PerkFindGold) Name() string
func (PerkFindGold) String ¶
func (p PerkFindGold) String() string
type PerkGoldBoost ¶
type PerkGoldBoost struct {
*Perk
}
PerkGoldBoost increases gold gain
func (PerkGoldBoost) Check ¶
func (p PerkGoldBoost) Check(e Event) bool
func (PerkGoldBoost) Description ¶
func (p PerkGoldBoost) Description() string
func (PerkGoldBoost) Name ¶
func (p PerkGoldBoost) Name() string
func (PerkGoldBoost) String ¶
func (p PerkGoldBoost) String() string
type PerkHealOnCrit ¶
type PerkHealOnCrit struct {
*Perk
}
func (PerkHealOnCrit) Check ¶
func (p PerkHealOnCrit) Check(e Event) bool
func (PerkHealOnCrit) Description ¶
func (p PerkHealOnCrit) Description() string
func (PerkHealOnCrit) Name ¶
func (p PerkHealOnCrit) Name() string
func (PerkHealOnCrit) String ¶
func (p PerkHealOnCrit) String() string
type PerkHealOnDodge ¶
type PerkHealOnDodge struct {
*Perk
}
func (PerkHealOnDodge) Check ¶
func (p PerkHealOnDodge) Check(e Event) bool
func (PerkHealOnDodge) Description ¶
func (p PerkHealOnDodge) Description() string
func (PerkHealOnDodge) Name ¶
func (p PerkHealOnDodge) Name() string
func (PerkHealOnDodge) String ¶
func (p PerkHealOnDodge) String() string
type PerkHealOnGoldGain ¶
type PerkHealOnGoldGain struct {
*Perk
}
PerkHealOnGoldGain heals dude when they get gold
func (PerkHealOnGoldGain) Check ¶
func (p PerkHealOnGoldGain) Check(e Event) bool
func (PerkHealOnGoldGain) Description ¶
func (p PerkHealOnGoldGain) Description() string
func (PerkHealOnGoldGain) Name ¶
func (p PerkHealOnGoldGain) Name() string
func (PerkHealOnGoldGain) String ¶
func (p PerkHealOnGoldGain) String() string
type PerkHealOnGoldLoss ¶
type PerkHealOnGoldLoss struct {
*Perk
}
PerkHealOnGoldGain heals dude when they get gold
func (PerkHealOnGoldLoss) Check ¶
func (p PerkHealOnGoldLoss) Check(e Event) bool
func (PerkHealOnGoldLoss) Description ¶
func (p PerkHealOnGoldLoss) Description() string
func (PerkHealOnGoldLoss) Name ¶
func (p PerkHealOnGoldLoss) Name() string
func (PerkHealOnGoldLoss) String ¶
func (p PerkHealOnGoldLoss) String() string
type PerkHealOnRoomEnter ¶
type PerkHealOnRoomEnter struct {
*Perk
}
PerkHeal heals dude based on wisdom when entering a room.
func (PerkHealOnRoomEnter) Check ¶
func (p PerkHealOnRoomEnter) Check(e Event) bool
func (PerkHealOnRoomEnter) Description ¶
func (p PerkHealOnRoomEnter) Description() string
func (PerkHealOnRoomEnter) Name ¶
func (p PerkHealOnRoomEnter) Name() string
func (PerkHealOnRoomEnter) String ¶
func (p PerkHealOnRoomEnter) String() string
type PerkHealOnSell ¶
type PerkHealOnSell struct {
*Perk
}
PerkHealOnSell heals all dudes based on quality when equip is sold
func (PerkHealOnSell) Check ¶
func (p PerkHealOnSell) Check(e Event) bool
func (PerkHealOnSell) Description ¶
func (p PerkHealOnSell) Description() string
func (PerkHealOnSell) Name ¶
func (p PerkHealOnSell) Name() string
func (PerkHealOnSell) String ¶
func (p PerkHealOnSell) String() string
type PerkNone ¶
type PerkNone struct {
Perk
}
PerkNone represents an empty perk. Not sure if this will be used.
func (PerkNone) Quality ¶
func (p PerkNone) Quality() PerkQuality
type PerkQuality ¶
type PerkQuality int
PerkQuality is the quality of a given perk.
const ( PerkQualityTrash PerkQuality = iota PerkQualityPathetic PerkQualityLesser PerkQualityCommon PerkQualityGreater PerkQualityGodly )
func (*PerkQuality) String ¶
func (pq *PerkQuality) String() string
func (PerkQuality) TextColor ¶
func (pq PerkQuality) TextColor() color.Color
type PerkStatBoost ¶
type PerkStatBoost struct { *Perk // contains filtered or unexported fields }
PerkStatBoost is a perk that modifies a stat based on teh quality of the perk. +1 target stat per quality level.
func (PerkStatBoost) Check ¶
func (p PerkStatBoost) Check(e Event) bool
func (PerkStatBoost) Description ¶
func (p PerkStatBoost) Description() string
func (PerkStatBoost) Name ¶
func (p PerkStatBoost) Name() string
func (PerkStatBoost) String ¶
func (p PerkStatBoost) String() string
type PerkStickyFingers ¶
type PerkStickyFingers struct {
*Perk
}
PerkStickyFingers reduces gold loss
func (PerkStickyFingers) Check ¶
func (p PerkStickyFingers) Check(e Event) bool
func (PerkStickyFingers) Description ¶
func (p PerkStickyFingers) Description() string
func (PerkStickyFingers) Name ¶
func (p PerkStickyFingers) Name() string
func (PerkStickyFingers) String ¶
func (p PerkStickyFingers) String() string
type PlaceResult ¶
type PlaceResult int
const ( PlaceResultSuccess PlaceResult = iota PlaceResultFail PlaceResultBroke PlaceResultTake )
type Profession ¶
type Profession struct {
// contains filtered or unexported fields
}
A profession defines a dude's abilities. It also defines the dude's appearance.
func NewProfession ¶
func NewProfession(kind ProfessionKind, level int) *Profession
func (*Profession) Description ¶
func (p *Profession) Description() string
func (*Profession) StartingEquipment ¶
func (p *Profession) StartingEquipment() []*Equipment
func (*Profession) StartingStats ¶
func (p *Profession) StartingStats() Stats
func (*Profession) String ¶
func (p *Profession) String() string
type ProfessionKind ¶
type ProfessionKind string
ProfessionKind is an enumeration of the different kinds of Professions a dude can have
const ( // Medium defense, medium attack, medium hp Vagabond ProfessionKind = "vagabond" // High defense, low attack, high hp Knight ProfessionKind = "knight" // Low defense, low attack, *can heal* Cleric ProfessionKind = "cleric" // Medium defense, high attack, low hp *ranged* Ranger ProfessionKind = "ranger" )
func RandomProfessionKind ¶
func RandomProfessionKind() ProfessionKind
func WeightedRandomProfessionKind ¶
func WeightedRandomProfessionKind(dudes []*Dude) ProfessionKind
WeightedRandomProfessionKind returns a profession kind based on the dudes' professions The lower the frequency of a profession, the higher the weight
func (*ProfessionKind) String ¶
func (p *ProfessionKind) String() string
type Room ¶
type Room struct {
// contains filtered or unexported fields
}
Room is a room within a story of za toweru.
func (*Room) AddDudeToCenter ¶
func (*Room) AddDudeToWaiting ¶
func (*Room) AreAllDudesWaiting ¶
func (*Room) GetRoomEffect ¶
func (*Room) IsDudeInCenter ¶
func (*Room) IsDudeWaiting ¶
func (*Room) RemoveDude ¶
func (*Room) RemoveDudeFromCenter ¶
func (*Room) RemoveDudesFromWaiting ¶
func (r *Room) RemoveDudesFromWaiting()
func (*Room) RollLoot ¶
Roll for new equipment from list Modifies the equipment by luck stat and room height Luck and room level determines chance of finding equipment, harder to find at higher levels Luck determines the quality
func (*Room) Update ¶
func (r *Room) Update(req *ActivityRequests, g *Game)
Update updates the stuff in the room.
type RoomBossCombatActivity ¶
type RoomBossCombatActivity struct {
// contains filtered or unexported fields
}
func (RoomBossCombatActivity) Apply ¶
func (r RoomBossCombatActivity) Apply()
func (RoomBossCombatActivity) Cb ¶
func (r RoomBossCombatActivity) Cb() func(success bool)
type RoomCenterActivity ¶
type RoomCenterActivity struct {
// contains filtered or unexported fields
}
func (RoomCenterActivity) Apply ¶
func (r RoomCenterActivity) Apply()
func (RoomCenterActivity) Cb ¶
func (r RoomCenterActivity) Cb() func(success bool)
type RoomCombatActivity ¶
type RoomCombatActivity struct {
// contains filtered or unexported fields
}
func (RoomCombatActivity) Apply ¶
func (r RoomCombatActivity) Apply()
func (RoomCombatActivity) Cb ¶
func (r RoomCombatActivity) Cb() func(success bool)
type RoomDef ¶
type RoomDef struct {
// contains filtered or unexported fields
}
RoomDef is used for providing the visuals for placing a room. It renders a stack at a pitch of 1 to a new image and stores that image for use during rendering.
func GetOptionalRooms ¶
Returns an amount of rooms until the given size/space count is reached.
func GetRequiredRooms ¶
For populating the required rooms to place Number of bad rooms based on requested size count. Every 3 stories is a boss room.
func (*RoomDef) GetDescription ¶
type RoomEndActivity ¶
type RoomEndActivity struct {
// contains filtered or unexported fields
}
func (RoomEndActivity) Apply ¶
func (r RoomEndActivity) Apply()
func (RoomEndActivity) Cb ¶
func (r RoomEndActivity) Cb() func(success bool)
type RoomEndBossActivity ¶
type RoomEndBossActivity struct {
// contains filtered or unexported fields
}
func (RoomEndBossActivity) Apply ¶
func (r RoomEndBossActivity) Apply()
func (RoomEndBossActivity) Cb ¶
func (r RoomEndBossActivity) Cb() func(success bool)
type RoomEnterActivity ¶
type RoomEnterActivity struct {
// contains filtered or unexported fields
}
func (RoomEnterActivity) Apply ¶
func (r RoomEnterActivity) Apply()
func (RoomEnterActivity) Cb ¶
func (r RoomEnterActivity) Cb() func(success bool)
type RoomInfoPanel ¶
type RoomInfoPanel struct {
// contains filtered or unexported fields
}
func MakeRoomInfoPanel ¶
func MakeRoomInfoPanel() RoomInfoPanel
func (*RoomInfoPanel) Check ¶
func (rip *RoomInfoPanel) Check(mx, my float64, kind UICheckKind) bool
func (*RoomInfoPanel) Draw ¶
func (rip *RoomInfoPanel) Draw(o *render.Options)
func (*RoomInfoPanel) Layout ¶
func (rip *RoomInfoPanel) Layout(o *UIOptions)
func (*RoomInfoPanel) Update ¶
func (rip *RoomInfoPanel) Update(o *UIOptions)
type RoomKind ¶
type RoomKind int
RoomKind is an enumeration of the different kinds of rooms in za toweru.
const ( Empty RoomKind = iota // Stairs // Armory provide... armor up? damage up? Maybe should be different types. Armory // Healing shrine heals the adventurers over time. HealingShrine // Combat is where it goes down. $$$ is acquired. Combat // Well restores magic items? Well // Treasure room - $$$ Treasure // Library - enchant Library // Curse - % to curse dude Curse // Trap - % to damage dude based on stats Trap // Boss room Boss // Marker for the end... allows for iteration RoomKindEnd )
func (*RoomKind) GetRoomEnemy ¶
type RoomLeaveActivity ¶
type RoomLeaveActivity struct {
// contains filtered or unexported fields
}
func (RoomLeaveActivity) Apply ¶
func (r RoomLeaveActivity) Apply()
func (RoomLeaveActivity) Cb ¶
func (r RoomLeaveActivity) Cb() func(success bool)
type RoomPanel ¶
type RoomPanel struct {
// contains filtered or unexported fields
}
func MakeRoomPanel ¶
func MakeRoomPanel() RoomPanel
func (*RoomPanel) SetRoomDefs ¶
type RoomSize ¶
type RoomSize int
RoomSize represents the different sizes of rooms, with 1 equating to 1/8th of a circle.
type RoomStartBossActivity ¶
type RoomStartBossActivity struct {
// contains filtered or unexported fields
}
func (RoomStartBossActivity) Apply ¶
func (r RoomStartBossActivity) Apply()
func (RoomStartBossActivity) Cb ¶
func (r RoomStartBossActivity) Cb() func(success bool)
type RoomTemplate ¶
type RoomTemplate struct {
// contains filtered or unexported fields
}
type RoomWaitActivity ¶
type RoomWaitActivity struct {
// contains filtered or unexported fields
}
func (RoomWaitActivity) Apply ¶
func (r RoomWaitActivity) Apply()
func (RoomWaitActivity) Cb ¶
func (r RoomWaitActivity) Cb() func(success bool)
type SpeedPanel ¶
type SpeedPanel struct { render.Positionable render.Sizeable // contains filtered or unexported fields }
func MakeSpeedPanel ¶
func MakeSpeedPanel() SpeedPanel
func (*SpeedPanel) Check ¶
func (sp *SpeedPanel) Check(mx, my float64, kind UICheckKind) bool
func (*SpeedPanel) Draw ¶
func (sp *SpeedPanel) Draw(o *render.Options)
func (*SpeedPanel) Layout ¶
func (sp *SpeedPanel) Layout(parent UIElement, o *UIOptions)
func (*SpeedPanel) Update ¶
func (sp *SpeedPanel) Update(o *UIOptions)
type Stat ¶
type Stat string
A dude's inherent capability to deal with their environment (how they survive dem rooms)
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
func (*Stats) ApplyDefense ¶
func (*Stats) LevelDown ¶
func (s *Stats) LevelDown()
ApplyLevelDown applies the level down changes to the stats
func (*Stats) LevelUp ¶
ApplyLevelUp applies the level up changes to the stats with some variance depend on wisdom
func (*Stats) ModifyStat ¶
type StereoPanStream ¶
type StereoPanStream struct { io.ReadSeeker // contains filtered or unexported fields }
StereoPanStream is an audio buffer that changes the stereo channel's signal based on the Panning.
func NewStereoPanStream ¶
func NewStereoPanStream(src io.ReadSeeker) *StereoPanStream
NewStereoPanStream returns a new StereoPanStream with a buffered src.
The src's format must be linear PCM (16bits little endian, 2 channel stereo) without a header (e.g. RIFF header). The sample rate must be same as that of the audio context.
func (*StereoPanStream) Pan ¶
func (s *StereoPanStream) Pan() float64
func (*StereoPanStream) SetPan ¶
func (s *StereoPanStream) SetPan(pan float64)
type Story ¶
type Story struct {
// contains filtered or unexported fields
}
Story is a single story in the tower. It contains rooms.
func NewStoryWithSize ¶
func (*Story) AddText ¶
func (s *Story) AddText(t FloatingText)
func (*Story) AngleFromCenter ¶
func (*Story) Complete ¶
Complete returns if the story is considered complete based upon full room saturation.
func (*Story) DistanceFromCenter ¶
func (*Story) GetRoomCenterRad ¶
func (*Story) Open ¶
func (s *Story) Open()
Open marks the story as being open. This activates full updates and rendering.
func (*Story) PlaceRoom ¶
PlaceRoom places a room in the story, populating the rooms slice's pointer references accordingly.
func (*Story) PositionFromCenter ¶
func (*Story) RemoveClouds ¶
func (s *Story) RemoveClouds()
func (*Story) RemoveDoor ¶
func (s *Story) RemoveDoor()
func (*Story) RemoveDude ¶
func (*Story) RemovePortal ¶
func (s *Story) RemovePortal()
func (*Story) RemoveRoom ¶
RemoveRoom removes the room at the given index. This function always gets the "head" of the room and removes its size, regardless of if the target index is not the head.
func (*Story) RoomIndexFromAngle ¶
RoomIndexFromAngle returns the room index based upon the radians provided.
func (*Story) Update ¶
func (s *Story) Update(req *ActivityRequests, g *Game)
Update updates the rooms.
type StoryEnterNextActivity ¶
type StoryEnterNextActivity struct {
// contains filtered or unexported fields
}
func (StoryEnterNextActivity) Apply ¶
func (s StoryEnterNextActivity) Apply()
func (StoryEnterNextActivity) Cb ¶
func (s StoryEnterNextActivity) Cb() func(success bool)
type Tower ¶
type Tower struct { render.Positionable // I guess it's okay to re-use this in such a fashion. Stories []*Story // contains filtered or unexported fields }
Tower is our glorious tower :o
func (*Tower) AddDude ¶
AddDude adds a new dude at the lowest story of the tower and assigns the dude's appropriate activity state.
func (*Tower) ClearBodies ¶
func (t *Tower) ClearBodies()
func (*Tower) ClearTexts ¶
func (t *Tower) ClearTexts()
func (*Tower) HasAliveDudes ¶
func (*Tower) RemoveDude ¶
type TowerCompleteActivity ¶
type TowerCompleteActivity struct {
// contains filtered or unexported fields
}
func (TowerCompleteActivity) Apply ¶
func (t TowerCompleteActivity) Apply()
func (TowerCompleteActivity) Cb ¶
func (t TowerCompleteActivity) Cb() func(success bool)
type TowerLeaveActivity ¶
type TowerLeaveActivity struct {
// contains filtered or unexported fields
}
func (TowerLeaveActivity) Apply ¶
func (t TowerLeaveActivity) Apply()
func (TowerLeaveActivity) Cb ¶
func (t TowerLeaveActivity) Cb() func(success bool)
type UIButton ¶
type UIButton struct { render.Positionable render.Sizeable // contains filtered or unexported fields }
======== BUTTON ========
func NewUIButton ¶
func (*UIButton) SetPosition ¶
type UICheckKind ¶
type UICheckKind int
const ( UICheckNone UICheckKind = iota UICheckHover UICheckClick )
type UIElement ¶
type UIElement interface { Position() (float64, float64) SetPosition(float64, float64) Size() (float64, float64) SetSize(float64, float64) X() float64 Y() float64 Width() float64 Height() float64 Layout(parent UIElement, o *UIOptions) Draw(o *render.Options) Update(o *UIOptions) Check(float64, float64, UICheckKind) bool }
type UIImage ¶
type UIImage struct { render.Positionable render.Sizeable // contains filtered or unexported fields }
func NewUIImage ¶
func NewUIImage(img *ebiten.Image) *UIImage
type UIItemList ¶
type UIItemList struct { render.Positionable render.Sizeable // contains filtered or unexported fields }
func NewUIItemList ¶
func NewUIItemList(direction int) *UIItemList
func (*UIItemList) AddItem ¶
func (l *UIItemList) AddItem(item UIElement)
func (*UIItemList) Check ¶
func (l *UIItemList) Check(mx, my float64, kind UICheckKind) bool
func (*UIItemList) Clear ¶
func (l *UIItemList) Clear()
func (*UIItemList) Draw ¶
func (l *UIItemList) Draw(o *render.Options)
func (*UIItemList) Layout ¶
func (l *UIItemList) Layout(parent UIElement, o *UIOptions)
func (*UIItemList) RemoveItemByIndex ¶
func (l *UIItemList) RemoveItemByIndex(index int)
func (*UIItemList) Update ¶
func (l *UIItemList) Update(o *UIOptions)
type UIOptions ¶
func (UIOptions) CoordsToScreen ¶
type UIPanel ¶
type UIPanel struct { render.Positionable render.Sizeable // contains filtered or unexported fields }
======== UIPanel ========
func NewUIPanel ¶
func NewUIPanel(style PanelStyle) *UIPanel
func (*UIPanel) RemoveChild ¶
func (*UIPanel) SetStyle ¶
func (p *UIPanel) SetStyle(style PanelStyle)