Esempio n. 1
0
int extra_flags_circle( int ef ) {
  int new_ef = 0;

  if ( ef & SFT(CIRCLE_ITEM_GLOW) ) SET_BIT( new_ef, ITEM_GLOW );
  if ( ef & SFT(CIRCLE_ITEM_HUM) ) SET_BIT( new_ef, ITEM_HUM );
  if ( ef & SFT(CIRCLE_ITEM_INVIS) ) SET_BIT( new_ef, ITEM_INVIS );
  if ( ef & SFT(CIRCLE_ITEM_MAGIC) ) SET_BIT( new_ef, ITEM_MAGIC );
  if ( ef & SFT(CIRCLE_ITEM_NODROP) ) SET_BIT( new_ef, ITEM_NODROP );
  if ( ef & SFT(CIRCLE_ITEM_BLESS) ) SET_BIT( new_ef, ITEM_BLESS );
  if ( ef & SFT(CIRCLE_ITEM_ANTI_GOOD) ) SET_BIT( new_ef, ITEM_ANTI_GOOD );
  if ( ef & SFT(CIRCLE_ITEM_ANTI_EVIL) ) SET_BIT( new_ef, ITEM_ANTI_EVIL );
  if ( ef & SFT(CIRCLE_ITEM_ANTI_NEUTRAL) ) SET_BIT( new_ef, ITEM_ANTI_NEUTRAL );
  if ( ef & SFT(CIRCLE_ITEM_NOSELL) ) SET_BIT( new_ef, ITEM_INVENTORY );

  return new_ef;
}
Esempio n. 2
0
int aff2_circle( int aff ) {
  int new_aff = 0;

  if ( aff & SFT(CIRCLE_AFF_WATERWALK) )   SET_BIT( new_aff, AFF2_WALK_ON_WATER );

  return new_aff;
}
Esempio n. 3
0
File: rtos.c Progetto: dek-an/Micro
// //////////////////////////////////////////////////////////
// Interface Implementation
//
void initRtos(void)
{
	INITIALIZE_CHECKING();

	initTaskQueue();
	initTimerTaskSet();

	// set timer TC0
	// Clear Timer on Compare match; WGM01:0 = 10
	// prescaler 64; CS02:0 = 011
	TCCR0 = SFT(WGM01) | SFT(CS01) | SFT(CS00);
	// reset counter
	TCNT0 = 0;
	// set Output Compare Register value
	OCR0 = RTOS_TIMER_OCR;
	// Output Compare Math Interrupt Enable
	SBI(TIMSK, OCIE0);
}
Esempio n. 4
0
File: clock.c Progetto: dek-an/Micro
void initClock(void)
{
	INITIALIZE_CHECKING();

	setTime(0);

#ifdef CLOCK_ASYNCRONOUS_MODE
	while (GBI(ASSR, TCN2UB) || GBI(ASSR, OCR2UB) || GBI(ASSR, TCR2UB)) // whait while TC2 is ready
	{
		_delay_ms(1);
	}

	// asynchronous mode
	ASSR = SFT(AS2);
	// reset timer counter
	TCNT2 = 0;
	// prescaler 128: TCS22:0 = 101
	TCCR2 = 5 << CS20;
	// Overflow interrupt
	SBI(TIMSK, TOIE2);
#else // not CLOCK_ASYNCRONOUS_MODE
	setTimerTaskMS(&clockTimerTask, 0, 1000);
#endif
}
Esempio n. 5
0
int aff_circle( int aff ) {
  int new_aff = 0;

  if ( aff & SFT(CIRCLE_AFF_BLIND) )         SET_BIT( new_aff, AFF_BLIND );
  if ( aff & SFT(CIRCLE_AFF_INVISIBLE) )     SET_BIT( new_aff, AFF_INVISIBLE );
  if ( aff & SFT(CIRCLE_AFF_DETECT_ALIGN) ) { SET_BIT( new_aff, AFF_DETECT_EVIL ); SET_BIT( new_aff, AFF_DETECT_GOOD ); }
  if ( aff & SFT(CIRCLE_AFF_DETECT_INVIS) )  SET_BIT( new_aff, AFF_DETECT_INVIS );
  if ( aff & SFT(CIRCLE_AFF_DETECT_MAGIC) )  SET_BIT( new_aff, AFF_DETECT_MAGIC );
  if ( aff & SFT(CIRCLE_AFF_DETECT_HIDDEN) ) SET_BIT( new_aff, AFF_DETECT_HIDDEN );
  if ( aff & SFT(CIRCLE_AFF_SANCTUARY) )     SET_BIT( new_aff, AFF_SANCTUARY );
  if ( aff & SFT(CIRCLE_AFF_CURSE) )         SET_BIT( new_aff, AFF_CURSE );
  if ( aff & SFT(CIRCLE_AFF_INFRARED) )      SET_BIT( new_aff, AFF_INFRARED );
  if ( aff & SFT(CIRCLE_AFF_POISON) )        SET_BIT( new_aff, AFF_POISON );
  if ( aff & SFT(CIRCLE_AFF_PROTECT_GOOD ) ) SET_BIT( new_aff, AFF_PROTECT_GOOD );
  if ( aff & SFT(CIRCLE_AFF_PROTECT_EVIL ) ) SET_BIT( new_aff, AFF_PROTECT_EVIL );
  if ( aff & SFT(CIRCLE_AFF_SLEEP) )         SET_BIT( new_aff, AFF_SLEEP );
  if ( aff & SFT(CIRCLE_AFF_SNEAK) )         SET_BIT( new_aff, AFF_SNEAK );
  if ( aff & SFT(CIRCLE_AFF_HIDE) )          SET_BIT( new_aff, AFF_HIDE );
  if ( aff & SFT(CIRCLE_AFF_SLEEP) )         SET_BIT( new_aff, AFF_SLEEP );
  if ( aff & SFT(CIRCLE_AFF_CHARM) )         SET_BIT( new_aff, AFF_CHARM );

  return new_aff;
}