Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phoenix chicken #465

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions UOP1_Project/Assets/Scripts/Characters/CharacterAudio.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class DroppableRewardConfigSO : ScriptableObject

public virtual DropGroup DropSpecialItem()
{
return null;
return null;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public override DropGroup DropSpecialItem()
if (_specialDroppableCurrentCount >= _specialDroppableMaxCount)
return _specialItem;
else
return null;
return null;
}
}
2 changes: 1 addition & 1 deletion UOP1_Project/Assets/Scripts/Characters/NPC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using UnityEngine;

public enum NPCState { Idle = 0, Walk, Talk};
public enum NPCState { Idle = 0, Walk, Talk };

public class NPC : MonoBehaviour
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public override void OnStateEnter()

private void DropAllRewards(Vector3 position)
{
DropGroup specialDropItem = _dropRewardConfig.DropSpecialItem();
DropGroup specialDropItem = _dropRewardConfig.DropSpecialItem();
if (specialDropItem != null) // drops a special item if any
DropOneReward(specialDropItem, position);
// Drop items
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PathwayMovementAction(
{
_agent = agent;
_isActiveAgent = _agent != null && _agent.isActiveAndEnabled && _agent.isOnNavMesh;
_wayPointIndex = - 1; //Initialized to -1 so we don't skip the first element from the waypoint list
_wayPointIndex = -1; //Initialized to -1 so we don't skip the first element from the waypoint list
_roamingSpeed = config.Speed;
_wayppoints = config.Waypoints;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ public class ShakeCamAction : StateAction
public override void Awake(StateMachine stateMachine)
{
}

public override void OnUpdate()
{
}

public override void OnStateEnter()
{
OriginSO.camShakeEvent.RaiseEvent();
}

public override void OnStateExit()
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected override bool Statement()
if (!_agent.pathPending)
{
//set the stop distance to 0.1 if it is set to 0 in the inspector
if (_agent.stoppingDistance == 0) _agent.stoppingDistance = 0.1f;
if (_agent.stoppingDistance == 0)
_agent.stoppingDistance = 0.1f;
if (_agent.remainingDistance <= _agent.stoppingDistance)
{
if (!_agent.hasPath || _agent.velocity.sqrMagnitude == 0f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
using UOP1.StateMachine.ScriptableObjects;

[CreateAssetMenu(fileName = "IsANewLineDisplayed", menuName = "State Machines/Conditions/Is A New Line Displayed")]
public class IsANewLineDisplayedSO : StateConditionSO {
public class IsANewLineDisplayedSO : StateConditionSO
{

[SerializeField] private DialogueLineChannelSO _onLineDisplayed = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public override void Awake(StateMachine stateMachine)
{
_stepControllerScript = stateMachine.GetComponent<StepController>();
}

protected override bool Statement()
{

Expand All @@ -27,5 +27,5 @@ protected override bool Statement()
return false;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
using UOP1.StateMachine.ScriptableObjects;

[CreateAssetMenu(fileName = "IsNPCSayingTheLine", menuName = "State Machines/Conditions/Is NPC Saying The Line")]
public class IsNPCSayingTheLineSO : StateConditionSO {
public class IsNPCSayingTheLineSO : StateConditionSO
{

[SerializeField] private DialogueLineChannelSO _onLineDisplayed = default;
[SerializeField] private ActorSO _protagonistActor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public override void Awake(StateMachine stateMachine)
{
_npcScript = stateMachine.GetComponent<NPC>();
}

protected override bool Statement()
{

Expand All @@ -27,5 +27,5 @@ protected override bool Statement()
return false;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public override void Awake(StateMachine stateMachine)
{
_npcScript = stateMachine.GetComponent<NPC>();
}

protected override bool Statement()
{

Expand All @@ -27,5 +27,5 @@ protected override bool Statement()
return false;
}
}

}
10 changes: 5 additions & 5 deletions UOP1_Project/Assets/Scripts/Dialogues/DialogueDataSO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public DialogueDataSO(DialogueDataSO dialogue)
_actor = dialogue.Actor;
_dialogueLines = new List<LocalizedString>(dialogue.DialogueLines);
_choices = new List<Choice>();
if(dialogue.Choices!=null)
for (int i=0; i<dialogue.Choices.Count; i++)
{
if (dialogue.Choices != null)
for (int i = 0; i < dialogue.Choices.Count; i++)
{

_choices.Add(new Choice(dialogue.Choices[i]));
_choices.Add(new Choice(dialogue.Choices[i]));

}
}
_dialogueType = dialogue.DialogueType;

}
Expand Down
50 changes: 25 additions & 25 deletions UOP1_Project/Assets/Scripts/Dialogues/DialogueManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ public void DisplayDialogueData(DialogueDataSO dialogueDataSO)
if (_gameState.CurrentGameState != GameState.Cutscene)
_gameState.UpdateGameState(GameState.Dialogue);
BeginDialogueData(dialogueDataSO);
if(_currentDialogue.DialogueLines!=null)
DisplayDialogueLine(_currentDialogue.DialogueLines[_counter], dialogueDataSO.Actor);
if (_currentDialogue.DialogueLines != null)
DisplayDialogueLine(_currentDialogue.DialogueLines[_counter], dialogueDataSO.Actor);
else
{
Debug.LogError("Check Dialogue");
Debug.LogError("Check Dialogue");
}
}

Expand All @@ -80,7 +80,7 @@ public void DisplayDialogueLine(LocalizedString dialogueLine, ActorSO actor)
{
_openUIDialogueEvent.RaiseEvent(dialogueLine, actor);
}


private void OnAdvance()
{
Expand All @@ -106,10 +106,10 @@ private void OnAdvance()
private void DisplayChoices(List<Choice> choices)
{
_inputReader.advanceDialogueEvent -= OnAdvance;
_makeDialogueChoiceEvent.OnEventRaised += MakeDialogueChoice;
_showChoicesUIEvent.RaiseEvent(choices);

_makeDialogueChoiceEvent.OnEventRaised += MakeDialogueChoice;
_showChoicesUIEvent.RaiseEvent(choices);

}

private void MakeDialogueChoice(Choice choice)
Expand All @@ -118,12 +118,12 @@ private void MakeDialogueChoice(Choice choice)

switch (choice.ActionType)
{
case ChoiceActionType.continueWithStep:
if (_continueWithStep != null)
_continueWithStep.RaiseEvent();
if (choice.NextDialogue != null)
DisplayDialogueData(choice.NextDialogue);
case ChoiceActionType.continueWithStep:

if (_continueWithStep != null)
_continueWithStep.RaiseEvent();
if (choice.NextDialogue != null)
DisplayDialogueData(choice.NextDialogue);
break;
case ChoiceActionType.winningChoice:

Expand All @@ -133,7 +133,7 @@ private void MakeDialogueChoice(Choice choice)
DisplayDialogueData(choice.NextDialogue);
else
DialogueEndedAndCloseDialogueUI();

break;
case ChoiceActionType.losingChoice:

Expand All @@ -143,20 +143,20 @@ private void MakeDialogueChoice(Choice choice)
DisplayDialogueData(choice.NextDialogue);
else
DialogueEndedAndCloseDialogueUI();

break;
case ChoiceActionType.doNothing
:
if (choice.NextDialogue != null)
DisplayDialogueData(choice.NextDialogue);
else
DialogueEndedAndCloseDialogueUI();
break;
if (choice.NextDialogue != null)
DisplayDialogueData(choice.NextDialogue);
else
DialogueEndedAndCloseDialogueUI();
break;

}



}
void DialogueEnded()
{
Expand All @@ -167,12 +167,12 @@ void DialogueEnded()
}
public void DialogueEndedAndCloseDialogueUI()
{

if (_endDialogue != null)
_endDialogue.RaiseEvent(_currentDialogue);
if (_closeDialogueUIEvent != null)
_closeDialogueUIEvent.RaiseEvent();
_gameState.ResetToPreviousGameState();
_gameState.ResetToPreviousGameState();
_inputReader.advanceDialogueEvent -= OnAdvance;
_inputReader.EnableGameplayInput();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public class LightmapScaleSetter : MonoBehaviour
{
[SerializeField] private float _lightmapScale = 1f;
[SerializeField] private float _lightmapScale = 1f;

#if UNITY_EDITOR
// Called when the Lightmap Scale field is changed in the component editor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ public void RaiseEvent(bool value)
public void UnsubscribeAll()
{
if (OnEventRaised != null)
{
{
if (OnEventRaised.GetInvocationList() != null)

foreach (System.Delegate d in OnEventRaised.GetInvocationList())
{
OnEventRaised -= d as UnityAction<bool>;

}
}


}
}
22 changes: 11 additions & 11 deletions UOP1_Project/Assets/Scripts/Gameplay/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private void Start()
}
private void OnEnable()
{
_addRockCandyRecipeEvent.OnEventRaised += AddRockCandyRecipe;
_addRockCandyRecipeEvent.OnEventRaised += AddRockCandyRecipe;
}
private void OnDisable()
{
Expand All @@ -41,16 +41,16 @@ void AddRockCandyRecipe()
}
// Start is called before the first frame update
void StartGame()
{
_gameState.UpdateGameState(GameState.Gameplay);
_questManager.StartGame();
}
public void PauseGame()
{
}
public void UnpauseGame()
{
_gameState.ResetToPreviousGameState();
}
_gameState.UpdateGameState(GameState.Gameplay);
_questManager.StartGame();
}
public void PauseGame()
{
}
public void UnpauseGame()
{
_gameState.ResetToPreviousGameState();
}

}
Loading