Exemple #1
0
attack_context::attack_context(const unit& a,
		const unit& d, int a_cth, int d_cth) :
	attacker_type(a.type_id()),
	defender_type(d.type_id()),
	attacker_side(a.side_id()),
	defender_side(d.side_id()),
	chance_to_hit_defender(a_cth),
	chance_to_hit_attacker(d_cth),
	attacker_res(),
	defender_res()
{
}
Exemple #2
0
void advance_unit(const unit& u)
{
	stats& s = get_stats(u.side_id());
	s.advanced_to[u.type_id()]++;
}
Exemple #3
0
int un_recall_unit_cost(const unit& u)  // this really belongs elsewhere, perhaps in undo.cpp
{					// but I'm too lazy to do it at the moment
	stats& s = get_stats(u.side_id());
	s.recalls[u.type_id()]--;
	return u.recall_cost();
}
Exemple #4
0
void un_recruit_unit(const unit& u)
{
	stats& s = get_stats(u.side_id());
	s.recruits[u.type().base_id()]--;
	s.recruit_cost -= u.cost();
}
Exemple #5
0
void un_recall_unit(const unit& u)
{
	stats& s = get_stats(u.side_id());
	s.recalls[u.type_id()]--;
	s.recall_cost -= u.cost();
}
Exemple #6
0
void recall_unit(const unit& u)
{
	stats& s = get_stats(u.side_id());
	s.recalls[u.type_id()]++;
	s.recall_cost += u.cost();
}