Skip to content

Commit

Permalink
add properties for new armor system (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
morphy2k authored Jan 10, 2024
1 parent 1fd047f commit 5773785
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
22 changes: 14 additions & 8 deletions model/item/kind_armor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@ const (
type Armor struct {
Item `bson:",inline"`

Type string `json:"type" bson:"type"`
Armor ArmorProps `json:"armor" bson:"armor"`
RicochetChance string `json:"ricochetChance,omitempty" bson:"ricochetChance,omitempty"`
Penalties Penalties `json:"penalties" bson:"penalties"`
Blocking []string `json:"blocking" bson:"blocking"`
Slots Slots `json:"slots" bson:"slots"`
Compatibility List `json:"compatibility" bson:"compatibility"`
Type string `json:"type" bson:"type"`
Armor ArmorProps `json:"armor" bson:"armor"`
Components []ArmorComponent `json:"components" bson:"components"`
RicochetChance string `json:"ricochetChance,omitempty" bson:"ricochetChance,omitempty"`
Penalties Penalties `json:"penalties" bson:"penalties"`
Blocking []string `json:"blocking" bson:"blocking"`
Slots Slots `json:"slots" bson:"slots"`
Compatibility List `json:"compatibility" bson:"compatibility"`
}

// ArmorProps represents the armor properties of Armor and TacticalRig
// ArmorComponent describes the entity of an armor component
type ArmorComponent struct {
ArmorProps `bson:",inline"`
}

// ArmorProps represents the armor properties of ArmorComponent and Armor
type ArmorProps struct {
Class int64 `json:"class" bson:"class"`
Durability float64 `json:"durability" bson:"durability"`
Expand Down
10 changes: 6 additions & 4 deletions model/item/kind_tacticalRig.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ const (
type TacticalRig struct {
Item `bson:",inline"`

Capacity int64 `json:"capacity" bson:"capacity"`
Grids []Grid `json:"grids" bson:"grids"`
Penalties Penalties `json:"penalties" bson:"penalties"`
Armor *ArmorProps `json:"armor,omitempty" bson:"armor,omitempty"`
Capacity int64 `json:"capacity" bson:"capacity"`
Grids []Grid `json:"grids" bson:"grids"`
Penalties Penalties `json:"penalties" bson:"penalties"`
Armor *ArmorProps `json:"armor,omitempty" bson:"armor,omitempty"` // Deprecated
ArmorComponents []ArmorComponent `json:"armorComponents,omitempty" bson:"armorComponents,omitempty"`
Slots Slots `json:"slots" bson:"slots"`
}

0 comments on commit 5773785

Please sign in to comment.