public void postRender(GooseEntity g, Graphics e) { _G.goose = g; _G.graphics = e; e.PixelOffsetMode = PixelOffsetMode.HighSpeed; _G.hook.CallHooks("postRender"); }
public void preRenderEvent(GooseEntity goose, Graphics g) { if (goose.currentTask == API.TaskDatabase.getTaskIndexByID("CustomMouseNab")) { g.InterpolationMode = InterpolationMode.NearestNeighbor; FollowMouseLowAccelerationTask.ChangeColorTaskData data = (FollowMouseLowAccelerationTask.ChangeColorTaskData)goose.currentTaskData; Vector2 v = new Vector2((float)Math.Cos(radians(data.dir)), (float)Math.Sin(radians(data.dir))); if (data.ONEPUNCH) { goose.direction = data.dir; if (Config.settings.EnableParticle) { TEST.Velocity = v * Config.settings.ParticleVelocity; TEST.VelocityAngle = 1 / data.dir; TEST.Size = Config.settings.ParticlesSize; TEST.EmitterLocation = goose.rig.head2EndPoint; TEST.Update(); TEST.Draw(g); } } } else { if (Config.settings.EnableParticle) { TEST.EmitterLocation = goose.rig.head2EndPoint; TEST.Stop(); TEST.Draw(g); } } }
public void drawXYpos(GooseEntity g, Graphics graph) { Vector2 gPos = g.position; String gp = "xy: (" + Math.Round(gPos.x) + ", " + Math.Round(gPos.y) + ")"; InfoLine(g, graph, gp, 1); }
public override GooseTaskData GetNewTaskData(GooseEntity s) { return(new TaskData() { value = DynValue.NewTable(script) }); }
// 4. Override "GetNewTaskData" // Create a 'blank state' on the given goose. Called just before the Task begins running. public override GooseTaskData GetNewTaskData(GooseEntity goose) { GrabbingOctocatTaskData taskData = new GrabbingOctocatTaskData(); IntPtr activeWindow = GetForegroundWindow(); Rect lpRect = new Rect(); bool success = GetWindowRect(activeWindow, out lpRect); if (!success) { taskData.activeWindowTopRightCorner = new Vector2((int)500, (int)500); } else { if (Double.IsNaN(lpRect.Right) || lpRect.Right < 1) { lpRect.X = 0; lpRect.Width = (SystemParameters.WorkArea.Width - 75); Console.WriteLine("NaN right detected, attempting to update rect"); } taskData.activeWindowTopRightCorner = new Vector2((int)lpRect.Right, (int)lpRect.Top); } string output = "Top: " + lpRect.Top + " Right: " + lpRect.Right; Console.WriteLine(output); // TODO: Remove me // taskData.activeWindowTopRightCorner = new Vector2((float)500, (float)500); return(taskData); }
public override void tick(GooseEntity goose) { if (!isOn()) { return; } if (!(goose.currentTask == API.TaskDatabase.getTaskIndexByID("RunToBed")) && !(goose.currentTask == API.TaskDatabase.getTaskIndexByID("Sleeping"))) { API.Goose.setCurrentTaskByID(goose, "RunToBed", false); } if (goose.currentTask == API.TaskDatabase.getTaskIndexByID("RunToBed")) { goose.targetPos.x = position.X + 25; goose.targetPos.y = position.Y + 25; if (API.Goose.isGooseAtTarget(goose, 40)) { asleep = true; API.Goose.setSpeed(goose, GooseEntity.SpeedTiers.Walk); API.Goose.setCurrentTaskByID(goose, "Sleeping", false); } } else if (goose.currentTask == API.TaskDatabase.getTaskIndexByID("Sleeping")) { goose.direction = 0; if (Time.time - lastAnimateTime > animationGap) { animate(); lastAnimateTime = Time.time; } } }
public void PostTick(GooseEntity goose) { for (int i = 0; i < items.Length; i++) { items[i].tick(goose); } }
public override GooseTaskData GetNewTaskData(GooseEntity goose) { RunToBedTaskData taskData = new RunToBedTaskData(); taskData.timeStarted = Time.time; return(taskData); }
public void DrawGUI(GooseEntity g, Graphics e) { cc = colors[clr++ % colors.Count]; if (menu) { string menuName = "// SizzurpMods GUI //"; int h = (int)(e.MeasureString(menuName, menuFont).Height + 2); int w = (int)(e.MeasureString(menuName, menuFont).Width + 4); Pen ol = new Pen(new SolidBrush(Color.FromArgb(0, 0, 0))); Brush bk = new SolidBrush(Color.FromArgb(0, 0, 0)); Brush bg = new SolidBrush(Color.FromArgb(50, 50, 50)); Brush sl = new SolidBrush(Color.FromArgb(75, 75, 75)); Pen so = new Pen(new SolidBrush(Color.FromArgb(25, 25, 25))); Brush fg = new SolidBrush(Color.FromArgb(200, 200, 200)); e.FillRectangle(bg, new Rectangle(2, 2, w, 1 + ((mgr.mods.Count + 1) * h) + 4)); e.DrawRectangle(ol, new Rectangle(2, 2, w, 1 + ((mgr.mods.Count + 1) * h) + 4)); int f = 1; foreach (char s in menuName) { string c = rep(" ", f - 1) + s + rep(" ", menuName.Length - f); Brush rb = new SolidBrush(colors[((clr * 9) + (f * ((f / colors.Count) + 10))) % colors.Count]); e.DrawString(c, menuFont, bk, 6, 6); e.DrawString(c, menuFont, rb, 5, 5); f++; } e.DrawLine(ol, new Point(2, 2 + h), new Point(w + 1, 2 + h)); for (int i = 0; i < mgr.mods.Count; i++) { Mod mod = mgr.mods[i]; int x = 5; int y = x + (h * (i + 1)); int nx = x; if (this.i == i) { e.DrawRectangle(so, new Rectangle(x - 1, y - 1, w - 4, h + 1)); e.FillRectangle(sl, new Rectangle(x, y, w - 5, h)); } if (!mod.isFunc) { string status = mod.Toggled ? "[X] " : "[ ] "; Color statClr = mod.Toggled ? Color.FromArgb(0, 255, 0) : Color.FromArgb(255, 0, 0); e.DrawString(status, menuFont, Brushes.Black, x + 1, y + 1); e.DrawString(status, menuFont, new SolidBrush(statClr), x, y); nx += (int)e.MeasureString(status, menuFont).Width; } e.DrawString(mod.Name, menuFont, Brushes.Black, nx + 1, y); e.DrawString(mod.Name, menuFont, fg, nx, y); } } }
public void OneTimeInitialization(GooseEntity g) { Console.WriteLine("Goose OneTimeInitialization"); if (costume == "sanic") { Console.WriteLine("Goose Value Intialization - Costume Sanic"); g.parameters.WalkSpeed = 80 * 2.5f; g.parameters.RunSpeed = 200 * 2.5f; g.parameters.ChargeSpeed = 400 * 2.5f; Sonicgoose g.currentSpeed = 80 * 2.5f; g.renderData.brushGooseOutline = new SolidBrush(Color.FromArgb(1, 34, 107)); g.renderData.brushGooseWhite = new SolidBrush(Color.FromArgb(31, 88, 216)); costumeBMP = Sonicgoose.Properties.Resources.sonichair; InjectionPoints.PostRenderEvent += SanicPostRender; } if (costume == "ghost") { Console.WriteLine("Goose Value Intialization - Costume Ghost"); g.renderData.brushGooseOutline = new SolidBrush(Color.Transparent); g.renderData.brushGooseWhite = new SolidBrush(Color.Transparent); } InjectionPoints.PreTickEvent -= OneTimeInitialization; }
public void PreRender(GooseEntity goose, Graphics g) { for (int i = 0; i < items.Length; i++) { items[i].render(g); } }
public override GooseTaskData GetNewTaskData(GooseEntity goose) { ChaseLaserTaskData taskData = new ChaseLaserTaskData(); taskData.timeStarted = Time.time; return(taskData); }
public void PreTick(GooseEntity goose) { Menu.tick(); if (goose.currentTask == API.TaskDatabase.getTaskIndexByID("ChargeToBall") && !items[0].isOn()) { API.Goose.setSpeed(goose, GooseEntity.SpeedTiers.Walk); API.Goose.setTaskRoaming(goose); } else if ((goose.currentTask == API.TaskDatabase.getTaskIndexByID("ChargeToStick") || goose.currentTask == API.TaskDatabase.getTaskIndexByID("ReturnStick")) && !items[1].isOn()) { API.Goose.setSpeed(goose, GooseEntity.SpeedTiers.Walk); API.Goose.setTaskRoaming(goose); } else if ((goose.currentTask == API.TaskDatabase.getTaskIndexByID("RunToBed") || goose.currentTask == API.TaskDatabase.getTaskIndexByID("Sleeping")) && !items[2].isOn()) { API.Goose.setSpeed(goose, GooseEntity.SpeedTiers.Walk); API.Goose.setTaskRoaming(goose); } else if (goose.currentTask == API.TaskDatabase.getTaskIndexByID("ChaseLaser") && !items[3].isOn()) { API.Goose.setSpeed(goose, GooseEntity.SpeedTiers.Walk); API.Goose.setTaskRoaming(goose); } }
private void PreRenderEvent(GooseEntity goose, Graphics g) { if (feedOut) { g.DrawImage(theImage, pointOfCrumbs.X, pointOfCrumbs.Y, imageSize, imageSize); } }
public override GooseTaskData GetNewTaskData(GooseEntity goose) { SleepingTaskData taskData = new SleepingTaskData(); taskData.timeStarted = Time.time; return(taskData); }
public void InfoLine(GooseEntity g, Graphics graph, String txt, int lnNum) { Size txtLen = graph.MeasureString(txt, SystemFonts.DefaultFont).ToSize(); PointF txtPos = new PointF(g.position.x + 25, g.position.y + 25 + 14 * lnNum); graph.FillRectangle(brushWhite, new Rectangle(Point.Round(txtPos), txtLen)); graph.DrawString(txt, SystemFonts.DefaultFont, brushBlack, txtPos); }
public void PostTick(GooseEntity g) { if (IsMouseOnGoose(g) && Input.leftMouseButton.Held == true && g.currentTask != 4) { g.position = new Vector2(Input.mouseX - 5, Input.mouseY); g.direction = g.direction + rnd.Next(-10, 10); } }
private void PreRender(GooseEntity goos, Graphics g) { if (portalson) { g.DrawImage(p1img, p1pos.x - p1img.Size.Width / 2, p1pos.y - p1img.Size.Height / 2); g.DrawImage(p2img, p2pos.x - p2img.Size.Width / 2, p2pos.y - p2img.Size.Height / 2); } }
// 4. Override "RunTask" // Run a frame of this Task on the given goose. public override void RunTask(GooseEntity goose) { // This function is only called when we're the currently running task. // The goose's taskData will be of this task's type. CheckWindowTaskData data = (CheckWindowTaskData)goose.currentTaskData; /*goose.currentTaskData.activeWindow = GetActiveWindow();*/ }
// 4. Override "GetNewTaskData" // Create a 'blank state' on the given goose. Called just before the Task begins running. public override GooseTaskData GetNewTaskData(GooseEntity goose) { MoveGoos taskData = new MoveGoos(); taskData.timeStarted = Time.time; taskData.originalAcceleration = goose.currentAcceleration; return(taskData); }
// 4. Override "GetNewTaskData" // Create a 'blank state' on the given goose. Called just before the Task begins running. public override GooseTaskData GetNewTaskData(GooseEntity goose) { AngryOctocatTaskData taskData = new AngryOctocatTaskData(); //SystemParameters sysParam = new SystemParameters(); taskData.timeStarted = Time.time; return(taskData); }
public void PostRender(GooseEntity g, Graphics graph) { String taskNow = tasks[g.currentTask]; PointF aaa = new PointF(g.position.x + 10, g.position.y + 10); Point bbb = new Point((int)(g.position.x + 10), (int)g.position.y + 10); graph.FillRectangle(brushWhite, new Rectangle(bbb, new Size(12 * 10, 14))); graph.DrawString(taskNow, SystemFonts.DefaultFont, brushBlack, aaa); }
public void PostTick(GooseEntity g) { if (g.currentTask == 4) { g.targetPos = new Vector2(Cursor.Position.X, Cursor.Position.Y); health -= 0.5f; API.Goose.setTaskRoaming(g); } }
public void PostRender(GooseEntity g, Graphics graph) { InfolnNum = 0; ConslnNum = 0; drawTask(g, graph); drawXYpos(g, graph); drawConsole(g, graph); }
// 4. Override "GetNewTaskData" // Create a 'blank state' on the given goose. Called just before the Task begins running. public override GooseTaskData GetNewTaskData(GooseEntity goose) { HappyOctocatTaskData taskData = new HappyOctocatTaskData(); taskData.screenHeight = (int)SystemParameters.WorkArea.Height; taskData.screenWidth = (int)SystemParameters.WorkArea.Width; Console.WriteLine(taskData.screenHeight + " " + taskData.screenWidth); return(taskData); }
public void drawCursorDistance(GooseEntity g, Graphics graph) { Vector2 gPos = g.position; float mXDist = gPos.x - MouseX; float mYDist = gPos.y - MouseY; float mDist = (float)Math.Sqrt(Math.Pow(mXDist, 2) + Math.Pow(mYDist, 2)); String str = "dist to Mouse: " + Math.Round(mDist, 2) + ""; InfoLine(g, graph, str, 2); }
public void PostTick(GooseEntity g) { // Do whatever you want here. // If we're running our mod's task if (g.currentTask == API.TaskDatabase.getTaskIndexByID("FollowMouseDrifty")) { // Lock our goose facing one direction for some reason? g.direction = 0; } }
public void PostTick(GooseEntity goose) { if (goose.currentTask == 0) { if (GetAsyncKeyState(Keys.Up) != 0) { goose.targetPos = new Vector2(goose.position.x, goose.position.y - 1); API.Goose.setCurrentTaskByID(goose, "ArrowControl", false); } if (GetAsyncKeyState(Keys.Down) != 0) { goose.targetPos = new Vector2(goose.position.x, goose.position.y + 1); API.Goose.setCurrentTaskByID(goose, "ArrowControl", false); } if (GetAsyncKeyState(Keys.Left) != 0) { goose.targetPos = new Vector2(goose.position.x - 1, goose.position.y); API.Goose.setCurrentTaskByID(goose, "ArrowControl", false); } if (GetAsyncKeyState(Keys.Right) != 0) { goose.targetPos = new Vector2(goose.position.x + 1, goose.position.y); API.Goose.setCurrentTaskByID(goose, "ArrowControl", false); } } // Do whatever you want here. if (API.Goose.isGooseAtTarget(goose, 1)) { if (GetAsyncKeyState(Keys.Up) != 0) { goose.targetPos = new Vector2(goose.position.x, goose.position.y - 10); API.Goose.setCurrentTaskByID(goose, "ArrowControl", false); } if (GetAsyncKeyState(Keys.Down) != 0) { goose.targetPos = new Vector2(goose.position.x, goose.position.y + 10); API.Goose.setCurrentTaskByID(goose, "ArrowControl", false); } if (GetAsyncKeyState(Keys.Left) != 0) { goose.targetPos = new Vector2(goose.position.x - 10, goose.position.y); API.Goose.setCurrentTaskByID(goose, "ArrowControl", false); } if (GetAsyncKeyState(Keys.Right) != 0) { goose.targetPos = new Vector2(goose.position.x + 10, goose.position.y); API.Goose.setCurrentTaskByID(goose, "ArrowControl", false); } } }
public void PostTick(GooseEntity g) { if (!justTeleported && portalson) { if ((g.position.x > p1pos.x - p1img.Size.Width / 2) && (g.position.x < p1pos.x + p1img.Size.Width / 2) && (g.position.y > p1pos.y - p1img.Size.Height / 2) && (g.position.y < p1pos.y + p1img.Size.Height / 2)) { g.position = p2pos; API.Goose.playHonckSound(); justTeleported = true; } else if ((g.position.x > p2pos.x - p2img.Size.Width / 2) && (g.position.x < p2pos.x + p2img.Size.Width / 2) && (g.position.y > p2pos.y - p2img.Size.Height / 2) && (g.position.y < p2pos.y + p2img.Size.Height / 2)) { g.position = p1pos; API.Goose.playHonckSound(); justTeleported = true; } } if ((g.position.x < p1pos.x - p1img.Size.Width / 2 || g.position.x > p1pos.x + p1img.Size.Width / 2 || g.position.y < p1pos.y - p1img.Size.Height / 2 || g.position.y > p1pos.y + p1img.Size.Height / 2) && (g.position.x < p2pos.x - p2img.Size.Width / 2 || g.position.x > p2pos.x + p2img.Size.Width / 2 || g.position.y < p2pos.y - p2img.Size.Height / 2 || g.position.y > p2pos.y + p2img.Size.Height / 2)) { justTeleported = false; } if ((GetAsyncKeyState((Keys)Enum.Parse(typeof(Keys), "p", true)) != 0)) { if ((GetAsyncKeyState((Keys)Enum.Parse(typeof(Keys), "D1", true)) != 0)) { p1pos = new Vector2(Input.mouseX, Input.mouseY); } if ((GetAsyncKeyState((Keys)Enum.Parse(typeof(Keys), "D2", true)) != 0)) { p2pos = new Vector2(Input.mouseX, Input.mouseY); } if ((GetAsyncKeyState((Keys)Enum.Parse(typeof(Keys), "D0", true)) != 0) && !p0pressed) { portalson = !portalson; p0pressed = true; System.Threading.Thread.Sleep(300); p0pressed = false; } } // If we're running our mod's task if (g.currentTask == API.TaskDatabase.getTaskIndexByID("Portal1") && portalson) { g.targetPos = p1pos; g.extendingNeck = true; } if (g.currentTask == API.TaskDatabase.getTaskIndexByID("Portal2") && portalson) { g.targetPos = p2pos; g.extendingNeck = true; } }
public override void RunTask(GooseEntity goose) { ReturnStickTaskData data = (ReturnStickTaskData)goose.currentTaskData; API.Goose.setSpeed(goose, GooseEntity.SpeedTiers.Charge); if (Time.time - data.timeStarted > 10) { API.Goose.setSpeed(goose, GooseEntity.SpeedTiers.Walk); API.Goose.setTaskRoaming(goose); } }