BaseEvents.es 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* Copyright (c) 2002-2012 Croteam Ltd.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of version 2 of the GNU General Public License as published by
  4. the Free Software Foundation
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along
  10. with this program; if not, write to the Free Software Foundation, Inc.,
  11. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
  12. 5
  13. %{
  14. #include "StdH.h"
  15. #define DECL_DLL ENGINE_API
  16. #include <Engine/Entities/EntityEvent.h>
  17. #include <Engine/Entities/EntityPointer.h>
  18. #include <Engine/Math/Vector.h>
  19. #include <Engine/Math/Plane.h>
  20. #include <Engine/Entities/EntityProperties.h>
  21. %}
  22. /*
  23. * These events are used globally
  24. */
  25. event EInternal { // internal jumping event - do not use
  26. };
  27. event EVoid { // general void type
  28. };
  29. event EReturn { // sub procedure return notify
  30. };
  31. event EBegin { // sent to wait handler when started
  32. };
  33. event ETimer { // timer elapsed
  34. };
  35. event ETouch { // one entity touched another while moving
  36. CEntityPointer penOther, // other entity
  37. BOOL bThisMoved, // if this entity has touched other entity
  38. FLOATplane3D plCollision, // plane of collision
  39. };
  40. event EPass { // one entity passed through another while moving
  41. CEntityPointer penOther, // other entity
  42. BOOL bThisMoved, // if this entity has touched other entity
  43. };
  44. event EBlock { // ONBLOCK_PUSH or ONBLOCK_STOP entity is blocked
  45. CEntityPointer penOther, // other entity
  46. FLOATplane3D plCollision, // plane of collision
  47. };
  48. event EWouldFall { // entity cannot move or it would fall over an edge
  49. };
  50. event ETeleport { // teleport has been activated in your vicinity
  51. };
  52. event EPreLevelChange { // notifying an entity that a level is about to change
  53. INDEX iUserData,
  54. };
  55. event EPostLevelChange { // notifying an entity that a level has just changed
  56. INDEX iUserData,
  57. };
  58. event EFirstWorldBase { // notifying an entity that it is the first worldbase in the world
  59. };
  60. enum DamageType {
  61. 1 DMT_EXPLOSION "Explosion", // caused by dynamites, rockets and other ordinary explosives
  62. 2 DMT_PROJECTILE "Projectile", // caused by projectile (non exploding)
  63. 3 DMT_CLOSERANGE "Close range", // caused by close range weapon (chainsaw, head-saw, ...)
  64. 4 DMT_BULLET "Bullets", // caused by ordinary bullets from pistols, rifles etc.
  65. 5 DMT_DROWNING "Drowning", // caused by being without air for too long
  66. 6 DMT_IMPACT "Impact", // caused by impact with some object at high relative velocity
  67. 7 DMT_BRUSH "Brush", // caused by moving brush
  68. 8 DMT_BURNING "Burning", // caused by being burned by fire or lava
  69. 9 DMT_ACID "Acid", // caused by being burned by acid
  70. 10 DMT_TELEPORT "Teleport", // applied to entities in teleport destination
  71. 11 DMT_FREEZING "Freezing", // caused by freezing in cold water
  72. 12 DMT_CANNONBALL "Cannon ball", // caused by cannon ball
  73. 13 DMT_CANNONBALL_EXPLOSION "Cannon ball explosion", // when cannonball explodes
  74. 14 DMT_SPIKESTAB "Spike stab", // stabbed by spikes (usually content type)
  75. 15 DMT_ABYSS "Abyss", // when someone falls off a high ledge into the void
  76. 16 DMT_HEAT "Heat", // walking under open sun too long
  77. 17 DMT_DAMAGER "Damager", // caused by damager
  78. 18 DMT_CHAINSAW "Chain saw", // caused by chainsaw
  79. 9999 DMT_NONE "no damage", // internal
  80. };
  81. event EDamage { // entity has been damaged
  82. CEntityPointer penInflictor, // entity that inflicted the damage
  83. FLOAT3D vDirection, // where the damage came from (in absolute space)
  84. FLOAT3D vHitPoint, // where the damage hit the entity (in absolute space)
  85. FLOAT fAmount, // amount of damage done
  86. enum DamageType dmtType, // type of damage
  87. };
  88. event EDeath { // when this entity dies (health reaches zero)
  89. EDamage eLastDamage, // the damage event that caused the death
  90. };
  91. event ETakingBreath { // when this entity takes air after being without it for some time
  92. FLOAT fBreathDelay, // how long it was without air (0=little, 1=drowning)
  93. };