Ejemplo n.º 1
0
BonusType what_i_need(Tank & me)
{
	if ( ( (double)me.crew_health()/(double)me.crew_max_health() ) < 0.9)
	{
		return MEDIKIT;
	}

	if ( ( (double)me.hull_durability()/(double)me.hull_max_durability() ) < 0.9 )
	{
		return REPAIR_KIT;
	}

	if (!me.premium_shell_count())
	{
		return AMMO_CRATE;
	}

	return UNKNOWN_BONUS;
}
Ejemplo n.º 2
0
bool HullIsCritical(Tank & self)
{
	return ( (double)self.hull_durability() /(double)self.hull_max_durability() ) < g_crit_health_treshold;
}