From 425da65ed46061303604610bb539d6495b2b1f3f Mon Sep 17 00:00:00 2001 From: anon5 Date: Mon, 21 Jun 2021 18:47:26 +0000 Subject: Add high-level protocol (de)serialization --- toolcaps.go | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 toolcaps.go (limited to 'toolcaps.go') diff --git a/toolcaps.go b/toolcaps.go new file mode 100644 index 0000000..c414607 --- /dev/null +++ b/toolcaps.go @@ -0,0 +1,45 @@ +package mt + +type ToolCaps struct { + //mt:if _ = %s; false + NonNil bool `json:"-"` + //mt:end + + //mt:lenhdr 16 + + //mt:ifde + //mt:if r.N > 0 { %s.NonNil = true}; /**/ + //mt:if %s.NonNil + + //mt:const uint8(5) + + AttackCooldown float32 `json:"full_punch_interval"` + MaxDropLvl int16 `json:"max_drop_level"` + + //mt:len32 + GroupCaps []ToolGroupCaps `json:"groupcaps"` + + //mt:len32 + DmgGroups []Group `json:"damage_groups"` + + AttackUses uint16 `json:"punch_attack_uses"` + + //mt:end + //mt:end + + //mt:end +} + +type ToolGroupCaps struct { + Name string + Uses int16 + MaxLvl int16 + + //mt:len32 + Times []DigTime +} + +type DigTime struct { + Rating int16 + Time float32 +} -- cgit v1.2.3