Esempio n. 1
0
 // Function from file: paicard.dm
 public void removePersonality(  )
 {
     this.pai = null;
     this.overlays.Cut();
     this.overlays.Add("pai-off");
     return;
 }
Esempio n. 2
0
        // Function from file: pai.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            dynamic candidate          = null;
            dynamic card               = null;
            Mob_Living_Silicon_Pai pai = null;
            dynamic candidate2         = null;
            dynamic option             = null;
            dynamic t = null;
            Obj_Item_Device_Paicard p = null;


            if (Lang13.Bool(href_list["download"]))
            {
                candidate = Lang13.FindObj(href_list["candidate"]);
                card      = Lang13.FindObj(href_list["device"]);

                if (Lang13.Bool(card.pai))
                {
                    return(null);
                }

                if (card is Obj_Item_Device_Paicard && candidate is PaiCandidate)
                {
                    pai = new Mob_Living_Silicon_Pai(card);

                    if (!Lang13.Bool(candidate.name))
                    {
                        pai.name = Rand13.PickFromTable(GlobalVars.ninja_names);
                    }
                    else
                    {
                        pai.name = candidate.name;
                    }
                    pai.real_name = pai.name;
                    pai.key       = candidate.key;
                    ((Obj_Item_Device_Paicard)card).setPersonality(pai);
                    card.looking_for_personality = false;
                    ((GameMode)GlobalVars.ticker.mode).update_cult_icons_removed(card.pai.mind);
                    ((GameMode)GlobalVars.ticker.mode).update_rev_icons_removed(card.pai.mind);
                    this.candidates.Remove(candidate);
                    Interface13.Browse(Task13.User, null, "window=findPai");
                }
            }

            if (Lang13.Bool(href_list["new"]))
            {
                candidate2 = Lang13.FindObj(href_list["candidate"]);
                option     = href_list["option"];
                t          = "";

                dynamic _b = option;                 // Was a switch-case, sorry for the mess.
                if (_b == "name")
                {
                    t = Interface13.Input("Enter a name for your pAI", "pAI Name", candidate2.name, null, null, InputType.Str);

                    if (Lang13.Bool(t))
                    {
                        candidate2.name = String13.SubStr(GlobalFuncs.sanitize(t), 1, 26);
                    }
                }
                else if (_b == "desc")
                {
                    t = Interface13.Input("Enter a description for your pAI", "pAI Description", candidate2.description, null, null, InputType.StrMultiline);

                    if (Lang13.Bool(t))
                    {
                        candidate2.description = String13.SubStr(GlobalFuncs.sanitize(t), 1, 1024);
                    }
                }
                else if (_b == "role")
                {
                    t = Interface13.Input("Enter a role for your pAI", "pAI Role", candidate2.role, null, null, InputType.Str);

                    if (Lang13.Bool(t))
                    {
                        candidate2.role = String13.SubStr(GlobalFuncs.sanitize(t), 1, 1024);
                    }
                }
                else if (_b == "ooc")
                {
                    t = Interface13.Input("Enter any OOC comments", "pAI OOC Comments", candidate2.comments, null, null, InputType.StrMultiline);

                    if (Lang13.Bool(t))
                    {
                        candidate2.comments = String13.SubStr(GlobalFuncs.sanitize(t), 1, 1024);
                    }
                }
                else if (_b == "save")
                {
                    ((PaiCandidate)candidate2).savefile_save(Task13.User);
                }
                else if (_b == "load")
                {
                    ((PaiCandidate)candidate2).savefile_load(Task13.User);

                    if (Lang13.Bool(candidate2.name))
                    {
                        candidate2.name = String13.SubStr(GlobalFuncs.sanitize(candidate2.name), 1, 26);
                    }

                    if (Lang13.Bool(candidate2.description))
                    {
                        candidate2.description = String13.SubStr(GlobalFuncs.sanitize(candidate2.description), 1, 1024);
                    }

                    if (Lang13.Bool(candidate2.role))
                    {
                        candidate2.role = String13.SubStr(GlobalFuncs.sanitize(candidate2.role), 1, 1024);
                    }

                    if (Lang13.Bool(candidate2.comments))
                    {
                        candidate2.comments = String13.SubStr(GlobalFuncs.sanitize(candidate2.comments), 1, 1024);
                    }
                }
                else if (_b == "submit")
                {
                    if (Lang13.Bool(candidate2))
                    {
                        candidate2.ready = 1;

                        foreach (dynamic _a in Lang13.Enumerate(typeof(Game13), typeof(Obj_Item_Device_Paicard)))
                        {
                            p = _a;


                            if (p.looking_for_personality)
                            {
                                p.alertUpdate();
                            }
                        }
                    }
                    Interface13.Browse(Task13.User, null, "window=paiRecruit");
                    return(null);
                }
                this.recruitWindow(Task13.User);
            }
            return(null);
        }
Esempio n. 3
0
 // Function from file: paicard.dm
 public void setPersonality(Mob_Living_Silicon_Pai personality = null)
 {
     this.pai = personality;
     this.overlays.Add("pai-null");
     return;
 }