예제 #1
0
        // Function from file: walls.dm
        public virtual void thermitemelt(dynamic user = null)
        {
            Obj_Effect_Overlay O = null;
            dynamic            F = null;

            this.overlays = new ByTable();
            O             = new Obj_Effect_Overlay(this);
            O.name        = "thermite";
            O.desc        = "Looks hot.";
            O.icon        = "icons/effects/fire.dmi";
            O.icon_state  = "2";
            O.anchored    = 1;
            O.opacity     = true;
            O.density     = true;
            O.layer       = 5;
            GlobalFuncs.playsound(this, "sound/items/welder.ogg", 100, 1);

            if (this.thermite >= 50)
            {
                F = this.ChangeTurf(typeof(Tile_Simulated_Floor_Plating));
                ((Tile_Simulated)F).burn_tile();
                F.icon_state = "wall_thermite";
                ((Ent_Static)F).add_hiddenprint(user);
                Task13.Schedule(Num13.MaxInt(100, ((int)(300 - this.thermite))), (Task13.Closure)(() => {
                    if (O != null)
                    {
                        GlobalFuncs.qdel(O);
                    }
                    return;
                }));
            }
            else
            {
                this.thermite = 0;
                Task13.Schedule(50, (Task13.Closure)(() => {
                    if (O != null)
                    {
                        GlobalFuncs.qdel(O);
                    }
                    return;
                }));
            }
            return;
        }
예제 #2
0
        // Function from file: drink_reagents.dm
        public override bool on_mob_life(dynamic M = null)
        {
            M.dizziness  = Num13.MaxInt(0, M.dizziness - 5);
            M.drowsyness = Num13.MaxInt(0, M.drowsyness - 3);
            ((Mob)M).SetSleeping(0);

            if (Convert.ToDouble(M.bodytemperature) < 310)
            {
                M.bodytemperature = Num13.MinInt(310, Convert.ToInt32(M.bodytemperature + 7.5));
            }
            ((Mob)M).Jitter(5);

            if (((Mob_Living)M).getBruteLoss() != 0 && Rand13.PercentChance(20))
            {
                ((Mob_Living)M).heal_organ_damage(1, 0);
            }
            base.on_mob_life((object)(M));
            return(false);
        }
예제 #3
0
        // Function from file: microwave.dm
        public bool microwaving(int seconds = 0)
        {
            double i = 0;


            foreach (dynamic _a in Lang13.IterateRange(1, seconds))
            {
                i = _a;


                if ((this.stat & 3) != 0)
                {
                    return(false);
                }
                this.f_use_power(500);
                Task13.Sleep(Num13.MaxInt(12 - (this.efficiency == true ?1:0) * 2, 2));
            }
            return(true);
        }
예제 #4
0
        // Function from file: blob_report.dm
        public double score(StationState result = null)
        {
            double output = 0;


            if (!(result != null))
            {
                return(0);
            }
            output  = 0;
            output += result.floor / Num13.MaxInt(this.floor, 1);
            output += result.r_wall / Num13.MaxInt(this.r_wall, 1);
            output += result.wall / Num13.MaxInt(this.wall, 1);
            output += result.window / Num13.MaxInt(this.window, 1);
            output += result.door / Num13.MaxInt(this.door, 1);
            output += result.grille / Num13.MaxInt(this.grille, 1);
            output += result.mach / Num13.MaxInt(this.mach, 1);
            return(output / 7);
        }
예제 #5
0
        // Function from file: drink_reagents.dm
        public override bool on_mob_life(dynamic M = null)
        {
            M.dizziness   = Num13.MaxInt(0, M.dizziness - 2);
            M.drowsyness  = Num13.MaxInt(0, M.drowsyness - 1);
            M.jitteriness = Num13.MaxInt(0, M.jitteriness - 3);
            ((Mob)M).AdjustSleeping(-1);

            if (Lang13.Bool(((Mob_Living)M).getToxLoss()) && Rand13.PercentChance(20))
            {
                ((Mob_Living)M).adjustToxLoss(-1);
            }

            if (Convert.ToDouble(M.bodytemperature) < 310)
            {
                M.bodytemperature = Num13.MinInt(310, Convert.ToInt32(M.bodytemperature + 30));
            }
            base.on_mob_life((object)(M));
            return(false);
        }
예제 #6
0
        // Function from file: spaceheater.dm
        public override ByTable ui_data(dynamic user = null)
        {
            ByTable    data    = null;
            dynamic    L       = null;
            dynamic    curTemp = null;
            GasMixture env     = null;

            data                 = new ByTable();
            data["open"]         = this.panel_open;
            data["on"]           = this.on;
            data["mode"]         = this.setMode;
            data["hasPowercell"] = !(!Lang13.Bool(this.cell));

            if (Lang13.Bool(this.cell))
            {
                data["powerLevel"] = Num13.Round(((Obj_Item_Weapon_StockParts_Cell)this.cell).percent(), 1);
            }
            data["targetTemp"] = Num13.Round(this.targetTemperature - 273.41, 1);
            data["minTemp"]    = Num13.MaxInt(((int)(this.settableTemperatureMedian - this.settableTemperatureRange - 273.41)), ((int)(2.7)));
            data["maxTemp"]    = this.settableTemperatureMedian + this.settableTemperatureRange - 273.41;
            L = GlobalFuncs.get_turf(this.loc);

            if (L is Tile_Simulated)
            {
                env     = ((Ent_Static)L).return_air();
                curTemp = env.temperature;
            }
            else if (L is Tile)
            {
                curTemp = L.temperature;
            }

            if (curTemp == null)
            {
                data["currentTemp"] = "N/A";
            }
            else
            {
                data["currentTemp"] = Num13.Round(Convert.ToDouble(curTemp - 273.41), 1);
            }
            return(data);
        }
예제 #7
0
        // Function from file: slotmachine.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic C = null;


            if (A is Obj_Item_Weapon_Coin)
            {
                C = A;

                if (Rand13.PercentChance(2))
                {
                    if (!Lang13.Bool(user.drop_item()))
                    {
                        return(null);
                    }
                    C.loc = this.loc;
                    ((Ent_Dynamic)C).throw_at(user, 3, 10);

                    if (Rand13.PercentChance(10))
                    {
                        this.balance = Num13.MaxInt(((int)(this.balance - 5)), 0);
                    }
                    user.WriteMsg("<span class='warning'>" + this + " spits your coin back out!</span>");
                }
                else
                {
                    if (!Lang13.Bool(user.drop_item()))
                    {
                        return(null);
                    }
                    user.WriteMsg("<span class='notice'>You insert a " + C.cmineral + " coin into " + this + "'s slot!</span>");
                    this.balance += Convert.ToDouble(C.value);
                    GlobalFuncs.qdel(C);
                }
                return(null);
            }
            else if (!(this.balance != 0))
            {
                base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            }
            return(null);
        }
예제 #8
0
        // Function from file: slotmachine.dm
        public int get_lines(  )
        {
            int     amountthesame = 0;
            int?    i             = null;
            string  inputtext     = null;
            dynamic symbol        = null;
            int     j             = 0;
            dynamic symboltext    = null;

            i = null;
            i = 1;

            while ((i ?? 0) <= 3)
            {
                inputtext = this.reels[1][i] + this.reels[2][i] + this.reels[3][i] + this.reels[4][i] + this.reels[5][i];

                foreach (dynamic _a in Lang13.Enumerate(this.symbols))
                {
                    symbol = _a;

                    j          = 3;
                    symboltext = symbol + symbol + symbol;

                    while (j <= 5)
                    {
                        if (String13.FindIgnoreCase(inputtext, symboltext, 1, 0) != 0)
                        {
                            amountthesame = Num13.MaxInt(j, amountthesame);
                        }
                        j++;
                        symboltext += symbol;
                    }

                    if (amountthesame != 0)
                    {
                        break;
                    }
                }
                i++;
            }
            return(amountthesame);
        }
        // Function from file: volume_pump.dm
        public override bool receive_signal(Signal signal = null, bool?receive_method = null, dynamic receive_param = null)
        {
            double? old_on = null;
            dynamic air1   = null;


            if (!Lang13.Bool(signal.data["tag"]) || signal.data["tag"] != this.id || signal.data["sigtype"] != "command")
            {
                return(false);
            }
            old_on = this.on;

            if (signal.data.Contains("power"))
            {
                this.on = String13.ParseNumber(signal.data["power"]);
            }

            if (signal.data.Contains("power_toggle"))
            {
                this.on = !Lang13.Bool(this.on) ?1:0;
            }

            if (signal.data.Contains("set_transfer_rate"))
            {
                air1 = this.airs[1];
                this.transfer_rate = Num13.MaxInt(0, Num13.MinInt(((int)(String13.ParseNumber(signal.data["set_transfer_rate"]) ?? 0)), Convert.ToInt32(air1.volume)));
            }

            if (this.on != old_on)
            {
                this.investigate_log("was turned " + (Lang13.Bool(this.on) ? "on" : "off") + " by a remote signal", "atmos");
            }

            if (signal.data.Contains("status"))
            {
                this.broadcast_status();
                return(false);
            }
            this.broadcast_status();
            this.update_icon();
            return(false);
        }
예제 #10
0
        // Function from file: medicine_reagents.dm
        public override bool on_mob_life(dynamic M = null)
        {
            M.drowsyness = Num13.MaxInt(M.drowsyness - 5, 0);
            ((Mob)M).AdjustParalysis(-1);
            ((Mob)M).AdjustStunned(-1);
            ((Mob)M).AdjustWeakened(-1);

            if (Lang13.Bool(((dynamic)this.holder).has_reagent("mindbreaker")))
            {
                ((dynamic)this.holder).remove_reagent("mindbreaker", 5);
            }
            M.hallucination = Num13.MaxInt(0, ((int)(M.hallucination - 10)));

            if (Rand13.PercentChance(30))
            {
                ((Mob_Living)M).adjustToxLoss(1);
            }
            base.on_mob_life((object)(M));
            return(false);
        }
예제 #11
0
        // Function from file: gas_mixture.dm
        public void temperature_mimic(Tile model = null, double conduction_coefficient = 0)
        {
            dynamic temperature_delta  = null;
            double  self_heat_capacity = 0;
            double  heat = 0;

            temperature_delta = this.temperature - model.temperature;

            if (Math.Abs(Convert.ToDouble(temperature_delta)) > 0.5)
            {
                self_heat_capacity = this.heat_capacity();

                if (model.heat_capacity > 0.0003 && self_heat_capacity > 0.0003)
                {
                    heat             = conduction_coefficient * Convert.ToDouble(temperature_delta) * (self_heat_capacity * model.heat_capacity / (self_heat_capacity + model.heat_capacity));
                    this.temperature = Num13.MaxInt(Convert.ToInt32(this.temperature - heat / self_heat_capacity), ((int)(2.7)));
                }
            }
            return;
        }
예제 #12
0
        // Function from file: structures.dm
        public override bool attack_animal(Mob_Living user = null)
        {
            int damage = 0;


            if (!(user != null))
            {
                return(false);
            }
            this.visible_message(new Txt("<span class='danger'>").The(this).item().str(" has been attacked by ").the(user).item().str("!</span>").ToString());
            damage = Rand13.Int(Convert.ToInt32(((dynamic)user).melee_damage_lower), Convert.ToInt32(((dynamic)user).melee_damage_upper));

            if (!(damage != 0))
            {
                return(false);
            }
            this.health = Num13.MaxInt(0, ((int)(this.health - damage)));
            this.healthcheck();
            return(false);
        }
예제 #13
0
파일: Design.cs 프로젝트: Somnium13/SS13
        // Function from file: designs.dm
        public void CalcReliability(ByTable temp_techs = null)
        {
            int  new_reliability = 0;
            Tech T = null;


            foreach (dynamic _a in Lang13.Enumerate(temp_techs, typeof(Tech)))
            {
                T = _a;


                if (this.req_tech.Contains(T.id))
                {
                    new_reliability += T.level;                     //Originally just *.level, not (*.level != 0) -Pdan
                }
            }
            new_reliability  = Num13.MaxInt(this.reliability, Num13.MinInt(new_reliability, 100));
            this.reliability = new_reliability;
            return;
        }
예제 #14
0
        public override bool f_action(dynamic target = null)
        {
            double?cur_amount = null;
            int    to_load    = 0;


            if (!this.action_checks(target))
            {
                return(false);
            }

            if (target is Obj_Item_Stack_CableCoil && Lang13.Bool(target.amount))
            {
                cur_amount = (this.cable != null ? this.cable.amount : 0);
                to_load    = Num13.MaxInt(((int)(this.max_cable - (cur_amount ?? 0))), 0);

                if (to_load != 0)
                {
                    to_load = Num13.MinInt(Convert.ToInt32(target.amount), to_load);

                    if (!(this.cable != null))
                    {
                        this.cable        = new Obj_Item_Stack_CableCoil(this);
                        this.cable.amount = 0;
                    }
                    this.cable.amount += to_load;
                    target.use(to_load);
                    this.occupant_message("<span class='notice'>" + to_load + " meters of cable successfully loaded.</span>");
                    GlobalFuncs.send_byjax(this.chassis.occupant, "exosuit.browser", new Txt().Ref(this).ToString(), this.get_equip_info());
                }
                else
                {
                    this.occupant_message("<span class='warning'>Reel is full.</span>");
                }
            }
            else
            {
                this.occupant_message("<span class='warning'>Unable to load " + target + " - no cable found.</span>");
            }
            return(false);
        }
예제 #15
0
        // Function from file: gas_mixture.dm
        public void temperature_turf_share(Tile sharer = null, double conduction_coefficient = 0)
        {
            dynamic temperature_delta  = null;
            double  self_heat_capacity = 0;
            double  heat = 0;

            temperature_delta = this.temperature_archived - sharer.temperature;

            if (Math.Abs(Convert.ToDouble(temperature_delta)) > 0.5)
            {
                self_heat_capacity = this.heat_capacity();

                if (sharer.heat_capacity > 0.0003 && self_heat_capacity > 0.0003)
                {
                    heat               = conduction_coefficient * Convert.ToDouble(temperature_delta) * (self_heat_capacity * sharer.heat_capacity / (self_heat_capacity + sharer.heat_capacity));
                    this.temperature   = Num13.MaxInt(Convert.ToInt32(this.temperature - heat / self_heat_capacity), ((int)(2.7)));
                    sharer.temperature = Num13.MaxInt(((int)(sharer.temperature + heat / sharer.heat_capacity)), ((int)(2.7)));
                }
            }
            return;
        }
예제 #16
0
        // Function from file: lighting_system.dm
        public void UpdateLuminosity(dynamic new_luminosity = null, int?new_cap = null)
        {
            if (Convert.ToDouble(new_luminosity) < 0)
            {
                new_luminosity = 0;
            }

            if (this.luminosity == new_luminosity && (new_cap == null || this.cap == new_cap))
            {
                return;
            }
            this.radius     = Num13.MaxInt(4, Convert.ToInt32(new_luminosity));
            this.luminosity = new_luminosity;

            if (new_cap != null)
            {
                this.cap = new_cap;
            }
            this.f_changed();
            return;
        }
예제 #17
0
        // Function from file: other_reagents.dm
        public override bool on_mob_life(dynamic M = null)
        {
            M.jitteriness = Num13.MaxInt(M.jitteriness - 5, 0);

            if (Rand13.PercentChance(80))
            {
                ((Mob_Living)M).adjustBrainLoss(1);
            }

            if (Rand13.PercentChance(50))
            {
                M.drowsyness = Num13.MaxInt(M.drowsyness, 3);
            }

            if (Rand13.PercentChance(10))
            {
                ((Mob)M).emote("drool");
            }
            base.on_mob_life((object)(M));
            return(false);
        }
예제 #18
0
        // Function from file: humans.dm
        public override dynamic Crossed(Ent_Dynamic O = null, dynamic X = null)
        {
            Ent_Dynamic             H = null;
            Obj_Item_Clothing_Shoes S = null;


            if (O is Mob_Living_Carbon_Human)
            {
                H = O;
                S = ((dynamic)H).shoes;

                if (S != null && Lang13.Bool(S.bloody_shoes[this.blood_state]))
                {
                    S.bloody_shoes[this.blood_state] = Num13.MaxInt(Convert.ToInt32(S.bloody_shoes[this.blood_state] - 5), 0);
                    this.entered_dirs |= H.dir;
                    this.shoe_types.Or(((dynamic)H).shoes.type);
                }
            }
            this.update_icon();
            return(null);
        }
예제 #19
0
        // Function from file: energy_net_nets.dm
        public override bool hitby(Ent_Dynamic AM = null, bool?skipcatch = null, bool?hitpush = null, bool?blocked = null)
        {
            dynamic tforce = null;

            base.hitby(AM, skipcatch, hitpush, blocked);
            tforce = 0;

            if (AM is Mob)
            {
                tforce = 10;
            }
            else
            {
                tforce = ((dynamic)AM).throwforce;
            }
            GlobalFuncs.playsound(this.loc, "sound/weapons/slash.ogg", 80, 1);
            this.health = Num13.MaxInt(0, ((int)(this.health - Convert.ToDouble(tforce))));
            this.healthcheck();
            base.hitby(AM, skipcatch, hitpush, blocked);
            return(false);
        }
예제 #20
0
        // Function from file: cellular.dm
        public override dynamic defineRegion(dynamic Start = null, dynamic End = null, bool?replace = null)
        {
            replace = replace ?? false;

            dynamic _default = null;

            int min_x = 0;
            int max_x = 0;
            int min_y = 0;
            int max_y = 0;

            _default    = base.defineRegion((object)(Start), (object)(End), replace);
            min_x       = Num13.MinInt(Convert.ToInt32(Start.x), Convert.ToInt32(End.x));
            max_x       = Num13.MaxInt(Convert.ToInt32(Start.x), Convert.ToInt32(End.x));
            min_y       = Num13.MinInt(Convert.ToInt32(Start.y), Convert.ToInt32(End.y));
            max_y       = Num13.MaxInt(Convert.ToInt32(Start.y), Convert.ToInt32(End.y));
            this.width  = max_x - min_x;
            this.height = max_y - min_y;
            this.start  = Map13.GetTile(min_x, min_y, Convert.ToInt32(Start.z));
            return(_default);
        }
예제 #21
0
파일: Swapmap.cs 프로젝트: Somnium13/SS13
        // Function from file: swapmaps.dm
        public void BuildFilledRectangle(Tile T1 = null, Tile T2 = null, dynamic item = null)
        {
            dynamic T = null;


            if (!this.Contains(T1) || !this.Contains(T2))
            {
                return;
            }
            T  = T1;
            T1 = Map13.GetTile(Num13.MinInt(T1.x, T2.x), Num13.MinInt(T1.y, T2.y), Num13.MinInt(T1.z, T2.z));
            T2 = Map13.GetTile(Num13.MaxInt(Convert.ToInt32(T.x), T2.x), Num13.MaxInt(Convert.ToInt32(T.y), T2.y), Num13.MaxInt(Convert.ToInt32(T.z), T2.z));

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInBlock(T1, T2)))
            {
                T = _a;

                Lang13.Call(item, T);
            }
            return;
        }
예제 #22
0
        // Function from file: other_reagents.dm
        public override bool on_mob_life(dynamic M = null)
        {
            if (!Lang13.Bool(this.data))
            {
                this.data = 1;
            }
            this.data++;
            M.jitteriness = Num13.MaxInt(M.jitteriness - 5, 0);

            if (Convert.ToDouble(this.data) >= 30)
            {
                if (!(M.stuttering != 0))
                {
                    M.stuttering = 1;
                }
                M.stuttering += 4;
                ((Mob)M).Dizzy(5);
            }

            if (Convert.ToDouble(this.data) >= 75 && Rand13.PercentChance(33))
            {
                if (!(M.confused != 0))
                {
                    M.confused = 1;
                }
                M.confused += 3;

                if (GlobalFuncs.is_handofgod_cultist(M) && !GlobalFuncs.is_handofgod_prophet(M))
                {
                    ((GameMode)GlobalVars.ticker.mode).remove_hog_follower(M.mind);
                    ((Reagents)this.holder).remove_reagent(this.id, this.volume);
                    M.jitteriness = 0;
                    M.stuttering  = 0;
                    M.confused    = 0;
                    return(false);
                }
            }
            ((Reagents)this.holder).remove_reagent(this.id, 0.4);
            return(false);
        }
예제 #23
0
        // Function from file: pyrotechnics.dm
        public override void on_reaction(Reagents holder = null, double?created_volume = null)
        {
            dynamic           location = null;
            Mob_Living_Carbon C        = null;


            if (Lang13.Bool(holder.has_reagent("stabilizing_agent")))
            {
                return;
            }
            holder.remove_reagent("sonic_powder", created_volume);
            location = GlobalFuncs.get_turf(holder.my_atom);
            GlobalFuncs.playsound(location, "sound/effects/bang.ogg", 25, 1);

            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_hearers_in_view((created_volume ?? 0) / 10, location), typeof(Mob_Living_Carbon)))
            {
                C = _a;


                if (C.check_ear_prot())
                {
                    continue;
                }
                C.show_message("<span class='warning'>BANG</span>", 2);
                C.Stun(5);
                C.Weaken(5);
                C.setEarDamage(C.ear_damage + Rand13.Int(0, 5), Num13.MaxInt(((int)(C.ear_deaf ?? 0)), 15));

                if (C.ear_damage >= 15)
                {
                    C.WriteMsg("<span class='warning'>Your ears start to ring badly!</span>");
                }
                else if (C.ear_damage >= 5)
                {
                    C.WriteMsg("<span class='warning'>Your ears start to ring!</span>");
                }
            }
            return;
        }
예제 #24
0
        // Function from file: camera_advanced.dm
        public override bool relaymove(Mob user = null, int?direction = null)
        {
            dynamic initial    = null;
            int     max_sprint = 0;
            int?    i          = null;
            dynamic step       = null;

            initial    = Lang13.Initial(this, "sprint");
            max_sprint = 50;

            if (this.cooldown != 0 && this.cooldown < Game13.timeofday)
            {
                this.sprint = initial;
            }
            i = null;
            i = 0;

            while ((i ?? 0) < Num13.MaxInt(Convert.ToInt32(this.sprint), Convert.ToInt32(initial)))
            {
                step = GlobalFuncs.get_turf(Map13.GetStep(this, direction ?? 0));

                if (Lang13.Bool(step))
                {
                    this.setLoc(step);
                }
                i += 20;
            }
            this.cooldown = Game13.timeofday + 5;

            if (this.acceleration)
            {
                this.sprint = Num13.MinInt(Convert.ToInt32(this.sprint + 0.5), max_sprint);
            }
            else
            {
                this.sprint = initial;
            }
            return(false);
        }
예제 #25
0
        // Function from file: organ_external.dm
        public bool heal_damage(dynamic brute = null, dynamic burn = null, bool robotic = false)
        {
            if (robotic && this.status != 2)
            {
                brute = Num13.MaxInt(0, Convert.ToInt32(brute - 3));
                burn  = Num13.MaxInt(0, Convert.ToInt32(burn - 3));
            }

            if (!robotic && this.status == 2)
            {
                brute = Num13.MaxInt(0, Convert.ToInt32(brute - 3));
                burn  = Num13.MaxInt(0, Convert.ToInt32(burn - 3));
            }
            this.brute_dam = Num13.MaxInt(((int)(this.brute_dam - Convert.ToDouble(brute))), 0);
            this.burn_dam  = Num13.MaxInt(((int)(this.burn_dam - Convert.ToDouble(burn))), 0);

            if (Lang13.Bool(this.owner))
            {
                ((Mob_Living)this.owner).updatehealth();
            }
            return(this.update_organ_icon());
        }
예제 #26
0
        // Function from file: other_reagents.dm
        public override bool on_mob_life(dynamic M = null)
        {
            ((Mob_Living)M).adjustBrainLoss(3);

            if (GlobalFuncs.iscultist(M))
            {
                M.status_flags |= 32;
                M.drowsyness    = Num13.MaxInt(M.drowsyness - 5, 0);
                ((Mob)M).AdjustParalysis(-2);
                ((Mob)M).AdjustStunned(-2);
                ((Mob)M).AdjustWeakened(-2);
            }
            else
            {
                ((Mob_Living)M).adjustToxLoss(2);
                ((Mob_Living)M).adjustFireLoss(2);
                ((Mob_Living)M).adjustOxyLoss(2);
                ((Mob_Living)M).adjustBruteLoss(2);
            }
            ((Reagents)this.holder).remove_reagent(this.id, 1);
            return(false);
        }
예제 #27
0
        // Function from file: firing.dm
        public virtual bool fire(dynamic target = null, dynamic user = null, string _params = null, double?distro = null, dynamic quiet = null, dynamic zone_override = null)
        {
            zone_override = zone_override ?? "";

            int?       i       = null;
            Ent_Static curloc  = null;
            dynamic    targloc = null;

            distro += this.variance;
            i       = null;
            i       = Num13.MaxInt(1, this.pellets);

            while ((i ?? 0) > 0)
            {
                curloc  = user.loc;
                targloc = GlobalFuncs.get_turf(target);
                this.ready_proj(target, user, quiet, zone_override);

                if (Lang13.Bool(distro))
                {
                    targloc = this.spread(targloc, curloc, distro);
                }

                if (!this.throw_proj(target, targloc, user, _params))
                {
                    return(false);
                }

                if ((i ?? 0) > 1)
                {
                    this.newshot();
                }
                i--;
            }
            ((Mob)user).changeNext_move(4);
            ((Ent_Dynamic)user).newtonian_move(Map13.GetDistance(target, user));
            this.update_icon();
            return(true);
        }
예제 #28
0
        // Function from file: window.dm
        public override bool hitby(Ent_Dynamic AM = null, bool?skipcatch = null, bool?hitpush = null, bool?blocked = null)
        {
            dynamic     tforce = null;
            Ent_Dynamic I      = null;

            base.hitby(AM, skipcatch, hitpush, blocked);
            tforce = 0;

            if (AM is Mob)
            {
                tforce = 40;
            }
            else if (AM is Obj)
            {
                I      = AM;
                tforce = ((dynamic)I).throwforce;
            }

            if (this.reinf == true)
            {
                tforce *= 0.25;
            }
            GlobalFuncs.playsound(this.loc, "sound/effects/Glasshit.ogg", 100, 1);
            this.health = Num13.MaxInt(0, ((int)(this.health - Convert.ToDouble(tforce))));

            if (this.health <= 7 && !(this.reinf == true))
            {
                this.anchored = 0;
                this.update_nearby_icons();
                Map13.Step(this, Map13.GetDistance(AM, this));
            }

            if (this.health <= 0)
            {
                this.spawnfragments();
            }
            this.update_nearby_icons();
            return(false);
        }
예제 #29
0
        // Function from file: disposal-structures.dm
        public override bool relaymove(Mob user = null, int?direction = null)
        {
            dynamic M = null;


            if (user.stat != 0)
            {
                return(false);
            }

            if (this.loc != null)
            {
                foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_hearers_in_view(this.loc.loc)))
                {
                    M = _a;

                    M.show_message("<FONT size=" + Num13.MaxInt(0, 5 - Map13.GetDistance(this, M)) + ">CLONG, clong!</FONT>", 2);
                }
            }
            GlobalFuncs.playsound(this.loc, "sound/effects/clang.ogg", 50, 0, 0);
            return(false);
        }
예제 #30
0
        // Function from file: other_reagents.dm
        public override void reaction_turf(dynamic T = null, double?volume = null)
        {
            int CT = 0;
            Mob_Living_SimpleAnimal_Slime M = null;
            dynamic    hotspot = null;
            GasMixture G       = null;


            if (!(T is Tile_Simulated))
            {
                return;
            }
            CT = this.cooling_temperature;

            if ((volume ?? 0) >= 10)
            {
                ((Tile_Simulated)T).MakeSlippery();
            }

            foreach (dynamic _a in Lang13.Enumerate(T, typeof(Mob_Living_SimpleAnimal_Slime)))
            {
                M = _a;

                M.apply_water();
            }
            hotspot = Lang13.FindIn(typeof(Obj_Effect_Hotspot), T);

            if (Lang13.Bool(hotspot) && !(T is Tile_Space))
            {
                if (Lang13.Bool(T.air))
                {
                    G             = T.air;
                    G.temperature = Num13.MaxInt(Num13.MinInt(Convert.ToInt32(G.temperature - CT * 1000), Convert.ToInt32(G.temperature / CT)), 0);
                    G.react();
                    GlobalFuncs.qdel(hotspot);
                }
            }
            return;
        }