Documentation ¶
Index ¶
- Variables
- func CanStack(source, destination IItem) bool
- func CheckColisionBetweenFrames(x1Old, y1Old, z1Old, x1New, y1New, z1New float32, cylinder1 []*Cylinder, ...) bool
- func Distance2D(v1 *math32.Vector3, v2 *math32.Vector3) float32
- func FilterEnemy(v interface{}) bool
- func FilterEvil(v interface{}) bool
- func FilterGood(v interface{}) bool
- func FilterPlayer(v interface{}) bool
- func NormalizeAngle(a float32) float32
- func ShortestDistanceBetweenLines(x1Old, z1Old, x1New, z1New, x2Old, z2Old, x2New, z2New float32) float32
- func Stack(source, destination IItem)
- type AmmoType
- type Attack
- func (e *Attack) Colision() []*Cylinder
- func (e *Attack) Hit(c ICharacter, delta float32)
- func (e *Attack) InnerEntity() IEntity
- func (e *Attack) Node() model.INode
- func (e *Attack) PostTick(delta float32)
- func (e *Attack) PreTick()
- func (e *Attack) Reach() float32
- func (e *Attack) SetReach(v float32)
- func (e *Attack) SetTargetFilter(v Filter)
- func (e *Attack) TargetFilter() Filter
- func (e *Attack) Tick(delta float32)
- type BodyType
- type Character
- func (e *Character) AddDontPickUpUntilFar(item IItem)
- func (e *Character) Attack(delta float32)
- func (e *Character) AttackAnimationSpeed() float32
- func (e *Character) Damaged(damage float32)
- func (e *Character) DontPickUpUntilFarDistance() float32
- func (e *Character) HandHeight() float32
- func (e *Character) InnerEntity() IEntity
- func (e *Character) IsAttacking() bool
- func (e *Character) IsJumping() bool
- func (e *Character) Jump()
- func (e *Character) JumpMoveFactor() float32
- func (e *Character) LookIntention() float32
- func (e *Character) MoveIntention() *math32.Vector3
- func (e *Character) OuterDistanceTo(c ICharacter) float32
- func (e *Character) PickUp(IItem)
- func (e *Character) PostTick(delta float32)
- func (e *Character) PreTick()
- func (e *Character) PushFactor() float32
- func (e *Character) PushForce() float32
- func (e *Character) RepeatJump()
- func (e *Character) SetAttackAnimationSpeed(v float32)
- func (e *Character) SetAttacking(v bool)
- func (e *Character) SetDontPickUpUntilFarDistance(v float32)
- func (e *Character) SetHandHeight(v float32)
- func (e *Character) SetJumpMoveFactor(v float32)
- func (e *Character) SetJumping(v bool)
- func (e *Character) SetLookIntention(v float32)
- func (e *Character) SetPushFactor(v float32)
- func (e *Character) SetPushForce(v float32)
- func (e *Character) SetTargetFilter(v Filter)
- func (e *Character) SetWalkAnimationSpeed(v float32)
- func (e *Character) SetWalkAnimationWhenStopping(v float32)
- func (e *Character) StyleEquipables() map[SlotId]IEquipable
- func (e *Character) TargetFilter() Filter
- func (e *Character) Think()
- func (e *Character) Tick(delta float32)
- func (e *Character) WalkAnimationSpeed() float32
- func (e *Character) WalkAnimationWhenStopping() float32
- func (e *Character) WantToAttack() bool
- func (e *Character) WantToPickUp(item IItem) bool
- func (e *Character) WantToRepeatAttack() bool
- type Consumable
- type CountableId
- type Cylinder
- type DrawSlotId
- type Entity
- func (e *Entity) Acceleration() float32
- func (e *Entity) BorderDistanceTo(c IEntity) float32
- func (e *Entity) CenterDistanceTo(c IEntity) float32
- func (e *Entity) ClimbRadius() float32
- func (e *Entity) ClimbReach() float32
- func (e *Entity) Colision() []*Cylinder
- func (e *Entity) Damageable() bool
- func (e *Entity) Damaged(damage float32)
- func (e *Entity) Destroy()
- func (e *Entity) Destroyed() bool
- func (e *Entity) FallingToVoidPosition() (v *math32.Vector3)
- func (e *Entity) FormerPosition() *math32.Vector3
- func (e *Entity) Friction() float32
- func (e *Entity) Generate() []IEntity
- func (e *Entity) Gravity(v float32)
- func (e *Entity) Healed(points float32)
- func (e *Entity) Health() float32
- func (e *Entity) Height() float32
- func (e *Entity) HorizontalSpeed() float32
- func (e *Entity) LookAngle() float32
- func (e *Entity) MaxHealth() float32
- func (e *Entity) MaxHorizontalSpeed() float32
- func (e *Entity) MaxSpeed() float32
- func (e *Entity) MinHorizontalSpeed() float32
- func (e *Entity) Name() string
- func (e *Entity) Node() model.INode
- func (e *Entity) OnGround() bool
- func (e *Entity) OuterRadius() float32
- func (e *Entity) Position() *math32.Vector3
- func (e *Entity) PostTick(delta float32)
- func (e *Entity) PreTick()
- func (e *Entity) Radius() float32
- func (e *Entity) RotationHorizontalSpeed() float32
- func (e *Entity) SetAcceleration(v float32)
- func (e *Entity) SetClimbRadius(v float32)
- func (e *Entity) SetClimbReach(v float32)
- func (e *Entity) SetDamageable(v bool)
- func (e *Entity) SetFallingToVoidPosition(v *math32.Vector3)
- func (e *Entity) SetFriction(v float32)
- func (e *Entity) SetHealth(v float32)
- func (e *Entity) SetHeight(v float32)
- func (e *Entity) SetLookAngle(v float32)
- func (e *Entity) SetMaxHealth(v float32)
- func (e *Entity) SetMaxSpeed(v float32)
- func (e *Entity) SetMinSpeed(v float32)
- func (e *Entity) SetOnGround(v bool)
- func (e *Entity) SetOuterRadius(v float32)
- func (e *Entity) SetRadius(v float32)
- func (e *Entity) SetRotationSpeed(v float32)
- func (e *Entity) SetShadowOpacity(v float32)
- func (e *Entity) SetSpeed(v float32)
- func (e *Entity) ShadowNode() model.INode
- func (e *Entity) ShadowOpacity() float32
- func (e *Entity) Speed() *math32.Vector3
- func (e *Entity) Tick(delta float32)
- type Equipable
- func (e *Equipable) AllowRepeat() bool
- func (e *Equipable) AttackValue() int
- func (e *Equipable) BodyType() BodyType
- func (e *Equipable) CoverDrawSlots() []DrawSlotId
- func (e *Equipable) DefenseValue() int
- func (e *Equipable) IsTwoHanded() bool
- func (e *Equipable) SetAllowRepeat(v bool)
- func (e *Equipable) SetAttackValue(v int)
- func (e *Equipable) SetCoverDrawSlots(v []DrawSlotId)
- func (e *Equipable) SetDefenseValue(v int)
- func (e *Equipable) SetTwoHanded(v bool)
- type Filter
- type IAttack
- type ICharacter
- type IConsumable
- type IEnemy
- type IEntity
- type IEquipable
- type IEvil
- type IGood
- type IInventory
- type IItem
- type IPlayer
- type ITickable
- type Item
- func (e *Item) Category() ItemCategory
- func (e *Item) Count() int
- func (e *Item) CountableId() CountableId
- func (e *Item) InnerEntity() IEntity
- func (e *Item) IsCountable() bool
- func (e *Item) IsPickupable() bool
- func (e *Item) ItemType() ItemType
- func (e *Item) PostTick(delta float32)
- func (e *Item) PreTick()
- func (e *Item) ProvidesAmmo() AmmoType
- func (e *Item) RequiresAmmo() AmmoType
- func (e *Item) SetCategory(v ItemCategory)
- func (e *Item) SetCount(v int)
- func (e *Item) SetCountableId(countableId CountableId)
- func (e *Item) SetProvidesAmmo(v AmmoType)
- func (e *Item) SetRequiresAmmo(v AmmoType)
- func (e *Item) Tick(delta float32)
- func (e *Item) WaitBeforePickupable(seconds float32)
- type ItemCategory
- type ItemType
- type RelativeCylinder
- type SimpleCylinder
- type SlotId
Constants ¶
This section is empty.
Variables ¶
View Source
var Artifact = ItemCategory{}
View Source
var Common = ItemCategory{}
View Source
var Rare = ItemCategory{}
Functions ¶
func FilterEnemy ¶
func FilterEnemy(v interface{}) bool
func FilterEvil ¶
func FilterEvil(v interface{}) bool
func FilterGood ¶
func FilterGood(v interface{}) bool
func FilterPlayer ¶
func FilterPlayer(v interface{}) bool
func NormalizeAngle ¶
Types ¶
type Attack ¶
type Attack struct { Entity // contains filtered or unexported fields }
func NewAttack ¶
func NewAttack(p *Entity, targetFilter Filter, attackColision []*RelativeCylinder, damage float32) *Attack
func (*Attack) Hit ¶
func (e *Attack) Hit(c ICharacter, delta float32)
func (*Attack) InnerEntity ¶
func (*Attack) SetTargetFilter ¶
func (*Attack) TargetFilter ¶
type Character ¶
type Character struct { Entity // contains filtered or unexported fields }
func NewCharacter ¶
func (*Character) AddDontPickUpUntilFar ¶
func (*Character) AttackAnimationSpeed ¶
func (*Character) DontPickUpUntilFarDistance ¶
func (*Character) HandHeight ¶
func (*Character) InnerEntity ¶
func (*Character) IsAttacking ¶
func (*Character) JumpMoveFactor ¶
func (*Character) LookIntention ¶
func (*Character) MoveIntention ¶
func (*Character) OuterDistanceTo ¶
func (e *Character) OuterDistanceTo(c ICharacter) float32
func (*Character) PushFactor ¶
func (*Character) RepeatJump ¶
func (e *Character) RepeatJump()
func (*Character) SetAttackAnimationSpeed ¶
func (*Character) SetAttacking ¶
func (*Character) SetDontPickUpUntilFarDistance ¶
func (*Character) SetHandHeight ¶
func (*Character) SetJumpMoveFactor ¶
func (*Character) SetJumping ¶
func (*Character) SetLookIntention ¶
func (*Character) SetPushFactor ¶
func (*Character) SetPushForce ¶
func (*Character) SetTargetFilter ¶
func (*Character) SetWalkAnimationSpeed ¶
func (*Character) SetWalkAnimationWhenStopping ¶
func (*Character) StyleEquipables ¶
func (e *Character) StyleEquipables() map[SlotId]IEquipable
func (*Character) TargetFilter ¶
func (*Character) WalkAnimationSpeed ¶
func (*Character) WalkAnimationWhenStopping ¶
func (*Character) WantToAttack ¶
func (*Character) WantToPickUp ¶
func (*Character) WantToRepeatAttack ¶
type Consumable ¶
type Consumable struct {
Item
}
func NewConsumable ¶
func NewConsumable(i *Item) *Consumable
func (*Consumable) Consume ¶
func (c *Consumable) Consume()
type CountableId ¶
type CountableId string
type Cylinder ¶
type Cylinder struct { X float32 Y float32 Z float32 SimpleCylinder *SimpleCylinder }
Cylinder is a simple cylinder somewhere in the 3D space.
func RelativeToAbsolute ¶
func RelativeToAbsolute(r *RelativeCylinder, lookAngle float32) *Cylinder
func RelativeToAbsoluteList ¶
func RelativeToAbsoluteList(r []*RelativeCylinder, lookAngle float32) []*Cylinder
func SimpleToAbsolute ¶
func SimpleToAbsolute(s *SimpleCylinder) *Cylinder
func SimpleToAbsoluteList ¶
func SimpleToAbsoluteList(s []*SimpleCylinder) []*Cylinder
type DrawSlotId ¶
type DrawSlotId string
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
func (*Entity) Acceleration ¶
func (*Entity) BorderDistanceTo ¶
func (*Entity) CenterDistanceTo ¶
func (*Entity) ClimbRadius ¶
func (*Entity) ClimbReach ¶
func (*Entity) Damageable ¶
func (*Entity) FallingToVoidPosition ¶
func (*Entity) FormerPosition ¶
func (*Entity) HorizontalSpeed ¶
func (*Entity) MaxHorizontalSpeed ¶
func (*Entity) MinHorizontalSpeed ¶
func (*Entity) OuterRadius ¶
func (*Entity) RotationHorizontalSpeed ¶
func (*Entity) SetAcceleration ¶
func (*Entity) SetClimbRadius ¶
func (*Entity) SetClimbReach ¶
func (*Entity) SetDamageable ¶
func (*Entity) SetFallingToVoidPosition ¶
func (*Entity) SetFriction ¶
func (*Entity) SetLookAngle ¶
func (*Entity) SetMaxHealth ¶
func (*Entity) SetMaxSpeed ¶
func (*Entity) SetMinSpeed ¶
func (*Entity) SetOnGround ¶
func (*Entity) SetOuterRadius ¶
func (*Entity) SetRotationSpeed ¶
func (*Entity) SetShadowOpacity ¶
func (*Entity) ShadowNode ¶
func (*Entity) ShadowOpacity ¶
type Equipable ¶
type Equipable struct { Item // contains filtered or unexported fields }
func NewEquipable ¶
func (*Equipable) AllowRepeat ¶
func (*Equipable) AttackValue ¶
func (*Equipable) CoverDrawSlots ¶
func (e *Equipable) CoverDrawSlots() []DrawSlotId
func (*Equipable) DefenseValue ¶
func (*Equipable) IsTwoHanded ¶
func (*Equipable) SetAllowRepeat ¶
func (*Equipable) SetAttackValue ¶
func (*Equipable) SetCoverDrawSlots ¶
func (e *Equipable) SetCoverDrawSlots(v []DrawSlotId)
func (*Equipable) SetDefenseValue ¶
func (*Equipable) SetTwoHanded ¶
type ICharacter ¶
type ICharacter interface { IEntity InnerEntity() IEntity MoveIntention() *math32.Vector3 SetLookIntention(float32) LookIntention() float32 Inventory() IInventory PushForce() float32 SetDontPickUpUntilFarDistance(float32) DontPickUpUntilFarDistance() float32 AddDontPickUpUntilFar(item IItem) PickUp(IItem) WantToPickUp(IItem) bool StyleEquipables() map[SlotId]IEquipable EquippedWeapon() IEquipable AttackIntention() bool TargetFilter() Filter HandHeight() float32 WantToAttack() bool WantToRepeatAttack() bool IsAttacking() bool SetAttacking(bool) Attack(delta float32) []IAttack Jump() RepeatJump() IsJumping() bool SetJumping(bool) OuterDistanceTo(ICharacter) float32 Think() }
type IConsumable ¶
type IConsumable interface { IItem Consume() }
type IEnemy ¶
type IEnemy interface { ICharacter IEvil TargetSeeDistance() float32 Target() IEntity SeeTarget(IEntity) }
type IEntity ¶
type IEntity interface { model.IDrawable ITickable Name() string ShadowNode() model.INode Colision() []*Cylinder Radius() float32 OuterRadius() float32 ClimbRadius() float32 ClimbReach() float32 Height() float32 Position() *math32.Vector3 FormerPosition() *math32.Vector3 Speed() *math32.Vector3 MaxSpeed() float32 SetLookAngle(float32) LookAngle() float32 Destroyed() bool Health() float32 SetHealth(v float32) MaxHealth() float32 SetMaxHealth(v float32) Gravity(v float32) SetOnGround(bool) OnGround() bool BorderDistanceTo(IEntity) float32 CenterDistanceTo(IEntity) float32 FallingToVoidPosition() *math32.Vector3 SetFallingToVoidPosition(*math32.Vector3) Generate() []IEntity Healed(float32) Damaged(float32) Destroy() }
type IEquipable ¶
type IEquipable interface { IItem EquippedNode() model.INode AllowRepeat() bool Attack(delta float32, damage float32, position *math32.Vector3, attackAngle, legHeight, handHeight, totalHeight float32, filter Filter) []IAttack CoverDrawSlots() []DrawSlotId AttackValue() int DefenseValue() int BodyType() BodyType IsTwoHanded() bool }
type IInventory ¶
type IInventory interface { ITickable Slots() map[SlotId]IItem EquipmentSlots() map[SlotId]IEquipable CanEquip(itemSlot int, slot SlotId) bool CanEquipItem(item IItem, slot SlotId) bool AutoEquip(itemSlot int) Equip(itemSlot int, slot SlotId) AutoUnequip(slot SlotId) Unequip(slot SlotId, itemSlot int) ShuffleEquipment(slot1, slot2 SlotId) bool Items() []IItem EquippedWeapon() IEquipable WhereHas(IItem) int WhereEquipped(item IItem) SlotId CanPickUp(item IItem) bool PickUp(item IItem) int ShuffleItem(itemSlot1, itemSlot2 int) SetHoldAmount(v int) HoldAmount() int SetHoldItem(item IItem) HoldItem() IItem RemoveItemSlot(itemSlot int) RemoveEquipped(slot SlotId) DropItemSlot(itemSlot int) DropEquipped(slot SlotId) DropAllLoot() Generate() []IItem Flip() Attack(bool) interface{} }
type IItem ¶
type IItem interface { IEntity InnerEntity() IEntity DroppedNode() model.INode InventoryNode() model.INode WaitBeforePickupable(seconds float32) IsPickupable() bool SimpleValue() float32 ItemType() ItemType ProvidesAmmo() AmmoType SetProvidesAmmo(v AmmoType) RequiresAmmo() AmmoType SetRequiresAmmo(v AmmoType) SetCountableId(countableId CountableId) IsCountable() bool CountableId() CountableId SetCount(v int) Count() int SetCategory(ItemCategory) Category() ItemCategory Clone() IItem }
type IPlayer ¶
type IPlayer interface { ICharacter IGood }
type Item ¶
type Item struct { Entity // When dropped // contains filtered or unexported fields }
func (*Item) Category ¶
func (e *Item) Category() ItemCategory
func (*Item) CountableId ¶
func (e *Item) CountableId() CountableId
func (*Item) InnerEntity ¶
func (*Item) IsCountable ¶
func (*Item) IsPickupable ¶
func (*Item) ProvidesAmmo ¶
func (*Item) RequiresAmmo ¶
func (*Item) SetCategory ¶
func (e *Item) SetCategory(v ItemCategory)
func (*Item) SetCountableId ¶
func (e *Item) SetCountableId(countableId CountableId)
func (*Item) SetProvidesAmmo ¶
func (*Item) SetRequiresAmmo ¶
func (*Item) WaitBeforePickupable ¶
type ItemCategory ¶
type ItemCategory struct{}
type ItemType ¶
type ItemType string
var ( OneHandedWeapon ItemType = "OneHandedWeapon" TwoHandedWeapon ItemType = "TwoHandedWeapon" Shield ItemType = "Shield" Other ItemType = "Other" WeaponItemType = map[ItemType]bool{ OneHandedWeapon: true, TwoHandedWeapon: true, } HandItemType = map[ItemType]bool{ OneHandedWeapon: true, Shield: true, TwoHandedWeapon: true, Other: true, } )
type RelativeCylinder ¶
type RelativeCylinder struct { Ahead float32 Y float32 SimpleCylinder *SimpleCylinder }
RelativeCylinder is a cylinder relative to a bigger entity, e.g. a sword that's carried.
func GenerateCylinders ¶
func GenerateCylinders(maxWidth, reach, height, y, startAhead float32) []*RelativeCylinder
type SimpleCylinder ¶
SimpleCylinder is a bare abstract cylinder with a certain volume.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.