/// <summary> /// Check if moon is up. /// </summary> /// <param name="i">Moon type to check for.</param> /// <param name="tickOffset">Offset to current tick. For example 0 would check if moon is currently up but 1 would check if moon is up in 1 tick.</param> /// <returns></returns> public bool IsMoonUp(MoonTypes i, int tickOffset) { if (MoonTimer[(int)i] == -1) { return(false); } return((MoonTimer[(int)i] + tickOffset) % MoonInterval[(int)i] >= MoonDuration[(int)i] - 1); }
/// Public Methods public override void MoonRiseResponse(MoonTypes moonType) { switch (moonType) { case MoonTypes.blueMoon: ChangeSpeed(speedBuffMultiplier); BecomeInvincible(); break; case MoonTypes.pinkMoon: ChangeSpeed(speedDebuffMultiplier); break; //since I want nothing, I can omitt this: case MoonTypes.purpleMoon: //do nothing break; } }
public override void MoonSetResponse(MoonTypes moonType) { //I m resetting the full state in all cases, so I don't differentiate here. ResetState(); }
abstract public void MoonSetResponse(MoonTypes moonType);
abstract public void MoonRiseResponse(MoonTypes moonType);
/// <summary> /// Check if we have seen a moon rise or fall. /// </summary> /// <param name="i">Moon type to check for.</param> /// <returns></returns> public bool HasSeenMoon(MoonTypes i) { return(MoonTimer[(int)i] != -1); }
public override void MoonSetResponse(MoonTypes moonType) { //restore resource output to normal }
public override void MoonRiseResponse(MoonTypes moonType) { //raise resource output }