Bladeren bron

Noch mehr definitionen

Kolja Strohm 6 jaren geleden
bovenliggende
commit
1f3ce31ddf

+ 38 - 15
StickmanWorldOnline/Bariere.h

@@ -1,23 +1,46 @@
 #pragma once
 
 #include "GameObject.h"
+#include "Team.h"
+#include "Timer.h"
 
 class Bariere : public GameObject
 {
+public:
+    class Style
+    {
+    public:
+        const static int AutoSchaltung = 0x1;
+        const static int AutoVerschiebung = 0x2;
+        const static int InSchaltung = 0x4;
+        const static int InVerschiebung = 0x8;
+        const static int VerschiebungWaagerecht = 0x10;
+        const static int NextVerschiebungLinksOben = 0x20;
+        const static int Aktiv = 0x40;
+    };
 private:
-    bool ü = true;
-    bool schaltung = false;
-    bool verschieben = false;
-    bool oben = false;
-    bool links = false;
-    int zufallv = 0;
-    int zufalls = 0;
-    bool ver = false;
-    bool sch = false;
-    int verw = 0;
-    bool verwaag = false;
-    int versch = 0;
-    int schalt = 0;
-    int team;
-    bool w = false;
+    int style;
+    int autoSchaltungMaxTime;
+    float autoSchaltungCurrentTime;
+    int verschiebungWeite;
+    float currentWeite;
+    int verschiebungAnzahl;
+    int schaltungAnzahl;
+    Team *team;
+
+public:
+    Bariere( int x, int y, int breite, int height, int style, int verschiebungWeite = 0, int autoSchaltungMaxTime = 0, Team *team = 0 );
+    ~Bariere();
+    void setStyle( int style, bool add );
+    void setAutoVerschiebungWeite( int pixel );
+    void startAutoVerschiebung();
+    void setAutoSchaltungMaxTime( int seconds );
+    void startAutoSchaltung();
+    void setTeam( Team *team );
+    void tick( float time );
+    bool hatStyle( int style ) const;
+    int getVerschiebungAnzahl() const;
+    int getSchaltungAnzahl() const;
+    Team *getTeam() const;
+    Team *zTeam() const;
 };

+ 15 - 1
StickmanWorldOnline/Base.h

@@ -1,9 +1,23 @@
 #pragma once
 
 #include "GameObject.h"
+#include "Team.h"
 
 class Base : public GameObject
 {
 private:
-    int team;
+    Team *team;
+    int maxTime;
+    bool inChange;
+    Team *nextTeam;
+    float leftTime;
+
+public:
+    Base( int x, int y, int width, int height, int maxTime = 10, Team *team = 0 );
+    ~Base();
+    void setTeam( Team *team );
+    void tick( float time );
+    void startChange( Team *team );
+    Team *getTeam() const;
+    Team *zTeam() const;
 };

+ 27 - 0
StickmanWorldOnline/Drop.h

@@ -1,8 +1,35 @@
 #pragma once
 
 #include "Variablen.h"
+#include "Gegenstand.h"
 
 class Drop : public Variable
 {
+private:
+    Text name;
+    int minX;
+    int maxX;
+    int minY;
+    int maxY;
+    int maxTime;
+    float nextDrop;
+    int numDrops;
+    float wahrscheinlichkeit[ ITEMANZAHL ];
 
+public:
+    Drop( int minX, int maxX, int minY, int maxY, int maxTime, int numDrops, const char *name, float wkeit[ ITEMANZAHL ] );
+    ~Drop();
+    void setMinX( int x );
+    void setMaxX( int x );
+    void setMinY( int y );
+    void setMaxY( int y );
+    void setMaxTime( int seconds );
+    void doDrop();
+    void tick( float time );
+    int getNumDrops() const;
+    int getMinX() const;
+    int getMaxX() const;
+    int getMinY() const;
+    int getMaxY() const;
+    int getMaxTime() const;
 };

+ 9 - 1
StickmanWorldOnline/GameObject.h

@@ -2,10 +2,18 @@
 
 #include "Variablen.h"
 
+enum Richtung
+{
+    OBEN,
+    RECHTS,
+    UNTEN,
+    LINKS
+};
+
 class GameObject : public Variable
 {
 protected:
-    int x, y, w, h;
+    float x, y, w, h;
 
 public:
     GameObject();

+ 14 - 6
StickmanWorldOnline/Gegenstand.h

@@ -13,18 +13,26 @@ enum GegenstandTyp
     ROLLE,
     STURM,
     DRACHENAUGE,
-    RUNE_WEISSHEIT,
-    RUNE_STAERKE,
-    RUNE_BOSSHEIT,
-    RUNE_LEBEN,
-    RUNE_TEMPO,
     FEUERBALL,
     ENTERHAKEN,
-    MINE
+    MINE,
+    RWEISHEIT,
+    RSTRENGTH,
+    RBOSHEIT,
+    RLEBEN,
+    RTEMPO,
+    ITEMANZAHL,
+    NICHTS
 };
 
 class Gegenstand : public GameObject
 {
 private:
     GegenstandTyp typ;
+    bool onMap;
+
+public:
+    Gegenstand( GegenstandTyp typ, bool onMap = 0, int x = 0, int y = 0, int w = 50, int h = 50 );
+    ~Gegenstand();
+    bool isOnMap() const;
 };

+ 42 - 0
StickmanWorldOnline/Geschoss.h

@@ -0,0 +1,42 @@
+#pragma once
+
+#include "GameObject.h"
+#include "Spieler.h"
+
+enum GeschossTyp
+{
+    PFEIL,
+    KUGEL,
+    DRACHENAUGE,
+    FEUERBALL
+};
+
+class Geschoss : public GameObject
+{
+private:
+    float speed;
+    Richtung richtung;
+    Spieler *besitzer;
+    GeschossTyp typ;
+    int tunnelBenutzt;
+    bool alive;
+    int umgelenkt;
+    int geschosseGetroffen;
+
+public:
+    Geschoss( float speed, GeschossTyp typ, Richtung r, int x, int y, Spieler *besitzer );
+    ~Geschoss();
+    void tick( double zeit );
+};
+
+class FeuerballTreffer : public GameObject
+{
+private:
+    Spieler *besitzer;
+    float timeLeft;
+
+public:
+    FeuerballTreffer( int x, int y, Spieler *besitzer, int maxZeit );
+    ~FeuerballTreffer();
+    void tick( double zeit );
+};

+ 9 - 1
StickmanWorldOnline/Schalter.h

@@ -5,6 +5,14 @@
 class Schalter : public GameObject
 {
 private:
-    bool ak = true;
+    bool aktiv = true;
     int aktivierungen = 0;
+
+public:
+    Schalter( int x, int y, int width, int height, bool aktive );
+    ~Schalter();
+    void setAktive() const;
+    void press();
+    int getAnzahlAktivierungen() const;
+    bool isAktive() const;
 };

+ 2 - 1
StickmanWorldOnline/Schiene.h

@@ -4,5 +4,6 @@
 
 class Schiene : public GameObject
 {
-
+public:
+    Schiene( int x, int y, int width, int height );
 };

+ 63 - 0
StickmanWorldOnline/Spieler.h

@@ -0,0 +1,63 @@
+#pragma once
+
+#include "GameObject.h"
+#include "Team.h"
+#include "Gegenstand.h"
+
+class Spieler : public GameObject
+{
+public:
+    class Style
+    {
+        const static int MOVES_RIGHT = 1;
+        const static int MOVES_LEFT = 2;
+        const static int MOVES_BOTTOM = 4;
+        const static int MOVES_TOP = 8;
+        const static int AM_LEBEN = 0x10;
+        const static int UNSICHTBAR = 0x20;
+        const static int ENTERHAKEN_AKTIV = 0x40;
+        const static int ENTERHAKEN_UNVERWUNDBAR = 0x40;
+    };
+private:
+    int spielerNummer;
+    Team *team;
+    int style;
+    int maxWiederbelebungsZeit;
+    float wiederbelebungsZeit;
+    GegenstandTyp zuletztAufgehoben;
+    GegenstandTyp zuletztAktiviert;
+    int leben;
+    int maxLeben;
+    int level;
+    int erfahrung;
+    int maxErfahrung;
+    int spawnX;
+    int spawnY;
+    int laufTempo;
+    int geschossTempo;
+    int armor;
+    int schadensBonus;
+    int lebensraub;
+    int lebensregeneration;
+    int abklingZeitVerringerung;
+    int color;
+    float gegenstandAbklingzeit[ ITEMANZAHL ];
+    int kills;
+    int tode;
+    int treffer;
+    int getroffen;
+    int schadenGenommen;
+    int schadenGemacht;
+    int lebenGeheilt;
+    int erhalteneErfahrung;
+    int itemsAufgehoben;
+    int itemsVerwendet;
+    int tunnelBenutzt;
+    int schalterAktiviert;
+    int geschosseGeschossen;
+
+public:
+    Spieler( int id, Team *team, int spawnX, int spawnY, int breite, int height );
+    ~Spieler();
+
+};

+ 2 - 0
StickmanWorldOnline/StickmanWorldOnline.vcxproj

@@ -81,6 +81,8 @@
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="Aktionen.h" />
+    <ClInclude Include="Geschoss.h" />
+    <ClInclude Include="Spieler.h" />
     <ClInclude Include="Trigger.h" />
     <ClInclude Include="Bariere.h" />
     <ClInclude Include="Base.h" />

+ 6 - 0
StickmanWorldOnline/StickmanWorldOnline.vcxproj.filters

@@ -98,5 +98,11 @@
     <ClInclude Include="Trigger.h">
       <Filter>Spiel\Auslöser</Filter>
     </ClInclude>
+    <ClInclude Include="Spieler.h">
+      <Filter>Spiel\System</Filter>
+    </ClInclude>
+    <ClInclude Include="Geschoss.h">
+      <Filter>Spiel\System</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>

+ 22 - 8
StickmanWorldOnline/Team.h

@@ -1,13 +1,27 @@
 #pragma once
 
-class Team
+#include "Variablen.h"
+
+class Team : Variable
 {
 private:
-    int wbz = 5;
-    int Tode = 0;
-    int Kills = 0;
-    int Punkte = 5;
-    int Teamnummer = 0;
-    int panzahl;
-    bool verloren = false;
+    int maxWiederbelebungsZeit;
+    int tode;
+    int kills;
+    int punkte;
+    int teamnummer;
+    int spielerAnzahl;
+
+public:
+    Team( int id, int spielerAnzahl, int punkte, int maxWiederbelebungZeit );
+    void setMaxWiederbelebungsZeit( int sekunden ) const;
+    void addTod() const;
+    void addKill() const;
+    void addPunkte( int punkte ) const;
+    int getMaxWiederbelebungsZeit() const;
+    int getTode() const;
+    int getKills() const;
+    int getPunkte() const;
+    int getTeamNummer() const;
+    int getSpielerAnzahl() const;
 };

+ 24 - 4
StickmanWorldOnline/Timer.h

@@ -5,8 +5,28 @@
 class Timer : public GameObject
 {
 private:
-    bool läuft = false;
-    bool pause = false;
-    int maxz;
-    bool wh = false;
+    Text name;
+    bool runns;
+    bool pause;
+    int farbe;
+    int maxZeit;
+    float currentTime;
+    bool autoWiederhohlung;
+    bool sichtbar;
+
+public:
+    Timer( const char *name, int maxZeit, int x, int y, bool visible = 1, bool autoWiederhohlung = 0, bool runns = 0, int farbe = 0xFFFFFFFF );
+    void start( bool restart = 0 );
+    void setPause( bool pause );
+    void setMaxZeit( int sekunden );
+    void setAutoWiederhohlung( bool wiederhohlung );
+    void setSichtbar( bool visible );
+    void setFarbe( int farbe );
+    bool tick( double time );
+    bool istSichtbar() const;
+    int getFarbe() const;
+    bool isRunning() const;
+    bool istPausiert() const;
+    int getMaxTime() const;
+    bool istAutoWiederhohlung() const;
 };

+ 15 - 2
StickmanWorldOnline/Tunnel.h

@@ -4,6 +4,19 @@
 
 class Tunnel : public GameObject
 {
-    bool ak = true;
-    int benutzt = 0;
+private:
+    bool aktiv;
+    int benutzt;
+    int zielX;
+    int zielY;
+
+public:
+    Tunnel( int x, int y, int width, int height, int zielX, int zielY, bool aktiv );
+    void setZielX( int x );
+    int setZielY( int y );
+    void addBenutzung();
+    void setAktiv( bool aktiv );
+    int getZielX() const;
+    int getZielY() const;
+    bool istAktiv() const;
 };

+ 20 - 6
StickmanWorldOnline/Umlenkung.h

@@ -5,10 +5,24 @@
 class Umlenkung : public GameObject
 {
 private:
-    char *r;
-    bool d;
-    bool abk = false;
-    int abki = 0;
-    int benutzt = 0;
-    int max_Abk = 10;
+    Richtung richtung;
+    bool drehend;
+    bool aktiv;
+    int benutzt;
+    int maxAbklingzeit;
+    float abklingzeitVerbleibend;
+
+public:
+    Umlenkung( int x, int y, int breite, int height, Richtung richtung, int maxAbklingzeit, bool drehend, bool aktiv );
+    void setMaxAbklingzeit( int sekunden );
+    void setAktiv( bool aktiv );
+    void setDrehend( bool drehend );
+    void setRichtung( Richtung r );
+    void addBenutzt();
+    void tick( double time );
+    bool isAktive() const;
+    bool hatAbklingzeit() const;
+    bool istDrehend() const;
+    int getMaxAbklingzeit() const;
+    Richtung getRichtung() const;
 };