[ScryMUD] SVN Commit Info r949 - in trunk/mud/grrmud: World server
scrymud at wanfear.com
scrymud at wanfear.com
Mon Jun 11 20:22:27 PDT 2007
Author: eroper
Date: 2007-06-11 20:22:27 -0700 (Mon, 11 Jun 2007)
New Revision: 949
Modified:
trunk/mud/grrmud/World/SKILLS_SPELLS
trunk/mud/grrmud/World/SS_DESCS
trunk/mud/grrmud/server/SkillSpell.cc
trunk/mud/grrmud/server/battle.cc
trunk/mud/grrmud/server/command2.cc
trunk/mud/grrmud/server/commands.cc
trunk/mud/grrmud/server/critter.cc
trunk/mud/grrmud/server/critter.h
trunk/mud/grrmud/server/necromancer.cc
trunk/mud/grrmud/server/necromancer.h
trunk/mud/grrmud/server/spells.cc
trunk/mud/grrmud/server/spells2.cc
Log:
critter::getDamGivMod() was added.
critter::getDamRecMod() and critter::getDamGivMod() now take an
include_modifiers bool. It is important to note that unlike other similar
functions, these default to true rather than false. The reasoning behind this
is that the others were in use prior to them considering things for return
value modification and getDamRecMod() was used only in very few locations,
making it easy to verify the safety of the change.
I haven't decided whether or not to invert the logic of the others, or simply
to not have a default.
The spell "ritual of power" has been added.
Modified: trunk/mud/grrmud/World/SKILLS_SPELLS
===================================================================
--- trunk/mud/grrmud/World/SKILLS_SPELLS 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/World/SKILLS_SPELLS 2007-06-12 03:22:27 UTC (rev 949)
@@ -1635,7 +1635,7 @@
rituals
0 25 0 0
-1
-263 264 265 -1
+263 264 265 267 -1
-1
263
@@ -1670,5 +1670,13 @@
-1
-1
+267
+267
+ritual of power
+10 100 200 0
+262 -1
+-1
+-1
+
-1 EOF
Modified: trunk/mud/grrmud/World/SS_DESCS
===================================================================
--- trunk/mud/grrmud/World/SS_DESCS 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/World/SS_DESCS 2007-06-12 03:22:27 UTC (rev 949)
@@ -882,3 +882,9 @@
SYNTAX : cast 'stamina ritual'
~
+ritual of power
+Recklessly drawing more energy than is safe enables the accomplished
+necromancer to deal devastation upon his foes.
+
+SYNTAX : cast 'ritual of power'
+~
Modified: trunk/mud/grrmud/server/SkillSpell.cc
===================================================================
--- trunk/mud/grrmud/server/SkillSpell.cc 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/server/SkillSpell.cc 2007-06-12 03:22:27 UTC (rev 949)
@@ -1077,6 +1077,8 @@
SPIRIT_RITUAL_SKILL_NUM = i;
else if (strcasecmp("stamina ritual", getSS(i).getName()) == 0)
STAMINA_RITUAL_SKILL_NUM = i;
+ else if (strcasecmp("ritual of power", getSS(i).getName()) == 0)
+ RITUAL_OF_POWER_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/battle.cc
===================================================================
--- trunk/mud/grrmud/server/battle.cc 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/server/battle.cc 2007-06-12 03:22:27 UTC (rev 949)
@@ -875,8 +875,8 @@
damage_magic_shields(dam, vict);
- dam = (dam * (((float)vict.getDamRecMod())/100.0) *
- ((float)(agg.DAM_GIV_MOD)/100.0));
+ dam = (dam * (((float)vict.getDamRecMod(true))/100.0) *
+ ((float)(agg.getDamGivMod(true))/100.0));
int pl;
if (agg.pc &&
(pl = get_percent_lrnd(ENHANCED_DAMAGE_SKILL_NUM, agg)) > 0) {
@@ -973,7 +973,7 @@
damage_magic_shields(dam, vict);
- dam *= (((float)vict.getDamRecMod())/100.0);
+ dam *= (((float)vict.getDamRecMod(true))/100.0);
// Give PC's a slight edge, maybe modify after the game has mature
// players.
Modified: trunk/mud/grrmud/server/command2.cc
===================================================================
--- trunk/mud/grrmud/server/command2.cc 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/server/command2.cc 2007-06-12 03:22:27 UTC (rev 949)
@@ -266,10 +266,10 @@
<< "^c" << "."<< endl
<< "^c" << "You receive "
- << "^C" << pc.getDamRecMod() << "%"
+ << "^C" << pc.getDamRecMod(true) << "%"
<< "^c" << " damage. "
<< "^c" << "You deal "
- << "^C" << pc.DAM_GIV_MOD << "%"
+ << "^C" << pc.getDamGivMod(true) << "%"
<< "^c" << " damage."
<< endl
@@ -2455,9 +2455,10 @@
crit_ptr->PRACS, crit_ptr->getHP_MAX(), crit_ptr->getManaMax());
show(buf2, pc);
- Sprintf(buf2, "Vmx: %i CRITTER_TYPE: %i dam_rec_mod: %i DAM_GIV_MOD: %i\n",
+ Sprintf(buf2, "Vmx: %i CRITTER_TYPE: %i dam_rec_mod: %i(%i) DAM_GIV_MOD: %i(%i)\n",
crit_ptr->getMovMax(), crit_ptr->CRITTER_TYPE,
- crit_ptr->DAM_REC_MOD, crit_ptr->DAM_GIV_MOD);
+ crit_ptr->getDamRecMod(true), crit_ptr->getDamRecMod(false),
+ crit_ptr->getDamGivMod(true), crit_ptr->getDamGivMod(false));
show(buf2, pc);
Sprintf(buf2,
Modified: trunk/mud/grrmud/server/commands.cc
===================================================================
--- trunk/mud/grrmud/server/commands.cc 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/server/commands.cc 2007-06-12 03:22:27 UTC (rev 949)
@@ -1265,6 +1265,8 @@
cast_spirit_ritual(pc);
else if (strncasecmp(*spell, "stamina ritual", len) == 0)
cast_stamina_ritual(pc);
+ else if (strncasecmp(*spell, "ritual of power", len) == 0)
+ cast_ritual_of_power(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 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/server/critter.cc 2007-06-12 03:22:27 UTC (rev 949)
@@ -1985,24 +1985,47 @@
return 0;
}//time
+int critter::getDamRecMod(bool include_modifiers=true) const {
+ int min_val = 25;
+ int ret_val = DAM_REC_MOD;
-
-/** NOTE: This may normalize the real value.
- */
-int critter::getDamRecMod() const {
- int min_val = 25;
if (is_affected_by(FLESH_TO_STONE_SKILL_NUM, *this)) {
min_val = 1;
+ } else if (isImmort() || (isNPC() && !isCharmed())) {
+ min_val = 1;
}
+ if ( is_affected_by(RITUAL_OF_POWER_SKILL_NUM, *this) ) {
+ ret_val = int(ret_val * 1.25);
+ }
+
+ if ( include_modifiers ) {
+ return (max(min_val, ret_val));
+ } else {
+ return(DAM_REC_MOD);
+ }
+}//critter::getDamRecMod()
+
+int critter::getDamGivMod(bool include_modifiers=true) const {
+
+ int max_val = 200;
+ int ret_val = DAM_GIV_MOD;
+
if (isImmort() || (isNPC() && !isCharmed())) {
- min_val = 1;
+ max_val = 1000;//probably doesn't need to be quite this high.
}
- return (max(min_val, DAM_REC_MOD));
-}
+ if ( is_affected_by(RITUAL_OF_POWER_SKILL_NUM, *this) ) {
+ ret_val = int(ret_val * 1.50);
+ }
+ if ( include_modifiers ) {
+ return (min(max_val, ret_val));
+ } else {
+ return(DAM_GIV_MOD);
+ }
+}//critter::getDamGivMod()
int critter::isInGroupWith(critter* v) {
return GROUPEES.haveData(v);
@@ -5778,8 +5801,8 @@
damage_magic_shields(dam, *this);
- dam = (dam * (((float)getDamRecMod())/100.0) *
- ((float)(agg.DAM_GIV_MOD)/100.0));
+ dam = (dam * (((float)getDamRecMod(true))/100.0) *
+ ((float)(agg.getDamGivMod(true)))/100.0);
int pl;
if (agg.pc &&
@@ -5894,7 +5917,7 @@
damage_magic_shields(dam, *this);
- dam *= (((float)getDamRecMod())/100.0);
+ dam *= (((float)getDamRecMod(true))/100.0);
HP -= (int)(dam);
return (int)dam;
}
Modified: trunk/mud/grrmud/server/critter.h
===================================================================
--- trunk/mud/grrmud/server/critter.h 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/server/critter.h 2007-06-12 03:22:27 UTC (rev 949)
@@ -754,7 +754,8 @@
/** NOTE: This may normalize the real value.
*/
- int getDamRecMod() const;
+ int getDamRecMod(bool include_modifiers) const;
+ int getDamGivMod(bool include_modifiers) const;
/** For scripts, the script_targ is always *this. The script_owner
* will be null (for non-script specific stuff) and should be specified
Modified: trunk/mud/grrmud/server/necromancer.cc
===================================================================
--- trunk/mud/grrmud/server/necromancer.cc 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/server/necromancer.cc 2007-06-12 03:22:27 UTC (rev 949)
@@ -893,3 +893,41 @@
agg.emote("looks eerily tense.");
}//cast_stamina_ritual()
+
+void cast_ritual_of_power(critter& agg) {
+// Spell: Ritual of Power
+//
+// This spell increases the casters damage given and received modifiers by 50%
+// and 25% respectively. The modification is handled by
+// critter::getDamGivMod() and critter::getDamRecMod()
+//
+ int spell_num = RITUAL_OF_POWER_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);
+
+ agg.affected_by.append(new stat_spell_cell(spell_num,int(agg.getLevel()/1.5), 0));
+
+ agg.show("Your mind screams out in agony as you draw in torrential quantities of magic.\n");
+
+ String buf = "The air feels heavier for a moment, but the feeling passes.\n";
+ agg.getCurRoom()->com_recho(&buf);
+}//ritual_of_power()
Modified: trunk/mud/grrmud/server/necromancer.h
===================================================================
--- trunk/mud/grrmud/server/necromancer.h 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/server/necromancer.h 2007-06-12 03:22:27 UTC (rev 949)
@@ -59,9 +59,7 @@
void cast_blood_ritual(critter& agg);
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);
-*/
#define GRRMUD_NECROMANCER
#endif
Modified: trunk/mud/grrmud/server/spells.cc
===================================================================
--- trunk/mud/grrmud/server/spells.cc 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/server/spells.cc 2007-06-12 03:22:27 UTC (rev 949)
@@ -521,7 +521,7 @@
pc.setHP(pc.getHP_MAX());
}
}//if
- else if ( spell_num == SPIRIT_RITUAL_SKILL_NUM) {
+ 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);
@@ -529,13 +529,18 @@
pc.setMana(pc.getManaMax());
}
}
- else if ( spell_num == STAMINA_RITUAL_SKILL_NUM) {
+ 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 if ( spell_num == RITUAL_OF_POWER_SKILL_NUM ) {
+ pc.show("Exhausted and unable to hold on, you release the surplus energy.\n");
+ pc.adjMov(-int(pc.getMov()/2.0));
+ pc.emote("stumbles.");
+ }
else {
Sprintf(buf, "ERROR: rem_effects_crit DEFAULT: spll# [%i] %s.\n",
spell_num,
Modified: trunk/mud/grrmud/server/spells2.cc
===================================================================
--- trunk/mud/grrmud/server/spells2.cc 2007-06-11 06:01:50 UTC (rev 948)
+++ trunk/mud/grrmud/server/spells2.cc 2007-06-12 03:22:27 UTC (rev 949)
@@ -1918,7 +1918,7 @@
ptr->bonus_duration += lvl/2 +5;
show("Ok.\n", agg);
}//if
- else if (vict.DAM_REC_MOD <= 70) {
+ else if (vict.getDamRecMod(true) <= 70) {
show("You can protect them no better!\n", agg);
}//if
else if (sptr) {
@@ -2084,7 +2084,7 @@
ptr->bonus_duration += lvl/2 +5;
show("Ok.\n", agg);
}//if
- else if (vict.DAM_REC_MOD <= 40) {
+ else if (vict.getDamRecMod(true) <= 40) {
show("You can protect them no better!\n", agg);
}//if
else if (sptr) {
More information about the ScryMUD
mailing list