Kolja Strohm 4 éve
szülő
commit
2c9d99a847

+ 1 - 1
StickmanWorldOnline/Schild.cpp

@@ -11,5 +11,5 @@ SchildEffect::~SchildEffect()
 
 bool SchildEffect::istSpielerVerwundbar( Richtung r )
 {
-    return false;
+    return 0;
 }

+ 21 - 0
StickmanWorldOnline/Schuh.cpp

@@ -0,0 +1,21 @@
+#include "Schuh.h"
+#include "Spieler.h"
+
+SchuhEffect::SchuhEffect( Spieler *zSpieler )
+    : Effect( zSpieler, (int)( 20.f + ( 20.f / 100.f ) * zSpieler->getAbklingZeitVerringerung() ) )
+{
+    speedup = 15;
+    zSpieler->setLaufTempo( zSpieler->getLaufTempo() + speedup );
+}
+
+SchuhEffect::~SchuhEffect()
+{
+    zSpieler->setLaufTempo( zSpieler->getLaufTempo() - speedup );
+}
+
+bool SchuhEffect::tick( double time, Spiel *zSpiel )
+{
+    zSpieler->setLaufTempo( zSpieler->getLaufTempo() - ( time / timeLeft ) * speedup );
+    speedup -= ( time / timeLeft ) * speedup;
+    return Effect::tick( time, zSpiel );
+}

+ 2 - 0
StickmanWorldOnline/Schuh.h

@@ -5,8 +5,10 @@
 class SchuhEffect : public Effect
 {
 private:
+    float speedup;
 
 public:
     SchuhEffect( Spieler *zSpieler );
     ~SchuhEffect();
+    bool tick( double time, Spiel *zSpiel ) override;
 };

+ 1 - 0
StickmanWorldOnline/StickmanWorldOnline.vcxproj

@@ -95,6 +95,7 @@
     <ClCompile Include="Schalter.cpp" />
     <ClCompile Include="Schiene.cpp" />
     <ClCompile Include="Schild.cpp" />
+    <ClCompile Include="Schuh.cpp" />
     <ClCompile Include="Spiel.cpp" />
     <ClCompile Include="Spieler.cpp" />
     <ClCompile Include="StrengthRune.cpp" />

+ 3 - 0
StickmanWorldOnline/StickmanWorldOnline.vcxproj.filters

@@ -111,6 +111,9 @@
     <ClCompile Include="Schild.cpp">
       <Filter>Spiel\Effekte</Filter>
     </ClCompile>
+    <ClCompile Include="Schuh.cpp">
+      <Filter>Spiel\Effekte</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="SpielKlasse.h">