Updated to include tests for Gentoo installation
[crack-attack.git] / src / ComboTabulator.cxx
blobc3e3ffd787bde051e5d64a920fd3a3fdb0215985
1 /*
2 * ComboTabulator.cxx
3 * Daniel Nelson - 8/24/0
5 * Copyright (C) 2000 Daniel Nelson
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Daniel Nelson - aluminumangel.org
22 * 174 W. 18th Ave.
23 * Columbus, OH 43210
25 * Each one keeps track of a set of or potential set of elimination combos.
28 #include "Game.h"
29 #include "Block.h"
30 #include "GarbageGenerator.h"
31 #include "ComboTabulator.h"
32 #include "SparkleManager.h"
33 #include "SignManager.h"
34 #include "BlockManager.h"
35 #include "Score.h"
37 using namespace std;
39 void ComboTabulator::initialize ( )
41 magnitude = 0;
42 special_magnitude = 0;
43 multiplier = 1;
44 n_multipliers_this_step = 0;
45 base_accumulated_score =0;
46 base_score_this_step = 0;
48 creation_time_stamp = Game::time_step;
50 involvement_count = 0;
53 void ComboTabulator::reportElimination ( int _magnitude, Block &kernel )
55 // hold the location for standard reward mote creation
56 x = kernel.x;
57 y = kernel.y;
59 time_stamp = Game::time_step;
61 // only increase the multiplier if this is a late elimination
62 if (Game::time_step != creation_time_stamp) {
64 multiplier++;
65 n_multipliers_this_step++;
67 SignManager::createSign(x, y, ST_MULTIPLIER, multiplier - 2);
68 SparkleManager::createRewardMote(x, y, multiplier + 9);
71 // if this is a special flavor combo match
72 if (BlockManager::isColorlessFlavor(kernel.flavor))
73 special_magnitude += _magnitude;
75 // if this is a normal flavor combo match
76 else
77 magnitude += _magnitude;