Bidderlyn

player class aoe2 roles

Jan 14th, 2021
472
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×