#pragma once #include "Team.h" #include "Gegenstand.h" #include "SSKlient.h" #include "Effect.h" class Spiel; #define INVENTORY_SLOTS 8 class Inventar { private: GegenstandTyp slots[ INVENTORY_SLOTS ]; int anzahl[ INVENTORY_SLOTS ]; float abklingzeit[ INVENTORY_SLOTS ]; int selected; public: Inventar(); void addItem( GegenstandTyp typ, int anzahl ); void setSelected( int slot ); GegenstandTyp useItem(); void tick( double zeit ); bool canAddItem( GegenstandTyp typ ) const; GegenstandTyp selectedItem() const; }; class Spieler : public GameObject { private: RCArray< Effect > effekte; Klient *klient; int accountId; int spielerNummer; Team *team; bool amLeben; int maxWiederbelebungsZeit; float wiederbelebungsZeit; GegenstandTyp zuletztAufgehoben; GegenstandTyp zuletztAktiviert; float leben; int maxLeben; int level; float erfahrung; int maxErfahrung; int spawnX; int spawnY; float laufTempo; float geschossTempo; float armor; float schadensBonus; float lebensraub; float lebensRegeneration; float abklingZeitVerringerung; int color; int kills; int tode; int treffer; int getroffen; float schadenGenommen; float schadenGemacht; float lebenGeheilt; float erhalteneErfahrung; int itemsAufgehoben; int itemsVerwendet; int tunnelBenutzt; int schalterAktiviert; int geschosseGeschossen; bool tastenStand[ 256 ]; Richtung ausrichtung; Inventar inv; public: Spieler( int id, Team *team, int spawnX, int spawnY, int farbe ); ~Spieler(); bool setTastenStand( unsigned char taste, bool pressed ); void setTeam( Team *team ); void setAccount( int id ); void setKlient( Klient *klient ); void addEffekt( Effect *e ); void setLaufTempo( float pps ); void addErfahrung( float anz, Spiel *zSpiel ); // aktualisiert auch die team statistik void addKill(); void addTreffer( Spiel *zSpiel ); void addGetroffen(); void move( double zeit ); void wiederbelebung( Spiel *zSpiel ); void tick( double zeit, Spiel *zSpiel ); void useItem(Spiel *zSpiel); bool addItem( GegenstandTyp typ, int anz, Spiel *zSpiel ); // heilt auch um den lebensraub prozentsatz void addGemachterSchaden( float schaden, Spiel *zSpiel ); // zieht die rüstung ab void nimmSchaden( float schaden, Spieler *zVerursacher, Richtung r, Spiel *zSpiel ); void heilung( float heal, Spiel *zSpiel ); float getSchadenBonus() const; Klient *zKlient() const; int getSpielerNummer() const; Team *zTeam() const; int getFarbe() const; int getAccountId() const; int getPunkte() const; bool istAmLeben() const; float getLaufTempo() const; bool isVerwundbar( Richtung r ) const; bool istBeweglich( Richtung r ) const; bool istSichtbar( Team *zTeam ) const; bool istGegenstandErlaubt( GegenstandTyp typ ) const; Richtung getAusrichtung() const; };