コード例 #1
0
ファイル: GasMixture.cs プロジェクト: Somnium13/SS13
        // Function from file: gas_mixture.dm
        public bool copy_from_turf(dynamic model = null)
        {
            ByTable cached_gases = null;

            cached_gases     = this.gases;
            this.temperature = model.temperature;

            if (Lang13.Bool(model.oxygen))
            {
                this.assert_gas("o2");
                cached_gases["o2"][1] = model.oxygen;
            }

            if (Lang13.Bool(model.nitrogen))
            {
                this.assert_gas("n2");
                cached_gases["n2"][1] = model.nitrogen;
            }

            if (Lang13.Bool(model.toxins))
            {
                this.assert_gas("plasma");
                cached_gases["plasma"][1] = model.toxins;
            }

            if (Lang13.Bool(model.carbon_dioxide))
            {
                this.assert_gas("co2");
                cached_gases["co2"][1] = model.carbon_dioxide;
            }
            cached_gases.And(GlobalVars.hardcoded_gases);
            return(true);
        }
コード例 #2
0
        // Function from file: retaliate.dm
        public override ByTable ListTargets(  )
        {
            ByTable see = null;


            if (!(this.enemies.len != 0))
            {
                return(new ByTable());
            }
            see = base.ListTargets();
            see.And(this.enemies);
            return(see);
        }
コード例 #3
0
        // Function from file: _handofgod.dm
        public override bool post_setup(bool?report = null)
        {
            ByTable red_god_possibilities = null;
            Mind    red_god = null;
            ByTable blue_god_possibilities = null;
            Mind    blue_god = null;

            red_god_possibilities = this.get_players_for_role("hand of god: god");
            red_god_possibilities.And(this.red_deity_followers);

            if (!(red_god_possibilities.len != 0))
            {
                red_god_possibilities = this.red_deity_followers;
            }
            red_god = GlobalFuncs.pick_n_take(red_god_possibilities);

            if (red_god != null)
            {
                ((Mob)red_god.current).become_god("red");
                this.remove_hog_follower(red_god, false);
                this.add_god(red_god, "red");
            }
            blue_god_possibilities = this.get_players_for_role("hand of god: god");
            blue_god_possibilities.And(this.blue_deity_followers);

            if (!(blue_god_possibilities.len != 0))
            {
                blue_god_possibilities = this.blue_deity_followers;
            }
            blue_god = GlobalFuncs.pick_n_take(blue_god_possibilities);

            if (blue_god != null)
            {
                ((Mob)blue_god.current).become_god("blue");
                this.remove_hog_follower(blue_god, false);
                this.add_god(blue_god, "blue");
            }

            if (red_god != null)
            {
                ((GameMode)GlobalVars.ticker.mode).forge_deity_objectives(red_god);
            }

            if (blue_god != null)
            {
                ((GameMode)GlobalVars.ticker.mode).forge_deity_objectives(blue_god);
            }
            base.post_setup(report);
            return(false);
        }
コード例 #4
0
ファイル: GasMixture.cs プロジェクト: Somnium13/SS13
        // Function from file: gas_mixture.dm
        public bool copy_from(GasMixture sample = null)
        {
            ByTable cached_gases = null;
            ByTable sample_gases = null;
            dynamic id           = null;

            cached_gases     = this.gases;
            sample_gases     = sample.gases;
            this.temperature = sample.temperature;

            foreach (dynamic _a in Lang13.Enumerate(sample_gases))
            {
                id = _a;

                this.assert_gas(id);
                cached_gases[id][1] = sample_gases[id][1];
            }
            cached_gases.And(sample_gases);
            return(true);
        }
コード例 #5
0
ファイル: Camerachunk.cs プロジェクト: Somnium13/SS13
        // Function from file: chunk.dm
        public void update(  )
        {
            ByTable newVisibleTurfs = null;
            dynamic camera          = null;
            dynamic c          = null;
            Tile    point      = null;
            dynamic t          = null;
            ByTable visAdded   = null;
            ByTable visRemoved = null;
            dynamic turf       = null;
            dynamic t2         = null;
            dynamic eye        = null;
            dynamic m          = null;
            Client  client     = null;
            dynamic turf2      = null;
            dynamic t3         = null;
            dynamic eye2       = null;
            dynamic m2         = null;
            Client  client2    = null;

            newVisibleTurfs = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(this.cameras))
            {
                camera = _b;

                c = camera;

                if (!Lang13.Bool(c))
                {
                    continue;
                }

                if (!((Obj_Machinery_Camera)c).can_use())
                {
                    continue;
                }
                point = Map13.GetTile((this.x ?? 0) + 8, (this.y ?? 0) + 8, this.z);

                if (Map13.GetDistance(point, c) > 24)
                {
                    continue;
                }

                foreach (dynamic _a in Lang13.Enumerate(((Obj_Machinery_Camera)c).can_see()))
                {
                    t = _a;

                    newVisibleTurfs[t] = t;
                }
            }
            newVisibleTurfs.And(this.turfs);
            visAdded           = newVisibleTurfs - this.visibleTurfs;
            visRemoved         = this.visibleTurfs - newVisibleTurfs;
            this.visibleTurfs  = newVisibleTurfs;
            this.obscuredTurfs = this.turfs - newVisibleTurfs;

            foreach (dynamic _d in Lang13.Enumerate(visAdded))
            {
                turf = _d;

                t2 = turf;

                if (Lang13.Bool(t2.obscured))
                {
                    this.obscured.Remove(t2.obscured);

                    foreach (dynamic _c in Lang13.Enumerate(this.seenby))
                    {
                        eye = _c;

                        m = eye;

                        if (!Lang13.Bool(m))
                        {
                            continue;
                        }
                        client = ((Mob_Camera_AiEye)m).GetViewerClient();

                        if (client != null)
                        {
                            client.images.Remove(t2.obscured);
                        }
                    }
                }
            }

            foreach (dynamic _f in Lang13.Enumerate(visRemoved))
            {
                turf2 = _f;

                t3 = turf2;

                if (Lang13.Bool(this.obscuredTurfs[t3]))
                {
                    if (!Lang13.Bool(t3.obscured))
                    {
                        t3.obscured = new Image("icons/effects/cameravis.dmi", t3, "black", 16);
                    }
                    this.obscured.Add(t3.obscured);

                    foreach (dynamic _e in Lang13.Enumerate(this.seenby))
                    {
                        eye2 = _e;

                        m2 = eye2;

                        if (!Lang13.Bool(m2))
                        {
                            this.seenby.Remove(m2);
                            continue;
                        }
                        client2 = ((Mob_Camera_AiEye)m2).GetViewerClient();

                        if (client2 != null)
                        {
                            client2.images.Add(t3.obscured);
                        }
                    }
                }
            }
            this.changed = false;
            return;
        }