attacking now fully works - not terribly happy with the range of attack ranges though
This commit is contained in:
parent
6aedad51e5
commit
4d5770006c
|
@ -93,7 +93,7 @@ bool GameData::add_vertex(int x, int y, int r, int colour)
|
||||||
{
|
{
|
||||||
Graph::add_vertex(x, y, r, colour, 10);
|
Graph::add_vertex(x, y, r, colour, 10);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "debug: GameData::add_vertex(): strength=%f\n",
|
fprintf(stderr, "debug: GameData::add_vertex(): strength=%2.f\n",
|
||||||
calculate_strength(*(vertices.rbegin())));
|
calculate_strength(*(vertices.rbegin())));
|
||||||
#endif
|
#endif
|
||||||
if (player == PLAYER1) player1_played = true;
|
if (player == PLAYER1) player1_played = true;
|
||||||
|
@ -107,7 +107,7 @@ bool GameData::add_vertex(int x, int y, int r, int colour)
|
||||||
if (Graph::add_vertex(x, y, r, colour, 10, current))
|
if (Graph::add_vertex(x, y, r, colour, 10, current))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "debug: GameData::add_vertex(): strength=%f\n",
|
fprintf(stderr, "debug: GameData::add_vertex(): strength=%.2f\n",
|
||||||
calculate_strength(*(vertices.rbegin())));
|
calculate_strength(*(vertices.rbegin())));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -192,6 +192,8 @@ int GameData::get_range(Vertex* node)
|
||||||
Vertex* v = *cursor;
|
Vertex* v = *cursor;
|
||||||
range -= 100 - MathUtils::distance(v->x, v->y, node->x, node->y);
|
range -= 100 - MathUtils::distance(v->x, v->y, node->x, node->y);
|
||||||
}
|
}
|
||||||
|
if (range < 0) range = 0;
|
||||||
|
return range;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +211,7 @@ void GameData::attack_vertex(Vertex* target)
|
||||||
if (target->score <= 0) remove_vertex(target);
|
if (target->score <= 0) remove_vertex(target);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "debug: GameData::attack_vertex(): atk_str=%2.f, def_str=%2.f, armor=%2.f, damage=%d\n", atk_str, def_str, armor, damage);
|
fprintf(stderr, "debug: GameData::attack_vertex(): atk_str=%.2f, def_str=%.2f, armor=%.2f, damage=%d\n", atk_str, def_str, armor, damage);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
toggle_turn();
|
toggle_turn();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user