Browse Source

Aktionen zum ändern von Spieler Eigenschafften fertig

Kolja Strohm 5 years ago
parent
commit
0740e4860b

+ 798 - 2
StickmanWorldOnline/Aktionen.cpp

@@ -475,7 +475,7 @@ bool SpielEnde::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemor
         Variable *t = zMemory->zVariable( "__return__" );
         if( !t || ( t->getVariableTyp() != TEAM && t->getVariableTyp() != NICHTS ) )
             return 1;
-        zSpiel->setEnde( t->getVariableTyp() == NICHTS ? 0 : (Team*)t );
+        zSpiel->setEnde( t->getVariableTyp() == NICHTS ? 0 : (Team *)t );
         return 1;
     }
 }
@@ -522,8 +522,804 @@ bool SpielerSetLevel::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *
                 return 1;
             }
             ( (Spieler *)t )->setLevel( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerGiveItem::SpielerGiveItem( Aktion *item, Aktion *anzahl, Aktion *spieler )
+    : Aktion( SPIELER_GIVE_ITEM )
+{
+    this->item = item;
+    this->anzahl = anzahl;
+    this->spieler = spieler;
+}
+
+SpielerGiveItem::~SpielerGiveItem()
+{}
+
+bool SpielerGiveItem::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( item->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != GEGENSTAND_TYP )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( anzahl->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != INTEGER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 2 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->addItem( ( (GegenstandTypVar *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue(),
+                ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue(), zSpiel );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerRemoveItem::SpielerRemoveItem( Aktion *item, Aktion *anzahl, Aktion *spieler )
+    : Aktion( SPIELER_REMOVE_ITEM )
+{
+    this->item = item;
+    this->anzahl = anzahl;
+    this->spieler = spieler;
+}
+
+SpielerRemoveItem::~SpielerRemoveItem()
+{
+    item->release();
+    anzahl->release();
+    spieler->release();
+}
+
+bool SpielerRemoveItem::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( item->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != GEGENSTAND_TYP )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( anzahl->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != INTEGER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 2 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->removeItem( ( (GegenstandTypVar *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue(),
+                ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetPosition::SpielerSetPosition( Aktion *x, Aktion *y, Aktion *spieler )
+    : Aktion( SPIELER_SET_POSITION )
+{
+    this->x = x;
+    this->y = y;
+    this->spieler = spieler;
+}
+
+SpielerSetPosition::~SpielerSetPosition()
+{
+    x->release();
+    y->release();
+    spieler->release();
+}
+
+bool SpielerSetPosition::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( x->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( y->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 2 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            ( (Spieler *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetLeben::SpielerSetLeben( Aktion *leben, Aktion *spieler )
+    : Aktion( SPIELER_SET_LEBEN )
+{
+    this->leben = leben;
+    this->spieler = spieler;
+}
+
+SpielerSetLeben::~SpielerSetLeben()
+{
+    leben->release();
+    spieler->release();
+}
+
+bool SpielerSetLeben::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( leben->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setLeben( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetMaxLeben::SpielerSetMaxLeben( Aktion *leben, Aktion *spieler )
+    : Aktion( SPIELER_SET_LEBEN )
+{
+    this->leben = leben;
+    this->spieler = spieler;
+}
+
+SpielerSetMaxLeben::~SpielerSetMaxLeben()
+{
+    leben->release();
+    spieler->release();
+}
+
+bool SpielerSetMaxLeben::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( leben->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != INTEGER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setMaxLeben( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetErfahrung::SpielerSetErfahrung( Aktion *erfahrung, Aktion *spieler )
+    : Aktion( SPIELER_SET_ERFAHRUNG )
+{
+    this->erfahrung = erfahrung;
+    this->spieler = spieler;
+}
+
+SpielerSetErfahrung::~SpielerSetErfahrung()
+{}
+
+bool SpielerSetErfahrung::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( erfahrung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setErfahrung( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetMaxErfahrung::SpielerSetMaxErfahrung( Aktion *erfahrung, Aktion *spieler )
+    : Aktion( SPIELER_SET_MAX_ERFAHRUNG )
+{
+    this->erfahrung = erfahrung;
+    this->spieler = spieler;
+}
+
+SpielerSetMaxErfahrung::~SpielerSetMaxErfahrung()
+{
+    erfahrung->release();
+    spieler->release();
+}
+
+bool SpielerSetMaxErfahrung::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( erfahrung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != INTEGER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setMaxErfahrung( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetTempo::SpielerSetTempo( Aktion *tempo, Aktion *spieler )
+    : Aktion( SPIELER_SET_TEMPO )
+{
+    this->tempo = tempo;
+    this->spieler = spieler;
+}
+
+SpielerSetTempo::~SpielerSetTempo()
+{
+    tempo->release();
+    spieler->release();
+}
+
+bool SpielerSetTempo::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( tempo->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setLaufTempo( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetWaffenTempo::SpielerSetWaffenTempo( Aktion *tempo, Aktion *spieler )
+    : Aktion( SPIELER_SET_GESCHOSS_TEMPO )
+{
+    this->tempo = tempo;
+    this->spieler = spieler;
+}
+
+SpielerSetWaffenTempo::~SpielerSetWaffenTempo()
+{
+    tempo->release();
+    spieler->release();
+}
+
+bool SpielerSetWaffenTempo::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( tempo->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setGeschossTempo( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetArmor::SpielerSetArmor( Aktion *armor, Aktion *spieler )
+    : Aktion( SPIELER_SET_ARMOR )
+{
+    this->armor = armor;
+    this->spieler = spieler;
+}
+
+SpielerSetArmor::~SpielerSetArmor()
+{
+    armor->release();
+    spieler->release();
+}
+
+bool SpielerSetArmor::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( armor->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setArmor( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetSchadenBonus::SpielerSetSchadenBonus( Aktion *bonus, Aktion *spieler )
+    : Aktion( SPIELER_SET_SCHADEN_BONUS )
+{
+    this->bonus = bonus;
+    this->spieler = spieler;
+}
+
+SpielerSetSchadenBonus::~SpielerSetSchadenBonus()
+{
+    bonus->release();
+    spieler->release();
+}
+
+bool SpielerSetSchadenBonus::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( bonus->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setSchadenBonus( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetLebensraub::SpielerSetLebensraub( Aktion *lebensraub, Aktion *spieler )
+    : Aktion( SPIELER_SET_LEBENSRAUB )
+{
+    this->lebensraub = lebensraub;
+    this->spieler = spieler;
+}
+
+SpielerSetLebensraub::~SpielerSetLebensraub()
+{
+    lebensraub->release();
+    spieler->release();
+}
+
+bool SpielerSetLebensraub::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( lebensraub->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setLebensRaub( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetLebensregeneration::SpielerSetLebensregeneration( Aktion *regeneration, Aktion *spieler )
+    : Aktion( SPIELER_SET_LEBENSRAUB )
+{
+    this->regeneration = regeneration;
+    this->spieler = spieler;
+}
+
+SpielerSetLebensregeneration::~SpielerSetLebensregeneration()
+{
+    regeneration->release();
+    spieler->release();
+}
+
+bool SpielerSetLebensregeneration::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( regeneration->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setLebensRegeneration( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+SpielerSetAbklingzeitverringerung::SpielerSetAbklingzeitverringerung( Aktion *verringerung, Aktion *spieler )
+    : Aktion( SPIELER_SET_ABKLINGZEITVERRINGERUNG )
+{
+    this->verringerung = verringerung;
+    this->spieler = spieler;
+}
+
+SpielerSetAbklingzeitverringerung::~SpielerSetAbklingzeitverringerung()
+{
+    verringerung->release();
+    spieler->release();
+}
+
+bool SpielerSetAbklingzeitverringerung::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( verringerung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != SPIELER )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Spieler *)t )->setAbklingZeitVerringerung( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
+        }
+    }
+    zPC->stepOut();
+    return 0;
+}
+
+
+DropSetTime::DropSetTime( Aktion *time, Aktion *drop )
+    : Aktion( DROP_SET_TIME )
+{
+    this->time = time;
+    this->drop = drop;
+}
+
+DropSetTime::~DropSetTime()
+{
+    time->release();
+    drop->release();
+}
+
+bool DropSetTime::runNext( Spiel * zSpiel, Ereignis * zEreignis, LocalMemory * zMemory, ProgramCounter * zPC, double &waitCount )
+{
+    zPC->stepIn();
+    if( zPC->currentPosition() == 0 )
+    {
+        if( time->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != FLOAT )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
+            zPC->count();
+        }
+    }
+    if( zPC->currentPosition() == 1 && waitCount <= 0 )
+    {
+        if( drop->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
+        {
+            Variable *t = zMemory->zVariable( "__return__" );
+            if( !t || t->getVariableTyp() != DROP )
+            {
+                zPC->stepOut();
+                return 1;
+            }
+            ( (Drop *)t )->setTime( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
+            zPC->stepOut();
+            return 1;
         }
     }
     zPC->stepOut();
     return 0;
-}
+}

+ 6 - 6
StickmanWorldOnline/Aktionen.h

@@ -468,11 +468,11 @@ public:
 class SpielerSetErfahrung : public Aktion
 {
 private:
-    Aktion *erfahrunNextg;
+    Aktion *erfahrung;
     Aktion *spieler;
 
 public:
-    SpielerSetErfahrung( Aktion *erfahrunNextg, Aktion *spieler );
+    SpielerSetErfahrung( Aktion *erfahrung, Aktion *spieler );
     ~SpielerSetErfahrung();
     bool runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount ) override;
 };
@@ -480,11 +480,11 @@ public:
 class SpielerSetMaxErfahrung : public Aktion
 {
 private:
-    Aktion *erfahrunNextg;
+    Aktion *erfahrung;
     Aktion *spieler;
 
 public:
-    SpielerSetMaxErfahrung( Aktion *erfahrunNextg, Aktion *spieler );
+    SpielerSetMaxErfahrung( Aktion *erfahrung, Aktion *spieler );
     ~SpielerSetMaxErfahrung();
     bool runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount ) override;
 };
@@ -564,11 +564,11 @@ public:
 class SpielerSetAbklingzeitverringerung : public Aktion
 {
 private:
-    Aktion *verringerunNextg;
+    Aktion *verringerung;
     Aktion *spieler;
 
 public:
-    SpielerSetAbklingzeitverringerung( Aktion *verringerunNextg, Aktion *spieler );
+    SpielerSetAbklingzeitverringerung( Aktion *verringerung, Aktion *spieler );
     ~SpielerSetAbklingzeitverringerung();
     bool runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount ) override;
 };

+ 1 - 0
StickmanWorldOnline/Drop.h

@@ -27,6 +27,7 @@ public:
     void setMinY( int y );
     void setMaxY( int y );
     void setMaxTime( int seconds );
+    void setTime( float time );
     void doDrop( Spiel *zSpiel );
     void tick( double time, Spiel *zSpiel );
     int getNumDrops() const;

+ 7 - 0
StickmanWorldOnline/Spieler.h

@@ -103,6 +103,13 @@ public:
     void setLebensRegeneration( float reg );
     // setzt alle eigenschafften, die mit dem level gesetzt werden entsprechend
     void setLevel( int level );
+    void removeItem( GegenstandTyp typ, int anzahl );
+    void setLeben( float leben );
+    void setMaxLeben( int leben );
+    // steuert auch level up oder level downs bei negativer erfahrung
+    void setErfahrung( float erf );
+    void setMaxErfahrung( int erf );
+    void setAbklingZeitVerringerung( float verringerung );
     float getLebensRegenneration() const;
     float getArmor() const;
     float getGeschossTempo() const;