// Function from file: mecha_pilot.dm
        public override bool handle_automated_action(  )
        {
            Obj_Mecha_Combat C = null;
            ByTable          L = null;
            int threat_count   = 0;


            if (base.handle_automated_action())
            {
                if (!(this.mecha != null))
                {
                    foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRange(this.vision_range, this), typeof(Obj_Mecha_Combat)))
                    {
                        C = _a;


                        if (this.is_valid_mecha(C))
                        {
                            this.target           = C;
                            this.minimum_distance = 1;
                            this.ranged           = false;
                            break;
                        }
                    }
                }

                if (this.mecha != null)
                {
                    L            = this.PossibleThreats();
                    threat_count = L.len;

                    if (!this.mecha.has_charge(this.mecha_charge_evacuate))
                    {
                        this.exit_mecha(this.mecha);
                        return(false);
                    }

                    if (this.mecha.health < Convert.ToDouble(Lang13.Initial(this.mecha, "health") * 0.1))
                    {
                        this.exit_mecha(this.mecha);
                        return(false);
                    }

                    if (threat_count >= this.threat_use_mecha_smoke && Rand13.PercentChance(this.smoke_chance))
                    {
                        if (this.mecha.smoke_action != null && Lang13.Bool(this.mecha.smoke_action.owner) && this.mecha.smoke != 0)
                        {
                            this.mecha.smoke_action.Activate();
                        }
                    }

                    if (this.mecha.health < Convert.ToDouble(Lang13.Initial(this.mecha, "health") * 0.25))
                    {
                        if (Rand13.PercentChance(this.defence_mode_chance))
                        {
                            if (this.mecha.defense_action != null && Lang13.Bool(this.mecha.defense_action.owner) && !Lang13.Bool(this.mecha.defence_mode))
                            {
                                this.mecha.leg_overload_mode = 0;
                                this.mecha.defense_action.Activate(GlobalVars.TRUE);
                                GlobalFuncs.addtimer(this.mecha.defense_action, "Activate", 100, GlobalVars.FALSE, GlobalVars.FALSE);
                            }
                        }
                        else if (Rand13.PercentChance(this.retreat_chance))
                        {
                            if (this.mecha.overload_action != null && Lang13.Bool(this.mecha.overload_action.owner) && !Lang13.Bool(this.mecha.leg_overload_mode))
                            {
                                this.mecha.overload_action.Activate(GlobalVars.TRUE);
                                GlobalFuncs.addtimer(this.mecha.overload_action, "Activate", 100, GlobalVars.FALSE, GlobalVars.FALSE);
                            }
                            this.retreat_distance = 50;
                            Task13.Schedule(100, (Task13.Closure)(() => {
                                this.retreat_distance = 0;
                                return;
                            }));
                        }
                    }
                }
            }
            return(false);
        }
Exemple #2
0
		// Function from file: musician.dm
		public void playsong( Mob user = null ) {
			ByTable cur_oct = null;
			ByTable cur_acc = null;
			double i = 0;
			dynamic line = null;
			dynamic beat = null;
			ByTable notes = null;
			dynamic note = null;
			int cur_note = 0;
			double i2 = 0;
			string ni = null;

			
			while (this.repeat >= 0) {
				cur_oct = null;
				cur_oct = new ByTable( 7 );
				cur_acc = null;
				cur_acc = new ByTable( 7 );

				foreach (dynamic _a in Lang13.IterateRange( 1, 7 )) {
					i = _a;
					
					cur_oct[i] = 3;
					cur_acc[i] = "n";
				}

				foreach (dynamic _e in Lang13.Enumerate( this.lines )) {
					line = _e;
					

					foreach (dynamic _d in Lang13.Enumerate( GlobalFuncs.splittext( String13.ToLower( line ), "," ) )) {
						beat = _d;
						
						notes = GlobalFuncs.splittext( beat, "/" );

						foreach (dynamic _c in Lang13.Enumerate( GlobalFuncs.splittext( notes[1], "-" ) )) {
							note = _c;
							

							if ( !this.playing || this.shouldStopPlaying( user ) ) {
								this.playing = false;
								return;
							}

							if ( Lang13.Length( note ) == 0 ) {
								continue;
							}
							cur_note = String13.GetCharCode( note, null ) - 96;

							if ( cur_note < 1 || cur_note > 7 ) {
								continue;
							}

							foreach (dynamic _b in Lang13.IterateRange( 2, Lang13.Length( note ) )) {
								i2 = _b;
								
								ni = String13.SubStr( note, ((int)( i2 )), ((int)( i2 + 1 )) );

								if ( !Lang13.Bool( String13.ParseNumber( ni ) ) ) {
									
									if ( ni == "#" || ni == "b" || ni == "n" ) {
										cur_acc[cur_note] = ni;
									} else if ( ni == "s" ) {
										cur_acc[cur_note] = "#";
									}
								} else {
									cur_oct[cur_note] = String13.ParseNumber( ni );
								}
							}
							this.playnote( cur_note, cur_acc[cur_note], Convert.ToInt32( cur_oct[cur_note] ) );
						}

						if ( notes.len >= 2 && Lang13.Bool( String13.ParseNumber( notes[2] ) ) ) {
							Task13.Sleep( this.sanitize_tempo( this.tempo / ( String13.ParseNumber( notes[2] ) ??0) ) );
						} else {
							Task13.Sleep( ((int)( this.tempo )) );
						}
					}
				}
				this.repeat--;

				if ( this.repeat >= 0 ) {
					this.updateDialog( user );
				}
			}
			this.playing = false;
			this.repeat = 0;
			this.updateDialog( user );
			return;
		}
        // Function from file: magnet.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            Signal signal  = null;
            string newpath = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }
            Task13.User.set_machine(this);

            if (Lang13.Bool(href_list["radio-op"]))
            {
                signal = new Signal();
                signal.transmission_method = 1;
                signal.source       = this;
                signal.frequency    = this.frequency;
                signal.data["code"] = this.code;

                dynamic _a = href_list["radio-op"];                 // Was a switch-case, sorry for the mess.
                if (_a == "togglepower")
                {
                    signal.data["command"] = "toggle-power";
                }
                else if (_a == "minuselec")
                {
                    signal.data["command"] = "sub-elec";
                }
                else if (_a == "pluselec")
                {
                    signal.data["command"] = "add-elec";
                }
                else if (_a == "minusmag")
                {
                    signal.data["command"] = "sub-mag";
                }
                else if (_a == "plusmag")
                {
                    signal.data["command"] = "add-mag";
                }
                this.radio_connection.post_signal(this, signal, GlobalVars.RADIO_MAGNETS);
                Task13.Schedule(1, (Task13.Closure)(() => {
                    this.updateUsrDialog();
                    return;
                }));
            }

            if (Lang13.Bool(href_list["operation"]))
            {
                dynamic _b = href_list["operation"];                 // Was a switch-case, sorry for the mess.
                if (_b == "plusspeed")
                {
                    this.speed++;

                    if (this.speed > 10)
                    {
                        this.speed = 10;
                    }
                }
                else if (_b == "minusspeed")
                {
                    this.speed--;

                    if (this.speed <= 0)
                    {
                        this.speed = 1;
                    }
                }
                else if (_b == "setpath")
                {
                    newpath = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(Task13.User, "Please define a new path!", null, this.path, null, InputType.Str | InputType.Null)), 1, 1024);

                    if (Lang13.Bool(newpath) && newpath != "")
                    {
                        this.moving  = false;
                        this.path    = newpath;
                        this.pathpos = 1;
                        this.filter_path();
                    }
                }
                else if (_b == "togglemoving")
                {
                    this.moving = !this.moving;

                    if (this.moving)
                    {
                        Task13.Schedule(0, (Task13.Closure)(() => {
                            this.MagnetMove();
                            return;
                        }));
                    }
                }
            }
            this.updateUsrDialog();
            return(null);
        }
Exemple #4
0
 static void Main(string[] args)
 {
     Task13.ExecuteTask();
     Task14.ExecuteTask();
 }
Exemple #5
0
        // Function from file: headcrab.dm
        public override dynamic sting_action(Mob user = null, Ent_Static target = null)
        {
            Mind    M                 = null;
            ByTable organs            = null;
            Obj_Item_Organ_Internal I = null;
            Mob_Living_Carbon_Human H = null;
            Mob_Living_Silicon      S = null;
            dynamic turf              = null;
            Mob_Living_SimpleAnimal_Hostile_Headcrab crab = null;
            Obj_Item_Organ_Internal I2 = null;

            M      = user.mind;
            organs = user.getorganszone("head", true);

            foreach (dynamic _a in Lang13.Enumerate(organs, typeof(Obj_Item_Organ_Internal)))
            {
                I = _a;

                I.Remove(user, true);
            }
            GlobalFuncs.explosion(GlobalFuncs.get_turf(user), 0, 0, 2, 0, null, null, null, true);

            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInRange(user, 2), typeof(Mob_Living_Carbon_Human)))
            {
                H = _b;

                H.WriteMsg("<span class='userdanger'>You are blinded by a shower of blood!</span>");
                H.Stun(1);
                H.blur_eyes(20);
                H.adjust_eye_damage(5);
                H.confused += 3;
            }

            foreach (dynamic _c in Lang13.Enumerate(Map13.FetchInRange(user, 2), typeof(Mob_Living_Silicon)))
            {
                S = _c;

                S.WriteMsg("<span class='userdanger'>Your sensors are disabled by a shower of blood!</span>");
                S.Weaken(3);
            }
            turf = GlobalFuncs.get_turf(user);
            Task13.Schedule(5, (Task13.Closure)(() => {
                crab = new Mob_Living_SimpleAnimal_Hostile_Headcrab(turf);

                foreach (dynamic _d in Lang13.Enumerate(organs, typeof(Obj_Item_Organ_Internal)))
                {
                    I2 = _d;

                    I2.loc = crab;
                }
                crab.origin = M;

                if (crab.origin != null)
                {
                    crab.origin.active = true;
                    crab.origin.transfer_to(crab);
                    crab.WriteMsg("<span class='warning'>You burst out of the remains of your former body in a shower of gore!</span>");
                }
                return;
            }));
            user.gib();
            GlobalFuncs.feedback_add_details("changeling_powers", "LR");
            return(1);
        }
        // Function from file: shadowling_abilities.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            Mob_Living_Carbon_Human target = null;
            int?progress = null;
            Obj_Item_Weapon_Implant_Loyalty L = null;

            GlobalFuncs.listclearnulls(GlobalVars.ticker.mode.thralls);

            if (!GlobalVars.ticker.mode.shadows.Contains(thearea.mind))
            {
                return(false);
            }

            if (thearea.dna.species.id != "shadowling")
            {
                if (GlobalVars.ticker.mode.thralls.len >= 5)
                {
                    this.revert_cast();
                    return(false);
                }
            }

            foreach (dynamic _c in Lang13.Enumerate(targets, typeof(Mob_Living_Carbon_Human)))
            {
                target = _c;


                if (!(Map13.GetDistance(thearea, target) <= 1))
                {
                    thearea.WriteMsg("<span class='warning'>You need to be closer to enthrall " + target + "!</span>");
                    this.revert_cast();
                    return(false);
                }

                if (!Lang13.Bool(target.key) || !(target.mind != null))
                {
                    thearea.WriteMsg("<span class='warning'>The target has no mind!</span>");
                    this.revert_cast();
                    return(false);
                }

                if (target.stat != 0)
                {
                    thearea.WriteMsg("<span class='warning'>The target must be conscious!</span>");
                    this.revert_cast();
                    return(false);
                }

                if (GlobalFuncs.is_shadow_or_thrall(target))
                {
                    thearea.WriteMsg("<span class='warning'>You can not enthrall allies!</span>");
                    this.revert_cast();
                    return(false);
                }

                if (!(target is Mob_Living_Carbon_Human))
                {
                    thearea.WriteMsg("<span class='warning'>You can only enthrall humans!</span>");
                    this.revert_cast();
                    return(false);
                }

                if (this.enthralling)
                {
                    thearea.WriteMsg("<span class='warning'>You are already enthralling!</span>");
                    this.revert_cast();
                    return(false);
                }

                if (!(target.client != null))
                {
                    thearea.WriteMsg("<span class='warning'>" + target + "'s mind is vacant of activity.</span>");
                }
                this.enthralling = true;
                thearea.WriteMsg("<span class='danger'>This target is valid. You begin the enthralling...</span>");
                target.WriteMsg("<span class='userdanger'>" + thearea + " stares at you. You feel your head begin to pulse.</span>");
                progress = null;
                progress = 0;

                while ((progress ?? 0) <= 3)
                {
                    switch ((int?)(progress))
                    {
                    case 1:
                        thearea.WriteMsg("<span class='notice'>You place your hands to " + target + "'s head...</span>");
                        ((Ent_Static)thearea).visible_message("<span class='warning'>" + thearea + " places their hands onto the sides of " + target + "'s head!</span>");
                        break;

                    case 2:
                        thearea.WriteMsg("<span class='notice'>You begin preparing " + target + "'s mind as a blank slate...</span>");
                        ((Ent_Static)thearea).visible_message("<span class='warning'>" + thearea + "'s palms flare a bright red against " + target + "'s temples!</span>");
                        target.WriteMsg("<span class='danger'>A terrible red light floods your mind. You collapse as conscious thought is wiped away.</span>");
                        target.Weaken(12);
                        Task13.Sleep(20);

                        if (GlobalFuncs.isloyal(target))
                        {
                            thearea.WriteMsg("<span class='notice'>They are enslaved by Nanotrasen. You begin to shut down the nanobot implant - this will take some time.</span>");
                            ((Ent_Static)thearea).visible_message("<span class='warning'>" + thearea + " pauses, then dips their head in concentration!</span>");
                            target.WriteMsg("<span class='boldannounce'>You feel your loyalties begin to weaken!</span>");
                            Task13.Sleep(100);
                            thearea.WriteMsg("<span class='notice'>The nanobots composing the loyalty implant have been rendered inert. Now to continue.</span>");
                            ((Ent_Static)thearea).visible_message("<span class='warning'>" + thearea + " relaxes again.</span>");

                            foreach (dynamic _a in Lang13.Enumerate(target, typeof(Obj_Item_Weapon_Implant_Loyalty)))
                            {
                                L = _a;


                                if (L != null && Lang13.Bool(L.implanted))
                                {
                                    GlobalFuncs.qdel(L);
                                }
                            }
                            target.WriteMsg("<span class='boldannounce'>Your unwavering loyalty to Nanotrasen unexpectedly falters, dims, dies.</span>");
                        }
                        break;

                    case 3:
                        thearea.WriteMsg("<span class='notice'>You begin planting the tumor that will control the new thrall...</span>");
                        ((Ent_Static)thearea).visible_message("<span class='warning'>A strange energy passes from " + thearea + "'s hands into " + target + "'s head!</span>");
                        target.WriteMsg("<span class='boldannounce'>You feel your memories twisting, morphing. A sense of horror dominates your mind.</span>");
                        break;
                    }

                    if (!GlobalFuncs.do_mob(thearea, target, 70))
                    {
                        thearea.WriteMsg("<span class='warning'>The enthralling has been interrupted - your target's mind returns to its previous state.</span>");
                        target.WriteMsg("<span class='userdanger'>You wrest yourself away from " + thearea + "'s hands and compose yourself</span>");
                        this.enthralling = false;
                        return(false);
                    }
                    progress++;
                }
                this.enthralling = false;
                thearea.WriteMsg("<span class='shadowling'>You have enthralled <b>" + target.real_name + "</b>!</span>");
                target.visible_message("<span class='big'>" + target + " looks to have experienced a revelation!</span>", "<span class='warning'>False faces all d<b>ark not real not real not--</b></span>");
                target.setOxyLoss(0);
                target.mind.special_role = "thrall";
                ((GameMode)GlobalVars.ticker.mode).add_thrall(target.mind);
            }
            return(false);
        }
Exemple #7
0
        // Function from file: watertank.dm
        public override bool afterattack(dynamic target = null, dynamic user = null, bool?proximity_flag = null, string click_parameters = null)
        {
            bool     Adj = false;
            Reagents R   = null;
            Obj_Effect_NanofrostContainer A = null;
            int?    a = null;
            dynamic F = null;


            if (this.nozzle_mode == 0)
            {
                base.afterattack((object)(target), (object)(user), proximity_flag, click_parameters);
                return(false);
            }
            Adj = ((Ent_Static)user).Adjacent(target);

            if (Adj)
            {
                this.AttemptRefill(target, user);
            }

            if (this.nozzle_mode == 1)
            {
                if (Adj)
                {
                    return(false);
                }
                R = this.reagents;

                if ((R.total_volume ?? 0) < 100)
                {
                    user.WriteMsg("<span class='warning'>You need at least 100 units of water to use the nanofrost launcher!</span>");
                    return(false);
                }

                if (this.nanofrost_cooldown)
                {
                    user.WriteMsg("<span class='warning'>Nanofrost launcher is still recharging...</span>");
                    return(false);
                }
                this.nanofrost_cooldown = true;
                R.remove_any(100);
                A = new Obj_Effect_NanofrostContainer(GlobalFuncs.get_turf(this));
                GlobalFuncs.log_game("" + user.ckey + " (" + user.name + ") used Nanofrost at " + GlobalFuncs.get_area(user) + " (" + user.x + ", " + user.y + ", " + user.z + ").");
                GlobalFuncs.playsound(this, "sound/items/syringeproj.ogg", 40, 1);
                a = null;
                a = 0;

                while ((a ?? 0) < 5)
                {
                    Map13.StepTowardsSimple(A, target);
                    Task13.Sleep(2);
                    a++;
                }
                A.Smoke();
                Task13.Schedule(100, (Task13.Closure)(() => {
                    if (this != null)
                    {
                        this.nanofrost_cooldown = false;
                    }
                    return;
                }));
                return(false);
            }

            if (this.nozzle_mode == 2)
            {
                if (!Adj || !(target is Tile))
                {
                    return(false);
                }

                if (this.metal_synthesis_cooldown < 5)
                {
                    F        = GlobalFuncs.PoolOrNew(typeof(Obj_Effect_ParticleEffect_Foam_Metal), GlobalFuncs.get_turf(target));
                    F.amount = 0;
                    this.metal_synthesis_cooldown++;
                    Task13.Schedule(100, (Task13.Closure)(() => {
                        this.metal_synthesis_cooldown--;
                        return;
                    }));
                }
                else
                {
                    user.WriteMsg("<span class='warning'>Metal foam mix is still being synthesized...</span>");
                    return(false);
                }
            }
            return(false);
        }
Exemple #8
0
        // Function from file: energy_net_nets.dm
        public override int?process(dynamic seconds = null)
        {
            int      check    = 0;
            string   mob_name = null;
            Obj_Item W        = null;
            EffectSystem_SparkSpread spark_system = null;
            dynamic O = null;

            check               = 30;
            mob_name            = this.affecting.name;
            seconds.notransform = 1;

            while (!(seconds == null) && !(this == null) && check > 0)
            {
                check--;
                Task13.Sleep(10);
            }

            if (seconds == null || seconds.loc != this.loc)
            {
                if (!(this.master == null))
                {
                    this.master.WriteMsg(new Txt("<span class='userdanger'>ERROR</span>: unable to locate ").the(mob_name).item().str(". Procedure terminated.").ToString());
                }
                GlobalFuncs.qdel(this);
                seconds.notransform = 0;
                return(null);
            }

            if (!(this == null))
            {
                this.density      = false;
                this.invisibility = 101;
                this.health       = Double.PositiveInfinity;

                foreach (dynamic _a in Lang13.Enumerate(seconds, typeof(Obj_Item)))
                {
                    W = _a;


                    if (seconds is Mob_Living_Carbon_Human)
                    {
                        if (W == seconds.w_uniform)
                        {
                            continue;
                        }

                        if (W == seconds.shoes)
                        {
                            continue;
                        }
                    }
                    ((Mob)seconds).unEquip(W);
                }
                Task13.Schedule(0, (Task13.Closure)(() => {
                    GlobalFuncs.playsound(seconds.loc, "sound/effects/sparks4.ogg", 50, 1);
                    GlobalFuncs.anim(seconds.loc, seconds, "icons/mob/mob.dmi", null, "phaseout", null, Convert.ToInt32(seconds.dir));
                    return;
                }));
                seconds.loc = Rand13.PickFromTable(GlobalVars.holdingfacility);
                seconds.WriteMsg("<span class='danger'>You appear in a strange place!</span>");
                Task13.Schedule(0, (Task13.Closure)(() => {
                    spark_system = new EffectSystem_SparkSpread();
                    spark_system.set_up(5, 0, seconds.loc);
                    spark_system.start();
                    GlobalFuncs.playsound(seconds.loc, "sound/effects/phasein.ogg", 25, 1);
                    GlobalFuncs.playsound(seconds.loc, "sound/effects/sparks2.ogg", 50, 1);
                    GlobalFuncs.anim(seconds.loc, seconds, "icons/mob/mob.dmi", null, "phasein", null, Convert.ToInt32(seconds.dir));
                    GlobalFuncs.qdel(this);
                    return;
                }));

                foreach (dynamic _b in Lang13.Enumerate(Map13.FetchViewers(3, this)))
                {
                    O = _b;

                    O.show_message("" + seconds + " vanishes!", 1, "<span class='italics'>You hear sparks flying!</span>", 2);
                }

                if (!(this.master == null))
                {
                    this.master.WriteMsg(new Txt("<span class='notice'><b>SUCCESS</b>: transport procedure of ").the(this.affecting).item().str(" complete.</span>").ToString());
                }
                seconds.notransform = 0;
            }
            else
            {
                seconds.WriteMsg("<span class='notice'>You are free of the net!</span>");
                seconds.notransform = 0;
            }
            return(null);
        }
Exemple #9
0
        // Function from file: blob_reagents.dm
        public void reagent_vortex(dynamic M = null, int setting_type = 0, double?reac_volume = null)
        {
            dynamic     pull         = null;
            int         range_power  = 0;
            Ent_Dynamic X            = null;
            Ent_Dynamic L            = null;
            double?     distance     = null;
            int         moving_power = 0;
            dynamic     throw_target = null;
            double?     throw_range  = null;
            double      i            = 0;
            double      i2           = 0;


            if (Lang13.Bool(M))
            {
                pull        = GlobalFuncs.get_turf(M);
                range_power = Num13.MaxInt(1, Num13.MinInt(((int)(Num13.Round((reac_volume ?? 0) / 5, 1))), 5));

                foreach (dynamic _c in Lang13.Enumerate(Map13.FetchInRange(pull, range_power), typeof(Ent_Dynamic)))
                {
                    X = _c;


                    if (X is Obj_Effect)
                    {
                        continue;
                    }

                    if (X is Mob_Living)
                    {
                        L = X;

                        if (Lang13.Bool(((dynamic)L).faction.Contains("blob")))
                        {
                            continue;
                        }
                    }

                    if (!Lang13.Bool(X.anchored))
                    {
                        distance     = Map13.GetDistance(X, pull);
                        moving_power = Num13.MaxInt(((int)(range_power - (distance ?? 0))), 1);

                        if (moving_power > 2)
                        {
                            if (setting_type != 0)
                            {
                                throw_target = GlobalFuncs.get_edge_target_turf(X, Map13.GetDistance(X, Map13.GetStepAway(X, pull, null)));
                                throw_range  = 5 - (distance ?? 0);
                                X.throw_at_fast(throw_target, throw_range, 1);
                            }
                            else
                            {
                                X.throw_at_fast(pull, distance, 1);
                            }
                        }
                        else
                        {
                            Task13.Schedule(0, (Task13.Closure)(() => {
                                if (setting_type != 0)
                                {
                                    foreach (dynamic _a in Lang13.IterateRange(0, moving_power - 1))
                                    {
                                        i = _a;

                                        Task13.Sleep(2);
                                        Map13.StepAway(X, pull, null);

                                        if (!false)
                                        {
                                            break;
                                        }
                                    }
                                }
                                else
                                {
                                    foreach (dynamic _b in Lang13.IterateRange(0, moving_power - 1))
                                    {
                                        i2 = _b;

                                        Task13.Sleep(2);
                                        Map13.StepTowardsSimple(X, pull);

                                        if (!false)
                                        {
                                            break;
                                        }
                                    }
                                }
                                return;
                            }));
                        }
                    }
                }
            }
            return;
        }
Exemple #10
0
        // Function from file: projectile.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            Mob_Living         target          = null;
            dynamic            projectile      = null;
            Type               projectile_type = null;
            Ent_Static         current_loc     = null;
            int?               i     = null;
            Obj_Effect_Overlay trail = null;

            this.playMagSound();

            foreach (dynamic _a in Lang13.Enumerate(targets, typeof(Mob_Living)))
            {
                target = _a;

                Task13.Schedule(0, (Task13.Closure)(() => {
                    projectile = null;

                    if (this.proj_type is string)
                    {
                        projectile_type = Lang13.FindClass(this.proj_type);
                        projectile      = Lang13.Call(projectile_type, thearea);
                    }

                    if (this.proj_type is Obj_Effect_ProcHolder_Spell)
                    {
                        projectile = new Obj_Effect_ProcHolder_Spell_Targeted_Trigger(thearea);
                        projectile.linked_spells.Add(this.proj_type);
                    }
                    projectile.icon       = this.proj_icon;
                    projectile.icon_state = this.proj_icon_state;
                    projectile.dir        = Map13.GetDistance(target, projectile);
                    projectile.name       = this.proj_name;
                    current_loc           = thearea.loc;
                    projectile.loc        = current_loc;
                    i = null;
                    i = 0;

                    while ((i ?? 0) < (this.proj_lifespan ?? 0))
                    {
                        if (!Lang13.Bool(projectile))
                        {
                            break;
                        }

                        if (this.proj_homing)
                        {
                            if (this.proj_insubstantial)
                            {
                                projectile.dir = Map13.GetDistance(projectile, target);
                                projectile.loc = Map13.GetStepTowards(projectile, target, 0);
                            }
                            else
                            {
                                Map13.StepTowards(projectile, target, 0);
                            }
                        }
                        else if (this.proj_insubstantial)
                        {
                            projectile.loc = Map13.GetStep(projectile, this.dir);
                        }
                        else
                        {
                            Map13.Step(projectile, this.dir);
                        }

                        if (!Lang13.Bool(projectile))
                        {
                            break;
                        }

                        if (!(target != null) || !this.proj_lingering && projectile.loc == current_loc)
                        {
                            GlobalFuncs.qdel(projectile);
                            break;
                        }

                        if (this.proj_trail && Lang13.Bool(projectile))
                        {
                            Task13.Schedule(0, (Task13.Closure)(() => {
                                if (Lang13.Bool(projectile))
                                {
                                    trail            = new Obj_Effect_Overlay(projectile.loc);
                                    trail.icon       = this.proj_trail_icon;
                                    trail.icon_state = this.proj_trail_icon_state;
                                    trail.density    = false;
                                    Task13.Schedule(this.proj_trail_lifespan, (Task13.Closure)(() => {
                                        GlobalFuncs.qdel(trail);
                                        return;
                                    }));
                                }
                                return;
                            }));
                        }

                        if (Map13.FetchInRange(this.proj_trigger_range, target.loc).Contains(projectile.loc))
                        {
                            ((Obj_Effect_ProcHolder_Spell)projectile).perform(new ByTable(new object [] { target }), null, thearea);
                            break;
                        }
                        current_loc = projectile.loc;
                        Task13.Sleep(this.proj_step_delay);
                        i++;
                    }

                    if (Lang13.Bool(projectile))
                    {
                        GlobalFuncs.qdel(projectile);
                    }
                    return;
                }));
            }
            return(false);
        }
        // Function from file: processor.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            double  total_time = 0;
            dynamic O          = null;
            dynamic P          = null;
            int     offset     = 0;
            dynamic O2         = null;
            dynamic P2         = null;


            if (this.stat != 0)
            {
                return(null);
            }

            if (this.processing)
            {
                a.WriteMsg("<span class='warning'>The processor is in the process of processing!</span>");
                return(1);
            }

            if (this.contents.len == 0)
            {
                a.WriteMsg("<span class='warning'>The processor is empty!</span>");
                return(1);
            }
            this.processing = true;
            ((Ent_Static)a).visible_message("" + a + " turns on " + this + ".", "<span class='notice'>You turn on " + this + ".</span>", "<span class='italics'>You hear a food processor.</span>");
            GlobalFuncs.playsound(this.loc, "sound/machines/blender.ogg", 50, 1);
            this.f_use_power(500);
            total_time = 0;

            foreach (dynamic _a in Lang13.Enumerate(this.contents))
            {
                O = _a;

                P = this.select_recipe(O);

                if (!Lang13.Bool(P))
                {
                    GlobalFuncs.log_admin("DEBUG: " + O + " in processor havent suitable recipe. How do you put it in?");
                    continue;
                }
                total_time += Convert.ToDouble(P.time);
            }
            offset = (Rand13.PercentChance(50) ? -2 : 2);
            Icon13.Animate(new ByTable().Set(1, this).Set("pixel_x", this.pixel_x + offset).Set("time", 0.2).Set("loop", total_time / Convert.ToDouble(this.rating_speed) * 5));
            Task13.Sleep(((int)(total_time / Convert.ToDouble(this.rating_speed))));

            foreach (dynamic _b in Lang13.Enumerate(this.contents))
            {
                O2 = _b;

                P2 = this.select_recipe(O2);

                if (!Lang13.Bool(P2))
                {
                    GlobalFuncs.log_admin("DEBUG: " + O2 + " in processor havent suitable recipe. How do you put it in?");
                    continue;
                }
                ((FoodProcessorProcess)P2).process_food(this.loc, O2, this);
            }
            this.pixel_x    = Convert.ToInt32(Lang13.Initial(this, "pixel_x"));
            this.processing = false;
            this.visible_message(new Txt().the(this).item().str(" finishes processing.").ToString());
            return(null);
        }