Bidderlyn

player class aoe2 roles

Jan 14th, 2021
487
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main;
  2.  
  3. /**
  4.  * This class represent the player in a MP aoe2 game.
  5.  *
  6.  */
  7.  class Player{
  8.  boolean hasRole = false; // in aoe2 can be replicated by a variable called "player <N> has role?" put 0 if false, 1 if true. Or by having a variable named after the role, with a value that equal to the player(Recommended).
  9.  int role = 0; // the # of the role, the amount of roles equals to the amount of players. in aoe2 use a variable named for each role, and put the number of player after.(example: "cultist" variable with "2" as input represents p2 is cultist
  10.  int chance[]; //the chance of the player to get a role. each index is a different role, the value of that index is the "chance" percentage given in the trigger.
  11.  
  12.  /**
  13.   * setting up a player, and changing the array to fit the amount of chosen roles by the user
  14.   * @param _roles the amount of roles
  15.   */
  16.     public Player(int _roles)
  17.     {
  18.      int chances[] = new int[_roles];
  19.      chance = chances;
  20.     }
  21.  }
  22.  
RAW Paste Data