Documentation
¶
Index ¶
- Constants
- Variables
- type Action
- type BaseStats
- type CombatTargetType
- type IconDefs
- type Icons
- type Item
- type ItemIndex
- type ItemTarget
- type ItemType
- type Mod
- type Modifier
- type SpecialItem
- type Stats
- type StatsGrowthT
- type UseAction
- type World
- func (w *World) AddItem(itemId, count int)
- func (w *World) AddKeyItem(itemId int)
- func (w World) DrawItem(a ...interface{})
- func (w *World) FilterItems(predicate ItemType) []ItemIndex
- func (w *World) Get(idx ItemIndex) Item
- func (w World) GetItemsAsStrings() []string
- func (w World) GetKeyItemsAsStrings() []string
- func (w World) GoldAsString() string
- func (w *World) HasKey(id int) bool
- func (w *World) RemoveItem(itemId, count int)
- func (w *World) RemoveKeyItem(itemId int)
- func (w World) TimeAsString() string
- func (w *World) Update(dt float64)
Constants ¶
View Source
const ( Any = "Any" MostHurtParty = "MostHurtParty" //lowest HP that is below their max HP value. MostDrainedParty = "MostDrainedParty" //lowest MP MostHurtEnemy = "MostHurtEnemy" DeadParty = "DeadParty" RandomAlivePlayer = "RandomAlivePlayer" WeakestEnemy = "WeakestEnemy" SideEnemy = "SideEnemy" SelectAll = "SelectAll" )
below should match to Key of Co
View Source
const ( SpecialSlash = "Slash" SpecialSteal = "Steal" )
View Source
const ( SpellFire = "Fire" SpellBurn = "Burn" SpellIce = "Ice" SpellBolt = "Bolt" )
Variables ¶
View Source
var ItemsDB = make(map[int]Item)
View Source
var SpecialsDB = map[string]SpecialItem{ SpecialSlash: { Name: "Slash", MpCost: 15, Action: ElementSlash, TimePoints: 10, Target: ItemTarget{ Selector: SideEnemy, SwitchSides: false, Type: CombatTargetTypeSIDE, }, }, SpecialSteal: { Name: "Steal", MpCost: 0, Action: ElementSteal, TimePoints: 10, Target: ItemTarget{ Selector: WeakestEnemy, SwitchSides: false, Type: CombatTargetTypeONE, }, }, }
View Source
var SpellsDB = map[string]SpecialItem{ SpellFire: { Name: "Fire", Action: ElementSpell, Element: SpellFire, MpCost: 8, CastTime: 0.7, BaseDamage: [2]float64{3, 5}, BaseHitChance: 1, TimePoints: 10, Target: ItemTarget{ Selector: WeakestEnemy, SwitchSides: true, Type: CombatTargetTypeONE, }, }, SpellBurn: { Name: "Burn", Action: ElementSpell, Element: SpellFire, MpCost: 16, CastTime: 0.9, BaseDamage: [2]float64{3, 6}, BaseHitChance: 1, TimePoints: 20, Target: ItemTarget{ Selector: SideEnemy, SwitchSides: true, Type: CombatTargetTypeSIDE, }, }, SpellIce: { Name: "Ice", Action: ElementSpell, Element: SpellIce, MpCost: 8, CastTime: 1, BaseDamage: [2]float64{7, 17}, BaseHitChance: 1, TimePoints: 10, Target: ItemTarget{ Selector: WeakestEnemy, SwitchSides: true, Type: CombatTargetTypeONE, }, }, SpellBolt: { Name: "Electric bolt", Action: ElementSpell, Element: SpellBolt, MpCost: 8, CastTime: 0.5, BaseDamage: [2]float64{4, 14}, BaseHitChance: 1, TimePoints: 10, Target: ItemTarget{ Selector: WeakestEnemy, SwitchSides: true, Type: CombatTargetTypeONE, }, }, }
spell cast time 1 is base, 2 is twice as long etc
View Source
var StatsGrowth = StatsGrowthT{ Fast: dice.Create("3d2"), Med: dice.Create("1d3"), Slow: dice.Create("1d2"), }
Functions ¶
This section is empty.
Types ¶
type CombatTargetType ¶
type CombatTargetType int
const ( CombatTargetTypeONE CombatTargetType = iota CombatTargetTypeSIDE CombatTargetTypeALL )
type IconDefs ¶
type IconDefs struct {
Usable,
Accessory,
Weapon,
Sword,
Dagger,
Stave,
Armor,
Plate,
Leather,
Robe,
UpArrow,
DownArrow int
}
type Icons ¶
type Icons struct {
Texture pixel.Picture
UVs []pixel.Rect
Sprites []*pixel.Sprite
IconDefs IconDefs
}
var IconsDB Icons
func IconsCreate ¶
func IconsCreate() Icons
type Item ¶
type Item struct {
Id int
ItemType ItemType
Name, Description string
Special bool
Stats Mod
Restrictions []string //e.g. {"hero","mage",}
Use UseAction
Icon int
Oddment float64 //chances of finding
}
• Key Item - a special item, usually required to progress past a certain part of the game. • Weapon - an item that can be equipped and has properties related to inflicting damage.
type ItemTarget ¶
type ItemTarget struct {
Selector string
SwitchSides bool
Type CombatTargetType
}
type SpecialItem ¶
type SpecialItem struct {
Name string
Action Action
Element string
MpCost,
CastTime,
BaseHitChance,
TimePoints float64
BaseDamage [2]float64 // multiplied by level
Target ItemTarget
Counter bool
}
SpecialItem Damage = Spell Power * 4 + (Level * Magic Power * Spell Power / 32)
type Stats ¶
func StatsCreate ¶
func (*Stats) AddModifier ¶
AddModifier
magic_sword := Modifier{
UniqueId: 1,
Mod: Mod{
Add: BaseStats{
Strength: 5,
Speed: 5,
},
},
}
func (Stats) GetBaseStat ¶
func (*Stats) RemoveModifier ¶
type StatsGrowthT ¶
type UseAction ¶
type UseAction struct {
Action Action
Restore float64
Target ItemTarget
Hint string
}
type World ¶
type World struct {
Time, Gold float64
Items, KeyItems []ItemIndex
//Party check world_extended.go
Icons Icons
}
func (*World) AddKeyItem ¶
func (*World) FilterItems ¶
func (World) GetItemsAsStrings ¶
func (World) GetKeyItemsAsStrings ¶
func (World) GoldAsString ¶
func (*World) RemoveItem ¶
func (*World) RemoveKeyItem ¶
func (World) TimeAsString ¶
Click to show internal directories.
Click to hide internal directories.