EntityTypes.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. """EntityTypes module: contains classes that describe Entity types"""
  2. from EntityTypeDesc import EntityTypeDesc
  3. from toontown.coghq.SpecImports import *
  4. class Entity(EntityTypeDesc):
  5. abstract = 1
  6. type = 'entity'
  7. attribs = (
  8. ('type', None, 'const'),
  9. ('name', '<unnamed>', 'string'),
  10. ('comment', '', 'string'),
  11. ('parentEntId', 0, 'entId'),
  12. )
  13. class LevelMgr(Entity):
  14. type = 'levelMgr'
  15. permanent = 1
  16. attribs = (
  17. ('name', 'LevelMgr', 'const'),
  18. ('parentEntId', 0, 'const'),
  19. ('modelFilename', '', 'const'),
  20. ('ouchMultiplier', 1, 'int', {'min':1}),
  21. )
  22. class EditMgr(Entity):
  23. type = 'editMgr'
  24. permanent = 1
  25. delAttribs = (
  26. 'comment',
  27. )
  28. attribs = (
  29. ('name', 'LevelMgr', 'const'),
  30. ('parentEntId', 0, 'const'),
  31. ('requestSave', None, 'const'),
  32. ('requestNewEntity', None, 'const'),
  33. ('insertEntity', None, 'const'),
  34. ('removeEntity', None, 'const'),
  35. )
  36. class Nodepath(Entity):
  37. type = 'nodepath'
  38. attribs = (
  39. ('parentEntId', 0, 'entId', {'type':'nodepath'}),
  40. ('pos', Point3(0,0,0), 'pos'),
  41. ('hpr', Vec3(0,0,0), 'hpr'),
  42. ('scale', 1, 'scale'),
  43. )
  44. class Zone(Nodepath):
  45. type = 'zone'
  46. permanent = 1
  47. delAttribs = (
  48. 'pos',
  49. 'hpr',
  50. )
  51. attribs = (
  52. ('parentEntId', 0, 'const'),
  53. ('description', '', 'string'),
  54. ('visibility', [], 'visZoneList'),
  55. )
  56. class EntrancePoint(Nodepath):
  57. type = 'entrancePoint'
  58. attribs = (
  59. ('entranceId', -1, 'int'),
  60. ('radius', 15, 'float', {'min':0}),
  61. ('theta', 20, 'float', {'min':0}),
  62. )
  63. class LogicGate(Entity):
  64. type = 'logicGate'
  65. output = 'bool'
  66. attribs = (
  67. ('input1Event', 0, 'entId', {'output':'bool'}),
  68. ('input2Event', 0, 'entId', {'output':'bool'}),
  69. ('isInput1', 0, 'bool'),
  70. ('isInput2', 0, 'bool'),
  71. ('logicType', 'or', 'choice',
  72. {'choiceSet':['or','and','xor','nand','nor','xnor']}),
  73. )
  74. class CutScene(Entity):
  75. type = 'cutScene'
  76. output = 'bool'
  77. attribs = (
  78. ('pos', Point3(0,0,0), 'pos'),
  79. ('hpr', Vec3(0,0,0), 'hpr'),
  80. ('startStopEvent', 0, 'entId', {'output':'bool'}),
  81. ('effect', 'irisInOut', 'choice', {'choiceSet':['nothing','irisInOut','letterBox']}),
  82. ('motion', 'foo1', 'choice', {'choiceSet':['foo1']}),
  83. ('duration', 5.0, 'float'),
  84. )
  85. class Model(Nodepath):
  86. type = 'model'
  87. attribs = (
  88. ('modelPath', None, 'bamfilename'),
  89. )
  90. class Path(Nodepath):
  91. type = 'path'
  92. attribs = (
  93. ('pathIndex', 0, 'int'),
  94. )
  95. class VisibilityExtender(Entity):
  96. type = 'visibilityExtender'
  97. attribs = (
  98. ('event', None, 'entId', {'output':'bool'}),
  99. ('newZones', [], 'visZoneList'),
  100. )
  101. class AmbientSound(Nodepath):
  102. type = 'ambientSound'
  103. attribs = (
  104. ('soundPath', '', 'bamfilename'),
  105. ('volume', 1, 'float', {'min':0,'max':1}),
  106. ('enabled', 1, 'bool'),
  107. )
  108. class PropSpinner(Entity):
  109. type = 'propSpinner'
  110. class EntityGroup(Entity):
  111. type = 'entityGroup'