[escape-from-the-masters-lair] push by DarkOppr...@gmail.com - Some tweaks. Resolution set automatically when game is first run. on 2011-04-21 05:50 GMT

1 view
Skip to first unread message

escape-from-th...@googlecode.com

unread,
Apr 21, 2011, 1:51:25 AM4/21/11
to escape-from-th...@googlegroups.com
Revision: d32b8d576074
Author: Kevin Wells <DarkOp...@gmail.com>
Date: Wed Apr 20 22:50:31 2011
Log: Some tweaks. Resolution set automatically when game is first run.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=d32b8d576074

Modified:
/Escape from the Master's Lair.layout
/Escape from the Master's Lair.layout.save
/creature_combat.cpp
/game_window.cpp
/game_window.h
/main.cpp
/message_log.cpp
/monster.cpp
/player.cpp
/player.h
/player_scores.cpp
/player_windows.cpp
/save_load.cpp
/string_input.cpp
/version.h

=======================================
--- /Escape from the Master's Lair.layout Wed Apr 20 12:02:54 2011
+++ /Escape from the Master's Lair.layout Wed Apr 20 22:50:31 2011
@@ -226,8 +226,8 @@
<File name="player_start.cpp" open="0" top="0" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="1003" topLine="15" />
</File>
- <File name="player_windows.cpp" open="0" top="0" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="69365" topLine="1677" />
+ <File name="player_windows.cpp" open="1" top="1" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
+ <Cursor1 position="37532" topLine="1047" />
</File>
<File name="quit.cpp" open="0" top="0" tabpos="0" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="963" topLine="21" />
=======================================
--- /Escape from the Master's Lair.layout.save Wed Apr 20 12:02:54 2011
+++ /Escape from the Master's Lair.layout.save Wed Apr 20 22:50:31 2011
@@ -50,7 +50,7 @@
<Cursor1 position="1460" topLine="36" />
</File>
<File name="creature_combat.cpp" open="0" top="0" tabpos="3" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="2423" topLine="48" />
+ <Cursor1 position="15912" topLine="365" />
</File>
<File name="creature_commands.cpp" open="0" top="0" tabpos="4" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="37944" topLine="1140" />
@@ -170,7 +170,7 @@
<Cursor1 position="132" topLine="0" />
</File>
<File name="main.cpp" open="0" top="0" tabpos="1" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="4540" topLine="86" />
+ <Cursor1 position="4274" topLine="84" />
</File>
<File name="main.h" open="0" top="0" tabpos="0" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="198" topLine="0" />
@@ -185,13 +185,13 @@
<Cursor1 position="211" topLine="0" />
</File>
<File name="message_log.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="924" topLine="15" />
+ <Cursor1 position="1138" topLine="21" />
</File>
<File name="message_log.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="255" topLine="0" />
</File>
<File name="monster.cpp" open="0" top="0" tabpos="3" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="1699" topLine="42" />
+ <Cursor1 position="15331" topLine="422" />
</File>
<File name="monster.h" open="0" top="0" tabpos="3" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="574" topLine="21" />
@@ -215,19 +215,19 @@
<Cursor1 position="132" topLine="0" />
</File>
<File name="player.cpp" open="0" top="0" tabpos="6" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="6195" topLine="215" />
+ <Cursor1 position="42748" topLine="1007" />
</File>
<File name="player.h" open="0" top="0" tabpos="7" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="2128" topLine="76" />
+ <Cursor1 position="995" topLine="22" />
</File>
<File name="player_scores.cpp" open="0" top="0" tabpos="5" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="8979" topLine="168" />
+ <Cursor1 position="5958" topLine="118" />
</File>
<File name="player_start.cpp" open="0" top="0" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="1003" topLine="15" />
</File>
<File name="player_windows.cpp" open="0" top="0" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="69365" topLine="1677" />
+ <Cursor1 position="52271" topLine="1353" />
</File>
<File name="quit.cpp" open="0" top="0" tabpos="0" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="963" topLine="21" />
@@ -260,7 +260,7 @@
<Cursor1 position="454" topLine="16" />
</File>
<File name="save_load.cpp" open="0" top="0" tabpos="9" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="1604" topLine="54" />
+ <Cursor1 position="12055" topLine="372" />
</File>
<File name="save_load.h" open="0" top="0" tabpos="4" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="204" topLine="0" />
@@ -269,7 +269,7 @@
<Cursor1 position="172" topLine="0" />
</File>
<File name="string_input.cpp" open="0" top="0" tabpos="3" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="9267" topLine="234" />
+ <Cursor1 position="3072" topLine="78" />
</File>
<File name="string_input.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="242" topLine="0" />
=======================================
--- /creature_combat.cpp Wed Apr 20 12:02:54 2011
+++ /creature_combat.cpp Wed Apr 20 22:50:31 2011
@@ -368,6 +368,8 @@
string message="";

if(is_player){
+ player.deaths++;
+
if(cause_of_death==CAUSE_OF_DEATH_THIRST){
message="You succumb to thirst... Press [Spacebar] to
continue.";
}
=======================================
--- /game_window.cpp Mon Apr 18 21:10:35 2011
+++ /game_window.cpp Wed Apr 20 22:50:31 2011
@@ -94,15 +94,18 @@
return true;
}

-bool Game_Window::init(){
- //Initialize all of the SDL stuff:
-
+bool Game_Window::init_sdl(){
//Initialize all of the standard SDL stuff, and return false if it did
not initialize properly.
if(SDL_Init(SDL_INIT_EVERYTHING)==-1){
fprintf(stderr,"Unable to init SDL: %s\n",SDL_GetError());
return false;
}

+ player.option_screen_width=SDL_GetVideoInfo()->current_w;
+ player.option_screen_height=SDL_GetVideoInfo()->current_h;
+}
+
+bool Game_Window::init(){
//Attempt to center the window on the screen.
SDL_putenv("SDL_VIDEO_CENTERED=center");

=======================================
--- /game_window.h Mon Apr 18 21:10:35 2011
+++ /game_window.h Wed Apr 20 22:50:31 2011
@@ -18,6 +18,8 @@

bool initialize_opengl();

+ bool init_sdl();
+
bool init();

void screenshot();
=======================================
--- /main.cpp Wed Apr 20 05:54:06 2011
+++ /main.cpp Wed Apr 20 22:50:31 2011
@@ -88,6 +88,11 @@
next_game_tick+=SKIP_TICKS;

//Now we update the game logic:
+
+ //If the dev option is ever on, this game should be flagged a
cheater.
+ if(player.option_dev){
+ player.flag_cheater=true;
+ }

//First, we check for input from the player.
input();
@@ -164,6 +169,11 @@
image.current_texture=0;

create_top_level_directories();
+
+ //Initialize the basic SDL subsystems.
+ if(!main_window.init_sdl()){
+ return 1;
+ }

if(!options_load()){
fprintf(stderr,"Failed to load 'options.cfg.'\n");
=======================================
--- /message_log.cpp Sun Apr 3 03:01:05 2011
+++ /message_log.cpp Wed Apr 20 22:50:31 2011
@@ -32,7 +32,8 @@

//Don't log system messsages.
if(message_type!=MESSAGE_SYSTEM){
- ofstream save_log("message_log.txt",ifstream::app);
+ ///This is commented out for the release version.
+ /**ofstream save_log("message_log.txt",ifstream::app);

if(save_log!=NULL){
time_t now;
@@ -49,7 +50,7 @@
}
else{
fprintf(stderr,"Error logging message.\n");
- }
+ }*/
}
}
}
=======================================
--- /monster.cpp Wed Apr 20 12:02:54 2011
+++ /monster.cpp Wed Apr 20 22:50:31 2011
@@ -427,7 +427,7 @@


font.show((int)(return_absolute_x()-player.camera_x),(int)(return_absolute_y()-player.camera_y),appearance,render_color);

- if(player.option_healthbars){
+ if(player.option_healthbars &&
return_health()<return_health_max()){
short health_bar_color=COLOR_GREEN;
if(return_health()>=return_health_max()*0.75){
health_bar_color=COLOR_GREEN;
@@ -442,12 +442,12 @@
health_bar_color=COLOR_RED;
}
double
health_bar_width=((double)((double)health/(double)health_max)*100)/6.25;
-
render_rectangle((int)(return_absolute_x()-player.camera_x),(int)(return_absolute_y()-player.camera_y),health_bar_width,5,0.75,health_bar_color);
+
render_rectangle((int)(return_absolute_x()-player.camera_x),(int)(return_absolute_y()+TILE_SIZE_Y-3-player.camera_y),health_bar_width,3,0.75,health_bar_color);
}

if(player.option_dev){

ss.clear();ss.str("");ss<<return_health();ss<<"/";ss<<return_health_max();msg=ss.str();
-
font.show((int)(return_absolute_x()-player.camera_x),(int)(return_absolute_y()-player.camera_y),msg,COLOR_GREEN);
+
font_small.show((int)(return_absolute_x()-player.camera_x),(int)(return_absolute_y()-player.camera_y),msg,COLOR_GREEN);
}

tile_rendered->at(x)[y]=true;
=======================================
--- /player.cpp Wed Apr 20 12:02:54 2011
+++ /player.cpp Wed Apr 20 22:50:31 2011
@@ -132,12 +132,14 @@
text_log_display_position=text_log.size()-1;

//Options:
- option_fullscreen=false;
+ option_fullscreen=true;
option_screen_width=800;
option_screen_height=600;
option_dev=false;
option_fps=true;
- option_healthbars=false;
+ option_healthbars=true;
+
+ flag_cheater=false;

//Set the camera's initial location and its dimensions.
camera_x=0.0;
@@ -679,7 +681,8 @@
//******************//

//If numpad 0 is pressed, toggle the camera's stickiness and play
the appropriate sound.
- if(keystates[SDLK_KP0]){
+ ///This is commented out for the release version.
+ /**if(keystates[SDLK_KP0]){
if(cam_state==CAM_STICKY){
cam_state=0;
}
@@ -725,7 +728,7 @@
if(!keystates[SDLK_DELETE] && !keystates[SDLK_HOME]
&& !keystates[SDLK_PAGEDOWN] && !keystates[SDLK_END]){
cam_state=0;
}
- }
+ }*/

//If the player hits the command key.
if(keystates[SDLK_RETURN] || keystates[SDLK_KP_ENTER]){
@@ -1013,7 +1016,7 @@


font.show((int)(return_absolute_x()-camera_x),(int)(return_absolute_y()-camera_y),appearance,render_color);

- if(player.option_healthbars){
+ if(option_healthbars &&
return_health()<return_health_max()){
short health_bar_color=COLOR_GREEN;
if(return_health()>=return_health_max()*0.75){
health_bar_color=COLOR_GREEN;
@@ -1028,7 +1031,7 @@
health_bar_color=COLOR_RED;
}
double
health_bar_width=((double)((double)health/(double)health_max)*100)/6.25;
-
render_rectangle((int)(return_absolute_x()-camera_x),(int)(return_absolute_y()-camera_y),health_bar_width,5,0.75,health_bar_color);
+
render_rectangle((int)(return_absolute_x()-camera_x),(int)(return_absolute_y()+TILE_SIZE_Y-3-camera_y),health_bar_width,3,0.75,health_bar_color);
}

tile_rendered->at(x)[y]=true;
=======================================
--- /player.h Tue Apr 19 12:07:59 2011
+++ /player.h Wed Apr 20 22:50:31 2011
@@ -42,6 +42,10 @@
//The number of deaths in this game.
int deaths;

+ //If the player ever enters dev mode, this is set to true.
+ //If true, this prevents the current game from being entered into the
highscores or game log.
+ bool flag_cheater;
+
//**************************************************//
// Variables that should not be saved in savegames. //
//**************************************************//
=======================================
--- /player_scores.cpp Wed Apr 20 05:54:06 2011
+++ /player_scores.cpp Wed Apr 20 22:50:31 2011
@@ -121,199 +121,202 @@
}

void Player::save_game_log_entry(short cause_of_death,string killer,string
killer_item,string killer_article,string killer_item_article){
- ofstream save_log("game_log",ifstream::app);
-
stringstream score_string("");

- if(save_log!=NULL){
- time_t now;
- struct tm *tm_now;
- char buff[BUFSIZ];
- now=time(NULL);
- tm_now=localtime(&now);
-
- strftime(buff,sizeof buff,"%d",tm_now);
-
- string day=buff;
- string initial_day_digit="";
- initial_day_digit+=day[0];
-
- //Remove the leading zero, if any.
- if(atoi(initial_day_digit.c_str())==0){
- erase_head(day,1);
- }
-
- string number_ending="";
-
- if(atoi(day.c_str())==11 || atoi(day.c_str())==12 ||
atoi(day.c_str())==13){
- number_ending="th";
- }
- else if(atoi(day.c_str())%10==1){
- number_ending="st";
- }
- else if(atoi(day.c_str())%10==2){
- number_ending="nd";
- }
- else if(atoi(day.c_str())%10==3){
- number_ending="rd";
- }
- else{
- number_ending="th";
- }
-
- end_date="the ";
- end_date+=day;
- end_date+=number_ending;
- strftime(buff,sizeof buff," day of %B, %Y",tm_now);
- end_date+=buff;
-
- strftime(buff,sizeof buff,"%H:%M:%S",tm_now);
-
- end_time=buff;
-
- //Determine whether the player won the game.
-
- won=false;
-
- runestones=0;
-
- for(int i=0;i<inventory.size();i++){
- if(inventory[i].name=="Runestone"){
- runestones++;
- }
- }
-
- if(runestones>=3){
- won=true;
- }
-
- //Calculate score.
-
- score=0;
-
- //Add any points that were earned during play.
- score+=score_from_game;
-
- //Add the gold value of all inventory items.
- for(int i=0;i<inventory.size();i++){
- score+=inventory[i].monetary_value*inventory[i].stack;
-
- //Add a score bonus if the item is a Runestone.
- if(inventory[i].name=="Runestone"){
- score+=100;
- }
- }
-
- //Add the dungeon level bonus.
- score+=(DUNGEON_DEPTH*50)-((max_level+1)*50);
-
- //Add the experience level bonus.
- score+=25*experience_level;
-
- //Add the attribute bonuses.
- for(int i=0;i<ATTRIBUTE_LUCK+1;i++){
- score+=10*attributes[i];
- }
-
- //Add the skill bonuses.
- for(int i=0;i<SKILL_MAGIC_SUMMONING+1;i++){
- score+=5*skills[i][SKILL_EXPERIENCE_LEVEL];
- }
-
- //Double the total score if the player won.
- if(won){
- score*=2;
- }
-
- score_string<<"name:"<<name<<"\n";
-
score_string<<"version:"<<AutoVersion::MAJOR<<"."<<AutoVersion::MINOR<<"\n";
- score_string<<"score:"<<score<<"\n";
- score_string<<"dungeon level:"<<current_level+1<<"\n";
- score_string<<"highest dungeon level:"<<max_level+1<<"\n";
- score_string<<"experience level:"<<experience_level<<"\n";
-
score_string<<"health:"<<return_health()<<"/"<<return_health_max()<<"\n";
-
///score_string<<"mana:"<<return_mana()<<"/"<<return_mana_max()<<"\n";
- score_string<<"deaths:"<<deaths<<"\n";
- score_string<<"game start:"<<start_date<<" at "<<start_time<<"\n";
- score_string<<"game end:"<<end_date<<" at "<<end_time<<"\n";
- score_string<<"class:"<<class_name<<"\n";
- score_string<<"race:"<<race_name<<"\n";
-
- /**if(gender==GENDER_MALE){
- score_string<<"gender:male"<<"\n";
- }
- else if(gender==GENDER_FEMALE){
- score_string<<"gender:female"<<"\n";
- }
- else if(gender==GENDER_NEUTRAL){
- score_string<<"gender:neutral"<<"\n";
- }*/
-
- if(cause_of_death==CAUSE_OF_DEATH_MELEE){
- death_message="Killed by ";
- death_message+=killer_article;
- death_message+=" ";
- death_message+=killer;
- death_message+=".";
- }
- else if(cause_of_death==CAUSE_OF_DEATH_THROWN){
- death_message="Killed by ";
- death_message+=killer_item_article;
- death_message+=" ";
- death_message+=killer_item;
- death_message+=" thrown by ";
- death_message+=killer_article;
- death_message+=" ";
- death_message+=killer;
- death_message+=".";
- }
- else if(cause_of_death==CAUSE_OF_DEATH_RANGED){
- death_message="Killed by ";
- death_message+=killer_item_article;
- death_message+=" ";
- death_message+=killer_item;
- death_message+=" fired by ";
- death_message+=killer_article;
- death_message+=" ";
- death_message+=killer;
- death_message+=".";
- }
- else if(cause_of_death==CAUSE_OF_DEATH_THIRST){
- death_message="Died of thirst.";
- }
- else if(cause_of_death==CAUSE_OF_DEATH_LAVA){
- death_message="Incinerated by molten lava.";
- }
- else if(cause_of_death==CAUSE_OF_DEATH_DROWN){
- death_message="Drowned.";
- }
- else if(cause_of_death==CAUSE_OF_DEATH_BURNED_BY_LIGHT){
- death_message="Burned up in the light.";
- }
-
- //If the player died.
- if(cause_of_death!=CAUSE_OF_DEATH_NONE){
- score_string<<death_message<<"\n";
- }
- //If the player escaped but did not win.
- else if(cause_of_death==CAUSE_OF_DEATH_NONE && !won){
- score_string<<"Escaped from the Lair."<<"\n";
- }
- //If the player escaped and won.
- else if(cause_of_death==CAUSE_OF_DEATH_NONE && won){
- score_string<<"Escaped from the Lair with "<<runestones<<"
Runestones."<<"\n";
- }
-
- score_string<<"\n\n";
-
- save_log<<score_string.str();
-
- save_log.close();
- save_log.clear();
- }
- else{
- fprintf(stderr,"Error saving game log entry.\n");
- }
-
- save_highscore(score_string.str());
-}
+ time_t now;
+ struct tm *tm_now;
+ char buff[BUFSIZ];
+ now=time(NULL);
+ tm_now=localtime(&now);
+
+ strftime(buff,sizeof buff,"%d",tm_now);
+
+ string day=buff;
+ string initial_day_digit="";
+ initial_day_digit+=day[0];
+
+ //Remove the leading zero, if any.
+ if(atoi(initial_day_digit.c_str())==0){
+ erase_head(day,1);
+ }
+
+ string number_ending="";
+
+ if(atoi(day.c_str())==11 || atoi(day.c_str())==12 ||
atoi(day.c_str())==13){
+ number_ending="th";
+ }
+ else if(atoi(day.c_str())%10==1){
+ number_ending="st";
+ }
+ else if(atoi(day.c_str())%10==2){
+ number_ending="nd";
+ }
+ else if(atoi(day.c_str())%10==3){
+ number_ending="rd";
+ }
+ else{
+ number_ending="th";
+ }
+
+ end_date="the ";
+ end_date+=day;
+ end_date+=number_ending;
+ strftime(buff,sizeof buff," day of %B, %Y",tm_now);
+ end_date+=buff;
+
+ strftime(buff,sizeof buff,"%H:%M:%S",tm_now);
+
+ end_time=buff;
+
+ //Determine whether the player won the game.
+
+ won=false;
+
+ runestones=0;
+
+ for(int i=0;i<inventory.size();i++){
+ if(inventory[i].name=="Runestone"){
+ runestones++;
+ }
+ }
+
+ if(runestones>=3){
+ won=true;
+ }
+
+ //Calculate score.
+
+ score=0;
+
+ //Add any points that were earned during play.
+ score+=score_from_game;
+
+ //Add the gold value of all inventory items.
+ for(int i=0;i<inventory.size();i++){
+ score+=inventory[i].monetary_value*inventory[i].stack;
+
+ //Add a score bonus if the item is a Runestone.
+ if(inventory[i].name=="Runestone"){
+ score+=100;
+ }
+ }
+
+ //Add the dungeon level bonus.
+ score+=(DUNGEON_DEPTH*50)-((max_level+1)*50);
+
+ //Add the experience level bonus.
+ score+=25*experience_level;
+
+ //Add the attribute bonuses.
+ for(int i=0;i<ATTRIBUTE_LUCK+1;i++){
+ score+=10*attributes[i];
+ }
+
+ //Add the skill bonuses.
+ for(int i=0;i<SKILL_MAGIC_SUMMONING+1;i++){
+ score+=5*skills[i][SKILL_EXPERIENCE_LEVEL];
+ }
+
+ //Double the total score if the player won.
+ if(won){
+ score*=2;
+ }
+
+ score_string<<"name:"<<name<<"\n";
+
score_string<<"version:"<<AutoVersion::MAJOR<<"."<<AutoVersion::MINOR<<"\n";
+ score_string<<"score:"<<score<<"\n";
+ score_string<<"dungeon level:"<<current_level+1<<"\n";
+ score_string<<"highest dungeon level:"<<max_level+1<<"\n";
+ score_string<<"experience level:"<<experience_level<<"\n";
+
score_string<<"health:"<<return_health()<<"/"<<return_health_max()<<"\n";
+ ///score_string<<"mana:"<<return_mana()<<"/"<<return_mana_max()<<"\n";
+ score_string<<"deaths:"<<deaths<<"\n";
+ score_string<<"game start:"<<start_date<<" at "<<start_time<<"\n";
+ score_string<<"game end:"<<end_date<<" at "<<end_time<<"\n";
+ score_string<<"class:"<<class_name<<"\n";
+ score_string<<"race:"<<race_name<<"\n";
+
+ /**if(gender==GENDER_MALE){
+ score_string<<"gender:male"<<"\n";
+ }
+ else if(gender==GENDER_FEMALE){
+ score_string<<"gender:female"<<"\n";
+ }
+ else if(gender==GENDER_NEUTRAL){
+ score_string<<"gender:neutral"<<"\n";
+ }*/
+
+ if(cause_of_death==CAUSE_OF_DEATH_MELEE){
+ death_message="Killed by ";
+ death_message+=killer_article;
+ death_message+=" ";
+ death_message+=killer;
+ death_message+=".";
+ }
+ else if(cause_of_death==CAUSE_OF_DEATH_THROWN){
+ death_message="Killed by ";
+ death_message+=killer_item_article;
+ death_message+=" ";
+ death_message+=killer_item;
+ death_message+=" thrown by ";
+ death_message+=killer_article;
+ death_message+=" ";
+ death_message+=killer;
+ death_message+=".";
+ }
+ else if(cause_of_death==CAUSE_OF_DEATH_RANGED){
+ death_message="Killed by ";
+ death_message+=killer_item_article;
+ death_message+=" ";
+ death_message+=killer_item;
+ death_message+=" fired by ";
+ death_message+=killer_article;
+ death_message+=" ";
+ death_message+=killer;
+ death_message+=".";
+ }
+ else if(cause_of_death==CAUSE_OF_DEATH_THIRST){
+ death_message="Died of thirst.";
+ }
+ else if(cause_of_death==CAUSE_OF_DEATH_LAVA){
+ death_message="Incinerated by molten lava.";
+ }
+ else if(cause_of_death==CAUSE_OF_DEATH_DROWN){
+ death_message="Drowned.";
+ }
+ else if(cause_of_death==CAUSE_OF_DEATH_BURNED_BY_LIGHT){
+ death_message="Burned up in the light.";
+ }
+
+ //If the player died.
+ if(cause_of_death!=CAUSE_OF_DEATH_NONE){
+ score_string<<death_message<<"\n";
+ }
+ //If the player escaped but did not win.
+ else if(cause_of_death==CAUSE_OF_DEATH_NONE && !won){
+ score_string<<"Escaped from the Lair."<<"\n";
+ }
+ //If the player escaped and won.
+ else if(cause_of_death==CAUSE_OF_DEATH_NONE && won){
+ score_string<<"Escaped from the Lair with "<<runestones<<"
Runestones."<<"\n";
+ }
+
+ score_string<<"\n\n";
+
+ //Only update the game log and highscores if this game was
non-cheating.
+ if(!flag_cheater){
+ ofstream save_log("game_log",ifstream::app);
+
+ if(save_log!=NULL){
+ save_log<<score_string.str();
+
+ save_log.close();
+ save_log.clear();
+ }
+ else{
+ fprintf(stderr,"Error saving game log entry.\n");
+ }
+
+ save_highscore(score_string.str());
+ }
+}
=======================================
--- /player_windows.cpp Wed Apr 20 12:02:54 2011
+++ /player_windows.cpp Wed Apr 20 22:50:31 2011
@@ -1315,10 +1315,10 @@
}

void Player::render_death(){
- short border_color=COLOR_SEPIA;
+ short border_color=COLOR_PAYNES_GRAY;
short font_color=COLOR_BLACK;

-
render_rectangle(0,0,option_screen_width,option_screen_height,1.0,COLOR_WHITE);
+
render_rectangle(0,0,option_screen_width,option_screen_height,1.0,COLOR_GRAY);

for(int i=font.w/256;i<option_screen_width-font.w/256;i+=font.w/256){
font.show(i,0,"\xCD",border_color);
=======================================
--- /save_load.cpp Wed Apr 20 05:54:06 2011
+++ /save_load.cpp Wed Apr 20 22:50:31 2011
@@ -78,6 +78,7 @@
save<<player.start_date<<"\n";
save<<player.start_time<<"\n";
save<<player.deaths<<"\n";
+ save<<player.flag_cheater<<"\n";
save<<player.score_from_game<<"\n";
for(int i=0;i<player.text_log.size();i++){
save<<player.text_log[i]<<"\n";
@@ -265,6 +266,9 @@
getline(load,line);
player.deaths=atoi(line.c_str());

+ getline(load,line);
+ player.flag_cheater=(bool)atoi(line.c_str());
+
getline(load,line);
player.score_from_game=atoi(line.c_str());

=======================================
--- /string_input.cpp Tue Apr 19 03:50:10 2011
+++ /string_input.cpp Wed Apr 20 22:50:31 2011
@@ -86,6 +86,7 @@
else if(istarts_with(str_command,"dev")){
player.option_dev=!player.option_dev;
options_save();
+
if(player.option_dev){
update_text_log("Dev mode on.",true,MESSAGE_SYSTEM);
}
=======================================
--- /version.h Wed Apr 20 12:02:54 2011
+++ /version.h Wed Apr 20 22:50:31 2011
@@ -4,7 +4,7 @@
namespace AutoVersion{

//Date Version Types
- static const char DATE[] = "20";
+ static const char DATE[] = "21";
static const char MONTH[] = "04";
static const char YEAR[] = "2011";
static const char UBUNTU_VERSION_STYLE[] = "11.04";
@@ -15,18 +15,18 @@

//Standard Version Type
static const long MAJOR = 0;
- static const long MINOR = 3;
- static const long BUILD = 3051;
- static const long REVISION = 16937;
+ static const long MINOR = 4;
+ static const long BUILD = 3070;
+ static const long REVISION = 17039;

//Miscellaneous Version Types
- static const long BUILDS_COUNT = 7162;
- #define RC_FILEVERSION 0,3,3051,16937
- #define RC_FILEVERSION_STRING "0, 3, 3051, 16937\0"
- static const char FULLVERSION_STRING[] = "0.3.3051.16937";
+ static const long BUILDS_COUNT = 7215;
+ #define RC_FILEVERSION 0,4,3070,17039
+ #define RC_FILEVERSION_STRING "0, 4, 3070, 17039\0"
+ static const char FULLVERSION_STRING[] = "0.4.3070.17039";

//These values are to keep track of your versioning state, don't modify
them.
- static const long BUILD_HISTORY = 91;
+ static const long BUILD_HISTORY = 10;


}

Reply all
Reply to author
Forward
0 new messages