Exemple #1
0
        public override void MapLoaded(Map map)
        {
            base.MapLoaded(map);

            CompatabilityAddMissingWaterTags();
            AddDefaultFishableTags();
            AddDefaultWaterAffordances();
            Logger.Message("MapLoaded: Fishable terrain options: " + string.Join(", ", FetchFishingTagged().ConvertAll <string>(t => t.ToString()).ToArray()));

            // Cleanup extra dolphins
            foreach (Thing d in map.GetDirectlyHeldThings().Where((Thing t) => (t as DolphinAway) != null))
            {
                Logger.Message("Caught a lazy dolphin... teleporting off-world");
                d.Destroy();
            }

            IntVec3?launchPoint = RandomFishable(map);

            if (launchPoint.HasValue)
            {
                Logger.Message("Humans are here... so long and thanks for all the fish @ (" + launchPoint + ")");
                DolphinAway dolphin = (DolphinAway)ThingMaker.MakeThing(ThingDef.Named("DolphinAway"), null);
                // Needs his fish before leaving...
                Thing fish = ThingMaker.MakeThing(ThingDef.Named("DeadFish"));
                dolphin.innerContainer.TryAdd(fish);
                this.dolphinLeaving = (DolphinAway)SkyfallerMaker.MakeSkyfaller(ThingDef.Named("DolphinAway"), dolphin);
                GenSpawn.Spawn(this.dolphinLeaving, launchPoint.GetValueOrDefault(), map);
            }
        }
Exemple #2
0
 public override void Tick(int currentTick)
 {
     base.Tick(currentTick);
     if (this.dolphinLeaving != null)
     {
         if (this.dolphinLeaving.Destroyed)
         {
             this.dolphinLeaving = null;
         }
         else
         {
             this.dolphinLeaving.Tick();
         }
     }
 }