| @@ -927,232 +927,230 @@ namespace Client | |||||
| { | { | ||||
| if (!isPlaybackMode) | if (!isPlaybackMode) | ||||
| { | { | ||||
| if(Keyboard.Modifiers == ModifierKeys.Control) | |||||
| { | |||||
| switch (e.Key) | |||||
| { | |||||
| case Key.D1: | |||||
| PropMsg msgP1 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.AddSpeed, | |||||
| }; | |||||
| client.PickProp(msgP1); | |||||
| break; | |||||
| case Key.D2: | |||||
| PropMsg msgP2 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.AddLifeOrAp, | |||||
| }; | |||||
| client.PickProp(msgP2); | |||||
| break; | |||||
| case Key.D3: | |||||
| PropMsg msgP3 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.AddHpOrAp, | |||||
| }; | |||||
| client.PickProp(msgP3); | |||||
| break; | |||||
| case Key.D4: | |||||
| PropMsg msgP4 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.ShieldOrSpear, | |||||
| }; | |||||
| client.PickProp(msgP4); | |||||
| break; | |||||
| case Key.D5: | |||||
| PropMsg msgP5 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.Key3, | |||||
| }; | |||||
| client.PickProp(msgP5); | |||||
| break; | |||||
| case Key.D6: | |||||
| PropMsg msgP6 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.Key5, | |||||
| }; | |||||
| client.PickProp(msgP6); | |||||
| break; | |||||
| case Key.D7: | |||||
| PropMsg msgP7 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.Key6, | |||||
| }; | |||||
| client.PickProp(msgP7); | |||||
| break; | |||||
| default: | |||||
| break; | |||||
| } | |||||
| } | |||||
| else if (Keyboard.Modifiers == ModifierKeys.Alt) | |||||
| { | |||||
| switch (e.Key) | |||||
| { | |||||
| case Key.D1: | |||||
| PropMsg msgP1 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.AddSpeed, | |||||
| }; | |||||
| client.UseProp(msgP1); | |||||
| break; | |||||
| case Key.D2: | |||||
| PropMsg msgP2 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.AddLifeOrAp, | |||||
| }; | |||||
| client.UseProp(msgP2); | |||||
| break; | |||||
| case Key.D3: | |||||
| PropMsg msgP3 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.AddHpOrAp, | |||||
| }; | |||||
| client.UseProp(msgP3); | |||||
| break; | |||||
| case Key.D4: | |||||
| PropMsg msgP4 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.ShieldOrSpear, | |||||
| }; | |||||
| client.UseProp(msgP4); | |||||
| break; | |||||
| case Key.D5: | |||||
| PropMsg msgP5 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.Key3, | |||||
| }; | |||||
| client.UseProp(msgP5); | |||||
| break; | |||||
| case Key.D6: | |||||
| PropMsg msgP6 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.Key5, | |||||
| }; | |||||
| client.UseProp(msgP6); | |||||
| break; | |||||
| case Key.D7: | |||||
| PropMsg msgP7 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.Key6, | |||||
| }; | |||||
| client.UseProp(msgP7); | |||||
| break; | |||||
| default: | |||||
| break; | |||||
| } | |||||
| } | |||||
| else if(Keyboard.Modifiers == ModifierKeys.Shift) | |||||
| { | |||||
| switch (e.Key) | |||||
| { | |||||
| case Key.D1: | |||||
| PropMsg msgP1 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.AddSpeed, | |||||
| }; | |||||
| client.ThrowProp(msgP1); | |||||
| break; | |||||
| case Key.D2: | |||||
| PropMsg msgP2 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.AddLifeOrAp, | |||||
| }; | |||||
| client.ThrowProp(msgP2); | |||||
| break; | |||||
| case Key.D3: | |||||
| PropMsg msgP3 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.AddHpOrAp, | |||||
| }; | |||||
| client.ThrowProp(msgP3); | |||||
| break; | |||||
| case Key.D4: | |||||
| PropMsg msgP4 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.ShieldOrSpear, | |||||
| }; | |||||
| client.ThrowProp(msgP4); | |||||
| break; | |||||
| case Key.D5: | |||||
| PropMsg msgP5 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.Key3, | |||||
| }; | |||||
| client.ThrowProp(msgP5); | |||||
| break; | |||||
| case Key.D6: | |||||
| PropMsg msgP6 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.Key5, | |||||
| }; | |||||
| client.ThrowProp(msgP6); | |||||
| break; | |||||
| case Key.D7: | |||||
| PropMsg msgP7 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.Key6, | |||||
| }; | |||||
| client.ThrowProp(msgP7); | |||||
| break; | |||||
| default: | |||||
| break; | |||||
| } | |||||
| } | |||||
| else if (Keyboard.Modifiers == ModifierKeys.Windows) | |||||
| { | |||||
| switch (e.Key) | |||||
| { | |||||
| case Key.D0: | |||||
| SkillMsg msgS0 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| SkillId = 0, | |||||
| }; | |||||
| client.UseSkill(msgS0); | |||||
| break; | |||||
| case Key.D1: | |||||
| SkillMsg msgS1 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| SkillId = 1, | |||||
| }; | |||||
| client.UseSkill(msgS1); | |||||
| break; | |||||
| case Key.D2: | |||||
| SkillMsg msgS2 = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| SkillId = 2, | |||||
| }; | |||||
| client.UseSkill(msgS2); | |||||
| break; | |||||
| default: | |||||
| break; | |||||
| } | |||||
| } | |||||
| else | |||||
| { | |||||
| //if(Keyboard.Modifiers == ModifierKeys.Control) | |||||
| //{ | |||||
| // switch (e.Key) | |||||
| // { | |||||
| // case Key.D1: | |||||
| // PropMsg msgP1 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.AddSpeed, | |||||
| // }; | |||||
| // client.PickProp(msgP1); | |||||
| // break; | |||||
| // case Key.D2: | |||||
| // PropMsg msgP2 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.AddLifeOrAp, | |||||
| // }; | |||||
| // client.PickProp(msgP2); | |||||
| // break; | |||||
| // case Key.D3: | |||||
| // PropMsg msgP3 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.AddHpOrAp, | |||||
| // }; | |||||
| // client.PickProp(msgP3); | |||||
| // break; | |||||
| // case Key.D4: | |||||
| // PropMsg msgP4 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.ShieldOrSpear, | |||||
| // }; | |||||
| // client.PickProp(msgP4); | |||||
| // break; | |||||
| // case Key.D5: | |||||
| // PropMsg msgP5 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.Key3, | |||||
| // }; | |||||
| // client.PickProp(msgP5); | |||||
| // break; | |||||
| // case Key.D6: | |||||
| // PropMsg msgP6 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.Key5, | |||||
| // }; | |||||
| // client.PickProp(msgP6); | |||||
| // break; | |||||
| // case Key.D7: | |||||
| // PropMsg msgP7 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.Key6, | |||||
| // }; | |||||
| // client.PickProp(msgP7); | |||||
| // break; | |||||
| // default: | |||||
| // break; | |||||
| // } | |||||
| //} | |||||
| //else if (Keyboard.Modifiers == ModifierKeys.Alt) | |||||
| //{ | |||||
| // switch (e.Key) | |||||
| // { | |||||
| // case Key.D1: | |||||
| // PropMsg msgP1 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.AddSpeed, | |||||
| // }; | |||||
| // client.UseProp(msgP1); | |||||
| // break; | |||||
| // case Key.D2: | |||||
| // PropMsg msgP2 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.AddLifeOrAp, | |||||
| // }; | |||||
| // client.UseProp(msgP2); | |||||
| // break; | |||||
| // case Key.D3: | |||||
| // PropMsg msgP3 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.AddHpOrAp, | |||||
| // }; | |||||
| // client.UseProp(msgP3); | |||||
| // break; | |||||
| // case Key.D4: | |||||
| // PropMsg msgP4 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.ShieldOrSpear, | |||||
| // }; | |||||
| // client.UseProp(msgP4); | |||||
| // break; | |||||
| // case Key.D5: | |||||
| // PropMsg msgP5 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.Key3, | |||||
| // }; | |||||
| // client.UseProp(msgP5); | |||||
| // break; | |||||
| // case Key.D6: | |||||
| // PropMsg msgP6 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.Key5, | |||||
| // }; | |||||
| // client.UseProp(msgP6); | |||||
| // break; | |||||
| // case Key.D7: | |||||
| // PropMsg msgP7 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.Key6, | |||||
| // }; | |||||
| // client.UseProp(msgP7); | |||||
| // break; | |||||
| // default: | |||||
| // break; | |||||
| // } | |||||
| //} | |||||
| //else if(Keyboard.Modifiers == ModifierKeys.Shift) | |||||
| //{ | |||||
| // switch (e.Key) | |||||
| // { | |||||
| // case Key.D1: | |||||
| // PropMsg msgP1 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.AddSpeed, | |||||
| // }; | |||||
| // client.ThrowProp(msgP1); | |||||
| // break; | |||||
| // case Key.D2: | |||||
| // PropMsg msgP2 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.AddLifeOrAp, | |||||
| // }; | |||||
| // client.ThrowProp(msgP2); | |||||
| // break; | |||||
| // case Key.D3: | |||||
| // PropMsg msgP3 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.AddHpOrAp, | |||||
| // }; | |||||
| // client.ThrowProp(msgP3); | |||||
| // break; | |||||
| // case Key.D4: | |||||
| // PropMsg msgP4 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.ShieldOrSpear, | |||||
| // }; | |||||
| // client.ThrowProp(msgP4); | |||||
| // break; | |||||
| // case Key.D5: | |||||
| // PropMsg msgP5 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.Key3, | |||||
| // }; | |||||
| // client.ThrowProp(msgP5); | |||||
| // break; | |||||
| // case Key.D6: | |||||
| // PropMsg msgP6 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.Key5, | |||||
| // }; | |||||
| // client.ThrowProp(msgP6); | |||||
| // break; | |||||
| // case Key.D7: | |||||
| // PropMsg msgP7 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // PropType = PropType.Key6, | |||||
| // }; | |||||
| // client.ThrowProp(msgP7); | |||||
| // break; | |||||
| // default: | |||||
| // break; | |||||
| // } | |||||
| //} | |||||
| //else if (Keyboard.Modifiers == ModifierKeys.Windows) | |||||
| //{ | |||||
| // switch (e.Key) | |||||
| // { | |||||
| // case Key.D0: | |||||
| // SkillMsg msgS0 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // SkillId = 0, | |||||
| // }; | |||||
| // client.UseSkill(msgS0); | |||||
| // break; | |||||
| // case Key.D1: | |||||
| // SkillMsg msgS1 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // SkillId = 1, | |||||
| // }; | |||||
| // client.UseSkill(msgS1); | |||||
| // break; | |||||
| // case Key.D2: | |||||
| // SkillMsg msgS2 = new() | |||||
| // { | |||||
| // PlayerId = playerID, | |||||
| // SkillId = 2, | |||||
| // }; | |||||
| // client.UseSkill(msgS2); | |||||
| // break; | |||||
| // default: | |||||
| // break; | |||||
| // } | |||||
| //} | |||||
| switch (e.Key) | switch (e.Key) | ||||
| { | { | ||||
| case Key.W: | case Key.W: | ||||
| @@ -1273,9 +1271,56 @@ namespace Client | |||||
| }; | }; | ||||
| client.EndAllAction(msgE); | client.EndAllAction(msgE); | ||||
| break; | break; | ||||
| case Key.F: | |||||
| PropMsg msgF = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType= PropType.NullPropType, | |||||
| }; | |||||
| client.PickProp(msgF); | |||||
| break; | |||||
| case Key.C: | |||||
| PropMsg msgC = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.NullPropType, | |||||
| }; | |||||
| client.ThrowProp(msgC); | |||||
| break; | |||||
| case Key.V: | |||||
| PropMsg msgV = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| PropType = PropType.NullPropType, | |||||
| }; | |||||
| client.UseProp(msgV); | |||||
| break; | |||||
| case Key.B: | |||||
| SkillMsg msgB = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| SkillId = 0, | |||||
| }; | |||||
| client.UseSkill(msgB); | |||||
| break; | |||||
| case Key.N: | |||||
| SkillMsg msgN = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| SkillId = 1, | |||||
| }; | |||||
| client.UseSkill(msgN); | |||||
| break; | |||||
| case Key.M: | |||||
| SkillMsg msgM = new() | |||||
| { | |||||
| PlayerId = playerID, | |||||
| SkillId = 2, | |||||
| }; | |||||
| client.UseSkill(msgM); | |||||
| break; | |||||
| default: | default: | ||||
| break; | break; | ||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -464,11 +464,20 @@ namespace GameClass.GameObj | |||||
| { | { | ||||
| lock (gameObjLock) | lock (gameObjLock) | ||||
| { | { | ||||
| foreach (Prop prop in propInventory) | |||||
| if (propType == PropType.Null) | |||||
| { | { | ||||
| if (prop.GetPropType() == propType) | |||||
| return prop; | |||||
| foreach (Prop prop in propInventory) | |||||
| { | |||||
| if (prop.GetPropType() != PropType.Null) | |||||
| return prop; | |||||
| } | |||||
| } | } | ||||
| else | |||||
| foreach (Prop prop in propInventory) | |||||
| { | |||||
| if (prop.GetPropType() == propType) | |||||
| return prop; | |||||
| } | |||||
| return new NullProp(); | return new NullProp(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -96,7 +96,7 @@ namespace GameClass.GameObj | |||||
| case CanBeginToCharge: | case CanBeginToCharge: | ||||
| return ActiveSkillType.CanBeginToCharge; | return ActiveSkillType.CanBeginToCharge; | ||||
| case Punish: | case Punish: | ||||
| return ActiveSkillType.Publish; | |||||
| return ActiveSkillType.Punish; | |||||
| default: | default: | ||||
| return ActiveSkillType.Null; | return ActiveSkillType.Null; | ||||
| } | } | ||||
| @@ -299,7 +299,7 @@ namespace Gaming | |||||
| if (!player.Commandable()) | if (!player.Commandable()) | ||||
| return false; | return false; | ||||
| XY res = new XY // 子弹紧贴人物生成。 | |||||
| XY res = player.Position + new XY // 子弹紧贴人物生成。 | |||||
| ( | ( | ||||
| (int)((player.Radius + BulletFactory.BulletRadius(player.BulletOfPlayer)) * Math.Cos(angle)), | (int)((player.Radius + BulletFactory.BulletRadius(player.BulletOfPlayer)) * Math.Cos(angle)), | ||||
| (int)((player.Radius + BulletFactory.BulletRadius(player.BulletOfPlayer)) * Math.Sin(angle)) | (int)((player.Radius + BulletFactory.BulletRadius(player.BulletOfPlayer)) * Math.Sin(angle)) | ||||
| @@ -358,17 +358,17 @@ namespace Gaming | |||||
| _ = attackManager.Attack(player, angle); | _ = attackManager.Attack(player, angle); | ||||
| } | } | ||||
| } | } | ||||
| public void UseProp(long playerID, PropType propType) | |||||
| public void UseProp(long playerID, PropType propType = PropType.Null) | |||||
| { | { | ||||
| if (!gameMap.Timer.IsGaming) | if (!gameMap.Timer.IsGaming) | ||||
| return; | return; | ||||
| Character? player = gameMap.FindPlayer(playerID); | Character? player = gameMap.FindPlayer(playerID); | ||||
| if (player != null) | if (player != null) | ||||
| { | { | ||||
| propManager.UseProp(player, propType); | |||||
| PropManager.UseProp(player, propType); | |||||
| } | } | ||||
| } | } | ||||
| public void ThrowProp(long playerID, PropType propType) | |||||
| public void ThrowProp(long playerID, PropType propType = PropType.Null) | |||||
| { | { | ||||
| if (!gameMap.Timer.IsGaming) | if (!gameMap.Timer.IsGaming) | ||||
| return; | return; | ||||
| @@ -21,7 +21,7 @@ namespace Gaming | |||||
| private readonly List<XY> availableCellForGenerateProp; | private readonly List<XY> availableCellForGenerateProp; | ||||
| public void UseProp(Character player, PropType propType) | |||||
| public static void UseProp(Character player, PropType propType) | |||||
| { | { | ||||
| if (player.IsResetting) | if (player.IsResetting) | ||||
| return; | return; | ||||
| @@ -49,9 +49,9 @@ namespace Gaming | |||||
| { | { | ||||
| if (character.IsGhost() != player.IsGhost() && XY.Distance(player.Position + new XY(player.FacingDirection, player.Radius), character.Position) <= character.Radius) | if (character.IsGhost() != player.IsGhost() && XY.Distance(player.Position + new XY(player.FacingDirection, player.Radius), character.Position) <= character.Radius) | ||||
| { | { | ||||
| AttackManager.BeStunned(character, GameData.TimeOfGhostFainting); | |||||
| player.AddScore(GameData.StudentScoreTrickerBeStunned); | |||||
| AttackManager.BeStunned(player, GameData.TimeOfStudentFainting); | |||||
| AttackManager.BeStunned(character, GameData.TimeOfGhostFaintingWhenCharge); | |||||
| player.AddScore(GameData.StudentScoreTrickerBeStunned(GameData.TimeOfGhostFaintingWhenCharge)); | |||||
| AttackManager.BeStunned(player, GameData.TimeOfStudentFaintingWhenCharge); | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -115,15 +115,31 @@ namespace Gaming | |||||
| { player.BulletOfPlayer = player.OriBulletOfPlayer; }); | { player.BulletOfPlayer = player.OriBulletOfPlayer; }); | ||||
| } | } | ||||
| public bool Publish(Character player) | |||||
| public bool Punish(Character player) | |||||
| { | { | ||||
| return ActiveSkillEffect(player.UseIActiveSkill(ActiveSkillType.Publish), player, () => | |||||
| return ActiveSkillEffect(player.UseIActiveSkill(ActiveSkillType.Punish), player, () => | |||||
| { | { | ||||
| player.BulletOfPlayer = BulletType.FlyingKnife; | |||||
| Debugger.Output(player, "uses flyingknife!"); | |||||
| gameMap.GameObjLockDict[GameObjType.Character].EnterReadLock(); | |||||
| try | |||||
| { | |||||
| foreach (Character character in gameMap.GameObjDict[GameObjType.Character]) | |||||
| { | |||||
| if (player.IsGhost() && XY.Distance(player.Position, character.Position) <= player.ViewRange) | |||||
| { | |||||
| AttackManager.BeStunned(character, GameData.TimeOfGhostFaintingWhenPunish + (player.MaxHp - player.HP) / GameData.TimeFactorOfGhostFainting); | |||||
| player.AddScore(GameData.StudentScoreTrickerBeStunned(GameData.TimeOfGhostFaintingWhenPunish + (player.MaxHp - player.HP) / GameData.TimeFactorOfGhostFainting)); | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | |||||
| finally | |||||
| { | |||||
| gameMap.GameObjLockDict[GameObjType.Character].ExitReadLock(); | |||||
| } | |||||
| Debugger.Output(player, "uses punishing!"); | |||||
| }, | }, | ||||
| () => | () => | ||||
| { player.BulletOfPlayer = player.OriBulletOfPlayer; }); | |||||
| { }); | |||||
| } | } | ||||
| public bool SuperFast(Character player) | public bool SuperFast(Character player) | ||||
| @@ -76,7 +76,7 @@ namespace Preparation.Interface | |||||
| public BulletType InitBullet => BulletType.Null; | public BulletType InitBullet => BulletType.Null; | ||||
| public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Publish }); | |||||
| public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Punish }); | |||||
| public List<PassiveSkillType> ListOfIPassiveSkill => new(new PassiveSkillType[] { }); | public List<PassiveSkillType> ListOfIPassiveSkill => new(new PassiveSkillType[] { }); | ||||
| public const int fixSpeed = 0; | public const int fixSpeed = 0; | ||||
| @@ -91,7 +91,7 @@ namespace Preparation.Utility | |||||
| SuperFast = 4, | SuperFast = 4, | ||||
| UseKnife = 5, | UseKnife = 5, | ||||
| CanBeginToCharge = 6, | CanBeginToCharge = 6, | ||||
| Publish = 7, | |||||
| Punish = 7, | |||||
| } | } | ||||
| public enum PassiveSkillType | public enum PassiveSkillType | ||||
| { | { | ||||
| @@ -117,7 +117,10 @@ namespace Preparation.Utility | |||||
| { | { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| public const int StudentScoreTrickerBeStunned = 25; | |||||
| public static int StudentScoreTrickerBeStunned(int time) | |||||
| { | |||||
| return time; | |||||
| } | |||||
| public const int StudentScoreRescue = 100; | public const int StudentScoreRescue = 100; | ||||
| public static int StudentScoreTreat(int degree) | public static int StudentScoreTreat(int degree) | ||||
| { | { | ||||
| @@ -159,9 +162,14 @@ namespace Preparation.Utility | |||||
| /// <summary> | /// <summary> | ||||
| /// BeginToCharge | /// BeginToCharge | ||||
| /// </summary> | /// </summary> | ||||
| public const int TimeOfGhostFainting = 7220;//=AP of Ram | |||||
| public const int TimeOfStudentFainting = 2090; | |||||
| public const int TimeOfGhostFaintingWhenCharge = 7220; | |||||
| public const int TimeOfStudentFaintingWhenCharge = 2090; | |||||
| /// <summary> | |||||
| /// Punish | |||||
| /// </summary> | |||||
| public const int TimeOfGhostFaintingWhenPunish = 3070; | |||||
| public const int TimeFactorOfGhostFainting = 1000; | |||||
| #endregion | #endregion | ||||
| #region 道具相关 | #region 道具相关 | ||||
| public const int MinPropTypeNum = 1; | public const int MinPropTypeNum = 1; | ||||
| @@ -1,8 +1,11 @@ | |||||
| @echo off | @echo off | ||||
| start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --port 8888 --teamCount 2 --playerCount 2 --gameTimeInSecond 600 --fileName test | |||||
| start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --port 8888 --teamCount 2 --playerNum 2 --gameTimeInSecond 600 --fileName test | |||||
| ping -n 4 127.0.0.1 > NUL | |||||
| 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=1 | |||||
| start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port=8888 --characterID=0 --type=1 --occupation=1 | |||||
| ping -n 2 127.0.0.1 > NUL | |||||
| start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port=8888 --characterID=1 --type=1 --occupation=1 | |||||
| @@ -353,3 +353,173 @@ | |||||
| | Key3 | 能开启3教的门 |不得分| 能开启3教的门 |不得分| | | Key3 | 能开启3教的门 |不得分| 能开启3教的门 |不得分| | ||||
| | Key5 | 能开启5教的门 |不得分| 能开启3教的门 |不得分| | | Key5 | 能开启5教的门 |不得分| 能开启3教的门 |不得分| | ||||
| | Key6 | 能开启6教的门 |不得分| 能开启3教的门 |不得分| | | Key6 | 能开启6教的门 |不得分| 能开启3教的门 |不得分| | ||||
| ## 游戏数据 | |||||
| ### 基本常数 | |||||
| ~~~csharp | |||||
| public const int numOfStepPerSecond = 20; // 每秒行走的步数 | |||||
| public const int frameDuration = 50; // 每帧时长 | |||||
| public const int checkInterval = 50; // 检查位置标志、补充子弹的帧时长 | |||||
| public const long gameDuration = 600000; // 游戏时长600000ms = 10min | |||||
| public const int MinSpeed = 1; // 最小速度 | |||||
| public const int MaxSpeed = int.MaxValue; // 最大速度 | |||||
| #endregion | |||||
| #region 地图相关 | |||||
| public const int numOfPosGridPerCell = 1000; // 每格的【坐标单位】数 | |||||
| public const int lengthOfMap = 50000; // 地图长度 | |||||
| public const int rows = 50; // 行数 | |||||
| public const int cols = 50; // 列数 | |||||
| public const int numOfBirthPoint = 5; | |||||
| public const int numOfGenerator = 9; | |||||
| public const int numOfChest = 8; | |||||
| public static XY GetCellCenterPos(int x, int y) // 求格子的中心坐标 | |||||
| { | |||||
| XY ret = new(x * numOfPosGridPerCell + numOfPosGridPerCell / 2, y * numOfPosGridPerCell + numOfPosGridPerCell / 2); | |||||
| return ret; | |||||
| } | |||||
| public static int PosGridToCellX(XY pos) // 求坐标所在的格子的x坐标 | |||||
| { | |||||
| return pos.x / numOfPosGridPerCell; | |||||
| } | |||||
| public static int PosGridToCellY(XY pos) // 求坐标所在的格子的y坐标 | |||||
| { | |||||
| return pos.y / numOfPosGridPerCell; | |||||
| } | |||||
| public static XY PosGridToCellXY(XY pos) // 求坐标所在的格子的y坐标 | |||||
| { | |||||
| return new XY(pos.x / numOfPosGridPerCell, pos.y / numOfPosGridPerCell); | |||||
| } | |||||
| public static bool IsInTheSameCell(XY pos1, XY pos2) | |||||
| { | |||||
| return PosGridToCellX(pos1) == PosGridToCellX(pos2) && PosGridToCellY(pos1) == PosGridToCellY(pos2); | |||||
| } | |||||
| public static bool ApproachToInteract(XY pos1, XY pos2) | |||||
| { | |||||
| return Math.Abs(PosGridToCellX(pos1) - PosGridToCellX(pos2)) <= 1 && Math.Abs(PosGridToCellY(pos1) - PosGridToCellY(pos2)) <= 1; | |||||
| } | |||||
| public static bool ApproachToInteractInACross(XY pos1, XY pos2) | |||||
| { | |||||
| return (Math.Abs(PosGridToCellX(pos1) - PosGridToCellX(pos2)) + Math.Abs(PosGridToCellY(pos1) - PosGridToCellY(pos2))) <= 1; | |||||
| } | |||||
| ~~~ | |||||
| ### 角色相关 | |||||
| ~~~csharp | |||||
| public const int numOfStudent = 4; | |||||
| public const int characterRadius = numOfPosGridPerCell / 2 / 5 * 4; // 人物半径 | |||||
| public const int basicTreatSpeed = 100; | |||||
| public const int basicFixSpeed = 100; | |||||
| public const int basicSpeedOfOpeningOrLocking = 3280; | |||||
| public const int basicStudentSpeedOfClimbingThroughWindows = 611; | |||||
| public const int basicGhostSpeedOfClimbingThroughWindows = 1270; | |||||
| public const int basicSpeedOfOpenChest = 1000; | |||||
| public const int basicHp = 3000000; // 初始血量 | |||||
| public const int basicMaxGamingAddiction = 60000;//基本完全沉迷时间 | |||||
| public const int BeginGamingAddiction = 10003; | |||||
| public const int MidGamingAddiction = 30000; | |||||
| public const int basicTreatmentDegree = 1500000; | |||||
| public const int basicTimeOfRescue = 1000; | |||||
| public const int basicMoveSpeed = 1270; // 基本移动速度,单位:s-1 | |||||
| public const int characterMaxSpeed = 12000; // 最大速度 | |||||
| public const int basicBulletMoveSpeed = 2700; // 基本子弹移动速度,单位:s-1 | |||||
| public const double basicConcealment = 1.0; | |||||
| public const int basicAlertnessRadius = 30700; | |||||
| public const int basicViewRange = 5 * numOfPosGridPerCell; | |||||
| public const int maxNumOfPropInPropInventory = 3; | |||||
| ~~~ | |||||
| ### 得分相关 | |||||
| ~~~csharp | |||||
| public static int TrickerScoreAttackStudent(int damage) | |||||
| { | |||||
| return damage * 100 / basicApOfGhost; | |||||
| } | |||||
| public const int TrickerScoreStudentBeAddicted = 50; | |||||
| public const int TrickerScoreStudentBeStunned = 25; | |||||
| public const int TrickerScoreStudentDie = 1000; | |||||
| public static int StudentScoreFix(int degreeOfFix) | |||||
| { | |||||
| return degreeOfFix; | |||||
| } | |||||
| public const int StudentScoreFixed = 25; | |||||
| public static int StudentScorePinDown(int timeOfPiningDown) | |||||
| { | |||||
| return 0; | |||||
| } | |||||
| public const int StudentScoreTrickerBeStunned = 25; | |||||
| public const int StudentScoreRescue = 100; | |||||
| public static int StudentScoreTreat(int degree) | |||||
| { | |||||
| return degree; | |||||
| } | |||||
| public const int StudentScoreEscape = 1000; | |||||
| public const int ScorePropRemainHp = 20; | |||||
| public const int ScorePropUseShield = 20; | |||||
| public const int ScorePropUseSpear = 20; | |||||
| public const int ScorePropAddAp = 10; | |||||
| public const int ScorePropAddHp = 50; | |||||
| ~~~ | |||||
| ### 攻击与子弹相关 | |||||
| ~~~csharp | |||||
| public const int basicApOfGhost = 1500000; // 捣蛋鬼攻击力 | |||||
| public const int MinAP = 0; // 最小攻击力 | |||||
| public const int MaxAP = int.MaxValue; // 最大攻击力 | |||||
| public const int basicCD = 3000; // 初始子弹冷却 | |||||
| public const int basicCastTime = 500;//基本前摇时间 | |||||
| public const int basicBackswing = 818;//基本后摇时间 | |||||
| public const int basicRecoveryFromHit = 4300;//基本命中攻击恢复时长 | |||||
| public const int basicStunnedTimeOfStudent = 4130; | |||||
| public const int bulletRadius = 200; // 默认子弹半径 | |||||
| public const int basicBulletNum = 3; // 基本初始子弹量 | |||||
| public const double basicRemoteAttackRange = 9000; // 基本远程攻击范围 | |||||
| public const double basicAttackShortRange = 2700; // 基本近程攻击范围 | |||||
| public const double basicBulletBombRange = 3000; // 基本子弹爆炸范围 | |||||
| ~~~ | |||||
| ### 技能相关 | |||||
| ~~~csharp | |||||
| public const int maxNumOfSkill = 3; | |||||
| public const int commonSkillCD = 30000; // 普通技能标准冷却时间 | |||||
| public const int commonSkillTime = 10000; // 普通技能标准持续时间 | |||||
| ~~~ | |||||
| ### 道具相关 | |||||
| ~~~csharp | |||||
| public const int MinPropTypeNum = 1; | |||||
| public const int MaxPropTypeNum = 10; | |||||
| public const int PropRadius = numOfPosGridPerCell / 2; | |||||
| public const int PropMoveSpeed = 3000; | |||||
| public const int PropMaxMoveDistance = 15 * numOfPosGridPerCell; | |||||
| public const long PropProduceTime = 10000; | |||||
| public const int PropDuration = 10000; | |||||
| public const int ApPropAdd = basicApOfGhost * 12 / 10; | |||||
| public const int ApSpearAdd = basicApOfGhost * 6 / 10; | |||||
| public const int RemainHpWhenAddLife = 100; | |||||
| public const int numOfKeyEachArea = 2; | |||||
| public const int numOfPropTypeNotKey = 4; | |||||
| public const int numOfTeachingBuilding = 3; | |||||
| ~~~ | |||||
| ### 物体相关 | |||||
| ~~~csharp | |||||
| public const int degreeOfFixedGenerator = 10300000; | |||||
| public const int degreeOfLockingOrOpeningTheDoor = 10000; | |||||
| public const int degreeOfOpeningChest = 10000; | |||||
| public const int degreeOfOpenedDoorway = 18000; | |||||
| public const int maxNumOfPropInChest = 2; | |||||
| public const int numOfGeneratorRequiredForRepair = 7; | |||||
| public const int numOfGeneratorRequiredForEmergencyExit = 3; | |||||
| ~~~ | |||||