UN.lua 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. local ReceiverBase = require("core:erm.ReceiverBase")
  2. local Metatype = require ("core:Metatype")
  3. local EntitiesChanged = require("netpacks.EntitiesChanged")
  4. local SERVICES = SERVICES
  5. local creatures = SERVICES:creatures()
  6. local SERVER = SERVER
  7. local function sendChanges(metatype, index, data)
  8. local pack = EntitiesChanged.new()
  9. pack:update(metatype, index, data)
  10. SERVER:commitPackage(pack)
  11. end
  12. local UN = ReceiverBase:new()
  13. function UN:new(ERM)
  14. return ReceiverBase.new(self,{ERM=ERM})
  15. end
  16. function UN:A(x, artifactIndex, ...)
  17. error ("UN:A is not implemented")
  18. end
  19. --[[
  20. WoG chests
  21. ]]
  22. function UN:B(x, ...)
  23. error ("UN:B is not implemented")
  24. end
  25. --[[
  26. May be reuse for smth
  27. ]]
  28. function UN:C(x, ...)
  29. error ("UN:C is not supported")
  30. end
  31. -- make water passable
  32. function UN:D(x, ...)
  33. error ("UN:D is not implemented")
  34. end
  35. -- check tile empty
  36. function UN:E(x, ...)
  37. error ("UN:E is not implemented")
  38. end
  39. -- Fire
  40. function UN:F(x, ...)
  41. error ("UN:F is not supported")
  42. end
  43. UN:p1Dispatcher("G")
  44. -- Secondary skill texts
  45. function UN:G0(x, ...)
  46. error ("UN:G0 is not implemented")
  47. end
  48. function UN:G1(x, creatureIndex, N, v)
  49. return nil, nil, (self["G1"..tostring(N)](self, x, creatureIndex, v))
  50. end
  51. function UN:G10(x, creatureIndex, v)
  52. if v == nil then
  53. return creatures:getByIndex(creatureIndex):getSingularName()
  54. else
  55. v = self.ERM:getZVar(v)
  56. local packData = {config = {name={singular=v}}}
  57. sendChanges(Metatype.CREATURE, creatureIndex, packData)
  58. end
  59. end
  60. function UN:G11(x, creatureIndex, v)
  61. if v == nil then
  62. return creatures:getByIndex(creatureIndex):getPluralName()
  63. else
  64. v = self.ERM:getZVar(v)
  65. local packData = {config = {name={plural=v}}}
  66. sendChanges(Metatype.CREATURE, creatureIndex, packData)
  67. end
  68. end
  69. --[[
  70. creature ability description, there is a field abilityText, but it`s not used anywhere
  71. ]]
  72. function UN:G12(x, creatureIndex, v)
  73. error ("UN:G1/*/2/* is not supported")
  74. end
  75. -- hero specialty texts
  76. function UN:G2(x, ...)
  77. error ("UN:G2 is not implemented")
  78. end
  79. -- Set Fog of war (for all but playerIndex)
  80. function UN:H(x, tx, ty, tl, playerIndex, radius)
  81. error ("UN:H is not supported")
  82. end
  83. -- Put new oblect
  84. function UN:I(x, tx, ty, tl, typ, subtype, ...)
  85. error ("UN:I is not supported")
  86. end
  87. UN:p1Dispatcher("J")
  88. -- allowed spells
  89. function UN:J0(x, ...)
  90. error ("UN:J0 is not implemented")
  91. end
  92. -- level XP limits
  93. function UN:J1(x, ...)
  94. error ("UN:J1 is not implemented")
  95. end
  96. -- difficulty
  97. function UN:J2(x, ...)
  98. error ("UN:J2 is not implemented")
  99. end
  100. -- WoG settings file
  101. function UN:J3(x, ...)
  102. error ("UN:J3 is not supported")
  103. end
  104. -- AI think radius
  105. function UN:J4(x, ...)
  106. error ("UN:J4 is not supported")
  107. end
  108. -- Enable autosave
  109. function UN:J5(x, ...)
  110. error ("UN:J5 is not implemented")
  111. end
  112. -- generate random artifact
  113. function UN:J6(x, ...)
  114. error ("UN:J6 is not implemented")
  115. end
  116. -- artifact trader
  117. function UN:J7(x, slot, artifactIndex)
  118. error ("UN:J7 is not implemented")
  119. end
  120. -- check file exists
  121. function UN:J8(x, ...)
  122. error ("UN:J8 is not implemented")
  123. end
  124. -- game paths
  125. function UN:J9(x, ...)
  126. error ("UN:J9 is not supported")
  127. end
  128. -- dump ERM variables
  129. function UN:J10(x, ...)
  130. error ("UN:J10 is not implemented")
  131. end
  132. function UN:J11(x, ...)
  133. error ("UN:J11 is not supported")
  134. end
  135. --new week params
  136. function UN:K(x, ...)
  137. error ("UN:K is not implemented")
  138. end
  139. -- set view point/check obelisk
  140. function UN:L(x, ...)
  141. error ("UN:L is not implemented")
  142. end
  143. --new month params
  144. function UN:M(x, ...)
  145. error ("UN:M is not implemented")
  146. end
  147. UN:p1Dispatcher("N")
  148. -- artifact name
  149. function UN:N0(x, z, ...)
  150. error ("UN:N0 is not implemented")
  151. end
  152. -- spell name
  153. function UN:N1(x, z, index)
  154. error ("UN:N1 is not implemented")
  155. end
  156. --building name
  157. function UN:N2(x, z, townIndex, index)
  158. error ("UN:N2 is not implemented")
  159. end
  160. --monster name
  161. function UN:N3(x, z, index)
  162. error ("UN:N3 is not implemented")
  163. end
  164. --sec skill name
  165. function UN:N4(x, z, index)
  166. error ("UN:N4 is not implemented")
  167. end
  168. function UN:N5(x, ...)
  169. error ("UN:N5 is not supported")
  170. end
  171. function UN:N6(x, ...)
  172. error ("UN:N6 is not supported")
  173. end
  174. --remove object
  175. function UN:O(x, tx, ty, tl)
  176. error ("UN:O is not implemented")
  177. end
  178. -- WoG options
  179. function UN:P(x, ...)
  180. error ("UN:P is not implemented")
  181. end
  182. -- end game for current player
  183. function UN:Q(x, ...)
  184. error ("UN:Q is not implemented")
  185. end
  186. function UN:R(x, ...)
  187. error ("UN:R is not supported")
  188. end
  189. -- Remove Fog of war for all playerIndex)
  190. function UN:H(x, tx, ty, tl, playerIndex, radius)
  191. error ("UN:H is not supported")
  192. end
  193. --set available creatures
  194. function UN:T(x, town, level, dwellingSlot, creature)
  195. error ("UN:T is not implemented")
  196. end
  197. -- count objects, get coordinates
  198. function UN:U(x, ...)
  199. error ("UN:U is not implemented")
  200. end
  201. -- version info
  202. function UN:V(x, ...)
  203. error ("UN:V is not implemented")
  204. end
  205. -- make water passable
  206. function UN:W(x, ...)
  207. error ("UN:W is not implemented")
  208. end
  209. -- map size
  210. function UN:X(x, ...)
  211. error ("UN:X is not implemented")
  212. end
  213. return UN