Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -0,0 +1,68 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Machine : MonoBehaviour {



#region Variables
[SerializeField]
int NumberOfCams;
[SerializeField]
GameObject[] Cameras = new GameObject[4];
[SerializeField]
MachineTrigger Trigger;
public bool isActive = false;
public float Axis_HL { get; set; }
public float Axis_HR { get; set; }
public float Axis_VL { get; set; }
public float Axis_VR { get; set; }


#endregion


// Use this for initialization
void Start () {

}
protected virtual void Initialize()
{
Trigger.ReferenceMachine = this.GetComponent<Machine>();
}

// Update is called once per frame
void Update () {
}
public void Activate()
{
isActive = true;
for (int i = NumberOfCams-1; i>=0; i--)
{
Cameras[i].SetActive(true);
}
//make things in a list Glow
}
#region Virtuals
public virtual void LeftStick()
{
}
public virtual void RightStick()
{
}
public virtual void LeftButton()
{
}
public virtual void BottomButton()
{
}
public virtual void TopButton()
{
}
public virtual void RightButton()
{
}
}

#endregion
@@ -0,0 +1,58 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Door : Machine {

[SerializeField]
GameObject Exit;
[SerializeField]
GameObject MovingPart;
[SerializeField]
float progress = 0f;
Vector3 Startpos;



// Use this for initialization
void Start () {
Initialize();
Startpos = MovingPart.transform.position;
}

// Update is called once per frame
void Update () {
if (isActive)
{
MovingPart.transform.position = Startpos + new Vector3(0, progress, 0);
}
if (progress > 0)
{
progress -= Time.deltaTime;
}

}
protected override void Initialize()
{
base.Initialize();
}
public override void BottomButton()
{
print("Bottom Button Pressed from Machine");
base.BottomButton();
progress += 1f;

}
public override void TopButton()
{
base.TopButton();
FlameImpLogic go = FindObjectOfType<FlameImpLogic>();
go.transform.position = Exit.transform.position;
go.SwitchColliders();
go.SwitchRenderers();
go.controllingMachine = false;
isActive = false;

}

}
@@ -3,7 +3,8 @@
using UnityEngine;
using UnityEngine.UI;

public class FlameImpLogic : PlayerLogic {
public class FlameImpLogic : PlayerLogic
{

[SerializeField]
GameObject projectile;
@@ -21,6 +22,9 @@ public class FlameImpLogic : PlayerLogic {

public bool fused;
public bool launched;
public bool controllingMachine;

public Machine ReferenceMachine;

int m_DashId;
int m_IdleDashTransId;
@@ -74,6 +78,12 @@ void FixedUpdate()
{
rigid.position = carryProjectile.transform.position;
}
else if (controllingMachine)
{
rigid.position = ReferenceMachine.transform.position;
rigid.MoveRotation(steamGolem.transform.rotation);

}
else
{
if (!IsTargeting() && IsInLocomotion() && ((direction >= 0 && horizontalL >= 0) || (direction < 0 && horizontalL < 0)))
@@ -130,19 +140,90 @@ public override void HandleInput()
animator.SetFloat("Angle", 0f); animator.SetFloat("Direction", 0f);
//Handle Fused Input

if(steamGolem.IsHitSphereEnabled())
if (steamGolem.IsPunching())
{
if (rePlayer.GetButtonDown("Bottom Button"))
{
FireImp();
steamGolem.ChainedAction = "Explosion";

//explosive punch - alternately release imp
}
if (rePlayer.GetButtonDown("R2"))
{
transform.position = steamGolem.transform.position + steamGolem.transform.forward * 2;
transform.rotation = steamGolem.transform.rotation;
SwitchColliders();
SwitchRenderers();
}
}
}
else
else if (steamGolem.IsHeavyPunch())
{
if (rePlayer.GetButtonDown("Bottom Button"))
{
steamGolem.ChainedAction = "Big Bang";
}
if (rePlayer.GetButtonDown("R2"))
{
transform.position = steamGolem.transform.position + steamGolem.transform.forward * 2;
transform.rotation = steamGolem.transform.rotation;
SwitchColliders();
SwitchRenderers();
}
}
else if (steamGolem.IsSpinning())
{
if (rePlayer.GetButtonDown("Bottom Button"))
{
steamGolem.ActiveFlameThrower();
}
}
else if (steamGolem.IsInChargeUp())
{
if (rePlayer.GetButtonDown("Bottom Buttom"))
{
steamGolem.ReleaseJump();
}
}
if (rePlayer.GetButtonDown("Left Button") && !steamGolem.IsInChargeUp())
{


steamGolem.DashWhileFused(rePlayer.GetAxis("Right Horizontal"));

}

}
else if (controllingMachine && ReferenceMachine != null)
{
base.HandleInput();
print("Im here");
if(rePlayer.GetButtonDown("Left Button")){

ReferenceMachine.LeftButton();
}
if (rePlayer.GetButtonDown("Bottom Button"))
{
print("Bottom pressed");
ReferenceMachine.BottomButton();
}
if (rePlayer.GetButtonDown("Up Button"))
{
ReferenceMachine.TopButton();
}
if (rePlayer.GetButtonDown("Right Button"))
{

ReferenceMachine.RightButton();
}
ReferenceMachine.Axis_HR = rePlayer.GetAxis("Right Horizontal");
ReferenceMachine.Axis_HL = rePlayer.GetAxis("Left Horizontal");
ReferenceMachine.Axis_VR = rePlayer.GetAxis("Right Vertical");
ReferenceMachine.Axis_VL = rePlayer.GetAxis("Left Vertical");
}
else
{
base.HandleInput();
}
}
}

public void FireProjectile()
{
@@ -4,7 +4,8 @@
using UnityEngine.UI;
using Rewired;

public class PlayerLogic : LivingEntity
[RequireComponent(typeof(Animator))]
public class PlayerLogic : LivingEntity
{

#region Serialize Fields
@@ -21,6 +22,8 @@ public class PlayerLogic : LivingEntity
protected float rotationDegreePerSecond = 120f;
[SerializeField]
protected float StrafeRotateSpeed = 5;
[SerializeField]
protected float DualTimerdown = 0.1f;

#endregion

@@ -36,6 +39,8 @@ public class PlayerLogic : LivingEntity
protected float verticalL;
protected float charAngle;

//protected PlayerState MyState;

[SerializeField]
List<LivingEntity> entitiesInRange = new List<LivingEntity>();
[SerializeField]
@@ -125,6 +130,7 @@ public override void Initialize()
rePlayer = ReInput.players.GetPlayer(playerNumber-1);
gameObject.tag = "Player" + playerNumber;
gameCam = GameObject.FindGameObjectWithTag("Cam" + playerNumber).GetComponent<ThirdPersonCamera>();
// MyState = new PlayerState(this, false, false);
}

public virtual void HandleInput()
@@ -144,20 +150,48 @@ public virtual void HandleInput()
if (rePlayer.GetAxis("L2") > 0.1f)
{
gameCam.camState = ThirdPersonCamera.CamStates.Target;

}
else
{
gameCam.camState = ThirdPersonCamera.CamStates.Behind;

}
if (rePlayer.GetButtonDown("L1"))
if (rePlayer.GetButton("L1"))
{
animator.SetTrigger("L1");
if (DualTimerdown >= 0)
{
DualTimerdown -= Time.deltaTime;
if (rePlayer.GetButton("R1"))
{
animator.SetTrigger("Punch");
DualTimerdown = 0.1f;

}
// if(animator.)
}
else {
animator.SetTrigger("L1");
DualTimerdown = 0.1f;
}
}

if (rePlayer.GetButtonDown("R1"))
if (rePlayer.GetButton("R1"))
{
animator.SetTrigger("R1");
if (DualTimerdown >= 0)
{
DualTimerdown -= Time.deltaTime;
if (rePlayer.GetButton("L1"))
{
animator.SetTrigger("Punch");
DualTimerdown = 0.1f;
}

}
else {
animator.SetTrigger("R1");
DualTimerdown = 0.1f;
}
}

if (rePlayer.GetButton("Left Button"))
@@ -377,3 +411,24 @@ public override void Die()
#endregion

}
#region Statemashine

//public struct PlayerState
//{
// public AnimatorStateInfo AnimationState { get; set; }
/* public bool Fused { get; set; }
public bool Targeting { get; set; }
PlayerLogic reference;
public PlayerState(PlayerLogic inReference, bool inFuse, bool inTargetin)
{
reference = inReference;
AnimationState = reference.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0);
Fused = inFuse;
Targeting = inTargetin;
}
}*/
#endregion


@@ -8,7 +8,8 @@ public class SteamGolemLogic : PlayerLogic
{

#region SerializeFields

[SerializeField]
GameObject Esplosion;
[SerializeField]
Material body02Mat;
[SerializeField]
@@ -27,7 +28,8 @@ public class SteamGolemLogic : PlayerLogic
#endregion

#region Private Variables


public string ChainedAction { get; set; }
bool overheatMode;
Slider handLHealthBar;
Slider handRHealthBar;
@@ -38,7 +40,11 @@ public class SteamGolemLogic : PlayerLogic
//HashTags
int m_ChargeId;
int m_ChargeLoopId;

int m_PunchL;
int m_PunchR;
// int h_PunchR;
int h_PunchL;
int m_Spin;
#endregion

#region Mono Methods
@@ -52,6 +58,14 @@ void Start()
//Hash IDs
m_ChargeId = Animator.StringToHash("Base Layer.WhirlWind.WhirlWindCharge");
m_ChargeLoopId = Animator.StringToHash("Base Layer.WhirlWind.ChargeLoop");
m_PunchL = Animator.StringToHash("PunchSequence.PunchL");
m_PunchR = Animator.StringToHash("PunchSequence.PunchR");
h_PunchL = Animator.StringToHash("PunchSequence.Punch2L");
m_Spin = Animator.StringToHash("Base layer.WhirlWindRelease");

//h_PunchR = Animator.StringToHash("PunchSequence.Punch2R");

ChainedAction = "";
}

void Update()
@@ -91,6 +105,17 @@ void Update()
}

}
if(base.transInfo.anyState && IsPunching() && ChainedAction == "Explosion")
{
print("Explooosion");
// Instantiate.gameObject.explosio
ChainedAction = "";
}
if (base.transInfo.anyState && IsHeavyPunch() && ChainedAction == "Big Bang")
{
print("Kaboom");
ChainedAction = "";
}

}

@@ -141,6 +166,8 @@ public override void HandleInput()
else
movementSpeed = 0.5f * overheatSpeedMultiplier;
}
//heavy attack
//jump when overheated
else
{
animator.SetBool("Blocking", false);
@@ -265,19 +292,36 @@ void HandleOverheating()

}

#endregion

#region BooleanChecks

public bool IsInChargeUp()
{
return stateInfo.fullPathHash == m_ChargeId || stateInfo.fullPathHash == m_ChargeLoopId;
}
public bool IsSpinning()
{
return stateInfo.fullPathHash == m_Spin;

}

//????
public bool IsHitSphereEnabled()
{
if (hitSpheres.Length != 0)
return hitSpheres[0].enabled || hitSpheres[1].enabled;
else
return false;
}

public bool IsPunching()
{
return stateInfo.fullPathHash == m_PunchL || stateInfo.fullPathHash == m_PunchR;
}
public bool IsHeavyPunch()
{
return stateInfo.fullPathHash == h_PunchL;
}
public bool IsOverheated()
{
return overheatMode;
@@ -351,6 +395,31 @@ public void HandleArmDisplay()
}
}

public void ActiveFlameThrower()
{
//FlameThrowerlogic
}
public void DashWhileFused (float inDir)
{
if(inDir>= 0.1f)
{
//dashright
} else if ( inDir <= -0.1f)
{
//dashleft
}
else
{
//dashforward
}
}
public void ReleaseJump()
{
//animator jumptrigger
}

#endregion

}


@@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MachineTrigger : MonoBehaviour {

public Machine ReferenceMachine { get; set; }

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
void OnTriggerStay(Collider other)
{

if (other.GetComponent<FlameImpLogic>())
{
if (other.GetComponent<FlameImpLogic>().IsDashing() && (!other.GetComponent<FlameImpLogic>().fused || !other.GetComponent<FlameImpLogic>().controllingMachine) && !ReferenceMachine.isActive)
{
other.GetComponent<FlameImpLogic>().SwitchColliders();
other.GetComponent<FlameImpLogic>().SwitchRenderers();
ReferenceMachine.isActive = true;
//setactive call when camera logic is done
other.GetComponent<FlameImpLogic>().ReferenceMachine = ReferenceMachine;
other.GetComponent<FlameImpLogic>().controllingMachine = true;

}
}

}
}