示例#1
0
        // Function from file: growninedible.dm
        public override bool pickup(dynamic user = null)
        {
            dynamic             C         = null;
            dynamic             H         = null;
            string              organ     = null;
            Obj_Item_Organ_Limb affecting = null;


            if (!(user is Mob_Living_Carbon))
            {
                return(false);
            }
            C = user;

            if (user is Mob_Living_Carbon_Human)
            {
                H = C;

                if (Lang13.Bool(H.gloves))
                {
                    return(false);
                }
                organ     = (H.hand ? "l_" : "r_") + "arm";
                affecting = ((Mob_Living_Carbon_Human)H).get_organ(organ);

                if (affecting.take_damage(0, this.force))
                {
                    ((Mob_Living)H).update_damage_overlays(  );
                }
            }
            else
            {
                ((Mob_Living)C).take_organ_damage(0, this.force);
            }
            C.WriteMsg("<span class='userdanger'>The nettle burns your bare hand!</span>");
            return(true);
        }
示例#2
0
        // Function from file: items.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            dynamic             H         = null;
            Obj_Item_Organ_Limb affecting = null;
            Ent_Static          S         = null;


            if (!Lang13.Bool(a))
            {
                return(null);
            }

            if (Lang13.Bool(this.anchored))
            {
                return(null);
            }

            if (this.burn_state == 1)
            {
                H = a;

                if (H is Mob_Living_Carbon_Human)
                {
                    if (Lang13.Bool(H.gloves) && (H.gloves.max_heat_protection_temperature ?? 0) > 360)
                    {
                        this.extinguish();
                        a.WriteMsg("<span class='notice'>You put out the fire on " + this + ".</span>");
                    }
                    else
                    {
                        a.WriteMsg("<span class='warning'>You burn your hand on " + this + "!</span>");
                        affecting = ((Mob_Living_Carbon_Human)H).get_organ("" + (a.hand ? "l" : "r") + "_arm");

                        if (affecting.take_damage(0, 5))
                        {
                            ((Mob_Living)H).update_damage_overlays(  );
                        }
                        ((Mob_Living)H).updatehealth();
                        return(null);
                    }
                }
                else
                {
                    this.extinguish();
                }
            }

            if (this.loc is Obj_Item_Weapon_Storage)
            {
                S = this.loc;
                ((dynamic)S).remove_from_storage(this, a.loc);
            }
            this.throwing = false;

            if (this.loc == a)
            {
                if (!((Mob)a).unEquip(this))
                {
                    return(null);
                }
            }
            this.pickup(a);
            this.add_fingerprint(a);

            if (!((Mob)a).put_in_active_hand(this))
            {
                this.dropped(a);
            }
            return(null);
        }
示例#3
0
        // Function from file: lighting.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            bool                prot      = false;
            dynamic             H         = null;
            Obj_Item            G         = null;
            Obj_Item_Organ_Limb affecting = null;
            dynamic             L         = null;

            ((Mob)a).changeNext_move(8);
            this.add_fingerprint(a);

            if (this.status == 1)
            {
                a.WriteMsg("There is no " + this.fitting + " in this light.");
                return(null);
            }

            if (this.on)
            {
                prot = false;
                H    = a;

                if (H is Mob_Living_Carbon_Human)
                {
                    if (Lang13.Bool(H.gloves))
                    {
                        G = H.gloves;

                        if (Lang13.Bool(G.max_heat_protection_temperature))
                        {
                            prot = (G.max_heat_protection_temperature ?? 0) > 360;
                        }
                    }
                }
                else
                {
                    prot = true;
                }

                if ((prot ?1:0) > 0)
                {
                    a.WriteMsg("<span class='notice'>You remove the light " + this.fitting + ".</span>");
                }
                else if (a is Mob_Living_Carbon_Human && ((Dna)a.dna).check_mutation("Telekinesis") != 0)
                {
                    a.WriteMsg("<span class='notice'>You telekinetically remove the light " + this.fitting + ".</span>");
                }
                else
                {
                    a.WriteMsg("<span class='warning'>You try to remove the light " + this.fitting + ", but you burn your hand on it!</span>");
                    affecting = ((Mob_Living_Carbon_Human)H).get_organ("" + (a.hand ? "l" : "r") + "_arm");

                    if (affecting.take_damage(0, 5))
                    {
                        ((Mob_Living)H).update_damage_overlays(  );
                    }
                    ((Mob_Living)H).updatehealth();
                    return(null);
                }
            }
            else
            {
                a.WriteMsg("<span class='notice'>You remove the light " + this.fitting + ".</span>");
            }
            L                = Lang13.Call(this.light_type);
            L.status         = this.status;
            L.rigged         = this.rigged;
            L.brightness     = this.brightness;
            L.switchcount    = this.switchcount;
            this.switchcount = 0;
            L.update();
            ((Ent_Static)L).add_fingerprint(a);
            L.loc = this.loc;
            ((Mob)a).put_in_active_hand(L);
            this.status = 1;
            this.update();
            return(null);
        }
示例#4
0
        // Function from file: mousetrap.dm
        public bool triggered(dynamic target = null, string type = null)
        {
            type = type ?? "feet";

            Obj_Item_Organ_Limb affecting = null;
            dynamic             H         = null;
            dynamic             M         = null;


            if (!this.armed)
            {
                return(false);
            }
            affecting = null;

            if (target is Mob_Living_Carbon_Human)
            {
                H = target;

                if (H.dna.species.specflags.Contains(8192))
                {
                    GlobalFuncs.playsound(this.loc, "sound/effects/snap.ogg", 50, 1);
                    this.armed = false;
                    this.update_icon();
                    this.pulse(false);
                    return(false);
                }

                switch ((string)(type))
                {
                case "feet":

                    if (!Lang13.Bool(H.shoes))
                    {
                        affecting = ((Mob_Living_Carbon_Human)H).get_organ(Rand13.Pick(new object [] { "l_leg", "r_leg" }));
                        ((Mob)H).Weaken(3);
                    }
                    break;

                case "l_hand":
                case "r_hand":

                    if (!Lang13.Bool(H.gloves))
                    {
                        affecting = ((Mob_Living_Carbon_Human)H).get_organ(type);
                        ((Mob)H).Stun(3);
                    }
                    break;
                }

                if (affecting != null)
                {
                    if (affecting.take_damage(1, 0))
                    {
                        ((Mob_Living)H).update_damage_overlays(  );
                    }
                    ((Mob_Living)H).updatehealth();
                }
            }
            else if (target is Mob_Living_SimpleAnimal_Mouse)
            {
                M = target;
                this.visible_message("<span class='boldannounce'>SPLAT!</span>");
                ((Mob_Living_SimpleAnimal_Mouse)M).splat();
            }
            GlobalFuncs.playsound(this.loc, "sound/effects/snap.ogg", 50, 1);
            this.armed = false;
            this.update_icon();
            this.pulse(false);
            return(false);
        }