Author: sveinung
Date: Mon Jun 20 00:11:13 2016
New Revision: 32921

URL: http://svn.gna.org/viewcvs/freeciv?rev=32921&view=rev
Log:
Action probability for the "Attack" action.

See patch #7265

Modified:
    trunk/common/actions.c

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=32921&r1=32920&r2=32921&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Mon Jun 20 00:11:13 2016
@@ -2426,7 +2426,13 @@
     /* TODO */
     break;
   case ACTION_ATTACK:
-    /* TODO */
+    {
+      struct unit *defender_unit = get_defender(actor_unit,
+                                                target_tile);
+      double unconverted = unit_win_chance(actor_unit, defender_unit);
+
+      chance = (int)((double)200 * unconverted);
+    }
     break;
   case ACTION_COUNT:
     fc_assert(FALSE);


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to