[escape-from-the-masters-lair] 2 new revisions pushed by DarkOppr...@gmail.com on 2011-04-20 05:46 GMT

1 view
Skip to first unread message

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

unread,
Apr 20, 2011, 1:47:11 AM4/20/11
to escape-from-th...@googlegroups.com
2 new revisions:

Revision: c9383b1b5ca1
Author: Kevin Wells <DarkOp...@gmail.com>
Date: Tue Apr 19 21:47:52 2011
Log: Fixed a bug with random size item templates.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=c9383b1b5ca1

Revision: 2f148ae7af24
Author: Kevin Wells <DarkOp...@gmail.com>
Date: Tue Apr 19 22:46:05 2011
Log: Finished the smart character picker.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=2f148ae7af24

==============================================================================
Revision: c9383b1b5ca1
Author: Kevin Wells <DarkOp...@gmail.com>
Date: Tue Apr 19 21:47:52 2011
Log: Fixed a bug with random size item templates.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=c9383b1b5ca1

Modified:
/Escape from the Master's Lair.layout.save
/creature.cpp
/dungeon_generation.cpp
/player_start.cpp
/templates.cpp
/version.h

=======================================
--- /Escape from the Master's Lair.layout.save Tue Apr 19 12:07:59 2011
+++ /Escape from the Master's Lair.layout.save Tue Apr 19 21:47:52 2011
@@ -38,10 +38,10 @@
<Cursor1 position="325" topLine="0" />
</File>
<File name="creature.cpp" open="0" top="0" tabpos="4" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="16096" topLine="481" />
+ <Cursor1 position="379" topLine="0" />
</File>
<File name="creature.h" open="0" top="0" tabpos="4" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="5133" topLine="325" />
+ <Cursor1 position="12258" topLine="325" />
</File>
<File name="creature_alchemy.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="3400" topLine="48" />
@@ -68,7 +68,7 @@
<Cursor1 position="1018" topLine="18" />
</File>
<File name="creature_skills.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="2454" topLine="94" />
+ <Cursor1 position="289" topLine="2" />
</File>
<File name="dungeon.h" open="0" top="0" tabpos="0" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="198" topLine="0" />
@@ -89,7 +89,7 @@
<Cursor1 position="132" topLine="0" />
</File>
<File name="enumerations.h" open="0" top="0" tabpos="2" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="4911" topLine="26" />
+ <Cursor1 position="5056" topLine="276" />
</File>
<File name="font.cpp" open="0" top="0" tabpos="5" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="1745" topLine="48" />
@@ -215,7 +215,7 @@
<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="9326" topLine="286" />
+ <Cursor1 position="297" topLine="0" />
</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="3968" topLine="130" />
@@ -224,13 +224,10 @@
<Cursor1 position="6880" topLine="222" />
</File>
<File name="player_start.cpp" open="1" top="1" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="1786" topLine="42" />
- </File>
- <File name="player_starting_values.h" open="0" top="0" tabpos="0"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="196" topLine="0" />
+ <Cursor1 position="183" topLine="36" />
</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="13183" topLine="272" />
+ <Cursor1 position="279" topLine="0" />
</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" />
@@ -268,6 +265,9 @@
<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" />
</File>
+ <File name="starting_values.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
+ <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" />
</File>
=======================================
--- /creature.cpp Tue Apr 19 12:07:59 2011
+++ /creature.cpp Tue Apr 19 21:47:52 2011
@@ -127,6 +127,11 @@

//Apply the selected template to the item.
temp_item=templates.template_items[item_category][item_index];
+
+ //If the item is set to have a random size.
+
if(templates.template_items[item_category][item_index].random_size){
+
templates.template_items[item_category][item_index].size=templates.determine_item_size(&temp_item,item_category,item_index);
+ }

//If this item's template has only certain materials allowed.

if(templates.template_items[item_category][item_index].allowed_materials.size()>0){
=======================================
--- /dungeon_generation.cpp Mon Apr 18 19:58:29 2011
+++ /dungeon_generation.cpp Tue Apr 19 21:47:52 2011
@@ -796,6 +796,11 @@

//Apply the selected template to the item.

generated_items[generated_items.size()-1]=templates.template_items[random_item_category][random_item_template];
+
+ //If the item is set to have a random size.
+
if(templates.template_items[random_item_category][random_item_template].random_size){
+
templates.template_items[random_item_category][random_item_template].size=templates.determine_item_size(&generated_items[generated_items.size()-1],random_item_category,random_item_template);
+ }

//If this item's template has only certain materials allowed.

if(templates.template_items[random_item_category][random_item_template].allowed_materials.size()>0){
=======================================
--- /player_start.cpp Tue Apr 19 12:07:59 2011
+++ /player_start.cpp Tue Apr 19 21:47:52 2011
@@ -167,7 +167,39 @@
starting_items_gold=STARTING_ITEMS_GOLD;
starting_items.clear();

- ///
+ //Randomly select an item for purchase.
+ string item_wanted="";
+
+ int random_item=-1;
+
+ for(int n=0;n<;n++){
+ if(is_focused_skill(SKILL_BLADED_WEAPONS)){
+ item_wanted="simple wooden dagger";
+ }
+
+ for(int i=0;i<available_starting_items.size();i++){
+ if(available_starting_items[i]==item_wanted){
+ random_item=i;
+ break;
+ }
+ }
+
+ //Determine the monetary value of the item.
+ int item_value=0;
+
+ item_template_data
item_template=return_item_template(available_starting_items[random_item]);
+
+
item_value=templates.template_items[item_template.category][item_template.index].monetary_value;
+
+ //If we have enough money for this item.
+ if(item_value<=starting_items_gold){
+ //Add the purchased item.
+ starting_items.push_back(random_item);
+
+ //Remove the item's value from the starting gold.
+ starting_items_gold-=item_value;
+ }
+ }

done_buying_start_items=true;

=======================================
--- /templates.cpp Mon Apr 18 21:25:22 2011
+++ /templates.cpp Tue Apr 19 21:47:52 2011
@@ -140,15 +140,7 @@


replace_first(item->plural_name,"MATERIAL",material_to_string(item->material));

- //Determine the size to use for the item's attribute calculations.
- double
size_to_use=template_items[item_category][item_template_index].size;
-
- //If the item is set to have a random size.
- if(template_items[item_category][item_template_index].random_size){
-
size_to_use=determine_item_size(item,item_category,item_template_index);
- }
-
- calculate_item_attributes(item,size_to_use);
+
calculate_item_attributes(item,template_items[item_category][item_template_index].size);
}

double Templates::determine_item_size(Item* item,int item_category,int
item_template_index){
=======================================
--- /version.h Tue Apr 19 12:07:59 2011
+++ /version.h Tue Apr 19 21:47:52 2011
@@ -16,17 +16,17 @@
//Standard Version Type
static const long MAJOR = 0;
static const long MINOR = 3;
- static const long BUILD = 2964;
- static const long REVISION = 16446;
+ static const long BUILD = 2971;
+ static const long REVISION = 16482;

//Miscellaneous Version Types
- static const long BUILDS_COUNT = 6934;
- #define RC_FILEVERSION 0,3,2964,16446
- #define RC_FILEVERSION_STRING "0, 3, 2964, 16446\0"
- static const char FULLVERSION_STRING[] = "0.3.2964.16446";
+ static const long BUILDS_COUNT = 6946;
+ #define RC_FILEVERSION 0,3,2971,16482
+ #define RC_FILEVERSION_STRING "0, 3, 2971, 16482\0"
+ static const char FULLVERSION_STRING[] = "0.3.2971.16482";

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


}

==============================================================================
Revision: 2f148ae7af24
Author: Kevin Wells <DarkOp...@gmail.com>
Date: Tue Apr 19 22:46:05 2011
Log: Finished the smart character picker.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=2f148ae7af24

Modified:
/Development/Old To Do.rtf
/Development/To Do.rtf
/Escape from the Master's Lair.layout.save
/player_start.cpp
/version.h

=======================================
--- /Development/Old To Do.rtf Mon Apr 18 18:50:18 2011
+++ /Development/Old To Do.rtf Tue Apr 19 22:46:05 2011
@@ -139,6 +139,12 @@
\lang1033 -Add the highscores list.\par
\cf1 -Implement an action taking multiple turns. UPDATE: I may just cut
this out entirely.\cf0\strike0\par
\strike -Allow creatures to drop equipped items with one
command.\strike0\par
-\strike -Expand the equipping/unequipping/item command related
messages.\lang9\strike0\par
+\strike -Expand the equipping/unequipping/item command related
messages.\par
+-Implement drinking from fountains.\strike0\par
+\strike -Handle anything left in the code in comments.\lang9\strike0\par
+\strike -Add random character selection stuff to game startup.\strike0\par
+\strike -Finish making current races all unique.\strike0\par
+\strike -Add race descriptions to race selection screen.\strike0\par
+\strike -Add smart startup choice thing.\strike0\par
}

=======================================
--- /Development/To Do.rtf Tue Apr 19 12:07:59 2011
+++ /Development/To Do.rtf Tue Apr 19 22:46:05 2011
@@ -1,12 +1,5 @@
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
-{\*\generator Msftedit
5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl240\slmult1\lang1033\strike\f0\fs22
-Implement drinking from fountains.\strike0\par
-\strike -Handle anything left in the code in comments.\lang9\strike0\par
-\strike -Add random character selection stuff to game startup.\strike0\par
-\strike -Finish making current races all unique.\strike0\par
-\strike -Add race descriptions to race selection screen.\strike0\par
--Add smart startup choice thing.\par
-\par
-AFTER BRANCH:\par
+{\*\generator Msftedit
5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl240\slmult1\lang9\f0\fs22 AFTER
BRANCH:\par
-Clean up the focused skills selection window. Letters should be in proper
order. All in one column.\par
-Stats screen, all skills should be in one column.\strike\par
}
=======================================
--- /Escape from the Master's Lair.layout.save Tue Apr 19 21:47:52 2011
+++ /Escape from the Master's Lair.layout.save Tue Apr 19 22:46:05 2011
@@ -38,10 +38,10 @@
<Cursor1 position="325" topLine="0" />
</File>
<File name="creature.cpp" open="0" top="0" tabpos="4" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="379" topLine="0" />
+ <Cursor1 position="3107" topLine="43" />
</File>
<File name="creature.h" open="0" top="0" tabpos="4" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="12258" topLine="325" />
+ <Cursor1 position="2982" topLine="104" />
</File>
<File name="creature_alchemy.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="3400" topLine="48" />
@@ -74,7 +74,7 @@
<Cursor1 position="198" topLine="0" />
</File>
<File name="dungeon_generation.cpp" open="0" top="0" tabpos="6" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="29204" topLine="753" />
+ <Cursor1 position="30466" topLine="784" />
</File>
<File name="dungeon_location.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="235" topLine="0" />
@@ -152,10 +152,10 @@
<Cursor1 position="3653" topLine="162" />
</File>
<File name="item_template.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="255" topLine="0" />
+ <Cursor1 position="261" topLine="0" />
</File>
<File name="item_template.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="460" topLine="0" />
+ <Cursor1 position="407" topLine="0" />
</File>
<File name="level.cpp" open="0" top="0" tabpos="6" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="2385" topLine="185" />
@@ -215,10 +215,10 @@
<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="297" topLine="0" />
+ <Cursor1 position="6773" topLine="209" />
</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="3968" topLine="130" />
+ <Cursor1 position="2128" topLine="76" />
</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="6880" topLine="222" />
@@ -275,7 +275,7 @@
<Cursor1 position="242" topLine="0" />
</File>
<File name="templates.cpp" open="0" top="0" tabpos="2" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="21479" topLine="125" />
+ <Cursor1 position="4989" topLine="125" />
</File>
<File name="templates.h" open="0" top="0" tabpos="1" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="2465" topLine="70" />
=======================================
--- /player_start.cpp Tue Apr 19 21:47:52 2011
+++ /player_start.cpp Tue Apr 19 22:46:05 2011
@@ -97,7 +97,7 @@
void Player::game_start_good_race(){
//Pick a good race.

- int random=random_range(0,2);
+ int random=random_range(0,5);

string new_race="";

@@ -105,9 +105,18 @@
new_race="human";
}
else if(random==1){
- new_race="yak";
+ new_race="dwarf";
}
else if(random==2){
+ new_race="gnome";
+ }
+ else if(random==3){
+ new_race="wood elf";
+ }
+ else if(random==4){
+ new_race="yak";
+ }
+ else if(random==5){
new_race="lynx";
}

@@ -129,9 +138,9 @@

//If the player has an affiinity for one or more skills, choose those
first.

- for(int i=0;i<SKILL_MAGIC_SUMMONING+1;i++){
+ for(int i=SKILL_BLADED_WEAPONS;i<SKILL_MAGIC_SUMMONING+1;i++){
//If the player has less than the standard max experience for this
skill, he has a natural affinity for it.
- if(skills[i][SKILL_EXPERIENCE_MAX]<STARTING_SKILL_EXPERIENCE_MAX){
+
if(skills[i][SKILL_EXPERIENCE_MAX]+templates.template_races[race].skills[i][SKILL_EXPERIENCE_MAX]<STARTING_SKILL_EXPERIENCE_MAX){
for(int n=0;n<3;n++){
if(focused_skills[n]==-1){
focused_skills[n]=i;
@@ -143,19 +152,19 @@

for(int n=0;n<3;n++){
if(focused_skills[n]==-1){
- focused_skills[n]=SKILL_BLADED_WEAPONS;
+ focused_skills[n]=SKILL_ARMOR;
break;
}
}
for(int n=0;n<3;n++){
if(focused_skills[n]==-1){
- focused_skills[n]=SKILL_ARMOR;
+ focused_skills[n]=SKILL_SPEED;
break;
}
}
for(int n=0;n<3;n++){
if(focused_skills[n]==-1){
- focused_skills[n]=SKILL_SPEED;
+ focused_skills[n]=SKILL_BLADED_WEAPONS;
break;
}
}
@@ -172,32 +181,63 @@

int random_item=-1;

- for(int n=0;n<;n++){
- if(is_focused_skill(SKILL_BLADED_WEAPONS)){
- item_wanted="simple wooden dagger";
- }
-
- for(int i=0;i<available_starting_items.size();i++){
- if(available_starting_items[i]==item_wanted){
- random_item=i;
- break;
+ bool need_ammo=false;
+
+ for(int n=SKILL_BLADED_WEAPONS;n<SKILL_MAGIC_SUMMONING+1+20;n++){
+ item_wanted="";
+
+ //While we are looking at skills.
+ if(n<=SKILL_MAGIC_SUMMONING && is_focused_skill(n)){
+ if(n==SKILL_BLADED_WEAPONS){
+ item_wanted="simple wooden dagger";
+ }
+ else if(n==SKILL_BLUNT_WEAPONS){
+ item_wanted="simple wooden mace";
+ }
+ else if(n==SKILL_STABBING_WEAPONS){
+ item_wanted="simple wooden spear";
+ }
+ else if(n==SKILL_LAUNCHER_WEAPONS){
+ if(!need_ammo){
+ item_wanted="simple wooden bow";
+ n--;
+ need_ammo=true;
+ }
+ else{
+ item_wanted="simple wooden arrow";
+ }
+ }
+ else if(n==SKILL_THROWN_WEAPONS){
+ item_wanted="simple bone shuriken";
}
}
-
- //Determine the monetary value of the item.
- int item_value=0;
-
- item_template_data
item_template=return_item_template(available_starting_items[random_item]);
-
-
item_value=templates.template_items[item_template.category][item_template.index].monetary_value;
-
- //If we have enough money for this item.
- if(item_value<=starting_items_gold){
- //Add the purchased item.
- starting_items.push_back(random_item);
-
- //Remove the item's value from the starting gold.
- starting_items_gold-=item_value;
+ else if(n>SKILL_MAGIC_SUMMONING){
+
item_wanted=available_starting_items[random_range(13,available_starting_items.size()-1)];
+ }
+
+ if(item_wanted.length()>0){
+ for(int i=0;i<available_starting_items.size();i++){
+ if(available_starting_items[i]==item_wanted){
+ random_item=i;
+ break;
+ }
+ }
+
+ //Determine the monetary value of the item.
+ int item_value=0;
+
+ item_template_data
item_template=return_item_template(available_starting_items[random_item]);
+
+
item_value=templates.template_items[item_template.category][item_template.index].monetary_value;
+
+ //If we have enough money for this item.
+ if(item_value<=starting_items_gold){
+ //Add the purchased item.
+ starting_items.push_back(random_item);
+
+ //Remove the item's value from the starting gold.
+ starting_items_gold-=item_value;
+ }
}
}

=======================================
--- /version.h Tue Apr 19 21:47:52 2011
+++ /version.h Tue Apr 19 22:46:05 2011
@@ -4,7 +4,7 @@
namespace AutoVersion{

//Date Version Types
- static const char DATE[] = "19";
+ static const char DATE[] = "20";
static const char MONTH[] = "04";
static const char YEAR[] = "2011";
static const char UBUNTU_VERSION_STYLE[] = "11.04";
@@ -16,17 +16,17 @@
//Standard Version Type
static const long MAJOR = 0;
static const long MINOR = 3;
- static const long BUILD = 2971;
- static const long REVISION = 16482;
+ static const long BUILD = 2982;
+ static const long REVISION = 16542;

//Miscellaneous Version Types
- static const long BUILDS_COUNT = 6946;
- #define RC_FILEVERSION 0,3,2971,16482
- #define RC_FILEVERSION_STRING "0, 3, 2971, 16482\0"
- static const char FULLVERSION_STRING[] = "0.3.2971.16482";
+ static const long BUILDS_COUNT = 6988;
+ #define RC_FILEVERSION 0,3,2982,16542
+ #define RC_FILEVERSION_STRING "0, 3, 2982, 16542\0"
+ static const char FULLVERSION_STRING[] = "0.3.2982.16542";

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


}
Reply all
Reply to author
Forward
0 new messages