[ScryMUD] SVN Commit Info r863 - trunk/mud/grrmud/server
scrymud at wanfear.com
scrymud at wanfear.com
Thu Feb 8 00:47:08 PST 2007
Author: eroper
Date: 2007-02-08 00:47:07 -0800 (Thu, 08 Feb 2007)
New Revision: 863
Modified:
trunk/mud/grrmud/server/commands.cc
Log:
Meditate shouldn't fail as often at high %learned.
Modified: trunk/mud/grrmud/server/commands.cc
===================================================================
--- trunk/mud/grrmud/server/commands.cc 2007-02-08 07:05:00 UTC (rev 862)
+++ trunk/mud/grrmud/server/commands.cc 2007-02-08 08:47:07 UTC (rev 863)
@@ -2743,40 +2743,42 @@
int meditate(critter& pc) {
- String buf(100);
+ String buf(100);
+ int p_lrnd = 0;
- if (!ok_to_do_action(NULL, "mFP", 0, pc, pc.getCurRoom(), NULL, TRUE)) {
- return -1;
- }
+ if (!ok_to_do_action(NULL, "mFP", 0, pc, pc.getCurRoom(), NULL, TRUE)) {
+ return -1;
+ }
- if (pc.POS == POS_MED) {
- pc.show(CS_ALREADY_MED);
- return 0;
- }//if
- else if ((pc.POS != POS_SLEEP)) {
- if (pc.IS_FIGHTING.isEmpty()) {
- if (d(1, 75) < d(1, get_percent_lrnd(MEDITATION_SKILL_NUM, pc))) {
- pc.show(CS_DO_MED);
- emote(CS_MED_EMOTE, pc, ROOM, FALSE);
- pc.setPosn(POS_MED);
-
- String cmd = "meditate";
- ROOM.checkForProc(cmd, NULL_STRING, pc, -1);
- return 0;
- }//if
- else {
- pc.show(CS_MED_NO_CONCENTRATE);
- pc.PAUSE += 2;
- }//else
- }//if
- else {
- pc.show(CS_MED_FIGHTING);
- }//else
- }//if
- else {
- pc.show(CS_MED_WAKE_FIRST);
- }//else
- return -1;
+ if (pc.POS == POS_MED) {
+ pc.show(CS_ALREADY_MED);
+ return 0;
+ }//if
+ else if ((pc.POS != POS_SLEEP)) {
+ if (pc.IS_FIGHTING.isEmpty()) {
+ p_lrnd = get_percent_lrnd(MEDITATION_SKILL_NUM, pc);
+ if ( d(1, 100) > ( ( 100 - p_lrnd ) + ( p_lrnd * 0.03 ) ) ) {
+ pc.show(CS_DO_MED);
+ emote(CS_MED_EMOTE, pc, ROOM, FALSE);
+ pc.setPosn(POS_MED);
+
+ String cmd = "meditate";
+ ROOM.checkForProc(cmd, NULL_STRING, pc, -1);
+ return 0;
+ }//if
+ else {
+ pc.show(CS_MED_NO_CONCENTRATE);
+ pc.PAUSE += 2;
+ }//else
+ }//if
+ else {
+ pc.show(CS_MED_FIGHTING);
+ }//else
+ }//if
+ else {
+ pc.show(CS_MED_WAKE_FIRST);
+ }//else
+ return -1;
}//meditate
More information about the ScryMUD
mailing list