Esempio n. 1
0
        // Function from file: turf.dm
        public override bool handle_slip(Mob_Living_Carbon C = null, int s_amount = 0, int w_amount = 0, dynamic O = null, dynamic lube = null)
        {
            Ent_Dynamic buckled_obj = null;
            int?        oldlying    = null;
            int         olddir      = 0;
            int?        i           = null;
            dynamic     dam_zone    = null;


            if (GlobalFuncs.has_gravity(this))
            {
                oldlying = C.lying;

                if (C.buckled != null)
                {
                    buckled_obj = C.buckled;

                    if (!Lang13.Bool(lube & 4))
                    {
                        return(false);
                    }
                }
                else
                {
                    if (Lang13.Bool(C.lying) || !((C.status_flags & 2) != 0))
                    {
                        return(false);
                    }

                    if (C.m_intent == "walk" && Lang13.Bool(lube & 1))
                    {
                        return(false);
                    }
                }
                C.WriteMsg("<span class='notice'>You slipped" + (Lang13.Bool(O) ? " on the " + O.name : "") + "!</span>");
                C.attack_log.Add("[" + GlobalFuncs.time_stamp() + "] <font color='orange'>Slipped" + (Lang13.Bool(O) ? " on the " + O.name : "") + (Lang13.Bool(lube & 2) ? " (LUBE)" : "") + "!</font>");
                GlobalFuncs.playsound(C.loc, "sound/misc/slip.ogg", 50, 1, -3);
                C.accident(C.l_hand);
                C.accident(C.r_hand);
                olddir = C.dir;
                C.Stun(s_amount);
                C.Weaken(w_amount);
                C.__CallVerb("Stop Pulling");

                if (buckled_obj != null)
                {
                    buckled_obj.unbuckle_mob();
                    Map13.Step(buckled_obj, olddir);
                }
                else if (Lang13.Bool(lube & 2))
                {
                    i = null;
                    i = 1;

                    while ((i ?? 0) < 5)
                    {
                        Task13.Schedule(i ?? 0, (Task13.Closure)(() => {
                            Map13.Step(C, olddir);
                            C.spin(1, 1);
                            return;
                        }));
                        i++;
                    }
                }

                if (C.lying != oldlying && Lang13.Bool(lube))
                {
                    dam_zone = Rand13.Pick(new object [] { "chest", "l_hand", "r_hand", "l_leg", "r_leg" });
                    C.apply_damage(5, "brute", dam_zone);
                }
                return(true);
            }
            return(false);
        }