Skip to content

Commit

Permalink
Version update
Browse files Browse the repository at this point in the history
  • Loading branch information
rudderbucky committed Feb 2, 2021
1 parent e96d8d0 commit c37c13d
Show file tree
Hide file tree
Showing 335 changed files with 24,060 additions and 44 deletions.
57 changes: 26 additions & 31 deletions Assets/Scripts/Functional Definitions/Abilities/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Control : PassiveAbility

const float healthAddition = 200;
const float damageAddition = 200;

private bool activated;
List<Entity> boosted = new List<Entity>();

protected override void Awake()
Expand All @@ -17,18 +17,24 @@ protected override void Awake()
}
public override void SetDestroyed(bool input)
{
for (int i = 0; i < boosted.Count; i++)
if(activated && input)
{
var entity = boosted[i];
var maxHealths = entity.GetMaxHealth();
maxHealths[0] -= healthAddition * abilityTier;

// Remove a percentage of health from the ship, based on what max health the core had before destruction
var healths = entity.GetHealth();
healths[0] -= (healths[0] / maxHealths[0]) * healthAddition * abilityTier;
entity.damageAddition -= damageAddition;
for (int i = 0; i < boosted.Count; i++)
{
var entity = boosted[i];
if (!entity)
continue;
var maxHealths = entity.GetMaxHealth();
maxHealths[0] -= healthAddition * abilityTier;

// Remove a percentage of health from the ship, based on what max health the core had before destruction
var healths = entity.GetHealth();
healths[0] -= (healths[0] / maxHealths[0]) * healthAddition * abilityTier;
entity.damageAddition -= damageAddition;
}
Entity.OnEntitySpawn -= EntitySpawn;
}
Entity.OnEntitySpawn -= EntitySpawn;

base.SetDestroyed(input);
}

Expand All @@ -39,6 +45,9 @@ protected override void Execute()
if (!(AIData.entities[i] is Turret) && AIData.entities[i].faction == Core.faction && AIData.entities[i] != Core) // All drones or only ones owned by the player?
{
var entity = AIData.entities[i];
if(!entity)
continue;

var maxHealths = entity.GetMaxHealth();
maxHealths[0] += healthAddition * abilityTier;
var healths = entity.GetHealth();
Expand All @@ -47,6 +56,7 @@ protected override void Execute()
boosted.Add(entity);
}
}
activated = true;
Entity.OnEntitySpawn += EntitySpawn;
}

Expand All @@ -59,29 +69,14 @@ void EntitySpawn(Entity entity)
var healths = entity.GetHealth();
healths[0] += healthAddition * abilityTier;
entity.damageAddition += damageAddition;
boosted.Add(entity);
if(!boosted.Contains(entity))
boosted.Add(entity);
}
}

private void OnDestroy()
void OnDestroy()
{
if (!isDestroyed)
{
for (int i = 0; i < boosted.Count; i++)
{
var entity = boosted[i];
if (!entity)
continue;
var maxHealths = entity.GetMaxHealth();
maxHealths[0] -= healthAddition * abilityTier;

// Remove a percentage of health from the ship, based on what max health the core had before destruction
var healths = entity.GetHealth();
healths[0] -= (healths[0] / maxHealths[0]) * healthAddition * abilityTier;
entity.damageAddition -= damageAddition;
}

Entity.OnEntitySpawn -= EntitySpawn;
}
if(!isDestroyed)
SetDestroyed(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,14 @@ public Entity SpawnEntity(EntityBlueprint blueprint, Sector.LevelEntity data)

if(current.type == Sector.SectorType.BattleZone)
{
// add core arrow
if(MinimapArrowScript.instance && !(shellcore is PlayerCore))
{
shellcore.faction = data.faction;
MinimapArrowScript.instance.AddCoreArrow(shellcore);
}


// set the carrier of the shellcore to the associated faction's carrier
if(carriers.ContainsKey(data.faction))
shellcore.SetCarrier(carriers[data.faction]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

public class VersionNumberScript : MonoBehaviour
{
public static string version = "Alpha 5.2.0";
public static string mapVersion = "Alpha 5.2.0";
public static string version = "Alpha 5.3.0";
public static string mapVersion = "Alpha 5.3.0";
static VersionNumberScript instance;
public Text episodeText;

Expand Down
16 changes: 10 additions & 6 deletions Assets/Scripts/Graphs/FinishTaskNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ void SetEntityID(string ID)

public void OnDialogue()
{
// draw objectives
TaskManager.objectiveLocations[(Canvas as QuestCanvas).missionName].Remove(objectiveLocation);
TaskManager.DrawObjectiveLocations();

DialogueSystem.ShowPopup(rewardText, textColor, SectorManager.instance.GetEntity(rewardGiverID));
DialogueSystem.OnDialogueEnd = (int _) =>
{
Expand Down Expand Up @@ -120,25 +124,23 @@ public override int Traverse()
}

SectorManager.instance.player.alerter.showMessage("TASK COMPLETE", "clip_victory");


TaskManager.speakerIDList.Add(rewardGiverID);
if (TaskManager.interactionOverrides.ContainsKey(rewardGiverID))
{
Debug.Log("Contains key");
TaskManager.interactionOverrides[rewardGiverID].Push(() => {
Debug.Log(TaskManager.interactionOverrides[rewardGiverID].Count);
TaskManager.interactionOverrides[rewardGiverID].Pop();
OnDialogue();
Debug.Log(TaskManager.interactionOverrides[rewardGiverID].Count);
});
}
else
{
var stack = new Stack<UnityEngine.Events.UnityAction>();
stack.Push(() => {
Debug.Log(TaskManager.interactionOverrides[rewardGiverID].Count);
TaskManager.interactionOverrides[rewardGiverID].Pop();
OnDialogue();
Debug.Log(TaskManager.interactionOverrides[rewardGiverID].Count);
});
TaskManager.interactionOverrides.Add(rewardGiverID, stack);
Debug.Log("ADDED " + rewardGiverID);
Expand All @@ -148,6 +150,7 @@ public override int Traverse()
return -1;
}

TaskManager.ObjectiveLocation objectiveLocation;
void TryAddObjective()
{
foreach(var ent in AIData.entities)
Expand All @@ -156,12 +159,13 @@ void TryAddObjective()
if(ent.ID == rewardGiverID)
{
TaskManager.objectiveLocations[(Canvas as QuestCanvas).missionName].Clear();
TaskManager.objectiveLocations[(Canvas as QuestCanvas).missionName].Add(new TaskManager.ObjectiveLocation(
objectiveLocation = new TaskManager.ObjectiveLocation(
ent.transform.position,
true,
(Canvas as QuestCanvas).missionName,
ent
));
);
TaskManager.objectiveLocations[(Canvas as QuestCanvas).missionName].Add(objectiveLocation);
TaskManager.DrawObjectiveLocations();
break;
}
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/Graphs/UsePartCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void Init(int index)
{
OnPlayerReconstruct.AddListener(CheckParts);
State = ConditionState.Listening;
TryAddObjective(false);
TryAddObjective(true);
}

public void DeInit()
Expand Down Expand Up @@ -80,7 +80,7 @@ void TryAddObjective(bool clear)
// TODO: Disambiguate name and entityName
if(ent.name == "Yard" || ent.entityName == "Yard")
{
if(clear) TaskManager.objectiveLocations.Clear();
if(clear) TaskManager.objectiveLocations[(Canvas as QuestCanvas).missionName].Clear();
objectiveLocation = new TaskManager.ObjectiveLocation(
ent.transform.position,
true,
Expand Down
3 changes: 3 additions & 0 deletions Assets/Scripts/HUD Scripts/MinimapArrowScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ public void ClearCoreArrows()

public void AddCoreArrow(ShellCore core)
{
if(coreArrows.ContainsKey(core))
return;

coreArrows.Add(core, Instantiate(arrowPrefab, transform, false).transform);
coreArrows[core].GetComponent<SpriteRenderer>().color = FactionColors.colors[core.faction];
UpdatePosition(coreArrows[core], core.transform.position, core.faction != PlayerCore.Instance.faction);
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/HUD Scripts/SaveMenuHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void InitializeSaves()
else icon.transform.SetSiblingIndex(1);
}
else icon.transform.SetSiblingIndex(0);
if((resourcePath == "" && saves[i].resourcePath != null && !saves[i].resourcePath.Contains("main"))
if((resourcePath == "" && saves[i].resourcePath != null && !saves[i].resourcePath.Contains("main") && saves[i].resourcePath != "")
|| (resourcePath != "" && saves[i].resourcePath != resourcePath)) icon.gameObject.SetActive(false);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sectorjson":"{\"sectorName\":\"Danger Zone 0-2070\",\"bounds\":{\"x\":-120,\"y\":-1740,\"w\":380,\"h\":660},\"type\":3,\"backgroundColor\":{\"r\":0.6499999761581421,\"g\":0.0,\"b\":0.0,\"a\":1.0},\"entities\":[],\"platformData\":[],\"platform\":{\"instanceID\":0},\"targets\":[],\"hasMusic\":true,\"musicID\":\"music_overworld\",\"partDropsDisabled\":false,\"backgroundSpawns\":[],\"waveSetPath\":\"\",\"rectangleEffectSkin\":1,\"backgroundTileSkin\":1,\"shardCountSet\":[0,0,0]}","platformjson":""}
Loading

0 comments on commit c37c13d

Please sign in to comment.