Skip to content

Commit

Permalink
fix: 🐛 construction activate
Browse files Browse the repository at this point in the history
  • Loading branch information
panxuc committed May 18, 2024
1 parent 29e2395 commit 2cbb5c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions logic/GameClass/GameObj/Areas/Construction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public bool BeAttacked(Bullet bullet)
{
lock (lockOfConstructionType)
constructionType = ConstructionType.Null;
IsActivated.Set(false);
}
return HP.IsBelowMaxTimes(0.5);
}
Expand Down
20 changes: 14 additions & 6 deletions logic/Gaming/AttackManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,20 @@ private void BombObj(Bullet bullet, GameObj objBeingShot)
case GameObjType.Construction:
var constructionType = ((Construction)objBeingShot).ConstructionType;
var flag = ((Construction)objBeingShot).BeAttacked(bullet);
if (constructionType == ConstructionType.Community && flag)
game.RemoveBirthPoint(
((Construction)objBeingShot).TeamID,
((Construction)objBeingShot).Position);
else if (constructionType == ConstructionType.Factory && flag)
game.RemoveFactory(((Construction)objBeingShot).TeamID);
if (flag)
{
((Construction)objBeingShot).IsActivated.SetROri(false);
if (constructionType == ConstructionType.Community)
{
game.RemoveBirthPoint(
((Construction)objBeingShot).TeamID,
((Construction)objBeingShot).Position);
}
else if (constructionType == ConstructionType.Factory)
{
game.RemoveFactory(((Construction)objBeingShot).TeamID);
}
}
break;
case GameObjType.Wormhole:
((WormholeCell)objBeingShot).Wormhole.BeAttacked(bullet);
Expand Down

0 comments on commit 2cbb5c3

Please sign in to comment.