コード例 #1
0
        // Function from file: alien_powers.dm
        public override bool fire(Mob user = null)
        {
            ByTable           aliens_around = null;
            Mob_Living_Carbon A             = null;
            dynamic           M             = null;
            dynamic           amount        = null;

            aliens_around = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInViewExcludeThis(null, user), typeof(Mob_Living_Carbon)))
            {
                A = _a;


                if (Lang13.Bool(A.getorgan(typeof(Obj_Item_Organ_Internal_Alien_Plasmavessel))))
                {
                    aliens_around.Add(A);
                }
            }
            M = Interface13.Input("Select who to transfer to:", "Transfer plasma to?", null, null, aliens_around, InputType.Mob);

            if (!Lang13.Bool(M))
            {
                return(false);
            }
            amount = Interface13.Input("Amount:", "Transfer Plasma to " + M, null, null, null, InputType.Num);

            if (Lang13.Bool(amount))
            {
                amount = Num13.MinInt(((int)(Math.Abs(Num13.Floor(Convert.ToDouble(amount))))), ((Mob_Living_Carbon)user).getPlasma());

                if (Map13.GetDistance(user, M) <= 1)
                {
                    ((Mob_Living_Carbon)M).adjustPlasma(amount);
                    ((Mob_Living_Carbon)user).adjustPlasma(-amount);
                    M.WriteMsg("<span class='noticealien'>" + user + " has transfered " + amount + " plasma to you.</span>");
                    user.WriteMsg("<span class='noticealien'>You trasfer " + amount + " plasma to " + M + "</span>");
                }
                else
                {
                    user.WriteMsg("<span class='noticealien'>You need to be closer!</span>");
                }
            }
            return(false);
        }