fix: 🐛 fix the bugs of the Skills "Punish" and "Howl"

This commit is contained in:
shangfengh 2023-03-31 10:02:25 +08:00
parent b9d72f1d2f
commit a13e5e8e99
4 changed files with 13 additions and 14 deletions

View File

@ -7,8 +7,8 @@ enum BulletType
NULL_BULLET_TYPE = 0;
FLYING_KNIFE = 1;
COMMON_ATTACK_OF_TRICKER = 2;
FAST_BULLET = 3;
ORDINARY_BULLET = 4;
FAST_BULLET = 3;//BombBomb
ORDINARY_BULLET = 4;// JumpyDumpty
ATOM_BOMB = 5;
}
@ -117,7 +117,7 @@ enum TrickerType
NULL_TRICKER_TYPE = 0;
ASSASSIN = 1;
TRICKERTYPE2 = 2;//KLEE
TRICKERTYPE3 = 3;
TRICKERTYPE3 = 3;// ANoisyPerson
TRICKERTYPE4 = 4;
}

View File

@ -89,11 +89,10 @@ namespace Gaming
{ IsBackground = true }.Start();
return true;
}
public static bool BackSwing(Character? player, int time, bool special)
public static bool BackSwing(Character? player, int time)
{
if (player == null && time <= 0) return false;
if (!special && player.PlayerState != PlayerStateType.TryingToAttack) return false;
if (special && (player.PlayerState == PlayerStateType.Swinging || (!player.Commandable() && player.PlayerState != PlayerStateType.TryingToAttack))) return false;
if (player.PlayerState == PlayerStateType.Swinging || (!player.Commandable() && player.PlayerState != PlayerStateType.TryingToAttack)) return false;
player.PlayerState = PlayerStateType.Swinging;
new Thread
@ -202,14 +201,14 @@ namespace Gaming
{
if (objBeingShot == null)
{
BackSwing((Character?)bullet.Parent, bullet.Backswing, false);
BackSwing((Character?)bullet.Parent, bullet.Backswing);
return;
}
Debugger.Output(bullet, bullet.TypeOfBullet.ToString());
BombObj(bullet, objBeingShot);
BackSwing((Character?)bullet.Parent, bullet.RecoveryFromHit, false);
BackSwing((Character?)bullet.Parent, bullet.RecoveryFromHit);
return;
}

View File

@ -104,7 +104,7 @@ namespace Gaming
{
foreach (Character character in gameMap.GameObjDict[GameObjType.Character])
{
if (!player.IsGhost() && XY.Distance(character.Position, player.Position) <= player.ViewRange)
if (!character.IsGhost() && XY.Distance(character.Position, player.Position) <= player.ViewRange)
{
if (AttackManager.BeStunned(character, GameData.TimeOfStudentFaintingWhenHowl))
player.AddScore(GameData.TrickerScoreStudentBeStunned(GameData.TimeOfStudentFaintingWhenHowl));
@ -116,7 +116,7 @@ namespace Gaming
{
gameMap.GameObjLockDict[GameObjType.Character].ExitReadLock();
}
AttackManager.BackSwing(player, GameData.TimeOfGhostSwingingAfterHowl, true);
AttackManager.BackSwing(player, GameData.TimeOfGhostSwingingAfterHowl);
Debugger.Output(player, "howled!");
},
() =>
@ -132,9 +132,9 @@ namespace Gaming
{
foreach (Character character in gameMap.GameObjDict[GameObjType.Character])
{
if (player.IsGhost() &&
(player.PlayerState == PlayerStateType.TryingToAttack || player.PlayerState == PlayerStateType.Swinging
|| player.PlayerState == PlayerStateType.UsingSkill || player.PlayerState == PlayerStateType.LockingOrOpeningTheDoor || player.PlayerState == PlayerStateType.OpeningTheChest)
if (character.IsGhost() &&
(character.PlayerState == PlayerStateType.TryingToAttack || character.PlayerState == PlayerStateType.Swinging
|| character.PlayerState == PlayerStateType.UsingSkill || character.PlayerState == PlayerStateType.LockingOrOpeningTheDoor || character.PlayerState == PlayerStateType.OpeningTheChest)
&& gameMap.CanSee(player, character))
{
if (AttackManager.BeStunned(character, GameData.TimeOfGhostFaintingWhenPunish + (player.MaxHp - player.HP) / GameData.timeFactorOfGhostFainting))

View File

@ -4,7 +4,7 @@ start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --ip 0.0.0.0 --port 8888 --s
ping -n 2 127.0.0.1 > NUL
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 4 --type 2 --occupation 2
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 4 --type 2 --occupation 3
ping -n 2 127.0.0.1 > NUL