SWY1985 / CivOne

An open source implementation of Sid Meier's Civilization.
http://www.civone.org/
Creative Commons Zero v1.0 Universal
244 stars 49 forks source link

Units do not gain veteran status from winning a battle (unsure) #353

Closed AlexFolland closed 7 years ago

AlexFolland commented 7 years ago

According to this thread, "After the battle, the victorious unit has a 50% chance to receive veteran status.".

https://forums.civfanatics.com/threads/civ1-combat-mechanics-explained.492843/

I have won many attacks and never received veteran status. Since it is a chance, it's possible that I have just been unlucky or unobservant. I can test this more with units spawned with the debug menu.

SWY1985 commented 7 years ago

The Veteran status is currently only awarded when the unit is built in a city that has Barracks. Since this is a simple fix, I will implement this now.

AlexFolland commented 7 years ago

The implementation looks like it will never award the defending unit veteran status. attackUnit.Veteran is being assigned in both assignments.

AlexFolland commented 7 years ago

Also, while I was looking at the code for this, I found this part, which seems to do something other what its comment says.

            // Step 6: If the attacking unit is a veteran unit, increase the attack strength by 50%.
            if (Veteran)
            {
                attackStrength *= 2;
            }

This would increase the attack strength by 100%, not 50%.

AlexFolland commented 7 years ago

I created a pull request here: https://github.com/SWY1985/CivOne/pull/355