// Function from file: suit.dm
        public bool lock_suit(dynamic H = null, bool?checkIcons = null)
        {
            checkIcons = checkIcons ?? false;


            if (!(H is Mob_Living_Carbon_Human))
            {
                return(false);
            }

            if (checkIcons == true)
            {
                this.icon_state     = (H.gender == GlobalVars.FEMALE ? "s-ninjanf" : "s-ninjan");
                H.gloves.icon_state = "s-ninjan";
                H.gloves.item_state = "s-ninjan";
            }
            else
            {
                if (H.mind.special_role != "Space Ninja")
                {
                    H.WriteMsg("ÿ<B>fÄTaL ÈÈRRoR</B>: 382200-*#00CÖDE <B>RED</B>\nUNAU†HORIZED USÈ DETÈC†††eD\nCoMMÈNCING SUB-R0U†IN3 13...\nTÈRMInATING U-U-USÈR...");
                    ((Mob)H).gib();
                    return(false);
                }

                if (!(H.head is Obj_Item_Clothing_Head_Helmet_Space_SpaceNinja))
                {
                    H.WriteMsg("<span class='userdanger'>ERROR</span>: 100113 UNABLE TO LOCATE HEAD GEAR\nABORTING...");
                    return(false);
                }

                if (!(H.shoes is Obj_Item_Clothing_Shoes_SpaceNinja))
                {
                    H.WriteMsg("<span class='userdanger'>ERROR</span>: 122011 UNABLE TO LOCATE FOOT GEAR\nABORTING...");
                    return(false);
                }

                if (!(H.gloves is Obj_Item_Clothing_Gloves_SpaceNinja))
                {
                    H.WriteMsg("<span class='userdanger'>ERROR</span>: 110223 UNABLE TO LOCATE HAND GEAR\nABORTING...");
                    return(false);
                }
                this.affecting      = H;
                this.flags         |= 2;
                this.slowdown       = 0;
                this.n_hood         = H.head;
                this.n_hood.flags  |= 2;
                this.n_shoes        = H.shoes;
                this.n_shoes.flags |= 2;
                this.n_shoes.slowdown--;
                this.n_gloves        = H.gloves;
                this.n_gloves.flags |= 2;
            }
            return(true);
        }
Ejemplo n.º 2
0
        // Function from file: ninjaDrainAct.dm
        public override dynamic ninjadrain_act(Obj_Item_Clothing_Suit_Space_SpaceNinja S = null, Ent_Static H = null, Obj_Item_Clothing_Gloves_SpaceNinja G = null)
        {
            dynamic _default = null;

            dynamic location         = null;
            Mob_Living_Silicon_Ai AI = null;
            Tech current_data        = null;
            Tech analyzing_data      = null;


            if (!(S != null) || !(H != null) || !(G != null))
            {
                return("INVALID");
            }
            _default = "RDHACKFAIL";
            ((dynamic)H).WriteMsg(new Txt("<span class='notice'>Hacking ").the(this).item().str("...</span>").ToString());
            Task13.Schedule(0, (Task13.Closure)(() => {
                location = GlobalFuncs.get_turf(H);

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Silicon_Ai)))
                {
                    AI = _a;

                    AI.WriteMsg("<span class='userdanger'>Network Alert: Hacking attempt detected" + (Lang13.Bool(location) ? " in " + location : ". Unable to pinpoint location") + "</span>.");
                }
                return;
            }));

            if (this.files != null && this.files.known_tech.len != 0)
            {
                foreach (dynamic _c in Lang13.Enumerate(S.stored_research, typeof(Tech)))
                {
                    current_data = _c;

                    ((dynamic)H).WriteMsg(new Txt("<span class='notice'>Checking ").the(current_data.name).item().str(" database.</span>").ToString());

                    if (GlobalFuncs.do_after(H, S.s_delay, null, this) && G.candrain && this != null)
                    {
                        foreach (dynamic _b in Lang13.Enumerate(this.files.known_tech, typeof(Tech)))
                        {
                            analyzing_data = _b;


                            if (current_data.id == analyzing_data.id)
                            {
                                if (analyzing_data.level > current_data.level)
                                {
                                    ((dynamic)H).WriteMsg("<span class='notice'>Database:</span> <b>UPDATED</b>.");
                                    current_data.level = analyzing_data.level;
                                    _default           = "RDHACK";
                                }
                                break;
                            }
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
            ((dynamic)H).WriteMsg("<span class='notice'>Data analyzed. Process finished.</span>");
            return(_default);
        }
Ejemplo n.º 3
0
        // Function from file: ninjaDrainAct.dm
        public override dynamic ninjadrain_act(Obj_Item_Clothing_Suit_Space_SpaceNinja S = null, Ent_Static H = null, Obj_Item_Clothing_Gloves_SpaceNinja G = null)
        {
            dynamic _default = null;

            bool   maxcapacity = false;
            double drain       = 0;
            EffectSystem_SparkSpread spark_system = null;


            if (!(S != null) || !(H != null) || !(G != null))
            {
                return("INVALID");
            }
            maxcapacity = false;
            drain       = 0;
            _default    = 0;

            if (this.charge != 0)
            {
                spark_system = new EffectSystem_SparkSpread();
                spark_system.set_up(5, 0, this.loc);

                while (G.candrain && this.charge > 0 && !maxcapacity)
                {
                    drain = Rand13.Int(G.mindrain, G.maxdrain);

                    if (this.charge < drain)
                    {
                        drain = this.charge;
                    }

                    if (Convert.ToDouble(S.cell.charge + drain) > (S.cell.maxcharge ?? 0))
                    {
                        drain       = (S.cell.maxcharge ?? 0) - Convert.ToDouble(S.cell.charge);
                        maxcapacity = true;
                    }

                    if (GlobalFuncs.do_after(H, 10, null, this))
                    {
                        spark_system.start();
                        GlobalFuncs.playsound(this.loc, "sparks", 50, 1);
                        this.charge   -= drain;
                        S.cell.charge += drain;
                        _default      += drain;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            return(_default);
        }
Ejemplo n.º 4
0
        // Function from file: ninjaDrainAct.dm
        public override dynamic ninjadrain_act(Obj_Item_Clothing_Suit_Space_SpaceNinja S = null, Ent_Static H = null, Obj_Item_Clothing_Gloves_SpaceNinja G = null)
        {
            dynamic _default = null;

            bool     maxcapacity            = false;
            int      drain                  = 0;
            Powernet PN                     = null;
            int      drained                = 0;
            Obj_Machinery_Power_Terminal T  = null;
            Obj_Machinery_Power          AP = null;


            if (!(S != null) || !(H != null) || !(G != null))
            {
                return("INVALID");
            }
            maxcapacity = false;
            drain       = 0;
            _default    = 0;
            PN          = this.powernet;

            while (G.candrain && !maxcapacity && this != null)
            {
                drain   = Num13.Floor(Rand13.Int(G.mindrain, G.maxdrain) / 2);
                drained = 0;

                if (PN != null && GlobalFuncs.do_after(H, 10, null, this))
                {
                    drained  = Num13.MinInt(drain, ((int)(PN.avail)));
                    PN.load += drained;

                    if (drained < drain)
                    {
                        foreach (dynamic _a in Lang13.Enumerate(PN.nodes, typeof(Obj_Machinery_Power_Terminal)))
                        {
                            T = _a;


                            if (T.master is Obj_Machinery_Power_Apc)
                            {
                                AP = T.master;

                                if (Lang13.Bool(((dynamic)AP).operating) && Lang13.Bool(((dynamic)AP).cell) && Convert.ToDouble(((dynamic)AP).cell.charge) > 0)
                                {
                                    ((dynamic)AP).cell.charge = Num13.MaxInt(0, Convert.ToInt32(((dynamic)AP).cell.charge - 5));
                                    drained += 5;
                                }
                            }
                        }
                    }
                }
                else
                {
                    break;
                }
                S.cell.charge += drained;

                if (Convert.ToDouble(S.cell.charge) > (S.cell.maxcharge ?? 0))
                {
                    _default     += drained - Convert.ToDouble(S.cell.charge - S.cell.maxcharge);
                    S.cell.charge = S.cell.maxcharge;
                    maxcapacity   = true;
                }
                else
                {
                    _default += drained;
                }
                S.spark_system.start();
            }
            return(_default);
        }
Ejemplo n.º 5
0
        // Function from file: ninjaDrainAct.dm
        public override dynamic ninjadrain_act(Obj_Item_Clothing_Suit_Space_SpaceNinja S = null, Ent_Static H = null, Obj_Item_Clothing_Gloves_SpaceNinja G = null)
        {
            dynamic _default = null;


            if (!(S != null) || !(H != null) || !(G != null))
            {
                return("INVALID");
            }
            _default = 0;

            if (Lang13.Bool(this.charge))
            {
                if (G.candrain && GlobalFuncs.do_after(H, 30, null, this))
                {
                    _default = this.charge;

                    if (Convert.ToDouble(S.cell.charge + this.charge) > (S.cell.maxcharge ?? 0))
                    {
                        S.cell.charge = S.cell.maxcharge;
                    }
                    else
                    {
                        S.cell.charge += this.charge;
                    }
                    this.charge = 0;
                    this.corrupt();
                    this.updateicon();
                }
            }
            return(_default);
        }