File: game.cpp

package info (click to toggle)
kobodeluxe 0.5.1-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,404 kB
  • sloc: ansic: 18,747; cpp: 18,203; sh: 3,192; makefile: 162
file content (138 lines) | stat: -rw-r--r-- 2,755 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*(GPL)
------------------------------------------------------------
   Kobo Deluxe - An enhanced SDL port of XKobo
------------------------------------------------------------
 * Copyright (C) 2002, 2007 David Olofson
 * 
 * This program 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.,
 * 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include "config.h"
#include "game.h"

game_t game;


game_t::game_t()
{
	reset();
}


void game_t::reset()
{
	set(GAME_SINGLE, SKILL_CLASSIC);
}


void game_t::set(game_types_t tp, skill_levels_t sk)
{
	type = tp;
	skill = sk;

	// Game and player
	speed = 30;
	lives = 5;
	bonus_first = 2000;
	bonus_every = 3000;
	health = 1;
	health_fade = 5;
	damage = 0;
	bolts = 10;
	bolt_damage = 20;
	noseloadtime = 1;
	noseheatup = 0;
	nosecooling = 256;
	altfire = 0;
	tailloadtime = 1;
	tailheatup = 0;
	tailcooling = 256;

	// Enemies
	rock_health = 255 * bolt_damage;
	rock_damage = 1000;

	switch(skill)
	{
	  case SKILL_CLASSIC:
		break;
	  case SKILL_NEWBIE:
		speed = 40;
		lives = 5;
		bonus_first = 5000;
		bonus_every = 7000;
		health = 100;
		damage = 100;
		bolts = MAX_BOLTS;
		noseloadtime = 1;
		noseheatup = 14;
		nosecooling = 5;
		tailloadtime = 0;
		tailheatup = 7;
		tailcooling = 5;
		altfire = 1;
		rock_health = 200;
		rock_damage = 50;
		break;
	  case SKILL_GAMER:
		speed = 30;
		lives = 5;
		bonus_first = 8000;
		bonus_every = 8000;
		health = 60;
		damage = 100;
		bolts = MAX_BOLTS;
		noseloadtime = 0;
		noseheatup = 10;
		nosecooling = 5;
		tailloadtime = 1;
		tailheatup = 20;
		tailcooling = 5;
		rock_health = 500;
		rock_damage = 50;
		break;
	  case SKILL_ELITE:
		speed = 27;
		lives = 4;
		bonus_first = 10000;
		bonus_every = 10000;
		health = 50;
		damage = 50;
		bolts = MAX_BOLTS;
		noseloadtime = 1;
		noseheatup = 26;
		nosecooling = 5;
		tailloadtime = 2;
		tailheatup = 39;
		tailcooling = 5;
		break;
	  case SKILL_GOD:
	  default:
		speed = 25;
		lives = 3;
		bonus_first = 10000;
		bonus_every = 10000;
		health = 40;
		damage = 30;
		bolts = MAX_BOLTS;
		noseloadtime = 1;
		noseheatup = 30;
		nosecooling = 5;
		tailloadtime = 2;
		tailheatup = 45;
		tailcooling = 5;
		break;
	}
}