[ScryMUD] SVN Commit Info r760 - branches/people/gingon/weather/mud/grrmud/server

scrymud at wanfear.com scrymud at wanfear.com
Wed Dec 15 01:35:21 PST 2004


Author: gingon
Date: 2004-12-15 01:35:20 -0800 (Wed, 15 Dec 2004)
New Revision: 760

Modified:
   branches/people/gingon/weather/mud/grrmud/server/critter.h
   branches/people/gingon/weather/mud/grrmud/server/misc.cc
   branches/people/gingon/weather/mud/grrmud/server/weather.cc
Log:
Players and mobs with now wake up/break meditation when smacked by hail.



Modified: branches/people/gingon/weather/mud/grrmud/server/critter.h
===================================================================
--- branches/people/gingon/weather/mud/grrmud/server/critter.h	2004-12-15 04:58:18 UTC (rev 759)
+++ branches/people/gingon/weather/mud/grrmud/server/critter.h	2004-12-15 09:35:20 UTC (rev 760)
@@ -1028,7 +1028,7 @@
    int isResting() const { return POS == POS_REST; }
    int isStanding() const { return POS == POS_STAND; }
    int isSitting() const { return POS == POS_SIT; }
-   int isSleeping() const { return POS == POS_SLEEP; }
+   bool isSleeping() const { if(POS == POS_SLEEP) return true; else return false;  }
    int isStunned() const { return POS == POS_STUN; }
    int isMeditating() const { return POS == POS_MED; }
    int isPossessed() const { return (possessed_by > 0); }

Modified: branches/people/gingon/weather/mud/grrmud/server/misc.cc
===================================================================
--- branches/people/gingon/weather/mud/grrmud/server/misc.cc	2004-12-15 04:58:18 UTC (rev 759)
+++ branches/people/gingon/weather/mud/grrmud/server/misc.cc	2004-12-15 09:35:20 UTC (rev 760)
@@ -480,9 +480,10 @@
 
    while ((crit_ptr = crit_cell.next())) {
 
-      env_mod = weather_regen_mods[crit_ptr->getCurRoom()->getWeather()] *
-         temperature_regen_mods[crit_ptr->getCurRoom()->getTemperature()];
-      
+   /*   if(crit_ptr->getCurRoom()){
+         env_mod = weather_regen_mods[crit_ptr->getCurRoom()->getWeather()] *
+            temperature_regen_mods[crit_ptr->getCurRoom()->getTemperature()];
+      }*/
       //no regen if we're fighting
       if ( crit_ptr->isFighting() ) {
          continue;

Modified: branches/people/gingon/weather/mud/grrmud/server/weather.cc
===================================================================
--- branches/people/gingon/weather/mud/grrmud/server/weather.cc	2004-12-15 04:58:18 UTC (rev 759)
+++ branches/people/gingon/weather/mud/grrmud/server/weather.cc	2004-12-15 09:35:20 UTC (rev 760)
@@ -359,7 +359,7 @@
       while((pc = cll.next())){
          if(!pc->isImmort() || !pc->isNoHassle()){
             rm = pc->getCurRoom();
-            if(rm->getWeather() == hail){
+            if(rm->getWeather() == hail && rm->hasWeather()){
                if((rand()%20 + 1)>prob){
                   if(d(1,pc->DEX) > d(1,20)){
                      Cell<critter*> rcll(rm->getCrits()); //holds mob        s in room
@@ -369,26 +369,68 @@
                         case 1:
                         case 2:
                         case 3:
-                           pc->show("A small piece of hail hits you!\n");
-                           while((crit_ptr = rcll.next())){
-                              if(crit_ptr != pc){
-                                 Sprintf(buf, "A small piece of hails hits %S!\n",
+                           if(pc->isSleeping()){
+                              pc->setPosn(POS_REST);
+                              pc->show("You are awakened by a piece of hail hitting you!\n");                          
+                              while((crit_ptr = rcll.next())){
+                                 if(crit_ptr != pc){
+                                     Sprintf(buf, "%S is woken up by being hit with a piece of hail!\n",
+                                     pc->getName(crit_ptr->SEE_BIT));
+                                     crit_ptr->show(buf);
+                                  }
+                              }
+                           }else if(pc->isMeditating()){
+                              pc->setPosn(POS_REST);
+                              pc->show("Your meditation is broken by a stinging sensation!\n"); 
+                              while((crit_ptr = rcll.next())){
+                                 if(crit_ptr != pc){
+                                    Sprintf(buf, "%S's meditation is broken by a small piece of hail!!\n",
+                                    pc->getName(crit_ptr->SEE_BIT));
+                                    crit_ptr->show(buf);
+                                 }
+                              }
+                           }else{
+                              pc->show("A small piece of hail hits you!\n");
+                              while((crit_ptr = rcll.next())){
+                                 if(crit_ptr != pc){
+                                    Sprintf(buf, "A small piece of hails hits %S!\n",
                                        pc->getName(crit_ptr->SEE_BIT));
-                                 crit_ptr->show(buf);
+                                       crit_ptr->show(buf);
+                                    }
+                                 }
                               }
-                           }
                            break;
                         case 4:
                         case 5:
-                           pc->show("A small piece of hail hits you!\n");
-                           while((crit_ptr = rcll.next())){
+                           if(pc->isSleeping()){
+                              pc->setPosn(POS_REST);
+                              pc->show("You are awakened by a stringing sensation!\n");
+                              while((crit_ptr = rcll.next())){
                               if(crit_ptr != pc){
-                                 Sprintf(buf, "A small piece of hails hits %S!\n",
-                                       pc->getName(crit_ptr->SEE_BIT));
-                                 crit_ptr->show(buf);
+                                    Sprintf(buf, "%S is woken up by being hit with a large piece of hail!\n",
+                                    pc->getName(crit_ptr->SEE_BIT));
+                                    crit_ptr->show(buf);
+                                 }
                               }
+                           }else if(pc->isMeditating()){
+                              pc->setPosn(POS_REST);
+                              pc->show("A stinging sensation breaks your meditation\n");
+                              if(crit_ptr != pc){
+                                    Sprintf(buf, "%S's meditation is disrupted by a large peice of hail !\n",
+                                    pc->getName(crit_ptr->SEE_BIT));
+                                    crit_ptr->show(buf);
+                              }
+                           }else{
+                              pc->show("A large piece of hail hits you!\n");
+                              while((crit_ptr = rcll.next())){
+                                 if(crit_ptr != pc){
+                                    Sprintf(buf, "A large piece of hails hits %S!\n",
+                                          pc->getName(crit_ptr->SEE_BIT));
+                                    crit_ptr->show(buf);
+                                 }
+                              }
                            }
-                           break;  
+                          break;
                      }
                   } else {
                      Cell<critter*> rcll(rm->getCrits()); //holds mobs in room




More information about the ScryMUD mailing list