예제 #1
0
        public override void ApplyBase(IStatContainer stats, IEventContainer events)
        {
            events.GetEvent(EventInfo.Identifier).Event.OnExecute += Explode;

            _damageMult = stats.AddStat(ExplosionDamageFactorInfo, DamageFactorBase * Coeffecient);
            _range      = stats.AddStat(ExplosionRangeInfo, RangeBase);
        }
예제 #2
0
        private void Init()
        {
            _mods    = new ModContainer(_stats, _events);
            Instance = this;

            _health    = GetComponent <IHealthContainer>();
            _unlocks   = GetComponent <IUnlockList>();
            _resources = GetComponent <IResourceContainer>();
            _inventory = GetComponent <IInventory>();

            if (_resources != null)
            {
                _resources?.ChangeResource(CreditsResource, 0);
            }

            ResourceEarningMultiplier = new Dictionary <string, IStatReference>();
            _resourceFractionTrackers = new Dictionary <string, float>();

            Resource[] resources = Content.GetAll <Resource>("*/Resources");
            foreach (Resource resource in resources)
            {
                ResourceEarningMultiplier.Add(resource.Identifier, _stats.AddStat(GenerateStatInfo(resource), 1f));
                _resourceFractionTrackers.Add(resource.Identifier, 0f);
            }


            OnNewPlayerInstance?.Invoke(this);
        }