public void checkBackR() { Debug.Log("Back on track"); State = CheckPointState.Unchecked; backBox.gameObject.SetActive(true); backBoxR.gameObject.SetActive(false); }
private void humanGetsPoint() { if (this.humanPt >= this.humanPtMax) { this.humanPt = this.humanPtMax; this.titanPt = 0f; this.syncPts(); this.state = CheckPointState.Human; object[] parameters = new object[] { 1 }; base.photonView.RPC("changeState", PhotonTargets.All, parameters); if (gamemode.SpawnSupplyStationOnHumanCapture) { supply = PhotonNetwork.Instantiate("aot_supply", transform.position - (Vector3.up * (transform.position.y - getHeight(transform.position))), transform.rotation, 0); } gamemode.AddHumanScore(2); if (this.checkIfHumanWins()) { GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().gameWin2(); } } else { this.humanPt += Time.deltaTime; } }
private void humanGetsPoint() { if (humanPt >= humanPtMax) { humanPt = humanPtMax; titanPt = 0f; SyncPoints(); state = CheckPointState.Human; base.photonView.RPC("changeState", PhotonTargets.AllBuffered, (int)CheckPointState.Human); if (FengGameManagerMKII.Level.Map != "The City I") { Vector3 position = base.transform.position; Vector3 up = Vector3.up; Vector3 position2 = base.transform.position; supply = PhotonNetwork.Instantiate("aot_supply", position - up * (position2.y - GetHeight(base.transform.position)), base.transform.rotation, 0); } fengGame.PVPhumanScore += 2; fengGame.CheckPvPPoints(); if (HasTeamWon(CheckPointState.Human)) { fengGame.WinGame(); } } else { humanPt += Time.deltaTime; } }
private void humanGetsPoint() { if (humanPt >= humanPtMax) { humanPt = humanPtMax; titanPt = 0f; syncPts(); state = CheckPointState.Human; object[] parameters = { 1 }; photonView.RPC("changeState", PhotonTargets.All, parameters); if (LevelInfo.getInfo(FengGameManagerMKII.level).mapName != "The City I") { supply = PhotonNetwork.Instantiate("aot_supply", transform.position - Vector3.up * (transform.position.y - getHeight(transform.position)), transform.rotation, 0); } var component = GGM.Caching.GameObjectCache.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); component.PVPhumanScore += 2; GGM.Caching.GameObjectCache.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().checkPVPpts(); if (checkIfHumanWins()) { GGM.Caching.GameObjectCache.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().gameWin(); } } else { humanPt += Time.deltaTime; } }
private void humanGetsPoint() { if (this.humanPt >= this.humanPtMax) { this.humanPt = this.humanPtMax; this.titanPt = 0f; this.syncPts(); this.state = CheckPointState.Human; BasePV.RPC("changeState", PhotonTargets.All, new object[] { 1 }); if (FengGameManagerMKII.Level.MapName != "The City I") { this.supply = Optimization.Caching.Pool.NetworkEnable("aot_supply", base.transform.position - Vectors.up * (base.transform.position.y - this.getHeight(base.transform.position)), base.transform.rotation, 0); } (FengGameManagerMKII.FGM.logic as GameLogic.PVPCaptureLogic).PVPHumanScore += 2; FengGameManagerMKII.FGM.CheckPVPpts(); if (this.checkIfHumanWins()) { FengGameManagerMKII.FGM.GameWin(); } } else { this.humanPt += Time.deltaTime; } }
private void humanGetsPoint() { if (this.humanPt >= this.humanPtMax) { this.humanPt = this.humanPtMax; this.titanPt = 0f; this.syncPts(); this.state = CheckPointState.Human; object[] parameters = new object[] { 1 }; base.photonView.RPC("changeState", PhotonTargets.All, parameters); if (LevelInfo.getInfo(FengGameManagerMKII.level).mapName != "The City I") { this.supply = PhotonNetwork.Instantiate("aot_supply", base.transform.position - ((Vector3)(Vector3.up * (base.transform.position.y - this.getHeight(base.transform.position)))), base.transform.rotation, 0); } FengGameManagerMKII component = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); component.PVPhumanScore += 2; GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().checkPVPpts(); if (this.checkIfHumanWins()) { GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().gameWin2(); } } else { this.humanPt += Time.deltaTime; } }
private void Start() { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { Destroy(gameObject); } else if (IN_GAME_MAIN_CAMERA.gamemode != GAMEMODE.PVP_CAPTURE) { if (photonView.isMine) { Destroy(gameObject); } Destroy(gameObject); } else { chkPts.Add(this); IComparer comparer = new IComparerPVPchkPtID(); chkPts.Sort(comparer); if (humanPt == humanPtMax) { state = CheckPointState.Human; if (photonView.isMine && LevelInfo.getInfo(FengGameManagerMKII.level).mapName != "The City I") { supply = PhotonNetwork.Instantiate("aot_supply", transform.position - Vector3.up * (transform.position.y - getHeight(transform.position)), transform.rotation, 0); } } else if (photonView.isMine && !hasAnnie) { if (Random.Range(0, 100) < 50) { var num = Random.Range(1, 2); for (var i = 0; i < num; i++) { newTitan(); } } if (isBase) { newTitan(); } } if (titanPt == titanPtMax) { state = CheckPointState.Titan; } hitTestR = 15f * size; transform.localScale = new Vector3(size, size, size); } }
void Update() { UpdateTargetIconPosition(); distance = Vector3.Distance(gameObject.transform.position, mainCamera.transform.position); if (distance < 20 && checkPointState == CheckPointState.OPEN) { checkPointState = CheckPointState.SMALLER; stateText.text = "REACHED"; } }
void Start() { mainCamera = Camera.main; mainCanvas = FindObjectOfType <Canvas>(); Debug.Assert((mainCanvas != null), "There needs to be a Canvas object in the scene for the OTI to display"); InstainateTargetIcon(); InstainateDistance(); InstainateState(); checkPointState = CheckPointState.OPEN; }
private bool HasTeamWon(CheckPointState state) { foreach (PVPcheckPoint checkPoint in chkPts) { if (checkPoint.state != state) { return(false); } } return(true); }
private void Start() { if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.SINGLE) { UnityEngine.Object.Destroy(base.gameObject); } else if (IN_GAME_MAIN_CAMERA.gamemode != GAMEMODE.PVP_CAPTURE) { if (base.photonView.isMine) { UnityEngine.Object.Destroy(base.gameObject); } UnityEngine.Object.Destroy(base.gameObject); } else { chkPts.Add(this); IComparer comparer = new IComparerPVPchkPtID(); chkPts.Sort(comparer); if (this.humanPt == this.humanPtMax) { this.state = CheckPointState.Human; if (base.photonView.isMine && (FengGameManagerMKII.lvlInfo.mapName != "The City I")) { this.supply = PhotonNetwork.Instantiate("aot_supply", base.transform.position - ((Vector3)(Vector3.up * (base.transform.position.y - this.getHeight(base.transform.position)))), base.transform.rotation, 0); } } else if (base.photonView.isMine && !this.hasAnnie) { if (RCSettings.AnnieSurvive == 0) { if (UnityEngine.Random.Range(0, 100) < 50) { int num = UnityEngine.Random.Range(1, 2); for (int i = 0; i < num; i++) { this.newTitan(); } } if (this.isBase) { this.newTitan(); } } } if (this.titanPt == this.titanPtMax) { this.state = CheckPointState.Titan; } this.hitTestR = 15f * this.size; base.transform.localScale = new Vector3(this.size, this.size, this.size); } }
private void Start() { if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single) { UnityEngine.Object.Destroy(base.gameObject); return; } if (IN_GAME_MAIN_CAMERA.GameMode != GameMode.PVP_CAPTURE) { if (BasePV.IsMine) { UnityEngine.Object.Destroy(base.gameObject); } UnityEngine.Object.Destroy(base.gameObject); return; } PVPcheckPoint.chkPts.Add(this); IComparer comparer = new IComparerPVPchkPtID(); PVPcheckPoint.chkPts.Sort(comparer); if (this.humanPt == this.humanPtMax) { this.state = CheckPointState.Human; if (BasePV.IsMine && FengGameManagerMKII.Level.MapName != "The City I") { this.supply = Optimization.Caching.Pool.NetworkEnable("aot_supply", base.transform.position - Vectors.up * (base.transform.position.y - this.getHeight(base.transform.position)), base.transform.rotation, 0); } } else if (BasePV.IsMine && !this.hasAnnie) { if (UnityEngine.Random.Range(0, 100) < 50) { int num = UnityEngine.Random.Range(1, 2); for (int i = 0; i < num; i++) { this.newTitan(); } } if (this.isBase) { this.newTitan(); } } if (this.titanPt == this.titanPtMax) { this.state = CheckPointState.Titan; } this.hitTestR = 15f * this.size; base.transform.localScale = new Vector3(this.size, this.size, this.size); }
private void Start() { fengGame = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); if (IN_GAME_MAIN_CAMERA.Gametype == GameType.Singleplayer) { Object.Destroy(base.gameObject); return; } if (FengGameManagerMKII.Level.Mode != GameMode.PVP_CAPTURE) { Object.Destroy(base.gameObject); return; } chkPts.Add(this); IComparer comparer = new IComparerPVPchkPtID(); chkPts.Sort(comparer); if (humanPt == humanPtMax) { state = CheckPointState.Human; if (base.photonView.isMine && FengGameManagerMKII.Level.Map != "The City I") { Vector3 position = base.transform.position; Vector3 up = Vector3.up; Vector3 position2 = base.transform.position; supply = PhotonNetwork.Instantiate("aot_supply", position - up * (position2.y - GetHeight(base.transform.position)), base.transform.rotation, 0); } } else if (base.photonView.isMine && !hasAnnie) { if (Random.Range(0, 100) < 50) { int num = Random.Range(1, 2); for (int i = 0; i < num; i++) { NewTitan(); } } if (isBase) { NewTitan(); } } if (titanPt == titanPtMax) { state = CheckPointState.Titan; } hitTestR = 15f * size; base.transform.localScale = new Vector3(size, size, size); }
public void checkIn() { switch (State) { case CheckPointState.Reversed: break; case CheckPointState.Unchecked: Debug.Log("Valid"); State = CheckPointState.Validated; break; default: break; } }
private void changeState(int num) { if (num == 0) { this.state = CheckPointState.Non; } if (num == 1) { this.state = CheckPointState.Human; } if (num == 2) { this.state = CheckPointState.Titan; } }
public HealthItem(float initialx, float initialy) { creation(); width = 31.5f; height = 31.5f; horizontal_pos = initialx; vertical_pos = initialy; currentFrame = 0; lastFrameIncrement = 0; currentAnimation = "heartAnimation"; removeFromGame = false; state = CheckPointState.Untouched; }
private void titanGetsPoint() { if (this.titanPt >= this.titanPtMax) { this.titanPt = this.titanPtMax; this.humanPt = 0f; this.syncPts(); if ((this.state == CheckPointState.Human) && (this.supply != null)) { PhotonNetwork.Destroy(this.supply); } this.state = CheckPointState.Titan; object[] parameters = new object[] { 2 }; base.photonView.RPC("changeState", PhotonTargets.All, parameters); FengGameManagerMKII component = FengGameManagerMKII.instance; component.PVPtitanScore += 2; FengGameManagerMKII.instance.checkPVPpts(); if (this.checkIfTitanWins()) { FengGameManagerMKII.instance.gameLose2(); } if (RCSettings.AnnieSurvive == 0) { if (this.hasAnnie) { if (!this.annie) { this.annie = true; PhotonNetwork.Instantiate("FEMALE_TITAN", base.transform.position - ((Vector3)(Vector3.up * (base.transform.position.y - this.getHeight(base.transform.position)))), base.transform.rotation, 0); } else { this.newTitan(); } } else { this.newTitan(); } } } else { this.titanPt += Time.deltaTime; } }
public void checkBack() { switch (State) { case CheckPointState.Validated: break; case CheckPointState.Unchecked: Debug.Log("Wrong Way"); State = CheckPointState.Reversed; backBox.gameObject.SetActive(false); backBoxR.gameObject.SetActive(true); break; default: break; } }
private void titanGetsPoint() { if (titanPt >= titanPtMax) { titanPt = titanPtMax; humanPt = 0f; syncPts(); if (state == CheckPointState.Human && supply != null) { PhotonNetwork.Destroy(supply); } state = CheckPointState.Titan; object[] parameters = { 2 }; photonView.RPC("changeState", PhotonTargets.All, parameters); var component = GGM.Caching.GameObjectCache.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); component.PVPtitanScore += 2; GGM.Caching.GameObjectCache.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().checkPVPpts(); if (checkIfTitanWins()) { GGM.Caching.GameObjectCache.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().gameLose(); } if (hasAnnie) { if (!annie) { annie = true; PhotonNetwork.Instantiate("FEMALE_TITAN", transform.position - Vector3.up * (transform.position.y - getHeight(transform.position)), transform.rotation, 0); } else { newTitan(); } } else { newTitan(); } } else { titanPt += Time.deltaTime; } }
private void Start() { playtime = 0; pData = GetComponent <PlayerData>(); if (File.Exists(selectedProfilePath)) { selectedProfile = File.ReadAllText(selectedProfilePath); saveDataPath += selectedProfile + ".json"; if (File.Exists(saveDataPath)) { string json = File.ReadAllText(saveDataPath); var dto = JsonConvert.DeserializeObject <PlayerDTO>(json); pData.serializeData = dto.playerSerializeData; playtime = dto.Playtime; if (pData.HasCheckPoint) { transform.position = new Vector2(pData.PosX, pData.PosY); } } } pInput = new PlayerInput(pData); spriteRenderer = GetComponent <SpriteRenderer>(); audioSource = GetComponent <AudioSource>(); #region Initialize States IdleState = new IdleState(this, pInput, pData, "Idle_Animation"); RunningState = new RunningState(this, pInput, pData, "Running_Animation"); FallingState = new FallingState(this, pInput, pData, "Falling_Animation"); JumpState = new JumpState(this, pInput, pData, "Jump_Animation"); StartFallingState = new StartFallingState(this, pInput, pData, "Start_Falling_Animation"); WallSlideState = new WallSlideState(this, pInput, pData, "Wall_slide"); DashingState = new DashingState(this, pInput, pData, "Dash_Animation"); PrimaryAttackState = new PrimaryAttackState(this, pInput, pData, "Left_swing_attack"); GroundedSecondaryAttackState = new GroundedSecondaryAttackState(this, pInput, pData, "Right_swing_attack"); GroundedDownwardAttackState = new GroundedDownwardAttackState(this, pInput, pData, "Downward");; DeathState = new DeathState(this, pInput, pData, "Death_Animation"); CheckPointState = new CheckPointState(this, pInput, pData, "CheckPoint_Animation"); WallJumpState = new WallJumpState(this, pInput, pData, "Jump_Animation"); currentState = IdleState; #endregion Initialize States }
private void titanLosePoint() { if (this.titanPt > 0f) { this.titanPt -= Time.deltaTime * 3f; if (this.titanPt <= 0f) { this.titanPt = 0f; this.syncPts(); if (this.state != CheckPointState.Human) { this.state = CheckPointState.Non; object[] parameters = new object[] { 0 }; base.photonView.RPC("changeState", PhotonTargets.All, parameters); } } } }
private void humanLosePoint() { if (humanPt > 0f) { humanPt -= Time.deltaTime * 3f; if (humanPt <= 0f) { humanPt = 0f; syncPts(); if (state != CheckPointState.Titan) { state = CheckPointState.Non; object[] parameters = { 0 }; photonView.RPC("changeState", PhotonTargets.Others, parameters); } } } }
private void titanGetsPoint() { if (titanPt >= titanPtMax) { titanPt = titanPtMax; humanPt = 0f; SyncPoints(); if (state == CheckPointState.Human && supply != null) { PhotonNetwork.Destroy(supply); } state = CheckPointState.Titan; base.photonView.RPC("changeState", PhotonTargets.AllBuffered, (int)CheckPointState.Titan); fengGame.PVPtitanScore += 2; fengGame.CheckPvPPoints(); if (HasTeamWon(CheckPointState.Titan)) { fengGame.LoseGame(); } if (hasAnnie) { if (!annie) { annie = true; Vector3 position = base.transform.position; Vector3 up = Vector3.up; Vector3 position2 = base.transform.position; PhotonNetwork.Instantiate("FEMALE_TITAN", position - up * (position2.y - GetHeight(base.transform.position)), base.transform.rotation, 0); } else { NewTitan(); } } else { NewTitan(); } } else { titanPt += Time.deltaTime; } }
private void titanGetsPoint() { if (this.titanPt >= this.titanPtMax) { this.titanPt = this.titanPtMax; this.humanPt = 0f; this.syncPts(); if (this.state == CheckPointState.Human && this.supply != null) { PhotonNetwork.Destroy(this.supply); } this.state = CheckPointState.Titan; BasePV.RPC("changeState", PhotonTargets.All, new object[] { 2 }); (FengGameManagerMKII.FGM.logic as GameLogic.PVPCaptureLogic).PVPTitanScore += 2; FengGameManagerMKII.FGM.CheckPVPpts(); if (this.checkIfTitanWins()) { FengGameManagerMKII.FGM.GameLose(); } if (this.hasAnnie) { if (!this.annie) { this.annie = true; Optimization.Caching.Pool.NetworkEnable("FEMALE_TITAN", base.transform.position - Vectors.up * (base.transform.position.y - this.getHeight(base.transform.position)), base.transform.rotation, 0); } else { this.newTitan(); } } else { this.newTitan(); } } else { this.titanPt += Time.deltaTime; } }
private void titanGetsPoint() { if (this.titanPt >= this.titanPtMax) { this.titanPt = this.titanPtMax; this.humanPt = 0f; this.syncPts(); if ((this.state == CheckPointState.Human) && (this.supply != null)) { PhotonNetwork.Destroy(this.supply); } this.state = CheckPointState.Titan; object[] parameters = new object[] { 2 }; base.photonView.RPC("changeState", PhotonTargets.All, parameters); FengGameManagerMKII component = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>(); gamemode.AddTitanScore(2); if (this.checkIfTitanWins()) { GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().gameLose2(); } if (this.hasAnnie) { if (!this.annie) { this.annie = true; PhotonNetwork.Instantiate("FEMALE_TITAN", base.transform.position - ((Vector3)(Vector3.up * (base.transform.position.y - this.getHeight(base.transform.position)))), base.transform.rotation, 0); } else { this.newTitan(); } } else { this.newTitan(); } } else { this.titanPt += Time.deltaTime; } }
private void Start() { if (gamemode == null) { Destroy(gameObject); return; } SetPreviousCheckpoints(); chkPts.Add(this); IComparer comparer = new IComparerPVPchkPtID(); chkPts.Sort(comparer); if (this.humanPt == this.humanPtMax) { this.state = CheckPointState.Human; if (base.photonView.isMine && (FengGameManagerMKII.Level.SceneName != "The City I")) { this.supply = PhotonNetwork.Instantiate("aot_supply", base.transform.position - ((Vector3)(Vector3.up * (base.transform.position.y - this.getHeight(base.transform.position)))), base.transform.rotation, 0); } } else if (base.photonView.isMine && !this.hasAnnie) { if (UnityEngine.Random.Range(0, 100) < 50) { int num = UnityEngine.Random.Range(1, 2); for (int i = 0; i < num; i++) { this.newTitan(); } } if (this.isBase) { this.newTitan(); } } if (this.titanPt == this.titanPtMax) { this.state = CheckPointState.Titan; } this.hitTestR = 15f * this.size; base.transform.localScale = new Vector3(this.size, this.size, this.size); }
public void Push(CheckPointState item) { if (checkPointCount < curCheckPointSize) { checkPoints[checkPointCount] = item; checkPointCount++; } else { CheckPointState[] temp = checkPoints; curCheckPointSize += INITSIZE; checkPoints = new CheckPointState[curCheckPointSize]; for (int i = 0; i < temp.Length; i++) { checkPoints[i] = temp[i]; } checkPoints[checkPointCount] = item; checkPointCount++; } }
private void titanLosePoint() { if (this.titanPt > 0f) { this.titanPt -= Time.deltaTime * 3f; if (this.titanPt <= 0f) { this.titanPt = 0f; this.syncPts(); if (this.state != CheckPointState.Human) { this.state = CheckPointState.Non; BasePV.RPC("changeState", PhotonTargets.All, new object[] { 0 }); } } } }
public void ChangeState(CheckPointState _state) { state = _state; }
public override void update(GameTime currentTime) { // update the current frame if needed if (currentTime.TotalGameTime.TotalMilliseconds - lastFrameIncrement > AnimationFactory.getAnimationSpeed(currentAnimation)) { lastFrameIncrement = currentTime.TotalGameTime.TotalMilliseconds; currentFrame = (currentFrame + 1) % AnimationFactory.getAnimationFrameCount(currentAnimation); } foreach (Entity en in Entity.globalEntityList) { if (en is Player && hitTest(en)) { if (state == CheckPointState.Untouched) { LevelState.currentPlayerHealth = LevelState.maxPlayerHealth; for (int i = 0; i < 12; i++) { LevelState.levelParticlePool.pushParticle(ParticlePool.ParticleType.ColouredSpark, CenterPosition, Vector2.Zero, (float)(i * Math.PI / 6.0), 0.0f, Color.Red); } AudioFactory.playSFX("sfx/getHealth"); LevelState.checkPointTouched = true; LevelState.checkPointTime = LevelState.LevelRecordTime; LevelState.respawnPosition = Position; state = CheckPointState.Touched; currentAnimation = "heartEmpty"; } } } if (state == CheckPointState.Touched) { if (LevelState.respawnPosition != Position) { currentAnimation = "heartAnimation"; currentFrame = 0; lastFrameIncrement = 0; state = CheckPointState.Untouched; } } }
private void changeState(int num) { state = (CheckPointState)num; }
void FixedUpdate() { distanceText.text = Mathf.Round(distance) + "m"; if (checkPointState == CheckPointState.SMALLER) { if (icon.transform.localScale.x > 0) { Vector3 scale = icon.transform.localScale; scale.x -= transition; scale.y -= transition; scale.z -= transition; icon.transform.localScale = scale; } else { iconImage.sprite = CheckPointDone; checkPointState = CheckPointState.BIGGER; } } else if (checkPointState == CheckPointState.BIGGER) { if (icon.transform.localScale.x < 1) { Vector3 scale = icon.transform.localScale; scale.x += transition; scale.y += transition; scale.z += transition; icon.transform.localScale = scale; } else { icon.transform.localScale = new Vector3(checkpointScale, checkpointScale); checkPointState = CheckPointState.CLOSING; } } else if (checkPointState == CheckPointState.CLOSING) { if (icon.transform.localScale.x > 0) { Vector3 scale = icon.transform.localScale; scale.x -= transition; scale.y -= transition; scale.z -= transition; icon.transform.localScale = scale; } else { distanceObject.SetParent(null); stateObject.SetParent(null); icon.transform.SetParent(null); Destroy(icon.gameObject); Destroy(distanceObject.gameObject); Destroy(stateObject.gameObject); Destroy(gameObject); //TODO NEXT Checkpoint } } }