|
@@ -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;
|
|
|
-}
|
|
|
+}
|