phase shifts, itemize

This commit is contained in:
anton.gurov
2019-11-13 18:55:11 +03:00
parent d5a853df0e
commit 999f48afe9
14 changed files with 213 additions and 15 deletions

14
engine/items/ammo.go Normal file
View File

@ -0,0 +1,14 @@
package items
import (
"lab.zaar.be/thefish/alchemyst-go/engine/ecs"
"lab.zaar.be/thefish/alchemyst-go/engine/items/itemprops"
)
type Ammo struct {
itemprops.DamageProfile
}
func (a *Ammo) Type() string {
return ecs.AmmoComponent
}

11
engine/items/armor.go Normal file
View File

@ -0,0 +1,11 @@
package items
import "lab.zaar.be/thefish/alchemyst-go/engine/ecs"
type Armor struct {
DefenceProfile struct{}
}
func (a *Armor) Type() string {
return ecs.ArmorComponent
}

14
engine/items/arms.go Normal file
View File

@ -0,0 +1,14 @@
package items
import (
"lab.zaar.be/thefish/alchemyst-go/engine/ecs"
"lab.zaar.be/thefish/alchemyst-go/engine/items/itemprops"
)
type Arms struct {
itemprops.DamageProfile
}
func (a Arms) Type() string {
return ecs.ArmsComponent
}

View File

@ -2,8 +2,26 @@ package items
import "lab.zaar.be/thefish/alchemyst-go/engine/ecs"
type Carried struct {}
type CarriedFace interface {
Drop()
Pickup()
}
type Carried struct {
Mass int //масса в граммах
Bulk int //внешний размер, см3
}
func (c *Carried) Type() string {
return ecs.CarriedComponent
}
func (c *Carried) Pickup() {}
func (c *Carried) Drop() {}
func (c *Carried) GetMass() int {
return c.Mass
}
func (c *Carried) GetBulk() int {
return c.Bulk
}

View File

@ -0,0 +1,7 @@
package itemprops
type DamageProfile struct {
Pierce int
Bash int
Cleave int
}

11
engine/items/ranged.go Normal file
View File

@ -0,0 +1,11 @@
package items
import "lab.zaar.be/thefish/alchemyst-go/engine/ecs"
type Ranged struct {
RangeProfile struct{} //это зависимость дальности-скорости от характеристик и атрибутов
}
func (r *Ranged) Type() string {
return ecs.RangedComponent
}

View File

@ -2,9 +2,16 @@ package items
import "lab.zaar.be/thefish/alchemyst-go/engine/ecs"
type Useable struct {}
type UsableFace interface {
Use()
}
type Usable struct {}
func (u *Useable) Type() string {
func (u *Usable) Type() string {
return ecs.UsableComponent
}
func (u *Usable) Use() {
}

16
engine/items/wearable.go Normal file
View File

@ -0,0 +1,16 @@
package items
import "lab.zaar.be/thefish/alchemyst-go/engine/ecs"
type WearableFace interface {
Wear()
Takeoff()
}
type Wearable struct {
Bodypart int //куда собстно одевать
}
func (w *Wearable) Type() string {
return ecs.WearableComponent
}