protected override void OrbwalkingEvents_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (args.Target != null && args.Target is Obj_AI_Hero && Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo) { var t = args.Target as Obj_AI_Hero; if (Spells[E].IsReady() && ComboUseE) { var pos = FindDashPosition(t); if (pos.IsValid()) { Spells[E].Cast(pos); return; } } } }
public static void AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (s_CheckAA) { s_CheckAA = false; CanCastAnimation = true; if(args.Target.IsValidTarget() && !Program.Champion.Spells[0].IsReady() && Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed) { if(Program.Champion.Spells[2].IsReady() && !Program.Champion.Spells[0].IsReady(1000) && Program.Champion.ConfigMenu.Item("HEMODE").GetValue<StringList>().SelectedIndex == 2) Program.Champion.Spells[2].Cast(ObjectManager.Player.ServerPosition + (args.Target.Position - ObjectManager.Player.ServerPosition).Normalized() * -Program.Champion.Spells[2].Range); } var t = Target.Get(Program.Champion.Spells[0].Range + 50, true); if (s_DoAttack && Program.Champion.Spells[0].IsReady()) { if (t != null && (Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo || Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed || Program.Champion.ConfigMenu.Item("CSHYKEY").GetValue<KeyBind>().Active)) { Program.Champion.Spells[0].Cast(t.ServerPosition + (t.ServerPosition - ObjectManager.Player.ServerPosition).Normalized() * 40); Program.Champion.Orbwalker.ResetAATimer(); Program.Champion.Orbwalker.ForcedTarget = t; } else if (Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.LaneClear) { var minion = MinionManager.GetMinions(400, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.MaxHealth).OrderBy(p => p.ServerPosition.Distance(ObjectManager.Player.ServerPosition)).FirstOrDefault(); if (minion != null) { if (minion.Health <= ObjectManager.Player.GetAutoAttackDamage(minion) * 2 && minion.IsJungleMinion()) SetAttack(false); else { Program.Champion.Spells[0].Cast(minion.ServerPosition); Program.Champion.Orbwalker.ResetAATimer(); Program.Champion.Orbwalker.ForcedTarget = t; } } } } else SetAttack(false); } }
protected override IEnumerable <bool> E_Draw() { Func <bool> f_移動 = SCommon.Supplier(this.移動()); Func <bool> f_攻撃 = SCommon.Supplier(this.攻撃()); for (; ;) { f_移動(); f_攻撃(); DDDraw.DrawCenter(Ground.I.Picture.Boss0003, this.X, this.Y); { const double WH = 192.0; const double CORNER_R = 30.0; this.Crash = DDCrashUtils.Multi( DDCrashUtils.Rect(new D4Rect( this.X - WH / 2.0 + CORNER_R, this.Y - WH / 2.0, WH - CORNER_R * 2.0, WH )), DDCrashUtils.Rect(new D4Rect( this.X - WH / 2.0, this.Y - WH / 2.0 + CORNER_R, WH, WH - CORNER_R * 2.0 )), DDCrashUtils.Circle(new D2Point(this.X - (WH / 2.0 - CORNER_R), this.Y - (WH / 2.0 - CORNER_R)), CORNER_R), DDCrashUtils.Circle(new D2Point(this.X + (WH / 2.0 - CORNER_R), this.Y - (WH / 2.0 - CORNER_R)), CORNER_R), DDCrashUtils.Circle(new D2Point(this.X + (WH / 2.0 - CORNER_R), this.Y + (WH / 2.0 - CORNER_R)), CORNER_R), DDCrashUtils.Circle(new D2Point(this.X - (WH / 2.0 - CORNER_R), this.Y + (WH / 2.0 - CORNER_R)), CORNER_R) ); } yield return(true); } }
protected override IEnumerable <bool> E_Draw() { // ---- game_制御 ---- if (Game.I.Status.InventoryFlags[GameStatus.Inventory_e.神奈子を倒した]) { yield break; } // ---- Func <bool> f_閉鎖 = SCommon.Supplier(this.E_閉鎖()); double targ_x = this.X; double targ_y = this.Y; this.X = Game.I.Map.W / 2.0; this.Y = -100.0; foreach (DDScene scene in DDSceneUtils.Create(120)) { f_閉鎖(); DDUtils.Approach(ref this.X, targ_x, 0.9); DDUtils.Approach(ref this.Y, targ_y, 0.9); bool facingLeft = Game.I.Player.X < this.X; DDDraw.DrawBegin(Ground.I.Picture2.Enemy_神奈子[0], this.X, this.Y); DDDraw.DrawSlide(20.0, 10.0); DDDraw.DrawZoom_X(facingLeft ? 1 : -1); DDDraw.DrawEnd(); // 当たり判定無し yield return(true); } Game.I.Enemies.Add(new Enemy_B神奈子0001(this.X, this.Y)); }
public override void Draw() { if (DDUtils.GetDistance(new D2Point(this.X, this.Y), new D2Point(Game.I.Player.X, Game.I.Player.Y)) < 50.0) { if (Game.I.FinalZone.OH_Event9003.Once()) { for (int x = 0; x < Game.I.Map.W; x++) { for (int y = 0; y < Game.I.Map.H; y++) { MapCell cell = Game.I.Map.GetCell(x, y); if ( cell.Kind == MapCell.Kind_e.DEATH || cell.Kind == MapCell.Kind_e.GOAL ) { cell.Kind = MapCell.Kind_e.WALL; } } } // 必要なイベント以外を除去 // Game.I.Enemies.RemoveAll(enemy => !( enemy is Enemy_Event9003B || enemy is Enemy_Event9004 || enemy is Enemy_Event9005 )); Game.I.Map.Design = new Design_0002(); //DDGround.EL.Add(SCommon.Supplier(Effects.Liteフラッシュ())); DDGround.EL.Add(SCommon.Supplier(Effects.Heavyフラッシュ())); DDMusicUtils.Stop(); } } }
protected override IEnumerable <bool> E_Draw() { double SCALE = LevelToScale(this.Level); double R = SCommon.ToInt(24.0 * SCALE); double yAdd = 0.0; // 初期位置調整 { this.X += (36.0 + R * (1 + 2 * this.Order)) * (this.FacingLeft ? -1 : 1); //this.Y += 0.0; } for (; ;) { yAdd -= (0.2 + 0.05 * this.Order) * SCALE; this.X += (4.0 + 0.5 * this.Order) * SCALE * (this.FacingLeft ? -1 : 1); this.Y += yAdd; DDDraw.SetBright(new I3Color(0, 192, 192)); DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(R * 2, R * 2); DDDraw.DrawEnd(); DDDraw.Reset(); DDPrint.SetDebug( (int)this.X - DDGround.ICamera.X - 12, (int)this.Y - DDGround.ICamera.Y - 8 ); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.Print("AS" + this.Level); DDPrint.Reset(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), R); yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), R)); // カメラから出たら消滅する。 } }
protected override IEnumerable <bool> E_Draw() { while (DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) // 画面内に入るまで休止する。 { yield return(true); } this.FacingLeft = Game.I.Player.X < this.X; DDPicture[] pictures = new DDPicture[] { Ground.I.Picture.Teki_a01_Fly01, Ground.I.Picture.Teki_a01_Fly02, Ground.I.Picture.Teki_a01_Fly03, Ground.I.Picture.Teki_a01_Fly02, }; Func <bool> f_attack = SCommon.Supplier(this.E_Attack()); for (int frame = 0; ; frame++) { f_attack(); const double SPEED = 4.0; this.X += this.FacingLeft ? -SPEED : SPEED; if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) { DDDraw.DrawBegin(pictures[frame / 8 % 4], this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawZoom_X(this.FacingLeft ? 1.0 : -1.0); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 12.0); } yield return(true); } }
protected override IEnumerable <bool> E_Draw() { double SCALE = LevelToScale(this.Level); double R = SCommon.ToInt(24.0 * SCALE); int yAddDir = 0; for (; ;) { if (yAddDir == 0) { this.X += 10.0 * (this.FacingLeft ? -1 : 1); yAddDir = this.索敵(R); } else { this.Y += 10.0 * yAddDir; } DDDraw.SetBright(new I3Color(0, 192, 255)); DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(R * 2, R * 2); DDDraw.DrawEnd(); DDDraw.Reset(); DDPrint.SetDebug( (int)this.X - DDGround.ICamera.X - 12, (int)this.Y - DDGround.ICamera.Y - 8 ); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.Print("MA" + this.Level); DDPrint.Reset(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), R); yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), R)); // カメラから出たら消滅する。 } }
public static IEnumerable <bool> E_フェードイン(IEnumerable <bool> e_draw, int frameMax = 150) { Func <bool> a_draw = SCommon.Supplier(e_draw); foreach (DDScene scene in DDSceneUtils.Create(frameMax)) { bool ret; using (GetScreen().Section()) { ret = a_draw(); } DDDraw.SetAlpha(scene.Rate); DDDraw.DrawSimple(GetScreen().ToPicture(), 0, 0); DDDraw.Reset(); yield return(ret); } for (; ;) { yield return(a_draw()); } }
/// <summary> /// マップファイル名からマップ名を得る。 /// 失敗すると、デフォルトのマップ名を返す。 /// </summary> /// <param name="mapFile">マップファイル名</param> /// <param name="defval">デフォルトのマップ名</param> /// <returns>マップ名</returns> public static string GetMapName(string mapFile, string defval) { if (!SCommon.StartsWithIgnoreCase(mapFile, MAP_FILE_PREFIX)) { return(defval); } mapFile = mapFile.Substring(MAP_FILE_PREFIX.Length); if (!SCommon.EndsWithIgnoreCase(mapFile, MAP_FILE_SUFFIX)) { return(defval); } mapFile = mapFile.Substring(0, mapFile.Length - MAP_FILE_SUFFIX.Length); if (mapFile == "") { return(defval); } return(mapFile); // as mapName }
public override void DrawPlayer() { double map_b = Game.I.Map.H * GameConsts.TILE_H; double pl_y = Game.I.Player.Y; double y = (map_b - 70) - pl_y; y /= 300.0; y = Math.Abs(y); if (y < 1.0) { DDDraw.SetAlpha(y); } DDDraw.DrawBegin( Ground.I.Picture.WhiteBox, SCommon.ToInt(Game.I.Player.X - DDGround.ICamera.X), SCommon.ToInt(Game.I.Player.Y - DDGround.ICamera.Y) ); DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H); DDDraw.DrawEnd(); DDDraw.Reset(); }
public void SetTile(string tileName) { int index = SCommon.IndexOf(TileCatalog.GetNames(), name => name == tileName); if (index == -1) { throw new DDError(); } for (int groupIndex = 0; groupIndex < LevelEditor.TileGroups.Count; groupIndex++) { for (int memberIndex = 0; memberIndex < LevelEditor.TileGroups[groupIndex].Members.Count; memberIndex++) { if (LevelEditor.TileGroups[groupIndex].Members[memberIndex].Index == index) { this.TileGroup.SelectedIndex = groupIndex; this.TileMember.SelectedIndex = memberIndex; return; } } } throw new DDError(); }
public static void Perform() { DDMain.KeepMainScreen(); DDCurtain.SetCurtain(0, 0.5); DDCurtain.SetCurtain(20); foreach (DDScene scene in DDSceneUtils.Create(40)) { 白黒効果.Perform(DDGround.KeptMainScreen); DDEngine.EachFrame(); } // Swap { DDSubScreen tmp = DDGround.KeptMainScreen; DDGround.KeptMainScreen = EL_Screen; EL_Screen = tmp; } DDGround.EL.Add(SCommon.Supplier(E_残像())); }
protected override void Invoke_02(string command, params string[] arguments) { int c = 0; if (command == "レイヤ毎の背景") { this.Act.AddOnce(() => this.ImageFile = @"dat\背景\Novel_背景_Floor" + Ground.I.CurrStageIndex + ".png"); } else if (command == "画像") { this.Act.AddOnce(() => this.ImageFile = arguments[c++]); } else if (command == "A") { this.Act.AddOnce(() => this.A = double.Parse(arguments[c++])); } else if (command == "スライド") { this.Act.AddOnce(() => { this.SlideRate = double.Parse(arguments[c++]); this.DestSlideRate = double.Parse(arguments[c++]); }); } else if (command == "フェードイン") { this.Act.Add(SCommon.Supplier(this.フェードイン())); } else if (command == "フェードアウト") { this.Act.Add(SCommon.Supplier(this.フェードアウト())); } else { throw new DDError(); } }
public override IEnumerable <bool> E_Draw() { Func <double> getA = SCommon.Supplier(WallCommon.E_GetA_フェードイン(this)); for (int frame = 0; ; frame++) { DDDraw.SetAlpha(getA()); { int slide = (int)((frame * 7L) % 180L); for (int dx = -slide; dx < DDConsts.Screen_W; dx += 180) { for (int dy = 0; dy < DDConsts.Screen_H; dy += 180) { DDDraw.DrawSimple(Ground.I.Picture.Wall0001, dx, dy); } } } { int slide = (int)((frame * 17L) % 90L); for (int dx = -slide; dx < DDConsts.Screen_W; dx += 90) { for (int dy = 0; dy < DDConsts.Screen_H; dy += 90) { DDDraw.DrawSimple(Ground.I.Picture.Wall0003, dx, dy); } } } DDDraw.Reset(); yield return(true); } }
/// <summary> /// <para>ファイルリストを取得する。</para> /// <para>ソート済み</para> /// <para>'_' で始まるファイルの除去済み</para> /// </summary> /// <returns>ファイルリスト</returns> public static IEnumerable <string> GetFiles() { IEnumerable <string> files; if (ReleaseMode) { files = File2ResInfo.Keys; } else { files = Directory.GetFiles(ResourceDir, "*", SearchOption.AllDirectories).Select(file => SCommon.ChangeRoot(file, ResourceDir)); // '_' で始まるファイルの除去 // makeDDResourceFile は '_' で始まるファイルを含めない。 files = files.Where(file => Path.GetFileName(file)[0] != '_'); } // ソート // makeDDResourceFile はファイルリストを sortJLinesICase している。 // ここでソートする必要は無いが、戻り値に統一性を持たせるため(毎回ファイルの並びが違うということのないように)ソートしておく。 files = SCommon.Sort(files, SCommon.CompIgnoreCase); return(files); }
private void カメラ位置調整(bool 一瞬で) { double targCamX = this.Player.X - DDConsts.Screen_W / 2 + (this.CamSlideX * DDConsts.Screen_W / 3); double targCamY = this.Player.Y - DDConsts.Screen_H / 2 + (this.CamSlideY * DDConsts.Screen_H / 3); DDUtils.ToRange(ref targCamX, 0.0, this.Map.W * GameConsts.TILE_W - DDConsts.Screen_W); DDUtils.ToRange(ref targCamY, 0.0, this.Map.H * GameConsts.TILE_H - DDConsts.Screen_H); // 不要 //if (this.Map.W * GameConsts.TILE_W - DDConsts.Screen_W < GameConsts.TILE_W) // ? カメラの横の可動域が1タイルより狭い場合 // targCamX = (this.Map.W * GameConsts.TILE_W - DDConsts.Screen_W) / 2; // 中心に合わせる。 if (this.Map.H * GameConsts.TILE_H - DDConsts.Screen_H < GameConsts.TILE_H) // ? カメラの縦の可動域が1タイルより狭い場合 targCamY = (this.Map.H * GameConsts.TILE_H - DDConsts.Screen_H) / 2; // 中心に合わせる。 DDUtils.Approach(ref DDGround.Camera.X, targCamX, 一瞬で ? 0.0 : 0.8); DDUtils.Approach(ref DDGround.Camera.Y, targCamY, 一瞬で ? 0.0 : 0.8); //DDUtils.ToRange(ref DDGround.Camera.X, 0.0, this.Map.W * Consts.TILE_W - DDConsts.Screen_W); //DDUtils.ToRange(ref DDGround.Camera.Y, 0.0, this.Map.H * Consts.TILE_H - DDConsts.Screen_H); DDGround.ICamera.X = SCommon.ToInt(DDGround.Camera.X); DDGround.ICamera.Y = SCommon.ToInt(DDGround.Camera.Y); }
public static void Perform(ref double x, ref double y, Predicate <Tile> isWall) { IsWall = isWall; // 整数化 IX = SCommon.ToInt(x); IY = SCommon.ToInt(y); A2 = new Around(IX, IY, 2); A3 = new Around(IX, IY, 3); I2Point a2RelPtBk = A2.RelativePoint; Perform_A(); if ( a2RelPtBk.X != A2.RelativePoint.X || a2RelPtBk.Y != A2.RelativePoint.Y ) { x = A2.CenterPoint.X + A2.RelativePoint.X; y = A2.CenterPoint.Y + A2.RelativePoint.Y; } }
private IEnumerable <bool> モード変更(string modeName, bool?mirrored) { int mode = SCommon.IndexOf(this.ImageTable[this.Chara], v => v.Name == modeName); if (mode == -1) { throw new DDError("Bad mode: " + mode); } int currMode = this.Mode; int destMode = mode; bool currMirrored = this.Mirrored; bool destMirrored = mirrored == null ? this.Mirrored : mirrored.Value; foreach (DDScene scene in DDSceneUtils.Create(30)) { if (NovelAct.IsFlush) { this.A = 1.0; this.Mode = destMode; this.Mirrored = destMirrored; break; } this.A = DDUtils.Parabola(scene.Rate * 0.5 + 0.5); this.Mode = currMode; this.Mirrored = currMirrored; this.P_Draw(); this.A = DDUtils.Parabola(scene.Rate * 0.5 + 0.0); this.Mode = destMode; this.Mirrored = destMirrored; this.P_Draw(); yield return(true); } }
/// <summary> /// <para>主たる画面描画</para> /// <para>色々な場所(モード)から呼び出されるだろう。</para> /// </summary> public void DrawSurfaces() { DDCurtain.DrawCurtain(); // 画面クリア if (this.SortSurfaces == null) { this.SortSurfaces = SCommon.Supplier(this.E_SortSurfaces()); } for (int c = 0; c < 10; c++) { this.SortSurfaces(); } foreach (Surface surface in Game.I.Status.Surfaces) // キャラクタ・オブジェクト・壁紙 { if (!surface.Act.Draw()) { surface.Draw(); } } Game.I.Status.Surfaces.RemoveAll(surface => surface.DeadFlag); }
protected override void OrbwalkingEvents_BeforeAttack(SCommon.Orbwalking.BeforeAttackArgs args) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo && Spells[W].IsReady() && ComboUseW) { Spells[W].Cast(); args.Process = false; } }
protected override void OrbwalkingEvents_BeforeAttack(SCommon.Orbwalking.BeforeAttackArgs args) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo && args.Target is Obj_AI_Hero && ComboUseQ) { leapTarget = args.Target as Obj_AI_Hero; if(Utils.TickCount - lastLeap < 100 && !HaveFullFerocity) { if (Spells[Q].IsReady()) Spells[Q].Cast(true); else args.Process = false; lastLeap = 0; } if (Spells[Q].IsReady() || HaveFullFerocity) { float dmg = 0f; if (HaveFullFerocity) dmg = (float)ObjectManager.Player.CalcDamage(leapTarget, LeagueSharp.Common.Damage.DamageType.Physical, new int[] { 30, 45, 60, 75, 90, 105, 120, 135, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240 }[ObjectManager.Player.Level - 1] + (ObjectManager.Player.BaseAttackDamage + ObjectManager.Player.FlatPhysicalDamageMod) * 0.5f); else dmg = (float)ObjectManager.Player.CalcDamage(leapTarget, LeagueSharp.Common.Damage.DamageType.Physical, new int[] { 30, 60, 90, 120, 150 }[Spells[Q].Level - 1] + (ObjectManager.Player.BaseAttackDamage + ObjectManager.Player.FlatPhysicalDamageMod) * new int[] { 0, 5, 10, 15, 20 }[ObjectManager.Player.GetSpell(SpellSlot.Q).Level - 1] / 100f); if (dmg >= leapTarget.Health || (WillLeap && OneShotComboActive)) { Spells[Q].Cast(true); if (!WillLeap) args.Process = false; } } if (ObjectManager.Player.HasBuff("RengarR")) Orbwalker.Configuration.DontMoveInRange = true; } }
// < DX.* public static byte[] SplitableJoin(string[] lines) { return(SCommon.SplittableJoin(lines.Select(line => Encoding.UTF8.GetBytes(line)).ToArray())); }
public static void ToRange(ref double value, double minval, double maxval) { value = SCommon.ToRange(value, minval, maxval); }
public void Perform() { Func <bool> f_ゴミ回収 = SCommon.Supplier(this.E_ゴミ回収()); this.Map = new Map(GameCommon.GetMapFile(this.World.GetCurrMapName())); this.ReloadEnemies(); // デフォルトの「プレイヤーのスタート地点」 // -- マップの中央 this.Player.X = this.Map.W * GameConsts.TILE_W / 2.0; this.Player.Y = this.Map.H * GameConsts.TILE_H / 2.0; { Enemy enemy = this.Enemies.Iterate().FirstOrDefault(v => v is Enemy_スタート地点 && ((Enemy_スタート地点)v).Direction == this.Status.StartPointDirection); if (enemy != null) { this.Player.X = enemy.X; this.Player.Y = enemy.Y; } } // ★★★★★ // プレイヤー・ステータス反映(マップ入場時) // その他の反映箇所: // -- マップ退場時 // -- セーブ時 { this.Player.HP = this.Status.StartHP; this.Player.FaceDirection = this.Status.StartFaceDirection; this.Player.選択武器 = this.Status.Start選択武器; } this.Wall = WallCreator.Create(this.Map.WallName); MusicCollection.Get(this.Map.MusicName).Play(); DDGround.Camera.X = this.Player.X - DDConsts.Screen_W / 2.0; DDGround.Camera.Y = this.Player.Y - DDConsts.Screen_H / 2.0; DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(10); DDEngine.FreezeInput(); // TODO: 音楽 for (this.Frame = 0; ; this.Frame++) { if (!this.UserInputDisabled && DDInput.PAUSE.GetInput() == 1) { this.Pause(); if (this.Pause_ReturnToTitleMenu) { this.Status.ExitDirection = 5; break; } } if (DDConfig.LOG_ENABLED && DDKey.GetInput(DX.KEY_INPUT_RETURN) == 1) { this.DebugPause(); } // 死亡時にカメラ移動を止める。 //if (this.Player.DeadFrame == 0) // this.カメラ位置調整(false); this.カメラ位置調整(false); if (DDConfig.LOG_ENABLED && DDKey.GetInput(DX.KEY_INPUT_E) == 1) // エディットモード(デバッグ用) { this.Edit(); this.ReloadEnemies(); this.Frame = 0; } // プレイヤー入力・移動 { bool deadOrUID = 1 <= this.Player.DeadFrame || this.UserInputDisabled; bool dir2 = !deadOrUID && 1 <= DDInput.DIR_2.GetInput() || this.PlayerHacker.DIR_2; bool dir4 = !deadOrUID && 1 <= DDInput.DIR_4.GetInput() || this.PlayerHacker.DIR_4; bool dir6 = !deadOrUID && 1 <= DDInput.DIR_6.GetInput() || this.PlayerHacker.DIR_6; bool dir8 = !deadOrUID && 1 <= DDInput.DIR_8.GetInput() || this.PlayerHacker.DIR_8; int dir; // 1~9 == { 左下, 下, 右下, 左, 動かない, 右, 左上, 上, 右上 } if (dir2 && dir4) { dir = 1; } else if (dir2 && dir6) { dir = 3; } else if (dir4 && dir8) { dir = 7; } else if (dir6 && dir8) { dir = 9; } else if (dir2) { dir = 2; } else if (dir4) { dir = 4; } else if (dir6) { dir = 6; } else if (dir8) { dir = 8; } else { dir = 5; } if (1 <= this.Player.DamageFrame) // ? プレイヤー・ダメージ中 { dir = 5; } bool camSlide = !deadOrUID && 1 <= DDInput.L.GetInput(); if (camSlide) { dir = 5; } bool slow = !deadOrUID && 1 <= DDInput.A.GetInput() || this.PlayerHacker.Slow; bool fast = !deadOrUID && 1 <= DDInput.R.GetInput() || this.PlayerHacker.Fast; if (Ground.I.FastReverseMode) { fast = !fast; } double speed = 3.0; if (slow) { speed -= 1.0; } if (fast) { speed += 2.0; } double nanameSpeed = speed / Consts.ROOT_OF_2; switch (dir) { case 2: this.Player.Y += speed; break; case 4: this.Player.X -= speed; break; case 6: this.Player.X += speed; break; case 8: this.Player.Y -= speed; break; case 1: this.Player.X -= nanameSpeed; this.Player.Y += nanameSpeed; break; case 3: this.Player.X += nanameSpeed; this.Player.Y += nanameSpeed; break; case 7: this.Player.X -= nanameSpeed; this.Player.Y -= nanameSpeed; break; case 9: this.Player.X += nanameSpeed; this.Player.Y -= nanameSpeed; break; case 5: break; default: throw null; // never } if (dir != 5 && !slow) { this.Player.FaceDirection = dir; } if (dir != 5) { this.Player.MoveFrame++; } else { this.Player.MoveFrame = 0; } if (this.Player.MoveFrame == 0) // 立ち止まったら座標を整数に矯正 { this.Player.X = SCommon.ToInt(this.Player.X); this.Player.Y = SCommon.ToInt(this.Player.Y); } if (camSlide) { if (dir4) { this.CamSlideCount++; this.CamSlideX--; } if (dir6) { this.CamSlideCount++; this.CamSlideX++; } if (dir8) { this.CamSlideCount++; this.CamSlideY--; } if (dir2) { this.CamSlideCount++; this.CamSlideY++; } DDUtils.ToRange(ref this.CamSlideX, -1, 1); DDUtils.ToRange(ref this.CamSlideY, -1, 1); } else { if (this.CamSlideMode && this.CamSlideCount == 0) { this.CamSlideX = 0; this.CamSlideY = 0; } this.CamSlideCount = 0; } this.CamSlideMode = camSlide; bool attack = !deadOrUID && 1 <= DDInput.B.GetInput() || this.PlayerHacker.Attack; if (attack) { this.Player.AttackFrame++; } else { this.Player.AttackFrame = 0; } bool 武器切り替え = !deadOrUID && DDInput.C.GetInput() == 1; if (武器切り替え) { this.Player.選択武器 = (Player.武器_e)(((int)this.Player.選択武器 + 1) % Player.武器_e_Length); } } //startDead: if (1 <= this.Player.DeadFrame) // プレイヤー死亡中の処理 { int frame = this.Player.DeadFrame - 1; if (GameConsts.PLAYER_DEAD_FRAME_MAX < frame) { this.Player.DeadFrame = 0; this.Status.ExitDirection = 5; break; } this.Player.DeadFrame++; // ---- const int HITBACK_FRAME_MAX = 30; if (frame < HITBACK_FRAME_MAX) { double rate = (double)frame / HITBACK_FRAME_MAX; double invRate = 1.0 - rate; D2Point speed = GameCommon.GetXYSpeed(this.Player.FaceDirection, 10.0 * invRate); this.Player.X -= speed.X; this.Player.Y -= speed.Y; } } //endDead: //startDamage: if (1 <= this.Player.DamageFrame) // プレイヤー・ダメージ中の処理 { int frame = this.Player.DamageFrame - 1; if (GameConsts.PLAYER_DAMAGE_FRAME_MAX < frame) { this.Player.DamageFrame = 0; this.Player.InvincibleFrame = 1; goto endDamage; } this.Player.DamageFrame++; // ---- { D2Point speed = GameCommon.GetXYSpeed(this.Player.FaceDirection, 5.0); for (int c = 0; c < 5; c++) { { int x = SCommon.ToInt(this.Player.X) / GameConsts.TILE_W; int y = SCommon.ToInt(this.Player.Y) / GameConsts.TILE_H; if (this.Map.GetCell(x, y).Tile.GetKind() != Tile.Kind_e.SPACE) // ? 歩行可能な場所ではない -> これ以上ヒットバックさせない。 { break; } } this.Player.X -= speed.X; this.Player.Y -= speed.Y; } } } endDamage: //startInvincible: if (1 <= this.Player.InvincibleFrame) // プレイヤー無敵時間中の処理 { int frame = this.Player.InvincibleFrame - 1; if (GameConsts.PLAYER_INVINCIBLE_FRAME_MAX < frame) { this.Player.InvincibleFrame = 0; goto endInvincible; } this.Player.InvincibleFrame++; // ---- // noop } endInvincible: // プレイヤー位置矯正 { 壁キャラ処理.Perform(ref this.Player.X, ref this.Player.Y, v => v.GetKind() != Tile.Kind_e.SPACE); } if (this.Player.X < 0.0) // ? マップの左側に出た。 { this.Status.ExitDirection = 4; break; } if (this.Map.W * GameConsts.TILE_W < this.Player.X) // ? マップの右側に出た。 { this.Status.ExitDirection = 6; break; } if (this.Player.Y < 0.0) // ? マップの上側に出た。 { this.Status.ExitDirection = 8; break; } if (this.Map.H * GameConsts.TILE_H < this.Player.Y) // ? マップの下側に出た。 { this.Status.ExitDirection = 2; break; } // 画面遷移時の微妙なカメラ位置ズレ解消 // -- 必要無いかもしれないが、念の為実行しておく。 if (this.Frame == 0) { this.カメラ位置調整(true); } if (1 <= this.Player.AttackFrame) { this.Player.Attack(); } DDCrash plCrash = DDCrashUtils.Point(new D2Point(this.Player.X, this.Player.Y)); // ==== // 描画ここから // ==== this.DrawWall(); this.DrawMap(); this.Player.Draw(); // memo: DeadFlag をチェックするのは「当たり判定」から foreach (Enemy enemy in this.Enemies.Iterate()) { enemy.Crash = DDCrashUtils.None(); // reset enemy.Draw(); } foreach (Shot shot in this.Shots.Iterate()) { shot.Crash = DDCrashUtils.None(); // reset shot.Draw(); } if (this.当たり判定表示) { // 最後に描画されるように DDGround.EL.Add() する。 DDGround.EL.Add(() => { DDCurtain.DrawCurtain(-0.8); const double A = 0.3; DDCrashView.Draw(new DDCrash[] { plCrash }, new I3Color(255, 0, 0), 1.0); DDCrashView.Draw(this.Enemies.Iterate().Select(v => v.Crash), new I3Color(255, 255, 255), A); DDCrashView.Draw(this.Shots.Iterate().Select(v => v.Crash), new I3Color(0, 255, 255), A); return(false); }); } // ==== // 描画ここまで // ==== // ==== // 当たり判定ここから // ==== foreach (Enemy enemy in this.Enemies.Iterate()) { if (1 <= enemy.HP) // ? 敵:生存 && 無敵ではない { foreach (Shot shot in this.Shots.Iterate()) { // 衝突判定:敵 x 自弾 if ( !shot.DeadFlag && // ? 自弾:生存 enemy.Crash.IsCrashed(shot.Crash) // ? 衝突 ) { // ★ 敵_被弾ここから if (!shot.敵を貫通する) { shot.Kill(); } enemy.HP -= shot.AttackPoint; if (1 <= enemy.HP) // ? まだ生存している。 { enemy.Damaged(shot); } else // ? 撃破した。 { enemy.Kill(true); break; // この敵は死亡したので、この敵について以降の当たり判定は不要 } // ★ 敵_被弾ここまで } } } // 衝突判定:敵 x 自機 if ( this.Player.DeadFrame == 0 && // ? プレイヤー死亡中ではない。 this.Player.DamageFrame == 0 && // ? プレイヤー・ダメージ中ではない。 this.Player.InvincibleFrame == 0 && // ? プレイヤー無敵時間中ではない。 !enemy.DeadFlag && // ? 敵:生存 DDCrashUtils.IsCrashed(enemy.Crash, plCrash) // ? 衝突 ) { // ★ 自機_被弾ここから if (enemy.自機に当たると消滅する) { enemy.Kill(); } this.Player.HP -= enemy.AttackPoint; if (1 <= this.Player.HP) // ? まだ生存している。 { this.Player.DamageFrame = 1; } else // ? 死亡した。 { this.Player.HP = -1; this.Player.DeadFrame = 1; } // ★ 自機_被弾ここまで } } foreach (Shot shot in this.Shots.Iterate()) { // 壁への当たり判定は自弾の「中心座標のみ」であることに注意して下さい。 if ( !shot.DeadFlag && // ? 自弾:生存 !shot.壁をすり抜ける && // ? この自弾は壁に当たる。 this.Map.GetCell(GameCommon.ToTablePoint(shot.X, shot.Y)).Tile.GetKind() == Tile.Kind_e.WALL // ? 壁に当たった。 ) { shot.Kill(); } } // ==== // 当たり判定ここまで // ==== f_ゴミ回収(); this.Enemies.RemoveAll(v => v.DeadFlag); this.Shots.RemoveAll(v => v.DeadFlag); DDEngine.EachFrame(); // ★★★ ゲームループの終わり ★★★ } DDEngine.FreezeInput(); if (this.Status.ExitDirection == 5) { DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.DrawWall(); this.DrawMap(); DDEngine.EachFrame(); } } else { double destSlide_X = 0.0; double destSlide_Y = 0.0; switch (this.Status.ExitDirection) { case 4: destSlide_X = DDConsts.Screen_W; break; case 6: destSlide_X = -DDConsts.Screen_W; break; case 8: destSlide_Y = DDConsts.Screen_H; break; case 2: destSlide_Y = -DDConsts.Screen_H; break; default: throw null; // never } using (DDSubScreen wallMapScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H)) { using (wallMapScreen.Section()) { this.DrawWall(); this.DrawMap(); } foreach (DDScene scene in DDSceneUtils.Create(30)) { double slide_X = destSlide_X * scene.Rate; double slide_Y = destSlide_Y * scene.Rate; DDCurtain.DrawCurtain(); DDDraw.DrawSimple(wallMapScreen.ToPicture(), slide_X, slide_Y); DDEngine.EachFrame(); } } DDCurtain.SetCurtain(0, -1.0); } // ★★★★★ // プレイヤー・ステータス反映(マップ退場時) // その他の反映箇所: // -- マップ入場時 // -- セーブ時 { this.Status.StartHP = this.Player.HP; this.Status.StartFaceDirection = this.Player.FaceDirection; this.Status.Start選択武器 = this.Player.選択武器; } // ★★★ end of Perform() ★★★ }
public static Tile Create(string name) { return(SCommon.FirstOrDie(Tiles, tile => tile.Name == name, () => new DDError(name)).Creator()); }
private void Events_OnAttack(SCommon.Orbwalking.OnAttackArgs args) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo && WillLeap && args.Target is Obj_AI_Hero) { LeagueSharp.Common.Utility.DelayAction.Add(50, () => { if (ComboUseE && Spells[E].IsReady()) Spells[E].Cast(args.Target.Position); }); } }
public static void GameStart() { foreach (string dllFile in "DxLib.dll:DxLib_x64.dll:DxLibDotNet.dll".Split(':')) // DxLibDotNet.dll 等の存在確認 (1) { if (!File.Exists(dllFile)) { throw new DDError(); } } DX.GetColor(0, 0, 0); // DxLibDotNet.dll 等の存在確認 (2) DDConfig.Load(); // LogFile, LOG_ENABLED 等を含むので真っ先に // Log > File.WriteAllBytes(DDConfig.LogFile, SCommon.EMPTY_BYTES); ProcMain.WriteLog = message => { if (LogCount < DDConfig.LogCountMax) { using (StreamWriter writer = new StreamWriter(DDConfig.LogFile, true, Encoding.UTF8)) { writer.WriteLine("[" + DateTime.Now + "] " + message); } LogCount++; } }; // < Log // *.INIT { DDGround.INIT(); DDResource.INIT(); DDDatStrings.INIT(); DDUserDatStrings.INIT(); DDFontRegister.INIT(); DDKey.INIT(); } DDSaveData.Load(); // DxLib > if (DDConfig.LOG_ENABLED) { DX.SetApplicationLogSaveDirectory(SCommon.MakeFullPath(DDConfig.ApplicationLogSaveDirectory)); } DX.SetOutApplicationLogValidFlag(DDConfig.LOG_ENABLED ? 1 : 0); // DxLib のログを出力 1: する 0: しない DX.SetAlwaysRunFlag(1); // ? 非アクティブ時に 1: 動く 0: 止まる SetMainWindowTitle(); //DX.SetGraphMode(DDConsts.Screen_W, DDConsts.Screen_H, 32); DX.SetGraphMode(DDGround.RealScreen_W, DDGround.RealScreen_H, 32); DX.ChangeWindowMode(1); // 1: ウィンドウ 0: フルスクリーン //DX.SetFullSceneAntiAliasingMode(4, 2); // フルスクリーンを廃止したので不要 DX.SetWindowIconHandle(GetAppIcon()); // ウィンドウ左上のアイコン if (0 <= DDConfig.DisplayIndex) { DX.SetUseDirectDrawDeviceIndex(DDConfig.DisplayIndex); } if (DX.DxLib_Init() != 0) // ? 失敗 { throw new DDError(); } Finalizers.Add(() => { if (DX.DxLib_End() != 0) // ? 失敗 { throw new DDError(); } }); DDUtils.SetMouseDispMode(DDGround.RO_MouseDispMode); // ? マウスを表示する。 DX.SetWindowSizeChangeEnableFlag(0); // ウィンドウの右下をドラッグで伸縮 1: する 0: しない //DX.SetDrawScreen(DX.DX_SCREEN_BACK); DX.SetDrawMode(DDConsts.DEFAULT_DX_DRAWMODE); // これをデフォルトとする。 // < DxLib DDGround.MainScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H); DDGround.MainScreen.ChangeDrawScreen(); DDGround.LastMainScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H); DDGround.KeptMainScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H); if (DDConfig.DisplayIndex == -2) { I2Point mousePt = DDWin32.GetMousePosition(); I4Rect[] monitors = DDWin32.GetAllMonitor(); I4Rect activeMonitor = monitors[0]; // マウス位置のモニタを特定出来ない場合のモニタ foreach (I4Rect monitor in monitors) { if ( monitor.L <= mousePt.X && mousePt.X < monitor.R && monitor.T <= mousePt.Y && mousePt.Y < monitor.B ) { activeMonitor = monitor; break; } } DDGround.MonitorRect = activeMonitor; } else { int l; int t; int w; int h; int p1; int p2; int p3; int p4; DX.GetDefaultState(out w, out h, out p1, out p2, out l, out t, out p3, out p4); if ( w < 1 || SCommon.IMAX < w || h < 1 || SCommon.IMAX < h || l < -SCommon.IMAX || SCommon.IMAX < l || t < -SCommon.IMAX || SCommon.IMAX < t ) { throw new DDError(); } DDGround.MonitorRect = new I4Rect(l, t, w, h); } PostSetScreenSize(DDGround.RealScreen_W, DDGround.RealScreen_H); // Font { //DDFontRegister.Add(@"e20200928_NovelAdv\Font\Genkai-Mincho-font\genkai-mincho.ttf"); //DDFontRegister.Add(@"e20200928_NovelAdv\Font\riitf\RiiT_F.otf"); DDFontRegister.Add(@"dat\Font\K Gothic\K Gothic.ttf"); DDFontRegister.Add(@"dat\Font\焚火フォント\03Takibi-Regular.otf"); //DDFontRegister.Add(@"dat\Font\廻想体\Kaiso-Next-B.otf"); DDFontRegister.Add(@"dat\Font\木漏れ日ゴシック\komorebi-gothic.ttf"); } Ground.I = new Ground(); Ground.I.Picture2 = new ResourcePicture2(); // Ground.I を参照しているので Ground のコンストラクタには書けない。 MainWin.I.PostGameStart_G3(); DDSaveData.Load_Delay(); Finalizers.Add(() => { DDSaveData.Save(); }); }
protected override void Orbwalking_BeforeAttack(SCommon.Orbwalking.BeforeAttackArgs args) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo && args.Target is Obj_AI_Hero && ComboUseQ) { leapTarget = args.Target as Obj_AI_Hero; if (Spells[Q].IsReady()) { float dmg = 0f; if (HaveFullFerocity) dmg = (float)ObjectManager.Player.CalcDamage(leapTarget, LeagueSharp.Common.Damage.DamageType.Physical, new int[] { 30, 45, 60, 75, 90, 105, 120, 135, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240 }[ObjectManager.Player.Level - 1] + (ObjectManager.Player.BaseAttackDamage + ObjectManager.Player.FlatPhysicalDamageMod) * 0.5f); else dmg = (float)ObjectManager.Player.CalcDamage(leapTarget, LeagueSharp.Common.Damage.DamageType.Physical, new int[] { 30, 60, 90, 120, 150 }[ObjectManager.Player.GetSpell(SpellSlot.Q).Level - 1] + (ObjectManager.Player.BaseAttackDamage + ObjectManager.Player.FlatPhysicalDamageMod) * new int[] { 0, 5, 10, 15, 20 }[ObjectManager.Player.GetSpell(SpellSlot.Q).Level - 1] / 100f); if (dmg >= leapTarget.Health || (WillLeap && OneShotComboActive)) { Spells[Q].Cast(); if (!WillLeap) args.Process = false; } } } }
protected override void Orbwalking_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (args.Target is Obj_AI_Hero) { if (Spells[Q].IsReady() && ((Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo && ComboUseQ) || (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed && HarassUseQ))) { Vector3 pos = Tumble.FindTumblePosition(args.Target as Obj_AI_Hero); if (pos.IsValid()) Spells[Q].Cast(pos); } } else if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.LaneClear) { if (Spells[Q].IsReady()) { var jungleMob = MinionManager.GetMinions(600, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth).FirstOrDefault(); if (jungleMob != null) Spells[Q].Cast(Game.CursorPos); else { if(LaneClearQ) { var minion = MinionManager.GetMinions(ObjectManager.Player.AttackRange + 100).Where(p => p.Health <= SCommon.Damage.AutoAttack.GetDamage(p) + ObjectManager.Player.GetSpellDamage(p, SpellSlot.Q)).FirstOrDefault(); if(minion != null) { Orbwalker.ForcedTarget = minion; Spells[Q].Cast(Game.CursorPos); } } } } } }
private bool CheckInputPadButtonKey(bool キー設定Flag, DDInput.Button targetButton) // ret: 設定した。 { DDInput.Button[] buttons = new DDInput.Button[] { DDInput.DIR_2, DDInput.DIR_4, DDInput.DIR_6, DDInput.DIR_8, DDInput.A, DDInput.B, DDInput.L, }; if (キー設定Flag) { int pressKeyId = -1; foreach (int keyId in DDSimpleMenu.GetAllKeyId()) { if (DDKey.GetInput(keyId) == 1) { pressKeyId = keyId; } } if (pressKeyId != -1) { int[] keyIds; switch (pressKeyId) { case DX.KEY_INPUT_LCONTROL: case DX.KEY_INPUT_RCONTROL: keyIds = new int[] { DX.KEY_INPUT_LCONTROL, DX.KEY_INPUT_RCONTROL }; break; case DX.KEY_INPUT_LSHIFT: case DX.KEY_INPUT_RSHIFT: keyIds = new int[] { DX.KEY_INPUT_LSHIFT, DX.KEY_INPUT_RSHIFT }; break; case DX.KEY_INPUT_LALT: case DX.KEY_INPUT_RALT: keyIds = new int[] { DX.KEY_INPUT_LALT, DX.KEY_INPUT_RALT }; break; default: keyIds = new int[] { pressKeyId }; break; } // 他ボタンとの重複回避 if (SCommon.Comp(targetButton.KeyIds, keyIds, SCommon.Comp) != 0) // ? 違う { foreach (DDInput.Button button in buttons) { if (SCommon.Comp(button.KeyIds, keyIds, SCommon.Comp) == 0) // ? 同じ { button.KeyIds = targetButton.KeyIds; } } } targetButton.KeyIds = keyIds; return(true); } } else { int pressBtnId = -1; for (int padId = 0; padId < DDPad.GetPadCount(); padId++) { for (int btnId = 0; btnId < DDPad.PAD_BUTTON_MAX; btnId++) { if (DDPad.GetInput(padId, btnId) == 1) { pressBtnId = btnId; } } } if (pressBtnId != -1) { int[] btnIds = new int[] { pressBtnId }; // 他ボタンとの重複回避 if (SCommon.Comp(targetButton.BtnIds, btnIds, SCommon.Comp) != 0) // ? 違う { foreach (DDInput.Button button in buttons) { if (SCommon.Comp(button.BtnIds, btnIds, SCommon.Comp) == 0) // ? 同じ { button.BtnIds = targetButton.BtnIds; } } } targetButton.BtnIds = btnIds; return(true); } } return(false); }
protected override void OrbwalkingEvents_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { HasPassive = false; if (args.Target != null && args.Target is Obj_AI_Hero && Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo) { var t = args.Target as Obj_AI_Hero; if (Spells[E].IsReady() && ComboUseE) { var pos = FindDashPosition(t); if (pos.IsValid()) { Spells[E].Cast(pos); return; } } if (Spells[W].IsReady() && ComboUseW) Spells[W].SPredictionCast(t, HitChance.Low); } else if (args.Target != null && args.Target is Obj_AI_Base && Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.LaneClear) { var jungleMob = MinionManager.GetMinions(Spells[Q].Range, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth).FirstOrDefault(); if (jungleMob != null) { if (Spells[E].IsReady()) { Spells[E].Cast(Game.CursorPos); return; } if (Spells[W].IsReady()) Spells[W].Cast(jungleMob.ServerPosition); } } }
protected override void OrbwalkingEvents_BeforeAttack(SCommon.Orbwalking.BeforeAttackArgs args) { if (!HasPassive && args.Target != null && args.Target is Obj_AI_Hero && Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo) { if (Spells[Q].IsReady() && ComboUseQ) { Spells[Q].CastOnUnit(args.Target as Obj_AI_Base); args.Process = false; } } }
protected override void OrbwalkingEvents_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo) { if (ComboUseTiamat) { if (Items.HasItem(3077) && Items.CanUseItem(3077)) Items.UseItem(3077); else if (Items.HasItem(3074) && Items.CanUseItem(3074)) Items.UseItem(3074); else if (Items.HasItem(3748) && Items.CanUseItem(3748)) //titanic Items.UseItem(3748); } } else if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.LaneClear) { if (Spells[Q].IsReady() && LaneClearQ) { var minions = MinionManager.GetMinions(Spells[Q].Range, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.Health); foreach (var minion in minions) { if (minion.Distance(ObjectManager.Player.ServerPosition) > 150 && minion.Health < Spells[Q].GetDamage(minion)) { Spells[Q].CastOnUnit(minion); return; } } } } }
protected override void OrbwalkingEvents_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (!args.Target.IsDead && args.Target.Type == GameObjectType.obj_AI_Hero && args.Target.IsValidTarget(Spells[Q].Range) && Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo && ComboUseQ) Spells[Q].CastOnUnit(args.Target as Obj_AI_Hero); }
protected override void OrbwalkingEvents_BeforeAttack(SCommon.Orbwalking.BeforeAttackArgs args) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed) { if (Spells[E].IsReady() && HarassUseE) { Spells[E].Cast(); args.Process = false; return; } } if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo) { if (Spells[E].IsReady() && ComboUseE) { Spells[E].Cast(); args.Process = false; return; } } }
protected override void OrbwalkingEvents_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo) { if (ComboUseTiamat) { if (Items.HasItem(3077) && Items.CanUseItem(3077)) Items.UseItem(3077); else if (Items.HasItem(3074) && Items.CanUseItem(3074)) Items.UseItem(3074); else if (Items.HasItem(3748) && Items.CanUseItem(3748)) //titanic Items.UseItem(3748); } if (Spells[Q].IsReady() && ComboUseQ) Spells[Q].Cast(); } else if(Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed || HarassToggle) { if (args.Target is Obj_AI_Hero) { if (HarassUseTiamat) { if (Items.HasItem(3077) && Items.CanUseItem(3077)) Items.UseItem(3077); else if (Items.HasItem(3074) && Items.CanUseItem(3074)) Items.UseItem(3074); else if (Items.HasItem(3748) && Items.CanUseItem(3748)) //titanic Items.UseItem(3748); } if (Spells[Q].IsReady() && HarassUseQ) Spells[Q].Cast(); } } else if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.LaneClear) { if (!args.Target.IsDead && LaneClearUseQ && Spells[Q].IsReady()) Spells[Q].Cast(); } }
protected override void OrbwalkingEvents_BeforeAttack(SCommon.Orbwalking.BeforeAttackArgs args) { if (DontAAStealth && ObjectManager.Player.HasBuff("vaynetumblefade")) { if (ObjectManager.Player.ServerPosition.CountEnemiesInRange(1000) > DontAAStealthCount) { if (args.Target is Obj_AI_Hero && args.Target.Health <= SCommon.Damage.AutoAttack.GetDamage(args.Target as Obj_AI_Base, true) * 2 && ObjectManager.Player.Health > (args.Target as Obj_AI_Hero).GetAutoAttackDamage(ObjectManager.Player, true)) //can killable return; args.Process = false; } } }
protected override void OrbwalkingEvents_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (args.Target is Obj_AI_Hero) { if (Spells[Q].IsReady() && ((Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo && ComboUseQ) || (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed && HarassUseQ))) { Vector3 pos = Helpers.Tumble.FindTumblePosition(args.Target as Obj_AI_Hero); if (pos.IsValid()) Spells[Q].Cast(pos); } } else if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.LaneClear) { if (Spells[Q].IsReady()) { var jungleMob = MinionManager.GetMinions(600, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth).FirstOrDefault(); if (jungleMob != null) Spells[Q].Cast(Game.CursorPos); else { if (LaneClearQ && args.Target.Health - SCommon.Damage.AutoAttack.GetDamage(args.Target as Obj_AI_Base, true) <= 0) { var minion = MinionManager.GetMinions(ObjectManager.Player.AttackRange).Where(p => p.NetworkId != args.Target.NetworkId && p.Health < SCommon.Damage.AutoAttack.GetDamage(p) + ObjectManager.Player.GetSpellDamage(p, SpellSlot.Q)).FirstOrDefault(); if(minion != null) { Orbwalker.ForcedTarget = minion; Spells[Q].Cast(SCommon.Maths.Geometry.Deviation(ObjectManager.Player.ServerPosition.To2D(), minion.ServerPosition.To2D(), 50).To3D2()); } } } } } }
private void Main4() { // *.INIT { // アプリ固有 > //RippleEffect.INIT(); //画面分割.INIT(); //画面分割_Effect.INIT(); // < アプリ固有 } #region Charge To DDTouch // DDCCResource 等のための Touch //DDTouch.Add(TitleMenu.TouchWallDrawerResources); // 個別に設定 //DDTouch.Add(Ground.I.Picture.XXX); //DDTouch.Add(Ground.I.Music.XXX); //DDTouch.Add(Ground.I.SE.XXX); // 全部設定 //DDTouch.AddAllPicture(); //DDTouch.AddAllMusic(); //DDTouch.AddAllSE(); #endregion //DDTouch.Touch(); // moved -> Logo if (DDConfig.LOG_ENABLED) { DDEngine.DispDebug = () => { DDPrint.SetPrint(); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.Print(string.Join(" ", DDEngine.FrameProcessingMillis, DDEngine.FrameProcessingMillis_Worst, DDMouse.X, DDMouse.Y // デバッグ表示する情報をここへ追加.. )); DDPrint.Reset(); }; } if (ProcMain.DEBUG) { Main4_Debug(); } else if (ProcMain.ArgsReader.HasArgs()) // シナリオファイルを指定して実行 { string name = ProcMain.ArgsReader.NextArg(); string scenarioRootDir = Path.Combine(ProcMain.SelfDir, DDConsts.ResourceDir_InternalRelease, Scenario.SCENARIO_FILE_PREFIX); scenarioRootDir = SCommon.MakeFullPath(scenarioRootDir); name = SCommon.MakeFullPath(name); name = SCommon.ChangeRoot(name, scenarioRootDir); name = Path.Combine(Path.GetDirectoryName(name), Path.GetFileNameWithoutExtension(name)); // remove extention using (new Game()) { Game.I.Status.Scenario = new Scenario(name); Game.I.Perform(); } } else { Main4_Release(); } }
protected override void OrbwalkingEvents_BeforeAttack(SCommon.Orbwalking.BeforeAttackArgs args) { if (args.Target is Obj_AI_Hero) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo) { if (Spells[W].IsReady() && ComboUseW) Spells[W].Cast(); } else if(Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed || HarassToggle) { if (Spells[W].IsReady() && HarassUseW) Spells[W].Cast(); } } else if(args.Target is Obj_AI_Minion) { if(Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.LaneClear) { if (Spells[W].IsReady() && LaneClearUseW) Spells[W].Cast(); } } }
private void Edit() { this.Map.Load(); // ゲーム中にマップを書き換える場合があるので、再ロードする。 DDEngine.FreezeInput(); DDUtils.SetMouseDispMode(true); LevelEditor.ShowDialog(); int lastMouseX = DDMouse.X; int lastMouseY = DDMouse.Y; for (; ;) { if (LevelEditor.Dlg.XPressed) { break; } // 廃止 //if (DDKey.GetInput(DX.KEY_INPUT_E) == 1) // break; I2Point cellPos = GameCommon.ToTablePoint( DDGround.Camera.X + DDMouse.X, DDGround.Camera.Y + DDMouse.Y ); MapCell cell = Game.I.Map.GetCell(cellPos); if (cell.IsDefault) { // noop } else if (1 <= DDKey.GetInput(DX.KEY_INPUT_LSHIFT) && 1 <= DDKey.GetInput(DX.KEY_INPUT_LCONTROL)) // 左シフト・コントロール押下 -> 塗り潰し_L / 塗り潰し_R { if (DDMouse.L.GetInput() == -1) // クリックを検出 { this.Map.Save(); // 失敗を想定して、セーブしておく switch (LevelEditor.Dlg.GetMode()) { case LevelEditor.Mode_e.TILE: { string tileName = LevelEditor.Dlg.GetTile_L(); if (tileName != cell.TileName) { string targetTileName = cell.TileName; // cell.TileName は this.EditFill で変更される。 this.EditFill( cellPos, v => v.TileName == targetTileName, v => { v.TileName = tileName; v.Tile = TileCatalog.Create(tileName); } ); } } break; case LevelEditor.Mode_e.ENEMY: { string enemyName = LevelEditor.Dlg.GetEnemy(); if (enemyName != cell.EnemyName) { string targetEnemyName = cell.EnemyName; // cell.EnemyName は this.EditFill で変更される。 this.EditFill( cellPos, v => v.EnemyName == targetEnemyName, v => v.EnemyName = enemyName ); } } break; default: throw null; // never } } else if (DDMouse.R.GetInput() == -1) // クリックを検出 { this.Map.Save(); // 失敗を想定して、セーブしておく switch (LevelEditor.Dlg.GetMode()) { case LevelEditor.Mode_e.TILE: { string tileName = LevelEditor.Dlg.GetTile_R(); if (tileName != cell.TileName) { string targetTileName = cell.TileName; // cell.TileName は this.EditFill で変更される。 this.EditFill( cellPos, v => v.TileName == targetTileName, v => { v.TileName = tileName; v.Tile = TileCatalog.Create(tileName); } ); } } break; case LevelEditor.Mode_e.ENEMY: // none break; default: throw null; // never } } } else if (1 <= DDKey.GetInput(DX.KEY_INPUT_LSHIFT)) // 左シフト押下 -> 移動 / none { if (1 <= DDMouse.L.GetInput()) { DDGround.Camera.X -= DDMouse.X - lastMouseX; DDGround.Camera.Y -= DDMouse.Y - lastMouseY; DDUtils.ToRange(ref DDGround.Camera.X, 0.0, this.Map.W * GameConsts.TILE_W - DDConsts.Screen_W); DDUtils.ToRange(ref DDGround.Camera.Y, 0.0, this.Map.H * GameConsts.TILE_H - DDConsts.Screen_H); DDGround.ICamera.X = SCommon.ToInt(DDGround.Camera.X); DDGround.ICamera.Y = SCommon.ToInt(DDGround.Camera.Y); } else if (1 <= DDMouse.R.GetInput()) { // none } } else if (1 <= DDKey.GetInput(DX.KEY_INPUT_LCONTROL)) // 左コントロール押下 -> スポイト_L / スポイト_R { if (1 <= DDMouse.L.GetInput()) { switch (LevelEditor.Dlg.GetMode()) { case LevelEditor.Mode_e.TILE: LevelEditor.Dlg.SetTile_L(cell.TileName); break; case LevelEditor.Mode_e.ENEMY: LevelEditor.Dlg.SetEnemy(cell.EnemyName); break; default: throw null; // never } } else if (1 <= DDMouse.R.GetInput()) { switch (LevelEditor.Dlg.GetMode()) { case LevelEditor.Mode_e.TILE: LevelEditor.Dlg.SetTile_R(cell.TileName); break; case LevelEditor.Mode_e.ENEMY: // none break; default: throw null; // never } } } else if (1 <= DDKey.GetInput(DX.KEY_INPUT_LALT)) // 左 ALT 押下 -> 自機ワープ / none { if (DDMouse.L.GetInput() == -1) // クリックを検出 { this.Player.X = cellPos.X * GameConsts.TILE_W + GameConsts.TILE_W / 2; this.Player.Y = cellPos.Y * GameConsts.TILE_H + GameConsts.TILE_H / 2; DDGround.EL.Add(SCommon.Supplier(Effects.中爆発(this.Player.X, this.Player.Y))); // アクションが分かるように } else if (1 <= DDMouse.R.GetInput()) { // none } } else // シフト系押下無し -> セット_L / セット_R (敵はクリア) { if (1 <= DDMouse.L.GetInput()) { switch (LevelEditor.Dlg.GetMode()) { case LevelEditor.Mode_e.TILE: { string tileName = LevelEditor.Dlg.GetTile_L(); cell.TileName = tileName; cell.Tile = TileCatalog.Create(tileName); } break; case LevelEditor.Mode_e.ENEMY: { string enemyName = LevelEditor.Dlg.GetEnemy(); cell.EnemyName = enemyName; } break; default: throw null; // never } } else if (1 <= DDMouse.R.GetInput()) { switch (LevelEditor.Dlg.GetMode()) { case LevelEditor.Mode_e.TILE: { string tileName = LevelEditor.Dlg.GetTile_R(); cell.TileName = tileName; cell.Tile = TileCatalog.Create(tileName); } break; case LevelEditor.Mode_e.ENEMY: cell.EnemyName = GameConsts.ENEMY_NONE; break; default: throw null; // never } } } if (DDKey.GetInput(DX.KEY_INPUT_S) == 1) // S キー --> Save { this.Map.Save(); // 表示 { int endFrame = DDEngine.ProcFrame + 60; DDGround.EL.Add(() => { DDPrint.SetPrint(0, 16); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.Print("セーブしました..."); DDPrint.Reset(); return(DDEngine.ProcFrame < endFrame); }); } } if (DDKey.GetInput(DX.KEY_INPUT_L) == 1) // L キー --> Load { this.Map.Load(); // 表示 { int endFrame = DDEngine.ProcFrame + 60; DDGround.EL.Add(() => { DDPrint.SetPrint(0, 16); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.Print("ロードしました..."); DDPrint.Reset(); return(DDEngine.ProcFrame < endFrame); }); } } DDCurtain.DrawCurtain(); if (LevelEditor.Dlg.IsShowTile()) { this.DrawMap(); } if (LevelEditor.Dlg.IsShowEnemy()) { LevelEditor.DrawEnemy(); } lastMouseX = DDMouse.X; lastMouseY = DDMouse.Y; DDEngine.EachFrame(); } DDEngine.FreezeInput(); DDUtils.SetMouseDispMode(false); LevelEditor.CloseDialog(); this.Map.Save(); // ★★★ マップをセーブする ★★★ }
protected override void OrbwalkingEvents_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { }
public static void ToRange(ref int value, int minval, int maxval) { value = SCommon.ToRange(value, minval, maxval); }
protected override void OrbwalkingEvents_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed) { if (Spells[W].IsReady() && HarassUseW) { Spells[W].Cast(); return; } } if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo) { if (Spells[W].IsReady() && ComboUseW) { Spells[W].Cast(); return; } if (ComboUseTiamat) { if (Items.HasItem(3077) && Items.CanUseItem(3077)) Items.UseItem(3077); else if (Items.HasItem(3074) && Items.CanUseItem(3074)) Items.UseItem(3074); else if (Items.HasItem(3748) && Items.CanUseItem(3748)) Items.UseItem(3748); return; } } }
public static string[] Split(byte[] data) { return(SCommon.Split(data).Select(bLine => Encoding.UTF8.GetString(bLine)).ToArray()); }
protected override void OrbwalkingEvents_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo) { if (Spells[Q].IsReady() && ComboUseQ) Spells[Q].Cast(true); } else if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.LaneClear) { if (!args.Target.IsDead && LaneClearUseQ && (!LaneClearSaveFerocity || !HaveFullFerocity)) Spells[Q].Cast(true); } }
private void 基本設定() { DDSE[] seSamples = new DDSE[] { Ground.I.SE.Poka01, Ground.I.SE.Poka02, }; DDEngine.FreezeInput(); for (; ;) { // ==== // 入力判定ここから // ==== if ( DDInput.A.GetInput() == 1 || DDInput.B.GetInput() == 1 || DDMouse.R.GetInput() == -1 ) { this.Mode = Mode_e.END; break; } if (DDMouse.L.GetInput() == -1) { if (this.GetTabTitleCrash_拡張設定().IsCrashed(DDCrashUtils.Point(new D2Point(DDMouse.X, DDMouse.Y)))) { this.Mode = Mode_e.拡張設定; break; } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_フルスクリーン) { DDMain.SetFullScreen(); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_ウィンドウ) { const int def_screen_w = DDConsts.Screen_W / 2; const int def_screen_h = DDConsts.Screen_H / 2; DDMain.SetScreenSize(def_screen_w, def_screen_h); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_デフォルトに戻す) { this.デフォルトに戻す(); } if (this.LastHoveringButton == Ground.I.Picture.SettingButton_戻る) { this.Mode = Mode_e.END; break; } } // ==== // 入力判定ここまで // ==== // ==== // 描画ここから // ==== this.BeforeDrawContents(); DDDraw.DrawSimple(Ground.I.Picture.基本設定枠, 0, 0); this.DrawTabTitles(false); this.DrawPrompt(100, 250, "画面モード"); this.DrawPrompt(100, 380, "BGM音量"); this.DrawPrompt(100, 510, "SE音量"); this.DrawPrompt(100, 640, "メッセージ表示速度"); this.DrawPrompt(100, 770, "メッセージウィンドウ透明度"); bool fullScreenFlag = DDGround.RealScreen_W == DDGround.MonitorRect.W && DDGround.RealScreen_H == DDGround.MonitorRect.H; this.DrawButton(1100, 280, Ground.I.Picture.SettingButton_フルスクリーン, fullScreenFlag); this.DrawButton(1550, 280, Ground.I.Picture.SettingButton_ウィンドウ, !fullScreenFlag); this.DrawTrackBar(1325, 410, "小", "大", DDGround.MusicVolume, volume => { DDGround.MusicVolume = volume; DDMusicUtils.UpdateVolume(); }); this.DrawTrackBar(1325, 540, "小", "大", DDGround.SEVolume, volume => { DDGround.SEVolume = volume; //DDSEUtils.UpdateVolume(); // v_20210215 -- メソッド終了時に全て更新する。 foreach (DDSE se in seSamples) { se.UpdateVolume(); } }, () => { DDUtils.Random.ChooseOne(seSamples).Play(); }); this.DrawTrackBar(1325, 670, "遅い", "速い", DDUtils.RateAToB(GameConsts.MESSAGE_SPEED_MIN, GameConsts.MESSAGE_SPEED_MAX, Ground.I.MessageSpeed), value => Ground.I.MessageSpeed = SCommon.ToInt( DDUtils.AToBRate(GameConsts.MESSAGE_SPEED_MIN, GameConsts.MESSAGE_SPEED_MAX, value) ) ); this.DrawTrackBar(1325, 800, "透明", "不透明", DDUtils.RateAToB(0, 100, Ground.I.MessageWindow_A_Pct), value => Ground.I.MessageWindow_A_Pct = SCommon.ToInt( DDUtils.AToBRate(0, 100, value) ) ); this.DrawUnderButtons(); // ==== // 描画ここまで // ==== DDEngine.EachFrame(); } DDEngine.FreezeInput(); DDSEUtils.UpdateVolume(); // v_20210215 }
public static void AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (s_CheckAA) { s_CheckAA = false; CanCastAnimation = true; if (args.Target.IsValidTarget() && args.Target.Type == GameObjectType.obj_AI_Hero && (Program.Champion.ConfigMenu.Item("CSHYKEY").GetValue<KeyBind>().Active || (Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo && Program.Champion.ConfigMenu.Item(String.Format("CMETHOD{0}", (args.Target as Obj_AI_Hero).ChampionName)).GetValue<StringList>().SelectedIndex == 1))) { if (ObjectManager.Player.HasBuff("RivenFengShuiEngine")) { { if (Program.Champion.Spells[3].IsReady()) //r2 { Program.Champion.Spells[3].Cast(args.Target.Position); return; } } } } if(args.Target.IsValidTarget() && !Program.Champion.Spells[0].IsReady() && Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed) { if (Program.Champion.Spells[2].IsReady() && !Program.Champion.Spells[0].IsReady(1000) && Program.Champion.ConfigMenu.Item("HEMODE").GetValue<StringList>().SelectedIndex == 2) { Program.Champion.Spells[2].Cast(ObjectManager.Player.ServerPosition + (args.Target.Position - ObjectManager.Player.ServerPosition).Normalized() * -Program.Champion.Spells[2].Range); return; } } var t = Target.Get(Program.Champion.Spells[0].Range + 50, true); if (Program.Champion.ConfigMenu.Item("CSHYKEY").GetValue<KeyBind>().Active || Program.Champion.ConfigMenu.Item("CFLASHKEY").GetValue<KeyBind>().Active) { if (t != null && !(Program.Champion as Riven).IsDoingFastQ && Program.Champion.Spells[0].IsReady()) { Program.Champion.Orbwalker.ForcedTarget = t; Program.Champion.Spells[0].Cast(t.ServerPosition, true); (Program.Champion as Riven).FastQCombo(true); return; } } if (s_DoAttack && Program.Champion.Spells[0].IsReady()) { if (t != null && (Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo || Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed || Program.Champion.ConfigMenu.Item("CSHYKEY").GetValue<KeyBind>().Active || Program.Champion.ConfigMenu.Item("CFLASHKEY").GetValue<KeyBind>().Active)) { Program.Champion.Orbwalker.ForcedTarget = t; //if (QStacks == 2) //{ // if (Program.Champion.Spells[1].IsReady() && Program.Champion.Spells[2].IsReady()) //e-q3-w // { // Program.Champion.Spells[2].Cast(t.ServerPosition); // Program.Champion.Spells[0].Cast(t.ServerPosition + (t.ServerPosition - ObjectManager.Player.ServerPosition).Normalized() * 40, true); // Program.Champion.Spells[1].Cast(true); // } //} //else Program.Champion.Spells[0].Cast(t.ServerPosition, true); return; //Program.Champion.Orbwalker.ResetAATimer(); } else if (Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.LaneClear) { var minion = MinionManager.GetMinions(400, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.MaxHealth).OrderBy(p => p.ServerPosition.Distance(ObjectManager.Player.ServerPosition)).FirstOrDefault(); if (minion != null) { if (minion.Health <= ObjectManager.Player.GetAutoAttackDamage(minion) * 2 && minion.IsJungleMinion()) SetAttack(false); else { Program.Champion.Spells[0].Cast(minion.ServerPosition, true); //Program.Champion.Orbwalker.ResetAATimer(); Program.Champion.Orbwalker.ForcedTarget = t; return; } } } } else { if(!Program.Champion.Spells[0].IsReady() && !Program.Champion.Spells[1].IsReady() && !Program.Champion.Spells[3].IsReady() && (Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo || Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed || Program.Champion.ConfigMenu.Item("CSHYKEY").GetValue<KeyBind>().Active || Program.Champion.ConfigMenu.Item("CFLASHKEY").GetValue<KeyBind>().Active)) { if((Program.Champion as Riven).IsCrestcentReady) (Program.Champion as Riven).CastCrescent(); } SetAttack(false); } } if(Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.None && Program.Champion.Spells[0].IsReady()) { if(Program.Champion.ConfigMenu.Item("LSEMIQJUNG").GetValue<bool>()) { if(args.Target is Obj_AI_Base) { var target = args.Target as Obj_AI_Base; if(target != null && target.IsValidTarget() && target.IsJungleMinion()) { Program.Champion.Spells[0].Cast(target.ServerPosition, true); } } } } if(Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo || Program.Champion.Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Mixed) { if (!(Program.Champion as Riven).IsDoingFastQ && Program.Champion.Spells[1].IsReady() && args.Target.IsValidTarget(Program.Champion.Spells[1].Range)) { (Program.Champion as Riven).CastCrescent(); Program.Champion.Spells[1].Cast(); } } }
public override void Draw() { this.X += this.XSpeed; this.Y += this.YSpeed; if (this.Y < this.Highest_Y) { DDUtils.Approach(ref this.YSpeed, 重力加速度, 0.9); } this.YSpeed = Math.Min(落下最高速度, this.YSpeed); int ix = SCommon.ToInt(this.X); int iy = SCommon.ToInt(this.Y); Around a2 = new Around(ix, iy, 2); int xDirSign = 0; int yDirSign = 0; if (this.Y < this.Highest_Y + 24.0) // ? 最高高度に近い { if ( a2.Table[0, 0].IsEnemyPataWall() || a2.Table[0, 1].IsEnemyPataWall() ) { xDirSign++; } if ( a2.Table[1, 0].IsEnemyPataWall() || a2.Table[1, 1].IsEnemyPataWall() ) { xDirSign--; } } else { if ( a2.Table[0, 0].IsEnemyPataWall() && a2.Table[0, 1].IsEnemyPataWall() ) { xDirSign++; } if ( a2.Table[1, 0].IsEnemyPataWall() && a2.Table[1, 1].IsEnemyPataWall() ) { xDirSign--; } } if ( !a2.Table[0, 0].IsEnemyPataWall() && a2.Table[0, 1].IsEnemyPataWall() || !a2.Table[1, 0].IsEnemyPataWall() && a2.Table[1, 1].IsEnemyPataWall() ) { yDirSign = -1; } else if ( a2.Table[0, 0].IsEnemyPataWall() && a2.Table[1, 0].IsEnemyPataWall() ) { yDirSign = 1; } else { this.YSpeed += 重力加速度; } if (xDirSign != 0) { this.XSpeed = Math.Abs(this.XSpeed) * xDirSign; } if (yDirSign != 0) { this.YSpeed = Math.Abs(this.YSpeed) * yDirSign; } if (!EnemyCommon.IsOutOfScreen_ForDraw(this)) { //DDDraw.SetBright(new I3Color(192, 32, 32)); // old DDDraw.SetBright(Game.I.Map.Design.EnemyColor_Pata); DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, SCommon.ToInt(this.X - DDGround.ICamera.X), SCommon.ToInt(this.Y - DDGround.ICamera.Y)); DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H); DDDraw.DrawEnd(); DDDraw.Reset(); this.Crash = DDCrashUtils.Rect_CenterSize(new D2Point(this.X, this.Y), new D2Size(GameConsts.TILE_W, GameConsts.TILE_H)); Game.I.タイル接近_敵描画_Points.Add(new D2Point(this.X, this.Y)); } }
protected override void Orbwalking_AfterAttack(SCommon.Orbwalking.AfterAttackArgs args) { if (Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.Combo) { if (Items.HasItem(3077) && Items.CanUseItem(3077)) Items.UseItem(3077); if (Items.HasItem(3074) && Items.CanUseItem(3074)) Items.UseItem(3074); if (Spells[Q].IsReady()) Spells[Q].Cast(); } else if(Orbwalker.ActiveMode == SCommon.Orbwalking.Orbwalker.Mode.LaneClear) { if (!args.Target.IsDead && !HaveFullFerocity && LaneClearQ) Spells[Q].Cast(); } }