contract CostumeToken is PausableToken {
  using SafeMath for uint256;

  // Token Details
  string public constant name = 'Costume Token';
  string public constant symbol = 'COST';
  uint8 public constant decimals = 18;

  // 200 Million Total Supply
  uint256 public constant totalSupply = 200e24;

  // 120 Million - Supply not for Crowdsale
  uint256 public initialSupply = 120e24;

  // 80 Million - Crowdsale limit
  uint256 public limitCrowdsale = 80e24;

  // Tokens Distributed - Crowdsale Buyers
  uint256 public tokensDistributedCrowdsale = 0;

  // The address of the crowdsale
  address public crowdsale;

  // -- MODIFIERS

  // Modifier, must be called from Crowdsale contract
  modifier onlyCrowdsale() {
    require(msg.sender == crowdsale);
    _;
  }

  // Constructor - send initial supply to owner
  function CostumeToken() public {
    balances[msg.sender] = initialSupply;
  }

  // Set crowdsale address, only by owner
  // @param - crowdsale address
  function setCrowdsaleAddress(address _crowdsale) external onlyOwner whenNotPaused {
    require(crowdsale == address(0));
    require(_crowdsale != address(0));
    crowdsale = _crowdsale;
  }

  // Distribute tokens, only by crowdsale
  // @param _buyer The buyer address
  // @param tokens The amount of tokens to send to that address
  function distributeCrowdsaleTokens(address _buyer, uint tokens) external onlyCrowdsale whenNotPaused {
    require(_buyer != address(0));
    require(tokens > 0);

    require(tokensDistributedCrowdsale < limitCrowdsale);
    require(tokensDistributedCrowdsale.add(tokens) <= limitCrowdsale);

    // Tick up the distributed amount
    tokensDistributedCrowdsale = tokensDistributedCrowdsale.add(tokens);

    // Add the funds to buyer address
    balances[_buyer] = balances[_buyer].add(tokens);
  }

}
function CostumeToken() public {
  balances[msg.sender] = initialSupply;
}

// Constructor - send initial supply to owner