]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Person.cpp
Stopped using Account pointers, and removed general difficulty setting (difficulty...
[lugaru.git] / Source / Person.cpp
index cada57b293cdaa13af7c2ce55179d1cd23ff92c1..fb3c4450112b84200270596827ad267ca97d4df8 100644 (file)
@@ -1468,14 +1468,15 @@ void Person::Reverse()
     velocity = 0;
     victim->velocity = 0;
 
-    if (aitype != playercontrolled)
+    if (aitype != playercontrolled) {
         feint = 0;
-    if (aitype != playercontrolled && Random() % 3 == 0 && escapednum < 2 && difficulty == 2)
-        feint = 1;
-    if (aitype != playercontrolled && Random() % 5 == 0 && escapednum < 2 && difficulty == 1)
-        feint = 1;
-    if (aitype != playercontrolled && Random() % 10 == 0 && escapednum < 2 && difficulty == 0)
-        feint = 1;
+        if (escapednum < 2) {
+            int chances = ((difficulty == 2) ? 3 : ((difficulty == 1) ? 5 : 10));
+            if ((Random() % chances) == 0) {
+                feint = 1;
+            }
+        }
+    }
 
     if (victim->id == 0 && Animation::animations[victim->animTarget].attack == reversal)
         numreversals++;