Beispiel #1
0
        // Function from file: Malf_Modules.dm
        public void remove_verbs(dynamic A = null)
        {
            AIModule AM = null;


            foreach (dynamic _a in Lang13.Enumerate(this.possible_modules, typeof(AIModule)))
            {
                AM = _a;

                A.verbs.Remove(AM.power_type);
            }
            return;
        }
Beispiel #2
0
        // Function from file: Malf_Modules.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Mob      A          = null;
            AIModule AM         = null;
            dynamic  already_AM = null;

            base.Topic(href, href_list, (object)(hsrc));

            if (!(Task13.User is Mob_Living_Silicon_Ai))
            {
                return(null);
            }
            A = Task13.User;

            if (A.stat == 2)
            {
                A.WriteMsg("You are already dead!");
                return(null);
            }

            foreach (dynamic _a in Lang13.Enumerate(this.possible_modules, typeof(AIModule)))
            {
                AM = _a;


                if (Lang13.Bool(href_list[AM.mod_pick_name]))
                {
                    if (AM.cost > this.processing_time)
                    {
                        this.temp = "You cannot afford this module.";
                        break;
                    }
                    already_AM = Lang13.FindIn(AM.type, ((dynamic)A).current_modules);

                    if (Lang13.Bool(already_AM))
                    {
                        if (!AM.one_time)
                        {
                            already_AM.uses      += AM.uses;
                            this.processing_time -= AM.cost;
                            this.temp             = "Additional use added to " + already_AM.module_name;
                            break;
                        }
                        else
                        {
                            this.temp = "This module is only needed once.";
                            break;
                        }
                    }
                    ((Mob_Living_Silicon_Ai)A).view_core();
                    A.verbs.Add(AM.power_type);
                    ((dynamic)A).current_modules += Lang13.Call(AM.type);
                    this.temp             = AM.description;
                    this.processing_time -= AM.cost;
                }

                if (Lang13.Bool(href_list["showdesc"]))
                {
                    if (AM.mod_pick_name == href_list["showdesc"])
                    {
                        this.temp = AM.description;
                    }
                }
            }
            this.use(Task13.User);
            return(null);
        }