Documentation ¶
Index ¶
- Variables
- type HUD
- type Humanoid
- func (e *Humanoid) Attack(delta float32) []entity.IAttack
- func (h *Humanoid) AttackIntention() bool
- func (e *Humanoid) CoveredByEquipables() map[entity.DrawSlotId]bool
- func (e *Humanoid) Damaged(damage float32)
- func (e *Humanoid) EquippedWeapon() entity.IEquipable
- func (e *Humanoid) Generate() []entity.IEntity
- func (h *Humanoid) Inventory() entity.IInventory
- func (e *Humanoid) Jump()
- func (h *Humanoid) Node() model.INode
- func (h *Humanoid) PostTick(delta float32)
- func (h *Humanoid) PreTick()
- func (e *Humanoid) RepeatJump()
- func (h *Humanoid) SetJumpPower(v float32)
- func (h *Humanoid) SetJumpTimeLimit(seconds float32)
- func (h *Humanoid) Tick(delta float32)
- func (h *Humanoid) WantToAttack() bool
- func (h *Humanoid) WantToRepeatAttack() bool
- type IHumanoidEquipable
- type Inventory
- func (i *Inventory) AllItems() []entity.IItem
- func (i *Inventory) Attack(repeat bool) interface{}
- func (i *Inventory) AutoEquip(itemSlot int)
- func (i *Inventory) AutoUnequip(slot entity.SlotId)
- func (i *Inventory) CanEquip(itemSlot int, slot entity.SlotId) bool
- func (i *Inventory) CanEquipItem(item entity.IItem, slot entity.SlotId) bool
- func (i *Inventory) CanPickUp(item entity.IItem) bool
- func (i *Inventory) DropAllLoot()
- func (i *Inventory) DropEquipped(slot entity.SlotId)
- func (i *Inventory) DropItemSlot(itemSlot int)
- func (i *Inventory) Equip(itemSlot int, slot entity.SlotId)
- func (i *Inventory) EquipmentSlots() map[entity.SlotId]entity.IEquipable
- func (i *Inventory) EquippedWeapon() entity.IEquipable
- func (i *Inventory) Flip()
- func (i *Inventory) Generate() []entity.IItem
- func (i *Inventory) HoldAmount() int
- func (i *Inventory) HoldItem() entity.IItem
- func (i *Inventory) Items() []entity.IItem
- func (i *Inventory) PickUp(item entity.IItem) int
- func (i *Inventory) PostTick(delta float32)
- func (i *Inventory) PreTick()
- func (i *Inventory) RemoveEquipped(slot entity.SlotId)
- func (i *Inventory) RemoveItemSlot(itemSlot int)
- func (i *Inventory) SetHoldAmount(v int)
- func (i *Inventory) SetHoldItem(item entity.IItem)
- func (i *Inventory) ShuffleEquipment(slot1, slot2 entity.SlotId) bool
- func (i *Inventory) ShuffleItem(itemSlot1, itemSlot2 int)
- func (i *Inventory) Slots() map[entity.SlotId]entity.IItem
- func (i *Inventory) Tick(delta float32)
- func (i *Inventory) Unequip(slot entity.SlotId, itemSlot int)
- func (i *Inventory) WhereEquipped(item entity.IItem) entity.SlotId
- func (i *Inventory) WhereHas(item entity.IItem) int
- type SideBar
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HumanoidAttackAction model.ActionId = "HumanoidAttackAction" HumanoidWalkAnimation = func(legLeft, legRight *model.Transform) *model.Sequence { s, err := model.New( 400, 2000./400, true, false, 400, []*model.Step{ model.NewStep(0, true, true, nil, nil, map[*model.Transform]*model.TransformStep{ legLeft: &model.TransformStep{Set: legStanding, Mutate: legBackward}, legRight: &model.TransformStep{Set: legStanding, Mutate: legForward}, }, ), model.NewStep(100, false, false, nil, nil, map[*model.Transform]*model.TransformStep{ legLeft: &model.TransformStep{Set: legBackward, Mutate: legStanding}, legRight: &model.TransformStep{Set: legForward, Mutate: legStanding}, }, ), model.NewStep(200, true, true, nil, nil, map[*model.Transform]*model.TransformStep{ legLeft: &model.TransformStep{Set: legStanding, Mutate: legForward}, legRight: &model.TransformStep{Set: legStanding, Mutate: legBackward}, }, ), model.NewStep(300, false, false, nil, nil, map[*model.Transform]*model.TransformStep{ legLeft: &model.TransformStep{Set: legForward, Mutate: legStanding}, legRight: &model.TransformStep{Set: legBackward, Mutate: legStanding}, }, ), }) if err != nil { panic(fmt.Sprintf("Critical error. Animation is broken: %v", err)) } return s } HumanoidWalkAnimationTest = HumanoidWalkAnimation(n, n) HumanoidAttackAnimation = func(arm, hand *model.Transform, right bool) *model.Sequence { var armDownFrontCenter, armDownFrontCenterHit *model.Transform if right { armDownFrontCenter = armRightDownFrontCenter armDownFrontCenterHit = armRightDownFrontCenterHit } else { armDownFrontCenter = armLeftDownFrontCenter armDownFrontCenterHit = armLeftDownFrontCenterHit } s, err := model.New( 120, 4000./400, false, true, 2, []*model.Step{ model.NewStep(0, true, true, nil, nil, map[*model.Transform]*model.TransformStep{ arm: &model.TransformStep{Set: armFront, Mutate: armUp}, hand: &model.TransformStep{Set: handUp, Mutate: handMid}, }, ), model.NewStep(15, false, false, nil, nil, map[*model.Transform]*model.TransformStep{ arm: &model.TransformStep{Set: armUp, Mutate: armDownFrontCenterHit}, hand: &model.TransformStep{Set: handMid, Mutate: handHit}, }, ), model.NewStep(32, false, false, nil, []model.ActionId{HumanoidAttackAction}, map[*model.Transform]*model.TransformStep{ arm: &model.TransformStep{Set: armDownFrontCenterHit, Mutate: armDownFrontCenter}, hand: &model.TransformStep{Set: handHit, Mutate: handFront}, }, ), model.NewStep(60, false, false, nil, nil, map[*model.Transform]*model.TransformStep{ arm: &model.TransformStep{Set: armDownFrontCenter, Mutate: armDown}, hand: &model.TransformStep{Set: handFront}, }, ), model.NewStep(80, false, false, nil, nil, map[*model.Transform]*model.TransformStep{ arm: &model.TransformStep{Set: armDown, Mutate: armFront}, hand: &model.TransformStep{Set: handFront, Mutate: handUp}, }, ), }) if err != nil { panic(fmt.Sprintf("Critical error. Animation is broken: %v", err)) } return s } HumanoidAttackAnimationTest = HumanoidAttackAnimation(n, n, true) )
View Source
var ( HumanoidBody entity.BodyType = "Humanoid" Helmet entity.ItemType = "HumanoidHelmet" Armor entity.ItemType = "HumanoidArmor" Gloves entity.ItemType = "HumanoidGloves" Pants entity.ItemType = "HumanoidPants" Boots entity.ItemType = "HumanoidBoots" Amulet entity.ItemType = "HumanoidAmulet" Ring entity.ItemType = "HumanoidRing" Back entity.ItemType = "HumanoidBack" AmuletSlot entity.SlotId = "Amulet" HelmetSlot entity.SlotId = "Helmet" ArmorSlot entity.SlotId = "Armor" GlovesSlot entity.SlotId = "Gloves" PantsSlot entity.SlotId = "Pants" BootsSlot entity.SlotId = "Boots" RingRightSlot entity.SlotId = "RingRight" RingLeftSlot entity.SlotId = "RingLeft" BackSlot entity.SlotId = "Back" HandRightSlot entity.SlotId = "HandRight" HandLeftSlot entity.SlotId = "HandLeft" AlternateRightSlot entity.SlotId = "AlternateRight" AlternateLeftSlot entity.SlotId = "AlternateLeft" Consumable1Slot entity.SlotId = "Consumable1Slot" Consumable2Slot entity.SlotId = "Consumable2Slot" Consumable3Slot entity.SlotId = "Consumable3Slot" Consumable4Slot entity.SlotId = "Consumable4Slot" Consumable5Slot entity.SlotId = "Consumable5Slot" Consumable6Slot entity.SlotId = "Consumable6Slot" Consumable7Slot entity.SlotId = "Consumable7Slot" Consumable8Slot entity.SlotId = "Consumable8Slot" Consumable9Slot entity.SlotId = "Consumable9Slot" Consumable10Slot entity.SlotId = "Consumable10Slot" Head entity.DrawSlotId = "Head" Torso entity.DrawSlotId = "Torso" Face entity.DrawSlotId = "Face" LegLeft entity.DrawSlotId = "LegLeft" LegRight entity.DrawSlotId = "legRight" ArmLeft entity.DrawSlotId = "ArmLeft" ArmRight entity.DrawSlotId = "ArmRight" HandLeft entity.DrawSlotId = "HandLeft" HandRight entity.DrawSlotId = "HandRight" ProtrudeHeadUpOrBackLong entity.DrawSlotId = "ProtrudeHeadUpOrBackLong" ProtrudeHeadUpOrBackShort entity.DrawSlotId = "ProtrudeHeadUpOrBackShort" ProtrudeHeadFrontOrHangLong entity.DrawSlotId = "ProtrudeHeadFrontOrHangLong" ProtrudeHeadFrontOrHangShort entity.DrawSlotId = "ProtrudeHeadFrontOrHangShort" ProtrudeHeadSidesLong entity.DrawSlotId = "ProtrudeHeadSidesLong" ProtrudeHeadSidesShort entity.DrawSlotId = "ProtrudeHeadSidesShort" ProtrudeHandLeft entity.DrawSlotId = "ProtrudeHandsLeft" ProtrudeHandRight entity.DrawSlotId = "ProtrudeHandsRight" ProtrudeNeck entity.DrawSlotId = "ProtrudeNeck" StandardSlots = []entity.SlotId{ AmuletSlot, HelmetSlot, ArmorSlot, GlovesSlot, PantsSlot, BootsSlot, RingRightSlot, RingLeftSlot, BackSlot, HandRightSlot, HandLeftSlot, AlternateRightSlot, AlternateLeftSlot, Consumable1Slot, Consumable2Slot, Consumable3Slot, Consumable4Slot, Consumable5Slot, Consumable6Slot, Consumable7Slot, Consumable8Slot, Consumable9Slot, Consumable10Slot, } EquippedSlots = map[entity.SlotId]bool{ AmuletSlot: true, HelmetSlot: true, ArmorSlot: true, GlovesSlot: true, PantsSlot: true, BootsSlot: true, RingRightSlot: true, RingLeftSlot: true, BackSlot: true, HandRightSlot: true, HandLeftSlot: true, AlternateRightSlot: true, AlternateLeftSlot: true, } ConsumableSlots = map[entity.SlotId]bool{ Consumable1Slot: true, Consumable2Slot: true, Consumable3Slot: true, Consumable4Slot: true, Consumable5Slot: true, Consumable6Slot: true, Consumable7Slot: true, Consumable8Slot: true, Consumable9Slot: true, Consumable10Slot: true, } ConsumableSlotsSorted = []entity.SlotId{ Consumable1Slot, Consumable2Slot, Consumable3Slot, Consumable4Slot, Consumable5Slot, Consumable6Slot, Consumable7Slot, Consumable8Slot, Consumable9Slot, Consumable10Slot, } )
View Source
var ( Walk = "Walk" AttackRight = "AttackRight" AttackLeft = "AttackLeft" LegLeftPosition = math32.NewVector3(13, 44, 0) LegRightPosition = math32.NewVector3(-13, 44, 0) ArmLeftPosition = math32.NewVector3(17, 75.5, 0) ArmRightPosition = math32.NewVector3(-17, 75.5, 0) HandLeftPosition = math32.NewVector3(8.5, 0, 30.5) HandRightPosition = math32.NewVector3(-8.5, 0, 30.5) LegLeftTransformPosition = (&math32.Vector3{}).Copy(LegLeftPosition).MultiplyScalar(model.GlobalScaleFactor) LegRightTransformPosition = (&math32.Vector3{}).Copy(LegRightPosition).MultiplyScalar(model.GlobalScaleFactor) ArmLeftTransformPosition = (&math32.Vector3{}).Copy(ArmLeftPosition).MultiplyScalar(model.GlobalScaleFactor) ArmRightTransformPosition = (&math32.Vector3{}).Copy(ArmRightPosition).MultiplyScalar(model.GlobalScaleFactor) HandLeftTransformPosition = (&math32.Vector3{}).Copy(HandLeftPosition).MultiplyScalar(model.GlobalScaleFactor) HandRightTransformPosition = (&math32.Vector3{}).Copy(HandRightPosition).MultiplyScalar(model.GlobalScaleFactor) )
Functions ¶
This section is empty.
Types ¶
type HUD ¶
type HUD struct { SideBar *SideBar // contains filtered or unexported fields }
func (*HUD) GatherInput ¶
func (g *HUD) GatherInput()
func (*HUD) KeyboardInput ¶
type Humanoid ¶
func NewHumanoid ¶
func (*Humanoid) AttackIntention ¶
func (*Humanoid) CoveredByEquipables ¶
func (e *Humanoid) CoveredByEquipables() map[entity.DrawSlotId]bool
func (*Humanoid) EquippedWeapon ¶
func (e *Humanoid) EquippedWeapon() entity.IEquipable
func (*Humanoid) Inventory ¶
func (h *Humanoid) Inventory() entity.IInventory
func (*Humanoid) RepeatJump ¶
func (e *Humanoid) RepeatJump()
func (*Humanoid) SetJumpPower ¶
func (*Humanoid) SetJumpTimeLimit ¶
func (*Humanoid) WantToAttack ¶
func (*Humanoid) WantToRepeatAttack ¶
type IHumanoidEquipable ¶
type Inventory ¶
type Inventory struct {
// contains filtered or unexported fields
}
func (*Inventory) AutoUnequip ¶
func (*Inventory) CanEquipItem ¶
func (*Inventory) DropAllLoot ¶
func (i *Inventory) DropAllLoot()
func (*Inventory) DropEquipped ¶
func (*Inventory) DropItemSlot ¶
func (*Inventory) EquipmentSlots ¶
func (i *Inventory) EquipmentSlots() map[entity.SlotId]entity.IEquipable
func (*Inventory) EquippedWeapon ¶
func (i *Inventory) EquippedWeapon() entity.IEquipable
func (*Inventory) HoldAmount ¶
func (*Inventory) RemoveEquipped ¶
func (*Inventory) RemoveItemSlot ¶
func (*Inventory) SetHoldAmount ¶
func (*Inventory) SetHoldItem ¶
func (*Inventory) ShuffleEquipment ¶
func (*Inventory) ShuffleItem ¶
func (*Inventory) WhereEquipped ¶
type SideBar ¶
type SideBar struct {
// contains filtered or unexported fields
}
func (*SideBar) SetInventory ¶
func (s *SideBar) SetInventory(inventory entity.IInventory)
Click to show internal directories.
Click to hide internal directories.