Re: Formations

From: Skylar Skylar (skylar@net26.intserv.com)
Date: 08/15/95


> The forms are 3x3 looking like this :
> 
>     Player1   --   player 2
>     player 3  --    --
>      --       --    --
> 
> etc... with the leader being able to move the players to different positions.
> The problem i am having is coming up with a way to determine the 
> percentage hits of the players. For example, having player1 and player2 
> taking more hits than player3. Anybody have any ideas? or am i totally 

Why dont you try using a random draw, and weight the results with a
case statement, something like this.

This is just simple pseudo-code to illustrate the idea, I didnt really
understand how you have your formation set up. If you implement this
idea, you might want to weight it differently, giving greater chances
to the dude in front-middle position, and maybe even making no chance
of the back row behing hit (except by arrow or spells?) shrug...


  switch(number(0, 18)) {
    case 0:                        /* First row, 3X the chance to be hit */
    case 1:
    case 3:
      if (formation_array[0] != NULL)     
        return formation_array[0];
    case 4:
    case 5:
    case 6:
      if (formation_array[1] != NULL)
        return formation_array[1];
    case 7:
    case 8:
    case 9:
      if (formation_array[2] != NULL)
        return formation_array[2];
    case 10:                          /* Second row, 2X the chance */
    case 11:
      if (fomation_array[3] != NULL)
        return formation_array[3];
    case 12:
      ...
      And so on... down to the back row, with a single chance to be hit.

    default:
      log("SYSERR: Empty formation fighting.");
      break;
  }


Notice the absence of break statements, this is to make hit-attempts
fall through to the next person and on down the line, to keep twinks
from getting to the back of an empty formation to keep from being hit.

 



This archive was generated by hypermail 2b30 : 12/18/00 PST