Your code is a little...odd - I'm surprised it compiles, given that there is unreacable code in you Walcz method:
public void Walcz(Zolnierz Z)
{
...
do
{
...
if (...)
{
...
}
else
{
...
} break;
if (Z.Wytrzymalosc == 0)
{
Console.WriteLine("Wygrywa zolnierz 1");
}
else
{
Console.WriteLine("Wygrywa zolnierz 2");
} break;
} while (this.Wytrzymalosc >= 0 || Z.Wytrzymalosc >= 0);
}
The
break
is unconditional, so the loop will only ever execute once.
Which means that the problem is in the if condition above it somewhere.
Without knowing what your code is supposed to do, that looks odd as well: both sides of teh conditional execute the same code, baring only the variable SA1 or SA2 and they both execute the Z instance of the Walcz method with the same instance as a parameter - so when it starts to execute,
this
and Z are the same instance...this feels wrong, even without knowing what is going on.
I don't think there is any good reason for this to be recursive anyway, If all you are doing is removing random hit points (as I am guessing you are) then a loop would be a more natural way to do it.