diff --git a/logic/GameClass/GameObj/Character/Character.cs b/logic/GameClass/GameObj/Character/Character.cs index 65de726..9441ef1 100644 --- a/logic/GameClass/GameObj/Character/Character.cs +++ b/logic/GameClass/GameObj/Character/Character.cs @@ -615,6 +615,8 @@ namespace GameClass.GameObj { return true; } + if (targetObj.Type == GameObjType.Character && XY.Distance(targetObj.Position, this.Position) < this.Radius + targetObj.Radius) + return true; return false; } } diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs index 34eeba0..64f69f9 100644 --- a/logic/Gaming/ActionManager.cs +++ b/logic/Gaming/ActionManager.cs @@ -326,16 +326,16 @@ namespace Gaming (Math.Abs(player.Position.x - windowForClimb.Position.x) > GameData.numOfPosGridPerCell / 2) ? (GameData.numOfPosGridPerCell / 2 * (player.Position.x > windowForClimb.Position.x ? 1 : -1)) : 0, (Math.Abs(player.Position.y - windowForClimb.Position.y) > GameData.numOfPosGridPerCell / 2) ? (GameData.numOfPosGridPerCell / 2 * (player.Position.y > windowForClimb.Position.y ? 1 : -1)) : 0); - Character? characterInWindow = (Character?)gameMap.OneInTheSameCell(windowForClimb.Position - 2 * windowToPlayer, GameObjType.Character); - if (characterInWindow != null) - { - if (player.IsGhost() && !characterInWindow.IsGhost()) - characterManager.BeAttacked((Student)(characterInWindow), player.Attack(characterInWindow.Position, PlaceType.Null)); - return false; - } + /* Character? characterInWindow = (Character?)gameMap.OneInTheSameCell(windowForClimb.Position - 2 * windowToPlayer, GameObjType.Character); + if (characterInWindow != null) + { + if (player.IsGhost() && !characterInWindow.IsGhost()) + characterManager.BeAttacked((Student)(characterInWindow), player.Attack(characterInWindow.Position, PlaceType.Null)); + return false; + }*/ - Wall addWall = new Wall(windowForClimb.Position - 2 * windowToPlayer); - gameMap.Add(addWall); + //Wall addWall = new Wall(windowForClimb.Position - 2 * windowToPlayer); + // gameMap.Add(addWall); player.PlayerState = PlayerStateType.ClimbingThroughWindows; windowForClimb.WhoIsClimbing = player; @@ -360,7 +360,7 @@ namespace Gaming player.ReSetPos(windowToPlayer + windowForClimb.Position, PlaceType.Window); player.MoveSpeed = player.SpeedOfClimbingThroughWindows; - moveEngine.MoveObj(player, (int)(windowToPlayer.Length() * 1000 / player.MoveSpeed), (-1 * windowToPlayer).Angle()); + moveEngine.MoveObj(player, (int)(windowToPlayer.Length() * 3.0 * 1000 / player.MoveSpeed), (-1 * windowToPlayer).Angle()); new FrameRateTaskExecutor( loopCondition: () => player.PlayerState == PlayerStateType.ClimbingThroughWindows && gameMap.Timer.IsGaming, @@ -376,7 +376,7 @@ namespace Gaming player.ReSetPos(PosJumpOff, gameMap.GetPlaceType(PosJumpOff)); player.MoveSpeed = player.ReCalculateBuff(BuffType.AddSpeed, player.OrgMoveSpeed, GameData.MaxSpeed, GameData.MinSpeed); windowForClimb.WhoIsClimbing = null; - gameMap.Remove(addWall); + // gameMap.Remove(addWall); if (player.PlayerState == PlayerStateType.ClimbingThroughWindows) { player.PlayerState = PlayerStateType.Null;