Пример #1
0
        // Function from file: changeling.dm
        public bool has_dna(Dna tDNA = null)
        {
            Changelingprofile prof = null;


            foreach (dynamic _a in Lang13.Enumerate(this.stored_profiles, typeof(Changelingprofile)))
            {
                prof = _a;


                if (tDNA.is_same_as(prof.dna))
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #2
0
 // Function from file: gibspawner.dm
 public Obj_Effect_Gibspawner_Human(dynamic location = null, ByTable viruses = null, Dna MobDNA = null) : base((object)(location), viruses, MobDNA)
 {
     GlobalFuncs.playsound(this, "sound/effects/blobattack.ogg", 50, 1);
     this.gibdirections = new ByTable(new object [] {
         new ByTable(new object [] { GlobalVars.NORTH, GlobalVars.NORTHEAST, GlobalVars.NORTHWEST }),
         new ByTable(new object [] { GlobalVars.SOUTH, GlobalVars.SOUTHEAST, GlobalVars.SOUTHWEST }),
         new ByTable(new object [] { GlobalVars.WEST, GlobalVars.NORTHWEST, GlobalVars.SOUTHWEST }),
         new ByTable(new object [] { GlobalVars.EAST, GlobalVars.NORTHEAST, GlobalVars.SOUTHEAST }),
         GlobalVars.alldirs,
         GlobalVars.alldirs,
         new ByTable()
     });
     this.gibamounts[6] = Rand13.Pick(new object [] { 0, 1, 2 });
     // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
     return;
 }
Пример #3
0
        // Function from file: dna_spread.dm
        public override void stage_act(  )
        {
            Dna transform_dna = null;

            base.stage_act();

            if (!Lang13.Bool(this.affected_mob.dna))
            {
                this.cure();
            }

            if (!Lang13.Bool(this.strain_data["dna"]))
            {
                this.strain_data["dna"] = Lang13.Call(this.affected_mob.dna.type);
                ((Dna)this.affected_mob.dna).copy_dna(this.strain_data["dna"]);
                this.carrier = true;
                this.stage   = 4;
                return;
            }

            switch ((int?)(this.stage))
            {
            case 2:

                if (Rand13.PercentChance(8))
                {
                    ((Mob)this.affected_mob).emote("sneeze");
                }

                if (Rand13.PercentChance(8))
                {
                    ((Mob)this.affected_mob).emote("cough");
                }

                if (Rand13.PercentChance(1))
                {
                    this.affected_mob.WriteMsg("<span class='danger'>Your muscles ache.</span>");

                    if (Rand13.PercentChance(20))
                    {
                        ((Mob_Living)this.affected_mob).take_organ_damage(1);
                    }
                }

                if (Rand13.PercentChance(1))
                {
                    this.affected_mob.WriteMsg("<span class='danger'>Your stomach hurts.</span>");

                    if (Rand13.PercentChance(20))
                    {
                        ((Mob_Living)this.affected_mob).adjustToxLoss(2);
                        ((Mob_Living)this.affected_mob).updatehealth();
                    }
                }
                break;

            case 4:

                if (!this.transformed && !this.carrier)
                {
                    this.original_dna = Lang13.Call(this.affected_mob.dna.type);
                    ((Dna)this.affected_mob.dna).copy_dna(this.original_dna);
                    this.affected_mob.WriteMsg("<span class='danger'>You don't feel like yourself..</span>");
                    transform_dna = this.strain_data["dna"];
                    transform_dna.transfer_identity(this.affected_mob, true);
                    this.affected_mob.real_name = this.affected_mob.dna.real_name;
                    ((Mob_Living_Carbon)this.affected_mob).updateappearance(null, true);
                    ((Mob)this.affected_mob).domutcheck();
                    this.transformed = true;
                    this.carrier     = true;
                }
                break;
            }
            return;
        }
Пример #4
0
        // Function from file: gibs.dm
        public void Gib(Ent_Static location = null, ByTable viruses = null, Dna MobDNA = null)
        {
            viruses = viruses ?? new ByTable();

            dynamic gib = null;
            EffectSystem_SparkSpread s = null;
            int?       i          = null;
            int?       j          = null;
            dynamic    gibType    = null;
            Ent_Static digester   = null;
            Disease    D          = null;
            dynamic    viruus     = null;
            ByTable    directions = null;


            if (this.gibtypes.len != this.gibamounts.len || this.gibamounts.len != this.gibdirections.len)
            {
                Game13.WriteMsg("<span class='danger'>Gib list length mismatch!</span>");
                return;
            }
            gib = null;

            if (this.sparks)
            {
                s = new EffectSystem_SparkSpread();
                s.set_up(2, 1, location);
                s.start();
            }
            i = null;
            i = 1;

            while ((i ?? 0) <= this.gibtypes.len)
            {
                if (Lang13.Bool(this.gibamounts[i]))
                {
                    j = null;
                    j = 1;

                    while ((j ?? 0) <= Convert.ToDouble(this.gibamounts[i]))
                    {
                        gibType = this.gibtypes[i];
                        gib     = Lang13.Call(gibType, location);

                        if (location is Mob_Living_Carbon)
                        {
                            digester = location;
                            ((dynamic)digester).stomach_contents += gib;
                        }

                        if (viruses.len > 0)
                        {
                            foreach (dynamic _a in Lang13.Enumerate(viruses, typeof(Disease)))
                            {
                                D = _a;


                                if (Rand13.PercentChance(this.virusProb))
                                {
                                    viruus        = D.Copy(true);
                                    gib.viruses  += viruus;
                                    viruus.holder = gib;
                                }
                            }
                        }

                        if (MobDNA != null)
                        {
                            gib.blood_DNA[MobDNA.unique_enzymes] = MobDNA.blood_type;
                        }
                        else if (this is Obj_Effect_Gibspawner_Generic)
                        {
                            gib.blood_DNA["Non-human DNA"] = "A+";
                        }
                        directions = this.gibdirections[i];

                        if (this.loc is Tile)
                        {
                            if (directions.len != 0)
                            {
                                gib.streak(directions);
                            }
                        }
                        j++;
                    }
                }
                i++;
            }
            GlobalFuncs.qdel(this);
            return;
        }
Пример #5
0
 // Function from file: gibs.dm
 public Obj_Effect_Gibspawner(dynamic location = null, ByTable viruses = null, Dna MobDNA = null) : base((object)(location))
 {
     // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
     this.Gib(this.loc, viruses, MobDNA);
     return;
 }