Exemple #1
0
 // Function from file: explosive.dm
 public Wires_Explosive_Pizza(Obj_Item_Pizzabox holder = null) : base(holder)
 {
     this.wires = new ByTable(new object [] { "disarm" });
     this.add_duds(3);
     // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
     return;
 }
Exemple #2
0
        // Function from file: pizzabox.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic           newbox = null;
            ByTable           add    = null;
            Obj_Item_Pizzabox box    = null;


            if (A is Obj_Item_Pizzabox)
            {
                newbox = A;

                if (!this.open && !Lang13.Bool(newbox.open))
                {
                    add = new ByTable();
                    add.Add(newbox);
                    add.Add(newbox.boxes);

                    if (this.boxes.len + add.len + 1 <= 5)
                    {
                        if (!Lang13.Bool(user.drop_item()))
                        {
                            return(null);
                        }
                        this.boxes.Add(add);
                        newbox.boxes.Cut();
                        newbox.loc = this;
                        user.WriteMsg("<span class='notice'>You put " + newbox + " on top of " + this + "!</span>");
                        newbox.update_icon();
                        this.update_icon();
                        return(null);
                    }
                    else
                    {
                        user.WriteMsg("<span class='notice'>The stack is dangerously high!</span>");
                    }
                }
                else
                {
                    user.WriteMsg("<span class='notice'>Close " + (this.open ? ((dynamic)(this)) : newbox) + " first!</span>");
                }
            }
            else if (A is Obj_Item_Weapon_ReagentContainers_Food_Snacks_Pizza || A is Obj_Item_Weapon_ReagentContainers_Food_Snacks_Customizable_Pizza)
            {
                if (this.open)
                {
                    if (!Lang13.Bool(user.drop_item()))
                    {
                        return(null);
                    }
                    this.pizza = A;
                    A.loc      = this;
                    user.WriteMsg("<span class='notice'>You put " + A + " in " + this + ".</span>");
                    this.update_icon();
                    return(null);
                }
            }
            else if (A is Obj_Item_Weapon_Bombcore_Pizza)
            {
                if (this.open && !Lang13.Bool(this.bomb))
                {
                    if (!Lang13.Bool(user.drop_item()))
                    {
                        return(null);
                    }
                    this.wires = new Wires_Explosive_Pizza(this);
                    this.bomb  = A;
                    A.loc      = this;
                    user.WriteMsg("<span class='notice'>You put " + A + " in " + this + ". Sneeki breeki...</span>");
                    this.update_icon();
                    return(null);
                }
                else if (Lang13.Bool(this.bomb))
                {
                    user.WriteMsg("<span class='notice'>" + this + " already has a bomb in it!</span>");
                }
            }
            else if (A is Obj_Item_Weapon_Pen)
            {
                if (!this.open)
                {
                    box         = (this.boxes.len != 0 ? this.boxes[this.boxes.len] : this);
                    box.boxtag += GlobalFuncs.stripped_input(user, "Write on " + box + "'s tag:", box, "", 30);
                    user.WriteMsg("<span class='notice'>You write with " + A + " on " + this + ".</span>");
                    this.update_icon();
                    return(null);
                }
            }
            else if (Lang13.Bool(GlobalFuncs.is_wire_tool(A)))
            {
                if (Lang13.Bool(this.wires) && Lang13.Bool(this.bomb))
                {
                    this.wires.interact(user);
                }
            }
            else if (A is Obj_Item_Weapon_ReagentContainers_Food)
            {
                user.WriteMsg("<span class='notice'>That's not a pizza!</span>");
            }
            base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            return(null);
        }
Exemple #3
0
        // Function from file: pizzabox.dm
        public override bool update_icon(dynamic new_state = null, dynamic new_icon = null, int?new_px = null, int?new_py = null)
        {
            Obj_Item_Pizzabox box      = null;
            Image             pizzaimg = null;
            Image             bombimg  = null;
            Obj_Item_Pizzabox box2     = null;
            Image             tagimg   = null;

            this.desc = Lang13.Initial(this, "desc");

            if (this.open)
            {
                if (Lang13.Bool(this.pizza))
                {
                    this.desc = new Txt().item(this.desc).str(" It appears to have ").a(this.pizza).item().str(" inside.").ToString();
                }

                if (Lang13.Bool(this.bomb))
                {
                    this.desc = new Txt().item(this.desc).str(" Wait, what?! It has ").a(this.bomb).item().str(" inside!").ToString();

                    if (Lang13.Bool(this.bomb_defused))
                    {
                        this.desc = "" + this.desc + " The bomb seems inert.";
                    }

                    if (Lang13.Bool(this.bomb_active))
                    {
                        this.desc = "" + this.desc + " It looks like its about to go off!";
                    }
                }
            }
            else
            {
                box = (this.boxes.len != 0 ? this.boxes[this.boxes.len] : this);

                if (this.boxes.len != 0)
                {
                    this.desc = "A pile of boxes suited for pizzas. There appears to be " + (this.boxes.len + 1) + " boxes in the pile.";
                }

                if (box.boxtag != "")
                {
                    this.desc = "" + this.desc + " The " + (this.boxes.len != 0 ? "top box" : "box") + "'s tag reads: " + box.boxtag;
                }
            }
            this.overlays.Cut();

            if (this.open)
            {
                this.icon_state = "pizzabox_open";

                if (Lang13.Bool(this.pizza))
                {
                    this.icon_state  = "pizzabox_messy";
                    pizzaimg         = new Image(this.pizza.icon, null, this.pizza.icon_state);
                    pizzaimg.pixel_y = -3;
                    this.overlays.Add(pizzaimg);
                }

                if (Lang13.Bool(this.bomb))
                {
                    this.bomb.icon_state = "pizzabomb_" + (Lang13.Bool(this.bomb_active) ? "active" : "inactive");
                    bombimg         = new Image(this.bomb.icon, null, this.bomb.icon_state);
                    bombimg.pixel_y = 5;
                    this.overlays.Add(bombimg);
                }
            }
            else
            {
                this.icon_state = "pizzabox" + (this.boxes.len + 1);
                box2            = (this.boxes.len != 0 ? this.boxes[this.boxes.len] : this);

                if (box2.boxtag != "")
                {
                    tagimg         = new Image(this.icon, null, "pizzabox_tag");
                    tagimg.pixel_y = this.boxes.len * 3;
                    this.overlays.Add(tagimg);
                }
            }
            return(false);
        }