Skip to content

Commit

Permalink
style: StyleChange
Browse files Browse the repository at this point in the history
  • Loading branch information
Hang-THU committed Nov 23, 2024
1 parent 1c4b062 commit 1fbb0ac
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions logic/Gaming/CharacterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ private class CharacterManager(Game game, Map gameMap)
{
private readonly Game game = game;
private readonly Map map = gameMap;
public static Character?AddCharacter(long teamID,long playerID,CharacterType charactertype,MoneyPool moneypool)
public static Character? AddCharacter(long teamID, long playerID, CharacterType charactertype, MoneyPool moneypool)
{
Character newcharacter = new(GameData.CharacterRadius, charactertype, moneypool);
newcharacter.TeamID.SetROri(teamID);
Expand All @@ -34,22 +34,22 @@ public bool ActivateCharacter(Character character, XY pos)
return true;
}

public void BeAttacked(Character character,Character obj)
public void BeAttacked(Character character, Character obj)
{
if(obj.TeamID.Get()==character.TeamID.Get())
if (obj.TeamID.Get() == character.TeamID.Get())
{
return;
}
long subHP = obj.AttackPower;
if(character.Shield>0)
if (character.Shield > 0)
{
character.Shield.SubPositiveV(subHP);
}
else
{
character.HP.SubPositiveV(subHP);
}
if(character.HP==0)
if (character.HP == 0)
{
long score = 0;
if (character.CharacterType == CharacterType.TangSeng || character.CharacterType == CharacterType.JiuLing)
Expand All @@ -63,7 +63,7 @@ public void BeAttacked(Character character,Character obj)
}
}

public void BeAttacked(Character character,long AP)//此部分适用于中立资源攻击及技能攻击
public void BeAttacked(Character character, long AP)//此部分适用于中立资源攻击及技能攻击
{
if (character.Shield > 0)
{
Expand All @@ -87,7 +87,7 @@ public void BeAttacked(Character character,long AP)//此部分适用于中立资
}
}

public static bool Recover(Character character,long recover)
public static bool Recover(Character character, long recover)
{
if (recover <= 0)
return false;
Expand All @@ -97,13 +97,12 @@ public static bool Recover(Character character,long recover)

public void Remove(Character character)
{
if(!character.TryToRemoveFromGame(CharacterState.DECEASED))
if (!character.TryToRemoveFromGame(CharacterState.DECEASED))
{
return;
}
gameMap.Remove(character);
}
}

}
}

0 comments on commit 1fbb0ac

Please sign in to comment.