// Function from file: teleprod.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            Obj_Item_Weapon_Melee_Baton_Cattleprod S = null;
            dynamic floorloc = null;


            if (Lang13.Bool(this.bcell) && Convert.ToDouble(this.bcell.charge) > (this.hitcost ?? 0))
            {
                this.status = !this.status;
                user.WriteMsg("<span class='notice'>" + this + " is now " + (this.status ? "on" : "off") + ".</span>");
                GlobalFuncs.playsound(this.loc, "sparks", 75, 1, -1);
            }
            else
            {
                this.status = false;

                if (!Lang13.Bool(this.bcell))
                {
                    S = new Obj_Item_Weapon_Melee_Baton_Cattleprod();

                    if (!this.remove_item_from_storage(user))
                    {
                        ((Mob)user).unEquip(this);
                    }
                    floorloc = GlobalFuncs.get_turf(user);
                    floorloc.contents.Add(this.contents);
                    ((Mob)user).unEquip(flag);
                    ((Mob)user).put_in_hands(S);
                    user.WriteMsg("<span class='notice'>You carefully remove the bluespace crystal from the teleprod.</span>");
                    GlobalFuncs.qdel(flag);
                    GlobalFuncs.qdel(this);
                }
                else
                {
                    user.WriteMsg("<span class='warning'>" + this + " is out of charge.</span>");
                }
            }
            this.update_icon();
            this.add_fingerprint(user);
            return(null);
        }
Ejemplo n.º 2
0
        // Function from file: weaponry.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            Obj_Item_Weapon_Twohanded_Spear        S = null;
            Obj_Item_Weapon_Melee_Baton_Cattleprod P = null;

            base.attackby((object)(A), (object)(user), _params, silent, replace_spent);

            if (A is Obj_Item_Weapon_Shard)
            {
                S = new Obj_Item_Weapon_Twohanded_Spear();

                if (!this.remove_item_from_storage(user))
                {
                    ((Mob)user).unEquip(this);
                }
                ((Mob)user).unEquip(A);
                ((Mob)user).put_in_hands(S);
                user.WriteMsg("<span class='notice'>You fasten the glass shard to the top of the rod with the cable.</span>");
                GlobalFuncs.qdel(A);
                GlobalFuncs.qdel(this);
            }
            else if (A is Obj_Item_Device_Assembly_Igniter && !Lang13.Bool(A.flags & 2))
            {
                P = new Obj_Item_Weapon_Melee_Baton_Cattleprod();

                if (!this.remove_item_from_storage(user))
                {
                    ((Mob)user).unEquip(this);
                }
                ((Mob)user).unEquip(A);
                ((Mob)user).put_in_hands(P);
                user.WriteMsg("<span class='notice'>You fasten " + A + " to the top of the rod with the cable.</span>");
                GlobalFuncs.qdel(A);
                GlobalFuncs.qdel(this);
            }
            return(null);
        }