Esempio n. 1
0
        // Function from file: easter.dm
        public override bool start(  )
        {
            Obj_Effect_Landmark R = null;


            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.landmarks_list, typeof(Obj_Effect_Landmark)))
            {
                R = _a;


                if (R.name != "blobspawn")
                {
                    if (Rand13.PercentChance(35))
                    {
                        if (R.loc is Tile_Space)
                        {
                            new Mob_Living_SimpleAnimal_Chicken_Rabbit_Space(R.loc);
                        }
                        else
                        {
                            new Mob_Living_SimpleAnimal_Chicken_Rabbit(R.loc);
                        }
                    }
                }
            }
            return(false);
        }
Esempio n. 2
0
 // Function from file: capture_the_flag.dm
 public Obj_Item_Weapon_Twohanded_Required_Ctf(dynamic loc = null) : base((object)(loc))
 {
     if (!(this.reset != null))
     {
         this.reset = new Obj_Effect_Landmark(GlobalFuncs.get_turf(this));
     }
     return;
 }
Esempio n. 3
0
 // Function from file: capture_the_flag.dm
 public override void initialize(  )
 {
     if (!(this.reset != null))
     {
         this.reset = new Obj_Effect_Landmark(GlobalFuncs.get_turf(this));
     }
     return;
 }
Esempio n. 4
0
        // Function from file: electrical_storm.dm
        public override bool start(  )
        {
            ByTable                 epicentreList      = null;
            int?                    i                  = null;
            ByTable                 possibleEpicentres = null;
            Obj_Effect_Landmark     newEpicentre       = null;
            Obj_Effect_Landmark     epicentre          = null;
            Obj_Machinery_Power_Apc apc                = null;

            epicentreList = new ByTable();
            i             = null;
            i             = 1;

            while ((i ?? 0) <= (this.lightsoutAmount ?? 0))
            {
                possibleEpicentres = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.landmarks_list, typeof(Obj_Effect_Landmark)))
                {
                    newEpicentre = _a;


                    if (newEpicentre.name == "lightsout" && !epicentreList.Contains(newEpicentre))
                    {
                        possibleEpicentres.Add(newEpicentre);
                    }
                }

                if (possibleEpicentres.len != 0)
                {
                    epicentreList.Add(Rand13.PickFromTable(possibleEpicentres));
                }
                else
                {
                    break;
                }
                i++;
            }

            if (!(epicentreList.len != 0))
            {
                return(false);
            }

            foreach (dynamic _c in Lang13.Enumerate(epicentreList, typeof(Obj_Effect_Landmark)))
            {
                epicentre = _c;


                foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.ultra_range(this.lightsoutRange, epicentre), typeof(Obj_Machinery_Power_Apc)))
                {
                    apc = _b;

                    apc.overload_lighting();
                }
            }
            return(false);
        }
        // Function from file: halloween.dm
        public override bool start(  )
        {
            Obj_Effect_Landmark C = null;


            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.landmarks_list, typeof(Obj_Effect_Landmark)))
            {
                C = _a;


                if (C.name == "carpspawn")
                {
                    new Mob_Living_SimpleAnimal_Hostile_Carp_Eyeball(C.loc);
                }
            }
            return(false);
        }
Esempio n. 6
0
        // Function from file: revenant_spawn_event.dm
        public bool get_revenant(bool?end_if_fail = null)
        {
            end_if_fail = end_if_fail ?? false;

            int                 deadMobs            = 0;
            dynamic             M                   = null;
            ByTable             candidates          = null;
            dynamic             C                   = null;
            Mind                player_mind         = null;
            ByTable             spawn_locs          = null;
            Obj_Effect_Landmark L                   = null;
            Obj_Effect_Landmark L2                  = null;
            Mob_Living_SimpleAnimal_Revenant revvie = null;

            deadMobs = 0;

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.dead_mob_list))
            {
                M = _a;

                deadMobs++;
            }

            if (deadMobs < 10)
            {
                GlobalFuncs.message_admins("Random event attempted to spawn a revenant, but there were only " + deadMobs + "/" + 10 + " dead mobs.");
                return(false);
            }
            this.key_of_revenant = null;

            if (!Lang13.Bool(this.key_of_revenant))
            {
                candidates = GlobalFuncs.get_candidates("revenant");

                if (!(candidates.len != 0))
                {
                    if (end_if_fail == true)
                    {
                        return(false);
                    }
                    this.find_revenant(); return(false);
                }
                C = Rand13.PickFromTable(candidates);
                this.key_of_revenant = C.key;
            }

            if (!Lang13.Bool(this.key_of_revenant))
            {
                if (end_if_fail == true)
                {
                    return(false);
                }
                this.find_revenant(); return(false);
            }
            player_mind        = new Mind(this.key_of_revenant);
            player_mind.active = true;
            spawn_locs         = new ByTable();

            foreach (dynamic _c in Lang13.Enumerate(GlobalVars.landmarks_list, typeof(Obj_Effect_Landmark)))
            {
                L = _c;


                if (L.loc is Tile)
                {
                    switch ((string)(L.name))
                    {
                    case "revenantspawn":
                        spawn_locs.Add(L.loc);
                        break;
                    }
                }
            }

            if (!(spawn_locs != null))
            {
                foreach (dynamic _e in Lang13.Enumerate(GlobalVars.landmarks_list, typeof(Obj_Effect_Landmark)))
                {
                    L2 = _e;


                    if (L2.loc is Tile)
                    {
                        switch ((string)(L2.name))
                        {
                        case "carpspawn":
                            spawn_locs.Add(L2.loc);
                            break;
                        }
                    }
                }
            }

            if (!(spawn_locs != null))
            {
                spawn_locs.Add(GlobalFuncs.get_turf(player_mind.current));
            }

            if (!(spawn_locs != null))
            {
                this.find_revenant(); return(false);
            }
            revvie = new Mob_Living_SimpleAnimal_Revenant(Rand13.PickFromTable(spawn_locs));
            player_mind.transfer_to(revvie);
            player_mind.assigned_role = "revenant";
            player_mind.special_role  = "Revenant";
            GlobalVars.ticker.mode.traitors.Or(player_mind);
            GlobalFuncs.message_admins("" + this.key_of_revenant + " has been made into a revenant by an event.");
            GlobalFuncs.log_game("" + this.key_of_revenant + " was spawned as a revenant by an event.");
            return(true);
        }
Esempio n. 7
0
		// Function from file: operative.dm
		public bool get_operative( bool? end_if_fail = null ) {
			end_if_fail = end_if_fail ?? false;

			ByTable candidates = null;
			dynamic C = null;
			Mind player_mind = null;
			ByTable spawn_locs = null;
			Obj_Effect_Landmark L = null;
			Mob_Living_Carbon_Human operative = null;
			Preferences A = null;
			Mind Mind = null;
			dynamic nuke = null;
			dynamic nuke_code = null;
			Objective_Nuclear O = null;

			this.key_of_operative = null;

			if ( !Lang13.Bool( this.key_of_operative ) ) {
				candidates = GlobalFuncs.get_candidates( "operative", 3000, "operative" );

				if ( !( candidates.len != 0 ) ) {
					
					if ( end_if_fail == true ) {
						return false;
					}
					this.find_operative(); return false;
				}
				C = Rand13.PickFromTable( candidates );
				this.key_of_operative = C.key;
			}

			if ( !Lang13.Bool( this.key_of_operative ) ) {
				
				if ( end_if_fail == true ) {
					return false;
				}
				this.find_operative(); return false;
			}
			player_mind = new Mind( this.key_of_operative );
			player_mind.active = true;
			spawn_locs = new ByTable();

			foreach (dynamic _a in Lang13.Enumerate( GlobalVars.landmarks_list, typeof(Obj_Effect_Landmark) )) {
				L = _a;
				

				if ( new ByTable(new object [] { "ninjaspawn", "carpspawn" }).Contains( L.name ) ) {
					spawn_locs.Add( L.loc );
				}
			}

			if ( !( spawn_locs.len != 0 ) ) {
				this.kill(); return false;
			}
			operative = new Mob_Living_Carbon_Human( Rand13.PickFromTable( spawn_locs ) );
			A = new Preferences();
			A.copy_to( operative );
			operative.dna.update_dna_identity();
			operative.equipOutfit( typeof(Outfit_Syndicate_Full) );
			Mind = new Mind( this.key_of_operative );
			Mind.assigned_role = "Lone Operative";
			Mind.special_role = "Lone Operative";
			GlobalVars.ticker.mode.traitors.Or( Mind );
			Mind.active = true;
			nuke = Lang13.FindIn( typeof(Obj_Machinery_Nuclearbomb_Selfdestruct), GlobalVars.machines );

			if ( Lang13.Bool( nuke ) ) {
				nuke_code = null;

				if ( !Lang13.Bool( nuke.r_code ) || nuke.r_code == "ADMIN" ) {
					nuke_code = "" + Rand13.Int( 10000, 99999 );
					nuke.r_code = nuke_code;
				} else {
					nuke_code = nuke.r_code;
				}
				Mind.store_memory( "<B>Station Self-Destruct Device Code</B>: " + nuke_code );
				Mind.current.WriteMsg( "The nuclear authorization code is: <B>" + nuke_code + "</B>" );
				O = new Objective_Nuclear();
				O.owner = Mind;
				Mind.objectives.Add( O );
			}
			Mind.transfer_to( operative );
			GlobalFuncs.message_admins( "" + this.key_of_operative + " has been made into lone operative by an event." );
			GlobalFuncs.log_game( "" + this.key_of_operative + " was spawned as a lone operative by an event." );
			return true;
		}
Esempio n. 8
0
        // Function from file: ninja_event.dm
        public override bool start(  )
        {
            ByTable             spawn_locs           = null;
            Obj_Effect_Landmark L                    = null;
            ByTable             candidates           = null;
            dynamic             C                    = null;
            Mind                    Mind             = null;
            ByTable                 possible_targets = null;
            Mind                    M                = null;
            ByTable                 objectives       = null;
            Objective_Download      O                = null;
            Objective_Steal_Special O2               = null;
            int?    selected              = null;
            Mind    M2                    = null;
            dynamic is_bad_guy            = null;
            Objective_Assassinate O3      = null;
            Objective_Protect     O4      = null;
            int?              selected2   = null;
            dynamic           M3          = null;
            dynamic           is_bad_guy2 = null;
            Objective_Debrain O5          = null;
            Objective_Capture O6          = null;
            Objective_Survive O7          = null;
            dynamic           N           = null;


            if (!Lang13.Bool(this.spawn_loc))
            {
                spawn_locs = new ByTable();

                foreach (dynamic _b in Lang13.Enumerate(GlobalVars.landmarks_list, typeof(Obj_Effect_Landmark)))
                {
                    L = _b;


                    if (L.loc is Tile)
                    {
                        switch ((string)(L.name))
                        {
                        case "ninjaspawn":
                        case "carpspawn":
                            spawn_locs.Add(L.loc);
                            break;
                        }
                    }
                }

                if (!(spawn_locs.len != 0))
                {
                    this.kill(); return(false);
                }
                this.spawn_loc = Rand13.PickFromTable(spawn_locs);
            }

            if (!Lang13.Bool(this.spawn_loc))
            {
                this.kill(); return(false);
            }

            if (!Lang13.Bool(this.key))
            {
                candidates = GlobalFuncs.get_candidates("space ninja");

                if (!(candidates.len != 0))
                {
                    this.kill(); return(false);
                }
                C        = Rand13.PickFromTable(candidates);
                this.key = C.key;
            }

            if (!Lang13.Bool(this.key))
            {
                this.kill(); return(false);
            }
            Mind             = GlobalFuncs.create_ninja_mind(this.key);
            Mind.active      = true;
            possible_targets = new ByTable();

            foreach (dynamic _c in Lang13.Enumerate(GlobalVars.ticker.minds, typeof(Mind)))
            {
                M = _c;


                if (Lang13.Bool(M.current) && Convert.ToInt32(M.current.stat) != 2)
                {
                    if (M.current is Mob_Living_Carbon_Human)
                    {
                        if (Lang13.Bool(M.special_role))
                        {
                            possible_targets[M] = 0;
                        }
                        else if (GlobalVars.command_positions.Contains(M.assigned_role))
                        {
                            possible_targets[M] = 1;
                        }
                    }
                }
            }
            objectives = new ByTable(new object [] { 1, 2, 3, 4 });

            while (Mind.objectives.len < 6)
            {
                dynamic _d = GlobalFuncs.pick_n_take(objectives);                   // Was a switch-case, sorry for the mess.
                if (_d == 1)
                {
                    O       = new Objective_Download();
                    O.owner = Mind;
                    O.gen_amount_goal();
                    Mind.objectives.Add(O);
                }
                else if (_d == 2)
                {
                    O2       = new Objective_Steal_Special();
                    O2.owner = Mind;
                    Mind.objectives.Add(O2);
                }
                else if (_d == 3)
                {
                    if (!(possible_targets.len != 0))
                    {
                        continue;
                    }
                    selected   = Rand13.Int(1, possible_targets.len);
                    M2         = possible_targets[selected];
                    is_bad_guy = possible_targets[M2];
                    possible_targets.Cut(selected, (selected ?? 0) + 1);

                    if (Lang13.Bool(is_bad_guy ^ this.helping_station))
                    {
                        O3                  = new Objective_Assassinate();
                        O3.owner            = Mind;
                        O3.target           = M2;
                        O3.explanation_text = new Txt("Slay ").the(M2.current.real_name).item().str(", the ").item(M2.assigned_role).str(".").ToString();
                        Mind.objectives.Add(O3);
                    }
                    else
                    {
                        O4                  = new Objective_Protect();
                        O4.owner            = Mind;
                        O4.target           = M2;
                        O4.explanation_text = new Txt("Protect ").the(M2.current.real_name).item().str(", the ").item(M2.assigned_role).str(", from harm.").ToString();
                        Mind.objectives.Add(O4);
                    }
                }
                else if (_d == 4)
                {
                    if (!(possible_targets.len != 0))
                    {
                        continue;
                    }
                    selected2   = Rand13.Int(1, possible_targets.len);
                    M3          = possible_targets[selected2];
                    is_bad_guy2 = possible_targets[M3];
                    possible_targets.Cut(selected2, (selected2 ?? 0) + 1);

                    if (Lang13.Bool(is_bad_guy2 ^ this.helping_station))
                    {
                        O5                  = new Objective_Debrain();
                        O5.owner            = Mind;
                        O5.target           = M3;
                        O5.explanation_text = "Steal the brain of " + M3.current.real_name + ".";
                        Mind.objectives.Add(O5);
                    }
                    else
                    {
                        O6       = new Objective_Capture();
                        O6.owner = Mind;
                        O6.gen_amount_goal();
                        Mind.objectives.Add(O6);
                    }
                }
                else
                {
                    break;
                }
            }
            O7       = new Objective_Survive();
            O7.owner = Mind;
            Mind.objectives.Add(O7);
            Mind.store_memory("I am an elite mercenary assassin of the mighty Spider Clan. A <font color='red'><B>SPACE NINJA</B></font>!");
            Mind.store_memory("Suprise is my weapon. Shadows are my armor. Without them, I am nothing. (//initialize your suit by right clicking on it, to use abilities like stealth)!");
            Mind.store_memory("Officially, " + (this.helping_station != 0 ? "Nanotrasen" : "The Syndicate") + " are my employer.");
            this.Ninja = GlobalFuncs.create_space_ninja(this.spawn_loc);
            Mind.transfer_to(this.Ninja);

            if (this.Ninja.wear_suit is Obj_Item_Clothing_Suit_Space_SpaceNinja)
            {
                N = this.Ninja.wear_suit;
                ((Obj_Item_Clothing_Suit_Space_SpaceNinja)N).randomize_param();
            }
            this.Ninja.v_internal = this.Ninja.s_store;
            this.Ninja.update_internals_hud_icon(true);

            if (this.Ninja.mind != Mind)
            {
                throw new Exception("Ninja created with incorrect mind");
                return(false);
            }
            this.Ninja.WriteMsg(new Sound("sound/effects/ninja_greeting.ogg"));
            this.success_spawn = true;
            return(false);
        }
Esempio n. 9
0
        // Function from file: slaughterevent.dm
        public bool get_slaughter(bool?end_if_fail = null)
        {
            end_if_fail = end_if_fail ?? false;

            ByTable             candidates      = null;
            dynamic             C               = null;
            Mind                player_mind     = null;
            ByTable             spawn_locs      = null;
            Obj_Effect_Landmark L               = null;
            dynamic             holder          = null;
            Mob_Living_SimpleAnimal_Slaughter S = null;

            this.key_of_slaughter = null;

            if (!Lang13.Bool(this.key_of_slaughter))
            {
                candidates = GlobalFuncs.get_candidates("xenomorph");

                if (!(candidates.len != 0))
                {
                    if (end_if_fail == true)
                    {
                        return(false);
                    }
                    this.find_slaughter(); return(false);
                }
                C = Rand13.PickFromTable(candidates);
                this.key_of_slaughter = C.key;
            }

            if (!Lang13.Bool(this.key_of_slaughter))
            {
                if (end_if_fail == true)
                {
                    return(false);
                }
                this.find_slaughter(); return(false);
            }
            player_mind        = new Mind(this.key_of_slaughter);
            player_mind.active = true;
            spawn_locs         = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(GlobalVars.landmarks_list, typeof(Obj_Effect_Landmark)))
            {
                L = _b;


                if (L.loc is Tile)
                {
                    switch ((string)(L.name))
                    {
                    case "carpspawn":
                        spawn_locs.Add(L.loc);
                        break;
                    }
                }
            }

            if (!(spawn_locs != null))
            {
                this.find_slaughter(); return(false);
            }
            holder   = GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Dummy_Slaughter), Rand13.PickFromTable(spawn_locs));
            S        = new Mob_Living_SimpleAnimal_Slaughter(holder);
            S.holder = holder;
            player_mind.transfer_to(S);
            player_mind.assigned_role = "Slaughter Demon";
            player_mind.special_role  = "Slaughter Demon";
            GlobalVars.ticker.mode.traitors.Or(player_mind);
            S.WriteMsg(S.playstyle_string);
            S.WriteMsg("<B>You are currently not currently in the same plane of existence as the station. Blood Crawl near a blood pool to manifest.</B>");
            S.WriteMsg("sound/magic/demon_dies.ogg");
            GlobalFuncs.message_admins("" + this.key_of_slaughter + " has been made into a slaughter demon by an event.");
            GlobalFuncs.log_game("" + this.key_of_slaughter + " was spawned as a slaughter demon by an event.");
            return(true);
        }
Esempio n. 10
0
        // Function from file: nuclear.dm
        public override bool post_setup(bool?report = null)
        {
            ByTable             synd_spawn = null;
            Obj_Effect_Landmark A          = null;
            string  nuke_code       = null;
            bool    leader_selected = false;
            int     agent_number    = 0;
            int     spawnpos        = 0;
            Mind    synd_mind       = null;
            dynamic nuke            = null;

            synd_spawn = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.landmarks_list, typeof(Obj_Effect_Landmark)))
            {
                A = _a;


                if (A.name == "Syndicate-Spawn")
                {
                    synd_spawn.Add(GlobalFuncs.get_turf(A));
                    continue;
                }
            }
            nuke_code       = "" + Rand13.Int(10000, 99999);
            leader_selected = false;
            agent_number    = 1;
            spawnpos        = 1;

            foreach (dynamic _b in Lang13.Enumerate(this.syndicates, typeof(Mind)))
            {
                synd_mind = _b;


                if (spawnpos > synd_spawn.len)
                {
                    spawnpos = 2;
                }
                synd_mind.current.loc = synd_spawn[spawnpos];
                this.forge_syndicate_objectives(synd_mind);
                this.greet_syndicate(synd_mind);
                this.equip_syndicate(synd_mind.current);

                if (Lang13.Bool(nuke_code))
                {
                    synd_mind.store_memory("<B>Syndicate Nuclear Bomb Code</B>: " + nuke_code);
                    synd_mind.current.WriteMsg("The nuclear authorization code is: <B>" + nuke_code + "</B>");
                }

                if (!leader_selected)
                {
                    this.prepare_syndicate_leader(synd_mind, nuke_code);
                    leader_selected = true;
                }
                else
                {
                    synd_mind.current.real_name = "" + GlobalFuncs.syndicate_name() + " Operative #" + agent_number;
                    agent_number++;
                }
                spawnpos++;
                this.update_synd_icons_added(synd_mind);
            }
            nuke = Lang13.FindIn("syndienuke", GlobalVars.nuke_list);

            if (Lang13.Bool(nuke))
            {
                nuke.r_code = nuke_code;
            }
            return(base.post_setup(report));
        }