[ScryMUD] SVN Commit Info r877 - trunk/mud/grrmud/server
scrymud at wanfear.com
scrymud at wanfear.com
Tue Feb 13 01:01:10 PST 2007
Author: eroper
Date: 2007-02-13 01:01:10 -0800 (Tue, 13 Feb 2007)
New Revision: 877
Modified:
trunk/mud/grrmud/server/command2.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/spells.cc
trunk/mud/grrmud/server/spells.h
trunk/mud/grrmud/server/spells2.cc
Log:
Weaken now reduces the players strength by 10%, which depending on the player
can be more or less than the previous effect. In addition, the duration of
weaken has been reduced substantially.
mstat will now show the values and durations remaining in the "Affected by"
lists.
added critter::getSTR() which currently takes into account the Strength
Conditioning skill.
The contents of the file "motd" will now be sent to players after they login.
Reverted the change from the previous patch to misc.cc (<= is back to ==). It
occured to me that "-1" as a value may be of some significance and the problem
turned out to be something different.
Modified: trunk/mud/grrmud/server/command2.cc
===================================================================
--- trunk/mud/grrmud/server/command2.cc 2007-02-13 07:25:25 UTC (rev 876)
+++ trunk/mud/grrmud/server/command2.cc 2007-02-13 09:01:10 UTC (rev 877)
@@ -52,6 +52,7 @@
String buf(100);
Cell<stat_spell_cell*> cll(of_pc.affected_by);
stat_spell_cell* ss_ptr;
+ bool called_by_imm = false;
// log("In score_long.\n");
@@ -64,6 +65,7 @@
pc.show(CS_IMM_ONLY_ACCESS);
return -1;
}//if
+ called_by_imm = true;
}//if
if(of_pc.isSneaking()) pc.show(CS_YOU_SNEAKING);
@@ -90,9 +92,18 @@
if (!of_pc.affected_by.isEmpty()) {
pc.show(CS_AFFECTED_BY);
while ((ss_ptr = cll.next())) {
- Sprintf(buf, "\t%s.\n",
- (const char*)(SSCollection::instance().getNameForNum(ss_ptr->stat_spell)));
- show(buf, pc);
+ if ( called_by_imm ) {
+ Sprintf(buf, "\t[val: %d][duration: %d] %s\n",
+ ss_ptr->bonus_value,
+ ss_ptr->bonus_duration,
+ (const char*)(SSCollection::instance().getNameForNum(ss_ptr->stat_spell)));
+ pc.show(buf);
+ }
+ else {
+ Sprintf(buf, "\t%s.\n",
+ (const char*)(SSCollection::instance().getNameForNum(ss_ptr->stat_spell)));
+ pc.show(buf);
+ }
}//while
}//if
else {
Modified: trunk/mud/grrmud/server/critter.cc
===================================================================
--- trunk/mud/grrmud/server/critter.cc 2007-02-13 07:25:25 UTC (rev 876)
+++ trunk/mud/grrmud/server/critter.cc 2007-02-13 09:01:10 UTC (rev 877)
@@ -2300,6 +2300,20 @@
return IN_ROOM;
}
+int critter::getSTR(bool include_modifiers=false) {
+ int p_lrnd;
+ int modifier = 0;
+
+ if ( include_modifiers && pc ) {
+ p_lrnd = get_percent_lrnd(STRENGTH_CONDITIONING_SKILL_NUM, *this);
+ if ( p_lrnd > 0 ) {
+ modifier += p_lrnd/30;
+ }
+ }
+
+ return STR+modifier;
+}
+
int critter::getDEX(bool include_modifiers=false) {
int p_lrnd;
int modifier = 0;
Modified: trunk/mud/grrmud/server/critter.h
===================================================================
--- trunk/mud/grrmud/server/critter.h 2007-02-13 07:25:25 UTC (rev 876)
+++ trunk/mud/grrmud/server/critter.h 2007-02-13 09:01:10 UTC (rev 877)
@@ -869,6 +869,7 @@
int getCharisma() const { return short_cur_stats[4]; }
int getHP() const { return short_cur_stats[15]; }
int getHP_MAX() const { return short_cur_stats[23]; }
+ int getSTR(bool include_modifiers);
int getDEX(bool include_modifiers);
int getWIS(bool include_modifiers);
int getCHA(bool include_modifiers);
Modified: trunk/mud/grrmud/server/login.cc
===================================================================
--- trunk/mud/grrmud/server/login.cc 2007-02-13 07:25:25 UTC (rev 876)
+++ trunk/mud/grrmud/server/login.cc 2007-02-13 09:01:10 UTC (rev 877)
@@ -632,7 +632,9 @@
break;
}//switch
}//else
+
mudlog.log(TRC, "Done w/do_login.\n");
+
}//do_login
@@ -968,7 +970,9 @@
update_skills(pc); //sync them up, does not necessarly add new ones
pc.PC_FLAGS.turn_off(33); //make sure they aren't marked as afk
- show("Welcome back!!\n\n", pc);
+ pc.show(get_page("./motd")); //message of the day
+
+ pc.show("Welcome back!!\n\n");
look(1, &NULL_STRING, pc); //autolook
recursive_init_loads(pc); //update stuff in game, like IN_GAME count
Modified: trunk/mud/grrmud/server/misc.cc
===================================================================
--- trunk/mud/grrmud/server/misc.cc 2007-02-13 07:25:25 UTC (rev 876)
+++ trunk/mud/grrmud/server/misc.cc 2007-02-13 09:01:10 UTC (rev 877)
@@ -1262,8 +1262,8 @@
while (sp_ptr) {
if (sp_ptr->bonus_duration != -1)
sp_ptr->bonus_duration--;
- if (sp_ptr->bonus_duration <= 0) {
- rem_effects_crit(sp_ptr->stat_spell, *crit_ptr, TRUE);
+ if (sp_ptr->bonus_duration == 0) {
+ rem_effects_crit(sp_ptr->stat_spell, *crit_ptr, TRUE, sp_ptr->bonus_value);
delete sp_ptr;
sp_ptr = crit_ptr->affected_by.lose(sp_cell);
}//if
Modified: trunk/mud/grrmud/server/spells.cc
===================================================================
--- trunk/mud/grrmud/server/spells.cc 2007-02-13 07:25:25 UTC (rev 876)
+++ trunk/mud/grrmud/server/spells.cc 2007-02-13 09:01:10 UTC (rev 877)
@@ -306,7 +306,9 @@
}
-void rem_effects_crit(int spell_num, critter &pc, short do_msg) {
+void rem_effects_crit(int spell_num, critter &pc, short do_msg, int bonus_value=0) {
+//TODO: Everything here needs to check for bonus_value and act accordingly.
+//TODO: Moving forward every spell object needs it own wear-off method if applicable
String buf(100);
if (spell_num == ARMOR_SKILL_NUM) {
@@ -379,7 +381,12 @@
show("You no longer detect invisible things.\n", pc);
}//if
else if (spell_num == WEAKEN_SKILL_NUM) {
- pc.STR -= WEAKEN_EFFECT;
+ if ( bonus_value != 0 ) {
+ pc.STR -= bonus_value;
+ }
+ else {
+ pc.STR -= WEAKEN_EFFECT;
+ }
if (do_msg)
show("You feel stronger!\n", pc);
}//if
Modified: trunk/mud/grrmud/server/spells.h
===================================================================
--- trunk/mud/grrmud/server/spells.h 2007-02-13 07:25:25 UTC (rev 876)
+++ trunk/mud/grrmud/server/spells.h 2007-02-13 09:01:10 UTC (rev 877)
@@ -78,7 +78,7 @@
///************** auxillary spell/skill functions *************///
-void rem_effects_crit(int spell_num, critter& pc, short do_msg);
+void rem_effects_crit(int spell_num, critter& pc, short do_msg, int bonus_value);
void rem_effects_obj(int spell_num, object& obj);
void rem_effects_room(int spell_num, room& rm, short do_msg);
void rem_effects_door(int spell_num, door& dr, room& rm1, room& rm2,
Modified: trunk/mud/grrmud/server/spells2.cc
===================================================================
--- trunk/mud/grrmud/server/spells2.cc 2007-02-13 07:25:25 UTC (rev 876)
+++ trunk/mud/grrmud/server/spells2.cc 2007-02-13 09:01:10 UTC (rev 877)
@@ -1403,8 +1403,9 @@
int lost_con = FALSE;
- if (!is_canned)
+ if (!is_canned) {
lvl = agg.LEVEL;
+ }
if ((is_canned && (did_hit =
did_spell_hit(agg, CRONIC, vict, lvl, TRUE))) ||
@@ -1413,16 +1414,19 @@
stat_spell_cell* ptr = is_affected_by(spell_num, vict);
- if (!is_canned)
+ if (!is_canned) {
agg.MANA -= spell_mana;
+ }
if (ptr) {
- ptr->bonus_duration += lvl / 3;
- show("Ok.\n", agg);
+ ptr->bonus_duration += d(1,3);
+ agg.show("Ok.\n");
}//if
else {
- vict.affected_by.append(new stat_spell_cell(spell_num, lvl/2));
- vict.STR += WEAKEN_EFFECT;
+ // -10% of unmodified strength for 1-5 ticks.
+ int weaken_by_value = (int)( - ( 0.10 * vict.getSTR(false) ) );
+ vict.affected_by.append(new stat_spell_cell(spell_num, d(1,5), weaken_by_value ) );
+ vict.STR += weaken_by_value;
if (vict.pc) {
if (vict.STR > 20) {
More information about the ScryMUD
mailing list