| 1 | |
| 2 | /** |
| 3 | * |
| 4 | * @file jj1event.h |
| 5 | * |
| 6 | * Part of the OpenJazz project |
| 7 | * |
| 8 | * @par History: |
| 9 | * - 23rd August 2005: Created OpenJazz.h |
| 10 | * - 31st January 2006: Created level.h from parts of OpenJazz.h |
| 11 | * - 4th February 2009: Created events.h from parts of level.h |
| 12 | * - 11th February 2009: Created bullet.h from parts of events.h |
| 13 | * - 1st March 2009: Created bird.h from parts of events.h |
| 14 | * - 19th July 2009: Renamed events.h to event.h |
| 15 | * - 2nd March 2010: Created guardians.h from parts of event.h |
| 16 | * - 1st August 2012: Renamed event.h to jj1event.h |
| 17 | * |
| 18 | * @par Licence: |
| 19 | * Copyright (c) 2005-2012 AJ Thomson |
| 20 | * |
| 21 | * OpenJazz is distributed under the terms of |
| 22 | * the GNU General Public License, version 2.0 |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | |
| 27 | #ifndef _EVENT_H |
| 28 | #define _EVENT_Hcxx . . $ `src/jj1/level/event/jj1event.h:28:9`! |
| 29 | |
| 30 | |
| 31 | #include "../jj1level.h"cxx . . $ `<file>/src/jj1/level/jj1level.h`/ |
| 32 | |
| 33 | #include "io/gfx/anim.h"cxx . . $ `<file>/src/io/gfx/anim.h`/ |
| 34 | #include "level/movable.h"cxx . . $ `<file>/src/level/movable.h`/ |
| 35 | #include "OpenJazz.h"cxx . . $ `<file>/src/OpenJazz.h`/ |
| 36 | |
| 37 | |
| 38 | // Constants |
| 39 | |
| 40 | // Animations |
| 41 | #define E_LEFTANIMcxx . . $ `src/jj1/level/event/jj1event.h:41:9`! 0 |
| 42 | #define E_RIGHTANIMcxx . . $ `src/jj1/level/event/jj1event.h:42:9`! 1 |
| 43 | #define E_LFINISHANIMcxx . . $ `src/jj1/level/event/jj1event.h:43:9`! 2 |
| 44 | #define E_RFINISHANIMcxx . . $ `src/jj1/level/event/jj1event.h:44:9`! 3 |
| 45 | #define E_LSHOOTANIMcxx . . $ `src/jj1/level/event/jj1event.h:45:9`! 4 |
| 46 | #define E_RSHOOTANIMcxx . . $ `src/jj1/level/event/jj1event.h:46:9`! 5 |
| 47 | #define E_NOANIMcxx . . $ `src/jj1/level/event/jj1event.h:47:9`! 6 |
| 48 | |
| 49 | // Delays |
| 50 | #define T_FLASHcxx . . $ `src/jj1/level/event/jj1event.h:50:9`! 100 |
| 51 | |
| 52 | // Speed factors |
| 53 | #define ES_SLOWcxx . . $ `src/jj1/level/event/jj1event.h:53:9`! ITOF(80) |
| 54 | #define ES_FASTcxx . . $ `src/jj1/level/event/jj1event.h:54:9`! ITOF(240) |
| 55 | |
| 56 | |
| 57 | // Classes |
| 58 | |
| 59 | class Animcxx . . $ Anim#; |
| 60 | class JJ1LevelPlayercxx . . $ JJ1LevelPlayer#; |
| 61 | |
| 62 | /// JJ1 level event |
| 63 | class JJ1Eventcxx . . $ JJ1Event# : public Movablecxx . . $ Movable# { |
| 64 | |
| 65 | private: |
| 66 | void calcDimensionscxx . . $ JJ1Event#calcDimensions(49f6e7a06ebc5aa8). (); |
| 67 | |
| 68 | protected: |
| 69 | JJ1Eventcxx . . $ JJ1Event#* nextcxx . . $ JJ1Event#next.; ///< Next event |
| 70 | JJ1EventTypecxx . . $ JJ1EventType#* setcxx . . $ JJ1Event#set.; ///< Type |
| 71 | Animcxx . . $ Anim#* animcxx . . $ JJ1Event#anim.; ///< Current animation |
| 72 | fixedcxx . . $ fixed# drawnXcxx . . $ JJ1Event#drawnX., drawnYcxx . . $ JJ1Event#drawnY.; ///< Current drawing co-ordinates |
| 73 | fixedcxx . . $ fixed# widthcxx . . $ JJ1Event#width., heightcxx . . $ JJ1Event#height.; ///< Current dimensions |
| 74 | unsigned char gridXcxx . . $ JJ1Event#gridX., gridYcxx . . $ JJ1Event#gridY.; ///< Grid position of the event |
| 75 | unsigned char animTypecxx . . $ JJ1Event#animType.; ///< Animation type (E_LEFTANIM, etc.) |
| 76 | unsigned int flashTimecxx . . $ JJ1Event#flashTime.; ///< Time flash will end |
| 77 | bool noAnimOffsetcxx . . $ JJ1Event#noAnimOffset.; |
| 78 | |
| 79 | JJ1Eventcxx . . $ JJ1Event#JJ1Event(8fbe6856f5410d23). (unsigned char gX, unsigned char gY); |
| 80 | |
| 81 | JJ1Eventcxx . . $ JJ1Event#* removecxx . . $ JJ1Event#remove(953c18bf09d857ef). (bool permanently); |
| 82 | void destroycxx . . $ JJ1Event#destroy(cb2f890c2fdad230). (unsigned int ticks); |
| 83 | |
| 84 | void setAnimTypecxx . . $ JJ1Event#setAnimType(ac50b47256ae7414). (unsigned char type); |
| 85 | void setAnimFramecxx . . $ JJ1Event#setAnimFrame(918ebd27a9ddbad3). (int frame, bool looping); |
| 86 | |
| 87 | JJ1EventTypecxx . . $ JJ1EventType#* prepareStepcxx . . $ JJ1Event#prepareStep(265b63775edc5f6e). (unsigned int ticks); |
| 88 | |
| 89 | public: |
| 90 | virtual ~cxx . . $ JJ1Event#`~JJ1Event`(49f6e7a06ebc5aa8).JJ1Eventcxx . . $ JJ1Event# (); |
| 91 | |
| 92 | JJ1Eventcxx . . $ JJ1Event#* getNextcxx . . $ JJ1Event#getNext(31caec775bb17100). (); |
| 93 | bool hitcxx . . $ JJ1Event#hit(a041df1a1d9c3254). (JJ1LevelPlayercxx . . $ JJ1LevelPlayer# *source, int hits, unsigned int ticks); |
| 94 | bool isEnemycxx . . $ JJ1Event#isEnemy(c9857a73d68e59ba). (); |
| 95 | bool isFromcxx . . $ JJ1Event#isFrom(4ed805b44025c28a). (unsigned char gX, unsigned char gY); |
| 96 | bool overlapcxx . . $ JJ1Event#overlap(a1642a0ee405ca20). (fixedcxx . . $ fixed# areaX, fixedcxx . . $ fixed# areaY, fixedcxx . . $ fixed# areaWidth, fixedcxx . . $ fixed# areaHeight); |
| 97 | |
| 98 | virtual JJ1Eventcxx . . $ JJ1Event#* stepcxx . . $ JJ1Event#step(96f3a021ae50222d). (unsigned int ticks) = 0; |
| 99 | virtual void drawcxx . . $ JJ1Event#draw(3d89109e85ced1be). (unsigned int ticks, int change) = 0; |
| 100 | void drawEnergycxx . . $ JJ1Event#drawEnergy(cb2f890c2fdad230). (unsigned int ticks); |
| 101 | |
| 102 | }; |
| 103 | |
| 104 | /// Standard JJ1 level event |
| 105 | class JJ1StandardEventcxx . . $ JJ1StandardEvent# : public JJ1Eventcxx . . $ JJ1Event# { |
| 106 | |
| 107 | private: |
| 108 | fixedcxx . . $ fixed# nodecxx . . $ JJ1StandardEvent#node.; ///< Current event path node |
| 109 | bool onlyLAnimOffsetcxx . . $ JJ1StandardEvent#onlyLAnimOffset.; |
| 110 | bool onlyRAnimOffsetcxx . . $ JJ1StandardEvent#onlyRAnimOffset.; |
| 111 | |
| 112 | void movecxx . . $ JJ1StandardEvent#move(cb2f890c2fdad230). (unsigned int ticks); |
| 113 | |
| 114 | public: |
| 115 | JJ1StandardEventcxx . . $ JJ1StandardEvent#JJ1StandardEvent(37c98e2d42f366f9). (JJ1EventTypecxx . . $ JJ1EventType#* event, unsigned char gX, unsigned char gY, fixedcxx . . $ fixed# startX, fixedcxx . . $ fixed# startY); |
| 116 | |
| 117 | JJ1Eventcxx . . $ JJ1Event#* stepcxx . . $ JJ1StandardEvent#step(96f3a021ae50222d). (unsigned int ticks) override; |
| 118 | void drawcxx . . $ JJ1StandardEvent#draw(3d89109e85ced1be). (unsigned int ticks, int change) override; |
| 119 | |
| 120 | }; |
| 121 | |
| 122 | /// JJ1 level bridge |
| 123 | class JJ1Bridgecxx . . $ JJ1Bridge# : public JJ1Eventcxx . . $ JJ1Event# { |
| 124 | |
| 125 | private: |
| 126 | fixedcxx . . $ fixed# leftDipXcxx . . $ JJ1Bridge#leftDipX.; |
| 127 | fixedcxx . . $ fixed# rightDipXcxx . . $ JJ1Bridge#rightDipX.; |
| 128 | |
| 129 | public: |
| 130 | JJ1Bridgecxx . . $ JJ1Bridge#JJ1Bridge(8fbe6856f5410d23). (unsigned char gX, unsigned char gY); |
| 131 | |
| 132 | JJ1Eventcxx . . $ JJ1Event#* stepcxx . . $ JJ1Bridge#step(96f3a021ae50222d). (unsigned int ticks) override; |
| 133 | void drawcxx . . $ JJ1Bridge#draw(3d89109e85ced1be). (unsigned int ticks, int change) override; |
| 134 | |
| 135 | }; |
| 136 | |
| 137 | #endif |
| 138 |