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."); }
private void MainForm_Shown(object sender, EventArgs e) { // generate map Refs.p = new Player("The Protagonist", Color.Cyan); Refs.p.SetXY(32, 12); // todo fix hardcoded numbers Refs.h = new Harem(); Refs.m = new MazeGenerator().Create(65, 25); // draw initial map FlowMap.RemakeAllFlows(); UpdateMap(); GlowTest(); HelpPopup(); Player p = Refs.p; Cubi c = Refs.h.roster[0]; Announce("Welcome to the underworld. Look out, they're getting away!", p.myAlign, p.myColor); Announce("You'll never catch meeee!", c.myAlign, c.myColor); Announce("We'll see about that!", p.myAlign, p.myColor); Announce("Whee! *giggle*", c.myAlign, c.myColor); c = Refs.h.roster[1]; Announce("Run, Master! *nyhha!*", c.myAlign, c.myColor); c = Refs.h.roster[2]; Announce("Chase me Master! *hehe*", c.myAlign, c.myColor); Refs.p.UpdateInventory(); }
public List <Cubi> roster; // secure this, use GetId() instead. public Harem() { roster = new List <Cubi>(); Grimoire.Load("Beehive.grim"); // todo fix hardcoded numbers // todo simple AI while we refactor flow stuff Cubi a = new Cubi(1); Grimoire.FillCubi(a); a.SetXY(33, 9); roster.Add(a); Cubi b = new Cubi(2); Grimoire.FillCubi(b); b.SetXY(34, 9); roster.Add(b); Cubi c = new Cubi(3); Grimoire.FillCubi(c); c.SetXY(35, 9); roster.Add(c); Cubi d = new Cubi(4); Grimoire.FillCubi(d); d.SetXY(34, 8); roster.Add(d); }
public MainForm() { InitializeComponent(); // generate map map = new MazeGenerator().Create(65, 25); p = new Player(this, map); p.SetXY(1, 1); s = new Cubi(this, map, p); //s.SetXY(65 - 2, 25 - 2); s.SetXY(4, 3); // draw map var bitMapMap = map.AsBitmap(p, s); // add to window MainBitmap.Image = bitMapMap; // init key handlers sw = new Stopwatch(); sw.Start(); this.KeyPreview = true; eh = new PreviewKeyDownEventHandler(PreviewKeyDownHandler); this.PreviewKeyDown += eh; }
public Bitmap AsBitmap(Player p, Cubi s) { Bitmap bmp = new Bitmap((int)(800), (int)(400)); Graphics gr = Graphics.FromImage(bmp); // clear the canvas to dark Rectangle pgRect = new Rectangle(0, 0, bmp.Width, bmp.Height); SolidBrush solidBlack = new SolidBrush(Color.DarkSlateBlue); gr.FillRectangle(solidBlack, pgRect); // frame the image with a black border Rectangle rc = new Rectangle(5, 5, bmp.Width - 10, bmp.Height - 10); gr.DrawRectangle(new Pen(Color.White, 4), rc); // add floor stuff Flow fl = new Flow(this, p, s); fl.RemakeFlow(p.loc); for (int x = 0; x < xLen; x++) { for (int y = 0; y < yLen; y++) { var t = tiles[x, y]; AddChar(bmp, x, y, t.gly.ToString(), t.flow); } } AddChar(bmp, p.loc.X, p.loc.Y, "♂", 0); AddChar(bmp, s.loc.X, s.loc.Y, "☿", 0); return(bmp); }
} // end healwalls public bool Touching(Player p, Cubi s) { double a = Math.Pow(p.loc.X - s.loc.X, 2); double b = Math.Pow(p.loc.Y - s.loc.Y, 2); double c = Math.Sqrt(a + b); Console.WriteLine(c); return(c < 1.01); }
public static void FillCubi(Cubi c) { string idStr = c.myIdNo.ToString(); c.name = GetValueString(idStr, "CubiName"); c.glyph = GetValueString(idStr, "CubiChar"); c.myColor = GetValueColor(idStr, "CubiColor"); c.myStdAi = GetValueStdAi(idStr, "CubiStdAi"); c.myJbAi = GetValueJbAi(idStr, "CubiJbAi"); c.myHome = GetValueHome(idStr, "CubiHome"); }
private void AnimateMobile(MapTile activeTile, Cubi c) { // todo animation code is a bit makeshift and needs to be cleaned up andmoved to Map.cs // todo not going to be the right color for anything but pillows... Refs.m.CubiSingleTileUpdate(c); Refs.mf.Refresh(); Thread.Sleep(75); Refs.m.ResetTile(c.loc); Refs.mf.Refresh(); // todo also fix nectar drops. }
/// 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); }
/// 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); }
public Flow(Map mp, Player pl, Cubi cu) { m = mp; p = pl; c = cu; }
// point update for animations public void CubiSingleTileUpdate(Cubi c) { Image img = Refs.mf.MainBitmap.Image; TileDraw.AddCharMobile(img, c); }
/// 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(); }
/// player-throwing-pillow trajectory logic private void ThrowPillowMain(Loc vector) { Refs.mf.Announce("You throw a pillow!", myAlign, myColor); // can't throw without pillow! if (heldPillows <= 0) { return; } else { heldPillows--; UpdateInventory(); } // determine release point of throw // todo check for hit on very first tile -- where to put pillow? Loc startloc = Loc.AddPts(this.loc, vector); MapTile activeTile = Refs.m.TileByLoc(startloc); string pillowGlyph = "O"; // if the next tile now is a lover, extra spank stun! // todo consolidate long and short throws 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("POINT BLANK PILLOW SPANK!", myAlign, myColor); victim.Spanked += 5; Refs.mf.Announce("oww! *moan*", victim.myAlign, victim.myColor); } while (moveClear == "clear") { // blip activeTile with pillow symbol AnimatePillow(activeTile, pillowGlyph); // 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); } } // 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)); } } // leave pillow on ground to form new obstruction activeTile.clear = false; Refs.m.HealWalls(); Refs.mf.UpdateMap(); }