From 273ff06b8c3bd287e9569925678b93e2d3e386f6 Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Fri, 19 May 2023 14:04:08 +0800 Subject: [PATCH] feat: :sparkles: add a feature of teachers --- logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs | 3 +-- logic/Gaming/ActionManager.cs | 6 +++--- logic/Gaming/CharacterManager.cs | 7 ++++++- logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs | 4 ++-- logic/Preparation/Interface/IOccupation.cs | 2 +- logic/Preparation/Utility/GameData.cs | 3 ++- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs b/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs index 68fd362..72a0ee7 100644 --- a/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs +++ b/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs @@ -69,8 +69,7 @@ namespace GameClass.GameObj switch (gameObjType) { case GameObjType.Character: - case: - GameObjType.Generator: + case GameObjType.Generator: return true; default: return false; diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs index 2960c5c..04acc9f 100644 --- a/logic/Gaming/ActionManager.cs +++ b/logic/Gaming/ActionManager.cs @@ -555,7 +555,7 @@ namespace Gaming if (((Bullet)collisionObj).Parent != player && ((Bullet)collisionObj).TypeOfBullet == BulletType.JumpyDumpty) { - if (characterManager.BeStunned((Character)player, GameData.timeOfStunnedWhenJumpyDumpty) > 0) + if (CharacterManager.BeStunned((Character)player, GameData.timeOfStunnedWhenJumpyDumpty) > 0) player.AddScore(GameData.TrickerScoreStudentBeStunned(GameData.timeOfStunnedWhenJumpyDumpty)); gameMap.Remove((GameObj)collisionObj); } @@ -563,9 +563,9 @@ namespace Gaming case GameObjType.Character: if (player.FindActiveSkill(ActiveSkillType.CanBeginToCharge).IsBeingUsed == 1 && ((Character)collisionObj).IsGhost()) { - if (characterManager.BeStunned((Character)collisionObj, GameData.timeOfGhostStunnedWhenCharge) > 0) + if (CharacterManager.BeStunned((Character)collisionObj, GameData.timeOfGhostStunnedWhenCharge) > 0) player.AddScore(GameData.StudentScoreTrickerBeStunned(GameData.timeOfGhostStunnedWhenCharge)); - characterManager.BeStunned(player, GameData.timeOfStudentStunnedWhenCharge); + CharacterManager.BeStunned(player, GameData.timeOfStudentStunnedWhenCharge); } break; case GameObjType.Item: diff --git a/logic/Gaming/CharacterManager.cs b/logic/Gaming/CharacterManager.cs index 614d6bf..54cd0be 100644 --- a/logic/Gaming/CharacterManager.cs +++ b/logic/Gaming/CharacterManager.cs @@ -240,7 +240,7 @@ namespace Gaming { IsBackground = true }.Start(); } - public long BeStunned(Character player, int time) + public static long BeStunned(Character player, int time) { if (player.CharacterType == CharacterType.Robot) return -1; long threadNum = player.SetPlayerState(PlayerStateType.Stunned); @@ -324,6 +324,11 @@ namespace Gaming #endif } bullet.Parent.AddScore(GameData.TrickerScoreAttackStudent(subHp)); + if (student.CharacterType == CharacterType.Teacher) + { + student.AddScore(subHp * GameData.factorOfScoreWhenTeacherAttacked / GameData.basicApOfGhost); + } + bullet.Parent.HP = (int)(bullet.Parent.HP + (bullet.Parent.Vampire * subHp)); } if (student.HP <= 0) diff --git a/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs b/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs index 7df2ef1..edc0bd3 100644 --- a/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs +++ b/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs @@ -310,7 +310,7 @@ namespace Gaming { if (!character.IsGhost() && !character.NoHp() && XY.DistanceFloor3(character.Position, player.Position) <= player.ViewRange) { - if (characterManager.BeStunned(character, GameData.timeOfStudentStunnedWhenHowl) > 0) + if (CharacterManager.BeStunned(character, GameData.timeOfStudentStunnedWhenHowl) > 0) player.AddScore(GameData.TrickerScoreStudentBeStunned(GameData.timeOfStudentStunnedWhenHowl)); } } @@ -343,7 +343,7 @@ namespace Gaming || character.PlayerState == PlayerStateType.ClimbingThroughWindows) && gameMap.CanSee(player, character)) { - if (characterManager.BeStunned(character, GameData.timeOfGhostStunnedWhenPunish + GameData.factorOfTimeStunnedWhenPunish * (player.MaxHp - player.HP)) > 0) + if (CharacterManager.BeStunned(character, GameData.timeOfGhostStunnedWhenPunish + GameData.factorOfTimeStunnedWhenPunish * (player.MaxHp - player.HP)) > 0) player.AddScore(GameData.StudentScoreTrickerBeStunned(GameData.timeOfGhostStunnedWhenPunish + GameData.factorOfTimeStunnedWhenPunish * (player.MaxHp - player.HP))); break; } diff --git a/logic/Preparation/Interface/IOccupation.cs b/logic/Preparation/Interface/IOccupation.cs index 7d21a67..4d8e606 100644 --- a/logic/Preparation/Interface/IOccupation.cs +++ b/logic/Preparation/Interface/IOccupation.cs @@ -130,7 +130,7 @@ namespace Preparation.Interface private const int maxHp = GameData.basicHp * 12 / 10; public int MaxHp => maxHp; - public BulletType InitBullet => BulletType.CommonAttackOfGhost; + public BulletType InitBullet => BulletType.Strike; public List ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Howl }); public List ListOfIPassiveSkill => new(new PassiveSkillType[] { }); diff --git a/logic/Preparation/Utility/GameData.cs b/logic/Preparation/Utility/GameData.cs index 2d3ccbe..682254c 100644 --- a/logic/Preparation/Utility/GameData.cs +++ b/logic/Preparation/Utility/GameData.cs @@ -205,7 +205,7 @@ namespace Preparation.Utility public const double basicAttackShortRange = 2200; // 基本近程攻击范围 public const double basicBulletBombRange = 2000; // 基本子弹爆炸范围 #endregion - #region 技能相关 + #region 技能、特性相关 public const int maxNumOfSkill = 3; public const int commonSkillCD = 30000; // 普通技能标准冷却时间 public const int commonSkillTime = 10000; // 普通技能标准持续时间 @@ -215,6 +215,7 @@ namespace Preparation.Utility public const int timeOfGhostStunnedWhenPunish = 3070; public const int factorOfTimeStunnedWhenPunish = 300 / basicApOfGhost; + public const int factorOfScoreWhenTeacherAttacked = 100;//每个 public const int timeOfGhostSwingingAfterHowl = 800; public const int timeOfStudentStunnedWhenHowl = 5500;