item.go 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. package world
  2. type DamageKind string
  3. const (
  4. DAMAGE_CUT DamageKind = "cut"
  5. DAMAGE_CRUSH DamageKind = "crush"
  6. DAMAGE_PIERCE DamageKind = "pierce"
  7. DAMAGE_HEAT DamageKind = "heat"
  8. DAMAGE_COLD DamageKind = "cold"
  9. DAMAGE_SHOCK DamageKind = "shock"
  10. DAMAGE_TOXIC DamageKind = "toxic"
  11. DAMAGE_LASER DamageKind = "laser"
  12. DAMAGE_BLAST DamageKind = "blast"
  13. DAMAGE_TONE DamageKind = "tone"
  14. DAMAGE_CORRUPTION DamageKind = "corruption"
  15. DAMAGE_ARCANE DamageKind = "arcane"
  16. DAMAGE_HEAL DamageKind = "heal"
  17. DAMAGE_REPAIR DamageKind = "repair"
  18. )
  19. type ItemKind string
  20. const (
  21. ITEM_MEDICINE ItemKind = "medicine"
  22. ITEM_CAP ItemKind = "cap"
  23. ITEM_RIBBON ItemKind = "ribbon"
  24. ITEM_HAT ItemKind = "hat"
  25. ITEM_SCARF ItemKind = "scarf"
  26. ITEM_CIRCLET ItemKind = "circlet"
  27. ITEM_HEADGEAR ItemKind = "headgear"
  28. ITEM_CROWN ItemKind = "crown"
  29. ITEM_HELMET ItemKind = "helmet"
  30. ITEM_CAPE ItemKind = "cape"
  31. ITEM_COAT ItemKind = "coat"
  32. ITEM_ROBE ItemKind = "robe"
  33. ITEM_VEST ItemKind = "vest"
  34. ITEM_CHEST ItemKind = "chest"
  35. ITEM_SUIT ItemKind = "suit"
  36. ITEM_ARMOR ItemKind = "armor"
  37. ITEM_SANDAL ItemKind = "sandal"
  38. ITEM_SHOE ItemKind = "shoe"
  39. ITEM_BOOT ItemKind = "boot"
  40. //not sure...
  41. ITEM_PANTS ItemKind = "pants"
  42. ITEM_SKIRT ItemKind = "skirt"
  43. ITEM_GREAVES ItemKind = "greaves"
  44. ITEM_RING ItemKind = "ring"
  45. ITEM_BRACELET ItemKind = "bracelet"
  46. ITEM_ARMLET ItemKind = "armlet"
  47. ITEM_SLEEVE ItemKind = "sleeve"
  48. ITEM_PAULDRON ItemKind = "pauldron"
  49. ITEM_GAUNTLET ItemKind = "gauntlet"
  50. ITEM_NECKLACE ItemKind = "necklace"
  51. ITEM_EARRING ItemKind = "earring"
  52. ITEM_LAMP ItemKind = "lamp"
  53. ITEM_FLASHLIGHT ItemKind = "flashlight"
  54. // sure again
  55. ITEM_SWORD ItemKind = "sword"
  56. ITEM_TWOHANDER ItemKind = "twohander"
  57. ITEM_KNIFE ItemKind = "knife"
  58. ITEM_DAGGER ItemKind = "dagger"
  59. ITEM_GLOVE ItemKind = "glove"
  60. ITEM_CLAW ItemKind = "claw"
  61. ITEM_WAND ItemKind = "wand"
  62. ITEM_STAFF ItemKind = "staff"
  63. ITEM_FOCUS ItemKind = "focus"
  64. // Not sure if these will be implemented.
  65. ITEM_AXE ItemKind = "axe"
  66. ITEM_MAUL ItemKind = "maul"
  67. ITEM_SPEAR ItemKind = "spear"
  68. ITEM_NAGINATA ItemKind = "naginata"
  69. ITEM_BOW ItemKind = "bow"
  70. ITEM_CROSSBOW ItemKind = "crossbow"
  71. ITEM_ARROW ItemKind = "arrow"
  72. ITEM_BOLT ItemKind = "bolt"
  73. // But these below are planned.
  74. ITEM_NEEDLER ItemKind = "needler"
  75. ITEM_HANDGUN ItemKind = "handgun"
  76. ITEM_LASERGUN ItemKind = "lasergun"
  77. ITEM_MACHINEGUN ItemKind = "machinegun"
  78. ITEM_CANNON ItemKind = "cannon"
  79. ITEM_BAZOOKA ItemKind = "bazooka"
  80. ITEM_NEEDLE ItemKind = "needle"
  81. ITEM_BULLET ItemKind = "bullet"
  82. ITEM_CELL ItemKind = "cell"
  83. ITEM_ROCKET ItemKind = "rocket"
  84. ITEM_EXPLOSIVE ItemKind = "explosive"
  85. ITEM_GRENADE ItemKind = "grenade"
  86. ITEM_REPAIR ItemKind = "repair"
  87. ITEM_ORE ItemKind = "ore"
  88. ITEM_INGOT ItemKind = "ingot"
  89. ITEM_METAL ItemKind = "metal"
  90. ITEM_PLANT ItemKind = "plant"
  91. ITEM_FRUIT ItemKind = "fruit"
  92. ITEM_WOOD ItemKind = "wood"
  93. ITEM_FOOD ItemKind = "food"
  94. ITEM_TRAP ItemKind = "trap"
  95. ITEM_HANDCUFFS ItemKind = "handcuffs"
  96. ITEM_CHEMICAL ItemKind = "chemical"
  97. ITEM_FISH ItemKind = "fish"
  98. ITEM_MEAT ItemKind = "meat"
  99. ITEM_HIDE ItemKind = "hide"
  100. ITEM_LEATHER ItemKind = "leather"
  101. ITEM_FIBER ItemKind = "fiber"
  102. ITEM_CLOTH ItemKind = "cloth"
  103. ITEM_CERAMIC ItemKind = "ceramic"
  104. ITEM_POLYMER ItemKind = "polymer"
  105. // android parts
  106. // AGI, STR, CHA
  107. ITEM_LEGPARTS ItemKind = "legparts"
  108. // DEX, STR, CHA
  109. ITEM_ARMPARTS ItemKind = "armparts"
  110. // TOU, CHA
  111. ITEM_BODYPARTS ItemKind = "bodyparts"
  112. // INT, WIS, CHA
  113. ITEM_HEADPARTS ItemKind = "headparts"
  114. ITEM_ ItemKind = ""
  115. )
  116. type EquipWhere string
  117. const (
  118. EQUIP_NONE EquipWhere = "none"
  119. EQUIP_HEAD EquipWhere = "head"
  120. EQUIP_TORSO EquipWhere = "torso"
  121. EQUIP_OFFHAND EquipWhere = "offhand"
  122. EQUIP_DOMINANT EquipWhere = "dominant"
  123. EQUIP_AMMO EquipWhere = "ammo"
  124. EQUIP_FEET EquipWhere = "feet"
  125. EQUIP_FOCUS EquipWhere = "focus"
  126. EQUIP_PHONE EquipWhere = "phone"
  127. EQUIP_GLOVES EquipWhere = "gloves"
  128. EQUIP_NECK EquipWhere = "neck"
  129. EQUIP_LEGS EquipWhere = "legs"
  130. EQUIP_ARMS EquipWhere = "arms"
  131. EQUIP_RIGHTRING EquipWhere = "rightring"
  132. EQUIP_LEFTRING EquipWhere = "leftring"
  133. EQUIP_LIGHT EquipWhere = "light"
  134. EQUIP_ EquipWhere = ""
  135. )
  136. type Item struct {
  137. Entity
  138. Quality int
  139. Price int
  140. Kind ItemKind
  141. Damage DamageKind
  142. // Equipment location, "none" if not equippable
  143. Equippable EquipWhere
  144. // Level of crafing skill needed to craft this, or of harvesting skill
  145. // to harvest this, or of mining skill to mine this. Negative if cannot
  146. // be crafted nor harvested, nor mined.
  147. Level int
  148. // Id's of ingredients to craft this item. Empty if it cannot be crafted.
  149. Ingredients []ID
  150. // Id of item this item can be upgraded/enhanced to. empty or "none"
  151. // if it cannot be upgraded.
  152. Upgrade ID
  153. // ID of item this item can degrade into. empty or "none" if cannot be
  154. // degraded.
  155. Degrade ID
  156. // ID of technique/art/item to craft this item teaches when used, empty or
  157. // none if it teaches nothing. If it's a skill, the XP of teaching is
  158. // determined by the Quality of the item.
  159. Teaches ID
  160. }
  161. type ItemPointer struct {
  162. ID ID
  163. item * Item
  164. }