]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/content_abm.cpp
Dynamic sky, fog and cloud colors; sun and moon
[dragonfireclient.git] / src / content_abm.cpp
index 63867b78b6baff9b8e07f2e386fc66e72031b100..3a92796a49eb8692415c34f30c99272877002af4 100644 (file)
@@ -88,119 +88,6 @@ class RemoveGrassABM : public ActiveBlockModifier
        }
 };
 
-class SpawnRatsAroundTreesABM : public ActiveBlockModifier
-{
-private:
-public:
-       virtual std::set<std::string> getTriggerContents()
-       {
-               std::set<std::string> s;
-               s.insert("tree");
-               s.insert("jungletree");
-               return s;
-       }
-       virtual float getTriggerInterval()
-       { return 10.0; }
-       virtual u32 getTriggerChance()
-       { return 200; }
-       virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n,
-                       u32 active_object_count, u32 active_object_count_wider)
-       {
-               if(active_object_count_wider != 0)
-                       return;
-
-               INodeDefManager *ndef = env->getGameDef()->ndef();
-               ServerMap *map = &env->getServerMap();
-               
-               v3s16 p1 = p + v3s16(myrand_range(-2, 2),
-                               0, myrand_range(-2, 2));
-               MapNode n1 = map->getNodeNoEx(p1);
-               MapNode n1b = map->getNodeNoEx(p1+v3s16(0,-1,0));
-               if(n1b.getContent() == ndef->getId("dirt_with_grass") &&
-                               n1.getContent() == CONTENT_AIR)
-               {
-                       v3f pos = intToFloat(p1, BS);
-                       ServerActiveObject *obj = new RatSAO(env, pos);
-                       env->addActiveObject(obj);
-               }
-       }
-};
-
-static void getMob_dungeon_master(Settings &properties)
-{
-       properties.set("looks", "dungeon_master");
-       properties.setFloat("yaw", 1.57);
-       properties.setFloat("hp", 30);
-       properties.setBool("bright_shooting", true);
-       properties.set("shoot_type", "fireball");
-       properties.set("shoot_y", "0.7");
-       properties.set("player_hit_damage", "1");
-       properties.set("player_hit_distance", "1.0");
-       properties.set("player_hit_interval", "0.5");
-       properties.setBool("mindless_rage", myrand_range(0,100)==0);
-}
-
-class SpawnInCavesABM : public ActiveBlockModifier
-{
-private:
-public:
-       virtual std::set<std::string> getTriggerContents()
-       {
-               std::set<std::string> s;
-               s.insert("stone");
-               s.insert("mossycobble");
-               return s;
-       }
-       virtual float getTriggerInterval()
-       { return 2.0; }
-       virtual u32 getTriggerChance()
-       { return 1000; }
-       virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n,
-                       u32 active_object_count, u32 active_object_count_wider)
-       {
-               if(active_object_count_wider != 0)
-                       return;
-
-               INodeDefManager *ndef = env->getGameDef()->ndef();
-               ServerMap *map = &env->getServerMap();
-
-               v3s16 p1 = p + v3s16(0,1,0);
-               MapNode n1a = map->getNodeNoEx(p1+v3s16(0,0,0));
-               if(n1a.getLightBlend(env->getDayNightRatio(), ndef) <= 3){
-                       MapNode n1b = map->getNodeNoEx(p1+v3s16(0,1,0));
-                       if(n1a.getContent() == CONTENT_AIR &&
-                                       n1b.getContent() == CONTENT_AIR)
-                       {
-                               v3f pos = intToFloat(p1, BS);
-                               int i = myrand()%5;
-                               if(i == 0 || i == 1){
-                                       actionstream<<"A dungeon master spawns at "
-                                                       <<PP(p1)<<std::endl;
-                                       Settings properties;
-                                       getMob_dungeon_master(properties);
-                                       ServerActiveObject *obj = new MobV2SAO(
-                                                       env, pos, &properties);
-                                       env->addActiveObject(obj);
-                               } else if(i == 2 || i == 3){
-                                       actionstream<<"Rats spawn at "
-                                                       <<PP(p1)<<std::endl;
-                                       for(int j=0; j<3; j++){
-                                               ServerActiveObject *obj = new RatSAO(
-                                                               env, pos);
-                                               env->addActiveObject(obj);
-                                       }
-                               } else {
-                                       actionstream<<"An oerkki spawns at "
-                                                       <<PP(p1)<<std::endl;
-                                       ServerActiveObject *obj = new Oerkki1SAO(
-                                                       env, pos);
-                                       env->addActiveObject(obj);
-                               }
-                       }
-               }
-       }
-};
-
 class MakeTreesFromSaplingsABM : public ActiveBlockModifier
 {
 private:
@@ -261,8 +148,6 @@ void add_legacy_abms(ServerEnvironment *env, INodeDefManager *nodedef)
 {
        env->addActiveBlockModifier(new GrowGrassABM());
        env->addActiveBlockModifier(new RemoveGrassABM());
-       env->addActiveBlockModifier(new SpawnRatsAroundTreesABM());
-       env->addActiveBlockModifier(new SpawnInCavesABM());
        env->addActiveBlockModifier(new MakeTreesFromSaplingsABM());
 }