Example #1
0
Item::Item(const uint16_t _type, uint16_t _count /*= 0*/) :
	ItemAttributes()
{
	id = _type;

	const ItemType& it = items[id];

	setItemCount(1);

	if(it.isFluidContainer() || it.isSplash()){
		setFluidType(_count);
	}
	else if(it.stackable){
		if(_count != 0){
			setItemCount(_count);
		}
		else if(it.charges != 0){
			setItemCount(it.charges);
		}
	}
	else if(it.charges != 0){
		//if count is higher than 1, override default charges
		if(_count > 1){
			setCharges(_count);
		}
		else{
			setCharges(it.charges);
		}
	}

	setDefaultDuration();
}
Example #2
0
Item::Item(const uint16_t _type, uint16_t _count /*= 0*/)
{
	parent = NULL;
	useCount = 0;

	id = _type;
	attributes = NULL;

	const ItemType& it = items[id];

	setItemCount(1);

	if (it.isFluidContainer() || it.isSplash()) {
		setFluidType(_count);
	} else if (it.stackable) {
		if (_count != 0) {
			setItemCount(_count);
		} else if (it.charges != 0) {
			setItemCount(it.charges);
		}
	} else if (it.charges != 0) {
		if (_count != 0) {
			setCharges(_count);
		} else {
			setCharges(it.charges);
		}
	}

	loadedFromMap = false;
	setDefaultDuration();
}
Example #3
0
MovieWriter::Format::Format( const ICMCompressionSessionOptionsRef options, uint32_t codec, float quality, float frameRate, bool enableMultiPass )
	: mCodec( codec ), mEnableMultiPass( enableMultiPass )
{
	::ICMCompressionSessionOptionsCreateCopy( NULL, options, &mOptions );
	setQuality( quality );
	setTimeScale( (long)(frameRate * 100) );
	setDefaultDuration( 1.0f / frameRate );
	setGamma( PLATFORM_DEFAULT_GAMMA );
}
Example #4
0
Item::Item(const uint16_t type, uint16_t amount/* = 0*/):
	ItemAttributes(), id(type)
{
	count = 1;
	raid = NULL;
	loadedFromMap = false;

	const ItemType& it = items[id];
	if(it.charges)
		setCharges(it.charges);

	setDefaultDuration();
	if(it.isFluidContainer() || it.isSplash())
		setFluidType(amount);
	else if(it.stackable && amount)
		count = amount;
	else if(it.charges && amount)
		setCharges(amount);
}
Example #5
0
Item::Item(const uint16_t type, uint16_t amount/* = 0*/):
	ItemAttributes(), id(type)
{
	count = 1;
	raid = NULL;
	loadedFromMap = false;

	setItemCount(1);
	setDefaultDuration();

	const ItemType& it = items[type];
	if(it.isFluidContainer() || it.isSplash())
		setFluidType(amount);
	else if(it.stackable)
	{
		if(amount)
			count = setItemCount(amount);
		else if(it.charges)
			setItemCount(it.charges);
	}
	else if(it.charges)
		setCharges(amount ? amount : it.charges);

	if(it.armorRndMin > -1 && it.armorRndMax > it.armorRndMin)
		setAttribute("armor", it.armorRndMin + rand() % (it.armorRndMax+1 - it.armorRndMin));
	if(it.defenseRndMin > -1 && it.defenseRndMax > it.defenseRndMin)
		setAttribute("defense", it.defenseRndMin + rand() % (it.defenseRndMax+1 - it.defenseRndMin));
	if(it.extraDefenseRndMin > -1 && it.extraDefenseRndMax > it.extraDefenseRndMin)
	if(it.extraDefenseChance == -1 || (it.extraDefenseChance >= rand() % 101) )
		setAttribute("extradefense", it.extraDefenseRndMin + rand() % (it.extraDefenseRndMax+1 - it.extraDefenseRndMin));
	if(it.attackRndMin > -1 && it.attackRndMax > it.attackRndMin)
		setAttribute("attack", it.attackRndMin + rand() % (it.attackRndMax - it.attackRndMin));
	if(it.extraAttackRndMin > -1 && it.extraAttackRndMax > it.extraAttackRndMin)
	if(it.extraAttackChance == -1 || (it.extraAttackChance >= rand() % 101) )
		setAttribute("extraattack", it.extraAttackRndMin + rand() % (it.extraAttackRndMax+1 - it.extraAttackRndMin));
	if(it.chargesRndMin > -1 && it.chargesRndMax > it.chargesRndMin)
		setAttribute("charges", it.chargesRndMin + rand() % (it.chargesRndMax+1 - it.chargesRndMin));
	if(it.attackSpeedRndMin > -1 && it.attackSpeedRndMax > it.attackSpeedRndMin)
	if(it.attackSpeedChance == -1 || (it.attackSpeedChance >= rand() % 101) )
		setAttribute("attackSpeed", it.attackSpeedRndMin + rand() % (it.attackSpeedRndMax+1 - it.attackSpeedRndMin) );
}
Example #6
0
Item::Item(const uint16_t type, uint16_t amount/* = 0*/):
	ItemAttributes(), id(type)
{
	raid = NULL;
	loadedFromMap = false;

	setItemCount(1);
	setDefaultDuration();

	const ItemType& it = items[type];
	if(it.isFluidContainer() || it.isSplash())
		setFluidType(amount);
	else if(it.stackable)
	{
		if(amount)
			setItemCount(amount);
		else if(it.charges)
			setItemCount(it.charges);
	}
	else if(it.charges)
		setCharges(amount ? amount : it.charges);
}
Example #7
0
Item::Item(const uint16_t _type, uint16_t _count /*= 0*/) :
	ItemAttributes()
{
	id = _type;

	const ItemType& it = items[id];

	count = 1;
	if(it.charges != 0){
		setCharges(it.charges);
	}

	if(it.isFluidContainer() || it.isSplash()){
		setFluidType(_count);
	}
	else if(it.stackable && _count != 0){
		count = _count;
	}
	else if(it.charges != 0 && _count != 0){
		setCharges(_count);
	}

	setDefaultDuration();
}
Example #8
0
void interpretCommands(void)
{
  short i, num, den, nbars;
  Char STR2[256];
  short FORLIM;

  strcpy(title_line, cline[(long)title]);
  strcpy(part_line, cline[(long)part]);
  if (*cline[(long)poet] != '\0' || *cline[(long)composer] != '\0')
    sprintf(composer_line, "\\mtxComposerLine{%s}{%s}",
	    cline[(long)poet], cline[(long)composer]);
  else
    *composer_line = '\0';
  strcpy(pmx_line, cline[(long)pmx]);
  GetNextWord(options_line, cline[(long)options], blank_, dummy);
  FORLIM = known_styles;
  for (i = 0; i <= FORLIM - 1; i++)
    style_used[i] = false;
  applyStyles();
  setVoices(voices);
  FORLIM = known_styles;
  for (i = old_known_styles; i <= FORLIM - 1; i++) {
    if (!style_used[i]) {
      warning("The following style was supplied but not used", !print);
      puts(known_style[i]);
    }
  }
  setClefs(clefs);
  if (!redefined[(long)meter]) {
    sprintf(STR2, "You have not defined Meter, assuming \"%s\" ",
	    cline[(long)meter]);
    warning(STR2, !print);
  }
  getMeter(cline[(long)meter], &meternum, &meterdenom, &pmnum, &pmdenom);
  setDefaultDuration(meterdenom);
  if (meternum == 0 &&
      !(redefined[(long)pages] || redefined[(long)systems] ||
	redefined[(long)bars])) {
    strcpy(cline[(long)bars], "1");
    redefined[(long)bars] = true;
  }
  if (redefined[(long)pages] || redefined[(long)systems]) {
    if (redefined[(long)bars])
      warning("BARS/LINE ignored since you specified PAGES or SYSTEMS", print);
    if (redefined[(long)systems])
      getNum(cline[(long)systems], &n_systems);
    else
      warning("PAGES specified but not SYSTEMS", !print);
    if (redefined[(long)pages])
      getNum(cline[(long)pages], &n_pages);
    else
      warning("SYSTEMS specified but not PAGES", !print);
  } else if (redefined[(long)bars]) {
    getNum(cline[(long)bars], &nbars);
    if (nbars > 0) {
      n_pages = 0;
      n_systems = nbars;
    }
  }
  getNum(cline[(long)sharps], &n_sharps);
  setSpace(cline[(long)space]);
  setSize(cline[(long)msize]);
  getTwoNums(cline[(long)shortnote], &num, &den);
  if (den == 0)
    den = 1;
  short_note = num * 64 / den;
  if (*cline[(long)flats] != '\0') {
    getNum(cline[(long)flats], &n_sharps);
    n_sharps = -n_sharps;
  }
  setName();
  setIndent();
  setInitOctave();
  setOnly(cline[(long)only]);
  setRange(cline[(long)range]);
  setDimension(cline[(long)width], width);
  setDimension(cline[(long)height], height);
  if (*options_line != '\0') {
    warning("\"Options\" is cryptic and obsolescent.", !print);
    printf("  Use \"Enable\" and \"Disable\" instead.\n");
  }
  FORLIM = strlen(options_line);
  for (i = 0; i <= FORLIM - 1; i++)
    processOption(options_line[i]);
}