Spieler.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #pragma once
  2. #include "Team.h"
  3. #include "Gegenstand.h"
  4. #include "SSKlient.h"
  5. class Effekt
  6. {
  7. private:
  8. Spieler *zSpieler;
  9. double timeLeft;
  10. int ref;
  11. public:
  12. Effekt( Spieler *zSpieler, int maxTime );
  13. virtual bool tick( double time );
  14. Effekt *getThis();
  15. Effekt *release();
  16. };
  17. class DrachenAugeEffekt : public Effekt
  18. {
  19. private:
  20. Spieler *zVerursacher;
  21. public:
  22. DrachenAugeEffekt( Spieler *zVerursacher, Spieler *zOpfer, int maxTime );
  23. bool tick( double time ) override;
  24. };
  25. class Spieler : public GameObject
  26. {
  27. public:
  28. class Style
  29. {
  30. const static int MOVES_RIGHT = 1;
  31. const static int MOVES_LEFT = 2;
  32. const static int MOVES_BOTTOM = 4;
  33. const static int MOVES_TOP = 8;
  34. const static int AM_LEBEN = 0x10;
  35. const static int UNSICHTBAR = 0x20;
  36. const static int ENTERHAKEN_AKTIV = 0x40;
  37. const static int ENTERHAKEN_UNVERWUNDBAR = 0x40;
  38. };
  39. private:
  40. RCArray< Effekt > effekte;
  41. Klient *klient;
  42. int accountId;
  43. int spielerNummer;
  44. Team *team;
  45. int style;
  46. int maxWiederbelebungsZeit;
  47. float wiederbelebungsZeit;
  48. GegenstandTyp zuletztAufgehoben;
  49. GegenstandTyp zuletztAktiviert;
  50. int leben;
  51. int maxLeben;
  52. int level;
  53. int erfahrung;
  54. int maxErfahrung;
  55. int spawnX;
  56. int spawnY;
  57. int laufTempo;
  58. int geschossTempo;
  59. int armor;
  60. int schadensBonus;
  61. int lebensraub;
  62. int lebensRegeneration;
  63. int abklingZeitVerringerung;
  64. int color;
  65. float gegenstandAbklingzeit[ ITEMANZAHL ];
  66. int kills;
  67. int tode;
  68. int treffer;
  69. int getroffen;
  70. int schadenGenommen;
  71. int schadenGemacht;
  72. int lebenGeheilt;
  73. int erhalteneErfahrung;
  74. int itemsAufgehoben;
  75. int itemsVerwendet;
  76. int tunnelBenutzt;
  77. int schalterAktiviert;
  78. int geschosseGeschossen;
  79. char *tastenStand;
  80. public:
  81. Spieler( int id, Team *team, int spawnX, int spawnY, int breite, int height,
  82. int farbe, int leben, int erfahrung, int laufTempo, int geschossTempo,
  83. int armor, int schadenBonus, int lebensraub, int lebensReg,
  84. int abkVerringerung, int level );
  85. ~Spieler();
  86. bool setTastenStand( char taste, bool pressed );
  87. void setTeam( Team *team );
  88. void setAccount( int id );
  89. void setKlient( Klient *klient );
  90. void addEffekt( Effekt *e );
  91. // aktualisiert auch die team statistik
  92. void addKill();
  93. void addTreffer();
  94. void addGetroffen();
  95. void tick( double zeit );
  96. // heilt auch um den lebensraub prozentsatz
  97. void addGemachterSchaden( double schaden );
  98. // zieht die rüstung ab
  99. void nimmSchaden( double schaden );
  100. int getSchadenBonus() const;
  101. Klient *zKlient() const;
  102. int getSpielerNummer() const;
  103. Team *zTeam() const;
  104. int getFarbe() const;
  105. int getAccountId() const;
  106. int getPunkte() const;
  107. bool istAmLeben() const;
  108. };