[ScryMUD] SVN Commit Info r944 - in trunk/mud: grrmud/World grrmud/server lib/containers
scrymud at wanfear.com
scrymud at wanfear.com
Sun Jun 10 21:33:55 PDT 2007
Author: eroper
Date: 2007-06-10 21:33:54 -0700 (Sun, 10 Jun 2007)
New Revision: 944
Modified:
trunk/mud/grrmud/World/SKILLS_SPELLS
trunk/mud/grrmud/World/SS_DESCS
trunk/mud/grrmud/server/SkillSpell.cc
trunk/mud/grrmud/server/command2.cc
trunk/mud/grrmud/server/command3.cc
trunk/mud/grrmud/server/commands.cc
trunk/mud/grrmud/server/critter.cc
trunk/mud/grrmud/server/critter.h
trunk/mud/grrmud/server/login.cc
trunk/mud/grrmud/server/misc.cc
trunk/mud/grrmud/server/necromancer.cc
trunk/mud/grrmud/server/necromancer.h
trunk/mud/grrmud/server/spells.cc
trunk/mud/lib/containers/rb_tree.cc
trunk/mud/lib/containers/rb_tree.h
Log:
Added critter::[getManaRegen(), getHealthRegen(), getMovRegen()]
Added spells: blood ritual, spirit ritual, stamina ritual
Modified: trunk/mud/grrmud/World/SKILLS_SPELLS
===================================================================
--- trunk/mud/grrmud/World/SKILLS_SPELLS 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/World/SKILLS_SPELLS 2007-06-11 04:33:54 UTC (rev 944)
@@ -1638,5 +1638,37 @@
-1
-1
+262
+262
+rituals
+0 25 0 0
+-1
+263 264 265 -1
+-1
+
+263
+263
+blood ritual
+0 50 100 0
+262 -1
+-1
+-1
+
+264
+264
+spirit ritual
+0 50 100 0
+262 -1
+-1
+-1
+
+264
+264
+stamina ritual
+0 50 100 0
+262 -1
+-1
+-1
+
-1 EOF
Modified: trunk/mud/grrmud/World/SS_DESCS
===================================================================
--- trunk/mud/grrmud/World/SS_DESCS 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/World/SS_DESCS 2007-06-11 04:33:54 UTC (rev 944)
@@ -863,3 +863,26 @@
SYNTAX :
type : birdseye direction in which you wish to scan
~
+rituals
+Through rituals, the skilled necromancer is able to transcend the limitations
+of the flesh... for a price.
+~
+blood ritual
+Through this ritual the necromancer may forsake his mana for health.
+
+SYNTAX : cast 'blood ritual'
+~
+spirit ritual
+Through this ritual the necromancer may forsake his health for more magical
+power.
+
+SYNTAX : cast 'spirit ritual'
+~
+stamina ritual
+Particularly useful when great distances must be crossed with haste, the
+necromancer will find that he can run great distances after performing this
+dark art. It may however take a while to recover from the abuse the flesh must
+suffer.
+
+SYNTAX : cast 'stamina ritual'
+~
Modified: trunk/mud/grrmud/server/SkillSpell.cc
===================================================================
--- trunk/mud/grrmud/server/SkillSpell.cc 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/SkillSpell.cc 2007-06-11 04:33:54 UTC (rev 944)
@@ -1069,7 +1069,14 @@
FEAR_SKILL_NUM = i;
else if (strcasecmp("necrophilia", getSS(i).getName()) == 0)
NECROPHILIA_SKILL_NUM = i;
-
+ else if (strcasecmp("rituals", getSS(i).getName()) == 0)
+ RITUALS_SKILL_NUM = i;
+ else if (strcasecmp("blood ritual", getSS(i).getName()) == 0)
+ BLOOD_RITUAL_SKILL_NUM = i;
+ else if (strcasecmp("spirit ritual", getSS(i).getName()) == 0)
+ SPIRIT_RITUAL_SKILL_NUM = i;
+ else if (strcasecmp("stamina ritual", getSS(i).getName()) == 0)
+ STAMINA_RITUAL_SKILL_NUM = i;
else {
mudlog << "ERROR: could not match the spell with a constant, spell_num:"
<< i << " name -:" << getSS(i).getName() << ":- " << endl;
Modified: trunk/mud/grrmud/server/command2.cc
===================================================================
--- trunk/mud/grrmud/server/command2.cc 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/command2.cc 2007-06-11 04:33:54 UTC (rev 944)
@@ -237,7 +237,7 @@
<< "^C" << right << setw(6) << pc.getHP()
<< "^c" << " of "
<< "^C" << right << setw(6) << pc.getHP_MAX()
- << "^c" << " (" << right << setw(3) << pc.HP_REGEN
+ << "^c" << " (" << right << setw(3) << pc.getHealthRegen(true)
<< "% regeneration)"
<< "^c" << " Wimpy: " << "^C" << pc.getWimpy()
<< "^c" << "hp"
@@ -247,7 +247,7 @@
<< "^C" << right << setw(6) << pc.getMana()
<< "^c" << " of "
<< "^C" << right << setw(6) << pc.getManaMax()
- << "^c" << " (" << right << setw(3) << pc.MA_REGEN
+ << "^c" << " (" << right << setw(3) << pc.getManaRegen(true)
<< "% regeneration)"
<< endl
@@ -255,7 +255,7 @@
<< "^C" << right << setw(6) << pc.getMov()
<< "^c" << " of "
<< "^C" << right << setw(6) << pc.getMovMax()
- << "^c" << " (" << right << setw(3) << pc.MV_REGEN
+ << "^c" << " (" << right << setw(3) << pc.getMovRegen(true)
<< "% regeneration)"
<< endl;
Modified: trunk/mud/grrmud/server/command3.cc
===================================================================
--- trunk/mud/grrmud/server/command3.cc 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/command3.cc 2007-06-11 04:33:54 UTC (rev 944)
@@ -1163,6 +1163,7 @@
vict->SKILLS_KNOWN.Insert(CURSING_SKILL_NUM, 25);
vict->SKILLS_KNOWN.Insert(CONJURING_SKILL_NUM, 10);
vict->SKILLS_KNOWN.Insert(NECROPHILIA_SKILL_NUM, 25);
+ vict->SKILLS_KNOWN.Insert(RITUALS_SKILL_NUM, 25);
break;
default: {
mudlog.log(ERROR, "ERROR: In default of class modifiers in remort.\n");
Modified: trunk/mud/grrmud/server/commands.cc
===================================================================
--- trunk/mud/grrmud/server/commands.cc 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/commands.cc 2007-06-11 04:33:54 UTC (rev 944)
@@ -1259,6 +1259,12 @@
cast_fear(j_th, victim, pc);
else if (strncasecmp(*spell, "necrophilia", len) == 0)
cast_necrophilia(pc);
+ else if (strncasecmp(*spell, "blood ritual", len) == 0)
+ cast_blood_ritual(pc);
+ else if (strncasecmp(*spell, "spirit ritual", len) == 0)
+ cast_spirit_ritual(pc);
+ else if (strncasecmp(*spell, "stamina ritual", len) == 0)
+ cast_stamina_ritual(pc);
else {
pc.show(CS_SPELL_RESEARCH);
return -1;
Modified: trunk/mud/grrmud/server/critter.cc
===================================================================
--- trunk/mud/grrmud/server/critter.cc 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/critter.cc 2007-06-11 04:33:54 UTC (rev 944)
@@ -6103,3 +6103,28 @@
return (d(1, 100) >= d(1, i));
}//critter::lost_concentration()
+short critter::getHealthRegen(bool include_modifiers=false) const {
+ return short_cur_stats[37];
+}//critter::getHealthRegen()
+
+short critter::getManaRegen(bool include_modifiers=false) const {
+ short ret_val = short_cur_stats[38];
+ if ( include_modifiers ) {
+ if ( is_affected_by(BLOOD_RITUAL_SKILL_NUM, *this) ) {
+ ret_val = short(ret_val*0.20);
+ }
+ }
+ return ret_val;
+}//critter::getManaRegen()
+
+short critter::getMovRegen(bool include_modifiers=false) const {
+ short ret_val = short_cur_stats[39];
+ if ( include_modifiers ) {
+ if ( is_affected_by(STAMINA_RITUAL_SKILL_NUM, *this) ) {
+ ret_val = short(ret_val*0.60);
+ }
+ }
+ return ret_val;
+}//critter::getMovRegen()
+
+
Modified: trunk/mud/grrmud/server/critter.h
===================================================================
--- trunk/mud/grrmud/server/critter.h 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/critter.h 2007-06-11 04:33:54 UTC (rev 944)
@@ -1178,6 +1178,10 @@
bool isUnaware() const;
bool hasLight() const;
bool lost_concentration(int spell_num) const;
+
+ short getManaRegen(bool include_modifiers) const;
+ short getHealthRegen(bool include_modifiers) const;
+ short getMovRegen(bool include_modifiers) const;
};//class critter
Modified: trunk/mud/grrmud/server/login.cc
===================================================================
--- trunk/mud/grrmud/server/login.cc 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/login.cc 2007-06-11 04:33:54 UTC (rev 944)
@@ -857,6 +857,7 @@
pc.SKILLS_KNOWN.Insert(CURSING_SKILL_NUM, 25);
pc.SKILLS_KNOWN.Insert(CONJURING_SKILL_NUM, 10);
pc.SKILLS_KNOWN.Insert(NECROPHILIA_SKILL_NUM, 25);
+ pc.SKILLS_KNOWN.Insert(RITUALS_SKILL_NUM, 25);
pc.STR-=2;
pc.DEX-=2;
pc.INT+=4;
Modified: trunk/mud/grrmud/server/misc.cc
===================================================================
--- trunk/mud/grrmud/server/misc.cc 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/misc.cc 2007-06-11 04:33:54 UTC (rev 944)
@@ -509,7 +509,7 @@
if ( ! (is_affected_by(REMOVE_HOPE_SKILL_NUM, *crit_ptr)) ) {
crit_ptr->HP += (int)((((((float)(crit_ptr->CON) + 5.0) / 15.0) *
(((float)(crit_ptr->getHP_MAX())) / 9.0) *
- posn_mod * (((float)(crit_ptr->HP_REGEN)) / 100.0)
+ posn_mod * (((float)(crit_ptr->getHealthRegen(true))) / 100.0)
* adj + 10.0)/6.0)*env_mod+1.0);
}
@@ -527,7 +527,7 @@
crit_ptr->MANA += (int)(((((((float)(crit_ptr->INT)) + 5.0) / 16.0) *
posn_mod *
(((float)(crit_ptr->getManaMax())) / 7.0) *
- (((float)(crit_ptr->MA_REGEN)) / 100.0) *
+ (((float)(crit_ptr->getManaRegen(true))) / 100.0) *
align_mod *
adj + 4.0)/6.0)*env_mod+1.0);
}
@@ -543,7 +543,7 @@
tmp_mov = (int)(((((((float)(crit_ptr->DEX)) + 5.0) / 16.0) *
posn_mod * adj *
(((float)(crit_ptr->getMovMax())) / 3.0) *
- (((float)(crit_ptr->MV_REGEN)) / 100.0) + 3.0)/6.0)*env_mod+1.0);
+ (((float)(crit_ptr->getMovRegen(true))) / 100.0) + 3.0)/6.0)*env_mod+1.0);
crit_ptr->MOV += tmp_mov;
}
@@ -609,21 +609,21 @@
crit_ptr->HP +=
(int)(((((crit_ptr->CON + 5.0) / 15.0) *
(crit_ptr->getHP_MAX() / 9.0) *
- posn_mod * (crit_ptr->HP_REGEN / 100.0) * adj + 10.0)/6.0)+1.0);
+ posn_mod * (crit_ptr->getHealthRegen(true) / 100.0) * adj + 10.0)/6.0)+1.0);
}
// if we are affected by remove hope we get no mana
if ( ! (is_affected_by(REMOVE_KARMA_SKILL_NUM, *crit_ptr)) ) {
crit_ptr->MANA +=
(int)(((((crit_ptr->INT + 5.0) / 16.0) * posn_mod *
- (crit_ptr->getManaMax() / 7.0) * (crit_ptr->MA_REGEN / 100.0) * adj +
+ (crit_ptr->getManaMax() / 7.0) * (crit_ptr->getManaRegen(true) / 100.0) * adj +
4.0)/6.0)+1.0);
}
crit_ptr->MOV +=
(int)(((((crit_ptr->DEX + 5.0) / 16.0) * posn_mod *
adj *
- (crit_ptr->getMovMax() / 2.0) * (crit_ptr->MV_REGEN / 100.0) +
+ (crit_ptr->getMovMax() / 2.0) * (crit_ptr->getMovRegen(true) / 100.0) +
5.0)/6.0)+1.0);
if (crit_ptr->getHP() > crit_ptr->getHP_MAX())
Modified: trunk/mud/grrmud/server/necromancer.cc
===================================================================
--- trunk/mud/grrmud/server/necromancer.cc 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/necromancer.cc 2007-06-11 04:33:54 UTC (rev 944)
@@ -751,27 +751,145 @@
do_cast_raise_undead(pc, FALSE, 0);
}//cast_raise_undead
-//TODO: cast_blood_ritual is incomplete.
void cast_blood_ritual(critter& agg) {
+// Spell: Blood Ritual
+//
+// This spell converts 100% of the casters mana to hitpoints. If necessary,
+// MAX_HP is temporarily increased for the duration of the spell.
+//
+// Misc: this spell severely lowers mana regeneration.
+//
int spell_num = BLOOD_RITUAL_SKILL_NUM;
int mana_cost = get_mana_cost(spell_num, agg);
- if (!ok_to_do_action(NULL, "KMSNBb", spell_num, agg)) {
+ if (!ok_to_do_action(NULL, "KMSN", spell_num, agg)) {
return;
}
+ // Can't use again until the original debuff wears off.
+ stat_spell_cell *ss_ptr = is_affected_by(spell_num, agg);
+ if ( ss_ptr ) {
+ agg.show("You can't do that yet.\n");
+ return;
+ }
+
bool lost_con = agg.lost_concentration(spell_num);
-
if ( lost_con ) {
agg.show(LOST_CONCENTRATION_MSG_SELF);
agg.adjMana(-mana_cost/2);
return;
}
+ agg.adjMana(-mana_cost);
+
int adj_value = agg.getMana();
agg.adjHP(adj_value);
agg.setMana(0);
- //agg.affected_by.append(new stat_spell_cell(spell_num, 3,
+ int max_hp = agg.getHP_MAX();
+ int cur_hp = agg.getHP();
+
+ if ( max_hp < cur_hp ) {
+ adj_value = cur_hp - max_hp;
+ } else {
+ adj_value = 0;
+ }
+
+ agg.adjHP_MAX(adj_value);
+ agg.affected_by.append(new stat_spell_cell(spell_num, 2, adj_value));
+
+ agg.show("You emanate a deep red light as your magical energy flows into your blood.\n");
+
+ String buf(100);
+ Sprintf(buf,"emanates a deep red light as %s magical energy flows into %s blood.",
+ get_his_her(agg), get_his_her(agg));
+ agg.emote(buf);
+
}//cast_blood_ritual()
+void cast_spirit_ritual(critter& agg) {
+// Spell: Spirit Ritual
+//
+// This spell converts 50% of the casters maximum hitpoints to maximum mana.
+//
+ int spell_num = SPIRIT_RITUAL_SKILL_NUM;
+ int mana_cost = get_mana_cost(spell_num, agg);
+
+ if (!ok_to_do_action(NULL, "KMSN", spell_num, agg)) {
+ return;
+ }
+
+ // Can't use again until the original debuff wears off.
+ stat_spell_cell *ss_ptr = is_affected_by(spell_num, agg);
+ if ( ss_ptr ) {
+ agg.show("You can't do that yet.\n");
+ return;
+ }
+
+ bool lost_con = agg.lost_concentration(spell_num);
+ if ( lost_con ) {
+ agg.show(LOST_CONCENTRATION_MSG_SELF);
+ agg.adjMana(-mana_cost/2);
+ return;
+ }
+
+ agg.adjMana(-mana_cost);
+
+ int adj_value = int(agg.getHP_MAX()/2.0);
+ agg.adjHP_MAX(-adj_value);
+ agg.adjManaMax(adj_value);
+
+ if ( agg.getHP() > agg.getHP_MAX() ) {
+ agg.setHP(agg.getHP_MAX());
+ }
+
+ agg.affected_by.append(new stat_spell_cell(spell_num,int(agg.getLevel()/1.5), adj_value));
+
+ agg.show("The world grows dim as black specks dance in your vision.\n");
+
+ String buf(100);
+ agg.pemote("eyes come to life as black specks begin an intricate within them.");
+
+}//cast_spirit_ritual()
+
+void cast_stamina_ritual(critter& agg) {
+// Spell: Stamina Ritual
+//
+// This spell increases the casters mov max by 1.5x, at the expense of mov
+// regen.
+//
+ int spell_num = STAMINA_RITUAL_SKILL_NUM;
+ int mana_cost = get_mana_cost(spell_num, agg);
+
+ if (!ok_to_do_action(NULL, "KMSN", spell_num, agg)) {
+ return;
+ }
+
+ // Can't use again until the original debuff wears off.
+ stat_spell_cell *ss_ptr = is_affected_by(spell_num, agg);
+ if ( ss_ptr ) {
+ agg.show("You can't do that yet.\n");
+ return;
+ }
+
+ bool lost_con = agg.lost_concentration(spell_num);
+ if ( lost_con ) {
+ agg.show(LOST_CONCENTRATION_MSG_SELF);
+ agg.adjMana(-mana_cost/2);
+ return;
+ }
+
+ agg.adjMana(-mana_cost);
+
+ int adj_value = int(agg.getMovMax()/2.0);
+ agg.adjMovMax(adj_value);
+ agg.adjMov(adj_value);
+
+ agg.affected_by.append(new stat_spell_cell(spell_num,int(agg.getLevel()/1.5), adj_value));
+
+ agg.show("Your heart begins to race.\n");
+
+ String buf(100);
+ agg.emote("looks eerily tense.");
+
+}//cast_stamina_ritual()
Modified: trunk/mud/grrmud/server/necromancer.h
===================================================================
--- trunk/mud/grrmud/server/necromancer.h 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/necromancer.h 2007-06-11 04:33:54 UTC (rev 944)
@@ -57,9 +57,9 @@
void do_cast_raise_undead(critter& pc, int is_canned, int lvl);
void cast_blood_ritual(critter& agg);
-/*TODO: these need to be implemented
void cast_spirit_ritual(critter& agg);
void cast_stamina_ritual(critter& agg);
+/*TODO: these need to be implemented
void cast_ritual_of_power(critter& agg);
*/
Modified: trunk/mud/grrmud/server/spells.cc
===================================================================
--- trunk/mud/grrmud/server/spells.cc 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/grrmud/server/spells.cc 2007-06-11 04:33:54 UTC (rev 944)
@@ -311,6 +311,12 @@
//TODO: Moving forward every spell object needs it own wear-off method if applicable
String buf(100);
+ // This is so that the new bonus values get used in all cases.
+ if ( bonus_value == 0 ) {
+ stat_spell_cell* ss_ptr = is_affected_by(spell_num, pc);
+ bonus_value = ss_ptr->bonus_value;
+ }
+
if (spell_num == ARMOR_SKILL_NUM) {
pc.AC -= ARMOR_EFFECT;
pc.SPEL_RESIS -= ARMOR_EFFECT_M;
@@ -508,6 +514,28 @@
pc.show("You no longer feel fragile.\n");
pc.DAM_REC_MOD -= SANCTUM_EFFECT;
}//if
+ else if (spell_num == BLOOD_RITUAL_SKILL_NUM) {
+ pc.show("Your blood no longer boils with magic.\n");
+ pc.adjHP_MAX(-bonus_value);
+ if ( pc.getHP() > pc.getHP_MAX() ) {
+ pc.setHP(pc.getHP_MAX());
+ }
+ }//if
+ else if ( spell_num == SPIRIT_RITUAL_SKILL_NUM) {
+ pc.show("As you blink your vision clears.\n");
+ pc.adjHP_MAX(bonus_value);
+ pc.adjManaMax(-bonus_value);
+ if ( pc.getMana() > pc.getManaMax() ) {
+ pc.setMana(pc.getManaMax());
+ }
+ }
+ else if ( spell_num == STAMINA_RITUAL_SKILL_NUM) {
+ pc.show("Your heartbeat slows.\n");
+ pc.adjMovMax(-bonus_value);
+ if ( pc.getMov() > pc.getMovMax() ) {
+ pc.setMov(pc.getMovMax());
+ }
+ }
else {
Sprintf(buf, "ERROR: rem_effects_crit DEFAULT: spll# [%i] %s.\n",
spell_num,
Modified: trunk/mud/lib/containers/rb_tree.cc
===================================================================
--- trunk/mud/lib/containers/rb_tree.cc 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/lib/containers/rb_tree.cc 2007-06-11 04:33:54 UTC (rev 944)
@@ -108,7 +108,7 @@
// The value associated with the key is returned through the second argument.
//
template <class K, class V> short Tree<K,V>::Find
- (register const K &Key, V &Value)
+ (register const K &Key, V &Value) const
{
register TreeNode<K,V> *N = Root;
while (N)
Modified: trunk/mud/lib/containers/rb_tree.h
===================================================================
--- trunk/mud/lib/containers/rb_tree.h 2007-06-11 02:12:11 UTC (rev 943)
+++ trunk/mud/lib/containers/rb_tree.h 2007-06-11 04:33:54 UTC (rev 944)
@@ -111,7 +111,7 @@
// Access
//
- short Find (const K &, V &);
+ short Find (const K &, V &) const;
//
// Find returns 1 if the key is in the tree, and 0 otherwise.
// If the key is found, the associated value is returned through the
More information about the ScryMUD
mailing list