body & combat primitives wip

This commit is contained in:
thefish
2022-10-12 15:50:38 +03:00
parent bf13c9c7a2
commit 20ba03c758
9 changed files with 569 additions and 336 deletions

View File

@ -0,0 +1,21 @@
package itemprops
import "github.com/shopspring/decimal"
type ArmorProfile struct {
LayerExtra Armored
LayerOuter Armored
LayerMiddle Armored
LayerInner Armored
}
type Armored struct {
ItemPhysics
Coverage Coverage
}
//Coverage is set of partial coverage from 0 to 1 (0 to 100%)
type Coverage struct {
Frontal decimal.Decimal
Rear decimal.Decimal
}

View File

@ -0,0 +1,148 @@
package itemprops
//MedicalSystem организм
// Humanoid
// Circuits
// Intake
//
// Breathe: Vessel: Air intake >> mouth/nose -> trachea -> lungs
// Vessel: Blood >> heart -> lungs -> brain -> heart
// Eat:
// Vessel: food >> mouth -> jaws
// Vessel: pulp >> esophagus -> stomach
// Congestion:
// Vessel: Blood >> heart -> guts -> system -> liver -> heart
// Vessel: pulp >> stomach -> guts -> output
// Vessel: bile >> liver -> stomach -> guts
// Fast Congestion
// Vessel: liquid >> stomach -> guts -> kidney -> bladder -> pulp output
// Vessel: Blood >> heart -> guts -> system -> kidney -> heart
// Blood сirculation:
// Vessel: blood >> heart -> system -> spleen -> heart
// -> brain -> heart
// Vision:
// Vessel: Nerve signal >> eye -> brain
// Smell:
// Vessel: Air intake >> nose
// Vessel: Nerve signal >> nose -> brain
// Hearing:
// Vessel: Air pressure >> ear
// Vessel: Nerve signal >> ear -> brain
// Touching:
// Vessel: Phys pressure/Temperature/Solvent >> skin -> nerve tissue -> brain
// Motion Sense:
// Vessel: Air pressure >> ear/nose -> inner ear -> brain [feeling fast-moving items]
// Motion:
// Vessel: Gravity >> inner ear -> brain [equilibrium]
// Vessel: Nerve signal >> brain -> major nerve -> [...muscle -> tendon -> bone/joint] -> nerve tissue -> brain
// Structural:
// Vessel: Nerve signal >> brain -> spinal brain -> [...muscle] -> nerve tissue -> brain
// Psychic:
// Vessel: Nerve signal >> brain -> spinal brain -> brain
// Consciousness:
// Vessel: Nerve signal >> brain -> brain
// Misc
// Hand Grip ???:
// Vessel: Nerve signal >> palm -> fingers with off-thumb
// Stance
// Body structure:
// BasePart -> chest -> spine -> joint -> head
// -> spine -> lowerbody
// -> [left] joint -> shoulder -> joint -> arm -> joint -> palm -> 5 x finger
// -> [right] joint -> shoulder -> joint -> arm -> joint -> palm -> 5 x finger
// -> lowerbody
// -> [left] joint -> leg -> joint -> hip -> joint -> foot -> 5 x finger
// -> [right] joint -> leg -> joint -> hip -> joint -> foot -> 5 x finger
// -> head -> joint -> jaw
//MedicalSystem Организм
type MedicalSystem struct {
BasePart BodyPart
}
//MedicalCircuit Система обращения
type MedicalCircuit struct {
Provides MedicalAbility
DependsOn Organ
Vessel MedicalVessel
Contains []Organ
}
//MedicalVessel кровь, желчь, пульпа, воздух, еда
type MedicalVessel struct {
Name string
Material
Pressure DimensionItemDensity
}
//BodyPart часть тела
type BodyPart struct {
LayerExtra MedicalMaterial
LayerOuter MedicalMaterial
LayerMiddle MedicalMaterial
LayerInner MedicalMaterial
Joints []Joint
Contains []InnerOrgan
Exposes []OuterOrgan
}
//Joint суставы, к чему и что крепится
type Joint struct {
Name string
ConnectsFrom BodyPart
ConnectsTo BodyPart
}
type Organ struct {
Name string
Material
}
//InnerOrgan ливер, селезёнка, сердце, кишки итп
type InnerOrgan struct {
Organ
DependsOn MedicalCircuit
BelongsTo MedicalCircuit
}
//OuterOrgan глаза, уши, волосы, когти итп
type OuterOrgan struct {
Organ
DependsOn MedicalCircuit
BelongsTo MedicalCircuit
}
//слой части тела - кожа/чешуя/роговые пластины/хитиновый панцирь, жир, мускулы, кости
type MedicalMaterial struct {
Name string
Material
MedicalSystemFlags
}
//@todo заменить на Medical Circuit
type MedicalSystemFlags struct {
//Structural является ли опорным аппаратом
Structural bool
//Содежит ли кровь/ихор/
MajorVeins bool //вход на мотор, сломаешь - быстро выйдет из строя если будет двигаться
MajorArteria bool //выход, то же самое + высокое давление
Veins bool //вход на мотор
Arteria bool //выход из мотора, высокое давление
MajorNerve bool //повредишь - ниже по суставам не работает
NerveTissue bool //повредишь - ниже по суставамс болит
OxygenTube bool //трахея
OxygenPump bool //лёгкое
BloodPump bool //мотор
ContainsCongestionLiquid bool
IsMainCongestionPump bool
}
//MedicalAbility спсобность есть, стоять, не терять равновесие, дышать, выздоравливать, лечить свои органы, видеть итп
type MedicalAbility string

View File

@ -0,0 +1,37 @@
package itemprops
import "github.com/shopspring/decimal"
type ItemPhysics struct {
Material Material
Rigidity DimensionItemRigidity
Size DimensionItemSize
Temperature DimensionItemTemperature
}
//DimensionItemSize length in m (1 mm = 1/1000 of 1m)
type DimensionItemSize struct {
Width decimal.Decimal
Height decimal.Decimal
// if item is solid - depth in m (1mm = 1/1000 of m)
Depth decimal.NullDecimal
//Thickness if item is hollow - thickness of outer item shell, ie for armor, in m (1 mm = 1/1000 of m)
Thickness decimal.NullDecimal
}
//Area is frontal area
func (d *DimensionItemSize) Area() decimal.Decimal {
return d.Width.Mul(d.Height)
}
//DimensionItemDensity density in kg/m3
type DimensionItemDensity decimal.Decimal
//DimensionItemRigidity rigidity жёсткость, способность твёрдого тела, конструкции или её элементов сопротивляться деформации in N/m
type DimensionItemRigidity decimal.Decimal
//NotchFractureToughness ударная вязкость по Шарпи, Дж (надо ли?)
type NotchFractureToughness decimal.Decimal
//DimensionItemTemperature in celsius, -273 to 10000
type DimensionItemTemperature decimal.Decimal

View File

@ -0,0 +1,20 @@
package itemprops
type Material struct {
Name string
Flags MaterialFlags
Density DimensionItemDensity
FractureToughness NotchFractureToughness
MeltingPoint DimensionItemTemperature
BoilingPoint DimensionItemTemperature
}
type MaterialFlags struct {
ConductsElictricity bool
BlocksLiquid bool
AcidResistant bool
BlocksGas bool
Flammable bool
ConductsHeat bool
Radiates bool
}