Esempio n. 1
0
        public void RemakeFlow()
        {
            //var sw = new Stopwatch(); sw.Start();

            // target tiles get a .flow of 0, tiles 1 square from target
            //    get a .flow of 1, tiles 2 out get a .flow of 2, etc...
            // So to navigate to a target tile, just pick a tile with less
            //    flow value than where you currently are.

            // tidy up values from previous runs
            SetToNines();

            // use myAi from here
            if (level > 0)             // don't do player flow yet
            {
                // which cubi are we doing this for?
                Cubi c = Harem.GetId(level);

                if (c.doJailBreak)
                {
                    c.myJbAi(c.TeaseDistance, this);
                }
                else
                {
                    c.myStdAi(c.TeaseDistance, this);
                }
            }

            // report time
            //Console.WriteLine("Finished this flow in " + sw.ElapsedMilliseconds + "ms.");
        }
Esempio n. 2
0
        public static void AddBackgroundStuff(Image img, MapTile t)
        {
            int x1 = (t.loc.X * FrameData.multX) + FrameData.edgeX;
            int y1 = (t.loc.Y * FrameData.multY) + FrameData.edgeY;

            if (t.clear)              // set flow as background only
            {
                int showFlow = Refs.p.viewFlow;

                if (showFlow > 0)
                {
                    Color flowCol = Harem.GetId(showFlow).myColor;

                    double flowInt = Refs.m.flows[showFlow].TileByLoc(t.loc).flow;

                    int r = ByteLimit(Convert.ToInt32(flowCol.R - flowInt * 4));
                    int g = ByteLimit(Convert.ToInt32(flowCol.G - flowInt * 4));
                    int b = ByteLimit(Convert.ToInt32(flowCol.B - flowInt * 4));

                    Color useCol = Color.FromArgb(r, g, b);

                    using (var gFlow = Graphics.FromImage(img))
                    {
                        // Create a rectangle for the working area on the map
                        RectangleF tileRect = new RectangleF(x1, y1, FrameData.multX, FrameData.multY);
                        using (var flowBrush = new SolidBrush(useCol))
                        {
                            gFlow.FillRectangle(flowBrush, tileRect);
                        }
                    }
                }
                else                 // show player los instead
                {
                    Color losCol = t.backCol;
                    Color hidCol = Color.DarkBlue;

                    Color useCol = t.los ? losCol : hidCol;

                    using (var gFlow = Graphics.FromImage(img))
                    {
                        // Create a rectangle for the working area on the map
                        RectangleF tileRect = new RectangleF(x1, y1, FrameData.multX, FrameData.multY);
                        using (var flowBrush = new SolidBrush(useCol))
                        {
                            gFlow.FillRectangle(flowBrush, tileRect);
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        /// fun class for manually spanking a held cubi

        private int CaneHeld()
        {
            MapTile here    = Refs.m.TileByLoc(loc);
            Cubi    partner = Harem.GetId(heldCubiId);

            // todo different text on repeat spankings.
            Refs.mf.Announce("Time for discpline!", myAlign, myColor);
            Refs.mf.Announce("Yes! I mean no! I mean yes! Owwwww!", partner.myAlign, partner.myColor);

            partner.Spanked += 15;
            partner.AddHorny(5);

            Refs.mf.Announce("I think I'll stay put... for now.", partner.myAlign, partner.myColor);

            return(2);
        }
Esempio n. 4
0
        /// fun class for f*****g a held cubi

        private int BoinkHeld()
        {
            MapTile here    = Refs.m.TileByLoc(loc);
            Cubi    partner = Harem.GetId(heldCubiId);

            AddHorny(5);
            partner.AddHorny(5);

            // todo consolidating o*****s.
            // todo more / better descriptions.
            int timepass = 0;

            if (GetHorny() > 15 && partner.GetHorny() > 15)             // cumming together
            {
                Refs.mf.Announce("Ohhh Yes! Yes! *splurt* (together)", partner.myAlign, partner.myColor);
                Refs.mf.Announce("Awwww yeah! *splurt* (together)", myAlign, myColor);
                timepass = 8;

                MainMap.SplurtNectar(here, partner.myIdNo);
                MainMap.SplurtNectar(here, myIndex: 0);

                partner.AddHorny(-10);
                AddHorny(-10);
            }
            else if (partner.GetHorny() > 15)             // partner only o****m
            {
                Refs.mf.Announce("Ohhh Yes! Yes! *splurt*", partner.myAlign, partner.myColor);
                timepass = 1;
                MainMap.SplurtNectar(here, partner.myIdNo);
                partner.AddHorny(-10);
            }
            else if (GetHorny() > 15)             // player only o****m
            {
                Refs.mf.Announce("Awwww yeah! *splurt*", myAlign, myColor);
                timepass = 5;
                MainMap.SplurtNectar(here, myIndex: 0);
                AddHorny(-10);
            }
            else             // nobody cums (yet)
            {
                Refs.mf.Announce("Loud boinking noises...", myAlign, myColor);
                timepass = 1;
            }

            return(timepass);
        }
Esempio n. 5
0
        public static void AddForegroundStuff(Image img, MapTile t)
        {
            int x1 = (t.loc.X * FrameData.multX) + FrameData.edgeX;
            int y1 = (t.loc.Y * FrameData.multY) + FrameData.edgeY;

            if (t.clear)              // set flow as background only
            {
                int showFlow = Refs.p.viewFlow;

                // display nectar drops using deepest level
                int deepestLevel = 0;
                int deepestAmt   = 0;
                int sumAmt       = 0;
                for (int nLoop = 0; nLoop < t.nectarLevel.Length; nLoop++)
                {
                    sumAmt += t.nectarLevel[nLoop];
                    if (t.nectarLevel[nLoop] > deepestAmt)
                    {
                        deepestAmt   = t.nectarLevel[nLoop];
                        deepestLevel = nLoop;
                    }
                }
                if (deepestAmt > 0)
                {
                    using (var gNectar = Graphics.FromImage(img))
                    {
                        Color nectarCol;
                        if (deepestLevel == 0)
                        {
                            nectarCol = Refs.p.myColor;
                        }
                        else
                        {
                            nectarCol = Harem.GetId(deepestLevel).myColor;
                        }

                        // Color mixedCol = GetColorMix(t);

                        if (sumAmt > 8)
                        {
                            sumAmt = 8;
                        }
                        string useNectarChar = nectarChars[sumAmt];
                        //if (sumAmt > 1) { useNectarChar = nectarCharLarge; }

                        gNectar.DrawImage(
                            SpriteManager.GetSprite(useNectarChar, Refs.m.stdSize, nectarCol, t.backCol),
                            x1, y1);
                    }
                }
                // todo bigger blob for more nectar maybe?
            }
            else             // it's not marked as clear, so draw the wall
            {
                Bitmap singleTileImage = SpriteManager.GetSprite(t.gly, Refs.m.stdSize, Color.White, t.backCol);
                using (var gChar = Graphics.FromImage(img))
                {
                    gChar.DrawImage(singleTileImage, x1, y1);
                }
            }
        }
Esempio n. 6
0
        public bool noTunnel = false;     // only for maze gen

        public MapTile(Loc p, MainMap f) : base(p, f)
        {
            nectarLevel = new int[1 + Harem.MaxId()];
        }
Esempio n. 7
0
        /// player-throwing-a-cubi trajectory logic

        private void ThrowCubiMain(Loc vector)
        {
            // todo lots of duplication here
            Player p          = Refs.p;
            Cubi   cubiThrown = Harem.GetId(p.heldCubiId);

            Refs.mf.Announce("You throw " + cubiThrown.name + " through the air!", myAlign, myColor);
            Refs.mf.Announce("*flap* *flap* *flap*", cubiThrown.myAlign, cubiThrown.myColor);
            cubiThrown.beingCarried = false;
            p.heldCubiId            = 0;

            // determine release point of throw
            // todo check for hit on very first tile
            Loc     startloc   = Loc.AddPts(loc, vector);
            MapTile activeTile = Refs.m.TileByLoc(startloc);

            // if very first tile is a holding pent, they can fly right over
            Loc zero = new Loc(0, 0);

            if (CheckClearForThrown(zero, activeTile) == "pent")
            {
                // oops you threw from too close
                Refs.mf.Announce("*desperate flapping* That was close, just made it over!", cubiThrown.myAlign, cubiThrown.myColor);
            }

            // if the next tile is another cubi, throw short
            // todo consolidate long and short throws
            // todo need to prevent throwing a cubi while ones already directly next to you
            string moveClear = CheckClearForThrown(vector, activeTile);

            if (moveClear == "cubi")
            {
                MapTile victimTile = Refs.m.TileByLoc(Loc.AddPts(activeTile.loc, vector));
                Cubi    victim     = Refs.m.CubiAt(victimTile.loc);

                Refs.mf.Announce("Owf!", cubiThrown.myAlign, cubiThrown.myColor);
                victim.Spanked += 5;

                Refs.mf.Announce("Oof too!", cubiThrown.myAlign, cubiThrown.myColor);
                cubiThrown.Spanked += 5;                 // and a good time was had by both
            }
            else if (moveClear == "pent")
            {
                // we just overflew a pent so consider her flight path clear for now
                moveClear = "clear";
            }

            // todo refresh player square so she's not superimposed on player square

            while (moveClear == "clear")
            {
                // blip activeTile with cubi symbol
                cubiThrown.loc = activeTile.loc;
                AnimateMobile(activeTile, cubiThrown);

                // is the next tile clear?
                moveClear = CheckClearForThrown(vector, activeTile);

                // nope, it has a cubi in.
                if (moveClear == "cubi")
                {
                    MapTile victimTile = Refs.m.TileByLoc(Loc.AddPts(activeTile.loc, vector));
                    Cubi    victim     = Refs.m.CubiAt(victimTile.loc);

                    MapTileSet escapes = new MapTileSet();

                    if (IsVertical(vector))
                    {
                        escapes = victimTile.GetPossibleMoves(Dir.DodgeVertical);
                    }
                    else
                    {
                        escapes = victimTile.GetPossibleMoves(Dir.DodgeHorizontal);
                    }

                    if (escapes.Count > 0)
                    {
                        victim.loc = MainMap.RandomFromList(escapes).loc;
                        Refs.mf.Announce("Nyahhh missed me!", victim.myAlign, victim.myColor);
                        moveClear = "clear";
                    }
                    else
                    {
                        victim.Spanked += 5;
                        Refs.mf.Announce("Owwwww!", victim.myAlign, victim.myColor);
                    }

                    // if it had a cubi, it could have moved revealing a holding pent
                    // so let's scan again
                    moveClear = CheckClearForThrown(vector, activeTile);
                }

                if (moveClear == "pent")
                {
                    // move one more tile
                    activeTile = Refs.m.TileByLoc(Loc.AddPts(vector, activeTile.loc));

                    Refs.mf.Announce("Eep! I'm caught!", cubiThrown.myAlign, cubiThrown.myColor);
                }

                // just a wall. stop here.
                if (moveClear == "wall")
                {
                    Refs.mf.Announce("You didn't hit anything interesting.", myAlign, myColor);
                }

                // it's clear, so move activeTile up and iterate
                if (moveClear == "clear")
                {
                    activeTile = Refs.m.TileByLoc(Loc.AddPts(vector, activeTile.loc));
                }
            }

            // deposit cubi here
            cubiThrown.loc = activeTile.loc;

            Refs.mf.UpdateMap();
        }