001package com.fs.starfarer.api.impl.campaign.intel;
002
003import com.fs.starfarer.api.EveryFrameScript;
004import com.fs.starfarer.api.Global;
005
006public class PersonBountyManager extends BaseEventManager {
007
008        public static final String KEY = "$core_personBountyManager";
009        
010        public static PersonBountyManager getInstance() {
011                Object test = Global.getSector().getMemoryWithoutUpdate().get(KEY);
012                return (PersonBountyManager) test; 
013        }
014        
015        public PersonBountyManager() {
016                super();
017                Global.getSector().getMemoryWithoutUpdate().set(KEY, this);
018        }
019        
020        @Override
021        protected int getMinConcurrent() {
022                return Global.getSettings().getInt("minPersonBounties");
023        }
024        @Override
025        protected int getMaxConcurrent() {
026                return Global.getSettings().getInt("maxPersonBounties");
027        }
028        
029        @Override
030        protected float getIntervalRateMult() {
031//              if (true) {
032//                      currMax = 200;
033//                      return 1000f;
034//              }
035                return super.getIntervalRateMult();
036        }
037
038        @Override
039        protected EveryFrameScript createEvent() {
040                if ((float) Math.random() < 0.75f) return null;
041                
042                PersonBountyIntel intel = new PersonBountyIntel();
043                if (intel.isDone()) intel = null;
044
045                return intel;
046        }
047        
048}