Пример #1
0
        public void startup()
        {
            Log("Called startup");
            specificStartup();
            Params param = new Params();

            param.loadFromFile();
            map = new Map(param);
            GraphicalMap.map   = map;
            GraphicalMap.world = this;

            Property_Prototype.loadProperties(map);
            EconTrait.loadTraits(map);
            map.world = this;
            map.gen();

            staticMap = map;
            if (!developer)
            {
                for (int i = 0; i < param.mapGen_burnInSteps; i++)
                {
                    map.turnTick();
                }
            }

            ui.setToWorld();
            displayMessages = true;
            Log("Got to end of initial startup");
            ui.checkData();
        }
Пример #2
0
 internal void set(string key, Property_Prototype value)
 {
     for (int i = 0; i < keys.Count; i++)
     {
         if (keys[i].Equals(key))
         {
             values[i] = value;
             return;
         }
     }
     add(key, value);
 }
Пример #3
0
        public static Property addProperty(Map map, Location location, string name)
        {
            if (map.globalist.propertyMap.ContainsKey(name) == false)
            {
                throw new Exception("Unable to find property named: " + name);
            }

            Property_Prototype proto = map.globalist.propertyMap.lookup(name);

            //Some, but not many, properties can be added multiply. Stackable defaults to false
            if (proto.stackStyle != Property_Prototype.stackStyleEnum.NONE)
            {
                foreach (Property p in location.properties)
                {
                    if (p.proto.name != name)
                    {
                        continue;
                    }
                    if (proto.stackStyle == Property_Prototype.stackStyleEnum.TO_MAX_CHARGE)
                    {
                        //Found matching name. Set timer to whatever's largest
                        p.charge = Math.Max(p.charge, proto.baseCharge);
                        return(p);
                    }
                    else if (proto.stackStyle == Property_Prototype.stackStyleEnum.ADD_CHARGE)
                    {
                        p.charge += proto.baseCharge;
                        return(p);
                    }
                    else
                    {
                        throw new NotImplementedException();
                    }
                }
            }

            Property prop = new Property(proto, location);

            prop.charge = proto.baseCharge;
            location.properties.Add(prop);
            return(prop);
        }
Пример #4
0
        public void startup(PopupGameOptions opts)
        {
            Log("Called startup");
            Params param = new Params();

            param.loadFromFile();

            //Apply the choices the user made in the choice screen
            param.overmind_powerRegen         *= opts.powerGainPercent / 100f;
            param.person_suspicionPerEvidence *= opts.susGainPercent / 100f;
            param.awareness_master_speed      *= opts.awarenessGainSpeed / 100f;
            param.mapGen_sizeX       = opts.sizeX;
            param.mapGen_sizeY       = opts.sizeY;
            param.mapGen_burnInSteps = opts.burnIn;
            param.useAwareness       = opts.useAwareness ? 1:0;

            map = new Map(param);
            GraphicalMap.map   = map;
            GraphicalMap.world = this;

            Property_Prototype.loadProperties(map);
            EconTrait.loadTraits(map);
            staticMap = map;
            map.world = this;
            map.globalist.buildBasicElements();
            map.gen();
            map.overmind.startedComplete();


            //ui.setToWorld();
            displayMessages = true;
            Log("Got to end of initial startup");
            ui.checkData();

            ui.setToVoting();
            ui.setToWorld();
            //bQuicksave();
        }
Пример #5
0
 public Property(Property_Prototype proto, Location loc)
 {
     this.proto    = proto;
     this.location = loc;
 }
Пример #6
0
        public void startup(PopupGameOptions opts)
        {
            Log("Called startup");

            Params param = new Params();

            //param.loadFromFile();

            //Apply the choices the user made in the choice screen
            param.overmind_powerRegen           *= opts.powerGainPercent / 100f;
            param.person_suspicionPerEvidence   *= opts.susGainPercent / 100f;
            param.awareness_master_speed        *= opts.awarenessGainSpeed / 100f;
            param.unit_investigatorsPerProvince *= opts.investigatorCount / 100f;
            param.mapGen_sizeX       = opts.sizeX;
            param.mapGen_sizeY       = opts.sizeY;
            param.mapGen_burnInSteps = opts.burnIn;
            param.unit_investigatorsSeeEnthralled = opts.investigatorsSee ? 1 : 0;
            param.useLightbringer                 = opts.allowLightbringer ? 1 : 0;
            param.useAwareness                    = opts.useAwareness ? 1 : 0;
            param.usePaladins                     = opts.usePaladins ? 1 : 0;
            param.overmind_maxEnthralled          = opts.nAgents;
            param.overmind_allowDirectEnthralling = opts.politicalStart ? 1:0;
            param.unit_armyHPMult                 = opts.armyHPMult / 100d;
            param.society_bonusSecurityMult       = opts.bonusSecurity / 100d;

            World.log("Opts use awareness " + opts.useAwareness);

            map = new Map(param);
            GraphicalMap.map   = map;
            GraphicalMap.world = this;

            map.seed      = opts.currentSeed;
            map.automatic = automatic;

            if (opts.useSimplified)
            {
                map.simplified = true;
                map.param.overmind_allowDirectEnthralling = 0;
                map.agentsOnly = true;
                if (opts.difficultySetting > 0)
                {
                    map.param.usePaladins = 1;
                }
            }
            else
            {
                map.agentsOnly = false;
            }
            if (param.overmind_allowDirectEnthralling == 0)
            {
                param.flashEnthrallables = false;
            }

            Property_Prototype.loadProperties(map);
            EconTrait.loadTraits(map);
            staticMap = map;
            map.world = this;
            map.globalist.buildBasicElements();
            Eleven.random = new System.Random(opts.currentSeed);
            map.gen();
            if (advancedEdition)
            {
                map.param.option_useAdvancedGraphics = 1;
            }
            PopupIOOptions.load(map);
            if (!advancedEdition)//Force it down, even if the IO options deceive you, if you are not actually the advanced edition
            {
                map.param.option_useAdvancedGraphics = 0;
            }



            //ui.setToWorld();
            displayMessages = !automatic;
            Log("Got to end of initial startup");
            ui.checkData();

            ui.setToVoting();
            ui.setToWorld();
            //bQuicksave();

            musicPlayer.stopTheme();

            if (map.simplified)
            {
                printSimplifiedMessage();
            }
            else if (map.automatic)
            {
                map.overmind.autoAI.popAIModeMessage();
            }
            map.hintSystem.popHint(HintSystem.hintType.INFILTRATION);
        }
Пример #7
0
 public void add(string key, Property_Prototype value)
 {
     keys.Add(key);
     values.Add(value);
 }
Пример #8
0
 public void Add(string key, Property_Prototype value)
 {
     add(key, value);
 }