Пример #1
0
        // Function from file: grown.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            Mob_Living_SimpleAnimal_Hostile_Killertomato K = null;


            if (this.awakening || user.loc is Tile_Space)
            {
                return(null);
            }
            user.WriteMsg("<span class='notice'>You begin to awaken the Killer Tomato...</span>");
            this.awakening = true;
            Task13.Schedule(30, (Task13.Closure)(() => {
                if (!Lang13.Bool(this.gc_destroyed))
                {
                    K                     = new Mob_Living_SimpleAnimal_Hostile_Killertomato(GlobalFuncs.get_turf(this.loc));
                    K.maxHealth          += Num13.Floor(this.endurance / 3);
                    K.melee_damage_lower += Num13.Floor((this.potency ?? 0) / 10);
                    K.melee_damage_upper += Num13.Floor((this.potency ?? 0) / 10);
                    K.move_to_delay      -= Num13.Floor((this.production ?1:0) / 50);
                    K.health              = K.maxHealth;
                    K.visible_message("<span class='notice'>The Killer Tomato growls as it suddenly awakens.</span>");

                    if (Lang13.Bool(user))
                    {
                        ((Mob)user).unEquip(this);
                    }
                    GlobalFuncs.qdel(this);
                }
                return;
            }));
            return(null);
        }
        // Function from file: implant_explosive.dm
        public override bool activate(dynamic cause = null)
        {
            if (!Lang13.Bool(cause) || !Lang13.Bool(this.imp_in))
            {
                return(false);
            }

            if (cause == "action_button" && Interface13.Alert(this.imp_in, "Are you sure you want to activate your microbomb implant? This will cause you to explode!", "Microbomb Implant Confirmation", "Yes", "No") != "Yes")
            {
                return(false);
            }
            this.heavy  = Num13.Floor(this.heavy);
            this.medium = Num13.Floor(this.medium);
            this.weak   = Num13.Floor(this.weak);
            this.imp_in.WriteMsg("<span class='notice'>You activate your microbomb implant.</span>");

            if (this.delay <= 7)
            {
                GlobalFuncs.explosion(this, this.heavy, this.medium, this.weak, this.weak, null, null, this.weak);

                if (Lang13.Bool(this.imp_in))
                {
                    ((Mob)this.imp_in).gib();
                }
                GlobalFuncs.qdel(this);
                return(false);
            }
            this.timed_explosion();
            return(false);
        }
Пример #3
0
        // Function from file: cell.dm
        public void explode(  )
        {
            dynamic T = null;
            int     devastation_range  = 0;
            int     heavy_impact_range = 0;
            int     light_impact_range = 0;
            int     flash_range        = 0;

            T = GlobalFuncs.get_turf(this.loc);

            if (this.charge == 0)
            {
                return;
            }
            devastation_range  = -1;
            heavy_impact_range = Num13.Floor(Math.Sqrt(this.charge ?? 0) / 60);
            light_impact_range = Num13.Floor(Math.Sqrt(this.charge ?? 0) / 30);
            flash_range        = light_impact_range;

            if (light_impact_range == 0)
            {
                this.rigged = false;
                this.corrupt();
                return;
            }
            GlobalFuncs.explosion(T, devastation_range, heavy_impact_range, light_impact_range, flash_range);
            GlobalFuncs.qdel(this);
            return;
        }
Пример #4
0
        // Function from file: chem_heater.dm
        public override int?process(dynamic seconds = null)
        {
            base.process((object)(seconds));

            if ((this.stat & 2) != 0)
            {
                return(null);
            }

            if (Lang13.Bool(this.on))
            {
                if (Lang13.Bool(this.beaker))
                {
                    if (Convert.ToDouble(this.beaker.reagents.chem_temp) > (this.target_temperature ?? 0))
                    {
                        this.beaker.reagents.chem_temp += Num13.MinInt(-1, ((int)(((this.target_temperature ?? 0) - Convert.ToDouble(this.beaker.reagents.chem_temp)) * this.heater_coefficient)));
                    }

                    if (Convert.ToDouble(this.beaker.reagents.chem_temp) < (this.target_temperature ?? 0))
                    {
                        this.beaker.reagents.chem_temp += Num13.MaxInt(1, ((int)(((this.target_temperature ?? 0) - Convert.ToDouble(this.beaker.reagents.chem_temp)) * this.heater_coefficient)));
                    }
                    this.beaker.reagents.chem_temp = Num13.Floor(Convert.ToDouble(this.beaker.reagents.chem_temp));
                    ((Reagents)this.beaker.reagents).handle_reactions();
                }
            }
            return(null);
        }
Пример #5
0
        // Function from file: brigdoors.dm
        public override ByTable ui_data(dynamic user = null)
        {
            ByTable data            = null;
            double  time_left       = 0;
            Obj_Machinery_Flasher F = null;

            data                   = new ByTable();
            time_left              = this.time_left(GlobalVars.TRUE);
            data["seconds"]        = Num13.Floor(time_left % 60);
            data["minutes"]        = Num13.Floor((time_left - Convert.ToDouble(data["seconds"])) / 60);
            data["timing"]         = this.timing;
            data["flash_charging"] = GlobalVars.FALSE;

            foreach (dynamic _a in Lang13.Enumerate(this.targets, typeof(Obj_Machinery_Flasher)))
            {
                F = _a;


                if (F.last_flash != 0 && F.last_flash + 150 > Game13.time)
                {
                    data["flash_charging"] = GlobalVars.TRUE;
                    break;
                }
            }
            return(data);
        }
Пример #6
0
        // Function from file: mining_mobs.dm
        public override void on_life(  )
        {
            dynamic H            = null;
            dynamic B            = null;
            int     blood_volume = 0;

            base.on_life();

            if (Lang13.Bool(this.owner))
            {
                ((Mob_Living)this.owner).adjustBruteLoss(-1);
                ((Mob_Living)this.owner).adjustFireLoss(-1);
                ((Mob_Living)this.owner).adjustOxyLoss(-2);
            }

            if (this.owner is Mob_Living_Carbon_Human)
            {
                H            = this.owner;
                B            = Lang13.FindIn(typeof(Reagent_Blood), H.vessel.reagent_list);
                blood_volume = Num13.Floor(H.vessel.get_reagent_amount("blood") ?1:0);

                if (Lang13.Bool(B) && blood_volume < 560 && blood_volume != 0)
                {
                    B.volume += 2;
                }
            }
            return;
        }
Пример #7
0
        // Function from file: abduction.dm
        public override bool pre_setup(  )
        {
            int possible_teams = 0;
            int?i = null;

            this.abductor_teams      = Num13.MaxInt(1, Num13.MinInt(this.max_teams, Num13.Floor(this.num_players() / (GlobalVars.config.abductor_scaling_coeff ?? 0))));
            possible_teams           = Num13.MaxInt(1, Num13.Floor(this.antag_candidates.len / 2));
            this.abductor_teams      = Num13.MinInt(this.abductor_teams ?? 0, possible_teams);
            this.abductors.len       = (this.abductor_teams ?? 0) * 2;
            this.scientists.len      = this.abductor_teams ?? 0;
            this.agents.len          = this.abductor_teams ?? 0;
            this.team_objectives.len = this.abductor_teams ?? 0;
            this.team_names.len      = this.abductor_teams ?? 0;
            i = null;
            i = 1;

            while ((i ?? 0) <= (this.abductor_teams ?? 0))
            {
                if (!this.make_abductor_team(i))
                {
                    return(false);
                }
                i++;
            }
            return(true);
        }
        // Function from file: other_tools.dm
        public double?load_fuel(dynamic P = null)
        {
            int    to_load = 0;
            double?units   = null;


            if (P.type == this.fuel.type && Convert.ToDouble(P.amount) > 0)
            {
                to_load = Num13.MaxInt(((int)(this.max_fuel - (this.fuel.amount ?? 0) * this.fuel.perunit)), 0);

                if (to_load != 0)
                {
                    units             = Num13.MinInt(Num13.MaxInt(Num13.Floor(to_load / P.perunit), 1), Convert.ToInt32(P.amount));
                    this.fuel.amount += units ?? 0;
                    ((Obj_Item_Stack)P).use(units);
                    this.occupant_message(new Txt().item(units).str(" unit").s().str(" of ").item(this.fuel).str(" successfully loaded.").ToString());
                    return(units);
                }
                else
                {
                    this.occupant_message("Unit is full.");
                    return(0);
                }
            }
            else
            {
                this.occupant_message("<span class='warning'>" + this.fuel + " traces in target minimal! " + P + " cannot be used as fuel.</span>");
                return(null);
            }
            return(null);
        }
Пример #9
0
        // Function from file: shadowling.dm
        public override bool pre_setup(  )
        {
            int     shadowlings = 0;
            dynamic shadow      = null;


            if (GlobalVars.config.protect_roles_from_antagonist)
            {
                this.restricted_jobs.Add(this.protected_jobs);
            }

            if (GlobalVars.config.protect_assistant_from_antagonist)
            {
                this.restricted_jobs.Add("Assistant");
            }
            shadowlings = Num13.MaxInt(3, Num13.Floor(this.num_players() / 14));

            while (shadowlings != 0)
            {
                shadow = Rand13.PickFromTable(this.antag_candidates);
                this.shadows.Add(shadow);
                this.antag_candidates.Remove(shadow);
                this.modePlayer.Add(shadow);
                shadow.special_role     = "Shadowling";
                shadow.restricted_roles = this.restricted_jobs;
                shadowlings--;
            }
            return(true);
        }
        // Function from file: lib_machines.dm
        public void build_library_menu(  )
        {
            double  i    = 0;
            dynamic C    = null;
            int     page = 0;


            if (this.libcomp_menu != null)
            {
                return;
            }
            GlobalFuncs.load_library_db_to_cache();

            if (!(GlobalVars.cachedbooks != null))
            {
                return;
            }
            this.libcomp_menu = new ByTable(new object [] { "" });

            foreach (dynamic _a in Lang13.IterateRange(1, GlobalVars.cachedbooks.len))
            {
                i = _a;

                C    = GlobalVars.cachedbooks[i];
                page = Num13.Floor(i / 250) + 1;

                if (this.libcomp_menu.len < page)
                {
                    this.libcomp_menu.len   = page;
                    this.libcomp_menu[page] = "";
                }
                this.libcomp_menu[page] += new Txt("<tr><td>").item(C.author).str("</td><td>").item(C.title).str("</td><td>").item(C.category).str("</td><td><A href='?src=").Ref(this).str(";targetid=").item(C.id).str("'>[Order]</A></td></tr>\n").ToString();
            }
            return;
        }
Пример #11
0
        // Function from file: magic.dm
        public override dynamic on_hit(Ent_Static target = null, double?blocked = null, dynamic hit_zone = null)
        {
            dynamic _default = null;

            int         teleammount        = 0;
            Ent_Static  teleloc            = null;
            Ent_Dynamic stuff              = null;
            EffectSystem_SmokeSpread smoke = null;

            _default    = base.on_hit(target, blocked, (object)(hit_zone));
            teleammount = 0;
            teleloc     = target;

            if (!(target is Tile))
            {
                teleloc = target.loc;
            }

            foreach (dynamic _a in Lang13.Enumerate(teleloc, typeof(Ent_Dynamic)))
            {
                stuff = _a;


                if (!Lang13.Bool(stuff.anchored) && stuff.loc != null)
                {
                    teleammount++;
                    GlobalFuncs.do_teleport(stuff, stuff, 10);
                    smoke = new EffectSystem_SmokeSpread();
                    smoke.set_up(Num13.MaxInt(Num13.Floor(4 - teleammount), 0), stuff.loc);
                    smoke.start();
                }
            }
            return(_default);
        }
Пример #12
0
        // Function from file: material_container.dm
        public double?insert_stack(dynamic S = null, double?amt = null)
        {
            amt = amt ?? 0;

            double material_amt = 0;


            if ((amt ?? 0) <= 0)
            {
                return(0);
            }

            if ((amt ?? 0) > Convert.ToDouble(S.amount))
            {
                amt = Lang13.DoubleNullable(S.amount);
            }
            material_amt = this.get_item_material_amount(S);

            if (!(material_amt != 0))
            {
                return(0);
            }
            amt = Num13.MinInt(((int)(amt ?? 0)), Num13.Floor(Convert.ToDouble((this.max_amount - this.total_amount) / material_amt)));

            if (!Lang13.Bool(amt))
            {
                return(0);
            }
            this.insert_materials(S, amt);
            ((Obj_Item_Stack)S).use(amt);
            return(amt);
        }
Пример #13
0
        // Function from file: RCD.dm
        public bool loadwithsheets(dynamic S = null, int value = 0, dynamic user = null)
        {
            double?maxsheets = null;

            maxsheets = Num13.Floor((this.max_matter - this.matter) / value);

            if ((maxsheets ?? 0) > 0)
            {
                if (Convert.ToDouble(S.amount) > (maxsheets ?? 0))
                {
                    ((Obj_Item_Stack)S).use(maxsheets);
                    this.matter += value * (maxsheets ?? 0);
                    GlobalFuncs.playsound(this.loc, "sound/machines/click.ogg", 50, 1);
                    user.WriteMsg("<span class='notice'>You insert " + maxsheets + " " + S.name + " sheets into the RCD. </span>");
                }
                else
                {
                    this.matter += value * Convert.ToDouble(S.amount);
                    ((Mob)user).unEquip();
                    ((Obj_Item_Stack)S).use(Lang13.DoubleNullable(S.amount));
                    GlobalFuncs.playsound(this.loc, "sound/machines/click.ogg", 50, 1);
                    user.WriteMsg("<span class='notice'>You insert " + S.amount + " " + S.name + " sheets into the RCD. </span>");
                }
                return(true);
            }
            user.WriteMsg("<span class='warning'>You can't insert any more " + S.name + " sheets into the RCD!");
            return(false);
        }
Пример #14
0
        // Function from file: constructs.dm
        public override dynamic bullet_act(dynamic P = null, dynamic def_zone = null)
        {
            int     reflectchance = 0;
            double  new_x         = 0;
            double  new_y         = 0;
            dynamic curloc        = null;


            if (P is Obj_Item_Projectile_Energy || P is Obj_Item_Projectile_Beam)
            {
                reflectchance = 80 - Num13.Floor(Convert.ToDouble(P.damage / 3));

                if (Rand13.PercentChance(reflectchance))
                {
                    this.apply_damage(P.damage * 0.5, P.damage_type);
                    this.visible_message("<span class='danger'>The " + P.name + " is reflected by " + this + "'s armored shell!</span>", "<span class='userdanger'>The " + P.name + " is reflected by your armored shell!</span>");

                    if (Lang13.Bool(P.starting))
                    {
                        new_x      = Convert.ToDouble(P.starting.x + Rand13.Pick(new object [] { 0, 0, -1, 1, -2, 2, -2, 2, -2, 2, -3, 3, -3, 3 }));
                        new_y      = Convert.ToDouble(P.starting.y + Rand13.Pick(new object [] { 0, 0, -1, 1, -2, 2, -2, 2, -2, 2, -3, 3, -3, 3 }));
                        curloc     = GlobalFuncs.get_turf(this);
                        P.original = Map13.GetTile(((int)(new_x)), ((int)(new_y)), Convert.ToInt32(P.z));
                        P.starting = curloc;
                        P.current  = curloc;
                        P.firer    = this;
                        P.yo       = new_y - Convert.ToDouble(curloc.y);
                        P.xo       = new_x - Convert.ToDouble(curloc.x);
                    }
                    return(-1);
                }
            }
            return(base.bullet_act((object)(P), (object)(def_zone)));
        }
Пример #15
0
        // Function from file: species_types.dm
        public override dynamic handle_speech(dynamic message = null, Mob_Living_Carbon_Human H = null)
        {
            ByTable message_list = null;
            int     maxchanges   = 0;
            int?    i            = null;
            int     insertpos    = 0;
            string  inserttext   = null;

            message_list = GlobalFuncs.splittext(message, " ");
            maxchanges   = Num13.MaxInt(Num13.Floor(message_list.len / 1.5), 2);
            i            = null;
            i            = Rand13.Int(((int)(maxchanges / 2)), maxchanges);

            while ((i ?? 0) > 0)
            {
                insertpos  = Rand13.Int(1, message_list.len - 1);
                inserttext = message_list[insertpos];

                if (!(String13.SubStr(inserttext, Lang13.Length(inserttext) - 2, 0) == "..."))
                {
                    message_list[insertpos] = inserttext + "...";
                }

                if (Rand13.PercentChance(20) && message_list.len > 3)
                {
                    message_list.Insert(insertpos, "" + Rand13.Pick(new object [] { "BRAINS", "Brains", "Braaaiinnnsss", "BRAAAIIINNSSS" }) + "...");
                }
                i--;
            }
            return(GlobalFuncs.jointext(message_list, " "));
        }
Пример #16
0
        // Function from file: priority_queue.dm
        public int FindElementIndex(dynamic A = null)
        {
            int i   = 0;
            int j   = 0;
            int mid = 0;

            i = 1;
            j = this.L.len;

            while (i < j)
            {
                mid = Num13.Floor((i + j) / 2);

                if (Convert.ToDouble(Lang13.Call(this.cmp, this.L[mid], A)) < 0)
                {
                    i = mid + 1;
                }
                else
                {
                    j = mid;
                }
            }

            if (i == 1 || i == this.L.len)
            {
                return(Convert.ToDouble(Lang13.Call(this.cmp, this.L[i], A)) > 0 ? i : i + 1);
            }
            else
            {
                return(i);
            }
        }
        // Function from file: flashbang.dm
        public override void prime(  )
        {
            dynamic         flashbang_turf = null;
            Mob_Living      M      = null;
            Obj_Effect_Blob B      = null;
            double          damage = 0;

            this.update_mob();
            flashbang_turf = GlobalFuncs.get_turf(this);

            if (!Lang13.Bool(flashbang_turf))
            {
                return;
            }

            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_hearers_in_view(7, flashbang_turf), typeof(Mob_Living)))
            {
                M = _a;

                this.bang(GlobalFuncs.get_turf(M), M);
            }

            foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.get_hear(8, flashbang_turf), typeof(Obj_Effect_Blob)))
            {
                B = _b;

                damage = Num13.Floor(40 / (Map13.GetDistance(B, GlobalFuncs.get_turf(this)) + 1));
                B.take_damage(damage, "fire");
            }
            GlobalFuncs.qdel(this);
            return;
        }
		// Function from file: watertank.dm
		public override ByTable worn_overlays( int? isinhands = null ) {
			isinhands = isinhands ?? GlobalVars.FALSE;

			ByTable _default = null;

			Image filling = null;
			int percent = 0;

			_default = new ByTable();

			if ( !Lang13.Bool( isinhands ) && Lang13.Bool( this.reagents.total_volume ) ) {
				filling = new Image( "icons/obj/reagentfillings.dmi", null, "backpackmob-10" );
				percent = Num13.Floor( ( this.reagents.total_volume ??0) / ( this.volume ??0) * 100 );

				dynamic _a = percent; // Was a switch-case, sorry for the mess.
				if ( 0<=_a&&_a<=15 ) {
					filling.icon_state = "backpackmob-10";
				} else if ( 16<=_a&&_a<=60 ) {
					filling.icon_state = "backpackmob50";
				} else if ( 61<=_a&&_a<=Double.PositiveInfinity ) {
					filling.icon_state = "backpackmob100";
				}
				filling.color = GlobalFuncs.mix_color_from_reagents( this.reagents.reagent_list );
				_default.Add( filling );
			}
			return _default;
		}
Пример #19
0
        // Function from file: traitor.dm
        public override void make_antag_chance(Mob_Living_Carbon_Human character = null)
        {
            int traitorcap = 0;

            traitorcap = Num13.MinInt(Num13.Floor(GlobalVars.joined_player_list.len / ((GlobalVars.config.traitor_scaling_coeff ?? 0) * 2)) + this.num_modifier + 2, Num13.Floor(GlobalVars.joined_player_list.len / (GlobalVars.config.traitor_scaling_coeff ?? 0)) + this.num_modifier);

            if (GlobalVars.ticker.mode.traitors.len >= traitorcap)
            {
                return;
            }

            if (GlobalVars.ticker.mode.traitors.len <= traitorcap - 2 || Rand13.PercentChance(((int)(100 / ((GlobalVars.config.traitor_scaling_coeff ?? 0) * 2)))))
            {
                if (character.client.prefs.be_special.Contains("traitor"))
                {
                    if (!GlobalFuncs.jobban_isbanned(character.client, "traitor") && !GlobalFuncs.jobban_isbanned(character.client, "Syndicate"))
                    {
                        if (this.age_check(character.client))
                        {
                            if (!this.restricted_jobs.Contains(character.job))
                            {
                                this.add_latejoin_traitor(character.mind);
                            }
                        }
                    }
                }
            }
            return;
        }
Пример #20
0
        // Function from file: order.dm
        public dynamic generate(dynamic T = null)
        {
            dynamic C = null;
            Obj_Item_Weapon_Paper_Manifest M = null;
            int lost = 0;

            C = this.pack.generate(T);
            M = this.generateManifest(C);

            if ((M.errors & 4) != 0)
            {
                if (C is Obj_Structure_Closet_Crate_Secure || C is Obj_Structure_Closet_Crate_Large)
                {
                    M.errors &= 65531;
                }
                else
                {
                    lost = Num13.MaxInt(Num13.Floor(C.contents.len / 10), 1);

                    while (--lost >= 0)
                    {
                        GlobalFuncs.qdel(Rand13.PickFromTable(C.contents));
                    }
                }
            }
            return(C);
        }
        // Function from file: port_gen.dm
        public override void RefreshParts(  )
        {
            double temp_rating            = 0;
            double consumption_coeff      = 0;
            Obj_Item_Weapon_StockParts SP = null;

            temp_rating       = 0;
            consumption_coeff = 0;

            foreach (dynamic _a in Lang13.Enumerate(this.component_parts, typeof(Obj_Item_Weapon_StockParts)))
            {
                SP = _a;


                if (SP is Obj_Item_Weapon_StockParts_MatterBin)
                {
                    this.max_sheets = SP.rating * SP.rating * 50;
                }
                else if (SP is Obj_Item_Weapon_StockParts_Capacitor)
                {
                    temp_rating += Convert.ToDouble(SP.rating);
                }
                else
                {
                    consumption_coeff += Convert.ToDouble(SP.rating);
                }
            }
            this.power_gen   = Num13.Floor(Convert.ToDouble(Lang13.Initial(this, "power_gen") * temp_rating * 2));
            this.consumption = consumption_coeff;
            return;
        }
Пример #22
0
        // Function from file: tanks.dm
        public override ByTable ui_data(dynamic user = null)
        {
            ByTable data = null;
            dynamic C    = null;

            data = new ByTable();
            data["tankPressure"]           = Num13.Floor((this.air_contents.return_pressure() != 0 ? this.air_contents.return_pressure() : 0));
            data["releasePressure"]        = Num13.Floor((this.distribute_pressure != 0 ? this.distribute_pressure : 0));
            data["defaultReleasePressure"] = Num13.Floor(16);
            data["minReleasePressure"]     = Num13.Floor(0);
            data["maxReleasePressure"]     = Num13.Floor(303.9749755859375);
            C = user;

            if (!(C is Mob_Living_Carbon))
            {
                C = this.loc.loc;
            }

            if (!(C is Mob_Living_Carbon))
            {
                return(data);
            }

            if (C.v_internal == this)
            {
                data["connected"] = GlobalVars.TRUE;
            }
            return(data);
        }
Пример #23
0
        // Function from file: material_container.dm
        public double retrieve(double?sheet_amt = null, Material M = null)
        {
            double count = 0;


            if ((sheet_amt ?? 0) > 0)
            {
                if (M.amount < (sheet_amt ?? 0) * 2000)
                {
                    sheet_amt = Num13.Floor(M.amount / 2000);
                }
                count = 0;

                while ((sheet_amt ?? 0) > 50)
                {
                    Lang13.Call(M.sheet_type, GlobalFuncs.get_turf(this.owner), 50);
                    count += 50;
                    this.use_amount_type((sheet_amt ?? 0) * 2000, M.material_type);
                    sheet_amt -= 50;
                }

                if (Num13.Floor(M.amount / 2000) != 0)
                {
                    Lang13.Call(M.sheet_type, GlobalFuncs.get_turf(this.owner), sheet_amt);
                    count += sheet_amt ?? 0;
                    this.use_amount_type((sheet_amt ?? 0) * 2000, M.material_type);
                }
                return(count);
            }
            return(0);
        }
Пример #24
0
        // Function from file: changeling.dm
        public override void make_antag_chance(Mob_Living_Carbon_Human character = null)
        {
            int changelingcap = 0;

            changelingcap = Num13.MinInt(Num13.Floor(GlobalVars.joined_player_list.len / ((GlobalVars.config.changeling_scaling_coeff ?? 0) * 2)) + 2, Num13.Floor(GlobalVars.joined_player_list.len / (GlobalVars.config.changeling_scaling_coeff ?? 0)));

            if (GlobalVars.ticker.mode.changelings.len >= changelingcap)
            {
                return;
            }

            if (GlobalVars.ticker.mode.changelings.len <= changelingcap - 2 || Rand13.PercentChance(((int)(100 - (GlobalVars.config.changeling_scaling_coeff ?? 0) * 2))))
            {
                if (character.client.prefs.be_special.Contains("changeling"))
                {
                    if (!GlobalFuncs.jobban_isbanned(character.client, "changeling") && !GlobalFuncs.jobban_isbanned(character.client, "Syndicate"))
                    {
                        if (this.age_check(character.client))
                        {
                            if (!this.restricted_jobs.Contains(character.job))
                            {
                                character.mind.make_Changling();
                            }
                        }
                    }
                }
            }
            return;
        }
Пример #25
0
        // Function from file: traitordevices.dm
        public override bool attack(dynamic M = null, dynamic user = null, bool?def_zone = null)
        {
            int cooldown = 0;


            if (!this.used)
            {
                GlobalFuncs.add_logs(user, M, "irradiated", this);
                ((Ent_Static)user).visible_message("<span class='notice'>" + user + " has analyzed " + M + "'s vitals.</span>");
                cooldown        = Num13.Floor(Num13.MaxInt(100, ((int)((this.intensity * 8 - this.wavelength / 2 + this.intensity * 2) * 10))));
                this.used       = true;
                this.icon_state = "health1";
                this.handle_cooldown(cooldown);
                Task13.Schedule((this.wavelength + this.intensity * 4) * 10, (Task13.Closure)(() => {
                    if (Lang13.Bool(M))
                    {
                        if (this.intensity >= 5)
                        {
                            ((Mob_Living)M).apply_effect(Num13.Floor(this.intensity / 1.5), "paralize");
                        }
                        ((Ent_Static)M).rad_act(this.intensity * 10);
                    }
                    return;
                }));
            }
            else
            {
                user.WriteMsg("<span class='warning'>The radioactive microlaser is still recharging.</span>");
            }
            return(false);
        }
        // Function from file: grown.dm
        public override bool add_juice(dynamic loc = null, int?potency = null)
        {
            potency = potency ?? 10;

            base.add_juice((object)(loc), potency);
            this.reagents.add_reagent("blood", Num13.Floor((potency ?? 0) / 5) + 1, new ByTable().Set("blood_type", "O-"));
            return(false);
        }
Пример #27
0
 // Function from file: material_container.dm
 public int amount2sheet(int amt = 0)
 {
     if (amt >= 2000)
     {
         return(Num13.Floor(amt / 2000));
     }
     return(0);
 }
Пример #28
0
        // Function from file: pyrotechnics.dm
        public override void on_reaction(Reagents holder = null, double?created_volume = null)
        {
            dynamic location = null;

            location = GlobalFuncs.get_turf(holder.my_atom);
            GlobalFuncs.empulse(location, Num13.Floor((created_volume ?? 0) / 24), Num13.Floor((created_volume ?? 0) / 14), true);
            holder.clear_reagents();
            return;
        }
Пример #29
0
 // Function from file: window.dm
 public override dynamic temperature_expose(GasMixture air = null, dynamic exposed_temperature = null, int?exposed_volume = null)
 {
     if (Convert.ToDouble(exposed_temperature) > (this.reinf == true ? 1600 : 800) + 273.41)
     {
         this.hit(Num13.Floor((exposed_volume ?? 0) / 100), false);
     }
     base.temperature_expose(air, (object)(exposed_temperature), exposed_volume);
     return(null);
 }
        // Function from file: port_gen.dm
        public override void UseFuel(  )
        {
            double needed_sheets = 0;
            int    temp          = 0;
            double lower_limit   = 0;
            double upper_limit   = 0;
            double bias          = 0;

            needed_sheets    = 1 / (this.time_per_sheet * this.consumption / this.power_output);
            temp             = Num13.MinInt(((int)(needed_sheets)), ((int)(this.sheet_left)));
            needed_sheets   -= temp;
            this.sheet_left -= temp;
            this.sheets     -= Num13.Floor(needed_sheets);
            needed_sheets   -= Num13.Floor(needed_sheets);

            if (this.sheet_left <= 0 && this.sheets > 0)
            {
                this.sheet_left = 1 - needed_sheets;
                this.sheets--;
            }
            lower_limit = this.power_output * 10 + 56;
            upper_limit = this.power_output * 10 + 76;
            bias        = 0;

            if (this.power_output > 4)
            {
                upper_limit = 400;
                bias        = this.power_output - this.consumption * (4 - this.consumption);
            }

            if (this.current_heat < lower_limit)
            {
                this.current_heat += 4 - this.consumption;
            }
            else
            {
                this.current_heat += Rand13.Int(((int)(bias + -7)), ((int)(bias + 7)));

                if (this.current_heat < lower_limit)
                {
                    this.current_heat = lower_limit;
                }

                if (this.current_heat > upper_limit)
                {
                    this.current_heat = upper_limit;
                }
            }

            if (this.current_heat > 300)
            {
                this.overheat();
                GlobalFuncs.qdel(this);
            }
            return;
        }