Browse Source

feat: add a feature of teachers

tags/v0.1.0
shangfengh 2 years ago
parent
commit
273ff06b8c
6 changed files with 15 additions and 10 deletions
  1. +1
    -2
      logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs
  2. +3
    -3
      logic/Gaming/ActionManager.cs
  3. +6
    -1
      logic/Gaming/CharacterManager.cs
  4. +2
    -2
      logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs
  5. +1
    -1
      logic/Preparation/Interface/IOccupation.cs
  6. +2
    -1
      logic/Preparation/Utility/GameData.cs

+ 1
- 2
logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs View File

@@ -69,8 +69,7 @@ namespace GameClass.GameObj
switch (gameObjType) switch (gameObjType)
{ {
case GameObjType.Character: case GameObjType.Character:
case:
GameObjType.Generator:
case GameObjType.Generator:
return true; return true;
default: default:
return false; return false;


+ 3
- 3
logic/Gaming/ActionManager.cs View File

@@ -555,7 +555,7 @@ namespace Gaming


if (((Bullet)collisionObj).Parent != player && ((Bullet)collisionObj).TypeOfBullet == BulletType.JumpyDumpty) 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)); player.AddScore(GameData.TrickerScoreStudentBeStunned(GameData.timeOfStunnedWhenJumpyDumpty));
gameMap.Remove((GameObj)collisionObj); gameMap.Remove((GameObj)collisionObj);
} }
@@ -563,9 +563,9 @@ namespace Gaming
case GameObjType.Character: case GameObjType.Character:
if (player.FindActiveSkill(ActiveSkillType.CanBeginToCharge).IsBeingUsed == 1 && ((Character)collisionObj).IsGhost()) 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)); player.AddScore(GameData.StudentScoreTrickerBeStunned(GameData.timeOfGhostStunnedWhenCharge));
characterManager.BeStunned(player, GameData.timeOfStudentStunnedWhenCharge);
CharacterManager.BeStunned(player, GameData.timeOfStudentStunnedWhenCharge);
} }
break; break;
case GameObjType.Item: case GameObjType.Item:


+ 6
- 1
logic/Gaming/CharacterManager.cs View File

@@ -240,7 +240,7 @@ namespace Gaming
{ IsBackground = true }.Start(); { 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; if (player.CharacterType == CharacterType.Robot) return -1;
long threadNum = player.SetPlayerState(PlayerStateType.Stunned); long threadNum = player.SetPlayerState(PlayerStateType.Stunned);
@@ -324,6 +324,11 @@ namespace Gaming
#endif #endif
} }
bullet.Parent.AddScore(GameData.TrickerScoreAttackStudent(subHp)); 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)); bullet.Parent.HP = (int)(bullet.Parent.HP + (bullet.Parent.Vampire * subHp));
} }
if (student.HP <= 0) if (student.HP <= 0)


+ 2
- 2
logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs View File

@@ -310,7 +310,7 @@ namespace Gaming
{ {
if (!character.IsGhost() && !character.NoHp() && XY.DistanceFloor3(character.Position, player.Position) <= player.ViewRange) 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)); player.AddScore(GameData.TrickerScoreStudentBeStunned(GameData.timeOfStudentStunnedWhenHowl));
} }
} }
@@ -343,7 +343,7 @@ namespace Gaming
|| character.PlayerState == PlayerStateType.ClimbingThroughWindows) || character.PlayerState == PlayerStateType.ClimbingThroughWindows)
&& gameMap.CanSee(player, character)) && 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))); player.AddScore(GameData.StudentScoreTrickerBeStunned(GameData.timeOfGhostStunnedWhenPunish + GameData.factorOfTimeStunnedWhenPunish * (player.MaxHp - player.HP)));
break; break;
} }


+ 1
- 1
logic/Preparation/Interface/IOccupation.cs View File

@@ -130,7 +130,7 @@ namespace Preparation.Interface
private const int maxHp = GameData.basicHp * 12 / 10; private const int maxHp = GameData.basicHp * 12 / 10;
public int MaxHp => maxHp; public int MaxHp => maxHp;


public BulletType InitBullet => BulletType.CommonAttackOfGhost;
public BulletType InitBullet => BulletType.Strike;


public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Howl }); public List<ActiveSkillType> ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Howl });
public List<PassiveSkillType> ListOfIPassiveSkill => new(new PassiveSkillType[] { }); public List<PassiveSkillType> ListOfIPassiveSkill => new(new PassiveSkillType[] { });


+ 2
- 1
logic/Preparation/Utility/GameData.cs View File

@@ -205,7 +205,7 @@ namespace Preparation.Utility
public const double basicAttackShortRange = 2200; // 基本近程攻击范围 public const double basicAttackShortRange = 2200; // 基本近程攻击范围
public const double basicBulletBombRange = 2000; // 基本子弹爆炸范围 public const double basicBulletBombRange = 2000; // 基本子弹爆炸范围
#endregion #endregion
#region 技能相关
#region 技能、特性相关
public const int maxNumOfSkill = 3; public const int maxNumOfSkill = 3;
public const int commonSkillCD = 30000; // 普通技能标准冷却时间 public const int commonSkillCD = 30000; // 普通技能标准冷却时间
public const int commonSkillTime = 10000; // 普通技能标准持续时间 public const int commonSkillTime = 10000; // 普通技能标准持续时间
@@ -215,6 +215,7 @@ namespace Preparation.Utility


public const int timeOfGhostStunnedWhenPunish = 3070; public const int timeOfGhostStunnedWhenPunish = 3070;
public const int factorOfTimeStunnedWhenPunish = 300 / basicApOfGhost; public const int factorOfTimeStunnedWhenPunish = 300 / basicApOfGhost;
public const int factorOfScoreWhenTeacherAttacked = 100;//每个


public const int timeOfGhostSwingingAfterHowl = 800; public const int timeOfGhostSwingingAfterHowl = 800;
public const int timeOfStudentStunnedWhenHowl = 5500; public const int timeOfStudentStunnedWhenHowl = 5500;


Loading…
Cancel
Save