Ejemplo n.º 1
0
 // Function from file: mutations.dm
 public virtual void on_ranged_attack(Mob_Living_Carbon_Human owner = null, Ent_Static target = null)
 {
     return;
 }
Ejemplo n.º 2
0
        // Function from file: cable.dm
        public void place_turf(Ent_Static T = null, dynamic user = null)
        {
            double?dirn            = null;
            Obj_Structure_Cable LC = null;
            dynamic             C  = null;
            Powernet            PN = null;


            if (!(user.loc is Tile))
            {
                return;
            }

            if (!Lang13.Bool(((dynamic)T).can_have_cabling()))
            {
                user.WriteMsg("<span class='warning'>You can only lay cables on catwalks and plating!</span>");
                return;
            }

            if ((this.get_amount() ?? 0) < 1)
            {
                user.WriteMsg("<span class='warning'>There is no cable left!</span>");
                return;
            }

            if (Map13.GetDistance(T, user) > 1)
            {
                user.WriteMsg("<span class='warning'>You can't lay cable at a place that far away!</span>");
                return;
            }
            else
            {
                if (user.loc == T)
                {
                    dirn = Lang13.DoubleNullable(user.dir);
                }
                else
                {
                    dirn = Map13.GetDistance(T, user);
                }

                foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj_Structure_Cable)))
                {
                    LC = _a;


                    if (LC.d2 == dirn && LC.d1 == 0)
                    {
                        user.WriteMsg("<span class='warning'>There's already a cable at that position!</span>");
                        return;
                    }
                }
                C    = this.get_new_cable(T);
                C.d1 = 0;
                C.d2 = dirn;
                ((Ent_Static)C).add_fingerprint(user);
                C.updateicon();
                PN = new Powernet();
                PN.add_cable(C);
                ((Obj_Structure_Cable)C).mergeConnectedNetworks(C.d2);
                ((Obj_Structure_Cable)C).mergeConnectedNetworksOnTurf();

                if ((((int)(C.d2 ?? 0)) & ((int)((C.d2 ?? 0) - 1))) != 0)
                {
                    ((Obj_Structure_Cable)C).mergeDiagonalsNetworks(C.d2);
                }
                this.use(1);

                if (((Obj_Structure_Cable)C).shock(user, 50))
                {
                    if (Rand13.PercentChance(50))
                    {
                        ((Obj)C).Deconstruct();
                    }
                }
            }
            return;
        }
Ejemplo n.º 3
0
        // Function from file: LINDA_fire.dm
        public override int?process(dynamic seconds = null)
        {
            Ent_Static     location             = null;
            double         radiated_temperature = 0;
            Tile_Simulated T = null;


            if (this.just_spawned)
            {
                this.just_spawned = false;
                return(0);
            }
            location = this.loc;

            if (!(location is Tile_Simulated))
            {
                GlobalFuncs.qdel(this);
                return(null);
            }

            if (Lang13.Bool(((dynamic)location).excited_group))
            {
                ((ExcitedGroup)((dynamic)location).excited_group).reset_cooldowns();
            }

            if (Convert.ToDouble(this.temperature) < 373.41 || (this.volume ?? 0) <= 1)
            {
                GlobalFuncs.qdel(this);
                return(null);
            }

            if (!Lang13.Bool(((dynamic)location).air) || !Lang13.Bool(((dynamic)location).air.gases["plasma"]) || !Lang13.Bool(((dynamic)location).air.gases["o2"]) || Convert.ToDouble(((dynamic)location).air.gases["plasma"][1]) < 0.5 || Convert.ToDouble(((dynamic)location).air.gases["o2"][1]) < 0.5)
            {
                GlobalFuncs.qdel(this);
                return(null);
            }
            this.perform_exposure();

            if (Lang13.Bool(((dynamic)location).wet))
            {
                ((dynamic)location).wet = 0;
            }

            if (this.bypassing)
            {
                this.icon_state = "3";
                ((dynamic)location).burn_tile();

                if (Convert.ToDouble(((dynamic)location).air.temperature) > 423.41)
                {
                    radiated_temperature = Convert.ToDouble(((dynamic)location).air.temperature * 0.85);

                    foreach (dynamic _a in Lang13.Enumerate(((dynamic)location).atmos_adjacent_turfs, typeof(Tile_Simulated)))
                    {
                        T = _a;


                        if (Lang13.Bool(T.active_hotspot))
                        {
                            T.hotspot_expose(radiated_temperature, 625);
                        }
                    }
                }
            }
            else if ((this.volume ?? 0) > 1000)
            {
                this.icon_state = "2";
            }
            else
            {
                this.icon_state = "1";
            }

            if (Convert.ToDouble(this.temperature) > Convert.ToDouble(((dynamic)location).max_fire_temperature_sustained))
            {
                ((dynamic)location).max_fire_temperature_sustained = this.temperature;
            }

            if (Lang13.Bool(((dynamic)location).heat_capacity) && Convert.ToDouble(this.temperature) > Convert.ToDouble(((dynamic)location).heat_capacity))
            {
                ((dynamic)location).to_be_destroyed = 1;
            }
            return(1);
        }
Ejemplo n.º 4
0
 // Function from file: medical_tools.dm
 public override bool Exit(Ent_Dynamic O = null, Ent_Static newloc = null)
 {
     return(false);
 }
Ejemplo n.º 5
0
        // Function from file: secbot.dm
        public override bool handle_automated_action(  )
        {
            int olddist = 0;


            if (!base.handle_automated_action())
            {
                return(false);
            }

            switch ((int)(this.v_mode))
            {
            case 0:
                Map13.WalkTowards(this, 0, 0, 0);
                this.look_for_perp();

                if (!(this.v_mode != 0) && this.auto_patrol)
                {
                    this.v_mode = 4;
                }
                break;

            case 1:

                if (this.frustration >= 8)
                {
                    Map13.WalkTowards(this, 0, 0, 0);
                    this.back_to_idle();
                    return(false);
                }

                if (Lang13.Bool(this.target))
                {
                    if (this.Adjacent(this.target) && this.target.loc is Tile)
                    {
                        this.stun_attack(this.target);
                        this.v_mode         = 2;
                        this.anchored       = 1;
                        this.target_lastloc = this.target.loc;
                        return(false);
                    }
                    else
                    {
                        olddist = Map13.GetDistance(this, this.target);
                        Map13.WalkTowards(this, this.target, 1, 4);

                        if (Map13.GetDistance(this, this.target) >= olddist)
                        {
                            this.frustration++;
                        }
                        else
                        {
                            this.frustration = 0;
                        }
                    }
                }
                else
                {
                    this.back_to_idle();
                }
                break;

            case 2:

                if (!this.Adjacent(this.target) || !(this.target.loc is Tile) || this.target.weakened < 2)
                {
                    this.back_to_hunt();
                    return(false);
                }

                if (this.target is Mob_Living_Carbon && ((Mob_Living_Carbon)this.target).canBeHandcuffed())
                {
                    if (!this.arrest_type)
                    {
                        if (!Lang13.Bool(this.target.handcuffed))
                        {
                            this.cuff(this.target);
                        }
                        else
                        {
                            this.back_to_idle();
                            return(false);
                        }
                    }
                }
                else
                {
                    this.back_to_idle();
                    return(false);
                }
                break;

            case 3:

                if (!Lang13.Bool(this.target))
                {
                    this.anchored    = 0;
                    this.v_mode      = 0;
                    this.last_found  = Game13.time;
                    this.frustration = 0;
                    return(false);
                }

                if (Lang13.Bool(this.target.handcuffed))
                {
                    this.back_to_idle();
                    return(false);
                }

                if (!this.Adjacent(this.target) || !(this.target.loc is Tile) || this.target.loc != this.target_lastloc && this.target.weakened < 2)
                {
                    this.back_to_hunt();
                    return(false);
                }
                else
                {
                    this.v_mode   = 2;
                    this.anchored = 0;
                }
                break;

            case 4:
                this.look_for_perp();
                this.start_patrol();
                break;

            case 5:
                this.look_for_perp();
                this.bot_patrol();
                break;
            }
            return(false);
        }
        // Function from file: mine_turfs.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            double              digging_speed = 0;
            dynamic             S             = null;
            dynamic             P             = null;
            Ent_Static          T             = null;
            dynamic             S2            = null;
            Obj_Item_Weapon_Ore O             = null;
            dynamic             Z             = null;
            dynamic             T2            = null;
            dynamic             L             = null;
            dynamic             F             = null;


            if (!Lang13.Bool(A) || !Lang13.Bool(user))
            {
                return(0);
            }
            digging_speed = 0;

            if (A is Obj_Item_Weapon_Shovel)
            {
                S             = A;
                digging_speed = Convert.ToDouble(S.digspeed);
            }
            else if (A is Obj_Item_Weapon_Pickaxe)
            {
                P             = A;
                digging_speed = Convert.ToDouble(P.digspeed);
            }

            if (digging_speed != 0)
            {
                T = user.loc;

                if (!(T is Tile))
                {
                    return(null);
                }

                if (this.dug)
                {
                    user.WriteMsg("<span class='warning'>This area has already been dug!</span>");
                    return(null);
                }
                user.WriteMsg("<span class='notice'>You start digging...</span>");
                GlobalFuncs.playsound(this, "sound/effects/shovel_dig.ogg", 50, 1);

                if (GlobalFuncs.do_after(user, digging_speed, null, this))
                {
                    if (this is Tile_Simulated_Floor_Plating_Asteroid)
                    {
                        user.WriteMsg("<span class='notice'>You dig a hole.</span>");
                        this.gets_dug();
                        GlobalFuncs.feedback_add_details("pick_used_mining", "" + A.type);
                    }
                }
            }

            if (A is Obj_Item_Weapon_Storage_Bag_Ore)
            {
                S2 = A;

                if (S2.collection_mode == 1)
                {
                    foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj_Item_Weapon_Ore)))
                    {
                        O = _a;

                        O.attackby(A, user);
                        return(null);
                    }
                }
            }

            if (A is Obj_Item_Stack_Tile)
            {
                Z = A;

                if (!(((Obj_Item_Stack)Z).use(1) != 0))
                {
                    return(null);
                }
                T2 = this.ChangeTurf(Z.turf_type);

                if (Z is Obj_Item_Stack_Tile_Light)
                {
                    L       = Z;
                    F       = T2;
                    F.state = L.state;
                }
                GlobalFuncs.playsound(this, "sound/weapons/genhit.ogg", 50, 1);
            }
            return(null);
        }
Ejemplo n.º 7
0
 // Function from file: statue.dm
 public override bool MouseDrop_T(Ent_Static dropping = null, Mob user = null)
 {
     return(false);
 }
        // Function from file: absorb.dm
        public override dynamic sting_action(Mob user = null, Ent_Static target = null)
        {
            Changeling changeling     = null;
            dynamic    G              = null;
            Mob_Living target2        = null;
            int?       stage          = null;
            ByTable    recent_speech  = null;
            dynamic    spoken_memory  = null;
            dynamic    spoken_memory2 = null;

            changeling             = user.mind.changeling;
            G                      = user.get_active_hand();
            target2                = G.affecting;
            changeling.isabsorbing = true;
            stage                  = null;
            stage                  = 1;

            while ((stage ?? 0) <= 3)
            {
                switch ((int?)(stage))
                {
                case 1:
                    user.WriteMsg("<span class='notice'>This creature is compatible. We must hold still...</span>");
                    break;

                case 2:
                    user.visible_message("<span class='warning'>" + user + " extends a proboscis!</span>", "<span class='notice'>We extend a proboscis.</span>");
                    break;

                case 3:
                    user.visible_message("<span class='danger'>" + user + " stabs " + target2 + " with the proboscis!</span>", "<span class='notice'>We stab " + target2 + " with the proboscis.</span>");
                    target2.WriteMsg("<span class='userdanger'>You feel a sharp stabbing pain!</span>");
                    target2.take_overall_damage(40);
                    break;
                }
                GlobalFuncs.feedback_add_details("changeling_powers", "A" + stage);

                if (!GlobalFuncs.do_mob(user, target2, 150))
                {
                    user.WriteMsg("<span class='warning'>Our absorption of " + target2 + " has been interrupted!</span>");
                    changeling.isabsorbing = false;
                    return(null);
                }
                stage++;
            }
            user.visible_message("<span class='danger'>" + user + " sucks the fluids from " + target2 + "!</span>", "<span class='notice'>We have absorbed " + target2 + ".</span>");
            target2.WriteMsg("<span class='userdanger'>You are absorbed by the changeling!</span>");

            if (!changeling.has_dna(((dynamic)target2).dna))
            {
                changeling.add_new_profile(target2, user);
            }

            if (user.nutrition < 450)
            {
                user.nutrition = Num13.MinInt(((int)(user.nutrition + target2.nutrition)), 450);
            }

            if (target2.mind != null)
            {
                target2.mind.show_memory(this, false);
                recent_speech = new ByTable();

                if (target2.say_log.len > 8)
                {
                    recent_speech = target2.say_log.Copy(target2.say_log.len - 8 + 1, 0);
                }
                else
                {
                    foreach (dynamic _b in Lang13.Enumerate(target2.say_log))
                    {
                        spoken_memory = _b;


                        if (recent_speech.len >= 8)
                        {
                            break;
                        }
                        recent_speech.Add(spoken_memory);
                    }
                }

                if (recent_speech.len != 0)
                {
                    user.mind.store_memory("<B>Some of " + target2 + "'s speech patterns, we should study these to better impersonate them!</B>");
                    user.WriteMsg("<span class='boldnotice'>Some of " + target2 + "'s speech patterns, we should study these to better impersonate them!</span>");

                    foreach (dynamic _c in Lang13.Enumerate(recent_speech))
                    {
                        spoken_memory2 = _c;

                        user.mind.store_memory("\"" + spoken_memory2 + "\"");
                        user.WriteMsg("<span class='notice'>\"" + spoken_memory2 + "\"</span>");
                    }
                    user.mind.store_memory("<B>We have no more knowledge of " + target2 + "'s speech patterns.</B>");
                    user.WriteMsg("<span class='boldnotice'>We have no more knowledge of " + target2 + "'s speech patterns.</span>");
                }

                if (target2.mind.changeling != null)
                {
                    changeling.chem_charges  += Num13.MinInt(((int)(target2.mind.changeling.chem_charges)), Convert.ToInt32(changeling.chem_storage));
                    changeling.absorbedcount += target2.mind.changeling.absorbedcount;
                    target2.mind.changeling.stored_profiles.len = 1;
                    target2.mind.changeling.absorbedcount       = 0;
                }
            }
            changeling.chem_charges = Num13.MinInt(((int)(changeling.chem_charges + 10)), Convert.ToInt32(changeling.chem_storage));
            changeling.isabsorbing  = false;
            changeling.canrespec    = true;
            target2.death(false);
            ((dynamic)target2).Drain();
            return(1);
        }
Ejemplo n.º 9
0
 // Function from file: infrared.dm
 public override dynamic Bump(Ent_Static Obstacle = null, dynamic yes = null)
 {
     GlobalFuncs.qdel(this);
     return(null);
 }
Ejemplo n.º 10
0
        // Function from file: swapmaps.dm
        public override dynamic Destroy(  )
        {
            ByTable    areas = null;
            Ent_Static A     = null;
            Obj        O     = null;
            dynamic    M     = null;
            dynamic    a     = null;


            if (!this.ischunk)
            {
                GlobalVars.swapmaps_loaded.Remove(this);
                GlobalVars.swapmaps_byname.Remove(this.id);

                if ((this.z2 ?? 0) > GlobalVars.swapmaps_compiled_maxz || this.y2 > GlobalVars.swapmaps_compiled_maxy || this.x2 > GlobalVars.swapmaps_compiled_maxx)
                {
                    areas = new ByTable();

                    foreach (dynamic _c in Lang13.Enumerate(Map13.FetchInBlock(Map13.GetTile(this.x1, this.y1, this.z1 ?? 0), Map13.GetTile(this.x2, this.y2, this.z2 ?? 0)), typeof(Ent_Static)))
                    {
                        A = _c;


                        foreach (dynamic _a in Lang13.Enumerate(A, typeof(Obj)))
                        {
                            O = _a;

                            GlobalFuncs.qdel(O);
                        }

                        foreach (dynamic _b in Lang13.Enumerate(A))
                        {
                            M = _b;


                            if (!Lang13.Bool(M.key))
                            {
                                GlobalFuncs.qdel(M);
                            }
                            else
                            {
                                M.loc = null;
                            }
                        }
                        areas[A.loc] = null;
                        GlobalFuncs.qdel(A);
                    }

                    foreach (dynamic _d in Lang13.Enumerate(areas))
                    {
                        a = _d;


                        if (Lang13.Bool(a) && !(a.contents.len != 0))
                        {
                            GlobalFuncs.qdel(a);
                        }
                    }

                    if (this.x2 >= Game13.map_size_x || this.y2 >= Game13.map_size_y || (this.z2 ?? 0) >= Game13.map_size_z)
                    {
                        this.CutXYZ();
                    }
                    GlobalFuncs.qdel(areas);
                }
            }
            base.Destroy();
            return(4);
        }
Ejemplo n.º 11
0
 // Function from file: other_mobs.dm
 public override void UnarmedAttack(Ent_Static A = null, bool?proximity_flag = null)
 {
     A.attack_paw(this);
     return;
 }
Ejemplo n.º 12
0
        // Function from file: swapmaps.dm
        public override void Read(SaveFile F = null, dynamic __id = null, dynamic locorner = null)
        {
            double     x       = 0;
            double     y       = 0;
            double     z       = 0;
            dynamic    n       = null;
            dynamic    areas   = null;
            dynamic    defarea = null;
            dynamic    dummy   = null;
            string     oldcd   = null;
            dynamic    tp      = null;
            dynamic    T       = null;
            Ent_Static A       = null;
            Obj        O       = null;
            dynamic    M       = null;

            defarea = Lang13.FindObj(Game13.default_zone);
            this.id = __id;

            if (Lang13.Bool(locorner))
            {
                this.ischunk = true;
                this.x1      = Convert.ToInt32(locorner.x);
                this.y1      = Convert.ToInt32(locorner.y);
                this.z1      = Lang13.IntNullable(locorner.z);
            }

            if (!Lang13.Bool(defarea))
            {
                defarea = Lang13.Call(Game13.default_zone);
            }

            if (!Lang13.Bool(__id))
            {
                this.id = F.ReadItem("id", this.id);
            }
            else
            {
                dummy = F.ReadItem("id", dummy);
            }
            this.z2     = F.ReadItem("z", this.z2);
            this.y2     = F.ReadItem("y", this.y2);
            this.x2     = F.ReadItem("x", this.x2);
            areas       = F.ReadItem("areas", areas);
            this.locked = true;
            this.AllocateSwapMap();
            oldcd = F.cd;

            foreach (dynamic _e in Lang13.IterateRange(this.z1, this.z2))
            {
                z = _e;

                F.cd = "" + (z - (this.z1 ?? 0) + 1);

                foreach (dynamic _d in Lang13.IterateRange(this.y1, this.y2))
                {
                    y = _d;

                    F.cd = "" + (y - this.y1 + 1);

                    foreach (dynamic _c in Lang13.IterateRange(this.x1, this.x2))
                    {
                        x = _c;

                        F.cd = "" + (x - this.x1 + 1);
                        tp   = null;
                        tp   = F.ReadItem("type", tp);
                        T    = Map13.GetTile(((int)(x)), ((int)(y)), ((int)(z)));
                        T.loc.contents.Remove(T);
                        T = Lang13.Call(tp, Map13.GetTile(((int)(x)), ((int)(y)), ((int)(z))));

                        if (F.dir.Contains("AREA"))
                        {
                            n = F.ReadItem("AREA", n);
                            A = areas[n];
                            A.contents.Add(T);
                        }
                        else
                        {
                            defarea.contents.Add(T);
                        }

                        foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj)))
                        {
                            O = _a;

                            GlobalFuncs.qdel(O);
                        }

                        foreach (dynamic _b in Lang13.Enumerate(T))
                        {
                            M = _b;


                            if (!Lang13.Bool(M.key))
                            {
                                GlobalFuncs.qdel(M);
                            }
                            else
                            {
                                M.loc = null;
                            }
                        }
                        ((Base_Data)T).Read(F);
                        F.cd = "..";
                    }
                    F.cd = "..";
                }
                Task13.Sleep(0);
                F.cd = oldcd;
            }
            this.locked = false;
            GlobalFuncs.qdel(areas);
            return;
        }
Ejemplo n.º 13
0
        // Function from file: photography.dm
        public void borgprint(  )
        {
            ByTable    nametemp  = null;
            dynamic    find      = null;
            Picture    selection = null;
            Ent_Static C         = null;
            Obj_Item_Device_Camera_Siliconcam targetcam = null;
            Picture t = null;
            Picture q = null;
            Obj_Item_Weapon_Photo p = null;

            nametemp  = new ByTable();
            C         = this.loc;
            targetcam = null;

            if (Convert.ToDouble(((dynamic)C).toner) < 20)
            {
                Task13.User.WriteMsg("Insufficent toner to print image.");
                return;
            }

            if (Lang13.Bool(((dynamic)C).connected_ai))
            {
                targetcam = ((dynamic)C).connected_ai.aicamera;
            }
            else
            {
                targetcam = ((dynamic)C).aicamera;
            }

            if (targetcam.aipictures.len == 0)
            {
                Task13.User.WriteMsg("<span class='userdanger'>No images saved</span>");
                return;
            }

            foreach (dynamic _a in Lang13.Enumerate(targetcam.aipictures, typeof(Picture)))
            {
                t = _a;

                nametemp.Add(t.fields["name"]);
            }
            find = Interface13.Input("Select image (numbered in order taken)", null, null, null, nametemp, InputType.Any);

            foreach (dynamic _b in Lang13.Enumerate(targetcam.aipictures, typeof(Picture)))
            {
                q = _b;


                if (q.fields["name"] == find)
                {
                    selection = q;
                    break;
                }
            }
            p = new Obj_Item_Weapon_Photo(C.loc);
            p.photocreate(selection.fields["icon"], selection.fields["img"], selection.fields["desc"], selection.fields["blueprints"]);
            p.pixel_x           = Rand13.Int(-10, 10);
            p.pixel_y           = Rand13.Int(-10, 10);
            ((dynamic)C).toner -= 20;
            this.visible_message("" + C.name + " spits out a photograph from a narrow slot on it's chassis.");
            Task13.User.WriteMsg("<span class='notice'>You print a photograph.</span>");
            return;
        }
Ejemplo n.º 14
0
 // Function from file: mutations.dm
 public virtual bool on_attack_hand(Mob_Living_Carbon_Human owner = null, Ent_Static target = null)
 {
     return(false);
 }
Ejemplo n.º 15
0
 // Function from file: singularity.dm
 public override dynamic Bump(Ent_Static Obstacle = null, dynamic yes = null)
 {
     this.consume(Obstacle);
     return(null);
 }
Ejemplo n.º 16
0
 // Function from file: brain.dm
 public override void UnarmedAttack(Ent_Static A = null, bool?proximity_flag = null)
 {
     return;
 }
Ejemplo n.º 17
0
        // Function from file: field_generator.dm
        public bool setup_field(int NSEW = 0)
        {
            Ent_Static T         = null;
            dynamic    G         = null;
            int?       steps     = null;
            int?       dist      = null;
            Ent_Static A         = null;
            int?       dist2     = null;
            int        field_dir = 0;
            Obj_Machinery_Field_Containment CF = null;
            Mob_Living L                      = null;
            bool       listcheck              = false;
            Obj_Machinery_Field_Generator FG  = null;
            Obj_Machinery_Field_Generator FG2 = null;

            T     = this.loc;
            steps = 0;

            if (!(NSEW != 0))
            {
                return(false);
            }
            dist = null;
            dist = 0;

            while ((dist ?? 0) <= 9)
            {
                T = Map13.GetStep(T, NSEW);

                if (T.density)
                {
                    return(false);
                }

                foreach (dynamic _a in Lang13.Enumerate(T.contents, typeof(Ent_Static)))
                {
                    A = _a;


                    if (A is Mob)
                    {
                        continue;
                    }

                    if (!(A is Obj_Machinery_Field_Generator))
                    {
                        if ((A is Obj_Machinery_Door || A is Obj_Machinery_TheSingularitygen) && A.density)
                        {
                            return(false);
                        }
                    }
                }
                steps += 1;
                G      = Lang13.FindIn(typeof(Obj_Machinery_Field_Generator), T);

                if (!(G == null))
                {
                    steps -= 1;

                    if (!Lang13.Bool(G.active))
                    {
                        return(false);
                    }
                    break;
                }
                dist += 1;
            }

            if (G == null)
            {
                return(false);
            }
            T     = this.loc;
            dist2 = null;
            dist2 = 0;

            while ((dist2 ?? 0) < (steps ?? 0))
            {
                field_dir = Map13.GetDistance(T, Map13.GetStep(G.loc, NSEW));
                T         = Map13.GetStep(T, NSEW);

                if (!Lang13.Bool(Lang13.FindIn(typeof(Obj_Machinery_Field_Containment), T)))
                {
                    CF = new Obj_Machinery_Field_Containment();
                    CF.set_master(this, G);
                    this.fields.Add(CF);
                    G.fields += CF;
                    CF.loc    = T;
                    CF.dir    = field_dir;

                    foreach (dynamic _b in Lang13.Enumerate(CF.loc, typeof(Mob_Living)))
                    {
                        L = _b;

                        CF.Crossed(L);
                    }
                }
                dist2 += 1;
            }
            listcheck = false;

            foreach (dynamic _c in Lang13.Enumerate(this.connected_gens, typeof(Obj_Machinery_Field_Generator)))
            {
                FG = _c;


                if (FG == null)
                {
                    continue;
                }

                if (FG == G)
                {
                    listcheck = true;
                    break;
                }
            }

            if (!listcheck)
            {
                this.connected_gens.Add(G);
            }
            listcheck = false;

            foreach (dynamic _d in Lang13.Enumerate(G.connected_gens, typeof(Obj_Machinery_Field_Generator)))
            {
                FG2 = _d;


                if (FG2 == null)
                {
                    continue;
                }

                if (FG2 == this)
                {
                    listcheck = true;
                    break;
                }
            }

            if (!listcheck)
            {
                G.connected_gens.Add(this);
            }
            return(false);
        }
Ejemplo n.º 18
0
        // Function from file: biodegrade.dm
        public override dynamic sting_action(Mob user = null, Ent_Static target = null)
        {
            bool       used = false;
            dynamic    O    = null;
            dynamic    S    = null;
            Ent_Static C    = null;

            used = false;

            if (!user.restrained() && !(user.loc is Obj_Structure_Closet))
            {
                user.WriteMsg("<span class='warning'>We are already free!</span>");
                return(0);
            }

            if (Lang13.Bool(((dynamic)user).handcuffed))
            {
                used = true;
                O    = user.get_item_by_slot(3);

                if (!Lang13.Bool(O) || !(O is Obj))
                {
                    return(0);
                }
                user.visible_message(new Txt("<span class='warning'>").item(user).str(" vomits a glob of acid on ").his_her_its_their().str(" ").item(O).str("!</span>").ToString(), "<span class='warning'>We vomit acidic ooze onto our restraints!</span>");
                Task13.Schedule(30, (Task13.Closure)(() => {
                    if (Lang13.Bool(O) && ((dynamic)user).handcuffed == O)
                    {
                        user.unEquip(O);
                        ((Ent_Static)O).visible_message("<span class='warning'>" + O + " dissolves into a puddle of sizzling goop.</span>");
                        O.loc = GlobalFuncs.get_turf(user);
                        GlobalFuncs.qdel(O);
                    }
                    return;
                }));
            }

            if (Lang13.Bool(((dynamic)user).wear_suit) && ((dynamic)user).wear_suit.breakouttime != 0 && !used)
            {
                used = true;
                S    = user.get_item_by_slot(13);

                if (!Lang13.Bool(S) || !(S is Obj_Item_Clothing_Suit))
                {
                    return(0);
                }
                user.visible_message(new Txt("<span class='warning'>").item(user).str(" vomits a glob of acid across the front of ").his_her_its_their().str(" ").item(S).str("!</span>").ToString(), "<span class='warning'>We vomit acidic ooze onto our straight jacket!</span>");
                Task13.Schedule(30, (Task13.Closure)(() => {
                    if (Lang13.Bool(S) && ((dynamic)user).wear_suit == S)
                    {
                        user.unEquip(S);
                        ((Ent_Static)S).visible_message("<span class='warning'>" + S + " dissolves into a puddle of sizzling goop.</span>");
                        S.loc = GlobalFuncs.get_turf(user);
                        GlobalFuncs.qdel(S);
                    }
                    return;
                }));
            }

            if (user.loc is Obj_Structure_Closet && !used)
            {
                used = true;
                C    = user.loc;

                if (!(C != null) || !(C is Obj_Structure_Closet))
                {
                    return(0);
                }
                C.visible_message("<span class='warning'>" + C + "'s hinges suddenly begin to melt and run!</span>");
                user.WriteMsg("<span class='warning'>We vomit acidic goop onto the interior of " + C + "!</span>");
                Task13.Schedule(70, (Task13.Closure)(() => {
                    if (C != null && user.loc == C)
                    {
                        C.visible_message("<span class='warning'>" + C + "'s door breaks and opens!</span>");
                        ((dynamic)C).welded = 0;
                        ((dynamic)C).locked = 0;
                        ((dynamic)C).broken = 1;
                        ((dynamic)C).open();
                        user.WriteMsg("<span class='warning'>We open the container restraining us!</span>");
                    }
                    return;
                }));
            }
            GlobalFuncs.feedback_add_details("changeling_powers", "BD");
            return(1);
        }
Ejemplo n.º 19
0
        // Function from file: cleanbot.dm
        public override bool handle_automated_action(  )
        {
            Ent_Static T = null;


            if (!base.handle_automated_action())
            {
                return(false);
            }

            if (this.v_mode == 7)
            {
                return(false);
            }

            if (this.emagged == 2)
            {
                if (this.loc is Tile_Simulated)
                {
                    if (Rand13.PercentChance(10))
                    {
                        T = this.loc;
                        ((dynamic)T).MakeSlippery();
                    }

                    if (Rand13.PercentChance(5))
                    {
                        this.visible_message("<span class='danger'>" + this + " whirs and bubbles violently, before releasing a plume of froth!</span>");
                        GlobalFuncs.PoolOrNew(typeof(Obj_Effect_ParticleEffect_Foam), this.loc);
                    }
                }
            }
            else if (Rand13.PercentChance(5))
            {
                this.audible_message("" + this + " makes an excited beeping booping sound!");
            }

            if (!Lang13.Bool(this.target))
            {
                this.target = this.scan(typeof(Obj_Effect_Decal_Cleanable));
            }

            if (!Lang13.Bool(this.target) && this.auto_patrol)
            {
                if (this.v_mode == 0 || this.v_mode == 4)
                {
                    this.start_patrol();
                }

                if (this.v_mode == 5)
                {
                    this.bot_patrol();
                }
            }

            if (Lang13.Bool(this.target))
            {
                if (!Lang13.Bool(this.path) || this.path.len == 0)
                {
                    this.path = GlobalFuncs.get_path_to(this, this.target.loc, typeof(Tile).GetMethod("Distance_cardinal"), false, 30, null, null, this.access_card);

                    if (!this.bot_move(this.target))
                    {
                        this.add_to_ignore(this.target);
                        this.target = null;
                        this.path   = new ByTable();
                        return(false);
                    }
                    this.v_mode = 9;
                }
                else if (!this.bot_move(this.target))
                {
                    this.target = null;
                    this.v_mode = 0;
                    return(false);
                }
            }

            if (Lang13.Bool(this.target) && this.loc == this.target.loc)
            {
                this.clean(this.target);
                this.path   = new ByTable();
                this.target = null;
            }
            this.oldloc = this.loc;
            return(false);
        }
Ejemplo n.º 20
0
        public bool toggle(  )
        {
            Mob        M          = null;
            ByTable    modes      = null;
            dynamic    switchMode = null;
            Ent_Static H          = null;

            M = Task13.User;

            if (M is Mob_Dead)
            {
                return(false);
            }

            if (!this.can_use(M))
            {
                return(false);
            }

            if (this.has_sensor >= 2)
            {
                Task13.User.WriteMsg("The controls are locked.");
                return(false);
            }

            if (this.has_sensor <= 0)
            {
                Task13.User.WriteMsg("This suit does not have any sensors.");
                return(false);
            }
            modes      = new ByTable(new object [] { "Off", "Binary vitals", "Exact vitals", "Tracking beacon" });
            switchMode = Interface13.Input("Select a sensor mode:", "Suit Sensor Mode", modes[this.sensor_mode + 1], null, modes, InputType.Any);

            if (Map13.GetDistance(Task13.User, this) > 1)
            {
                Task13.User.WriteMsg("<span class='warning'>You have moved too far away!</span>");
                return(false);
            }
            this.sensor_mode = modes.Find(switchMode) - 1;

            if (this.loc == Task13.User)
            {
                switch ((int)(this.sensor_mode))
                {
                case 0:
                    Task13.User.WriteMsg("<span class='notice'>You disable your suit's remote sensing equipment.</span>");
                    break;

                case 1:
                    Task13.User.WriteMsg("<span class='notice'>Your suit will now only report whether you are alive or dead.</span>");
                    break;

                case 2:
                    Task13.User.WriteMsg("<span class='notice'>Your suit will now only report your exact vital lifesigns.</span>");
                    break;

                case 3:
                    Task13.User.WriteMsg("<span class='notice'>Your suit will now report your exact vital lifesigns as well as your coordinate position.</span>");
                    break;
                }
            }

            if (this.loc is Mob_Living_Carbon_Human)
            {
                H = this.loc;

                if (((dynamic)H).w_uniform == this)
                {
                    ((dynamic)H).update_suit_sensors();
                }
            }
            Lang13.SuperCall();
            return(false);
        }
Ejemplo n.º 21
0
        // Function from file: spell.dm
        public void after_cast(dynamic targets = null)
        {
            Ent_Static target   = null;
            Ent_Static location = null;
            EffectSystem_SparkSpread          sparks = null;
            EffectSystem_SmokeSpread          smoke  = null;
            EffectSystem_SmokeSpread_Bad      smoke2 = null;
            EffectSystem_SmokeSpread_Sleeping smoke3 = null;


            foreach (dynamic _a in Lang13.Enumerate(targets, typeof(Ent_Static)))
            {
                target = _a;

                location = null;

                if (target is Mob_Living)
                {
                    location = target.loc;
                }
                else if (target is Tile)
                {
                    location = target;
                }

                if (target is Mob_Living && Lang13.Bool(this.message))
                {
                    ((dynamic)target).WriteMsg("" + this.message);
                }

                if (this.sparks_spread)
                {
                    sparks = new EffectSystem_SparkSpread();
                    sparks.set_up(this.sparks_amt, 0, location);
                    sparks.start();
                }

                if (this.smoke_spread != 0)
                {
                    if (this.smoke_spread == 1)
                    {
                        smoke = new EffectSystem_SmokeSpread();
                        smoke.set_up(this.smoke_amt, location);
                        smoke.start();
                    }
                    else if (this.smoke_spread == 2)
                    {
                        smoke2 = new EffectSystem_SmokeSpread_Bad();
                        smoke2.set_up(this.smoke_amt, location);
                        smoke2.start();
                    }
                    else if (this.smoke_spread == 3)
                    {
                        smoke3 = new EffectSystem_SmokeSpread_Sleeping();
                        smoke3.set_up(this.smoke_amt, location);
                        smoke3.start();
                    }
                }
            }
            return;
        }
Ejemplo n.º 22
0
 // Function from file: energy_ball.dm
 public override dynamic Bump(Ent_Static Obstacle = null, dynamic yes = null)
 {
     this.dust_mobs(Obstacle);
     return(null);
 }
Ejemplo n.º 23
0
        // Function from file: xenobiology.dm
        public virtual void timestop(  )
        {
            double              i  = 0;
            Ent_Static          A  = null;
            Ent_Static          M  = null;
            Ent_Static          H  = null;
            Ent_Static          P  = null;
            Mob_Living          M2 = null;
            Mob_Living          M3 = null;
            Obj_Item_Projectile P2 = null;

            GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/magic/TIMEPARADOX2.ogg", 100, 1, -1);

            foreach (dynamic _c in Lang13.IterateRange(1, this.duration - 1))
            {
                i = _c;


                foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(this.loc, this.freezerange), typeof(Ent_Static)))
                {
                    A = _a;


                    if (A is Mob_Living)
                    {
                        M = A;

                        if (this.immune.Contains(M))
                        {
                            continue;
                        }
                        ((dynamic)M).stunned  = 10;
                        ((dynamic)M).anchored = 1;

                        if (M is Mob_Living_SimpleAnimal_Hostile)
                        {
                            H = M;
                            ((dynamic)H).AIStatus = 3;
                            ((dynamic)H).LoseTarget();
                        }
                        this.stopped_atoms.Or(M);
                    }
                    else if (A is Obj_Item_Projectile)
                    {
                        P = A;
                        ((dynamic)P).paused = GlobalVars.TRUE;
                        this.stopped_atoms.Or(P);
                    }
                }

                foreach (dynamic _b in Lang13.Enumerate(this.stopped_atoms, typeof(Mob_Living)))
                {
                    M2 = _b;


                    if (Map13.GetDistance(GlobalFuncs.get_turf(M2), GlobalFuncs.get_turf(this)) > this.freezerange)
                    {
                        this.unfreeze_mob(M2);
                        this.stopped_atoms.Remove(M2);
                    }
                }
                Task13.Sleep(1);
            }

            foreach (dynamic _d in Lang13.Enumerate(this.stopped_atoms, typeof(Mob_Living)))
            {
                M3 = _d;

                this.unfreeze_mob(M3);
            }

            foreach (dynamic _e in Lang13.Enumerate(this.stopped_atoms, typeof(Obj_Item_Projectile)))
            {
                P2 = _e;

                P2.paused = GlobalVars.FALSE;
            }
            GlobalFuncs.qdel(this);
            return;
        }
Ejemplo n.º 24
0
        // Function from file: hydroponics.dm
        public override ByTable harvest(Mob user = null)
        {
            user = user ?? Task13.User;

            Ent_Static parent              = null;
            bool       make_podman         = false;
            dynamic    ckey_holder         = null;
            dynamic    M                   = null;
            dynamic    O                   = null;
            dynamic    M2                  = null;
            dynamic    O2                  = null;
            Mob_Living_Carbon_Human podman = null;
            int?seed_count                 = null;
            int?i = null;
            Obj_Item_Seeds_Replicapod harvestseeds = null;

            parent      = this.loc;
            make_podman = false;
            ckey_holder = null;

            if (Lang13.Bool(GlobalVars.config.revival_pod_plants))
            {
                if (Lang13.Bool(this.ckey))
                {
                    foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list))
                    {
                        M = _a;


                        if (M is Mob_Dead_Observer)
                        {
                            O = M;

                            if (O.ckey == this.ckey && O.can_reenter_corpse == true)
                            {
                                make_podman = true;
                                break;
                            }
                        }
                        else if (M.ckey == this.ckey && Convert.ToInt32(M.stat) == 2 && !Lang13.Bool(M.suiciding))
                        {
                            make_podman = true;
                            break;
                        }
                    }
                }
                else
                {
                    foreach (dynamic _b in Lang13.Enumerate(GlobalVars.player_list))
                    {
                        M2 = _b;


                        if (this.mind != null && Lang13.Bool(M2.mind) && String13.CKey(M2.mind.key) == String13.CKey(this.mind.key) && Lang13.Bool(M2.ckey) && Lang13.Bool(M2.client) && Convert.ToInt32(M2.stat) == 2 && !Lang13.Bool(M2.suiciding))
                        {
                            if (M2 is Mob_Dead_Observer)
                            {
                                O2 = M2;

                                if (!(O2.can_reenter_corpse == true))
                                {
                                    break;
                                }
                            }
                            make_podman = true;
                            ckey_holder = M2.ckey;
                            break;
                        }
                    }
                }
            }

            if (make_podman)
            {
                podman = new Mob_Living_Carbon_Human(parent.loc);

                if (Lang13.Bool(this.realName))
                {
                    podman.real_name = this.realName;
                }
                else
                {
                    podman.real_name = "Pod Person " + Rand13.Int(0, 999);
                }
                this.mind.transfer_to(podman);

                if (Lang13.Bool(this.ckey))
                {
                    podman.ckey = this.ckey;
                }
                else
                {
                    podman.ckey = ckey_holder;
                }
                podman.gender   = this.blood_gender;
                podman.faction |= this.factions;

                if (!Lang13.Bool(this.features["mcolor"]))
                {
                    this.features["mcolor"] = "#59CE00";
                }
                podman.hardset_dna(null, null, podman.real_name, this.blood_type, typeof(Species_Pod), this.features);
                podman.set_cloned_appearance();
            }
            else
            {
                seed_count = 1;

                if (Rand13.PercentChance(((int)(this.getYield() * 20))))
                {
                    seed_count++;
                }
                i = null;
                i = 0;

                while ((i ?? 0) < (seed_count ?? 0))
                {
                    harvestseeds            = new Obj_Item_Seeds_Replicapod(user.loc);
                    harvestseeds.lifespan   = this.lifespan;
                    harvestseeds.endurance  = this.endurance;
                    harvestseeds.maturation = this.maturation;
                    harvestseeds.production = this.production;
                    harvestseeds.yield      = this.yield;
                    harvestseeds.potency    = this.potency;
                    i++;
                }
            }
            ((dynamic)parent).update_tray();
            return(null);
        }
Ejemplo n.º 25
0
 // Function from file: particle.dm
 public void toxmob(Ent_Static M = null)
 {
     M.rad_act(this.energy * 6);
     ((Mob_Living)M).updatehealth();
     return;
 }
Ejemplo n.º 26
0
        // Function from file: alien_infestation.dm
        public bool get_alien(bool?end_if_fail = null)
        {
            end_if_fail = end_if_fail ?? false;

            ByTable vents = null;
            Obj_Machinery_Atmospherics_Components_Unary_VentPump temp_vent = null;
            Pipeline   temp_vent_parent = null;
            ByTable    candidates       = null;
            Ent_Static vent             = null;
            dynamic    C = null;
            Mob_Living_Carbon_Alien_Larva new_xeno = null;

            vents = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Atmospherics_Components_Unary_VentPump)))
            {
                temp_vent = _a;


                if (Lang13.Bool(GlobalFuncs.qdeleted(temp_vent)))
                {
                    continue;
                }

                if (temp_vent.loc.z == 1 && !(temp_vent.welded == true))
                {
                    temp_vent_parent = temp_vent.parents[1];

                    if (temp_vent_parent.other_atmosmch.len > 20)
                    {
                        vents.Add(temp_vent);
                    }
                }
            }

            if (!(vents.len != 0))
            {
                GlobalFuncs.message_admins("An event attempted to spawn an alien but no suitable vents were found. Shutting down.");
                this.kill(); return(false);
            }
            candidates = GlobalFuncs.get_candidates("xenomorph", GlobalVars.ALIEN_AFK_BRACKET, "alien candidate");

            if (!(candidates.len != 0))
            {
                if (end_if_fail == true)
                {
                    return(false);
                }
                this.find_alien(); return(false);
            }

            while (this.spawncount > 0 && vents.len != 0 && candidates.len != 0)
            {
                vent         = GlobalFuncs.pick_n_take(vents);
                C            = GlobalFuncs.pick_n_take(candidates);
                new_xeno     = new Mob_Living_Carbon_Alien_Larva(vent.loc);
                new_xeno.key = C.key;
                this.spawncount--;
                this.successSpawn = true;
                GlobalFuncs.message_admins("" + new_xeno.key + " has been made into an alien by an event.");
                GlobalFuncs.log_game("" + new_xeno.key + " was spawned as an alien by an event.");
            }

            if (this.successSpawn)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 27
0
        // Function from file: cable.dm
        public void cable_join(Obj_Structure_Cable C = null, dynamic user = null)
        {
            Ent_Static          U     = null;
            Ent_Static          T     = null;
            double?             dirn  = null;
            double?             fdirn = null;
            Obj_Structure_Cable LC    = null;
            dynamic             NC    = null;
            Powernet            newPN = null;
            double?             nd1   = null;
            double?             nd2   = null;
            Obj_Structure_Cable LC2   = null;

            U = user.loc;

            if (!(U is Tile))
            {
                return;
            }
            T = C.loc;

            if (!(T is Tile) || Lang13.Bool(((dynamic)T).intact))
            {
                return;
            }

            if (Map13.GetDistance(C, user) > 1)
            {
                user.WriteMsg("<span class='warning'>You can't lay cable at a place that far away!</span>");
                return;
            }

            if (U == T)
            {
                this.place_turf(T, user);
                return;
            }
            dirn = Map13.GetDistance(C, user);

            if (C.d1 == dirn || C.d2 == dirn)
            {
                if (!Lang13.Bool(((dynamic)U).can_have_cabling()))
                {
                    user.WriteMsg("<span class='warning'>You can only lay cables on catwalks and plating!</span>");
                    return;
                }

                if (Lang13.Bool(((dynamic)U).intact))
                {
                    user.WriteMsg("<span class='warning'>You can't lay cable there unless the floor tiles are removed!</span>");
                    return;
                }
                else
                {
                    fdirn = Num13.Rotate(dirn, 180);

                    foreach (dynamic _a in Lang13.Enumerate(U, typeof(Obj_Structure_Cable)))
                    {
                        LC = _a;


                        if (LC.d1 == fdirn || LC.d2 == fdirn)
                        {
                            user.WriteMsg("<span class='warning'>There's already a cable at that position!</span>");
                            return;
                        }
                    }
                    NC    = this.get_new_cable(U);
                    NC.d1 = 0;
                    NC.d2 = fdirn;
                    ((Ent_Static)NC).add_fingerprint();
                    NC.updateicon();
                    newPN = new Powernet();
                    newPN.add_cable(NC);
                    ((Obj_Structure_Cable)NC).mergeConnectedNetworks(NC.d2);
                    ((Obj_Structure_Cable)NC).mergeConnectedNetworksOnTurf();

                    if ((((int)(NC.d2 ?? 0)) & ((int)((NC.d2 ?? 0) - 1))) != 0)
                    {
                        ((Obj_Structure_Cable)NC).mergeDiagonalsNetworks(NC.d2);
                    }
                    this.use(1);

                    if (((Obj_Structure_Cable)NC).shock(user, 50))
                    {
                        if (Rand13.PercentChance(50))
                        {
                            ((Obj)NC).Deconstruct();
                        }
                    }
                    return;
                }
            }
            else if (C.d1 == 0)
            {
                nd1 = C.d2;
                nd2 = dirn;

                if ((nd1 ?? 0) > (nd2 ?? 0))
                {
                    nd1 = dirn;
                    nd2 = C.d2;
                }

                foreach (dynamic _b in Lang13.Enumerate(T, typeof(Obj_Structure_Cable)))
                {
                    LC2 = _b;


                    if (LC2 == C)
                    {
                        continue;
                    }

                    if (LC2.d1 == nd1 && LC2.d2 == nd2 || LC2.d1 == nd2 && LC2.d2 == nd1)
                    {
                        user.WriteMsg("<span class='warning'>There's already a cable at that position!</span>");
                        return;
                    }
                }
                C.cableColor(this.item_color);
                C.d1 = nd1;
                C.d2 = nd2;
                C.update_stored(2, this.item_color);
                C.add_fingerprint();
                C.updateicon();
                C.mergeConnectedNetworks(C.d1);
                C.mergeConnectedNetworks(C.d2);
                C.mergeConnectedNetworksOnTurf();

                if ((((int)(C.d1 ?? 0)) & ((int)((C.d1 ?? 0) - 1))) != 0)
                {
                    C.mergeDiagonalsNetworks(C.d1);
                }

                if ((((int)(C.d2 ?? 0)) & ((int)((C.d2 ?? 0) - 1))) != 0)
                {
                    C.mergeDiagonalsNetworks(C.d2);
                }
                this.use(1);

                if (C.shock(user, 50))
                {
                    if (Rand13.PercentChance(50))
                    {
                        C.Deconstruct();
                        return;
                    }
                }
                C.denode();
                return;
            }
            return;
        }
Ejemplo n.º 28
0
        // Function from file: singularity.dm
        public bool check_turfs_in(int?direction = null, int?step = null)
        {
            direction = direction ?? 0;
            step      = step ?? 0;

            int?       steps = null;
            ByTable    turfs = null;
            Ent_Static T     = null;
            double     i     = 0;
            int        dir2  = 0;
            int        dir3  = 0;
            Ent_Static T2    = null;
            double     j     = 0;
            double     k     = 0;
            dynamic    T3    = null;


            if (!Lang13.Bool(direction))
            {
                return(false);
            }
            steps = 0;

            if (!Lang13.Bool(step))
            {
                switch ((int?)(this.current_size))
                {
                case 1:
                    steps = 1;
                    break;

                case 3:
                    steps = 3;
                    break;

                case 5:
                    steps = 3;
                    break;

                case 7:
                    steps = 4;
                    break;

                case 9:
                    steps = 5;
                    break;
                }
            }
            else
            {
                steps = step;
            }
            turfs = new ByTable();
            T     = this.loc;

            foreach (dynamic _b in Lang13.IterateRange(1, steps))
            {
                i = _b;

                T = Map13.GetStep(T, direction ?? 0);
            }

            if (!(T is Tile))
            {
                return(false);
            }
            turfs.Add(T);
            dir2 = 0;
            dir3 = 0;

            switch ((int?)(direction))
            {
            case 1:
                dir2 = 4;
                dir3 = 8;
                break;

            case 4:
                dir2 = 1;
                dir3 = 2;
                break;
            }
            T2 = T;

            foreach (dynamic _d in Lang13.IterateRange(1, (steps ?? 0) - 1))
            {
                j = _d;

                T2 = Map13.GetStep(T2, dir2);

                if (!(T2 is Tile))
                {
                    return(false);
                }
                turfs.Add(T2);
            }

            foreach (dynamic _e in Lang13.IterateRange(1, (steps ?? 0) - 1))
            {
                k = _e;

                T = Map13.GetStep(T, dir3);

                if (!(T is Tile))
                {
                    return(false);
                }
                turfs.Add(T);
            }

            foreach (dynamic _f in Lang13.Enumerate(turfs))
            {
                T3 = _f;


                if (T3 == null)
                {
                    continue;
                }

                if (!this.can_move(T3))
                {
                    return(false);
                }
            }
            return(true);
        }
Ejemplo n.º 29
0
 public bool _internal_Moved(Ent_Static OldLoc = null, int?Dir = null)
 {
     return(true);
 }
Ejemplo n.º 30
0
 // Function from file: mutations.dm
 public override void on_ranged_attack(Mob_Living_Carbon_Human owner = null, Ent_Static target = null)
 {
     target.attack_tk(owner);
     return;
 }