Browse Source

feat: change the skill of Idol

tags/0.1.0
shangfengh 2 years ago
parent
commit
c5652925e2
8 changed files with 38 additions and 13 deletions
  1. +1
    -1
      CAPI/cpp/API/include/constants.h
  2. +1
    -1
      CAPI/python/PyAPI/constants.py
  3. +1
    -1
      logic/GameClass/GameObj/Character/Character.cs
  4. +1
    -1
      logic/GameRules.md
  5. +10
    -2
      logic/Gaming/ActionManager.cs
  6. +2
    -2
      logic/Gaming/CharacterManager .cs
  7. +21
    -4
      logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs
  8. +1
    -1
      logic/Preparation/Interface/ISkill.cs

+ 1
- 1
CAPI/cpp/API/include/constants.h View File

@@ -269,7 +269,7 @@ namespace Constants

struct ShowTime
{
SCCI int skillCD = commonSkillCD * 3;
SCCI int skillCD = commonSkillCD * 8 / 3;
SCCI int durationTime = commonSkillTime * 1;
};



+ 1
- 1
CAPI/python/PyAPI/constants.py View File

@@ -270,7 +270,7 @@ class Howl:


class ShowTime:
skillCD = (int)(3.0 * Constants.commonSkillCD)
skillCD = (int)(8 * Constants.commonSkillCD/3)
durationTime = (int)(1.0 * Constants.commonSkillTime)




+ 1
- 1
logic/GameClass/GameObj/Character/Character.cs View File

@@ -584,7 +584,7 @@ namespace GameClass.GameObj
this.Vampire = this.OriVampire;
}
}*/
public void Die(PlayerStateType playerStateType)
public void RemoveFromGame(PlayerStateType playerStateType)
{
lock (gameObjLock)
{


+ 1
- 1
logic/GameRules.md View File

@@ -1,5 +1,5 @@
# 规则
V4.4
V4.5
- [规则](#规则)
- [简则](#简则)
- [地图](#地图)


+ 10
- 2
logic/Gaming/ActionManager.cs View File

@@ -43,6 +43,14 @@ namespace Gaming
return true;
}

public bool MovePlayerWhenStunned(Character playerToMove, int moveTimeInMilliseconds, double moveDirection)
{
if (!playerToMove.Commandable() && playerToMove.PlayerState != PlayerStateType.Stunned) return false;
characterManager.SetPlayerState(playerToMove, PlayerStateType.Stunned);
moveEngine.MoveObj(playerToMove, moveTimeInMilliseconds, moveDirection);
return true;
}

public bool Stop(Character player)
{
if (player.Commandable() || !TryToStop())
@@ -129,7 +137,7 @@ namespace Gaming
{
player.AddScore(GameData.StudentScoreEscape);
++gameMap.NumOfEscapedStudent;
player.Die(PlayerStateType.Escaped);
player.RemoveFromGame(PlayerStateType.Escaped);
return true;
}
else
@@ -139,7 +147,7 @@ namespace Gaming
{
player.AddScore(GameData.StudentScoreEscape);
++gameMap.NumOfEscapedStudent;
player.Die(PlayerStateType.Escaped);
player.RemoveFromGame(PlayerStateType.Escaped);
return true;
}
return false;


+ 2
- 2
logic/Gaming/CharacterManager .cs View File

@@ -378,12 +378,12 @@ namespace Gaming
return true;
}

private void Die(Character player)
public void Die(Student player)
{
#if DEBUG
Debugger.Output(player, "die.");
#endif
player.Die(PlayerStateType.Deceased);
player.RemoveFromGame(PlayerStateType.Deceased);

for (int i = 0; i < GameData.maxNumOfPropInPropInventory; i++)
{


+ 21
- 4
logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs View File

@@ -49,8 +49,25 @@ namespace Gaming
{
foreach (Character person in gameMap.GameObjDict[GameObjType.Character])
{
if (!person.IsGhost())
actionManager.MovePlayer(person, GameData.frameDuration, (player.Position - person.Position).Angle());
if (!person.IsGhost() && player.CharacterType != CharacterType.Robot && !person.NoHp())
{
double dis = XY.Distance(person.Position, player.Position);
if (dis >= player.AlertnessRadius)
{
person.AddMoveSpeed(GameData.checkIntervalWhenShowTime, dis / player.AlertnessRadius);
actionManager.MovePlayerWhenStunned(person, GameData.checkIntervalWhenShowTime, (player.Position - person.Position).Angle());
}
else if (dis >= player.ViewRange)
{
Student student = (Student)person;
student.GamingAddiction += GameData.checkIntervalWhenShowTime;
if (student.GamingAddiction == student.MaxGamingAddiction)
{
player.AddScore(GameData.TrickerScoreStudentDie);
characterManager.Die(student);
}
}
}
}
}
finally
@@ -58,7 +75,7 @@ namespace Gaming
gameMap.GameObjLockDict[GameObjType.Character].ExitReadLock();
}
},
timeInterval: GameData.frameDuration,
timeInterval: GameData.checkIntervalWhenShowTime,
finallyReturn: () => 0
)

@@ -167,7 +184,7 @@ namespace Gaming
{
foreach (Character character in gameMap.GameObjDict[GameObjType.Character])
{
if (!character.IsGhost() && XY.Distance(character.Position, player.Position) <= player.ViewRange)
if (!character.IsGhost() && !character.NoHp() && XY.Distance(character.Position, player.Position) <= player.ViewRange)
{
if (characterManager.BeStunned(character, GameData.timeOfStudentStunnedWhenHowl))
player.AddScore(GameData.TrickerScoreStudentBeStunned(GameData.timeOfStudentStunnedWhenHowl));


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

@@ -123,7 +123,7 @@ namespace Preparation.Interface

public class ShowTime : IActiveSkill
{
public int SkillCD => GameData.commonSkillCD * 3;
public int SkillCD => GameData.commonSkillCD * 8 / 3;
public int DurationTime => GameData.commonSkillTime;

private readonly object commonSkillLock = new();


Loading…
Cancel
Save