[ScryMUD] SVN Commit Info r953 - in trunk/mud/grrmud: World server
scrymud at wanfear.com
scrymud at wanfear.com
Sun Jun 17 14:45:22 PDT 2007
Author: eroper
Date: 2007-06-17 14:45:22 -0700 (Sun, 17 Jun 2007)
New Revision: 953
Added:
trunk/mud/grrmud/server/cleric.cc
trunk/mud/grrmud/server/cleric.h
Modified:
trunk/mud/grrmud/World/SKILLS_SPELLS
trunk/mud/grrmud/World/SS_DESCS
trunk/mud/grrmud/server/Makefile
trunk/mud/grrmud/server/SkillSpell.cc
trunk/mud/grrmud/server/SkillSpell.h
trunk/mud/grrmud/server/battle.cc
trunk/mud/grrmud/server/commands.cc
trunk/mud/grrmud/server/const.h
trunk/mud/grrmud/server/grrmud.cc
trunk/mud/grrmud/server/spells.cc
Log:
Added Dys's "divine retribution" with a few changes.
* Spell messages now refer to a crackling aura rather than a dark light.
* The effect fires, regardless of whether the aggressor has the same effect.
* The damage calculations have been redone. (examples follow)
- At 100% learned, +/- 1000 alignment, 100% of the aggressors damage is
returned.
- At 100% learned, +/- 500 alignment, 50% of the agressors damage is
returned.
- At 50% learned, +/- 1000 alignment, 50% of the agressors damage is
returned.
* The damage dealt is electric damage, rather than normal melee damage.
TODO: Should probably add combat messages so that folks know the thing is
doing something.
Modified: trunk/mud/grrmud/World/SKILLS_SPELLS
===================================================================
--- trunk/mud/grrmud/World/SKILLS_SPELLS 2007-06-17 19:36:53 UTC (rev 952)
+++ trunk/mud/grrmud/World/SKILLS_SPELLS 2007-06-17 21:45:22 UTC (rev 953)
@@ -699,7 +699,7 @@
religion
0 50 0 0
134 -1
-1 201 191 192 196 -1
+1 201 191 192 196 268 -1
-1
139
@@ -1678,5 +1678,13 @@
-1
-1
+268
+268
+divine retribution
+3 20 15 0
+138 -1
+-1
+7 -1
+
-1 EOF
Modified: trunk/mud/grrmud/World/SS_DESCS
===================================================================
--- trunk/mud/grrmud/World/SS_DESCS 2007-06-17 19:36:53 UTC (rev 952)
+++ trunk/mud/grrmud/World/SS_DESCS 2007-06-17 21:45:22 UTC (rev 953)
@@ -888,3 +888,10 @@
SYNTAX : cast 'ritual of power'
~
+divine retribution
+A clerical spell that is defensive as well as offensive. It surrounds
+the target with a crackling aura, which reflects most close-range
+physical attacks back towards the opponent.
+
+SYNTAX : cast 'divine retribution' <target>
+~
Modified: trunk/mud/grrmud/server/Makefile
===================================================================
--- trunk/mud/grrmud/server/Makefile 2007-06-17 19:36:53 UTC (rev 952)
+++ trunk/mud/grrmud/server/Makefile 2007-06-17 21:45:22 UTC (rev 953)
@@ -22,7 +22,7 @@
script.o SkillSpell.o zone.o rm_parse.o rm_cmds.o obj_parse.o \
obj_cmds.o BuildInfo.o BugEntry.o MudStats.o clients.o ServerConfig.o \
mapper.o regex.o protocol_handler.o telnet_handler.o hegemon_handler.o \
-pfile_maint.o weather.o necromancer.o
+pfile_maint.o weather.o necromancer.o cleric.o
grrmud_TARG = grrmud
Modified: trunk/mud/grrmud/server/SkillSpell.cc
===================================================================
--- trunk/mud/grrmud/server/SkillSpell.cc 2007-06-17 19:36:53 UTC (rev 952)
+++ trunk/mud/grrmud/server/SkillSpell.cc 2007-06-17 21:45:22 UTC (rev 953)
@@ -1079,7 +1079,10 @@
STAMINA_RITUAL_SKILL_NUM = i;
else if (strcasecmp("ritual of power", getSS(i).getName()) == 0)
RITUAL_OF_POWER_SKILL_NUM = i;
- else {
+ //DYS SPELLS
+ else if (strcasecmp("divine retribution", getSS(i).getName()) == 0)
+ DIVINE_RETRIBUTION_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/SkillSpell.h
===================================================================
--- trunk/mud/grrmud/server/SkillSpell.h 2007-06-17 19:36:53 UTC (rev 952)
+++ trunk/mud/grrmud/server/SkillSpell.h 2007-06-17 21:45:22 UTC (rev 953)
@@ -34,7 +34,7 @@
///*********************** skill spell *****************************///
-#define NUMBER_OF_SKILL_SPELLS 414
+#define NUMBER_OF_SKILL_SPELLS 415
class object;
class critter;
Modified: trunk/mud/grrmud/server/battle.cc
===================================================================
--- trunk/mud/grrmud/server/battle.cc 2007-06-17 19:36:53 UTC (rev 952)
+++ trunk/mud/grrmud/server/battle.cc 2007-06-17 21:45:22 UTC (rev 953)
@@ -896,6 +896,21 @@
dam = 0;
}//if
+//DYS
+ if (is_affected_by(DIVINE_RETRIBUTION_SKILL_NUM, vict)) {
+ // example numbers:
+ // at +/- 1000 alignment, and 100% learned, the victim returns 100%
+ // at +/- 500 alignment, and 100% learned, the victim returns 50%
+ // at +/- 1000 alignment, and 50% learned, the victim returns 50%
+ // at +/- 500 alignment, and 50% learned, the victim returns 25%
+ float modifier = get_percent_lrnd(DIVINE_RETRIBUTION_SKILL_NUM, vict);
+ modifier /= 1000;
+ modifier *= abs(vict.getAlignment());
+ modifier /= 100;
+
+ agg.takeDamage( (int)(dam *= modifier), ELECTRICITY, vict);
+ }
+
if (is_affected_by(ABSORB_BLOWS_SKILL_NUM, vict)) {
vict.MANA -= (short)dam;
if (vict.MANA < 0) {
Added: trunk/mud/grrmud/server/cleric.cc
===================================================================
--- trunk/mud/grrmud/server/cleric.cc (rev 0)
+++ trunk/mud/grrmud/server/cleric.cc 2007-06-17 21:45:22 UTC (rev 953)
@@ -0,0 +1,108 @@
+// $Id$
+
+//
+//ScryMUD Server Code
+//Copyright (C) 2007 Edward Roper
+//
+//This program is free software; you can redistribute it and/or
+//modify it under the terms of the GNU General Public License
+//as published by the Free Software Foundation; either version 2
+//of the License, or (at your option) any later version.
+//
+//This program is distributed in the hope that it will be useful,
+//but WITHOUT ANY WARRANTY; without even the implied warranty of
+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//GNU General Public License for more details.
+//
+//You should have received a copy of the GNU General Public License
+//along with this program; if not, write to the Free Software
+//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+//To contact the maintainer, Edward Roper: edro+scrymud [at] wanfear.net
+//
+
+#include "cleric.h"
+#include "skills.h"
+#include "spells.h"
+#include "misc.h"
+#include "misc2.h"
+
+void cast_divine_retribution(int i_th, const String *victim, critter &pc)
+{
+ critter *vict = NULL;
+ int spell_num = DIVINE_RETRIBUTION_SKILL_NUM;
+
+ vict = ROOM.haveCritNamed(i_th, victim, pc);
+
+ if (!vict) {
+ pc.show("Whose do you wish to protect?", HL_DEF);
+ return;
+ }
+
+ if (vict->isMob()) {
+ vict = mob_to_smob(*vict, pc.getCurRoomNum(), TRUE, i_th, victim, pc.SEE_BIT);
+ } // if
+
+ if (!ok_to_do_action(vict, "KMVN", spell_num, pc)) {
+ return;
+ }
+
+ do_cast_divine_retribution(*vict, pc, FALSE, 0);
+}
+
+void do_cast_divine_retribution(critter &vict, critter &agg, int is_canned, int lvl)
+{
+ String buf(100);
+ int spell_num = DIVINE_RETRIBUTION_SKILL_NUM;
+ int spell_mana = get_mana_cost(spell_num, agg);
+
+ int lost_con = FALSE;
+
+ if (!is_canned)
+ lvl = agg.getLevel();
+
+ // Time to rock n' roll.
+ if ( is_canned || !(lost_con = lost_concentration(agg, spell_num))) {
+
+ stat_spell_cell *ptr = is_affected_by(spell_num, vict);
+
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana);
+
+ if ( ptr ) {
+ ptr->bonus_duration += lvl / 2;
+ } else {
+ vict.affected_by.append(new stat_spell_cell(spell_num, lvl));
+
+ // Cast on self
+ if ( &vict == &agg ) {
+ vict.show("You are surrounded by a crackling aura.\n", HL_DEF);
+ Sprintf(buf, "surrounds %s with a crackling aura.", get_himself_herself(vict));
+ vict.emote(buf);
+ } else {
+
+ Sprintf(buf, "You surround %S with a crackling aura.\n",
+ name_of_crit(vict, agg.SEE_BIT));
+ agg.show(buf, HL_DEF);
+
+ Sprintf(buf, "%S surrounds you with a crackling aura.\n",
+ name_of_crit(agg, vict.SEE_BIT));
+ buf.Cap();
+ vict.show(buf, HL_DEF);
+
+ Sprintf(buf, "surrounds %S with a crackling aura.",
+ name_of_crit(vict, ~0));
+ emote(buf, agg, *(agg.getCurRoom()), TRUE, &vict);
+ }
+ }
+ }// end of "if - it - worked"
+ else { // !canned && lost concentration
+ agg.show(LOST_CONCENTRATION_MSG_SELF, HL_DEF);
+ Sprintf(buf, "seems to have lost %s concentration.", get_his_her(agg));
+ emote(buf, agg, room_list[agg.getCurRoomNum()], TRUE);
+ if ( ! is_canned )
+ agg.adjMana(-spell_mana/2);
+ }
+
+}
+
Added: trunk/mud/grrmud/server/cleric.h
===================================================================
--- trunk/mud/grrmud/server/cleric.h (rev 0)
+++ trunk/mud/grrmud/server/cleric.h 2007-06-17 21:45:22 UTC (rev 953)
@@ -0,0 +1,31 @@
+// $Id$
+
+//
+//ScryMUD Server Code
+//Copyright (C) 2007 Edward Roper
+//
+//This program is free software; you can redistribute it and/or
+//modify it under the terms of the GNU General Public License
+//as published by the Free Software Foundation; either version 2
+//of the License, or (at your option) any later version.
+//
+//This program is distributed in the hope that it will be useful,
+//but WITHOUT ANY WARRANTY; without even the implied warranty of
+//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//GNU General Public License for more details.
+//
+//You should have received a copy of the GNU General Public License
+//along with this program; if not, write to the Free Software
+//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+//To contact the maintainer, Edward Roper: edro+scrymud [at] wanfear.net
+//
+
+#ifndef GRRMUD_CLERIC
+#include "critter.h"
+
+void cast_divine_retribution(int i_th, const String* vict, critter& agg);
+void do_cast_divine_retribution(critter& vict, critter& agg, int is_canned, int lvl);
+
+#define GRRMUD_CLERIC
+#endif
Modified: trunk/mud/grrmud/server/commands.cc
===================================================================
--- trunk/mud/grrmud/server/commands.cc 2007-06-17 19:36:53 UTC (rev 952)
+++ trunk/mud/grrmud/server/commands.cc 2007-06-17 21:45:22 UTC (rev 953)
@@ -49,6 +49,7 @@
#include "clients.h"
#include "weather.h"
#include "necromancer.h"
+#include "cleric.h"
int inventory(critter& pc) {
String buf(100);
@@ -1267,6 +1268,8 @@
cast_stamina_ritual(pc);
else if (strncasecmp(*spell, "ritual of power", len) == 0)
cast_ritual_of_power(pc);
+ else if (strncasecmp(*spell, "divine retribution", len) == 0)
+ cast_divine_retribution(j_th, victim, pc);
else {
pc.show(CS_SPELL_RESEARCH);
return -1;
Modified: trunk/mud/grrmud/server/const.h
===================================================================
--- trunk/mud/grrmud/server/const.h 2007-06-17 19:36:53 UTC (rev 952)
+++ trunk/mud/grrmud/server/const.h 2007-06-17 21:45:22 UTC (rev 953)
@@ -1199,7 +1199,9 @@
BLOOD_RITUAL_SKILL_NUM,
SPIRIT_RITUAL_SKILL_NUM,
STAMINA_RITUAL_SKILL_NUM,
- RITUAL_OF_POWER_SKILL_NUM;
+ RITUAL_OF_POWER_SKILL_NUM,
+ //New skills via Dys
+ DIVINE_RETRIBUTION_SKILL_NUM;
// Ripped off from some PennMUSH code someone posted to the
// mud-dev list.
Modified: trunk/mud/grrmud/server/grrmud.cc
===================================================================
--- trunk/mud/grrmud/server/grrmud.cc 2007-06-17 19:36:53 UTC (rev 952)
+++ trunk/mud/grrmud/server/grrmud.cc 2007-06-17 21:45:22 UTC (rev 953)
@@ -380,7 +380,8 @@
BLOOD_RITUAL_SKILL_NUM,
SPIRIT_RITUAL_SKILL_NUM,
STAMINA_RITUAL_SKILL_NUM,
- RITUAL_OF_POWER_SKILL_NUM;
+ RITUAL_OF_POWER_SKILL_NUM,
+ DIVINE_RETRIBUTION_SKILL_NUM;
/* end of global variables */
Modified: trunk/mud/grrmud/server/spells.cc
===================================================================
--- trunk/mud/grrmud/server/spells.cc 2007-06-17 19:36:53 UTC (rev 952)
+++ trunk/mud/grrmud/server/spells.cc 2007-06-17 21:45:22 UTC (rev 953)
@@ -541,6 +541,10 @@
pc.adjMov(-int(pc.getMov()/2.0));
pc.emote("stumbles.");
}
+ else if (spell_num == DIVINE_RETRIBUTION_SKILL_NUM) {
+ pc.show("Your crackling aura fizzles out.\n");
+ pc.pemote("crackling aura fizzles out.\n");
+ }//if
else {
Sprintf(buf, "ERROR: rem_effects_crit DEFAULT: spll# [%i] %s.\n",
spell_num,
More information about the ScryMUD
mailing list