[ScryMUD] SVN Commit Info r732 - branches/version-2-1/mud/grrmud/server
scrymud at wanfear.com
scrymud at wanfear.com
Sat Dec 4 04:21:40 PST 2004
Author: eroper
Date: 2004-12-04 04:21:39 -0800 (Sat, 04 Dec 2004)
New Revision: 732
Modified:
branches/version-2-1/mud/grrmud/server/grrmud.cc
branches/version-2-1/mud/grrmud/server/misc.cc
Log:
Changed the way stacked listings are generated. For some reason Sprintf() was
insisting on putting X where x was supposed to be. I'm guessing it's a format
string modifier of some sort (but too tired to look).
* Players and MOBs no longer regenerate during combat.
* Players and MOBs now regenerate every 10 seconds or so.
* Players no longer lose their excess hitpoints on regen if they are affected by
absorb blows.
Modified: branches/version-2-1/mud/grrmud/server/grrmud.cc
===================================================================
--- branches/version-2-1/mud/grrmud/server/grrmud.cc 2004-12-04 11:09:16 UTC (rev 731)
+++ branches/version-2-1/mud/grrmud/server/grrmud.cc 2004-12-04 12:21:39 UTC (rev 732)
@@ -890,8 +890,13 @@
// Will try to pulse the entire MUD ever 20 seconds.
// We will pulse one-tenth at a time (room wise).
- if ((pulse % 10) == 0)
+ if ((pulse % 10) == 0) {
do_pulsed_spec_procs(First_Room, Last_Room);
+ }
+ if ((pulse % 63) == 0) {
+ do_regeneration_pcs();
+ do_regeneration_smobs();
+ }
if ((pulse % 379) == 0) {
do_tick(); //takes care of zones too
}
Modified: branches/version-2-1/mud/grrmud/server/misc.cc
===================================================================
--- branches/version-2-1/mud/grrmud/server/misc.cc 2004-12-04 11:09:16 UTC (rev 731)
+++ branches/version-2-1/mud/grrmud/server/misc.cc 2004-12-04 12:21:39 UTC (rev 732)
@@ -324,8 +324,8 @@
decrease_timed_affecting_rooms(); //takes care of affected_rooms
/* do all incrementing */
- do_regeneration_pcs(); //takes care of all pc's
- do_regeneration_smobs(); //takes care of affected_mobs list
+ //do_regeneration_pcs(); //takes care of all pc's
+ //do_regeneration_smobs(); //takes care of affected_mobs list
do_regeneration_objects(); //takes care of affected_objects list
ZoneCollection::instance().doRegeneration(); //update mobs, objs, rooms if needed
@@ -454,6 +454,10 @@
}//do_mini_tick
+//The /6.0)+1.0) is because I'm having regen occur in about 1/6th the amount
+//of time that it used to. The +1.0 is just so we don't accidently have people
+//that never regen. I'll be watching the effects of this change closely and
+//will most likely adjust the algorithms based on what I discover.
void do_regeneration_pcs() {
float adj = 1.0, posn_mod, align_mod = 1.0;
Cell<critter*> crit_cell;
@@ -461,8 +465,14 @@
critter* crit_ptr;
//log("In do_regeneration_pcs\n");
-
+
while ((crit_ptr = crit_cell.next())) {
+
+ //no regen if we're fighting
+ if ( crit_ptr->isFighting() ) {
+ continue;
+ }
+
if ((crit_ptr->THIRST == 0) || (crit_ptr->HUNGER == 0)) {
adj = 0.2; // big penalty for being hungry
}
@@ -486,10 +496,10 @@
// if we are affected by remove hope we get no hp
if ( ! (is_affected_by(REMOVE_HOPE_SKILL_NUM, *crit_ptr)) ) {
- crit_ptr->HP += (int)((((float)(crit_ptr->CON) + 5.0) / 15.0) *
+ crit_ptr->HP += (int)((((((float)(crit_ptr->CON) + 5.0) / 15.0) *
(((float)(crit_ptr->HP_MAX)) / 9.0) *
posn_mod * (((float)(crit_ptr->HP_REGEN)) / 100.0)
- * adj + 10.0);
+ * adj + 10.0)/6.0)+1.0);
}
// if we are affected by remove karma we get no mana
@@ -503,19 +513,19 @@
align_mod = 1/pow(10, (breakeven+crit_ptr->ALIGN)/(1000-breakeven));
}
- crit_ptr->MANA += (int)(((((float)(crit_ptr->INT)) + 5.0) / 16.0) *
+ crit_ptr->MANA += (int)(((((((float)(crit_ptr->INT)) + 5.0) / 16.0) *
posn_mod *
(((float)(crit_ptr->MA_MAX)) / 7.0) *
(((float)(crit_ptr->MA_REGEN)) / 100.0) *
align_mod *
- adj + 4.0);
+ adj + 4.0)/6.0)+1.0);
}
int tmp_mov;
- tmp_mov = (int)(((((float)(crit_ptr->DEX)) + 5.0) / 16.0) *
+ tmp_mov = (int)(((((((float)(crit_ptr->DEX)) + 5.0) / 16.0) *
posn_mod * adj *
(((float)(crit_ptr->MV_MAX)) / 3.0) *
- (((float)(crit_ptr->MV_REGEN)) / 100.0) + 3.0);
+ (((float)(crit_ptr->MV_REGEN)) / 100.0) + 3.0)/6.0)+1.0);
crit_ptr->MOV += tmp_mov;
@@ -527,8 +537,10 @@
// }
//}
- if (crit_ptr->HP > crit_ptr->HP_MAX)
+ if ( (crit_ptr->HP > crit_ptr->HP_MAX) &&
+ ( ! is_affected_by(ABSORB_BLOWS_SKILL_NUM, *crit_ptr) ) ) {
crit_ptr->HP = crit_ptr->HP_MAX;
+ }
if (crit_ptr->MANA > crit_ptr->MA_MAX)
crit_ptr->MANA = crit_ptr->MA_MAX;
if (crit_ptr->MOV > crit_ptr->MV_MAX)
@@ -567,27 +579,34 @@
//log("In do_regeneration_smobs\n");
while ((crit_ptr = crit_cell.next())) {
+
+ //no regen if we're fighting
+ if ( crit_ptr->isFighting() ) {
+ continue;
+ }
posn_mod = (2.0 + crit_ptr->POS) / 4.0;
-
+
// if we are affected by remove hope we get no hp
if ( ! (is_affected_by(REMOVE_HOPE_SKILL_NUM, *crit_ptr)) ) {
crit_ptr->HP +=
- (int)(((crit_ptr->CON + 5.0) / 15.0) *
+ (int)(((((crit_ptr->CON + 5.0) / 15.0) *
(crit_ptr->HP_MAX / 9.0) *
- posn_mod * (crit_ptr->HP_REGEN / 100.0) * adj + 10.0);
+ posn_mod * (crit_ptr->HP_REGEN / 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->MA_MAX / 7.0) * (crit_ptr->MA_REGEN / 100.0) * adj + 4.0);
+ (int)(((((crit_ptr->INT + 5.0) / 16.0) * posn_mod *
+ (crit_ptr->MA_MAX / 7.0) * (crit_ptr->MA_REGEN / 100.0) * adj +
+ 4.0)/6.0)+1.0);
}
crit_ptr->MOV +=
- (int)(((crit_ptr->DEX + 5.0) / 16.0) * posn_mod *
+ (int)(((((crit_ptr->DEX + 5.0) / 16.0) * posn_mod *
adj *
- (crit_ptr->MV_MAX / 2.0) * (crit_ptr->MV_REGEN / 100.0) + 5.0);
+ (crit_ptr->MV_MAX / 2.0) * (crit_ptr->MV_REGEN / 100.0) +
+ 5.0)/6.0)+1.0);
if (crit_ptr->HP > crit_ptr->HP_MAX)
crit_ptr->HP = crit_ptr->HP_MAX;
@@ -2105,7 +2124,7 @@
//already done it.
continue;
} else if ( item_counts[id_num] > 1 ) {
- Sprintf(qty_str, "(%ix) ", item_counts[id_num]);
+ Sprintf(qty_str, "(%i%s) ", item_counts[id_num], "x");
} else {
qty_str = "";
}
@@ -2167,7 +2186,7 @@
//already done it.
continue;
} else if ( item_counts[id_num] > 1 ) {
- Sprintf(qty_str, "(%ix) ", item_counts[id_num]);
+ Sprintf(qty_str, "(%i%s) ", item_counts[id_num], "x");
} else {
qty_str = "";
}
More information about the ScryMUD
mailing list