Commit ae923771 authored by Tobias's avatar Tobias
Browse files

Balancing Changes

parent da0ccd9b
fileFormatVersion: 2
guid: 74fd32b8a82a08841abd27b278fdf4b0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -56,7 +56,7 @@ CapsuleCollider: ...@@ -56,7 +56,7 @@ CapsuleCollider:
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 1
m_Radius: 1 m_Radius: 1.2
m_Height: 3.7 m_Height: 3.7
m_Direction: 1 m_Direction: 1
m_Center: {x: -0, y: 1.9, z: -0} m_Center: {x: -0, y: 1.9, z: -0}
......
...@@ -15,6 +15,9 @@ public class CustomerBehaviour : MonoBehaviour ...@@ -15,6 +15,9 @@ public class CustomerBehaviour : MonoBehaviour
[SerializeField] private float orderPopUpTime = 5; [SerializeField] private float orderPopUpTime = 5;
[SerializeField] private float waitingTime = 90; [SerializeField] private float waitingTime = 90;
private bool _percOne = false;
private bool _percTwo = false;
private bool _percThree = false;
private GameObject _cameraObject; private GameObject _cameraObject;
private NavMeshAgent _agent; private NavMeshAgent _agent;
...@@ -100,6 +103,25 @@ public class CustomerBehaviour : MonoBehaviour ...@@ -100,6 +103,25 @@ public class CustomerBehaviour : MonoBehaviour
_state = CustomerState.Leaving; _state = CustomerState.Leaving;
} }
if (_customerBar.getPercentage() >= 0.25 && !_percOne)
{
StartCoroutine(OrderAgain(orderPopUpTime));
_percOne = true;
}
if (_customerBar.getPercentage() >= 0.50 && !_percTwo)
{
StartCoroutine(OrderAgain(orderPopUpTime));
_percTwo = true;
}
if (_customerBar.getPercentage() >= 0.75 && !_percThree)
{
StartCoroutine(OrderAgain(orderPopUpTime));
_percThree = true;
}
_playerActor.gameObject.transform.LookAt(_playerActor.gameObject.transform.position + _agent.velocity); _playerActor.gameObject.transform.LookAt(_playerActor.gameObject.transform.position + _agent.velocity);
_customerBar.transform.parent.LookAt(_cameraObject.transform); _customerBar.transform.parent.LookAt(_cameraObject.transform);
...@@ -107,16 +129,27 @@ public class CustomerBehaviour : MonoBehaviour ...@@ -107,16 +129,27 @@ public class CustomerBehaviour : MonoBehaviour
} }
private IEnumerator OrderAndWait(float orderDuration) private IEnumerator OrderAgain(float orderDuration)
{ {
//_customerBar.gameObject.SetActive(false);
_orderPopUp.SetActive(true); _orderPopUp.SetActive(true);
yield return new WaitForSeconds(orderDuration); yield return new WaitForSeconds(orderDuration);
_orderPopUp.SetActive(false);
//_customerBar.gameObject.SetActive(true);
_state = CustomerState.Random;
}
private IEnumerator OrderAndWait(float orderDuration)
{
_orderPopUp.SetActive(true);
yield return new WaitForSeconds(orderDuration);
_orderPopUp.SetActive(false); _orderPopUp.SetActive(false);
_customerBar.gameObject.SetActive(true); _customerBar.gameObject.SetActive(true);
_customerBar.initializeBar(90f); _customerBar.initializeBar(90f);
_state = CustomerState.Random; _state = CustomerState.Random;
...@@ -175,17 +208,18 @@ public class CustomerBehaviour : MonoBehaviour ...@@ -175,17 +208,18 @@ public class CustomerBehaviour : MonoBehaviour
_agent.SetDestination(transform.parent.position); _agent.SetDestination(transform.parent.position);
_customerBar.gameObject.SetActive(false); _customerBar.gameObject.SetActive(false);
_state = CustomerState.Leaving; _state = CustomerState.Leaving;
Destroy(other.gameObject);
} }
else else
{ {
// Wrong Beer // Wrong Beer
_playerActor.AudioSource.PlayOneShot(_customerSounds.GetHappyClip(), 0.2f); _playerActor.AudioSource.PlayOneShot(_customerSounds.GetHappyClip(), 0.2f);
_customerBar.addPercentageOfSlider(-0.3f); _customerBar.addPercentageOfSlider(-0.3f);
Destroy(other.gameObject);
} }
} }
}else if (other.collider.gameObject.CompareTag("Projectile")) Destroy(other.gameObject);
}
else if (other.collider.gameObject.CompareTag("Projectile"))
{ {
_playerActor.AudioSource.PlayOneShot(_customerSounds.GetSadClip(), 0.2f); _playerActor.AudioSource.PlayOneShot(_customerSounds.GetSadClip(), 0.2f);
_customerBar.addPercentageOfSlider(0.3f); _customerBar.addPercentageOfSlider(0.3f);
......
...@@ -45,7 +45,7 @@ public class PlayerBazookaAiming : MonoBehaviour ...@@ -45,7 +45,7 @@ public class PlayerBazookaAiming : MonoBehaviour
_playerActor.LineRenderer.SetPosition(0, bazookaPos); _playerActor.LineRenderer.SetPosition(0, bazookaPos);
List<Vector3> bezierCurve; List<Vector3> bezierCurve;
if (Physics.Raycast(aimRay, out RaycastHit raycastHit, 0, LayerMask.GetMask("Environment")) && raycastHit.distance <= dashSize) if (Physics.Raycast(aimRay, out RaycastHit raycastHit, 0, LayerMask.GetMask("Environment", "Customer")) && raycastHit.distance <= dashSize)
{ {
Vector3 pos2 = bazookaPos + (raycastHit.point - bazookaPos) / 2; Vector3 pos2 = bazookaPos + (raycastHit.point - bazookaPos) / 2;
......
...@@ -77,7 +77,7 @@ public class PlayerInputSystemManager : MonoBehaviour, IInputManager ...@@ -77,7 +77,7 @@ public class PlayerInputSystemManager : MonoBehaviour, IInputManager
return false; return false;
if (GetGamePadCount() >= playerNumber) if (GetGamePadCount() >= playerNumber)
result = _gamepads[playerNumber - 1].leftTrigger.wasPressedThisFrame; result = _gamepads[playerNumber - 1].leftTrigger.isPressed;
if (GetGamePadCount() == 0) if (GetGamePadCount() == 0)
result = Keyboard.current.spaceKey.isPressed; result = Keyboard.current.spaceKey.isPressed;
...@@ -94,10 +94,10 @@ public class PlayerInputSystemManager : MonoBehaviour, IInputManager ...@@ -94,10 +94,10 @@ public class PlayerInputSystemManager : MonoBehaviour, IInputManager
return false; return false;
if (GetGamePadCount() >= playerNumber) if (GetGamePadCount() >= playerNumber)
result = _gamepads[playerNumber - 1].rightTrigger.wasPressedThisFrame; result = _gamepads[playerNumber - 1].rightTrigger.isPressed;
if (GetGamePadCount() == 0) if (GetGamePadCount() == 0)
result = Keyboard.current.fKey.wasPressedThisFrame; result = Keyboard.current.fKey.isPressed;
return result; return result;
} }
......
...@@ -27,7 +27,7 @@ public class PlayerRotate : MonoBehaviour ...@@ -27,7 +27,7 @@ public class PlayerRotate : MonoBehaviour
if (_playerActor.PlayerMovement != null) if (_playerActor.PlayerMovement != null)
{ {
if (_playerActor.PlayerMovement.MoveDirection.sqrMagnitude > 0.1) if (_playerActor.PlayerMovement.MoveDirection.sqrMagnitude > 0)
direction = _playerActor.PlayerMovement.MoveDirection.normalized; direction = _playerActor.PlayerMovement.MoveDirection.normalized;
if (!_playerActor.PlayerMovement.MoveDirection.Equals(Vector3.zero)) if (!_playerActor.PlayerMovement.MoveDirection.Equals(Vector3.zero))
......
fileFormatVersion: 2
guid: 938fe1540aa4aac42981219f8e6e8caf
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
...@@ -70,5 +70,10 @@ public class CustomerBar : MonoBehaviour ...@@ -70,5 +70,10 @@ public class CustomerBar : MonoBehaviour
{ {
return (customerSlider.value >= 100); return (customerSlider.value >= 100);
} }
public float getPercentage()
{
return _currentTime / durationTime;
}
} }
fileFormatVersion: 2
guid: bc3f13c3a929b244eb70dfac58545015
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment