// Function from file: book.dm
        public void bless(dynamic M = null)
        {
            dynamic             H         = null;
            double              heal_amt  = 0;
            Obj_Item_Organ_Limb affecting = null;


            if (M is Mob_Living_Carbon_Human)
            {
                H        = M;
                heal_amt = 10;

                foreach (dynamic _a in Lang13.Enumerate(H.organs, typeof(Obj_Item_Organ_Limb)))
                {
                    affecting = _a;


                    if (affecting.status == 1)
                    {
                        if (affecting.heal_damage(heal_amt, heal_amt, false))
                        {
                            ((Mob_Living)H).update_damage_overlays(  );
                        }
                    }
                }
            }
            return;
        }
Ejemplo n.º 2
0
        // Function from file: cable.dm
        public override bool attack(dynamic M = null, dynamic user = null, bool?def_zone = null)
        {
            Obj_Item_Organ_Limb affecting = null;


            if (!(M is Mob_Living_Carbon_Human))
            {
                return(base.attack((object)(M), (object)(user), def_zone));
            }
            affecting = ((Mob_Living_Carbon_Human)M).get_organ(GlobalFuncs.check_zone(user.zone_selected));

            if (affecting.status == 2)
            {
                ((Ent_Static)user).visible_message("<span class='notice'>" + user + " starts to fix some of the wires in " + M + "'s " + affecting.getDisplayName() + ".</span>", "<span class='notice'>You start fixing some of the wires in " + M + "'s " + affecting.getDisplayName() + ".</span>");

                if (!GlobalFuncs.do_mob(user, M, 50))
                {
                    return(false);
                }
                GlobalFuncs.item_heal_robotic(M, user, 0, 5);
                this.use(1);
                return(false);
            }
            else
            {
                return(base.attack((object)(M), (object)(user), def_zone));
            }
        }
Ejemplo n.º 3
0
        // Function from file: martial.dm
        public override bool grab_act(dynamic A = null, Mob_Living_Carbon_Human D = null)
        {
            Obj_Item_Organ_Limb affecting = null;
            double armor_block            = 0;

            D.grabbedby(A, true);
            D.visible_message("<span class='danger'>" + A + " holds " + D + " down!</span>", "<span class='userdanger'>" + A + " holds " + D + " down!</span>");
            affecting   = D.get_organ(GlobalFuncs.ran_zone(A.zone_selected));
            armor_block = D.run_armor_check(affecting, "melee");
            D.apply_damage(10, "stamina", affecting, armor_block);
            return(true);
        }
Ejemplo n.º 4
0
        // Function from file: damage_converter.dm
        public bool Convert(dynamic M = null)
        {
            double              get_damage = 0;
            dynamic             H          = null;
            ByTable             parts      = null;
            Obj_Item_Organ_Limb L          = null;

            get_damage = Rand13.Int(1, 2);

            if (M is Mob_Living_Carbon_Human)
            {
                H     = M;
                parts = ((Mob_Living_Carbon_Human)H).get_damaged_organs(1, 1);

                if (!(parts.len != 0))
                {
                    return(false);
                }

                foreach (dynamic _a in Lang13.Enumerate(parts, typeof(Obj_Item_Organ_Limb)))
                {
                    L = _a;

                    L.heal_damage(get_damage, get_damage, false);
                }
            }
            else if (((Mob_Living)M).getFireLoss() > 0 || ((Mob_Living)M).getBruteLoss() > 0)
            {
                ((Mob_Living)M).adjustFireLoss(-get_damage);
                ((Mob_Living)M).adjustBruteLoss(-get_damage);
            }
            else
            {
                return(false);
            }
            ((Mob_Living)M).adjustToxLoss(get_damage);
            return(true);
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
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);
        }
        // Function from file: interactive.dm
        public Mob_Living_Carbon_Human_Interactive(dynamic loc = null) : base((object)(loc))
        {
            dynamic             R    = null;
            dynamic             L    = null;
            dynamic             R2   = null;
            dynamic             L2   = null;
            dynamic             R3   = null;
            dynamic             L3   = null;
            Obj_Item_Organ_Limb LIMB = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            this.random();
            this.MYID                 = new Obj_Item_Weapon_Card_Id(this);
            this.MYID.name            = "" + this.real_name + "'s ID Card (" + this.myjob.title + ")";
            this.MYID.assignment      = "" + this.myjob.title;
            this.MYID.registered_name = this.real_name;
            this.MYID.access          = this.myjob.access;
            this.equip_to_slot_or_del(this.MYID, 7);
            this.MYPDA        = new Obj_Item_Device_Pda(this);
            this.MYPDA.owner  = this.real_name;
            this.MYPDA.ownjob = "Crew";
            this.MYPDA.name   = "PDA-" + this.real_name + " (" + this.myjob.title + ")";
            this.equip_to_slot_or_del(this.MYPDA, 6);
            this.zone_selected = "chest";

            if (Rand13.PercentChance(10))
            {
                if (Rand13.PercentChance(((int)(67.5))))
                {
                    R = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_RArm), this.organs);
                    GlobalFuncs.qdel(R);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_RArm());
                }
                else
                {
                    L = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_LArm), this.organs);
                    GlobalFuncs.qdel(L);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_LArm());
                }

                if (Rand13.PercentChance(((int)(67.5))))
                {
                    R2 = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_RLeg), this.organs);
                    GlobalFuncs.qdel(R2);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_RLeg());
                }
                else
                {
                    L2 = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_LLeg), this.organs);
                    GlobalFuncs.qdel(L2);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_LLeg());
                }

                if (Rand13.PercentChance(((int)(67.5))))
                {
                    R3 = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_Chest), this.organs);
                    GlobalFuncs.qdel(R3);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_Chest());
                }
                else
                {
                    L3 = Lang13.FindIn(typeof(Obj_Item_Organ_Limb_Head), this.organs);
                    GlobalFuncs.qdel(L3);
                    this.organs.Add(new Obj_Item_Organ_Limb_Robot_Head());
                }

                foreach (dynamic _a in Lang13.Enumerate(this.organs, typeof(Obj_Item_Organ_Limb)))
                {
                    LIMB = _a;

                    LIMB.owner = this;
                }
            }
            this.update_icons();
            this.update_damage_overlays(  );
            this.update_augments();
            this.hand = false;

            if ((this.TRAITS & 2) != 0)
            {
                this.robustness = 75;
            }
            else if ((this.TRAITS & 4) != 0)
            {
                this.robustness = 25;
            }

            if ((this.TRAITS & 8) != 0)
            {
                this.smartness = 25;
            }
            else if ((this.TRAITS & 16) != 0)
            {
                this.disabilities |= 256;
                this.smartness     = 75;
            }

            if ((this.TRAITS & 32) != 0)
            {
                this.attitude = 75;
            }
            else if ((this.TRAITS & 64) != 0)
            {
                this.attitude = 1;
            }

            if ((this.TRAITS & 128) != 0)
            {
                this.slyness = 75;
            }
            GlobalVars.SSnpc.insertBot(this);
            return;
        }
Ejemplo n.º 9
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);
        }
        // Function from file: book.dm
        public override bool attack(dynamic M = null, dynamic user = null, bool?def_zone = null)
        {
            bool                chaplain     = false;
            dynamic             H            = null;
            bool                message_halt = false;
            Obj_Item_Organ_Limb affecting    = null;

            chaplain = false;

            if (Lang13.Bool(user.mind) && user.mind.assigned_role == "Chaplain")
            {
                chaplain = true;
            }

            if (!((Mob)user).IsAdvancedToolUser())
            {
                user.WriteMsg("<span class='warning'>You don't have the dexterity to do this!</span>");
                return(false);
            }

            if (!chaplain)
            {
                user.WriteMsg("<span class='danger'>The book sizzles in your hands.</span>");
                ((Mob_Living)user).take_organ_damage(0, 10);
                return(false);
            }

            if (Lang13.Bool(user.disabilities & 256) && Rand13.PercentChance(50))
            {
                user.WriteMsg("<span class='danger'>The " + this + " slips out of your hand and hits your head.</span>");
                ((Mob_Living)user).take_organ_damage(10);
                ((Mob)user).Paralyse(20);
                return(false);
            }

            if (Convert.ToInt32(M.stat) != 2)
            {
                if (Lang13.Bool(M.mind) && M.mind.assigned_role == "Chaplain")
                {
                    user.WriteMsg("<span class='warning'>You can't heal yourself!</span>");
                    return(false);
                }

                if (M is Mob_Living_Carbon_Human && Rand13.PercentChance(60))
                {
                    this.bless(M);

                    if (M is Mob_Living_Carbon_Human)
                    {
                        H            = M;
                        message_halt = false;

                        foreach (dynamic _a in Lang13.Enumerate(H.organs, typeof(Obj_Item_Organ_Limb)))
                        {
                            affecting = _a;


                            if (affecting.status == 1)
                            {
                                if (!message_halt)
                                {
                                    ((Ent_Static)M).visible_message("<span class='notice'>" + user + " heals " + M + " with the power of " + this.deity_name + "!</span>");
                                    M.WriteMsg("<span class='boldnotice'>May the power of " + this.deity_name + " compel you to be healed!</span>");
                                    GlobalFuncs.playsound(this.loc, "punch", 25, 1, -1);
                                    message_halt = true;
                                }
                            }
                            else
                            {
                                user.WriteMsg("<span class='warning'>" + this.deity_name + " refuses to heal this metallic taint!</span>");
                                return(false);
                            }
                        }
                    }
                }
                else
                {
                    if (M is Mob_Living_Carbon_Human && !(M.head is Obj_Item_Clothing_Head_Helmet))
                    {
                        ((Mob_Living)M).adjustBrainLoss(10);
                        M.WriteMsg("<span class='danger'>You feel dumber.</span>");
                    }
                    ((Ent_Static)M).visible_message("<span class='danger'>" + user + " beats " + M + " over the head with " + this + "!</span>", "<span class='userdanger'>" + user + " beats " + M + " over the head with " + this + "!</span>");
                    GlobalFuncs.playsound(this.loc, "punch", 25, 1, -1);
                    GlobalFuncs.add_logs(user, M, "attacked", this);
                }
            }
            else if (Convert.ToInt32(M.stat) == 2)
            {
                ((Ent_Static)M).visible_message("<span class='danger'>" + user + " smacks " + M + "'s lifeless corpse with " + this + ".</span>");
                GlobalFuncs.playsound(this.loc, "punch", 25, 1, -1);
            }
            return(false);
        }
Ejemplo n.º 11
0
        // Function from file: medical.dm
        public override bool attack(dynamic M = null, dynamic user = null, bool?def_zone = null)
        {
            string              t_him     = null;
            dynamic             H         = null;
            dynamic             critter   = null;
            string              t_himself = null;
            dynamic             H2        = null;
            Obj_Item_Organ_Limb affecting = null;


            if (Convert.ToInt32(M.stat) == 2)
            {
                t_him = "it";

                if (M.gender == GlobalVars.MALE)
                {
                    t_him = "him";
                }
                else if (M.gender == GlobalVars.FEMALE)
                {
                    t_him = "her";
                }
                user.WriteMsg(new Txt("<span class='danger'>").The(M).item().str(" is dead, you cannot help ").item(t_him).str("!</span>").ToString());
                return(false);
            }

            if (!(M is Mob_Living_Carbon) && !(M is Mob_Living_SimpleAnimal))
            {
                user.WriteMsg(new Txt("<span class='danger'>You don't know how to apply ").the(this).item().str(" to ").item(M).str("!</span>").ToString());
                return(true);
            }

            if (M is Mob_Living_Carbon_Human)
            {
                H = M;

                if (this.stop_bleeding != 0)
                {
                    if (H.bleedsuppress)
                    {
                        user.WriteMsg("<span class='warning'>" + H + "'s bleeding is already bandaged!</span>");
                        return(false);
                    }
                    else if (!(H.blood_max != 0))
                    {
                        user.WriteMsg("<span class='warning'>" + H + " isn't bleeding!</span>");
                        return(false);
                    }
                }
            }

            if (M is Mob_Living)
            {
                if (!((Mob_Living)M).can_inject(user, true))
                {
                    return(false);
                }
            }

            if (Lang13.Bool(user))
            {
                if (M != user)
                {
                    if (M is Mob_Living_SimpleAnimal)
                    {
                        critter = M;

                        if (!critter.healable)
                        {
                            user.WriteMsg("<span class='notice'> You cannot use " + this + " on " + M + "!</span>");
                            return(false);
                        }
                        else if (critter.health == critter.maxHealth)
                        {
                            user.WriteMsg("<span class='notice'> " + M + " is at full health.</span>");
                            return(false);
                        }
                        else if (this.heal_brute < 1)
                        {
                            user.WriteMsg("<span class='notice'> " + this + " won't help " + M + " at all.</span>");
                            return(false);
                        }
                    }
                    ((Ent_Static)user).visible_message("<span class='green'>" + user + " applies " + this + " on " + M + ".</span>", "<span class='green'>You apply " + this + " on " + M + ".</span>");
                }
                else
                {
                    t_himself = "itself";

                    if (user.gender == GlobalVars.MALE)
                    {
                        t_himself = "himself";
                    }
                    else if (user.gender == GlobalVars.FEMALE)
                    {
                        t_himself = "herself";
                    }
                    ((Ent_Static)user).visible_message("<span class='notice'>" + user + " starts to apply " + this + " on " + t_himself + "...</span>", "<span class='notice'>You begin applying " + this + " on yourself...</span>");

                    if (!GlobalFuncs.do_mob(user, M, this.self_delay))
                    {
                        return(false);
                    }
                    ((Ent_Static)user).visible_message("<span class='green'>" + user + " applies " + this + " on " + t_himself + ".</span>", "<span class='green'>You apply " + this + " on yourself.</span>");
                }
            }

            if (M is Mob_Living_Carbon_Human)
            {
                H2        = M;
                affecting = ((Mob_Living_Carbon_Human)H2).get_organ(GlobalFuncs.check_zone(user.zone_selected));

                if (this.stop_bleeding != 0)
                {
                    if (!H2.bleedsuppress)
                    {
                        ((Mob_Living_Carbon_Human)H2).suppress_bloodloss(this.stop_bleeding);
                    }
                }

                if (affecting.status == 1)
                {
                    if (affecting.heal_damage(this.heal_brute, this.heal_burn, false))
                    {
                        ((Mob_Living)H2).update_damage_overlays(  );
                    }
                    ((Mob_Living)M).updatehealth();
                }
                else
                {
                    user.WriteMsg("<span class='notice'>Medicine won't work on a robotic limb!</span>");
                }
            }
            else
            {
                ((Mob_Living)M).heal_organ_damage(this.heal_brute / 2, this.heal_burn / 2);
            }
            this.use(1);
            return(false);
        }