// ------------------------------------------------------------------------------- public float GetDurationModifier(CurrencyTemplate _template, int _level, float _baseValue) { float value = 0; if (template != _template) { return(value); } value += durationFlat.Get(_level); value += _baseValue * durationPercent.Get(_level); return(value); }
// ------------------------------------------------------------------------------- public long GetProductionModifier(CurrencyTemplate _template, int _level, long _baseValue) { long value = 0; if (template != _template) { return(value); } value += productionFlat.Get(_level); value += Convert.ToInt64(_baseValue * productionPercent.Get(_level)); return(value); }
// ------------------------------------------------------------------------------- public long GetCapacityModifier(CurrencyTemplate _template, int _level, long _baseValue) { long value = 0; if (template != _template) { return(value); } value += capacityFlat.Get(_level); value += Convert.ToInt64(_baseValue * capacityPercent.Get(_level)); return(value); }
// ------------------------------------------------------------------------------- public long GetProduction(GameObject player, int _intervals = 0) { CurrencyTemplate _template = template; int _level = player.GetComponent <AccountManager>().level; long _baseValue = template.autoProduction.amount.Get(_level); long _modifier = 0; _modifier += player.GetComponent <BuildingManager>().GetProduction_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <TechnologyManager>().GetProduction_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <EnhancementManager>().GetProduction_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <UnitManager>().GetProduction_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <EventManager>().GetProduction_AutoCurrencyProduction(_template, _baseValue); return(Convert.ToInt64(_intervals * (_baseValue - _modifier))); }
// ------------------------------------------------------------------------------- public long GetCapacity(GameObject player) { CurrencyTemplate _template = template; int _level = player.GetComponent <AccountManager>().level; long _baseValue = template.capacity.Get(_level); long _modifier = 0; _modifier += player.GetComponent <BuildingManager>().GetCapacity_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <TechnologyManager>().GetCapacity_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <EnhancementManager>().GetCapacity_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <UnitManager>().GetCapacity_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <EventManager>().GetCapacity_AutoCurrencyProduction(_template, _baseValue); return(_baseValue + _modifier); }
// ------------------------------------------------------------------------------- public int GetDuration(GameObject player) { CurrencyTemplate _template = template; int _level = player.GetComponent <AccountManager>().level; float _baseValue = template.autoProduction.duration.Get(_level); float _modifier = 0; _modifier += player.GetComponent <BuildingManager>().GetDuration_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <TechnologyManager>().GetDuration_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <EnhancementManager>().GetDuration_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <UnitManager>().GetDuration_AutoCurrencyProduction(_template, _baseValue); _modifier += player.GetComponent <EventManager>().GetDuration_AutoCurrencyProduction(_template, _baseValue); return(Convert.ToInt32(DateTime.UtcNow.Subtract(new DateTime(timeStamp)).TotalSeconds / _baseValue)); }
// ------------------------------------------------------------------------------- public float GetDuration_AutoCurrencyProduction(CurrencyTemplate _template, float _baseValue) { float value = 0; foreach (UnitSyncStruct entry in syncUnits) { if (!entry.Active) { continue; } foreach (CurrencyProductionModifier modifier in entry.template.autoCurrencyProductionModifier) { value += modifier.GetDurationModifier(_template, entry.level, _baseValue); } } return(value); }
// ------------------------------------------------------------------------------- public long GetCapacity_AutoCurrencyProduction(CurrencyTemplate _template, long _baseValue) { long value = 0; foreach (UnitSyncStruct entry in syncUnits) { if (!entry.Active) { continue; } foreach (CurrencyProductionModifier modifier in entry.template.autoCurrencyProductionModifier) { value += modifier.GetCapacityModifier(_template, entry.level, _baseValue); } } return(value); }
public void AddEntry(int _slot, CurrencyTemplate _template, byte _state, long _timeStamp, long _amount) { CurrencySyncStruct syncStruct = new CurrencySyncStruct(_slot, _template, _state, _timeStamp, _amount); syncCurrencies.Add(syncStruct); }