//************************************************************** // collisions raise static events Mainhandtouched blah and offhandtouched blah //************************************************************** private void OnTriggerEnter(Collider other) { // Debug.Log(" collision "+ this.gameObject.name + "->OntrigEnt-> " + other.gameObject.name); if (Mytype == ARZHandType.HandGun) { StemKitMNGR.MAINHandTouchedThisThing(other.gameObject.tag); } else if (Mytype == ARZHandType.HandMag) { if (other.gameObject.tag == "Ammo") { StemKitMNGR.OffHandTouchedThisThing(other.gameObject.tag); } if (MyBun.IsMyThingShowing()) { StemKitMNGR.OffHandTouchedThisThing(other.gameObject.tag); } } else { Debug.Log(" collision but no type set"); } }
private void Update() { if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY) { if (Input.GetKeyDown(KeyCode.I)) { StemKitMNGR.Call_OVR_Cell_ID(0); } if (Input.GetKeyDown(KeyCode.O)) { StemKitMNGR.Call_OVR_Cell_ID(1); } if (Input.GetKeyDown(KeyCode.P)) { StemKitMNGR.Call_OVR_Cell_ID(2); } } if (GameSettings.Instance.IsTestModeON) { if (showText) { txt.text = currentActiveCell.ToString(); } } allCELLOBJ[0].FillWithTime(); allCELLOBJ[1].FillWithTime(); allCELLOBJ[2].FillWithTime(); }
void Hammers_GunSlider() { if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY) { StemKitMNGR.Call_OVR_Cell_ID(2); } }
void ReadKeyBoardInput(bool argAllowExtra) { if (isPlayerAllowedToUseStemInput) { if (Input.GetKeyDown(KeyCode.LeftArrow)) { SelectPreviousGun(); } if (Input.GetKeyDown(KeyCode.RightArrow)) { SelectNextGun(); } if (Input.GetMouseButtonDown(0)) { Fires_EquippedGun(); } if (Input.GetMouseButtonUp(0)) { FireStops_EquippedGun(); } //disable laser from here instead of gun //if ((Input.GetKeyDown(KeyCode.UpArrow)) ){ //if (argAllowExtra) _curEquippedIGun.ToggleLazerOnOff(); } if (Input.GetKeyDown(KeyCode.Z)) { //Ejects_LoadedMag(); StemKitMNGR.CALL_ResetGunAndMeter(); } } }
public void ResetWave() { // destroy all enemies foreach (GameObject g in enemies) { Destroy(g); } enemies = new List <GameObject>(); foreach (ZombieBehavior z in GameObject.FindObjectsOfType <ZombieBehavior>()) { Destroy(z.gameObject); } // get rid of blood splatters _gameCanvas.ResetDamage(); // turn on gun and reticle if (reticle != null) { if (usedevRoom) { reticle.SetActive(true); } } //if no gun->reset gunfor wave isDead = false; //disable game over tag along screen youDiedScreen.SetActive(false); WaveStartedGraphics(); StemKitMNGR.CALL_ToggleStemInput(true); }
public void ResetWave() { StemKitMNGR.CALL_ResetGunAndMeter(); if (GameIsNotOver_IcanmakeZombies) { GameManager.Instance.ResetWave(); currentWave.GetComponent <WaveStandard>().ResetSpawnStates(); } }
IEnumerator WaitExtratime() { yield return(new WaitForSeconds(0.2f)); DisableCanvas(); ResetCellObjsVAlues(); currentActiveCell = ReloadMeterState.Sleeping; StemKitMNGR.CALL_UICELLFilled(-666); //to now have i can haz shooties again }
public override void RefHandleCollision(string ArgObjectTouched) { if (ArgObjectTouched == "Ammo") { StemKitMNGR.OffHandTouchedThisThing(ArgObjectTouched); } if (base.MyBun.IsMyThingShowing()) { StemKitMNGR.OffHandTouchedThisThing(ArgObjectTouched); } }
//todo: find a better way to initialize the gun in had in any other way than a timer... bad programming void SetGun() { StemKitMNGR.Call_GunSetChangeTo(GunType.MAGNUM); StemKitMNGR.CALL_UpdateAvailableGUnIndex(3); StemKitMNGR.CALL_ToggleAllowExtraButtons(true); StemKitMNGR.CALL_ToggleStemInput(true); if (_stmKitMngr == null) { Debug.Log("we loaded the stemstation, but cannot get the stemkitMNGrScript"); } }
//this was on a timer 5sec in wm the first time public void StartWave() { // Debug.Log("3 waveSTD StartWave"); GameManager.Instance.curgamestate = ARZState.WavePlay; StartCoroutine(ie_StartWaveTimer()); FillAllSpawnpoints_onlyonStart(); // print(WaveGun.ToString() + " <--mu gun"); StemKitMNGR.Call_GunSetChangeTo(WaveGun); StemKitMNGR.CALL_UpdateAvailableGUnIndex((int)WaveGun); StemKitMNGR.CALL_ResetGunAndMeter(); StemKitMNGR.CALL_ToggleStemInput(true); }
void Ejects_LoadedMag() { if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY) { if (!_curEquippedIGun.GUN_GET_BOOLS().CanAcceptNewClip) { StemKitMNGR.Call_OVR_Cell_ID(-1); } } //pressing button only skips seg0 , i will check curr state in meterCTRL, if we are i seg 0 we skip, if not do nothing //_IseeThisGun.MANUAL_EJECT_MAG_OUT(); }
////stemkitmanager.start() -> playerHandsCTRL.INit() void Set_EquipedGunObject_Visible(bool argVisible) { // make equipped clip active _isEquipedGunVisible = argVisible; if (_curGunObject != null) { _curGunObject.SetActive(argVisible); StemKitMNGR.Call_SetCurIgunTo(CurGunScript); } else { Debug.LogWarning("no curr weapon Onject "); } }
public void PlayerDied_GameManager() { isDead = true; StemKitMNGR.CALL_ToggleStemInput(false); _scoreManager.Increment_DeathsCNT(); // turn off gun and reticle if (reticle != null) { reticle.SetActive(false); } // pause all enemies foreach (GameObject g in enemies) { g.GetComponent <ZombieBehavior>().Zbeh_PauseZombieAnimation(); } if (gameTimeIsUp) { Debug.Log("gameover yo"); // game over _gameCanvas.FinalScore(_scoreManager.Get_PointsTotal()); gameOverScreen.SetActive(true); _waveManager.StopTheGame(); } else { //******************************************************************************************************************* //THIS NEVER HAPPENED gametimeIsup is Never set to true bcause nothing ever calst TimeUp() , instead we use HArdStop //******************************************************************************************************************* int CurWavePoints = _scoreManager.Get_PointsCurWave(); _gameCanvas.PointsLost(CurWavePoints); _scoreManager.Update_Add_PointsTotalLost(CurWavePoints); _scoreManager.Update_Remove_PointsTotal(CurWavePoints); _scoreManager.Reset_WavePoints(); ScoreDebugCon.Instance.update_WAVEPoints(0); youDiedScreen.SetActive(true); // tell wave manager whether or not to reload wave via if time is up //OnGameOver_WaveManager(false); _waveManager.KeepPlaying(); } _gameCanvas.PlayGameOverAudio(); }
public void OnMagSlideAnimCompleted() { if (GameSettings.Instance == null) { _myGunBools.CanAcceptNewClip = false; return; } if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY) { _myGunBools.CanAcceptNewClip = false; StemKitMNGR.CALL_Start_UIcell(2); } }
void testandrun() { if (startIndexWasSet) { if (!all3celsfinished) { DrainInSeconds(0.5f, indexOfActiveCell); } else { StemKitMNGR.HEyActiveReloadEnds(); Destroy(this.gameObject); } } }
void KEYBOARDSelectNextGun() { if (_curEquippedIGun.GUN_GET_BOOLS().ThisGunIsReloading) { return; } _curGunenumIndex = _curEquippedIGun.GetCurGunIndex(); _curGunenumIndex++; if (_curGunenumIndex > _latestUnlockedGunEnumIndex) { _curGunenumIndex = _latestUnlockedGunEnumIndex; } ; StemKitMNGR.Call_GunSetChangeTo((GunType)_curGunenumIndex); }
public void OnSlideOutAnimComplete() { if (GameSettings.Instance == null) { DropMagFromGun(); return; } if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY) { DropMagFromGun(); _myGunBools.CanAcceptNewClip = true; StemKitMNGR.CALL_Start_UIcell(1); } }
void KEYBOARDSelectPreviousGun() { if (_curEquippedIGun.GUN_GET_BOOLS().ThisGunIsReloading) { return; } _curGunenumIndex = _curEquippedIGun.GetCurGunIndex(); _curGunenumIndex--; if (_curGunenumIndex < 1) { _curGunenumIndex = 1; } ; StemKitMNGR.Call_GunSetChangeTo((GunType)_curGunenumIndex); }
void PrivatTapintoCOLLISION() { if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY) { StemKitMNGR.Call_OVR_Cell_ID(1); _curEquippedIGun.GunInjstantiateMagANDSLIDEINanim(); OFFhandScript.MyBun.HideMyCurrBunThing(); OFFhandScript.Animate_OpenHand(); } else { _curEquippedIGun.MagicReloadBulletCount(); OFFhandScript.MyBun.HideMyCurrBunThing(); OFFhandScript.Animate_OpenHand(); } }
void GunHandle_CellFiled(int argIdOfFilledCEll) { if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY) { if (argIdOfFilledCEll == 0) { _myGunAnimate.Gunimate_OPENSLIDER(); _myGunEffect.AUDIO_PopMagOut(); } else if (argIdOfFilledCEll == 1) { GunInjstantiateMagANDSLIDEINanim(); _myGunBools.CanAcceptNewClip = false; _myGunEffect.AUDIO_PushMagIn(); } else if (argIdOfFilledCEll == 2) { // Debug.Log("CAN SHOOT not yet, wiat for a mock HAMERanimatoin time to end , and just play HAMMERDOWN?"); StemKitMNGR.CALL_Start_UIcell(-666); //___ time0.8 seconds of wait time before this point \ _myGunAnimate.Gunimate_HAMMERDOWN(); // |~ _myGunEffect.AUDIO_Chamber(); // | to this poit is a wait of .8 }// | else// V if (argIdOfFilledCEll == -666) //this is wird, since i dont have animation event on hammerdown, i ll fake it by making reloadmeterctrl run a waitforseconds, and at the same time jujst play the hammerdown anim. when waitfr ends, it should call CEllfilled(-666) which will hit here { // Debug.Log("and now i can shoot"); _myGunBools.ThisGunIsReloading = false; _myGunBools.CAnManuallyDropMag = true; if (GameManager.Instance != null) { GameManager.Instance.GetScoreMAnager().Increment_ReloadsCNT(); } } else { Debug.LogError("there should only be 0,1,2, -666 right now"); } } }
void StartGame() { StemKitMNGR.CALL_ToggleAllowExtraButtons(false); TargCTRL.MakeInvisible(); // DebugConsole.print("1 Gamestarted"); if (mists.Count > 0) { //DebugConsole.print("we got mists"); MistMover mm = mists[0].gameObject.GetComponent <MistMover>(); if (mm) { // DebugConsole.print("we got mistmover"); if (_placeHolderMistTarget != null) { DebugConsole.print("mist can move to mist target"); mm.StartMistMove(_placeHolderMistTarget.transform.position); } else { DebugConsole.print("mist is moving to player"); mm.StartMistMove( new Vector3( mists[0].gameObject.transform.position.x, mists[0].gameObject.transform.position.y, GameObject.FindObjectOfType <Camera>().transform.position.z)); } } } isGameStarted = true; if (player.gridPosition == null) { player.SetGridPosition(); } // begin first wave in 5 seconds _waveManager.BeginNextWave(GameSettings.Instance.FirstBuffer); WaveStartedGraphics(); }
public void KeepPlaying() { GameIsNotOver_IcanmakeZombies = true; currentWave.GetComponent <WaveStandard>().ResetSpawnStates(); isWaveLoaded = false; Destroy(currentWave); StemKitMNGR.CALL_ResetGunAndMeter(); if (!GameSettings.Instance.IsGameLong) { currentWave = Instantiate(ShortWaves[waveNum]); wave = currentWave.GetComponent <IWave>(); WS = GetCurrWave(); isWaveLoaded = true; TimerBehavior t = gameObject.AddComponent <TimerBehavior>(); t.StartTimer(GameSettings.Instance.StartResetWaveIn, ResetWave); t = gameObject.AddComponent <TimerBehavior>(); t.StartTimer(GameSettings.Instance.StartWaveAgain, WMStartWave); } else { currentWave = Instantiate(waves[waveNum]); wave = currentWave.GetComponent <IWave>(); WS = GetCurrWave(); isWaveLoaded = true; TimerBehavior t = gameObject.AddComponent <TimerBehavior>(); t.StartTimer(GameSettings.Instance.StartResetWaveIn, ResetWave); t = gameObject.AddComponent <TimerBehavior>(); t.StartTimer(GameSettings.Instance.StartWaveAgain, WMStartWave); } }
//public PlayerInfoEntry pdi; public void HardStop() { // tell wave manager whether or not to reload wave via if time is up // waveManager.OnGameOver_WaveManager(true); _waveManager.StopTheGame(); StemKitMNGR.CALL_ToggleStemInput(false); // pause all enemies foreach (GameObject g in enemies) { g.GetComponent <ZombieBehavior>().Zbeh_PauseZombieAnimation(); } // game over _gameCanvas.FinalScore(_scoreManager.Get_PointsTotal()); gameOverScreen.SetActive(true); _gameCanvas.PlayGameOverAudio(); curgamestate = ARZState.EndGame; PersistantScoreGrabber.Instance.DoGrabScores(); PersistantScoreGrabber.Instance.DoGrabLines(); StartCoroutine(AUTOGOTO_DataEntry()); }
public void TimesUp() { curgamestate = ARZState.EndGame; gameTimeIsUp = true; StemKitMNGR.CALL_ToggleStemInput(false); }
public void AUDIO_Chamber() { _uaudio.PlayEvent("_Hammer"); StemKitMNGR.CALL_VIBRATECONTROLLERG(200, 1f); }
public void AUDIO_FullReload() { _uaudio.PlayEvent("_FullReload"); StemKitMNGR.CALL_VIBRATECONTROLLERG(500, 0.5f); }
//_myGunBools.CanAcceptNewClip = true; public void GUN_FIRE() { //**************************************************************************************************************************************** //gunhelper.DrawStatic(barrelTran.transform.position, barrelTran.transform.position + (barrelTran.transform.forward * -5)); //**************************************************************************************************************************************** Quaternion thenewrot = DoSpread(stopSpreading); // gunhelper.DrawStatic(barrelTran.transform.position, thenewrot * Vector3.one *5); //**************************************************************************************************************************************** //gunhelper.DrawStatic(barrelTran.transform.position, barrelTran.transform.position + (thenewrot*(barrelTran.transform.forward * 5) )); //**************************************************************************************************************************************** if (_myGunBools.ThisGunIsReloading) { Debug.Log("no shot I b reloading "); return; } if (!_myMagazineMNGR.IsMagPlaced()) { Debug.Log("no shot no mag in "); return; } if (!_myMagazineMNGR.IsThereBulletsInCurmag()) { // Debug.Log("play dry shot caling cell0"); _myGunEffect.AUDIO_Dry(); if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY) { StemKitMNGR.CALL_Start_UIcell(0); _myGunBools.ThisGunIsReloading = true; _myGunBools.CAnManuallyDropMag = true; } return; } { // repeat fire if gun type is uzi if (gunType == GunType.UZI) { _myGunAnimate.PlayFastest(); stopSpreading = false; repeatTimer.StartTimer(repeatTime, GUN_FIRE, false); } else { _myGunAnimate.PlayFast(); } if (!_myMagazineMNGR.IsMagPlaced()) { Debug.Log("no mag"); GUN_STOP_FIRE();//FOR SAFE MEASURE return; } if (_myMagazineMNGR.CanDecrementCurMagBulletCount()) { //_myGunBools.BHazBullets = true; Instantiate(_myMagazineMNGR.GetChamberedBullet(), barrelTran.position, thenewrot);// barrelTran.rotation); _myGunAnimate.Gunimate_FIRE(); GunFlash_FIRE(); } } }
void SignalEndOfThisCellReached() { StemKitMNGR.CALL_UICELLFilled(CellID); }
public void FlashEffect() { myflash.Flash(); _uaudio.PlayEvent("_Fire"); StemKitMNGR.CALL_VIBRATECONTROLLERG(100, 1f); }
void LoadObjects() { if (_waveManager.GetWave() == null) { TimerBehavior t = gameObject.AddComponent <TimerBehavior>(); t.StartTimer(0.5f, LoadObjects); return; } if (!IsInDevRoom()) { // gather all stored anchors string[] ids = anchorStore.GetAllIds(); for (int index = 0; index < ids.Length; index++) { if (ids[index] == AnchorName_StemBase) { if (curgamemode != ARZGameModes.GameNoStem) { reticle.gameObject.SetActive(false); // if anchor is stem system // instantiate stem system prefab it should have been set to left or right on start GameObject obj = Instantiate(stemSystemKit) as GameObject; anchorStore.Load(ids[index], obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } _stmKitMngr = obj.GetComponent <StemKitMNGR>(); } } else if (ids[index] == AnchorName_ConsoleObject) { // if anchor is console object // instantiate console prefab GameObject obj = Instantiate(consoleObject) as GameObject; anchorStore.Load(ids[index], obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } } else if (ids[index] == AnchorName_ScoreBoard) { // if anchor is scoreboard // instantiate scoreboard from anchor data GameObject obj = Instantiate(scoreboard) as GameObject; anchorStore.Load(ids[index], obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } } //-------------------------------------------------------------------- else if (ids[index] == AnchorName_Target) { // if anchor is scoreboard // instantiate scoreboard from anchor data GameObject obj = Instantiate(target) as GameObject; anchorStore.Load(ids[index], obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } TargCTRL = obj.GetComponent <TargetControle>(); } //-------------------------------------------------------------------- else if (ids[index] == AnchorName_StartButton) { GameObject obj = Instantiate(startButton) as GameObject; anchorStore.Load(ids[index], obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } StartCTRL = obj.GetComponent <StartButtonControle>(); } //-------------------------------------------------------------------- AnchorName_StartButton else if (ids[index] == AnchorName_metalBarrel) { // if anchor is weapons rack // instantiate weapons rack from anchor data GameObject obj = Instantiate(metalBarrel) as GameObject; anchorStore.Load(ids[index], obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } // obj.transform.Rotate(Vector3.up, 180.0f); or not // rack = obj.GetComponent<WeaponRack>(); } else if (ids[index] == AnchorName_roomModel) { // if anchor is weapons rack // instantiate weapons rack from anchor data GameObject obj = Instantiate(roomModel) as GameObject; anchorStore.Load(ids[index], obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } // obj.transform.Rotate(Vector3.up, 180.0f); or not // rack = obj.GetComponent<WeaponRack>(); } else if (ids[index].Contains(AnchorName_AmmoBoxInfinite)) { // if anchor is infinite ammo box // instantiate infinite ammo box from anchor data GameObject obj = Instantiate(infiniteAmmoBox) as GameObject; anchorStore.Load(ids[index], obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } } else if (ids[index] == AnchorName_PathFinder) { // if anchor is pathfinder // instantiate pathfinder from anchor data GameObject obj = Instantiate(gridMap) as GameObject; anchorStore.Load(ids[index], obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } Locate_Lines_ANC_Pivot(obj); } else if (ids[index].Contains(AnchorName_SpawnPoint)) { // if anchor is a spawn point // instantiate spawn point from anchor data GameObject obj = Instantiate(spawnPoint) as GameObject; anchorStore.Load(ids[index], obj); // add spawn point to collection spawnPoints.Add(obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } } else if (ids[index].Contains(AnchorName_HotSpot)) { // if anchor is a hotspot // instantiate hotspot from anchor data GameObject obj = Instantiate(hotspot) as GameObject; anchorStore.Load(ids[index], obj); // add spawn point to collection hotspots.Add(obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } } else if (ids[index].Contains(AnchorName_MistEmitter)) { // if anchor is mist // instantiate mist from anchor data GameObject obj = Instantiate(mist) as GameObject; anchorStore.Load(ids[index], obj); mists.Add(obj); // delete anchor component WorldAnchor attachedAnchor = obj.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } } else if (ids[index].Contains(AnchorName_MistEnd)) { //MistMover MistMoverScript = FindObjectOfType<MistMover>(); //// if none exist then instantiate one //if (MistMoverScript == null) //{ // GameObject obj = Instantiate(mist) as GameObject; // MistMoverScript = obj.GetComponent<MistMover>(); //} // instantiate placeholder at world anchor position _placeHolderMistTarget = Instantiate(placeholder) as GameObject; anchorStore.Load(ids[index], _placeHolderMistTarget); // delete anchor component WorldAnchor attachedAnchor = _placeHolderMistTarget.GetComponent <WorldAnchor>(); if (attachedAnchor != null) { DestroyImmediate(attachedAnchor); } // add placeholder to airstrike object as air strike end //MistMoverScript.SetMistEnd(placeholderObject); } } } if (_placeHolderMistTarget == null) { DebugConsole.print("mist target is NULL!"); } LevelLoaded(); }