3 new revisions:
Revision: 4a24e19b0e86
Author: Kevin Wells <
DarkOp...@gmail.com>
Date: Wed Apr 20 10:59:15 2011
Log: Added launcher weapon slot.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=4a24e19b0e86
Revision: 84baa46dc96a
Author: Kevin Wells <
DarkOp...@gmail.com>
Date: Wed Apr 20 12:02:54 2011
Log: Bug fixes, tweaks, etc.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=84baa46dc96a
Revision: 9f1cf83942d7
Author: Kevin Wells <
DarkOp...@gmail.com>
Date: Wed Apr 20 12:30:03 2011
Log: Added licenses for everything.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=9f1cf83942d7
==============================================================================
Revision: 4a24e19b0e86
Author: Kevin Wells <
DarkOp...@gmail.com>
Date: Wed Apr 20 10:59:15 2011
Log: Added launcher weapon slot.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=4a24e19b0e86
Modified:
/Development/Ideas.rtf
/Development/Old To Do.rtf
/Development/To Do.rtf
/Escape from the Master's Lair.layout.save
/ai_keys.h
/combat_all.cpp
/covering.cpp
/creature.h
/creature_combat.cpp
/creature_commands.cpp
/creature_equipment.cpp
/creature_experience.cpp
/creature_skills.cpp
/dungeon_generation.cpp
/enumerations.h
/item.h
/item_combat.cpp
/monster.cpp
/player.cpp
/player_start.cpp
/player_windows.cpp
/random_chance.cpp
/random_chance.h
/templates.cpp
/templates_strings.cpp
/update.cpp
/version.h
=======================================
--- /Development/Ideas.rtf Wed Apr 20 05:55:33 2011
+++ /Development/Ideas.rtf Wed Apr 20 10:59:15 2011
@@ -1,4 +1,4 @@
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0
Calibri;}}
-{\*\generator Msftedit
5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\f0\fs22 I think
I should add a special new equipment slot for a launcher item. It could
work similarly to armor, in that ONLY launcher items can go in it. This
way, you could have a launcher item equipped while also dual-wielding or
single-wielding decent melee items. Right now, if you want melee and ranged
attacks ready, you have to have a melee and launcher item equipped in the
hand slots. But, this means that the launcher weapon is figured into melee
attacks.\par
+{\*\generator Msftedit
5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\f0\fs22\par
}
=======================================
--- /Development/Old To Do.rtf Wed Apr 20 05:55:33 2011
+++ /Development/Old To Do.rtf Wed Apr 20 10:59:15 2011
@@ -149,6 +149,8 @@
\pard\sa200\sl276\slmult1 The darkness should be more dangerous than
simply not allowing the player to see far, though. Perhaps some enemies
can only move in the darkness. Others could only spawn in the darkness.
Maybe some kind of zergling type creature (small and weak, but lots can
spawn) that only spawns in the dark near the player.\strike0\par
\strike I need to add monsters spawning over time. Also, dark-spawning
monsters.\strike0\par
\pard\sa200\sl240\slmult1\strike Maybe monsters initially spawned on a
level should be determined by the dungeon level, but monsters spawned later
on a given level are determined by the player's current experience
level.\par
-At higher levels, monsters could spawn with their items from their race
template. At lower levels, the items would be ignored.\strike0\par
+At higher levels, monsters could spawn with their items from their race
template. At lower levels, the items would be ignored.\par
+Cut fighting and dodging skills out of the code entirely.\par
+I think I should add a special new equipment slot for a launcher item. It
could work similarly to armor, in that ONLY launcher items can go in it.
This way, you could have a launcher item equipped while also dual-wielding
or single-wielding decent melee items. Right now, if you want melee and
ranged attacks ready, you have to have a melee and launcher item equipped
in the hand slots. But, this means that the launcher weapon is figured into
melee attacks.\strike0\par
}
=======================================
--- /Development/To Do.rtf Wed Apr 20 01:14:58 2011
+++ /Development/To Do.rtf Wed Apr 20 10:59:15 2011
@@ -1,7 +1,5 @@
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
-{\*\generator Msftedit
5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl240\slmult1\lang9\f0\fs22 Cut
fighting and dodging skills out of the code entirely.\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 Wed Apr 20 03:13:44 2011
+++ /Escape from the Master's Lair.layout.save Wed Apr 20 10:59:15 2011
@@ -5,13 +5,13 @@
<Cursor1 position="14358" topLine="427" />
</File>
<File name="age_limits.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="364" topLine="0" />
+ <Cursor1 position="266" topLine="0" />
</File>
<File name="ai.h" open="0" top="0" tabpos="4" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="347" topLine="0" />
</File>
<File name="ai_keys.h" open="0" top="0" tabpos="0" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="679" topLine="3" />
+ <Cursor1 position="573" topLine="3" />
</File>
<File name="collision.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="142" topLine="0" />
@@ -20,28 +20,28 @@
<Cursor1 position="132" topLine="0" />
</File>
<File name="combat_all.cpp" open="0" top="0" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="17" topLine="0" />
+ <Cursor1 position="261" topLine="0" />
</File>
<File name="combat_all.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="199" topLine="0" />
</File>
<File name="covering.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="973" topLine="20" />
+ <Cursor1 position="788" topLine="20" />
</File>
<File name="covering.h" open="0" top="0" tabpos="0" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="170" topLine="0" />
+ <Cursor1 position="544" topLine="0" />
</File>
<File name="covering_conversions.cpp" open="0" top="0" tabpos="0"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="776" topLine="0" />
+ <Cursor1 position="261" topLine="20" />
</File>
<File name="covering_conversions.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<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="3107" topLine="43" />
+ <Cursor1 position="14917" topLine="435" />
</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="10091" topLine="285" />
+ <Cursor1 position="11815" topLine="319" />
</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" />
@@ -49,35 +49,35 @@
<File name="creature_attributes.cpp" open="0" top="0" tabpos="0"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<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="4878" topLine="51" />
+ <File name="creature_combat.cpp" open="1" top="0" tabpos="3" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
+ <Cursor1 position="5729" topLine="132" />
</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="10188" topLine="295" />
+ <Cursor1 position="38498" topLine="1147" />
</File>
<File name="creature_equipment.cpp" open="0" top="0" tabpos="5" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="1143" topLine="174" />
+ <Cursor1 position="7224" topLine="178" />
</File>
<File name="creature_experience.cpp" open="0" top="0" tabpos="1"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="3573" topLine="79" />
+ <Cursor1 position="939" topLine="29" />
</File>
<File name="creature_other_stats.cpp" open="0" top="0" tabpos="4"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="4016" topLine="123" />
+ <Cursor1 position="199" topLine="6" />
</File>
<File name="creature_save_load.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<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="479" topLine="122" />
+ <Cursor1 position="2651" topLine="116" />
</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" />
</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="30466" topLine="784" />
+ <File name="dungeon_generation.cpp" open="1" top="1" tabpos="6" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
+ <Cursor1 position="22730" topLine="642" />
</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" />
+ <Cursor1 position="185" topLine="0" />
</File>
<File name="dungeon_location.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="147" 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="5639" topLine="333" />
+ <Cursor1 position="3438" topLine="187" />
</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" />
@@ -104,10 +104,10 @@
<Cursor1 position="818" topLine="29" />
</File>
<File name="game.cpp" open="0" top="0" tabpos="3" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="1930" topLine="78" />
+ <Cursor1 position="454" topLine="6" />
</File>
<File name="game.h" open="0" top="0" tabpos="4" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="1777" topLine="60" />
+ <Cursor1 position="724" topLine="33" />
</File>
<File name="game_window.cpp" open="0" top="0" tabpos="2" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="3456" topLine="96" />
@@ -143,10 +143,10 @@
<Cursor1 position="11165" topLine="405" />
</File>
<File name="item.h" open="0" top="0" tabpos="2" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="6386" topLine="6" />
+ <Cursor1 position="1224" topLine="152" />
</File>
<File name="item_combat.cpp" open="0" top="0" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="9606" topLine="72" />
+ <Cursor1 position="1828" topLine="28" />
</File>
<File name="item_save_load.cpp" open="0" top="0" tabpos="14" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="3653" topLine="162" />
@@ -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="4402" topLine="80" />
+ <Cursor1 position="4540" topLine="86" />
</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" />
@@ -191,10 +191,10 @@
<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="4120" topLine="396" />
+ <Cursor1 position="10396" topLine="292" />
</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="1103" topLine="27" />
+ <Cursor1 position="574" topLine="21" />
</File>
<File name="monster_ai.cpp" open="0" top="0" tabpos="2" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="985" topLine="96" />
@@ -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="1830" topLine="65" />
+ <Cursor1 position="21423" topLine="500" />
</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" />
</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" />
+ <Cursor1 position="8979" topLine="168" />
</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="6914" topLine="217" />
+ <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="49121" topLine="1296" />
+ <Cursor1 position="61113" topLine="1504" />
</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" />
@@ -236,16 +236,16 @@
<Cursor1 position="132" topLine="0" />
</File>
<File name="race.cpp" open="0" top="0" tabpos="2" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="362" topLine="0" />
+ <Cursor1 position="387" topLine="1" />
</File>
<File name="race.h" open="0" top="0" tabpos="3" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="678" topLine="3" />
+ <Cursor1 position="833" topLine="15" />
</File>
<File name="random_chance.cpp" open="0" top="0" tabpos="2" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="2427" topLine="76" />
+ <Cursor1 position="220" topLine="0" />
</File>
<File name="random_chance.h" open="0" top="0" tabpos="3" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="758" topLine="8" />
+ <Cursor1 position="296" topLine="0" />
</File>
<File name="random_number_generator.cpp" open="0" top="0" tabpos="0"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="474" topLine="0" />
@@ -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="1774" topLine="55" />
+ <Cursor1 position="1604" topLine="54" />
</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" />
@@ -275,13 +275,13 @@
<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="2212" topLine="35" />
+ <Cursor1 position="19513" topLine="549" />
</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" />
</File>
<File name="templates_strings.cpp" open="0" top="0" tabpos="6" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="6855" topLine="288" />
+ <Cursor1 position="3201" topLine="117" />
</File>
<File name="tile.cpp" open="0" top="0" tabpos="5" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="3899" topLine="96" />
@@ -305,10 +305,10 @@
<Cursor1 position="132" topLine="0" />
</File>
<File name="update.cpp" open="0" top="0" tabpos="2" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="13459" topLine="297" />
+ <Cursor1 position="4268" topLine="108" />
</File>
<File name="update.h" open="0" top="0" tabpos="11" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="249" topLine="0" />
+ <Cursor1 position="245" topLine="0" />
</File>
<File name="version.h" open="0" top="0" tabpos="0" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="369" topLine="0" />
=======================================
--- /ai_keys.h Mon Apr 18 18:50:18 2011
+++ /ai_keys.h Wed Apr 20 10:59:15 2011
@@ -24,6 +24,7 @@
AIK_EQUIP_RIGHT_HAND,
AIK_EQUIP_LEFT_HAND,
AIK_QUIVER_ITEM,
+ AIK_EQUIP_LAUNCHER_WEAPON,
AIK_EQUIP_ARMOR,
AIK_UNEQUIP_ITEM,
AIK_THROW_ITEM,
=======================================
--- /combat_all.cpp Wed Apr 20 02:37:11 2011
+++ /combat_all.cpp Wed Apr 20 10:59:15 2011
@@ -8,9 +8,6 @@
int determine_damage_reduction(Creature* target){
int damage_reduction=0;
- //Exercise the target's dodging skill.
- ///target->gain_skill_experience(SKILL_DODGING,1);
-
//Exercise the target's armor skill.
int points_gained=1;
=======================================
--- /covering.cpp Mon Apr 4 22:12:58 2011
+++ /covering.cpp Wed Apr 20 10:59:15 2011
@@ -26,6 +26,7 @@
if(age>=AGE_BLOOD_LOTS_DRY){
type=COVERING_BLOOD_DRIED;
+ age=0;
}
}
else if(type==COVERING_ICE){
@@ -33,6 +34,7 @@
if(age>=AGE_ICE){
type=COVERING_WATER;
+ age=0;
}
}
else if(type==COVERING_WATER){
=======================================
--- /creature.h Wed Apr 20 05:54:06 2011
+++ /creature.h Wed Apr 20 10:59:15 2011
@@ -338,8 +338,6 @@
int return_skill_thrown_weapons();
int return_skill_dual_wielding();
int return_skill_speed();
- ///int return_skill_fighting();
- ///int return_skill_dodging();
int return_skill_armor();
/**int return_skill_magic_air();
int return_skill_magic_fire();
=======================================
--- /creature_combat.cpp Wed Apr 20 05:54:06 2011
+++ /creature_combat.cpp Wed Apr 20 10:59:15 2011
@@ -16,182 +16,136 @@
string outcome="";
- //If the attacker succeeds its hit check.
-
/**if(rc_attack_hit(return_skill_fighting(),return_attribute_agility(),experience_level,target)){
- //If the defender fails its dodge check.
- if(!rc_attack_dodge(experience_level,target)){*/
- //The attack will hit.
- //We now determine the maximum amount of damage the attacker
can do (before the target's reduction(s)).
-
- //Damage begins with base melee damage.
- int
base_damage=random_range(base_damage_melee_min,base_damage_melee_max);
-
- damage=base_damage;
-
- //Add the racial base melee damage modifier.
-
- //If the race has a melee damage bonus.
- if(templates.template_races[race].base_damage_melee_max>=0){
-
damage+=random_range(templates.template_races[race].base_damage_melee_min,templates.template_races[race].base_damage_melee_max);
- }
- //If the race has a melee damage penalty.
- else{
-
damage-=random_range(abs(templates.template_races[race].base_damage_melee_min),abs(templates.template_races[race].base_damage_melee_max));
- }
-
- //Add in melee weapon damage.
-
- //Remember how many weapons are being wielded that the
creature has insufficient strength to wield properly.
- int weapons_under_strength=0;
-
- //Check for items wielded in either hand.
- for(int i=EQUIP_HOLD_RIGHT;i<EQUIP_HOLD_LEFT+1;i++){
- //If there is an item wielded in this hand.
- if(equipment[i]!=0){
- //Determine the identifier for the item equipped in
this slot.
- int item_identifier=index_of_item_in_slot(i);
-
- //Determine the base damage range for this item.
- int
weapon_damage_min=inventory[item_identifier].damage_min_melee;
- int
weapon_damage_max=inventory[item_identifier].damage_max_melee;
- int
weapon_damage=random_range(weapon_damage_min,weapon_damage_max);
-
- //Does the creature have enough strength to wield this
item?
- bool enough_strength=true;
-
- //If the creature does not have sufficient strength to
wield this item.
-
if(inventory[item_identifier].weight*1.5>attributes[ATTRIBUTE_STRENGTH]){
- weapons_under_strength++;
- enough_strength=false;
- }
-
- //Apply the appropriate weapon skill, if any.
-
- //If the item is governed by the bladed weapons skill.
- if(inventory[item_identifier].category==ITEM_WEAPON &&
inventory[item_identifier].governing_skill_weapon==SKILL_BLADED_WEAPONS){
-
weapon_damage+=weapon_damage*(return_skill_bladed_weapons()/10.0);
-
- if(enough_strength){
- //Exercise the bladed weapons skill.
- gain_skill_experience(SKILL_BLADED_WEAPONS,1);
- }
- }
- //If the item is governed by the blunt weapons skill.
- else
if(inventory[item_identifier].category==ITEM_WEAPON &&
inventory[item_identifier].governing_skill_weapon==SKILL_BLUNT_WEAPONS){
-
weapon_damage+=weapon_damage*(return_skill_blunt_weapons()/10.0);
-
- if(enough_strength){
- //Exercise the blunt weapons skill.
- gain_skill_experience(SKILL_BLUNT_WEAPONS,1);
- }
- }
- //If the item is governed by the stabbing weapons
skill.
- else
if(inventory[item_identifier].category==ITEM_WEAPON &&
inventory[item_identifier].governing_skill_weapon==SKILL_STABBING_WEAPONS){
-
weapon_damage+=weapon_damage*(return_skill_stabbing_weapons()/10.0);
-
- if(enough_strength){
- //Exercise the stabbing weapons skill.
-
gain_skill_experience(SKILL_STABBING_WEAPONS,1);
- }
- }
-
- //Add the weapon's damage to the attack's damage.
- damage+=weapon_damage;
+ //Determine the maximum amount of damage the attacker can do (before
the target's reduction(s)).
+
+ //Damage begins with base melee damage.
+ int
base_damage=random_range(base_damage_melee_min,base_damage_melee_max);
+
+ damage=base_damage;
+
+ //Add the racial base melee damage modifier.
+
+ //If the race has a melee damage bonus.
+ if(templates.template_races[race].base_damage_melee_max>=0){
+
damage+=random_range(templates.template_races[race].base_damage_melee_min,templates.template_races[race].base_damage_melee_max);
+ }
+ //If the race has a melee damage penalty.
+ else{
+
damage-=random_range(abs(templates.template_races[race].base_damage_melee_min),abs(templates.template_races[race].base_damage_melee_max));
+ }
+
+ //Add in melee weapon damage.
+
+ //Remember how many weapons are being wielded that the creature has
insufficient strength to wield properly.
+ int weapons_under_strength=0;
+
+ //Check for items wielded in either hand.
+ for(int i=EQUIP_HOLD_RIGHT;i<EQUIP_HOLD_LEFT+1;i++){
+ //If there is an item wielded in this hand.
+ if(equipment[i]!=0){
+ //Determine the identifier for the item equipped in this slot.
+ int item_identifier=index_of_item_in_slot(i);
+
+ //Determine the base damage range for this item.
+ int
weapon_damage_min=inventory[item_identifier].damage_min_melee;
+ int
weapon_damage_max=inventory[item_identifier].damage_max_melee;
+ int
weapon_damage=random_range(weapon_damage_min,weapon_damage_max);
+
+ //Does the creature have enough strength to wield this item?
+ bool enough_strength=true;
+
+ //If the creature does not have sufficient strength to wield
this item.
+
if(inventory[item_identifier].weight*1.5>attributes[ATTRIBUTE_STRENGTH]){
+ weapons_under_strength++;
+ enough_strength=false;
+ }
+
+ //Apply the appropriate weapon skill, if any.
+
+ //If the item is governed by the bladed weapons skill.
+ if(inventory[item_identifier].category==ITEM_WEAPON &&
inventory[item_identifier].governing_skill_weapon==SKILL_BLADED_WEAPONS){
+
weapon_damage+=weapon_damage*(return_skill_bladed_weapons()/10.0);
+
+ if(enough_strength){
+ //Exercise the bladed weapons skill.
+ gain_skill_experience(SKILL_BLADED_WEAPONS,1);
}
}
-
- //If items are being dual-wielded.
- if(equipment[EQUIP_HOLD_RIGHT]!=0 &&
equipment[EQUIP_HOLD_LEFT]!=0){
- //Apply the dual-wielding modifier.
-
- if(return_skill_dual_wielding()<10){
- damage-=50.0/return_skill_dual_wielding();
- }
- else{
- damage+=return_skill_dual_wielding()/2.0;
- }
-
- //As long as both weapons are being wielded with enough
strength.
- if(weapons_under_strength==0){
- //Exercise the dual wielding skill.
- gain_skill_experience(SKILL_DUAL_WIELDING,1);
+ //If the item is governed by the blunt weapons skill.
+ else if(inventory[item_identifier].category==ITEM_WEAPON &&
inventory[item_identifier].governing_skill_weapon==SKILL_BLUNT_WEAPONS){
+
weapon_damage+=weapon_damage*(return_skill_blunt_weapons()/10.0);
+
+ if(enough_strength){
+ //Exercise the blunt weapons skill.
+ gain_skill_experience(SKILL_BLUNT_WEAPONS,1);
+ }
+ }
+ //If the item is governed by the stabbing weapons skill.
+ else if(inventory[item_identifier].category==ITEM_WEAPON &&
inventory[item_identifier].governing_skill_weapon==SKILL_STABBING_WEAPONS){
+
weapon_damage+=weapon_damage*(return_skill_stabbing_weapons()/10.0);
+
+ if(enough_strength){
+ //Exercise the stabbing weapons skill.
+ gain_skill_experience(SKILL_STABBING_WEAPONS,1);
}
}
- //If there are no items being wielded.
- else if(equipment[EQUIP_HOLD_RIGHT]==0 &&
equipment[EQUIP_HOLD_LEFT]==0){
- //Apply the unarmed weapon skill.
- damage+=base_damage*(return_skill_unarmed()/10.0);
-
- //Exercise the unarmed skill.
- gain_skill_experience(SKILL_UNARMED,1);
- }
-
- //Apply the strength bonus.
- damage+=damage*(return_attribute_strength()/4.0);
-
- //If the creature is wielding one or more weapons under
strength, reduce its damage.
- if(weapons_under_strength==1){
- damage/=2.0;
- }
- else if(weapons_under_strength==2){
- damage/=4.0;
- }
-
- //We have finished determining the maximum damage the attacker
can do.
- //Now, we determine the damage reduction based on the target's
stats.
-
- int damage_reduction=determine_damage_reduction(target);
-
- //Subtract the total damage reduction from the maximum damage.
- damage-=damage_reduction;
-
- if(damage<0){
- damage=0;
- }
-
- //If the attacker succeeds in a critical strike.
-
/**if(rc_attack_critical_strike(return_attribute_agility(),experience_level,target)){
- damage+=random_range(damage/4,damage/2);
- }*/
- /**}
- //If the defender succeeds in its dodge check.
- else{
- if(is_player){
- outcome="The ";
- outcome+=target->return_full_name();
- outcome+=" dodges out of the way!";
- }
- else{
- outcome="You dodge the ";
- outcome+=return_full_name();
- outcome+="'s attack!";
- }
-
- update_text_log(outcome.c_str(),true);
-
- return;
- }*/
- /**}
- //If the attacker fails its hit check.
- else{
- if(is_player){
- outcome="You miss the ";
- outcome+=target->return_full_name();
- outcome+="!";
- }
- else{
- outcome="The ";
- outcome+=return_full_name();
- outcome+=" misses!";
- }
-
- update_text_log(outcome.c_str(),true);
-
- return;
- }*/
-
- //If the attack succeeded and did damage.
+ //Add the weapon's damage to the attack's damage.
+ damage+=weapon_damage;
+ }
+ }
+
+ //If items are being dual-wielded.
+ if(equipment[EQUIP_HOLD_RIGHT]!=0 && equipment[EQUIP_HOLD_LEFT]!=0){
+ //Apply the dual-wielding modifier.
+
+ if(return_skill_dual_wielding()<10){
+ damage-=50.0/return_skill_dual_wielding();
+ }
+ else{
+ damage+=return_skill_dual_wielding()/2.0;
+ }
+
+ //As long as both weapons are being wielded with enough strength.
+ if(weapons_under_strength==0){
+ //Exercise the dual wielding skill.
+ gain_skill_experience(SKILL_DUAL_WIELDING,1);
+ }
+ }
+
+ //If there are no items being wielded.
+ else if(equipment[EQUIP_HOLD_RIGHT]==0 &&
equipment[EQUIP_HOLD_LEFT]==0){
+ //Apply the unarmed weapon skill.
+ damage+=base_damage*(return_skill_unarmed()/10.0);
+
+ //Exercise the unarmed skill.
+ gain_skill_experience(SKILL_UNARMED,1);
+ }
+
+ //Apply the strength bonus.
+ damage+=damage*(return_attribute_strength()/4.0);
+
+ //If the creature is wielding one or more weapons under strength,
reduce its damage.
+ if(weapons_under_strength==1){
+ damage/=2.0;
+ }
+ else if(weapons_under_strength==2){
+ damage/=4.0;
+ }
+
+ //We have finished determining the maximum damage the attacker can do.
+ //Now, we determine the damage reduction based on the target's stats.
+
+ int damage_reduction=determine_damage_reduction(target);
+
+ //Subtract the total damage reduction from the maximum damage.
+ damage-=damage_reduction;
+
+ if(damage<0){
+ damage=0;
+ }
+
+ //If the attack did damage.
if(damage>0){
//If the creature is the player.
if(is_player){
=======================================
--- /creature_commands.cpp Tue Apr 19 03:50:10 2011
+++ /creature_commands.cpp Wed Apr 20 10:59:15 2011
@@ -450,9 +450,8 @@
else if(command==DIRECTIONAL_COMMAND_FIRE_ITEM){
//If an item is quivered.
if(!equipment_slot_empty(-1,EQUIP_QUIVER) &&
- //And if a launcher is being wielded in either the right or
left hand.
- ((!equipment_slot_empty(-1,EQUIP_HOLD_RIGHT) &&
inventory[index_of_item_in_slot(EQUIP_HOLD_RIGHT)].category==ITEM_WEAPON &&
inventory[index_of_item_in_slot(EQUIP_HOLD_RIGHT)].governing_skill_weapon==SKILL_LAUNCHER_WEAPONS)
||
- (!equipment_slot_empty(-1,EQUIP_HOLD_LEFT) &&
inventory[index_of_item_in_slot(EQUIP_HOLD_LEFT)].category==ITEM_WEAPON &&
inventory[index_of_item_in_slot(EQUIP_HOLD_LEFT)].governing_skill_weapon==SKILL_LAUNCHER_WEAPONS))){
+ //And if a launcher is being wielded in the launcher weapon
slot.
+ !equipment_slot_empty(-1,EQUIP_LAUNCHER_WEAPON)){
initiate_turn=true;
}
//If no item is quivered.
@@ -691,9 +690,6 @@
//If the item's stack is not 0.
if(inventory[inventory_item_index].stack!=0){
- //Exercise the fighting skill.
- ///gain_skill_experience(SKILL_FIGHTING,1);
-
//If the item is an actual thrown weapon.
if(inventory[inventory_item_index].category==ITEM_WEAPON &&
inventory[inventory_item_index].governing_skill_weapon==SKILL_THROWN_WEAPONS){
//Exercise the thrown weapons skill.
@@ -758,15 +754,7 @@
int quivered_item=index_of_item_in_slot(EQUIP_QUIVER);
//Determine the index of the launcher item.
- int launcher_item=-1;
- //If a launcher is being wielded in the right hand.
- if(!equipment_slot_empty(-1,EQUIP_HOLD_RIGHT) &&
inventory[index_of_item_in_slot(EQUIP_HOLD_RIGHT)].category==ITEM_WEAPON &&
inventory[index_of_item_in_slot(EQUIP_HOLD_RIGHT)].governing_skill_weapon==SKILL_LAUNCHER_WEAPONS){
- launcher_item=index_of_item_in_slot(EQUIP_HOLD_RIGHT);
- }
- //If a launcher is being wielded in the left hand.
- else if(!equipment_slot_empty(-1,EQUIP_HOLD_LEFT) &&
inventory[index_of_item_in_slot(EQUIP_HOLD_LEFT)].category==ITEM_WEAPON &&
inventory[index_of_item_in_slot(EQUIP_HOLD_LEFT)].governing_skill_weapon==SKILL_LAUNCHER_WEAPONS){
- launcher_item=index_of_item_in_slot(EQUIP_HOLD_LEFT);
- }
+ int launcher_item=index_of_item_in_slot(EQUIP_LAUNCHER_WEAPON);
//Setup a fire message.
@@ -793,9 +781,6 @@
//If the quivered item's stack is not 0.
if(inventory[quivered_item].stack!=0){
- //Exercise the fighting skill.
- ///gain_skill_experience(SKILL_FIGHTING,1);
-
//Exercise the launcher weapons skill.
gain_skill_experience(SKILL_LAUNCHER_WEAPONS,1);
@@ -822,7 +807,7 @@
//Add the item to the dungeon items vector.
vector_levels[current_level].items.push_back(inventory[quivered_item]);
- //Regardless of whether or not the item was unequipped above,
the new item in the dungeon MUST not be set to equipped.
+ //Regardless of whether or not the item was unequipped above,
the new item in the dungeon MUST NOT be set to equipped.
vector_levels[current_level].items[vector_levels[current_level].items.size()-1].equipped=false;
//Assign an identifier to the newly fired item.
@@ -1140,7 +1125,7 @@
}
else if(command==INVENTORY_COMMAND_EQUIP_RIGHT_HAND ||
command==INVENTORY_COMMAND_EQUIP_LEFT_HAND ||
- command==INVENTORY_COMMAND_QUIVER_ITEM ||
command==INVENTORY_COMMAND_EQUIP_ARMOR){
+ command==INVENTORY_COMMAND_QUIVER_ITEM ||
command==INVENTORY_COMMAND_EQUIP_ARMOR ||
command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON){
//Determine the equipment slot to check.
//If this remains -1, we are checking an armor slot.
short equip_slot=-1;
@@ -1153,6 +1138,9 @@
else if(command==INVENTORY_COMMAND_QUIVER_ITEM){
equip_slot=EQUIP_QUIVER;
}
+ else if(command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON){
+ equip_slot=EQUIP_LAUNCHER_WEAPON;
+ }
//If the item is not already equipped.
if(!inventory[inventory_item_index].equipped &&
@@ -1169,6 +1157,19 @@
update_text_log(str_msg.c_str(),is_player);
update_text_log("I suppose you could unequip it and then equip
it again, but then who would that be helping, really?",is_player);
+ //No inventory command will be executed.
+ input_inventory=0;
+ inventory_input_state=0;
+ }
+ //If the item is not a launcher weapon, but the creature tried to
wield it as one.
+ else if(command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON &&
(inventory[inventory_item_index].category!=ITEM_WEAPON ||
inventory[inventory_item_index].governing_skill_weapon!=SKILL_LAUNCHER_WEAPONS)){
+ string message="You can't use ";
+ message+=a_vs_an(&inventory[inventory_item_index]);
+ message+=" ";
+ message+=inventory[inventory_item_index].return_full_name(1);
+ message+=" as a launcher!";
+ update_text_log(message.c_str(),is_player);
+
//No inventory command will be executed.
input_inventory=0;
inventory_input_state=0;
@@ -1435,7 +1436,7 @@
}
else if(command==INVENTORY_COMMAND_EQUIP_RIGHT_HAND ||
command==INVENTORY_COMMAND_EQUIP_LEFT_HAND ||
- command==INVENTORY_COMMAND_QUIVER_ITEM ||
command==INVENTORY_COMMAND_EQUIP_ARMOR){
+ command==INVENTORY_COMMAND_QUIVER_ITEM ||
command==INVENTORY_COMMAND_EQUIP_ARMOR ||
command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON){
//Setup an equip message.
string str_item="";
@@ -1448,6 +1449,9 @@
else if(command==INVENTORY_COMMAND_QUIVER_ITEM){
str_item="You place the ";
}
+ else if(command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON){
+ str_item="You wield the ";
+ }
else if(command==INVENTORY_COMMAND_EQUIP_ARMOR){
str_item="You put on the ";
}
@@ -1464,6 +1468,11 @@
str_item+=return_full_name();
str_item+=" places the ";
}
+ else if(command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON){
+ str_item="The ";
+ str_item+=return_full_name();
+ str_item+=" wields the ";
+ }
else if(command==INVENTORY_COMMAND_EQUIP_ARMOR){
str_item="The ";
str_item+=return_full_name();
@@ -1471,7 +1480,7 @@
}
}
- if(command==INVENTORY_COMMAND_EQUIP_RIGHT_HAND ||
command==INVENTORY_COMMAND_EQUIP_LEFT_HAND){
+ if(command==INVENTORY_COMMAND_EQUIP_RIGHT_HAND ||
command==INVENTORY_COMMAND_EQUIP_LEFT_HAND ||
command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON){
str_item+=inventory[inventory_item_index].return_full_name(1);
}
else{
@@ -1502,6 +1511,14 @@
str_item+=" into its quiver";
}
}
+ else if(command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON){
+ if(is_player){
+ str_item+=" as a launcher";
+ }
+ else{
+ str_item+=" as a launcher";
+ }
+ }
str_item+=".";
@@ -1516,6 +1533,9 @@
else if(command==INVENTORY_COMMAND_EQUIP_LEFT_HAND){
equip_slot=EQUIP_HOLD_LEFT;
}
+ else if(command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON){
+ equip_slot=EQUIP_LAUNCHER_WEAPON;
+ }
else if(command==INVENTORY_COMMAND_QUIVER_ITEM){
equip_slot=EQUIP_QUIVER;
}
=======================================
--- /creature_equipment.cpp Mon Apr 4 22:12:58 2011
+++ /creature_equipment.cpp Wed Apr 20 10:59:15 2011
@@ -90,7 +90,7 @@
}
void Creature::equip_item(int item_identifier,short equip_slot){
- //If we are equipping an item in the right hand, left hand, or quiver.
+ //If we are equipping an item in the right hand, left hand, quiver, or
launcher weapon slot.
if(equip_slot!=-1){
//Assign the item to this slot.
equipment[equip_slot]=inventory[item_identifier].inventory_letter;
@@ -185,8 +185,13 @@
///This might instead be handled in the inventory input check function.
///For now, all weapons need one slot.
- //If we are checking the right hand, left hand, or quiver.
+ //If we are checking the right hand, left hand, quiver, or launcher
weapon slot.
if(equip_slot!=-1){
+ //If the slot is the launcher weapon slot, and the item is not a
launcher weapon.
+ if(equip_slot==EQUIP_LAUNCHER_WEAPON &&
(inventory[item_identifier].category!=ITEM_WEAPON ||
inventory[item_identifier].governing_skill_weapon!=SKILL_LAUNCHER_WEAPONS)){
+ return false;
+ }
+
//If the slot is empty.
if(equipment[equip_slot]==0){
return true;
=======================================
--- /creature_experience.cpp Mon Apr 18 05:06:09 2011
+++ /creature_experience.cpp Wed Apr 20 10:59:15 2011
@@ -284,7 +284,7 @@
}
//If the skill is governed by agility.
else if(skill==SKILL_SECURITY || skill==SKILL_STEALTH ||
skill==SKILL_LAUNCHER_WEAPONS || skill==SKILL_THROWN_WEAPONS ||
- skill==SKILL_DUAL_WIELDING || skill==SKILL_SPEED ||
skill==SKILL_FIGHTING || skill==SKILL_DODGING){
+ skill==SKILL_DUAL_WIELDING || skill==SKILL_SPEED){
attribute_level_bonuses[ATTRIBUTE_AGILITY]++;
}
//If the skill is governed by hardiness.
=======================================
--- /creature_skills.cpp Mon Apr 18 18:50:18 2011
+++ /creature_skills.cpp Wed Apr 20 10:59:15 2011
@@ -121,26 +121,6 @@
return (int)skill;
}
-/**int Creature::return_skill_fighting(){
- double skill=skills[SKILL_FIGHTING][SKILL_EXPERIENCE_LEVEL];
-
- if(skill<1.0){
- skill=1.0;
- }
-
- return (int)skill;
-}
-
-int Creature::return_skill_dodging(){
- double skill=skills[SKILL_DODGING][SKILL_EXPERIENCE_LEVEL];
-
- if(skill<1.0){
- skill=1.0;
- }
-
- return (int)skill;
-}*/
-
int Creature::return_skill_armor(){
double skill=skills[SKILL_ARMOR][SKILL_EXPERIENCE_LEVEL];
=======================================
--- /dungeon_generation.cpp Wed Apr 20 05:54:06 2011
+++ /dungeon_generation.cpp Wed Apr 20 10:59:15 2011
@@ -608,7 +608,6 @@
y=random_range(0,generated_level_y-1);
//If the tile at the random position is an appropriate tile.
- ///It should also check to make sure there is not more than one
other fountain within a small radius.
if(generated_tiles[x][y].type==TILE_TYPE_FLOOR){
generated_tiles[x][y].type=TILE_TYPE_FOUNTAIN;
generated_tiles[x][y].material=MATERIAL_WATER;
@@ -624,7 +623,7 @@
//Add traps.
//The maximum number.
- int
max_traps=random_range((generated_level_x*generated_level_y)/25000,(generated_level_x*generated_level_y)/20000);
+ /**int
max_traps=random_range((generated_level_x*generated_level_y)/25000,(generated_level_x*generated_level_y)/20000);
//The maximum number of tries.
int
random_amount_traps=random_range((generated_level_x*generated_level_y)/10,(generated_level_x*generated_level_y)/4);
//The number created successfully.
@@ -638,7 +637,6 @@
y=random_range(0,generated_level_y-1);
//If the tile at the random position is an appropriate tile.
- ///It should also check to make sure there is not more than one
other trap within a small radius.
if(generated_tiles[x][y].type==TILE_TYPE_FLOOR){
generated_tiles[x][y].type=TILE_TYPE_TRAP;
traps_created++;
@@ -648,7 +646,7 @@
if(traps_created>max_traps){
break;
}
- }
+ }*/
//Modify the covering(s) of the tiles according to the level's
temperature.
for(short y=0;y<generated_level_y;y++){
=======================================
--- /enumerations.h Wed Apr 20 05:54:06 2011
+++ /enumerations.h Wed Apr 20 10:59:15 2011
@@ -255,9 +255,9 @@
HEALING_SLIGHT_MIN=15,
HEALING_SLIGHT_MAX=25,
HEALING_MIN=50,
- HEALING_MAX=200,
- HEALING_CONSIDERABLE_MIN=500,
- HEALING_CONSIDERABLE_MAX=2000
+ HEALING_MAX=100,
+ HEALING_CONSIDERABLE_MIN=100,
+ HEALING_CONSIDERABLE_MAX=200
};
//*************//
@@ -293,8 +293,6 @@
SKILL_THROWN_WEAPONS,
SKILL_DUAL_WIELDING,
SKILL_SPEED,
- SKILL_FIGHTING,
- SKILL_DODGING,
SKILL_ARMOR,
@@ -371,6 +369,7 @@
EQUIP_FINGER_RIGHT,
EQUIP_FINGER_LEFT,
EQUIP_QUIVER,
+ EQUIP_LAUNCHER_WEAPON,
EQUIP_HOLD_RIGHT,
EQUIP_HOLD_LEFT
};
@@ -480,6 +479,7 @@
INVENTORY_COMMAND_EQUIP_RIGHT_HAND,
INVENTORY_COMMAND_EQUIP_LEFT_HAND,
INVENTORY_COMMAND_QUIVER_ITEM,
+ INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON,
INVENTORY_COMMAND_EQUIP_ARMOR,
INVENTORY_COMMAND_UNEQUIP_ITEM,
INVENTORY_COMMAND_THROW_ITEM,
=======================================
--- /item.h Sat Apr 16 07:21:30 2011
+++ /item.h Wed Apr 20 10:59:15 2011
@@ -20,7 +20,6 @@
struct Owner_Data_Thrown{
short strength;
short agility;
- ///short fighting_skill;
short thrown_weapons_skill;
short experience_level;
short base_damage_min_thrown;
@@ -34,7 +33,6 @@
struct Owner_Data_Fired{
short strength;
short agility;
- ///short fighting_skill;
short launcher_weapons_skill;
short experience_level;
short base_damage_min_ranged;
=======================================
--- /item_combat.cpp Wed Apr 20 01:14:58 2011
+++ /item_combat.cpp Wed Apr 20 10:59:15 2011
@@ -25,7 +25,6 @@
owner_data_thrown[0].strength=creature->return_attribute_strength();
owner_data_thrown[0].agility=creature->return_attribute_agility();
-
///owner_data_thrown[0].fighting_skill=creature->return_skill_fighting();
owner_data_thrown[0].thrown_weapons_skill=creature->return_skill_thrown_weapons();
owner_data_thrown[0].experience_level=creature->experience_level;
owner_data_thrown[0].base_damage_min_thrown=creature->base_damage_thrown_min;
@@ -42,7 +41,6 @@
owner_data_fired[0].strength=creature->return_attribute_strength();
owner_data_fired[0].agility=creature->return_attribute_agility();
-
///owner_data_fired[0].fighting_skill=creature->return_skill_fighting();
owner_data_fired[0].launcher_weapons_skill=creature->return_skill_launcher_weapons();
owner_data_fired[0].experience_level=creature->experience_level;
owner_data_fired[0].base_damage_min_ranged=creature->base_damage_ranged_min;
@@ -78,117 +76,63 @@
string outcome="";
- //If the attacker succeeds its hit check.
-
/**if(rc_attack_hit(owner_data_thrown[0].fighting_skill,owner_data_thrown[0].agility,owner_data_thrown[0].experience_level,target)){
- //If the defender fails its dodge check.
-
if(!rc_attack_dodge(owner_data_thrown[0].experience_level,target)){*/
- //The attack will hit.
- //We now determine the maximum amount of damage the attacker
can do (before the target's reduction(s)).
-
- //Damage begins with base thrown damage.
- int
base_damage=random_range(owner_data_thrown[0].base_damage_min_thrown,owner_data_thrown[0].base_damage_max_thrown);
-
- damage=base_damage;
-
- //Add the momentum bonus.
- damage+=momentum*2.0;
-
- //Add the racial base thrown damage modifier.
-
- //If the race has a thrown damage bonus.
-
if(templates.template_races[owner_data_thrown[0].race].base_damage_thrown_max>=0){
-
damage+=random_range(templates.template_races[owner_data_thrown[0].race].base_damage_thrown_min,templates.template_races[owner_data_thrown[0].race].base_damage_thrown_max);
- }
- //If the race has a thrown damage penalty.
- else{
-
damage-=random_range(abs(templates.template_races[owner_data_thrown[0].race].base_damage_thrown_min),abs(templates.template_races[owner_data_thrown[0].race].base_damage_thrown_max));
- }
-
- //Add in thrown weapon damage.
-
- //Determine the base damage range for this item.
- int weapon_damage_min=damage_min_thrown;
- int weapon_damage_max=damage_max_thrown;
- int
weapon_damage=random_range(weapon_damage_min,weapon_damage_max);
-
- //Apply the appropriate weapon skill, if any.
-
- //If the item is governed by the thrown weapons skill.
- if(category==ITEM_WEAPON &&
governing_skill_weapon==SKILL_THROWN_WEAPONS){
-
weapon_damage+=weapon_damage*(owner_data_thrown[0].thrown_weapons_skill/10);
- }
-
- //Add the weapon's damage to the attack's damage.
- damage+=weapon_damage;
-
- //Apply the agility bonus.
- damage+=damage*(owner_data_thrown[0].agility/6);
-
- //Apply the strength bonus.
- damage+=damage*(owner_data_thrown[0].strength/8);
-
- //We have finished determining the maximum damage the attacker
can do.
- //Now, we determine the damage reduction based on the target's
stats.
-
- int damage_reduction=determine_damage_reduction(target);
-
- //Subtract the total damage reduction from the maximum damage.
- damage-=damage_reduction;
-
- if(damage<0){
- damage=0;
- }
-
- //If the attacker succeeds in a critical strike.
-
/**if(rc_attack_critical_strike(owner_data_thrown[0].agility,owner_data_thrown[0].experience_level,target)){
- damage+=random_range(damage/4,damage/2);
- }*/
- /**}
- //If the defender succeeds in its dodge check.
- else{
- if(owner_data_thrown[0].is_player){
- outcome="The ";
- outcome+=target->return_full_name();
- outcome+=" dodges your ";
- outcome+=return_full_name(1);
- outcome+="!";
- }
- else{
- outcome="You dodge the ";
- outcome+=owner_data_thrown[0].full_name;
- outcome+="'s ";
- outcome+=return_full_name(1);
- outcome+="!";
- }
-
- update_text_log(outcome.c_str(),true);
-
- return;
- }*/
- /**}
- //If the attacker fails its hit check.
- else{
- if(owner_data_thrown[0].is_player){
- outcome="Your ";
- outcome+=return_full_name(1);
- outcome+=" misses the ";
- outcome+=target->return_full_name();
- outcome+="!";
- }
- else{
- outcome="The ";
- outcome+=owner_data_thrown[0].full_name;
- outcome+="'s ";
- outcome+=return_full_name(1);
- outcome+=" misses!";
- }
-
- update_text_log(outcome.c_str(),true);
-
- return;
- }*/
-
- //If the attack succeeded and did damage.
+ //Determine the maximum amount of damage the attacker can do (before
the target's reduction(s)).
+
+ //Damage begins with base thrown damage.
+ int
base_damage=random_range(owner_data_thrown[0].base_damage_min_thrown,owner_data_thrown[0].base_damage_max_thrown);
+
+ damage=base_damage;
+
+ //Add the momentum bonus.
+ damage+=momentum*2.0;
+
+ //Add the racial base thrown damage modifier.
+
+ //If the race has a thrown damage bonus.
+
if(templates.template_races[owner_data_thrown[0].race].base_damage_thrown_max>=0){
+
damage+=random_range(templates.template_races[owner_data_thrown[0].race].base_damage_thrown_min,templates.template_races[owner_data_thrown[0].race].base_damage_thrown_max);
+ }
+ //If the race has a thrown damage penalty.
+ else{
+
damage-=random_range(abs(templates.template_races[owner_data_thrown[0].race].base_damage_thrown_min),abs(templates.template_races[owner_data_thrown[0].race].base_damage_thrown_max));
+ }
+
+ //Add in thrown weapon damage.
+
+ //Determine the base damage range for this item.
+ int weapon_damage_min=damage_min_thrown;
+ int weapon_damage_max=damage_max_thrown;
+ int weapon_damage=random_range(weapon_damage_min,weapon_damage_max);
+
+ //Apply the appropriate weapon skill, if any.
+
+ //If the item is governed by the thrown weapons skill.
+ if(category==ITEM_WEAPON &&
governing_skill_weapon==SKILL_THROWN_WEAPONS){
+
weapon_damage+=weapon_damage*(owner_data_thrown[0].thrown_weapons_skill/10);
+ }
+
+ //Add the weapon's damage to the attack's damage.
+ damage+=weapon_damage;
+
+ //Apply the agility bonus.
+ damage+=damage*(owner_data_thrown[0].agility/6);
+
+ //Apply the strength bonus.
+ damage+=damage*(owner_data_thrown[0].strength/8);
+
+ //We have finished determining the maximum damage the attacker can do.
+ //Now, we determine the damage reduction based on the target's stats.
+
+ int damage_reduction=determine_damage_reduction(target);
+
+ //Subtract the total damage reduction from the maximum damage.
+ damage-=damage_reduction;
+
+ if(damage<0){
+ damage=0;
+ }
+
+ //If the attack did damage.
if(damage>0){
//If the creature is the player.
if(owner_data_thrown[0].is_player){
@@ -243,122 +187,68 @@
string outcome="";
- //If the attacker succeeds its hit check.
-
/**if(rc_attack_hit(owner_data_fired[0].fighting_skill,owner_data_fired[0].agility,owner_data_fired[0].experience_level,target)){
- //If the defender fails its dodge check.
- if(!rc_attack_dodge(owner_data_fired[0].experience_level,target)){*/
- //The attack will hit.
- //We now determine the maximum amount of damage the attacker
can do (before the target's reduction(s)).
-
- //Damage begins with base ranged damage.
- int
base_damage=random_range(owner_data_fired[0].base_damage_min_ranged,owner_data_fired[0].base_damage_max_ranged);
-
- damage=base_damage;
-
- //Add the momentum bonus.
- damage+=momentum*2.0;
-
- //Add the racial base ranged damage modifier.
-
- //If the race has a ranged damage bonus.
-
if(templates.template_races[owner_data_fired[0].race].base_damage_ranged_max>=0){
-
damage+=random_range(templates.template_races[owner_data_fired[0].race].base_damage_ranged_min,templates.template_races[owner_data_fired[0].race].base_damage_ranged_max);
- }
- //If the race has a ranged damage penalty.
- else{
-
damage-=random_range(abs(templates.template_races[owner_data_fired[0].race].base_damage_ranged_min),abs(templates.template_races[owner_data_fired[0].race].base_damage_ranged_max));
- }
-
- //Add the actual projectile's thrown weapon damage.
-
- //Determine the base damage range for this item.
- int weapon_damage_min=damage_min_thrown;
- int weapon_damage_max=damage_max_thrown;
- int
weapon_damage=random_range(weapon_damage_min,weapon_damage_max);
-
- //Add the weapon's damage to the attack's damage.
- damage+=weapon_damage;
-
- //Add in the launcher's damage.
-
- weapon_damage_min=owner_data_fired[0].launcher_damage_min;
- weapon_damage_max=owner_data_fired[0].launcher_damage_max;
-
weapon_damage=random_range(weapon_damage_min,weapon_damage_max);
-
- //Apply the ranged weapon skill.
-
weapon_damage+=weapon_damage*(owner_data_fired[0].launcher_weapons_skill/10);
-
- //Add the weapon's damage to the attack's damage.
- damage+=weapon_damage;
-
- //Apply the agility bonus.
- damage+=damage*(owner_data_fired[0].agility/6);
-
- //Apply the strength bonus.
- damage+=damage*(owner_data_fired[0].strength/8);
-
- //We have finished determining the maximum damage the attacker
can do.
- //Now, we determine the damage reduction based on the target's
stats.
-
- int damage_reduction=determine_damage_reduction(target);
-
- //Subtract the total damage reduction from the maximum damage.
- damage-=damage_reduction;
-
- if(damage<0){
- damage=0;
- }
-
- //If the attacker succeeds in a critical strike.
-
/**if(rc_attack_critical_strike(owner_data_fired[0].agility,owner_data_fired[0].experience_level,target)){
- damage+=random_range(damage/4,damage/2);
- }*/
- /**}
- //If the defender succeeds in its dodge check.
- else{
- if(owner_data_fired[0].is_player){
- outcome="The ";
- outcome+=target->return_full_name();
- outcome+=" dodges your ";
- outcome+=return_full_name(1);
- outcome+="!";
- }
- else{
- outcome="You dodge the ";
- outcome+=owner_data_fired[0].full_name;
- outcome+="'s ";
- outcome+=return_full_name(1);
- outcome+="!";
- }
-
- update_text_log(outcome.c_str(),true);
-
- return;
- }*/
- /**}
- //If the attacker fails its hit check.
- else{
- if(owner_data_fired[0].is_player){
- outcome="Your ";
- outcome+=return_full_name(1);
- outcome+=" misses the ";
- outcome+=target->return_full_name();
- outcome+="!";
- }
- else{
- outcome="The ";
- outcome+=owner_data_fired[0].full_name;
- outcome+="'s ";
- outcome+=return_full_name(1);
- outcome+=" misses!";
- }
-
- update_text_log(outcome.c_str(),true);
-
- return;
- }*/
-
- //If the attack succeeded and did damage.
+ //Determine the maximum amount of damage the attacker can do (before
the target's reduction(s)).
+
+ //Damage begins with base ranged damage.
+ int
base_damage=random_range(owner_data_fired[0].base_damage_min_ranged,owner_data_fired[0].base_damage_max_ranged);
+
+ damage=base_damage;
+
+ //Add the momentum bonus.
+ damage+=momentum*2.0;
+
+ //Add the racial base ranged damage modifier.
+
+ //If the race has a ranged damage bonus.
+
if(templates.template_races[owner_data_fired[0].race].base_damage_ranged_max>=0){
+
damage+=random_range(templates.template_races[owner_data_fired[0].race].base_damage_ranged_min,templates.template_races[owner_data_fired[0].race].base_damage_ranged_max);
+ }
+ //If the race has a ranged damage penalty.
+ else{
+
damage-=random_range(abs(templates.template_races[owner_data_fired[0].race].base_damage_ranged_min),abs(templates.template_races[owner_data_fired[0].race].base_damage_ranged_max));
+ }
+
+ //Add the actual projectile's thrown weapon damage.
+
+ //Determine the base damage range for this item.
+ int weapon_damage_min=damage_min_thrown;
+ int weapon_damage_max=damage_max_thrown;
+ int weapon_damage=random_range(weapon_damage_min,weapon_damage_max);
+
+ //Add the weapon's damage to the attack's damage.
+ damage+=weapon_damage;
+
+ //Add in the launcher's damage.
+
+ weapon_damage_min=owner_data_fired[0].launcher_damage_min;
+ weapon_damage_max=owner_data_fired[0].launcher_damage_max;
+ weapon_damage=random_range(weapon_damage_min,weapon_damage_max);
+
+ //Apply the ranged weapon skill.
+
weapon_damage+=weapon_damage*(owner_data_fired[0].launcher_weapons_skill/10);
+
+ //Add the weapon's damage to the attack's damage.
+ damage+=weapon_damage;
+
+ //Apply the agility bonus.
+ damage+=damage*(owner_data_fired[0].agility/6);
+
+ //Apply the strength bonus.
+ damage+=damage*(owner_data_fired[0].strength/8);
+
+ //We have finished determining the maximum damage the attacker can do.
+ //Now, we determine the damage reduction based on the target's stats.
+
+ int damage_reduction=determine_damage_reduction(target);
+
+ //Subtract the total damage reduction from the maximum damage.
+ damage-=damage_reduction;
+
+ if(damage<0){
+ damage=0;
+ }
+
+ //If the attack did damage.
if(damage>0){
//If the creature is the player.
if(owner_data_fired[0].is_player){
=======================================
--- /monster.cpp Wed Apr 20 05:54:06 2011
+++ /monster.cpp Wed Apr 20 10:59:15 2011
@@ -310,6 +310,11 @@
else if(ai_keystates[AIK_QUIVER_ITEM]){
input_inventory=INVENTORY_COMMAND_QUIVER_ITEM;
}
+
+ //Equip launcher weapon.
+ else if(ai_keystates[AIK_EQUIP_LAUNCHER_WEAPON]){
+ input_inventory=INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON;
+ }
//Equip armor.
else if(ai_keystates[AIK_EQUIP_ARMOR]){
=======================================
--- /player.cpp Wed Apr 20 05:54:06 2011
+++ /player.cpp Wed Apr 20 10:59:15 2011
@@ -513,6 +513,13 @@
input_inventory=INVENTORY_COMMAND_QUIVER_ITEM;
}
+
+ //Equip launcher weapon.
+ else if(input_inventory==INVENTORY_COMMAND_NONE &&
input_directional==DIRECTIONAL_COMMAND_NONE &&
event.key.keysym.unicode==(Uint16)'3'){
+ update_text_log("What do you want to use as a
launcher? [?*]",is_player);
+
+
input_inventory=INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON;
+ }
//Equip armor.
else if(input_inventory==INVENTORY_COMMAND_NONE &&
input_directional==DIRECTIONAL_COMMAND_NONE &&
event.key.keysym.unicode==(Uint16)'w'){
=======================================
--- /player_start.cpp Wed Apr 20 05:54:06 2011
+++ /player_start.cpp Wed Apr 20 10:59:15 2011
@@ -30,7 +30,7 @@
///short
random_skill=random_range(SKILL_BLADED_WEAPONS,SKILL_MAGIC_SUMMONING);
///Disable some skills.
short random_skill=random_range(SKILL_BLADED_WEAPONS,SKILL_ARMOR);
- while(random_skill==SKILL_SECURITY || random_skill==SKILL_STEALTH |
| random_skill==SKILL_FIGHTING || random_skill==SKILL_DODGING){
+ while(random_skill==SKILL_SECURITY || random_skill==SKILL_STEALTH){
random_skill=random_range(SKILL_BLADED_WEAPONS,SKILL_ARMOR);
}
///
=======================================
--- /player_windows.cpp Wed Apr 20 05:54:06 2011
+++ /player_windows.cpp Wed Apr 20 10:59:15 2011
@@ -239,12 +239,6 @@
case (Uint16)'j':
skill=SKILL_SPEED;
break;
- /**case (Uint16)'k':
- skill=SKILL_FIGHTING;
- break;
- case (Uint16)'l':
- skill=SKILL_DODGING;
- break;*/
case (Uint16)'m':
skill=SKILL_ARMOR;
break;
@@ -832,29 +826,7 @@
font_small.show(150,60,msg,COLOR_WHITE);
- msg="";
-
- /**ss.clear();ss.str("");ss<<"(k) ";msg+=ss.str();
- if(is_focused_skill(SKILL_FIGHTING)){
- ss.clear();ss.str("");ss<<"+ ";msg+=ss.str();
- }
- else{
- ss.clear();ss.str("");ss<<"- ";msg+=ss.str();
- }
- ss.clear();ss.str("");ss<<"Fighting";ss<<"\xA";msg+=ss.str();
- msg+="\xA";
-
- ss.clear();ss.str("");ss<<"(l) ";msg+=ss.str();
- if(is_focused_skill(SKILL_DODGING)){
- ss.clear();ss.str("");ss<<"+ ";msg+=ss.str();
- }
- else{
- ss.clear();ss.str("");ss<<"- ";msg+=ss.str();
- }
- ss.clear();ss.str("");ss<<"Dodging";ss<<"\xA";msg+=ss.str();
- msg+="\xA";*/
-
- ss.clear();ss.str("");ss<<"(m) ";msg+=ss.str();
+ ss.clear();ss.str("");ss<<"(m) ";msg=ss.str();
if(is_focused_skill(SKILL_ARMOR)){
ss.clear();ss.str("");ss<<"+ ";msg+=ss.str();
}
@@ -1207,13 +1179,18 @@
string item_amount_prefix="";
+ string stack_size="";
+
if(inventory[item_info].stack==1){
item_amount_prefix=a_vs_an(&inventory[item_info]);
item_amount_prefix+=" ";
}
-
- ss.clear();ss.str("");ss<<inventory[item_info].appearance;ss<<"
- ";ss<<item_amount_prefix;ss<<inventory[item_info].return_full_name();ss<<"\xA";msg=ss.str();
+ else{
+ ss.clear();ss.str("");ss<<"
(x";ss<<inventory[item_info].stack;ss<<")";stack_size=ss.str();
+ }
+
+ ss.clear();ss.str("");ss<<inventory[item_info].appearance;ss<<"
- ";ss<<item_amount_prefix;ss<<inventory[item_info].return_full_name(1);ss<<stack_size;ss<<"\xA";msg=ss.str();
font_small.show(5,5,msg,render_color);
@@ -1315,7 +1292,7 @@
else{
ss.clear();ss.str("");ss<<"This item is composed
of ";ss<<material_to_string(inventory[item_info].material);ss<<".";ss<<"\xA";msg=ss.str();
}
- ss.clear();ss.str("");ss<<"It
weighs ";ss<<inventory[item_info].weight*inventory[item_info].stack;ss<<".";ss<<"\xA";msg+=ss.str();
+ ss.clear();ss.str("");ss<<"It
weighs ";ss<<inventory[item_info].weight;ss<<".";ss<<"\xA";msg+=ss.str();
ss.clear();ss.str("");ss<<"It
requires ";ss<<inventory[item_info].weight*1.5;ss<<" strength to wield in
melee.";ss<<"\xA";msg+=ss.str();
ss.clear();ss.str("");ss<<"It can
do ";ss<<inventory[item_info].damage_min_melee;ss<<"-";ss<<inventory[item_info].damage_max_melee;ss<<"
melee damage.";ss<<"\xA";msg+=ss.str();
ss.clear();ss.str("");ss<<"It can
do ";ss<<inventory[item_info].damage_min_thrown;ss<<"-";ss<<inventory[item_info].damage_max_thrown;ss<<"
thrown damage.";ss<<"\xA";msg+=ss.str();
@@ -1332,7 +1309,7 @@
}
ss.clear();ss.str("");ss<<"It can defend
against ";ss<<inventory[item_info].defense;ss<<" ";ss<<points;ss<<" of
damage.";ss<<"\xA";msg+=ss.str();
}
- ss.clear();ss.str("");ss<<"It is
worth ";ss<<inventory[item_info].monetary_value*inventory[item_info].stack;ss<<".";ss<<"\xA";msg+=ss.str();
+ ss.clear();ss.str("");ss<<"It is
worth ";ss<<inventory[item_info].monetary_value;ss<<".";ss<<"\xA";msg+=ss.str();
font_small.show(5,5+font_small.spacing_y,msg,COLOR_WHITE);
}
@@ -1543,13 +1520,6 @@
font_small.show(200,30,msg,COLOR_WHITE);
- /**ss.clear();ss.str("");ss<<"Fighting
- ";ss<<return_skill_fighting();ss<<"
(";ss<<skills[SKILL_FIGHTING][SKILL_EXPERIENCE];ss<<"/";ss<<skills[SKILL_FIGHTING][SKILL_EXPERIENCE_MAX];ss<<")";ss<<"\xA";msg=ss.str();
- msg+="\xA";
- ss.clear();ss.str("");ss<<"Dodging
- ";ss<<return_skill_dodging();ss<<"
(";ss<<skills[SKILL_DODGING][SKILL_EXPERIENCE];ss<<"/";ss<<skills[SKILL_DODGING][SKILL_EXPERIENCE_MAX];ss<<")";ss<<"\xA";msg+=ss.str();
- msg+="\xA";*/
-
- ///ss.clear();ss.str("");ss<<"Armor - ";ss<<return_skill_armor();ss<<"
(";ss<<skills[SKILL_ARMOR][SKILL_EXPERIENCE];ss<<"/";ss<<skills[SKILL_ARMOR][SKILL_EXPERIENCE_MAX];ss<<")";ss<<"\xA";msg+=ss.str();
- ///USE THIS LINE INSTEAD OF THE ABOVE LINE.
ss.clear();ss.str("");ss<<"Armor - ";ss<<return_skill_armor();ss<<"
(";ss<<skills[SKILL_ARMOR][SKILL_EXPERIENCE];ss<<"/";ss<<skills[SKILL_ARMOR][SKILL_EXPERIENCE_MAX];ss<<")";ss<<"\xA";msg=ss.str();
msg+="\xA";
=======================================
--- /random_chance.cpp Mon Apr 18 18:50:18 2011
+++ /random_chance.cpp Wed Apr 20 10:59:15 2011
@@ -6,54 +6,6 @@
using namespace std;
-/**bool rc_attack_critical_strike(short attacker_agility,int
attacker_experience_level,Creature* target){
- int
max_chance_range=99-((double)attacker_agility/10)*((double)attacker_experience_level/(double)target->experience_level);
- if(max_chance_range<0){
- max_chance_range=0;
- }
-
- int random_attempt=random_range(0,max_chance_range);
-
- if(random_attempt==0){
- return true;
- }
- else{
- return false;
- }
-}
-
-bool rc_attack_dodge(int attacker_experience_level,Creature* target){
- int
max_chance_range=(99-((double)target->return_skill_dodging()/250)*(double)target->return_attribute_agility())/((double)target->experience_level/(double)attacker_experience_level);
- if(max_chance_range<0){
- max_chance_range=0;
- }
-
- int random_attempt=random_range(0,max_chance_range);
-
- if(random_attempt==0){
- return true;
- }
- else{
- return false;
- }
-}
-
-bool rc_attack_hit(short attacker_fighting_skill,short
attacker_agility,int attacker_experience_level,Creature* target){
- int
max_chance_range=(99-((double)attacker_fighting_skill/2500)*(double)attacker_agility)/((double)attacker_experience_level/(double)target->experience_level);
- if(max_chance_range<0){
- max_chance_range=0;
- }
-
- int random_attempt=random_range(0,max_chance_range);
-
- if(random_attempt>=0 && random_attempt<89){
- return true;
- }
- else{
- return false;
- }
-}*/
-
bool rc_open_door(){
int random_attempt=random_range(0,99);
=======================================
--- /random_chance.h Mon Apr 18 18:50:18 2011
+++ /random_chance.h Wed Apr 20 10:59:15 2011
@@ -9,14 +9,6 @@
//All of these return true if the action requested succeeded,
//or false if it failed.
-//Combat//
-
-///bool rc_attack_critical_strike(short attacker_agility,int
attacker_experience_level,Creature* target);
-
-///bool rc_attack_dodge(int attacker_experience_level,Creature* target);
-
-///bool rc_attack_hit(short attacker_fighting_skill,short
attacker_agility,int attacker_experience_level,Creature* target);
-
//Level interaction//
bool rc_open_door();
=======================================
--- /templates.cpp Wed Apr 20 05:54:06 2011
+++ /templates.cpp Wed Apr 20 10:59:15 2011
@@ -566,8 +566,6 @@
string thrown_weapons="thrown weapons:";
string dual_wielding="dual wielding:";
string speed="speed:";
- string fighting="fighting:";
- string dodging="dodging:";
string armor="armor:";
string air_magic="air magic:";
string fire_magic="fire magic:";
@@ -937,20 +935,6 @@
temp_race.skills[SKILL_SPEED][SKILL_EXPERIENCE_MAX]=atoi(line.c_str());
}
- //Fighting
- else if(icontains(line,fighting)){
- //Clear the data name.
- line.erase(0,fighting.length());
-
-
temp_race.skills[SKILL_FIGHTING][SKILL_EXPERIENCE_MAX]=atoi(line.c_str());
- }
- //Dodging
- else if(icontains(line,dodging)){
- //Clear the data name.
- line.erase(0,dodging.length());
-
-
temp_race.skills[SKILL_DODGING][SKILL_EXPERIENCE_MAX]=atoi(line.c_str());
- }
//Armor
else if(icontains(line,armor)){
//Clear the data name.
=======================================
--- /templates_strings.cpp Mon Apr 4 20:10:27 2011
+++ /templates_strings.cpp Wed Apr 20 10:59:15 2011
@@ -131,12 +131,6 @@
else if(line=="speed"){
governing_skill=SKILL_SPEED;
}
- else if(line=="fighting"){
- governing_skill=SKILL_FIGHTING;
- }
- else if(line=="dodging"){
- governing_skill=SKILL_DODGING;
- }
else if(line=="armor"){
governing_skill=SKILL_ARMOR;
=======================================
--- /update.cpp Wed Apr 20 05:54:06 2011
+++ /update.cpp Wed Apr 20 10:59:15 2011
@@ -104,9 +104,11 @@
int random_race_template=-1;
if(player_has_light){
- //Choose a random location in the level.
-
x=random_range(0,vector_levels[current_level].level_x-1);
-
y=random_range(0,vector_levels[current_level].level_y-1);
+ //Choose a random location in the level, far from the
player.
+ do{
+
x=random_range(0,vector_levels[current_level].level_x-1);
+
y=random_range(0,vector_levels[current_level].level_y-1);
+ }while(x>=player.x-12 && x<=player.x+12 &&
y>=player.y-12 && y<=player.y+12);
//Randomly select a race from the races template.
random_race_template=random_range(0,templates.template_races.size()-1);
=======================================
--- /version.h Wed Apr 20 05:54:06 2011
+++ /version.h Wed Apr 20 10:59:15 2011
@@ -16,17 +16,17 @@
//Standard Version Type
static const long MAJOR = 0;
static const long MINOR = 3;
- static const long BUILD = 3033;
- static const long REVISION = 16817;
+ static const long BUILD = 3044;
+ static const long REVISION = 16888;
//Miscellaneous Version Types
- static const long BUILDS_COUNT = 7112;
- #define RC_FILEVERSION 0,3,3033,16817
- #define RC_FILEVERSION_STRING "0, 3, 3033, 16817\0"
- static const char FULLVERSION_STRING[] = "0.3.3033.16817";
+ static const long BUILDS_COUNT = 7142;
+ #define RC_FILEVERSION 0,3,3044,16888
+ #define RC_FILEVERSION_STRING "0, 3, 3044, 16888\0"
+ static const char FULLVERSION_STRING[] = "0.3.3044.16888";
//These values are to keep track of your versioning state, don't modify
them.
- static const long BUILD_HISTORY = 73;
+ static const long BUILD_HISTORY = 84;
}
==============================================================================
Revision: 84baa46dc96a
Author: Kevin Wells <
DarkOp...@gmail.com>
Date: Wed Apr 20 12:02:54 2011
Log: Bug fixes, tweaks, etc.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=84baa46dc96a
Modified:
/Escape from the Master's Lair.layout
/Escape from the Master's Lair.layout.save
/creature_combat.cpp
/creature_commands.cpp
/creature_experience.cpp
/monster.cpp
/player.cpp
/player_windows.cpp
/version.h
=======================================
--- /Escape from the Master's Lair.layout Wed Apr 20 05:54:06 2011
+++ /Escape from the Master's Lair.layout Wed Apr 20 12:02:54 2011
@@ -5,13 +5,13 @@
<Cursor1 position="14358" topLine="427" />
</File>
<File name="age_limits.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="364" topLine="0" />
+ <Cursor1 position="266" topLine="0" />
</File>
<File name="ai.h" open="0" top="0" tabpos="4" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="347" topLine="0" />
</File>
<File name="ai_keys.h" open="0" top="0" tabpos="0" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="679" topLine="3" />
+ <Cursor1 position="573" topLine="3" />
</File>
<File name="collision.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="142" topLine="0" />
@@ -20,19 +20,19 @@
<Cursor1 position="132" topLine="0" />
</File>
<File name="combat_all.cpp" open="0" top="0" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="17" topLine="0" />
+ <Cursor1 position="261" topLine="0" />
</File>
<File name="combat_all.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="199" topLine="0" />
</File>
<File name="covering.cpp" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="973" topLine="20" />
+ <Cursor1 position="788" topLine="20" />
</File>
<File name="covering.h" open="0" top="0" tabpos="0" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="170" topLine="0" />
+ <Cursor1 position="544" topLine="0" />
</File>
<File name="covering_conversions.cpp" open="0" top="0" tabpos="0"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="776" topLine="0" />
+ <Cursor1 position="261" topLine="20" />
</File>
<File name="covering_conversions.h" open="0" top="0" tabpos="0" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="325" topLine="0" />
@@ -41,7 +41,7 @@
<Cursor1 position="14917" topLine="435" />
</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="4003" topLine="139" />
+ <Cursor1 position="11815" topLine="319" />
</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" />
@@ -50,16 +50,16 @@
<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="20453" topLine="425" />
+ <Cursor1 position="2423" topLine="48" />
</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="10188" topLine="295" />
+ <Cursor1 position="37944" topLine="1140" />
</File>
<File name="creature_equipment.cpp" open="0" top="0" tabpos="5" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="1143" topLine="174" />
+ <Cursor1 position="7224" topLine="178" />
</File>
<File name="creature_experience.cpp" open="0" top="0" tabpos="1"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="4409" topLine="24" />
+ <Cursor1 position="3715" topLine="83" />
</File>
<File name="creature_other_stats.cpp" open="0" top="0" tabpos="4"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="199" topLine="6" />
@@ -68,13 +68,13 @@
<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="479" topLine="122" />
+ <Cursor1 position="2651" topLine="116" />
</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" />
</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="32908" topLine="844" />
+ <Cursor1 position="32047" topLine="816" />
</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="185" 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="1555" topLine="46" />
+ <Cursor1 position="4594" topLine="261" />
</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" />
@@ -143,10 +143,10 @@
<Cursor1 position="11165" topLine="405" />
</File>
<File name="item.h" open="0" top="0" tabpos="2" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="6386" topLine="6" />
+ <Cursor1 position="1224" topLine="152" />
</File>
<File name="item_combat.cpp" open="0" top="0" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="9606" topLine="72" />
+ <Cursor1 position="6965" topLine="94" />
</File>
<File name="item_save_load.cpp" open="0" top="0" tabpos="14" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="3653" topLine="162" />
@@ -191,7 +191,7 @@
<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="911" topLine="24" />
+ <Cursor1 position="1699" topLine="42" />
</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,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="37275" topLine="854" />
+ <Cursor1 position="6195" topLine="215" />
</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" />
@@ -224,10 +224,10 @@
<Cursor1 position="8979" topLine="168" />
</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="3228" topLine="96" />
+ <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="50115" topLine="1313" />
+ <Cursor1 position="69365" topLine="1677" />
</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" />
@@ -242,10 +242,10 @@
<Cursor1 position="833" topLine="15" />
</File>
<File name="random_chance.cpp" open="0" top="0" tabpos="2" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="2427" topLine="76" />
+ <Cursor1 position="220" topLine="0" />
</File>
<File name="random_chance.h" open="0" top="0" tabpos="3" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="758" topLine="8" />
+ <Cursor1 position="296" topLine="0" />
</File>
<File name="random_number_generator.cpp" open="0" top="0" tabpos="0"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="474" topLine="0" />
@@ -275,13 +275,13 @@
<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="20815" topLine="108" />
+ <Cursor1 position="19513" topLine="549" />
</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" />
</File>
<File name="templates_strings.cpp" open="0" top="0" tabpos="6" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="6855" topLine="288" />
+ <Cursor1 position="3201" topLine="117" />
</File>
<File name="tile.cpp" open="0" top="0" tabpos="5" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="3899" topLine="96" />
@@ -305,7 +305,7 @@
<Cursor1 position="132" topLine="0" />
</File>
<File name="update.cpp" open="0" top="0" tabpos="2" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="4268" topLine="108" />
+ <Cursor1 position="4468" topLine="508" />
</File>
<File name="update.h" open="0" top="0" tabpos="11" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="245" topLine="0" />
=======================================
--- /Escape from the Master's Lair.layout.save Wed Apr 20 10:59:15 2011
+++ /Escape from the Master's Lair.layout.save Wed Apr 20 12:02:54 2011
@@ -49,17 +49,17 @@
<File name="creature_attributes.cpp" open="0" top="0" tabpos="0"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="1460" topLine="36" />
</File>
- <File name="creature_combat.cpp" open="1" top="0" tabpos="3" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="5729" topLine="132" />
+ <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" />
</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="38498" topLine="1147" />
+ <Cursor1 position="37944" topLine="1140" />
</File>
<File name="creature_equipment.cpp" open="0" top="0" tabpos="5" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="7224" topLine="178" />
</File>
<File name="creature_experience.cpp" open="0" top="0" tabpos="1"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="939" topLine="29" />
+ <Cursor1 position="3715" topLine="83" />
</File>
<File name="creature_other_stats.cpp" open="0" top="0" tabpos="4"
split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="199" topLine="6" />
@@ -73,8 +73,8 @@
<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" />
</File>
- <File name="dungeon_generation.cpp" open="1" top="1" tabpos="6" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="22730" topLine="642" />
+ <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="32047" topLine="816" />
</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="185" 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="3438" topLine="187" />
+ <Cursor1 position="4594" topLine="261" />
</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" />
@@ -146,7 +146,7 @@
<Cursor1 position="1224" topLine="152" />
</File>
<File name="item_combat.cpp" open="0" top="0" tabpos="1" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="1828" topLine="28" />
+ <Cursor1 position="6965" topLine="94" />
</File>
<File name="item_save_load.cpp" open="0" top="0" tabpos="14" split="0"
active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="3653" topLine="162" />
@@ -191,7 +191,7 @@
<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="10396" topLine="292" />
+ <Cursor1 position="1699" topLine="42" />
</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,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="21423" topLine="500" />
+ <Cursor1 position="6195" topLine="215" />
</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" />
@@ -227,7 +227,7 @@
<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="61113" topLine="1504" />
+ <Cursor1 position="69365" topLine="1677" />
</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" />
@@ -305,7 +305,7 @@
<Cursor1 position="132" topLine="0" />
</File>
<File name="update.cpp" open="0" top="0" tabpos="2" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
- <Cursor1 position="4268" topLine="108" />
+ <Cursor1 position="4468" topLine="508" />
</File>
<File name="update.h" open="0" top="0" tabpos="11" split="0" active="1"
splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="245" topLine="0" />
=======================================
--- /creature_combat.cpp Wed Apr 20 10:59:15 2011
+++ /creature_combat.cpp Wed Apr 20 12:02:54 2011
@@ -55,7 +55,7 @@
bool enough_strength=true;
//If the creature does not have sufficient strength to wield
this item.
-
if(inventory[item_identifier].weight*1.5>attributes[ATTRIBUTE_STRENGTH]){
+
if((int)(inventory[item_identifier].weight*1.5)>return_attribute_strength()){
weapons_under_strength++;
enough_strength=false;
}
=======================================
--- /creature_commands.cpp Wed Apr 20 10:59:15 2011
+++ /creature_commands.cpp Wed Apr 20 12:02:54 2011
@@ -1155,7 +1155,6 @@
str_msg+=" is already equipped.";
update_text_log(str_msg.c_str(),is_player);
- update_text_log("I suppose you could unequip it and then equip
it again, but then who would that be helping, really?",is_player);
//No inventory command will be executed.
input_inventory=0;
@@ -1450,7 +1449,7 @@
str_item="You place the ";
}
else if(command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON){
- str_item="You wield the ";
+ str_item="You use the ";
}
else if(command==INVENTORY_COMMAND_EQUIP_ARMOR){
str_item="You put on the ";
@@ -1471,7 +1470,7 @@
else if(command==INVENTORY_COMMAND_EQUIP_LAUNCHER_WEAPON){
str_item="The ";
str_item+=return_full_name();
- str_item+=" wields the ";
+ str_item+=" uses the ";
}
else if(command==INVENTORY_COMMAND_EQUIP_ARMOR){
str_item="The ";
=======================================
--- /creature_experience.cpp Wed Apr 20 10:59:15 2011
+++ /creature_experience.cpp Wed Apr 20 12:02:54 2011
@@ -12,8 +12,8 @@
void Creature::update_class_name(){
class_name="";
-
if(attributes[ATTRIBUTE_STRENGTH]==attributes[ATTRIBUTE_AGILITY]==attributes[ATTRIBUTE_HARDINESS]){
- if(attributes[ATTRIBUTE_STRENGTH]==1){
+
if(return_attribute_strength()==return_attribute_agility()==return_attribute_hardiness()){
+ if(return_attribute_strength()==1){
class_name="beginner";
}
else{
@@ -24,84 +24,81 @@
}
//Determine the highest attribute.
- int largest_attribute[2];
- largest_attribute[0]=-1;
- largest_attribute[1]=0;
-
- for(int i=ATTRIBUTE_STRENGTH;i<ATTRIBUTE_HARDINESS+1;i++){
- if(attributes[i]>largest_attribute[1]){
- largest_attribute[0]=i;
- largest_attribute[1]=attributes[i];
- break;
- }
+ short largest_attribute=ATTRIBUTE_STRENGTH;
+
+ if(return_attribute_agility()>return_attribute_strength()){
+ largest_attribute=ATTRIBUTE_AGILITY;
+ }
+ if(return_attribute_hardiness()>return_attribute_agility()){
+ largest_attribute=ATTRIBUTE_HARDINESS;
}
- if(largest_attribute[0]==ATTRIBUTE_STRENGTH){
- if(largest_attribute[1]<5){
+ if(largest_attribute==ATTRIBUTE_STRENGTH){
+ if(return_attribute_strength()<5){
class_name="scuffler";
}
- else if(largest_attribute[1]>=5 && largest_attribute[1]<10){
+ else if(return_attribute_strength()>=5 &&
return_attribute_strength()<10){
class_name="street tough";
}
- else if(largest_attribute[1]>=10 && largest_attribute[1]<25){
+ else if(return_attribute_strength()>=10 &&
return_attribute_strength()<25){
class_name="fighter";
}
- else if(largest_attribute[1]>=25 && largest_attribute[1]<50){
+ else if(return_attribute_strength()>=25 &&
return_attribute_strength()<50){
class_name="soldier";
}
- else if(largest_attribute[1]>=50 && largest_attribute[1]<75){
+ else if(return_attribute_strength()>=50 &&
return_attribute_strength()<75){
class_name="warrior-in-training";
}
- else if(largest_attribute[1]>=75 && largest_attribute[1]<100){
+ else if(return_attribute_strength()>=75 &&
return_attribute_strength()<100){
class_name="warrior";
}
- else if(largest_attribute[1]>=100){
+ else if(return_attribute_strength()>=100){
class_name="knight";
}
}
- else if(largest_attribute[0]==ATTRIBUTE_AGILITY){
- if(largest_attribute[1]<5){
+ else if(largest_attribute==ATTRIBUTE_AGILITY){
+ if(return_attribute_agility()<5){
class_name="circus performer";
}
- else if(largest_attribute[1]>=5 && largest_attribute[1]<10){
+ else if(return_attribute_agility()>=5 &&
return_attribute_agility()<10){
class_name="acrobat";
}
- else if(largest_attribute[1]>=10 && largest_attribute[1]<25){
+ else if(return_attribute_agility()>=10 &&
return_attribute_agility()<25){
class_name="speedster";
}
- else if(largest_attribute[1]>=25 && largest_attribute[1]<50){
+ else if(return_attribute_agility()>=25 &&
return_attribute_agility()<50){
class_name="chucker";
}
- else if(largest_attribute[1]>=50 && largest_attribute[1]<75){
+ else if(return_attribute_agility()>=50 &&
return_attribute_agility()<75){
class_name="hurler";
}
- else if(largest_attribute[1]>=75 && largest_attribute[1]<100){
+ else if(return_attribute_agility()>=75 &&
return_attribute_agility()<100){
class_name="sharpshooter";
}
- else if(largest_attribute[1]>=100){
+ else if(return_attribute_agility()>=100){
class_name="olympic gold medalist";
}
}
- else if(largest_attribute[0]==ATTRIBUTE_HARDINESS){
- if(largest_attribute[1]<5){
+ else if(largest_attribute==ATTRIBUTE_HARDINESS){
+ if(return_attribute_hardiness()<5){
class_name="tourist";
}
- else if(largest_attribute[1]>=5 && largest_attribute[1]<10){
+ else if(return_attribute_hardiness()>=5 &&
return_attribute_hardiness()<10){
class_name="outdoorsy type";
}
- else if(largest_attribute[1]>=10 && largest_attribute[1]<25){
+ else if(return_attribute_hardiness()>=10 &&
return_attribute_hardiness()<25){
class_name="survivor";
}
- else if(largest_attribute[1]>=25 && largest_attribute[1]<50){
+ else if(return_attribute_hardiness()>=25 &&
return_attribute_hardiness()<50){
class_name="hunter";
}
- else if(largest_attribute[1]>=50 && largest_attribute[1]<75){
+ else if(return_attribute_hardiness()>=50 &&
return_attribute_hardiness()<75){
class_name="ranger";
}
- else if(largest_attribute[1]>=75 && largest_attribute[1]<100){
+ else if(return_attribute_hardiness()>=75 &&
return_attribute_hardiness()<100){
class_name="forester";
}
- else if(largest_attribute[1]>=100){
+ else if(return_attribute_hardiness()>=100){
class_name="master of survival";
}
}
=======================================
--- /monster.cpp Wed Apr 20 10:59:15 2011
+++ /monster.cpp Wed Apr 20 12:02:54 2011
@@ -45,8 +45,8 @@
slot=EQUIP_QUIVER;
}
}
- //If the item is a melee weapon or a ranged weapon.
- else
if((inventory[inventory.size()-1].weapon_category>=WEAPON_SHORT_BLADES &&
inventory[inventory.size()-1].weapon_category<=WEAPON_STAVES) ||
(inventory[inventory.size()-1].weapon_category>=WEAPON_BOWS &&
inventory[inventory.size()-1].weapon_category<=WEAPON_SLINGS)){
+ //If the item is a melee weapon.
+ else
if(inventory[inventory.size()-1].weapon_category>=WEAPON_SHORT_BLADES &&
inventory[inventory.size()-1].weapon_category<=WEAPON_STAVES){
if(equipment_slot_empty(inventory.size()-1,EQUIP_HOLD_RIGHT)){
slot=EQUIP_HOLD_RIGHT;
}
@@ -54,6 +54,12 @@
slot=EQUIP_HOLD_LEFT;
}
}
+ //If the item is a ranged weapon.
+ else
if(inventory[inventory.size()-1].weapon_category>=WEAPON_BOWS &&
inventory[inventory.size()-1].weapon_category<=WEAPON_SLINGS){
+
if(equipment_slot_empty(inventory.size()-1,EQUIP_LAUNCHER_WEAPON)){
+ slot=EQUIP_LAUNCHER_WEAPON;
+ }
+ }
if(slot!=-1){
equip_item(inventory.size()-1,slot);
=======================================
--- /player.cpp Wed Apr 20 10:59:15 2011
+++ /player.cpp Wed Apr 20 12:02:54 2011
@@ -189,8 +189,8 @@
slot=EQUIP_QUIVER;
}
}
- //If the item is a melee weapon or a ranged weapon.
- else
if((inventory[inventory.size()-1].weapon_category>=WEAPON_SHORT_BLADES &&
inventory[inventory.size()-1].weapon_category<=WEAPON_STAVES) ||
(inventory[inventory.size()-1].weapon_category>=WEAPON_BOWS &&
inventory[inventory.size()-1].weapon_category<=WEAPON_SLINGS)){
+ //If the item is a melee weapon.
+ else
if(inventory[inventory.size()-1].weapon_category>=WEAPON_SHORT_BLADES &&
inventory[inventory.size()-1].weapon_category<=WEAPON_STAVES){
if(equipment_slot_empty(inventory.size()-1,EQUIP_HOLD_RIGHT)){
slot=EQUIP_HOLD_RIGHT;
}
@@ -198,6 +198,12 @@
slot=EQUIP_HOLD_LEFT;
}
}
+ //If the item is a ranged weapon.
+ else
if(inventory[inventory.size()-1].weapon_category>=WEAPON_BOWS &&
inventory[inventory.size()-1].weapon_category<=WEAPON_SLINGS){
+
if(equipment_slot_empty(inventory.size()-1,EQUIP_LAUNCHER_WEAPON)){
+ slot=EQUIP_LAUNCHER_WEAPON;
+ }
+ }
if(slot!=-1){
equip_item(inventory.size()-1,slot);
@@ -209,7 +215,7 @@
void Player::set_base_stats(){
// From creature: //
- health_max=templates.base_stats.health_max*2.0;
+ health_max=templates.base_stats.health_max*1.5;
health=health_max;
mana_max=templates.base_stats.mana_max;
=======================================
--- /player_windows.cpp Wed Apr 20 10:59:15 2011
+++ /player_windows.cpp Wed Apr 20 12:02:54 2011
@@ -1292,8 +1292,8 @@
else{
ss.clear();ss.str("");ss<<"This item is composed
of ";ss<<material_to_string(inventory[item_info].material);ss<<".";ss<<"\xA";msg=ss.str();
}
- ss.clear();ss.str("");ss<<"It
weighs ";ss<<inventory[item_info].weight;ss<<".";ss<<"\xA";msg+=ss.str();
- ss.clear();ss.str("");ss<<"It
requires ";ss<<inventory[item_info].weight*1.5;ss<<" strength to wield in
melee.";ss<<"\xA";msg+=ss.str();
+ ss.clear();ss.str("");ss<<"It
weighs ";ss<<(int)inventory[item_info].weight;ss<<".";ss<<"\xA";msg+=ss.str();
+ ss.clear();ss.str("");ss<<"It
requires ";ss<<(int)(inventory[item_info].weight*1.5);ss<<" strength to
wield in melee.";ss<<"\xA";msg+=ss.str();
ss.clear();ss.str("");ss<<"It can
do ";ss<<inventory[item_info].damage_min_melee;ss<<"-";ss<<inventory[item_info].damage_max_melee;ss<<"
melee damage.";ss<<"\xA";msg+=ss.str();
ss.clear();ss.str("");ss<<"It can
do ";ss<<inventory[item_info].damage_min_thrown;ss<<"-";ss<<inventory[item_info].damage_max_thrown;ss<<"
thrown damage.";ss<<"\xA";msg+=ss.str();
if(inventory[item_info].damage_max_ranged!=0){
@@ -1679,7 +1679,7 @@
str_item=" (";
- //If the item is a stack larger than 1 and the
equipment slot is a hold slot or the light source slot.
+ //If the item is a stack larger than 1 and the
equipment slot is a hold slot.
if(inventory[i].stack>1 &&
(equip_slot==EQUIP_HOLD_RIGHT || equip_slot==EQUIP_HOLD_LEFT)){
str_item+="one ";
}
@@ -1693,6 +1693,10 @@
str_item+="being wielded in left hand)";
break;
+ case EQUIP_LAUNCHER_WEAPON:
+ str_item+="being used as a launcher)";
+ break;
+
case EQUIP_QUIVER:
str_item+="in quiver)";
break;
=======================================
--- /version.h Wed Apr 20 10:59:15 2011
+++ /version.h Wed Apr 20 12:02:54 2011
@@ -16,17 +16,17 @@
//Standard Version Type
static const long MAJOR = 0;
static const long MINOR = 3;
- static const long BUILD = 3044;
- static const long REVISION = 16888;
+ static const long BUILD = 3051;
+ static const long REVISION = 16937;
//Miscellaneous Version Types
- static const long BUILDS_COUNT = 7142;
- #define RC_FILEVERSION 0,3,3044,16888
- #define RC_FILEVERSION_STRING "0, 3, 3044, 16888\0"
- static const char FULLVERSION_STRING[] = "0.3.3044.16888";
+ 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";
//These values are to keep track of your versioning state, don't modify
them.
- static const long BUILD_HISTORY = 84;
+ static const long BUILD_HISTORY = 91;
}
==============================================================================
Revision: 9f1cf83942d7
Author: Kevin Wells <
DarkOp...@gmail.com>
Date: Wed Apr 20 12:30:03 2011
Log: Added licenses for everything.
http://code.google.com/p/escape-from-the-masters-lair/source/detail?r=9f1cf83942d7
Added:
/docs/LICENSE_MersenneTwister
/docs/LICENSE_SDL
/docs/LICENSE_boost_1_0
/docs/LICENSE_glew
/docs/LICENSE_libfov
=======================================
--- /dev/null
+++ /docs/LICENSE_MersenneTwister Wed Apr 20 12:30:03 2011
@@ -0,0 +1,58 @@
+The following notice is included in MersenneTwister.h:
+
+// MersenneTwister.h
+// Mersenne Twister random number generator -- a C++ class MTRand
+// Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus
+// Richard J. Wagner v1.1 28 September 2009
wag...@umich.edu
+
+// The Mersenne Twister is an algorithm for generating random numbers. It
+// was designed with consideration of the flaws in various other
generators.
+// The period, 2^19937-1, and the order of equidistribution, 623
dimensions,
+// are far greater. The generator is also fast; it avoids multiplication
and
+// division, and it benefits from caches and pipelines. For more
information
+// see the inventors' web page at
+//
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
+
+// Reference
+// M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally
+// Equidistributed Uniform Pseudo-Random Number Generator", ACM
Transactions on
+// Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30.
+
+// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
+// Copyright (C) 2000 - 2009, Richard J. Wagner
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the
distribution.
+//
+// 3. The names of its contributors may not be used to endorse or promote
+// products derived from this software without specific prior written
+// permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+// The original code included the following notice:
+//
+// When you use this, send an email to:
m-...@math.sci.hiroshima-u.ac.jp
+// with an appropriate reference to your work.
+//
+// It would be nice to CC:
wag...@umich.edu and
Co...@math.washington.edu
+// when you write.
=======================================
--- /dev/null
+++ /docs/LICENSE_SDL Wed Apr 20 12:30:03 2011
@@ -0,0 +1,13 @@
+
+Please distribute this file with the SDL runtime environment:
+
+The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library
+designed to make it easy to write multi-media software, such as games and
+emulators.
+
+The Simple DirectMedia Layer library source code is available from:
+
http://www.libsdl.org/
+
+This library is distributed under the terms of the GNU LGPL license:
+
http://www.gnu.org/copyleft/lesser.html
+
=======================================
--- /dev/null
+++ /docs/LICENSE_boost_1_0 Wed Apr 20 12:30:03 2011
@@ -0,0 +1,23 @@
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
=======================================
--- /dev/null
+++ /docs/LICENSE_glew Wed Apr 20 12:30:03 2011
@@ -0,0 +1,73 @@
+The OpenGL Extension Wrangler Library
+Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org>
+Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org>
+Copyright (C) 2002, Lev Povalahev
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* The name of the author may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+
+Mesa 3-D graphics library
+Version: 7.0
+
+Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+Copyright (c) 2007 The Khronos Group Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and/or associated documentation files (the
+"Materials"), to deal in the Materials without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Materials, and to
+permit persons to whom the Materials are furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Materials.
+
+THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
=======================================
--- /dev/null
+++ /docs/LICENSE_libfov Wed Apr 20 12:30:03 2011
@@ -0,0 +1,20 @@
+Copyright (c) 2006 Greg McIntyre
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
copy of
+this software and associated documentation files (the "Software"), to deal
in
+the Software without restriction, including without limitation the rights
to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies
+of the Software, and to permit persons to whom the Software is furnished
to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE
+SOFTWARE.