Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Pestis/Assets/Scripts/Horde/EvolutionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ public void ApplyActiveEffects(ActiveMutation mutation)
{
GameManager.Instance.UIManager.AddNotification(
"This horde has acquired the maximum number of mutations.", Color.red);
PointsAvailable = -1;
_rareMutationClock.Reset();
}

Expand Down Expand Up @@ -381,7 +382,7 @@ public override void Spawned()
CreatePassiveEvolutions();
CreateActiveEvolutions();
}

public void AddPoints()
{
PointsAvailable++;
Expand Down
33 changes: 3 additions & 30 deletions Pestis/Assets/Scripts/POI/POIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class PoiController : NetworkBehaviour
private Camera _camera;
private float _cheesePerTick;

private POIType _poiType;
public POIType _poiType;

private Sprite captureFlag;
private GameObject flagObject;
Expand Down Expand Up @@ -202,36 +202,9 @@ public void ChangeControllerRpc(Player player)
Debug.Log($"Fixed cheese rate is {_cheesePerTick}");
ControlledBy.IncrementCheeseIncrementRateRpc(_cheesePerTick);
StationedHordes.Clear();
if (player.IsLocal)
{
GameManager.Instance.ObjectiveManager.AddProgress(ObjectiveTrigger.POICaptured, 1);

switch (_poiType)
{
case POIType.City:
foreach (var horde in player.Hordes) horde.SetAliveRatsRpc((uint)((uint)horde.AliveRats * 1.1));
GameManager.Instance.UIManager.AddNotification("City captured. Population increased",
Color.black);
break;
case POIType.Lab:
foreach (var horde in player.Hordes)
{
horde.GetComponent<EvolutionManager>().AddPoints();
horde.AddSpeechBubbleRpc(EmoteType.Evolution);
}

GameManager.Instance.UIManager.AddNotification("Lab captured. Mutation points acquired.",
Color.black);
break;
case POIType.Farm:
player.AddCheeseRpc(100);
GameManager.Instance.UIManager.AddNotification("Farm captured. Food package acquired.",
Color.black);
break;
}



GameManager.Instance.PlaySfx(SoundEffectType.POICapture);
}

s_ChangeController.End();
}
Expand Down
24 changes: 24 additions & 0 deletions Pestis/Assets/Scripts/Players/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,30 @@ public void AddControlledPoiRpc(PoiController poi)
s_AddControlledPoiRpc.Begin();
ControlledPOIs.Add(poi);
GameManager.Instance.ObjectiveManager.AddProgress(ObjectiveTrigger.POICaptured, 1);
GameManager.Instance.PlaySfx(SoundEffectType.POICapture);
if (IsLocal)
switch (poi._poiType)
{
case POIType.City:
foreach (var horde in poi.StationedHordes) horde.SetAliveRatsRpc((uint)((uint)horde.AliveRats * 1.1));
GameManager.Instance.UIManager.AddNotification("City captured. Population increased",
Color.black);
break;
case POIType.Lab:
foreach (var horde in poi.StationedHordes)
{
horde.GetComponent<EvolutionManager>().AddPoints();
}

GameManager.Instance.UIManager.AddNotification("Lab captured. Mutation points acquired.",
Color.black);
break;
case POIType.Farm:
AddCheeseRpc(100);
GameManager.Instance.UIManager.AddNotification("Farm captured. Food package acquired.",
Color.black);
break;
}
s_AddControlledPoiRpc.End();
}

Expand Down
10 changes: 10 additions & 0 deletions Pestis/Assets/Scripts/UI/UI_manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,16 @@ public void MutationPopUpEnable()
buttons[1].SetActive(false);
buttons[2].SetActive(false);
noPointsWarning.SetActive(true);
noPointsWarning.GetComponentInChildren<TMP_Text>().text = "No points for upgrades!!!";

}
if (evolutionManager.PointsAvailable < 0)
{
buttons[0].SetActive(false);
buttons[1].SetActive(false);
buttons[2].SetActive(false);
noPointsWarning.SetActive(true);
noPointsWarning.GetComponentInChildren<TMP_Text>().text = "Max mutations acquired.";
}
else
{
Expand Down
Loading