예제 #1
0
        // Function from file: advance.dm
        public override void stage_act(  )
        {
            Symptom S  = null;
            Symptom S2 = null;

            base.stage_act();

            if (this.symptoms != null && this.symptoms.len != 0)
            {
                if (!this.processing)
                {
                    this.processing = true;

                    foreach (dynamic _a in Lang13.Enumerate(this.symptoms, typeof(Symptom)))
                    {
                        S = _a;

                        S.Start(this);
                    }
                }

                foreach (dynamic _b in Lang13.Enumerate(this.symptoms, typeof(Symptom)))
                {
                    S2 = _b;

                    S2.Activate(this);
                }
            }
            else
            {
                Task13.Crash("We do not have any symptoms during stage_act()!");
            }
            return;
        }
예제 #2
0
        // Function from file: advance.dm
        public ByTable GenerateProperties(  )
        {
            ByTable properties = null;
            Symptom S          = null;


            if (!(this.symptoms != null) || !(this.symptoms.len != 0))
            {
                Task13.Crash("We did not have any symptoms before generating properties.");
                return(null);
            }
            properties = new ByTable().Set("resistance", 1).Set("stealth", 1).Set("stage_rate", 1).Set("transmittable", 1).Set("severity", 0);

            foreach (dynamic _a in Lang13.Enumerate(this.symptoms, typeof(Symptom)))
            {
                S = _a;

                properties["resistance"]    += S.resistance;
                properties["stealth"]       += S.stealth;
                properties["stage_rate"]    += S.stage_speed;
                properties["transmittable"] += S.transmittable;
                properties["severity"]       = Num13.MaxInt(Convert.ToInt32(properties["severity"]), S.severity);
            }
            return(properties);
        }
예제 #3
0
        // Function from file: advance.dm
        public override dynamic Destroy(  )
        {
            Symptom S = null;


            if (this.processing)
            {
                foreach (dynamic _a in Lang13.Enumerate(this.symptoms, typeof(Symptom)))
                {
                    S = _a;

                    S.End(this);
                }
            }
            return(base.Destroy());
        }
예제 #4
0
        // Function from file: advance.dm
        public bool HasSymptom(dynamic S = null)
        {
            Symptom symp = null;


            foreach (dynamic _a in Lang13.Enumerate(this.symptoms, typeof(Symptom)))
            {
                symp = _a;


                if (symp.id == S.id)
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #5
0
        // Function from file: advance.dm
        public Disease_Advance(bool?process = null, Disease_Advance D = null) : base(  )
        {
            process = process ?? true;

            dynamic symp = null;
            dynamic S    = null;
            Symptom S2   = null;


            if (!(GlobalVars.dictionary_symptoms.len != 0))
            {
                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.list_symptoms))
                {
                    symp = _a;

                    S = Lang13.Call(symp);
                    GlobalVars.dictionary_symptoms[S.id] = symp;
                }
            }

            if (!(D is Disease_Advance))
            {
                D = null;
            }

            if (!(this.symptoms != null) || !(this.symptoms.len != 0))
            {
                if (!(D != null) || !(D.symptoms != null) || !(D.symptoms.len != 0))
                {
                    this.symptoms = this.GenerateSymptoms(0, 2);
                }
                else
                {
                    foreach (dynamic _b in Lang13.Enumerate(D.symptoms, typeof(Symptom)))
                    {
                        S2 = _b;

                        this.symptoms.Add(Lang13.Call(S2.type));
                    }
                }
            }
            this.Refresh();
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            return;
        }
예제 #6
0
        // Function from file: advance.dm
        public void Mix(dynamic D = null)
        {
            dynamic possible_symptoms = null;
            Symptom S = null;


            if (!this.IsSame(D))
            {
                possible_symptoms = GlobalFuncs.shuffle(D.symptoms);

                foreach (dynamic _a in Lang13.Enumerate(possible_symptoms, typeof(Symptom)))
                {
                    S = _a;

                    this.AddSymptom(Lang13.Call(S.type));
                }
            }
            return;
        }
예제 #7
0
        // Function from file: advance.dm
        public override dynamic GetDiseaseID(  )
        {
            dynamic L      = null;
            Symptom S      = null;
            string  result = null;


            if (!Lang13.Bool(this.id))
            {
                L = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(this.symptoms, typeof(Symptom)))
                {
                    S = _a;

                    L += S.id;
                }
                L       = GlobalFuncs.sortList(L);
                result  = GlobalFuncs.jointext(L, ":");
                this.id = result;
            }
            return(this.id);
        }
        // Function from file: pandemic.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            string        dat              = null;
            Reagents      R                = null;
            Reagent_Blood Blood            = null;
            Reagent_Blood B                = null;
            ByTable       vir              = null;
            int           i                = 0;
            Disease       D                = null;
            Disease       A                = null;
            Disease       A2               = null;
            ByTable       english_symptoms = null;
            Symptom       S                = null;
            ByTable       res              = null;
            int           i2               = 0;
            dynamic       type             = null;
            string        disease_name     = null;
            dynamic       A3               = null;
            dynamic       D2               = null;


            if (Lang13.Bool(base.attack_hand((object)(a), b, c)))
            {
                return(null);
            }
            ((Mob)a).set_machine(this);
            dat = "";

            if (Lang13.Bool(this.temp_html))
            {
                dat = new Txt().item(this.temp_html).str("<BR><BR><A href='?src=").Ref(this).str(";clear=1'>Main Menu</A>").ToString();
            }
            else if (!Lang13.Bool(this.beaker))
            {
                dat += "Please insert beaker.<BR>";
                dat += new Txt("<A href='?src=").Ref(a).str(";mach_close=pandemic'>Close</A>").ToString();
            }
            else
            {
                R     = this.beaker.reagents;
                Blood = null;

                foreach (dynamic _a in Lang13.Enumerate(R.reagent_list, typeof(Reagent_Blood)))
                {
                    B = _a;


                    if (B != null)
                    {
                        Blood = B;
                        break;
                    }
                }

                if (!Lang13.Bool(R.total_volume) || !(R.reagent_list.len != 0))
                {
                    dat += "The beaker is empty<BR>";
                }
                else if (!(Blood != null))
                {
                    dat += "No blood sample found in beaker.";
                }
                else if (!Lang13.Bool(Blood.data))
                {
                    dat += "No blood data found in beaker.";
                }
                else
                {
                    dat += "<h3>Blood sample data:</h3>";
                    dat += "<b>Blood DNA:</b> " + (Lang13.Bool(Blood.data["blood_DNA"]) || Lang13.Bool("none")) + "<BR>";
                    dat += "<b>Blood Type:</b> " + (Lang13.Bool(Blood.data["blood_type"]) || Lang13.Bool("none")) + "<BR>";

                    if (Lang13.Bool(Blood.data["viruses"]))
                    {
                        vir = Blood.data["viruses"];

                        if (vir.len != 0)
                        {
                            i = 0;

                            foreach (dynamic _c in Lang13.Enumerate(Blood.data["viruses"], typeof(Disease)))
                            {
                                D = _c;

                                i++;

                                if (!((D.visibility_flags & 2) != 0))
                                {
                                    if (D is Disease_Advance)
                                    {
                                        A = D;
                                        D = GlobalVars.archive_diseases[A.GetDiseaseID()];

                                        if (D != null && D.name == "Unknown")
                                        {
                                            dat += new Txt("<b><a href='?src=").Ref(this).str(";name_disease=").item(i).str("'>Name Disease</a></b><BR>").ToString();
                                        }
                                    }

                                    if (!(D != null))
                                    {
                                        Task13.Crash("We weren't able to get the advance disease from the archive.");
                                    }
                                    dat += "<b>Disease Agent:</b> " + (D != null ? new Txt().item(D.agent).str(" - <A href='?src=").Ref(this).str(";create_virus_culture=").item(i).str("'>Create virus culture bottle</A>").ToString() : "none") + "<BR>";
                                    dat += "<b>Common name:</b> " + (Lang13.Bool(D.name) || Lang13.Bool("none")) + "<BR>";
                                    dat += "<b>Description: </b> " + (Lang13.Bool(D.desc) || Lang13.Bool("none")) + "<BR>";
                                    dat += "<b>Spread:</b> " + (Lang13.Bool(D.spread_text) || Lang13.Bool("none")) + "<BR>";
                                    dat += "<b>Possible cure:</b> " + (Lang13.Bool(D.cure_text) || Lang13.Bool("none")) + "<BR><BR>";

                                    if (D is Disease_Advance)
                                    {
                                        A2   = D;
                                        dat += "<b>Symptoms:</b> ";
                                        english_symptoms = new ByTable();

                                        foreach (dynamic _b in Lang13.Enumerate(((dynamic)A2).symptoms, typeof(Symptom)))
                                        {
                                            S = _b;

                                            english_symptoms.Add(S.name);
                                        }
                                        dat += GlobalFuncs.english_list(english_symptoms);
                                    }
                                }
                                else
                                {
                                    dat += "No detectable virus in the sample.";
                                }
                            }
                        }
                    }
                    else
                    {
                        dat += "No detectable virus in the sample.";
                    }
                    dat += "<BR><b>Contains antibodies to:</b> ";

                    if (Lang13.Bool(Blood.data["resistances"]))
                    {
                        res = Blood.data["resistances"];

                        if (res.len != 0)
                        {
                            dat += "<ul>";
                            i2   = 0;

                            foreach (dynamic _d in Lang13.Enumerate(Blood.data["resistances"]))
                            {
                                type = _d;

                                i2++;
                                disease_name = "Unknown";

                                if (!(type is Type))
                                {
                                    A3 = GlobalVars.archive_diseases[type];

                                    if (Lang13.Bool(A3))
                                    {
                                        disease_name = A3.name;
                                    }
                                }
                                else
                                {
                                    D2           = Lang13.Call(type, 0, null);
                                    disease_name = D2.name;
                                }
                                dat += new Txt("<li>").item(disease_name).str(" - <A href='?src=").Ref(this).str(";create_vaccine=").item(i2).str("'>Create vaccine bottle</A></li>").ToString();
                            }
                            dat += "</ul><BR>";
                        }
                        else
                        {
                            dat += "nothing<BR>";
                        }
                    }
                    else
                    {
                        dat += "nothing<BR>";
                    }
                }
                dat += new Txt("<BR><A href='?src=").Ref(this).str(";eject=1'>Eject beaker</A>").item((Lang13.Bool(R.total_volume) && R.reagent_list.len != 0 ? new Txt("-- <A href='?src=").Ref(this).str(";empty_beaker=1'>Empty beaker</A>").ToString() : "")).str("<BR>").ToString();
                dat += new Txt("<A href='?src=").Ref(a).str(";mach_close=pandemic'>Close</A>").ToString();
            }
            Interface13.Browse(a, "<TITLE>" + this.name + "</TITLE><BR>" + dat, "window=pandemic;size=575x400");
            GlobalFuncs.onclose(a, "pandemic");
            return(null);
        }