public void SaveSpell() { MoveEntry entry = GetEntry(); GameData.MoveDex[spellNum] = entry; GameData.MoveDex[spellNum].Save(spellNum); }
private void Anim_Changed(object sender, EventArgs e) { if (chkAutoTest.Checked) { MoveEntry entry = GetEntry(); Logic.Gameplay.Processor.MockAttack(entry); } }
internal void MoveReq(Direction dir, byte seq) { m_OutstandingMoves++; FastWalkKey++; MoveEntry e = new MoveEntry(); if (!m_MoveInfo.ContainsKey(seq)) { m_MoveInfo.TryAdd(seq, e); } else { m_MoveInfo[seq] = e; } e.IsStep = (dir & Direction.Mask) == (Direction & Direction.Mask); e.Dir = dir; ProcessMove(dir); e.Position = Position; if (Body != 0x03DB && !IsGhost && ((int)(e.Dir & Direction.Mask)) % 2 == 0 && Engine.MainWindow.AutoOpenDoors.Checked && CheckHiddedOpenDoor()) { int x = Position.X, y = Position.Y; Utility.Offset(e.Dir, ref x, ref y); int z = CalcZ; foreach (Item i in World.Items.Values) { if (i.Position.X == x && i.Position.Y == y) { if (i.IsDoor) { if (i.Position.Z - 15 <= z && i.Position.Z + 15 >= z) { if (m_LastDoor != i.Serial || m_LastDoorTime + TimeSpan.FromSeconds(1) < DateTime.Now) { m_LastDoor = i.Serial; m_LastDoorTime = DateTime.Now; m_OpenDoorReq.Start(); break; } } } } } } e.FilterAck = false; m_WalkSeq = (byte)(seq >= 255 ? 1 : seq + 1); }
public void TestMoveEntryConstruction() { var b = new Board(); var m = new Move( new Square(Files.a, Ranks.one), new Square(Files.b, Ranks.one), MoveType.Normal); var moveEntry = new MoveEntry(m, b.Position); Assert.Empty(moveEntry.Position); Assert.Equal(m, moveEntry.Move); }
public void TestMoveEntryStoresThePast() { var b = new Board(); var m = new Move( new Square(Files.a, Ranks.one), new Square(Files.b, Ranks.one), MoveType.Normal); var moveEntry = new MoveEntry(m, b); b.AddPiece <MockedPiece>(new Square(Files.a, Ranks.one), true); Assert.Empty(moveEntry.Position); }
public void MoveReq(Direction dir, byte seq) { m_OutstandingMoves++; FastWalkKey++; MoveEntry e = new MoveEntry(); m_MoveInfo[seq] = e; e.IsStep = (dir & Direction.Mask) == (Direction & Direction.Mask); e.Dir = dir; ProcessMove(dir); // shouldnt this be in MoveAck?!? e.Position = Position; if (Body != 0x03DB && !IsGhost && ((int)(e.Dir & Direction.Mask)) % 2 == 0 && Config.GetBool("AutoOpenDoors") && ClientCommunication.AllowBit(FeatureBit.AutoOpenDoors)) { int x = Position.X, y = Position.Y; Utility.Offset(e.Dir, ref x, ref y); int z = CalcZ; foreach (Item i in World.Items.Values) { if (i.Position.X == x && i.Position.Y == y && i.IsDoor && i.Position.Z - 15 <= z && i.Position.Z + 15 >= z && (m_LastDoor != i.Serial || m_LastDoorTime + TimeSpan.FromSeconds(1) < DateTime.UtcNow)) { m_LastDoor = i.Serial; m_LastDoorTime = DateTime.UtcNow; m_OpenDoorReq.Start(); break; } } } /*if ( m_OutstandingMoves < 5 && !Macros.WalkAction.IsMacroWalk( seq ) && Config.GetBool( "SmoothWalk" ) ) * { * e.FilterAck = true; * ClientCommunication.SendToClient( new MoveAcknowledge( seq, Notoriety ) ); * } * else * { * e.FilterAck = false; * }*/ e.FilterAck = false; m_WalkSeq = (byte)(seq >= 255 ? 1 : seq + 1); }
public void MoveReq(Direction dir, byte seq) { MoveEntry e = new MoveEntry(); m_MoveInfo[seq] = e; e.IsStep = (dir & Direction.Mask) == (Direction & Direction.Mask); e.Dir = dir; ProcessMove(dir); e.Position = Position; m_WalkSeq = (byte)(seq >= 255 ? 1 : seq + 1); }
public BattleSetup(BattleSetup copy) { Attacker = copy.Attacker; Defender = copy.Defender; DefenderTile = copy.DefenderTile; AllTargets = copy.AllTargets; moveSlot = copy.moveSlot; moveIndex = copy.moveIndex; Move = new MoveEntry(copy.Move); Cancel = copy.Cancel; Multiplier = copy.Multiplier; BattleTags = copy.BattleTags; TimeForHit = copy.TimeForHit; TotalWaveTime = copy.TotalWaveTime; TotalWaves = copy.TotalWaves; }
public bool MoveAck(byte seq) { m_OutstandingMoves--; MoveEntry e = (MoveEntry)m_MoveInfo[seq]; if (e != null) { if (e.IsStep && !IsGhost) { StealthSteps.OnMove(); } return(!e.FilterAck); } else { return(true); } }
public void TestAdd() { IChess chess = new MockedChess(new Dictionary <Square, IPiece>() { { new Square(Files.a, Ranks.one), new MockedPiece(true) } }); var move = new Move( new Square(Files.a, Ranks.one), new Square(Files.b, Ranks.two), MoveType.Normal); var entry = new MoveEntry(move, chess.Position); ((Chess)chess).Add(entry); Assert.Single(chess.MoveEntries); Assert.Equal(chess.Position.Keys, chess.MoveEntries.Last().Position.Keys); Assert.All(chess.Position.Keys, k => { Assert.True(chess.MoveEntries.Last().Position[k] is MockedPiece); Assert.True(chess.MoveEntries.Last().Position[k].Color); }); Assert.Equal(move, chess.MoveEntries.Last().Move); }
public void MoveReq( Direction dir, byte seq ) { MoveEntry e = new MoveEntry(); m_MoveInfo[seq] = e; e.IsStep = (dir & Direction.Mask) == (Direction & Direction.Mask); e.Dir = dir; ProcessMove( dir ); e.Position = Position; m_WalkSeq = (byte)(seq >= 255 ? 1 : seq+1); }
public void MoveReq( Direction dir, byte seq ) { m_OutstandingMoves++; FastWalkKey++; MoveEntry e = new MoveEntry(); m_MoveInfo[seq] = e; e.IsStep = (dir & Direction.Mask) == (Direction & Direction.Mask); e.Dir = dir; ProcessMove( dir ); // shouldnt this be in MoveAck?!? e.Position = Position; if ( Body != 0x03DB && !IsGhost && ((int)(e.Dir&Direction.Mask))%2 == 0 && Config.GetBool( "AutoOpenDoors" ) && ClientCommunication.AllowBit( FeatureBit.AutoOpenDoors )) { int x = Position.X, y = Position.Y; Utility.Offset( e.Dir, ref x, ref y ); int z = CalcZ; foreach ( Item i in World.Items.Values ) { if ( i.Position.X == x && i.Position.Y == y && i.IsDoor && i.Position.Z - 15 <= z && i.Position.Z + 15 >= z && ( m_LastDoor != i.Serial || m_LastDoorTime+TimeSpan.FromSeconds( 1 ) < DateTime.Now ) ) { m_LastDoor = i.Serial; m_LastDoorTime = DateTime.Now; m_OpenDoorReq.Start(); break; } } } /*if ( m_OutstandingMoves < 5 && !Macros.WalkAction.IsMacroWalk( seq ) && Config.GetBool( "SmoothWalk" ) ) { e.FilterAck = true; ClientCommunication.SendToClient( new MoveAcknowledge( seq, Notoriety ) ); } else { e.FilterAck = false; }*/ e.FilterAck = false; m_WalkSeq = (byte)(seq >= 255 ? 1 : seq+1); }
private void BtnTest_Click(object sender, EventArgs e) { MoveEntry entry = GetEntry(); Logic.Gameplay.Processor.MockAttack(entry); }
private MoveEntry GetEntry() { MoveEntry entry = new MoveEntry { Name = txtName.Text, Power = (int)nudPower.Value, Accuracy = (int)nudAccuracy.Value, Desc = txtDescription.Text, Type = (Enums.Element)cbType.SelectedIndex, Category = (Enums.MoveCategory)cbCategory.SelectedIndex, Effect = (int)nudEffect.Value, Effect1 = (int)nudEffect1.Value, Effect2 = (int)nudEffect2.Value, Effect3 = (int)nudEffect3.Value, Contact = chkContact.Checked, SoundBased = chkSound.Checked, FistBased = chkFist.Checked, PulseBased = chkPulse.Checked, BulletBased = chkBullet.Checked, JawBased = chkJaw.Checked }; entry.Range.RangeType = (Enums.RangeType)cbRange.SelectedIndex; entry.Range.Distance = (int)nudDistance.Value; entry.Range.Mobility = (int)nudMobility.Value; entry.Range.CutsCorners = chkCorners.Checked; entry.Range.HitsSelf = chkSelf.Checked; entry.Range.HitsFriend = chkFriend.Checked; entry.Range.HitsFoe = chkFoe.Checked; entry.StartAnim.AnimType = (Logic.Display.MoveAnimationType)cbStartAnim.SelectedIndex; entry.StartAnim.AnimIndex = (int)nudStartIndex.Value; entry.StartAnim.FrameLength = RenderTime.FromMillisecs((int)nudStartLength.Value); entry.StartAnim.Anim1 = (int)nudStartData1.Value; entry.StartAnim.Anim2 = (int)nudStartData2.Value; entry.StartAnim.Anim3 = (int)nudStartData3.Value; entry.StartUserAnim.ActionType = (Logic.Display.CharSprite.ActionType)cbStartUser.SelectedIndex; entry.StartSound = (int)nudStartSound.Value; entry.MidAnim.AnimType = (Logic.Display.MoveAnimationType)cbMidAnim.SelectedIndex; entry.MidAnim.AnimIndex = (int)nudMidIndex.Value; entry.MidAnim.FrameLength = RenderTime.FromMillisecs((int)nudMidLength.Value); entry.MidAnim.Anim1 = (int)nudMidData1.Value; entry.MidAnim.Anim2 = (int)nudMidData2.Value; entry.MidAnim.Anim3 = (int)nudMidData3.Value; entry.MidUserAnim.ActionType = (Logic.Display.CharSprite.ActionType)cbMidUser.SelectedIndex; entry.MidTargetAnim.ActionType = (Logic.Display.CharSprite.ActionType)cbMidTarget.SelectedIndex; entry.MidSound = (int)nudMidSound.Value; entry.EndAnim.AnimType = (Logic.Display.MoveAnimationType)cbEndAnim.SelectedIndex; entry.EndAnim.AnimIndex = (int)nudEndIndex.Value; entry.EndAnim.FrameLength = RenderTime.FromMillisecs((int)nudEndLength.Value); entry.EndAnim.Anim1 = (int)nudEndData1.Value; entry.EndAnim.Anim2 = (int)nudEndData2.Value; entry.EndAnim.Anim3 = (int)nudEndData3.Value; entry.EndUserAnim.ActionType = (Logic.Display.CharSprite.ActionType)cbEndUser.SelectedIndex; entry.EndTargetAnim.ActionType = (Logic.Display.CharSprite.ActionType)cbEndTarget.SelectedIndex; entry.EndSound = (int)nudEndSound.Value; return(entry); }
public void LoadSpell(int index) { spellNum = index; MoveEntry entry = GameData.MoveDex[index]; txtName.Text = entry.Name; nudPower.Value = entry.Power; nudAccuracy.Value = entry.Accuracy; txtDescription.Text = entry.Desc; cbType.SelectedIndex = (int)entry.Type; cbCategory.SelectedIndex = (int)entry.Category; nudEffect.Value = entry.Effect; nudEffect1.Value = entry.Effect1; nudEffect2.Value = entry.Effect2; nudEffect3.Value = entry.Effect3; chkContact.Checked = entry.Contact; chkSound.Checked = entry.SoundBased; chkFist.Checked = entry.FistBased; chkPulse.Checked = entry.PulseBased; chkBullet.Checked = entry.BulletBased; chkJaw.Checked = entry.JawBased; cbRange.SelectedIndex = (int)entry.Range.RangeType; nudDistance.Value = entry.Range.Distance; nudMobility.Value = entry.Range.Mobility; chkCorners.Checked = entry.Range.CutsCorners; chkSelf.Checked = entry.Range.HitsSelf; chkFriend.Checked = entry.Range.HitsFriend; chkFoe.Checked = entry.Range.HitsFoe; cbStartAnim.SelectedIndex = (int)entry.StartAnim.AnimType; nudStartIndex.Value = entry.StartAnim.AnimIndex; nudStartLength.Value = entry.StartAnim.FrameLength.ToMillisecs(); nudStartData1.Value = entry.StartAnim.Anim1; nudStartData2.Value = entry.StartAnim.Anim2; nudStartData3.Value = entry.StartAnim.Anim3; cbStartUser.SelectedIndex = (int)entry.StartUserAnim.ActionType; nudStartSound.Value = entry.StartSound; cbMidAnim.SelectedIndex = (int)entry.MidAnim.AnimType; nudMidIndex.Value = entry.MidAnim.AnimIndex; nudMidLength.Value = entry.MidAnim.FrameLength.ToMillisecs(); nudMidData1.Value = entry.MidAnim.Anim1; nudMidData2.Value = entry.MidAnim.Anim2; nudMidData3.Value = entry.MidAnim.Anim3; cbMidUser.SelectedIndex = (int)entry.MidUserAnim.ActionType; cbMidTarget.SelectedIndex = (int)entry.MidTargetAnim.ActionType; nudMidSound.Value = entry.MidSound; cbEndAnim.SelectedIndex = (int)entry.EndAnim.AnimType; nudEndIndex.Value = entry.EndAnim.AnimIndex; nudEndLength.Value = entry.EndAnim.FrameLength.ToMillisecs(); nudEndData1.Value = entry.EndAnim.Anim1; nudEndData2.Value = entry.EndAnim.Anim2; nudEndData3.Value = entry.EndAnim.Anim3; cbEndUser.SelectedIndex = (int)entry.EndUserAnim.ActionType; cbEndTarget.SelectedIndex = (int)entry.EndTargetAnim.ActionType; nudEndSound.Value = entry.EndSound; }