#ifndef AWARDS_H
#define AWARDS_H
+enum bonus_types {
+#define DECLARE_BONUS(id, name) id,
+#include "Bonuses.def"
+#undef DECLARE_BONUS
+bonus_count
+};
+
+static const char *bonus_names[bonus_count] = {
+#define DECLARE_BONUS(id, name) name,
+#include "Bonuses.def"
+#undef DECLARE_BONUS
+};
+
enum award_types {
#define DECLARE_AWARD(id, name) id,
#include "Awards.def"
--- /dev/null
+/*
+Copyright (C) 2010 - Lugaru authors
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+DECLARE_BONUS(nobonus, "")
+DECLARE_BONUS(tracheotomy, "Tracheotomy!")
+DECLARE_BONUS(backstab, "Backstabber!")
+DECLARE_BONUS(spinecrusher, "Spinecrusher!")
+DECLARE_BONUS(ninja, "Ninja Bonus!")
+DECLARE_BONUS(style, "Style Bonus!")
+DECLARE_BONUS(cannon, "Leg Cannon!")
+DECLARE_BONUS(aimbonus, "Nice Aim!")
+DECLARE_BONUS(deepimpact, "Heavy Impact!")
+DECLARE_BONUS(touchofdeath, "Touch of Death!")
+DECLARE_BONUS(swordreversebonus, "Sword Disarm!")
+DECLARE_BONUS(staffreversebonus, "Staff Disarm!")
+DECLARE_BONUS(reverseko, "Reversal KO!")
+DECLARE_BONUS(solidhit, "Solid Hit!")
+DECLARE_BONUS(twoxcombo, "2X Combo!")
+DECLARE_BONUS(threexcombo, "3X Combo!")
+DECLARE_BONUS(fourxcombo, "4X COMBO!")
+DECLARE_BONUS(megacombo, "MEGA COMBO!")
+DECLARE_BONUS(Reversal, "Reversal!")
+DECLARE_BONUS(Stabbonus, "Punctured!")
+DECLARE_BONUS(Slicebonus, "Sliced!")
+DECLARE_BONUS(Bullseyebonus, "Bullseye!")
+DECLARE_BONUS(Slashbonus, "Slashed!")
+DECLARE_BONUS(Wolfbonus, "WOLF SLAYER!")
+DECLARE_BONUS(FinishedBonus, "SLAIN!")
+DECLARE_BONUS(TackleBonus, "Tackle!")
+DECLARE_BONUS(AboveBonus, "Death from Above!")
"dead1", "dead2", "dead3", "dead4"
};
-const int tracheotomy = 1;
-const int backstab = 2;
-const int spinecrusher = 3;
-const int ninja = 4;
-const int style = 5;
-const int cannon = 6;
-const int aimbonus = 7;
-const int deepimpact = 8;
-const int touchofdeath = 9;
-const int swordreversebonus = 10;
-const int staffreversebonus = 11;
-const int reverseko = 12;
-const int solidhit = 13;
-const int twoxcombo = 14;
-const int threexcombo = 15;
-const int fourxcombo = 16;
-const int megacombo = 17;
-const int Reversal = 18;
-const int Stabbonus = 19;
-const int Slicebonus = 20;
-const int Bullseyebonus = 21;
-const int Slashbonus = 22;
-const int Wolfbonus = 23;
-const int FinishedBonus = 24;
-const int TackleBonus = 25;
-const int AboveBonus = 26;
-
const int boneconnect = 0;
const int constraint = 1;
const int muscle = 2;
if(!tutoriallevel)
if(bonus>0&&bonustime<1&&!winfreeze&&indialogue==-1/*bonustime<4*/){
- if(bonus==tracheotomy)sprintf (string, "Tracheotomy!");
- else if(bonus==backstab)sprintf (string, "Backstabber!");
- else if(bonus==spinecrusher)sprintf (string, "Spinecrusher!");
- else if(bonus==ninja)sprintf (string, "Ninja Bonus!");
- else if(bonus==style)sprintf (string, "Style Bonus!");
- else if(bonus==cannon)sprintf (string, "Leg Cannon!");
- else if(bonus==aimbonus)sprintf (string, "Nice Aim!");
- else if(bonus==deepimpact)sprintf (string, "Heavy Impact!");
- else if(bonus==touchofdeath)sprintf (string, "Touch of Death!");
- else if(bonus==swordreversebonus)sprintf (string, "Sword Disarm!");
- else if(bonus==staffreversebonus)sprintf (string, "Staff Disarm!");
- else if(bonus==reverseko)sprintf (string, "Reversal KO!");
- else if(bonus==solidhit)sprintf (string, "Solid Hit!");
- else if(bonus==twoxcombo)sprintf (string, "2X Combo!");
- else if(bonus==threexcombo)sprintf (string, "3X Combo!");
- else if(bonus==fourxcombo)sprintf (string, "4X COMBO!");
- else if(bonus==megacombo)sprintf (string, "MEGA COMBO!");
- else if(bonus==Reversal)sprintf (string, "Reversal!");
- else if(bonus==Stabbonus)sprintf (string, "Punctured!");
- else if(bonus==Slicebonus)sprintf (string, "Sliced!");
- else if(bonus==Bullseyebonus)sprintf (string, "Bullseye!");
- else if(bonus==Slashbonus)sprintf (string, "Slashed!");
- else if(bonus==Wolfbonus)sprintf (string, "WOLF SLAYER!");
- else if(bonus==FinishedBonus)sprintf (string, "SLAIN!");
- else if(bonus==TackleBonus)sprintf (string, "Tackle!");
- else if(bonus==AboveBonus)sprintf (string, "Death from Above!");
- else sprintf (string, "Excellent!");
+ const char *bonus_name;
+ if (bonus < bonus_count)
+ bonus_name = bonus_names[bonus];
+ else
+ bonus_name = "Excellent!"; // When does this happen?
glColor4f(0,0,0,1-bonustime);
- text.glPrintOutline(1024/2-10*strlen(string)-4,768/16-4+768*4/5,string,1,2.5,1024,768);
+ text.glPrintOutline(1024/2-10*strlen(bonus_name)-4,768/16-4+768*4/5,bonus_name,1,2.5,1024,768);
glColor4f(1,0,0,1-bonustime);
- text.glPrint(1024/2-10*strlen(string),768/16+768*4/5,string,1,2,1024,768);
+ text.glPrint(1024/2-10*strlen(bonus_name),768/16+768*4/5,bonus_name,1,2,1024,768);
sprintf (string, "%d",(int)bonusvalue);
glColor4f(0,0,0,1-bonustime);
#include "Animation.h"
#include "Sounds.h"
#include "Game.h"
+#include "Awards.h"
extern float multiplier;
extern int channels[100];