Exemplo 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;
}
Exemplo n.º 2
0
bool HealthIsCritical(Tank & self)
{
	return ( (double)self.crew_health()/(double)self.crew_max_health() ) < g_crit_health_treshold;
}