protected void TryCaptureOrRecharge(Portal portal, AchievementModel achievement) { if (portal.Model.Faction == Faction.None) { GameProvider.CapturePortal(portal, SelfFaction); achievement.Capture(portal.Model); if (ShouldSound) { SoundManager.GetInstance().PortalCapturedSound.Play(); } } else if (portal.Model.Faction == SelfFaction) { if (portal.Energy < 100 && rechargeTimer.IsTimeout()) { portal.RechargeEnergy(10); rechargeTimer.Start(); achievement.Recharge(); if (ShouldSound) { SoundManager.GetInstance().PortalRechargedSound.Play(); } } } }
// Update is called once per frame void Update() { if (!IsActive) { if (Input.touchCount > 0 || Input.GetMouseButton(0)) { if (!activationTimerCounting) { activationTimer.Start(); activationTimerCounting = true; } else { if (activationTimer.IsTimeout()) { InputPad.SetActive(true); activationTimerCounting = false; SoundManager.GetInstance().MenuSelectSound.Play(); } } } else { activationTimerCounting = false; } } }
static int Start(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); TimeTicker obj = (TimeTicker)ToLua.CheckObject(L, 1, typeof(TimeTicker)); float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.Start(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void FinishGame(Boolean escape) { var muDiff = LinkManager.GetMU(Faction.Player) - LinkManager.GetMU(Faction.Enemy); var finalResult = (muDiff < 0 || escape) ? Resultboard.FinalResult.Lose : (muDiff >= GameConstants.ExceedingMUToWin) ? Resultboard.FinalResult.Win : Resultboard.FinalResult.Draw; Resultboard.DisplayFinalResult(finalResult, new MedalHelper(PlayerAchievement).Results); Resultboard.Show(); SoundManager.GetInstance().FinishSound.Play(); IsGameOver = true; if (!escape) { gameOverScreenWaitTimer.Start(); } }
// TODO Player specific? public bool TryHack(Faction faction, ItemInventoryModel inventory) { if (!coolDownTimer.IsTimeout()) { return(false); } coolDownTimer.Start(); inventory.AddBursters(Mathf.FloorToInt(Random.value * BursterDropRate)); if (Random.value < KeyDropRate) { inventory.AddKey(Model); } return(true); }
private int GetInput() { var input = InputUtil.GetY(); if (input != 0) { if (keyInputRepeatTimer.IsTimeout()) { keyInputRepeatTimer.Start(); return(input); } else { return(0); } } else { keyInputRepeatTimer.Reset(); return(input); } }
public void DisplayHack() { hackIndicatorTimer.Start(); }