public static void RunRadarPanorama(int EntBase) { if (CheatStatus.RadarActive && !CEntityPlayer.isDead(EntBase)) { CEntityPlayer.SpotPlayer(EntBase); } }
public static void RunGlowESPPanorama(int EntBase) { int GlowIndex = CylMem.ReadInt(EntBase + m_iGlowIndex); if (CEntityPlayer.Team(EntBase) == Teams.TERRORIST && CheatStatus.WallActive && CEntityPlayer.isAlive(EntBase) && ((CLocalPlayer.Team != CEntityPlayer.Team(EntBase) && VisualConfig.glowEnemyTeam) || (CLocalPlayer.Team == CEntityPlayer.Team(EntBase) && VisualConfig.glowLocalTeam))) //T { if (VisualConfig.selectedGlowColor == VisualColor.ENGINE) { CEntityPlayer.Glow(GlowIndex, VisualConfig.GlowEngineTerrorist, VisualConfig.selectedGlowStyle, VisualConfig.selectedGlowType); } else if (VisualConfig.selectedGlowColor == VisualColor.REDBLUE) { CEntityPlayer.Glow(GlowIndex, VisualConfig.GlowRed, VisualConfig.selectedGlowStyle, VisualConfig.selectedGlowType); } else if (VisualConfig.selectedGlowColor == VisualColor.HEALTH) { CEntityPlayer.Glow(GlowIndex, Parsers.ParseEnemyGlowHealth(CEntityPlayer.Health(EntBase)), VisualConfig.selectedGlowStyle, VisualConfig.selectedGlowType); } } if (CEntityPlayer.Team(EntBase) == Teams.ANTI_TERRORIST && CheatStatus.WallActive && CEntityPlayer.isAlive(EntBase) && ((CLocalPlayer.Team != CEntityPlayer.Team(EntBase) && VisualConfig.glowEnemyTeam) || (CLocalPlayer.Team == CEntityPlayer.Team(EntBase) && VisualConfig.glowLocalTeam))) //AT { if (VisualConfig.selectedGlowColor == VisualColor.ENGINE) { CEntityPlayer.Glow(GlowIndex, VisualConfig.GlowEngineATerrorist, VisualConfig.selectedGlowStyle, VisualConfig.selectedGlowType); } else if (VisualConfig.selectedGlowColor == VisualColor.REDBLUE) { CEntityPlayer.Glow(GlowIndex, VisualConfig.GlowBlue, VisualConfig.selectedGlowStyle, VisualConfig.selectedGlowType); } else if (VisualConfig.selectedGlowColor == VisualColor.HEALTH) { CEntityPlayer.Glow(GlowIndex, Parsers.ParseEnemyGlowHealth(CEntityPlayer.Health(EntBase)), VisualConfig.selectedGlowStyle, VisualConfig.selectedGlowType); } } }
void OnTriggerStay(Collider collider) { if (!enabled) { return; } Rigidbody rBody = collider.gameObject.GetComponent <Rigidbody>(); if (rBody == null) { return; } if (rBody.velocity.y < MaximumVelocity.y) { rBody.AddForce(new Vector3(0.0f, ForceToApply.y, 0.0f)); } CEntityPlayer player = CEntityPlayer.GetInstance(); if (player) { player.Physics.MakeJump(); player.Physics.Velocity += ForceToApply.x; if (player.Physics.Velocity > MaximumVelocity.x) { player.Physics.Velocity = MaximumVelocity.x; } } }
public static void RunAimbotPanorama(AimBotController Aim) { Aim.setFrom(CLocalPlayer.Position); int target_aim_entbase = Aim.closestPlayerEntityBase; Vector3 target_aim_vector = Aim.closestPlayerVector; if (CEntityPlayer.isPlayerSpotted(target_aim_entbase) && CLocalPlayer.Team != CEntityPlayer.Team(target_aim_entbase) && (CEntityPlayer.Team(target_aim_entbase) == Teams.ANTI_TERRORIST || CEntityPlayer.Team(target_aim_entbase) == Teams.TERRORIST) && CEntityPlayer.Health(target_aim_entbase) <= 100 && CEntityPlayer.Health(target_aim_entbase) > 0 && CEntityPlayer.WeaponName(target_aim_entbase) != "NONE" && !(CEntityPlayer.Team(target_aim_entbase) == Teams.NONE || CEntityPlayer.Team(target_aim_entbase) == Teams.SPECTATOR) && CEntityPlayer.isAlive(target_aim_entbase) && !CEntityPlayer.isDormant(target_aim_entbase) && CEntityPlayer.isPlayerSpotted(target_aim_entbase) && CheatStatus.AimbotActive) { if (AimBotConfig.LockKey == KeysList.NOKEYS) { if (Methods.HoldingKey(Keys.LButton)) { Vector3 raw = Aim.CalcAngle(CLocalPlayer.VectorEyeLevel, target_aim_vector); Vector3 raw_unp = Aim.RemovePunch(raw); Vector3 target_angle = Parsers.ClampAngle(raw_unp); CLocalPlayer.ViewAngles = target_angle; } } else { if (Methods.HoldingKey(Parsers.KeyListToRealKey(AimBotConfig.LockKey))) { Vector3 raw = Aim.CalcAngle(CLocalPlayer.VectorEyeLevel, target_aim_vector); Vector3 raw_unp = Aim.RemovePunch(raw); Vector3 target_angle = Parsers.ClampAngle(raw_unp); CLocalPlayer.ViewAngles = target_angle; } } } }
public static void RunRadarLegit(int EntBase, bool Active) { if (Active) { CEntityPlayer.SpotPlayer(EntBase); } }
public static void ConfigureAimbot(int EntBase, AimBotController Aim) { if (CLocalPlayer.Team != CEntityPlayer.Team(EntBase) && (CEntityPlayer.Team(EntBase) == Teams.ANTI_TERRORIST || CEntityPlayer.Team(EntBase) == Teams.TERRORIST) && CEntityPlayer.Health(EntBase) <= 100 && CEntityPlayer.Health(EntBase) > 0 && CEntityPlayer.WeaponName(EntBase) != "NONE" && !(CEntityPlayer.Team(EntBase) == Teams.NONE || CEntityPlayer.Team(EntBase) == Teams.SPECTATOR) && CEntityPlayer.isAlive(EntBase) && !CEntityPlayer.isDormant(EntBase) && CEntityPlayer.isPlayerSpotted(EntBase)) { Aim.closestEngine(EntBase, Methods.GetBonePos(EntBase, AimBotConfig.SelectedBone)); } }
public static void MainThread() { if (Modules.IsModuleRunning(Modules.ClientDLLName)) { } while (true) { if (CLocalPlayer.IsPlaying) { for (int i = 0; i <= EngineClient.MaxPlayer; i++) { int EntBase = CylMem.ReadInt(Modules.ClientDLLAdress + CoreCheat_Reborn.CheatClasses.Offsets.signatures.dwEntityList + i * 0x10); if (EntBase == 0) { continue; } if (CEntityPlayer.isDormant(EntBase)) { continue; } GlowESP.RunGlowESPLegit(EntBase, deadESP, GlowEngineTerrorist, GlowEngineATerrorist); Chams.RunChamsLegit(EntBase, chams, deadESP); EngineRadar.RunRadarLegit(EntBase, radar); } Thread.Sleep(1); } } }
/* * \brief Called whilst a collision is taking place */ void OnCollisionStay(Collision collision) { if (m_playerState == GruntState.FallingFromTower) { return; } m_physics.CallOnCollisionStay(collision, ref m_playerState, ref m_playerPositionAlpha); if (m_physics.CollisionType == CollisionState.OnWall) { m_playerPositionAlpha = m_lastPlayerPositionAlpha; } foreach (ContactPoint contact in collision) { //Debug.Log("This Collider: " + contact.thisCollider.gameObject.name); //Debug.Log("Other Collider: " + contact.otherCollider.gameObject.name); if (contact.otherCollider != null && contact.otherCollider.gameObject != null) { if (contact.thisCollider.gameObject.name == "Bip001 L Hand001" && contact.otherCollider.gameObject.name == "Player Spawn") { Debug.Log("Hit player"); CEntityPlayer.GetInstance().PushPlayerFromTower(); m_playerDetected = false; } } } }
private void CheckKillOnTouch(Collision collision) { if (!KillPlayerOnTouch) { return; } foreach (ContactPoint contact in collision) { GameObject player = null; if (contact.otherCollider != null && contact.otherCollider.gameObject.name == "Player Spawn") { player = contact.otherCollider.gameObject; } if (contact.thisCollider != null && contact.thisCollider.gameObject.name == "Player Spawn") { player = contact.thisCollider.gameObject; } if (player == null) { continue; } CEntityPlayer entityPlayer = player.GetComponent <CEntityPlayer>(); if (entityPlayer == null) { return; } entityPlayer.PushPlayerFromTower(); } }
public override void LogicStateChange(bool newState) { if (!m_active) { enabled = true; m_camera = CCamera.GetInstance(); m_player = CEntityPlayer.GetInstance(); } }
public void MakeJump() { m_fakeJump = true; m_jumpTimer = ((Time.time) * 1000.0f); m_jumpState = JumpState.Jumping; CEntityPlayer.GetInstance().SetPlayerState(PlayerState.Jumping); m_collisionState = CollisionState.None; }
public override void LogicStateChange(bool newState) { if (!m_active) { enabled = true; m_camera = CCamera.GetInstance(); m_player = CEntityPlayer.GetInstance(); } }
/* * \brief Called when the object is created. At the start. * Only called once per instaniation. */ public void Start() { m_transform = this.transform; DistanceFromPlayer = InitialDistanceFromPlayer; m_playerEntity = this.transform.FindChild("../Player Spawn").GetComponent <CEntityPlayer>(); m_playerPelvis = this.transform.FindChild("../Player Spawn/Player_Mesh/Bip001/Bip001 Pelvis"); m_storedPositions = new ArrayList(); m_storedPositions.Add(m_playerPelvis.position); m_countIgnoredFrames = 0; }
public void SetLedgeGrabState(CEntityPlayer player, PlayerState state) { if (state == PlayerState.LedgeHang) { m_velocity = 0; player.SetPlayerState(PlayerState.LedgeHang); m_body.constraints = RigidbodyConstraints.FreezeAll; m_jumpState = JumpState.Landed; } }
void OnTriggerStay(Collider collision) { GameObject gObject = collision.collider.gameObject; CEntityPlayer player = gObject.GetComponent <CEntityPlayer>(); if (player != null) { TriggerCheckpoint(player); } }
/* * \brief Initialise anything we don't know at construct time */ public void Create(CEntityPlayer player, Rigidbody body) { m_body = body; m_player = player; m_wallJump = player.GetComponent <CWallJump>(); m_ladderClimb = new CLadderClimb(); //m_ledgeGrabBox = transform.Find("Ledge_Grab_Detection").gameObject; m_invert = InsideTower ? -1 : 1; }
//called if a collidable object triggers the volume void OnTriggerEnter(Collider collider) { if (m_enabled) { CEntityPlayer player = collider.gameObject.GetComponent <CEntityPlayer>(); if (player) { player.DoDamage(Damage); m_timeDamaged = Time.time; } } }
void OnTriggerEnter(Collider collision) { GameObject gObject = collision.collider.gameObject; CEntityPlayer player = gObject.GetComponent <CEntityPlayer>(); if (player != null) { player.LastCheckPoint = this; m_playerAlpha = player.CurrentPlayerAlpha; m_direction = player.Physics.Direction; } }
void OnTriggerStay(Collider collider) { if (collider.name != "Player Spawn") { return; } if (Enabled) { CEntityPlayer.GetInstance().PushPlayerFromTower(); } }
//called if a collidable object triggers the volume void OnTriggerEnter(Collider collider) { Rigidbody rBody = collider.gameObject.GetComponent <Rigidbody>(); rBody.AddForce(ForceToApply); CEntityPlayer player = collider.gameObject.GetComponent <CEntityPlayer>(); if (player) { player.SetPlayerState(PlayerState.Jumping); } }
/* * \brief Called when the object is created. At the start. * Only called once per instaniation. */ public override void Start() { if (INSTANCE == null) { INSTANCE = this; } base.Start(); if (Application.platform == RuntimePlatform.Android) { Screen.orientation = ScreenOrientation.Landscape; } //Time.timeScale = 0.75f; m_playerPositionAlpha = InitialAlphaPosition; m_name = "Player"; m_physics = GetComponent <CPlayerPhysics>(); m_physics.Create(this, GetComponent <Rigidbody>()); //m_cameraClass = MainCamera.GetComponent<CCamera>(); m_animation = GetComponent <CPlayerAnimation>(); m_animation.OnStart(GetComponentInChildren <Animation>()); m_playerHealth = MaxHealth; m_characterMesh = this.transform.Find("Player_Mesh"); m_characterMesh.rotation = Quaternion.Euler(new Vector3(0, this.transform.rotation.eulerAngles.y + 90, 0)); m_physics.MovingDirection = StartFacing == LeftRight.Left ? 1 : -1; m_ledgeGrabBox = this.transform.Find("Ledge_Grab_Detection"); if (StartCheckPoint != null) { m_lastCheckpoint = StartCheckPoint; } m_dead.didDie = false; m_debug = GetComponent <CPlayerDebug>(); if (m_debug != null) { m_debug.SetPlayer(this); } m_pelvisOffset = this.transform.Find("Player_Mesh/Bip001/Bip001 Pelvis").position - this.transform.position; }
/* * \brief Called when this first collides with something */ void OnCollisionEnter(Collision collision) { if (m_playerState == GruntState.FallingFromTower) { return; } foreach (ContactPoint contact in collision) { //Debug.Log("This Collider: " + contact.thisCollider.gameObject.name); //Debug.Log("Other Collider: " + contact.otherCollider.gameObject.name); if (contact.otherCollider != null && contact.otherCollider.gameObject != null) { if (contact.otherCollider.gameObject.name == "Player Spawn") { //Debug.Log("Collided with player"); m_playerState = GruntState.Attacking; m_ticksInContactWithPlayer++; } } if (contact.thisCollider.gameObject.name == "Bip001 L Hand001" && contact.otherCollider.gameObject.name == "Player Spawn") { Debug.Log("Hit player"); CEntityPlayer.GetInstance().PushPlayerFromTower(); m_playerDetected = false; } } m_physics.CallOnCollisionEnter(collision, m_playerDetected); if (collision.collider.gameObject.name == "GruntBarrier") { m_onBarrier = true; } if (collision.collider.gameObject.name == "GruntSpawn" && !m_playerDetected) { m_playerState = GruntState.Standing; m_physics.MovingDirection = -1; } if (collision.collider.gameObject.name == "Electricity") { //Kill grunt Object deathBlast = Instantiate(DeathEffect, transform.position, transform.rotation); Destroy(deathBlast, 2); Debug.Log(this); this.transform.gameObject.SetActiveRecursively(false); } }
void OnTriggerEnter() { if (!m_active) { CEntityPlayer player = CEntityPlayer.GetInstance(); if (player == null) { return; } player.SetPlayerState(PlayerState.InCutScene); m_active = true; //m_animation.Play(); this.transform.rotation.SetLookRotation(this.transform.position - player.transform.position); } }
private Vector3 m_wallJumpPoint = Vector3.zero; //!< #endregion Fields #region Methods /* * \brief Called when the player enters a collosion */ public void CallOnCollisionEnter(CEntityPlayer player, Collision collision, ref PlayerState playerState) { if (playerState != PlayerState.Jumping) return; CSceneObject sceneObject = collision.gameObject.GetComponent<CSceneObject>(); if (sceneObject && (m_lastWallJumpObject == null || m_lastWallJumpObject != sceneObject) && sceneObject.CanWallJump) { m_canWallJump = true; m_lastWallJumpObject = sceneObject; m_wallJumpPoint = player.transform.position; playerState = PlayerState.WallJumping; } else { m_canWallJump = false; } }
// Something entered the trigger area void OnTriggerEnter(Collider other) { if (!enabled) { return; } if (m_animation == null || m_animation.GetClipCount() == 0) { Debug.LogWarning("Cutscene '" + name + "' is missing an animation!"); return; } if (other.name != "Player Spawn") { return; } m_player = CEntityPlayer.GetInstance(); if (m_player == null) { return; } m_camera = CCamera.GetInstance(); if (m_camera == null) { return; } m_player.SetPlayerState(PlayerState.InCutScene); if (GruntObject != null) { GruntObject.GetComponent <CEntityGrunt>().SetGruntState(GruntState.Standing); } m_camera.ClearFrames(); m_initialDistanceFromPlayer = m_camera.DistanceFromPlayer; m_maxPositionsStored = m_camera.MaxPositionsStored; m_camera.MaxPositionsStored = NumberOfLerpKeys; m_animation.Play(); m_active = true; }
void OnTriggerStay(Collider collider) { Rigidbody rBody = collider.gameObject.GetComponent <Rigidbody>(); if (rBody.velocity.y < MaximumVelocity.y) { rBody.AddForce(new Vector3(0.0f, ForceToApply.y, 0.0f)); } CEntityPlayer player = collider.gameObject.GetComponent <CEntityPlayer>(); if (player) { if (player.Physics.Velocity < MaximumVelocity.x) { player.Physics.Velocity += ForceToApply.x; } } }
/* * \brief Called when the player enters a collosion */ public void CallOnCollisionEnter(CEntityPlayer player, Collision collision, ref PlayerState playerState) { if (playerState != PlayerState.Jumping) { return; } CSceneObject sceneObject = collision.gameObject.GetComponent <CSceneObject>(); if (sceneObject && (m_lastWallJumpObject == null || m_lastWallJumpObject != sceneObject) && sceneObject.CanWallJump) { m_canWallJump = true; m_lastWallJumpObject = sceneObject; m_wallJumpPoint = player.transform.position; playerState = PlayerState.WallJumping; } else { m_canWallJump = false; } }
public static void RunChamsPanorama(int EntBase) { if (CheatStatus.ChamsActive) { if (CEntityPlayer.Team(EntBase) == Teams.TERRORIST && CEntityPlayer.isAlive(EntBase)) //T { if (VisualConfig.selectedChamsColor == VisualColor.ENGINE) { CEntityPlayer.ApplyChams(VisualConfig.EngineTerroristColor, VisualConfig.ChamsBrightness, EntBase); } else if (VisualConfig.selectedChamsColor == VisualColor.REDBLUE) { CEntityPlayer.ApplyChams(VisualConfig.Red, VisualConfig.ChamsBrightness, EntBase); } else if (VisualConfig.selectedChamsColor == VisualColor.HEALTH) { CEntityPlayer.ApplyChams(Parsers.ParseEnemyChamsHealth(CEntityPlayer.Health(EntBase)), VisualConfig.ChamsBrightness, EntBase); } } if (CEntityPlayer.Team(EntBase) == Teams.ANTI_TERRORIST && CEntityPlayer.isAlive(EntBase)) //AT { if (VisualConfig.selectedChamsColor == VisualColor.ENGINE) { CEntityPlayer.ApplyChams(VisualConfig.EngineATerroristColor, VisualConfig.ChamsBrightness, EntBase); } else if (VisualConfig.selectedChamsColor == VisualColor.REDBLUE) { CEntityPlayer.ApplyChams(VisualConfig.Blue, VisualConfig.ChamsBrightness, EntBase); } else if (VisualConfig.selectedChamsColor == VisualColor.HEALTH) { CEntityPlayer.ApplyChams(Parsers.ParseEnemyChamsHealth(CEntityPlayer.Health(EntBase)), VisualConfig.ChamsBrightness, EntBase); } } } else { CEntityPlayer.ClearChams(EntBase); } }
//called if a collidable object triggers the volume void OnTriggerEnter(Collider collider) { if (!enabled) { return; } Rigidbody rBody = collider.gameObject.GetComponent <Rigidbody>(); if (rBody == null) { return; } rBody.AddForce(ForceToApply); CEntityPlayer player = CEntityPlayer.GetInstance(); if (player) { player.Physics.MakeJump(); } }
/* * \brief Called when the object is created. At the start. * Only called once per instaniation. */ public void Start() { if (INSTANCE == null) { INSTANCE = this; CGUIOptions.GetInstance().ApplyOptions(); } m_transform = this.transform; DistanceFromPlayer = InitialDistanceFromPlayer; m_playerEntity = CEntityPlayer.GetInstance(); if (m_playerEntity == null) { m_playerEntity = GameObject.Find("Player Spawn").GetComponent <CEntityPlayer>(); } m_playerPelvis = m_playerEntity.transform.FindChild("Player_Mesh/Bip001/Bip001 Pelvis"); m_currentTransform = m_playerPelvis; m_storedPositions = new ArrayList(); m_storedPositions.Add(m_currentTransform.position); m_countIgnoredFrames = 0; m_storedCameraPositions = new ArrayList(); m_credits = this.gameObject.GetComponentInChildren <CEndCredits>(); if (m_credits) { m_credits.gameObject.SetActiveRecursively(false); } if (this.transform.FindChild("Background")) { m_creditsBackground = this.transform.FindChild("Background").gameObject; if (m_creditsBackground) { m_creditsBackground.SetActiveRecursively(false); } } }
public static void RunGlowESPLegit(int EntBase, bool Active, GlowStruct TColor, GlowStruct ATColor) { int GlowIndex = CylMem.ReadInt(EntBase + m_iGlowIndex); if (Active) { if (CLocalPlayer.isDead) { if (CLocalPlayer.Team != CEntityPlayer.Team(EntBase)) { if (CEntityPlayer.Team(EntBase) == Teams.TERRORIST && CEntityPlayer.isAlive(EntBase)) //T { CEntityPlayer.Glow(GlowIndex, TColor, GlowStyle.NORMAL, GlowType.NORMAL); } if (CEntityPlayer.Team(EntBase) == Teams.ANTI_TERRORIST && CEntityPlayer.isAlive(EntBase)) //AT { CEntityPlayer.Glow(GlowIndex, ATColor, GlowStyle.NORMAL, GlowType.NORMAL); } } } } }
void TriggerCheckpoint(CEntityPlayer player) { player.LastCheckPoint = this; player.CurrentLevel = LevelName; m_playerAlpha = player.CurrentPlayerAlpha; m_direction = player.Physics.Direction; if (m_direction == 0) { m_direction = player.Physics.MovingDirection; } if (KillPlane != null && m_killPlane == null) { Vector3 yPos = new Vector3(0, transform.position.y - KillYOffset, 0); m_killPlane = Instantiate(KillPlane, yPos, Quaternion.identity); } if (m_spritesheet != null) { m_spritesheet.active = true; } }
public void OnFixedUpdate(ref PlayerState playerState, CEntityPlayer player) { if (playerState == PlayerState.Walking) { m_currentAnimation = "run"; if (!m_animation.IsPlaying("run")) { m_animation.CrossFade("run", 0.2f); PlayFootstepAudio(player.Physics.GetFootMaterial()); } } else if (playerState == PlayerState.Turning) { m_currentAnimation = "running-turn"; if (!m_animation.IsPlaying("running-turn") && !m_startedTurningRound) { m_startedTurningRound = true; m_animation["running-turn"].speed = 1.2f; m_animation.CrossFade("running-turn"); } else if (!m_animation.IsPlaying("running-turn")) { m_startedTurningRound = false; playerState = PlayerState.Walking; } } else if (playerState == PlayerState.Standing) { if (!m_animation.IsPlaying(m_lastKnownIdle)) { m_currentAnimation = "idle-0"; // "idle-" + Random.Range(0, 4); m_lastKnownIdle = m_currentAnimation; m_animation[m_currentAnimation].speed = Random.Range(10, 30) / 100.0f; m_animation.CrossFade(m_currentAnimation); } } else if (playerState == PlayerState.Jumping) { m_currentAnimation = "run-jump"; if (!m_animation.IsPlaying("run-jump")) m_animation.Play("run-jump"); } else if (playerState == PlayerState.FallJumping) { m_currentAnimation = "falling"; if (!m_animation.IsPlaying("falling")) m_animation.CrossFade("falling"); } else if (playerState == PlayerState.WallJumpStart) { m_currentAnimation = "wall-hang-idle"; if (!m_animation.IsPlaying(m_currentAnimation)) m_animation.CrossFade(m_currentAnimation); } else if (playerState == PlayerState.LedgeHang) { m_currentAnimation = "free-hang-idle"; if (player.Physics.GetLedgeGrabType() == eLedgeType.Wall) m_currentAnimation = "wall-hang-idle"; if (!m_animation.IsPlaying(m_currentAnimation)) { m_animation.CrossFade(m_currentAnimation); m_startedLedgeClimb = false; } } else if (playerState == PlayerState.LedgeClimb) { m_currentAnimation = "free-hang-climb"; if (!m_animation.IsPlaying("free-hang-climb") && !m_startedLedgeClimb) { m_animation.CrossFade("free-hang-climb"); m_startedLedgeClimb = true; } else if (m_startedLedgeClimb == true && !m_animation.IsPlaying("free-hang-climb")) { playerState = PlayerState.LedgeClimbComplete; m_startedLedgeClimb = false; } } else if (playerState == PlayerState.FallingFromTower) { m_currentAnimation = "falling"; if (!m_animation.IsPlaying("falling")) m_animation.CrossFade("falling"); } else if (playerState == PlayerState.OnLadder) { m_currentAnimation = "ladder-climb"; m_animation[m_currentAnimation].speed = player.Physics.GetLadder.offset * 100.0f; if (!m_animation.IsPlaying(m_currentAnimation)) { m_animation.Play(m_currentAnimation); PlayFootstepAudio(FootMaterial.Metal); } } }
public void OnFixedUpdate(ref PlayerState playerState, CEntityPlayer player) { if (playerState == PlayerState.Walking) { m_currentAnimation = "run"; if (!m_animation.IsPlaying("run")) { m_animation.CrossFade("run", 0.2f); PlayFootstepAudio(player.Physics.GetFootMaterial()); } } else if (playerState == PlayerState.Turning) { m_currentAnimation = "running-turn"; if (!m_animation.IsPlaying(m_currentAnimation) && !m_startedTurningRound) { m_startedTurningRound = true; m_animation[m_currentAnimation].speed = 1.2f; m_animation.CrossFade(m_currentAnimation); } else if (!m_animation.IsPlaying(m_currentAnimation)) { m_startedTurningRound = false; playerState = PlayerState.Walking; } } else if (playerState == PlayerState.Standing) { if (!m_animation.IsPlaying(m_lastKnownIdle)) { m_currentAnimation = "idle-0"; // "idle-" + Random.Range(0, 4); m_lastKnownIdle = m_currentAnimation; m_animation[m_currentAnimation].speed = Random.Range(10, 30) / 100.0f; m_animation.CrossFade(m_currentAnimation); m_hasWallJumped = false; } } else if (playerState == PlayerState.Jumping) { m_currentAnimation = "run-jump"; if (!m_animation.IsPlaying("run-jump")) { m_animation.Play("run-jump"); PlayRandomAudio(Jump, true); m_hasWallJumped = false; } } else if (playerState == PlayerState.FallJumping) { m_currentAnimation = "falling"; if (!m_animation.IsPlaying("falling")) { m_animation.CrossFade("falling"); } } else if (playerState == PlayerState.WallJumpStart) { m_currentAnimation = "wall-jump"; if (!m_animation.IsPlaying(m_currentAnimation) && !m_hasWallJumped){ m_hasWallJumped = true; m_animation.CrossFade(m_currentAnimation, 0.01f); } } else if (playerState == PlayerState.LedgeHang) { m_currentAnimation = "free-hang-idle"; if (player.Physics.GetLedgeGrabType() == eLedgeType.Wall) m_currentAnimation = "wall-hang-idle"; if (!m_animation.IsPlaying(m_currentAnimation)) { m_animation.CrossFade(m_currentAnimation); m_startedLedgeClimb = false; } } else if (playerState == PlayerState.LedgeClimb) { m_currentAnimation = "free-hang-climb"; if (!m_animation.IsPlaying("free-hang-climb") && !m_startedLedgeClimb) { m_animation.CrossFade("free-hang-climb"); PlayRandomAudio(Climb, true); m_startedLedgeClimb = true; } else if (m_startedLedgeClimb == true && !m_animation.IsPlaying("free-hang-climb")) { playerState = PlayerState.LedgeClimbComplete; m_startedLedgeClimb = false; } } else if (playerState == PlayerState.FallingFromTower) { m_currentAnimation = "falling"; if (!m_animation.IsPlaying("falling")) { PlayRandomAudio(FallFromTower, false); m_animation.CrossFade("falling"); } } else if (playerState == PlayerState.OnLadder) { m_currentAnimation = "ladder-climb"; m_animation[m_currentAnimation].speed = player.Physics.GetLadder.offset * 150.0f; if (!m_animation.IsPlaying(m_currentAnimation)) { m_animation.Play(m_currentAnimation); PlayFootstepAudio(FootMaterial.Metal); } } else if (playerState == PlayerState.PullingWallLeverDown) { if (m_pulledLever && !m_animation.IsPlaying(m_currentAnimation)) { playerState = PlayerState.Standing; m_pulledLever = false; } m_currentAnimation = "switch-down"; if (!m_animation.IsPlaying(m_currentAnimation)) { m_animation.CrossFade(m_currentAnimation); m_pulledLever = true; } } else if (playerState == PlayerState.PullingWallLeverUp) { if (m_pulledLever && !m_animation.IsPlaying(m_currentAnimation)) { playerState = PlayerState.Standing; m_pulledLever = false; } m_currentAnimation = "switch-up"; if (!m_animation.IsPlaying(m_currentAnimation)) { m_animation.CrossFade(m_currentAnimation); m_pulledLever = true; } } else if (playerState == PlayerState.NormalFloorLever) { if (m_pulledLever && !m_animation.IsPlaying(m_currentAnimation)) { playerState = PlayerState.Standing; m_pulledLever = false; } m_currentAnimation = "bigswitch-on"; if (!m_animation.IsPlaying(m_currentAnimation)) { m_animation.CrossFade(m_currentAnimation); m_pulledLever = true; } } else if (playerState == PlayerState.KickFloorLever) { if (m_pulledLever && !m_animation.IsPlaying(m_currentAnimation)) { playerState = PlayerState.Standing; m_pulledLever = false; } m_currentAnimation = "bigswitch-kick"; if (!m_animation.IsPlaying(m_currentAnimation)) { m_animation.CrossFade(m_currentAnimation); m_pulledLever = true; } } }
void TriggerCheckpoint(CEntityPlayer player) { player.LastCheckPoint = this; player.CurrentLevel = LevelName; m_playerAlpha = player.CurrentPlayerAlpha; m_direction = player.Physics.Direction; if (m_direction == 0) { m_direction = player.Physics.MovingDirection; } if (KillPlane != null && m_killPlane == null) { Vector3 yPos = new Vector3(0, transform.position.y - KillYOffset, 0); m_killPlane = Instantiate(KillPlane, yPos, Quaternion.identity); } if (m_spritesheet != null) { m_spritesheet.active = true; } }
public void SetPlayer(CEntityPlayer player) { m_player = player; }
// Use this for initialization void Start() { //m_healthBarForegroundRect = new Rect(); m_playerEnt = PlayerEntity.GetComponent<CEntityPlayer>(); }
public void Start() { m_playerEntity = PlayerEntity.GetComponent<CEntityPlayer>(); m_steamVent = SteamVent.GetComponent<CSteamVent>(); }
public void SetLedgeGrabState(CEntityPlayer player, PlayerState state) { if (state == PlayerState.LedgeHang) { m_velocity = 0; player.SetPlayerState(PlayerState.LedgeHang); m_body.constraints = RigidbodyConstraints.FreezeAll; m_jumpState = JumpState.Landed; } }
/* * \brief Initialise anything we don't know at construct time */ public void Create(CEntityPlayer player, Rigidbody body) { m_body = body; m_player = player; m_wallJump = player.GetComponent<CWallJump>(); m_ladderClimb = new CLadderClimb(); //m_ledgeGrabBox = transform.Find("Ledge_Grab_Detection").gameObject; m_invert = InsideTower ? -1 : 1; }
// Use this for initialization void Start() { INSTANCE = this; m_initialTransform = this.transform; m_storedYPositions = new ArrayList(); m_fireTimer = 0.0f; m_isFiring = false; testLength = 0.0f; m_playerEntity = CEntityPlayer.GetInstance(); if (m_playerEntity == null) { GameObject playerObject = GameObject.Find("Player Spawn"); if (playerObject != null) { m_playerEntity = playerObject.GetComponent<CEntityPlayer>(); } if (m_playerEntity == null) { Debug.LogError("CEntityAirship: Cannot find player"); return; } } m_playerTransform = m_playerEntity.transform.FindChild("Player_Mesh/Bip001/Bip001 Pelvis"); float playerY = m_playerTransform.position.y; for( int posCount = 0; posCount < NumYPositions; posCount++ ) { m_storedYPositions.Add(playerY); } this.gameObject.SetActiveRecursively(false); }
void OnTriggerStay(Collider other) { if (!enabled || m_active) return; if (m_animation == null || m_animation.GetClipCount() == 0) { Debug.LogWarning("Cutscene '" + name + "' is missing an animation!"); return; } if (other.name != "Player Spawn") return; m_player = CEntityPlayer.GetInstance(); if (m_player == null) return; m_camera = CCamera.GetInstance(); if (m_camera == null) return; m_player.SetPlayerState(PlayerState.InCutScene); m_camera.ClearFrames(); m_initialDistanceFromPlayer = m_camera.DistanceFromPlayer; m_maxPositionsStored = m_camera.MaxPositionsStored; m_camera.MaxPositionsStored = NumberOfLerpKeys; m_animation.Play(); m_active = true; }
/* * \brief Called when the object is created. At the start. * Only called once per instaniation. */ public void Start() { m_transform = this.transform; DistanceFromPlayer = InitialDistanceFromPlayer; m_playerEntity = this.transform.FindChild("../Player Spawn").GetComponent<CEntityPlayer>(); m_playerPelvis = this.transform.FindChild("../Player Spawn/Player_Mesh/Bip001/Bip001 Pelvis"); m_storedPositions = new ArrayList(); m_storedPositions.Add(m_playerPelvis.position); m_countIgnoredFrames = 0; }
/* * \brief Called when the object is created. At the start. * Only called once per instaniation. */ public void Start() { if (INSTANCE == null) { INSTANCE = this; CGUIOptions.GetInstance().ApplyOptions(); } m_transform = this.transform; DistanceFromPlayer = InitialDistanceFromPlayer; m_playerEntity = CEntityPlayer.GetInstance(); if (m_playerEntity == null) { m_playerEntity = GameObject.Find("Player Spawn").GetComponent<CEntityPlayer>(); } m_playerPelvis = m_playerEntity.transform.FindChild("Player_Mesh/Bip001/Bip001 Pelvis"); m_currentTransform = m_playerPelvis; m_storedPositions = new ArrayList(); m_storedPositions.Add(m_currentTransform.position); m_countIgnoredFrames = 0; m_storedCameraPositions = new ArrayList(); m_credits = this.gameObject.GetComponentInChildren<CEndCredits>(); if(m_credits) { m_credits.gameObject.SetActiveRecursively(false); } if(this.transform.FindChild("Background")) { m_creditsBackground = this.transform.FindChild("Background").gameObject; if(m_creditsBackground) { m_creditsBackground.SetActiveRecursively(false); } } }
/* * \brief Called when the object is created. At the start. * Only called once per instaniation. */ public override void Start() { if (INSTANCE == null) { INSTANCE = this; } base.Start(); if (Application.platform == RuntimePlatform.Android) Screen.orientation = ScreenOrientation.Landscape; //Time.timeScale = 0.75f; m_playerPositionAlpha = InitialAlphaPosition; m_name = "Player"; m_physics = GetComponent<CPlayerPhysics>(); m_physics.Create(this, GetComponent<Rigidbody>()); //m_cameraClass = MainCamera.GetComponent<CCamera>(); m_animation = GetComponent<CPlayerAnimation>(); m_animation.OnStart(GetComponentInChildren<Animation>()); m_playerHealth = MaxHealth; m_characterMesh = this.transform.Find("Player_Mesh"); m_characterMesh.rotation = Quaternion.Euler(new Vector3(0, this.transform.rotation.eulerAngles.y + 90, 0)); m_physics.MovingDirection = StartFacing == LeftRight.Left ? 1 : -1; m_ledgeGrabBox = this.transform.Find("Ledge_Grab_Detection"); if (StartCheckPoint != null) { m_lastCheckpoint = StartCheckPoint; } m_dead.didDie = false; m_debug = GetComponent<CPlayerDebug>(); if (m_debug != null) { m_debug.SetPlayer(this); } m_pelvisOffset = this.transform.Find("Player_Mesh/Bip001/Bip001 Pelvis").position - this.transform.position; }
private Vector3 m_wallJumpPoint = Vector3.zero; //!< #endregion Fields #region Methods /* * \brief Called when the player enters a collosion */ public void CallOnCollisionEnter(CEntityPlayer player, Collision collision, ref PlayerState playerState) { }