public void suicide( ) { string confirm = null; if (!this.canSuicide()) { return; } confirm = Interface13.Alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No"); if (!this.canSuicide()) { return; } if (confirm == "Yes") { this.suiciding = 1; this.visible_message("<span class='danger'>" + this + "'s brain is growing dull and lifeless. It looks like it's lost the will to live.</span>", "<span class='userdanger'>" + this + "'s brain is growing dull and lifeless. It looks like it's lost the will to live.</span>"); Task13.Schedule(50, (Task13.Closure)(() => { this.death(false); return; })); } return; }
// Function from file: backpack.dm public override bool handle_item_insertion(dynamic W = null, bool?prevent_warning = null, dynamic user = null) { prevent_warning = prevent_warning ?? false; string safety = null; Obj_Singularity singulo = null; if (W is Obj_Item_Weapon_Storage_Backpack_Holding && !W.crit_fail) { safety = Interface13.Alert(user, "You feel this may not be the best idea.", "Put in " + this.name + "?", "Proceed", "Abort"); if (safety == "Abort" || !(Map13.GetDistance(this, user) <= 1) || !(this != null) || !Lang13.Bool(W) || ((Mob)user).incapacitated()) { return(false); } this.investigate_log("has become a singularity. Caused by " + user.key, "singulo"); user.WriteMsg("<span class='danger'>The Bluespace interfaces of the two devices catastrophically malfunction!</span>"); GlobalFuncs.qdel(W); singulo = new Obj_Singularity(GlobalFuncs.get_turf(this)); singulo.energy = 300; GlobalFuncs.message_admins("" + GlobalFuncs.key_name_admin(user) + " detonated a bag of holding"); GlobalFuncs.log_game("" + GlobalFuncs.key_name(user) + " detonated a bag of holding"); GlobalFuncs.qdel(this); singulo.process(); return(false); } base.handle_item_insertion((object)(W), prevent_warning, (object)(user)); return(false); }
// Function from file: holder.dm public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null) { this.add_fingerprint(user); if (!Lang13.Bool(this.a_left) || !Lang13.Bool(this.a_right)) { user.WriteMsg("<span class='danger'>Assembly part missing!</span>"); return(null); } if (Lang13.Bool(((dynamic)this.a_right.type).IsInstanceOfType(this.a_left))) { switch ((string)(Interface13.Alert("Which side would you like to use?", null, "Left", "Right"))) { case "Left": ((Obj_Item)this.a_left).attack_self(user); break; case "Right": ((Obj_Item)this.a_right).attack_self(user); break; } return(null); } else { ((Obj_Item)this.a_left).attack_self(user); ((Obj_Item)this.a_right).attack_self(user); } return(null); }
// Function from file: AI_modules.dm public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null) { dynamic newpos = null; string response = null; string targName = null; newpos = Interface13.Input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", this.lawpos, null, null, InputType.Num | InputType.Null); if (newpos == null) { return(null); } if (Convert.ToDouble(newpos) < 15) { response = Interface13.Alert("Error: The law priority of " + newpos + " is invalid, Law priorities below 14 are reserved for core laws, Would you like to change that that to 15?", "Invalid law priority", "Change to 15", "Cancel"); if (!Lang13.Bool(response) || response == "Cancel") { return(null); } newpos = 15; } this.lawpos = Num13.MinInt(Convert.ToInt32(newpos), 50); targName = GlobalFuncs.stripped_input(user, "Please enter a new law for the AI.", "Freeform Law Entry", this.laws[1], 1024); if (!Lang13.Bool(targName)) { return(null); } this.laws[1] = targName; base.attack_self((object)(user), (object)(flag), emp); return(null); }
public void suicide( ) { string confirm = null; if (!this.canSuicide()) { return; } confirm = Interface13.Alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No"); if (!this.canSuicide()) { return; } if (confirm == "Yes") { this.suiciding = 1; this.visible_message(new Txt("<span class='danger'>").item(this).str(" is thrashing wildly! It looks like ").he_she_it_they().str("'s trying to commit suicide.</span>").ToString(), new Txt("<span class='userdanger'>").item(this).str(" is thrashing wildly! It looks like ").he_she_it_they().str("'s trying to commit suicide.</span>").ToString(), "<span class='italics'>You hear thrashing.</span>"); this.adjustOxyLoss(Num13.MaxInt(((int)(200 - this.getFireLoss() - this.getBruteLoss() - Convert.ToDouble(this.getOxyLoss()))), 0)); this.death(false); } return; }
// Function from file: implant_explosive.dm public override bool activate(dynamic cause = null) { if (!Lang13.Bool(cause) || !Lang13.Bool(this.imp_in)) { return(false); } if (cause == "action_button" && Interface13.Alert(this.imp_in, "Are you sure you want to activate your microbomb implant? This will cause you to explode!", "Microbomb Implant Confirmation", "Yes", "No") != "Yes") { return(false); } this.heavy = Num13.Floor(this.heavy); this.medium = Num13.Floor(this.medium); this.weak = Num13.Floor(this.weak); this.imp_in.WriteMsg("<span class='notice'>You activate your microbomb implant.</span>"); if (this.delay <= 7) { GlobalFuncs.explosion(this, this.heavy, this.medium, this.weak, this.weak, null, null, this.weak); if (Lang13.Bool(this.imp_in)) { ((Mob)this.imp_in).gib(); } GlobalFuncs.qdel(this); return(false); } this.timed_explosion(); return(false); }
public void togglev( ) { Ent_Static U = null; string vchange = null; int chance = 0; ByTable names = null; Mob_Living_Carbon_Human M = null; U = this.loc; vchange = Interface13.Alert("Would you like to synthesize a new name or turn off the voice synthesizer?", null, "New Name", "Turn Off"); if (vchange == "New Name") { chance = Rand13.Int(1, 100); dynamic _b = chance; // Was a switch-case, sorry for the mess. if (1 <= _b && _b <= 50) { this.voice = "" + (Rand13.Int(0, 1) == 1 ? Rand13.PickFromTable(GlobalVars.first_names_female) : Rand13.PickFromTable(GlobalVars.first_names_male)) + " " + Rand13.PickFromTable(GlobalVars.last_names); } else if (51 <= _b && _b <= 70) { this.voice = "" + Rand13.Pick(new object [] { GlobalFuncs.lizard_name(GlobalVars.MALE), GlobalFuncs.lizard_name(GlobalVars.FEMALE) }); } else if (71 <= _b && _b <= 80) { this.voice = "" + Rand13.PickFromTable(GlobalVars.clown_names); } else if (81 <= _b && _b <= 90) { this.voice = "" + Rand13.PickFromTable(GlobalVars.wizard_first) + " " + Rand13.PickFromTable(GlobalVars.wizard_second); } else if (91 <= _b && _b <= 100) { names = new ByTable(); foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Carbon_Human))) { M = _a; if (M == U || !(M.client != null) || !Lang13.Bool(M.real_name)) { continue; } names.Add(M.real_name); } this.voice = (!(names.len != 0) ? ((dynamic)("Cuban Pete")) : Rand13.PickFromTable(names)); } ((dynamic)U).WriteMsg("You are now mimicking <B>" + this.voice + "</B>."); } else { ((dynamic)U).WriteMsg("The voice synthesizer is " + (this.voice != "Unknown" ? "now" : "already") + " deactivated."); this.voice = "Unknown"; } return; }
// Function from file: nuclear_challenge.dm public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null) { string are_you_sure = null; string war_declaration = null; Obj_Machinery_Computer_Shuttle_Syndicate S = null; Obj_Item_Device_Radio_Uplink_Nuclear U = null; if (this.declaring_war) { return(null); } if (GlobalVars.player_list.len < 50) { user.WriteMsg("The enemy crew is too small to be worth declaring war on."); return(null); } if (Convert.ToInt32(user.z) != 2) { user.WriteMsg("You have to be at your base to use this."); return(null); } if (Game13.time > 3000) { user.WriteMsg("It's too late to declare hostilities. Your benefactors are already busy with other schemes. You'll have to make do with what you have on hand."); return(null); } this.declaring_war = true; are_you_sure = Interface13.Alert(user, "Consult your team carefully before you declare war on " + GlobalFuncs.station_name() + "]. Are you sure you want to alert the enemy crew?", "Declare war?", "Yes", "No"); if (are_you_sure == "No") { user.WriteMsg("On second thought, the element of surprise isn't so bad after all."); this.declaring_war = false; return(null); } war_declaration = "" + user.real_name + " has declared his intent to utterly destroy " + GlobalFuncs.station_name() + " with a nuclear device, and dares the crew to try and stop them."; GlobalFuncs.priority_announce(war_declaration, "Declaration of War", "sound/machines/Alarm.ogg"); user.WriteMsg("You've attracted the attention of powerful forces within the syndicate. A bonus bundle of telecrystals has been granted to your team. Great things await you if you complete the mission."); foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_Shuttle_Syndicate))) { S = _a; S.challenge = GlobalVars.TRUE; } U = new Obj_Item_Device_Radio_Uplink_Nuclear(GlobalFuncs.get_turf(user)); U.hidden_uplink.owner = "" + user.key; U.hidden_uplink.telecrystals = 280; U.hidden_uplink.gamemode = typeof(GameMode_Nuclear); GlobalVars.config.shuttle_refuel_delay = Num13.MaxInt(((int)(GlobalVars.config.shuttle_refuel_delay ?? 0)), 15000); GlobalFuncs.qdel(this); return(null); }
// Function from file: powers.dm public override bool fire(Mob user = null) { Mob L = null; string alien_caste = null; Mob_Living_Carbon_Alien_Humanoid new_xeno = null; if (!(user is Mob_Living_Carbon_Alien_Larva)) { return(false); } L = user; if (Lang13.Bool(((dynamic)L).handcuffed) || Lang13.Bool(((dynamic)L).legcuffed)) { user.WriteMsg("<span class='danger'>You cannot evolve when you are cuffed.</span>"); } if (Convert.ToDouble(((dynamic)L).amount_grown) >= Convert.ToDouble(((dynamic)L).max_grown)) { L.WriteMsg("<span class='name'>You are growing into a beautiful alien! It is time to choose a caste.</span>"); L.WriteMsg("<span class='info'>There are three to choose from:"); L.WriteMsg("<span class='name'>Hunters</span> <span class='info'>are the most agile caste tasked with hunting for hosts. They are faster than a human and can even pounce, but are not much tougher than a drone.</span>"); L.WriteMsg("<span class='name'>Sentinels</span> <span class='info'>are tasked with protecting the hive. With their ranged spit, invisibility, and high health, they make formidable guardians and acceptable secondhand hunters.</span>"); L.WriteMsg("<span class='name'>Drones</span> <span class='info'>are the weakest and slowest of the castes, but can grow into the queen if there is none, and are vital to maintaining a hive with their resin secretion abilities.</span>"); alien_caste = Interface13.Alert(L, "Please choose which alien caste you shall belong to.", null, "Hunter", "Sentinel", "Drone"); if (user.incapacitated()) { return(false); } switch ((string)(alien_caste)) { case "Hunter": new_xeno = new Mob_Living_Carbon_Alien_Humanoid_Hunter(L.loc); break; case "Sentinel": new_xeno = new Mob_Living_Carbon_Alien_Humanoid_Sentinel(L.loc); break; case "Drone": new_xeno = new Mob_Living_Carbon_Alien_Humanoid_Drone(L.loc); break; } ((dynamic)L).alien_evolve(new_xeno); return(false); } else { user.WriteMsg("<span class='danger'>You are not fully grown.</span>"); return(false); } }
// Function from file: aicard.dm public override int?ui_act(string action = null, ByTable _params = null, Tgui ui = null, UiState state = null) { int?_default = null; string confirm = null; if (Lang13.Bool(base.ui_act(action, _params, ui, state))) { return(_default); } switch ((string)(action)) { case "wipe": confirm = Interface13.Alert("Are you sure you want to wipe this card's memory? This cannot be undone once started.", this.name, "Yes", "No"); if (confirm == "Yes" && !Lang13.Bool(base.ui_act(action, _params, ui, state))) { this.flush = GlobalVars.TRUE; if (this.AI != null && this.AI.loc == this) { ((dynamic)this.AI).suiciding = GlobalVars.TRUE; ((dynamic)this.AI).WriteMsg("Your core files are being wiped!"); while (Convert.ToInt32(((dynamic)this.AI).stat) != 2) { ((dynamic)this.AI).adjustOxyLoss(2); ((dynamic)this.AI).updatehealth(); Task13.Sleep(10); } this.flush = GlobalVars.FALSE; } } _default = GlobalVars.TRUE; break; case "wireless": ((dynamic)this.AI).control_disabled = !Lang13.Bool(((dynamic)this.AI).control_disabled); ((dynamic)this.AI).WriteMsg("" + this + "'s wireless port has been " + (Lang13.Bool(((dynamic)this.AI).control_disabled) ? "disabled" : "enabled") + "!"); _default = GlobalVars.TRUE; break; case "radio": ((dynamic)this.AI).radio_enabled = !Lang13.Bool(((dynamic)this.AI).radio_enabled); ((dynamic)this.AI).WriteMsg("Your Subspace Transceiver has been " + (Lang13.Bool(((dynamic)this.AI).radio_enabled) ? "enabled" : "disabled") + "!"); _default = GlobalVars.TRUE; break; } this.update_icon(); return(_default); }
// Function from file: implant_explosive.dm public override bool activate(dynamic cause = null) { if (!Lang13.Bool(cause) || !Lang13.Bool(this.imp_in)) { return(false); } if (cause == "action_button" && Interface13.Alert(this.imp_in, "Are you sure you want to activate your macrobomb implant? This will cause you to explode and gib!", "Macrobomb Implant Confirmation", "Yes", "No") != "Yes") { return(false); } this.imp_in.WriteMsg("<span class='notice'>You activate your macrobomb implant.</span>"); this.timed_explosion(); return(false); }
// Function from file: syndicatebomb.dm public void settings(dynamic user = null) { dynamic newtime = null; dynamic bombturf = null; dynamic A = null; newtime = Interface13.Input(user, "Please set the timer.", "Timer", "" + this.timer, null, InputType.Num); newtime = Num13.MaxInt(60, Num13.MinInt(Convert.ToInt32(newtime), 60000)); if (Map13.GetDistance(this, user) <= 1 && user is Mob_Living) { this.timer = newtime; this.loc.visible_message(new Txt("<span class='notice'>").icon(this).str(" timer set for ").item(this.timer).str(" seconds.</span>").ToString()); } if (Interface13.Alert(user, "Would you like to start the countdown now?", null, "Yes", "No") == "Yes" && Map13.GetDistance(this, user) <= 1 && user is Mob_Living) { if (this.defused || this.active) { if (this.defused) { this.loc.visible_message(new Txt("<span class='warning'>").icon(this).str(" Device error: User intervention required.</span>").ToString()); } return; } else { this.loc.visible_message(new Txt("<span class='danger'>").icon(this).str(" ").item(this.timer).str(" seconds until detonation, please clear the area.</span>").ToString()); GlobalFuncs.playsound(this.loc, "sound/machines/click.ogg", 30, 1); this.active = true; this.update_icon(); this.add_fingerprint(user); bombturf = GlobalFuncs.get_turf(this); A = GlobalFuncs.get_area(bombturf); if (Lang13.Bool(this.payload) && !(this.payload is Obj_Item_Weapon_Bombcore_Training)) { GlobalFuncs.message_admins(new Txt().item(GlobalFuncs.key_name_admin(user)).str("<A HREF='?_src_=holder;adminmoreinfo=").Ref(user).str("'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=").Ref(user).str("'>FLW</A>) has primed a ").item(this.name).str(" (").item(this.payload).str(") for detonation at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=").item(bombturf.x).str(";Y=").item(bombturf.y).str(";Z=").item(bombturf.z).str("'>").item(A.name).str(" (JMP)</a>.").ToString()); GlobalFuncs.log_game("" + GlobalFuncs.key_name(user) + " has primed a " + this.name + " (" + this.payload + ") for detonation at " + A.name + "(" + bombturf.x + "," + bombturf.y + "," + bombturf.z + ")"); this.payload.adminlog = "The " + this.name + " that " + GlobalFuncs.key_name(user) + " had primed detonated!"; } } } return; }
// Function from file: posibrain.dm public void activate(Mob user = null) { string posi_ask = null; if (this.used || this.brainmob != null && Lang13.Bool(this.brainmob.key) || GlobalFuncs.jobban_isbanned(user, "posibrain")) { return; } posi_ask = Interface13.Alert("Become a positronic brain? (Warning, You can no longer be cloned, and all past lives will be forgotten!)", "Are you positive?", "Yes", "No"); if (posi_ask == "No" || Lang13.Bool(this.gc_destroyed)) { return; } this.transfer_personality(user); return; }
// Function from file: corpse.dm public override void attack_ghost(Mob user = null) { string ghost_role = null; if (GlobalVars.ticker.current_state != 3) { return; } ghost_role = Interface13.Alert("Become " + this.mobname + "? (Warning, You can no longer be cloned!)", null, "Yes", "No"); if (ghost_role == "No") { return; } this.createCorpse(this.death, user.ckey); return; }
// Function from file: ritual.dm public void open_tome(dynamic user = null) { string choice = null; choice = Interface13.Alert(user, "You open the tome...", null, "Scribe Rune", "Read Tome"); switch ((string)(choice)) { case "Read Tome": this.read_tome(user); break; case "Scribe Rune": this.scribe_rune(user); break; } return; }
// Function from file: personality.dm public bool savefile_load(Mob user = null, bool?silent = null) { silent = silent ?? true; string path = null; SaveFile F = null; bool? version = null; if (GlobalFuncs.IsGuestKey(user.key)) { return(false); } path = this.savefile_path(user); if (!File13.Exists(path)) { return(false); } F = new SaveFile(path); if (!(F != null)) { return(false); } version = null; version = F.ReadItem("version", version); if (version == null || version != true) { File13.Delete(path); if (!(silent == true)) { Interface13.Alert(user, "Your savefile was incompatible with this version and was deleted."); } return(false); } this.name = F.ReadItem("name", this.name); this.description = F.ReadItem("description", this.description); this.role = F.ReadItem("role", this.role); this.comments = F.ReadItem("comments", this.comments); return(true); }
public void empty( ) { if (Task13.User.incapacitated()) { return; } if (Interface13.Alert(Task13.User, "Are you sure you want to empty that?", "Empty Bottle:", "Yes", "No") != "Yes") { return; } if (Task13.User.loc is Tile && this.loc == Task13.User) { Task13.User.WriteMsg(new Txt("<span class='notice'>You empty ").the(this).item().str(" onto the floor.</span>").ToString()); this.reagents.reaction(Task13.User.loc); this.reagents.clear_reagents(); } return; }
// Function from file: fakedeath.dm public override bool can_sting(Mob user = null, Ent_Static target = null) { if ((user.status_flags & 8192) != 0) { user.WriteMsg("<span class='warning'>We are already regenerating.</span>"); return(false); } if (!(user.stat != 0)) { switch ((string)(Interface13.Alert("Are we sure we wish to fake our own death?", null, "Yes", "No"))) { case "No": return(false); break; } } return(base.can_sting(user, target)); }
public bool possess( ) { ByTable possessible = null; Mob_Living L = null; dynamic target = null; possessible = new ByTable(); foreach (dynamic _a in Lang13.Enumerate(GlobalVars.living_mob_list, typeof(Mob_Living))) { L = _a; if (!GlobalVars.player_list.Contains(L) && !(L.mind != null)) { possessible.Add(L); } } target = Interface13.Input("Your new life begins today!", "Possess Mob", null, null, possessible, InputType.Null | InputType.Any); if (!Lang13.Bool(target)) { return(false); } if (this.can_reenter_corpse == true || this.mind != null && Lang13.Bool(this.mind.current)) { if (Interface13.Alert(this, "Your soul is still tied to your former life as " + this.mind.current.name + ", if you go foward there is no going back to that life. Are you sure you wish to continue?", "Move On", "Yes", "No") == "No") { return(false); } } if (Lang13.Bool(target.key)) { this.WriteMsg("<span class='warning'>Someone has taken this body while you were choosing!</span>"); return(false); } target.key = this.key; return(true); }
// Function from file: drones_as_items.dm public override void attack_ghost(Mob user = null) { string be_drone = null; dynamic D = null; if (GlobalFuncs.jobban_isbanned(user, "drone")) { return; } if (GlobalVars.config.use_age_restriction_for_jobs) { if (!Lang13.Bool(Lang13.IsNumber(user.client.player_age))) { return; } if (Convert.ToDouble(user.client.player_age) < 14) { user.WriteMsg("<span class='danger'>You're too new to play as a drone! Please try again in " + (14 - Convert.ToDouble(user.client.player_age)) + " days.</span>"); return; } } if (!Lang13.Bool(GlobalVars.ticker.mode)) { user.WriteMsg("Can't become a drone before the game has started."); return; } be_drone = Interface13.Alert("Become a drone? (Warning, You can no longer be cloned!)", null, "Yes", "No"); if (be_drone == "No" || Lang13.Bool(this.gc_destroyed)) { return; } D = Lang13.Call(this.drone_type, GlobalFuncs.get_turf(this.loc)); D.key = user.key; GlobalFuncs.qdel(this); return; }
// Function from file: tgstation.dme public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null) { switch ((string)(Interface13.Alert("Travel back to ss13?", null, "Yes", "No"))) { case "Yes": if (Convert.ToInt32(a.z) != this.z) { return(null); } a.loc.loc.Exited(a); a.loc = Rand13.PickFromTable(GlobalVars.latejoin); break; case "No": return(null); break; } return(null); }
// Function from file: cards_ids.dm public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null) { string t = null; string u = null; if (user is Mob_Living && Lang13.Bool(user.mind)) { if (Lang13.Bool(user.mind.special_role)) { if (Interface13.Alert(user, "Action", "Agent ID", "Show", "Forge") == "Forge") { t = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(user, "What name would you like to put on this card?", "Agent card name", (Lang13.Bool(this.registered_name) ? this.registered_name : (user is Mob_Living_Carbon_Human ? user.real_name : user.name)), null, InputType.Str | InputType.Null)), 1, 26); if (!Lang13.Bool(t) || t == "Unknown" || t == "floor" || t == "wall" || t == "r-wall") { if (Lang13.Bool(t)) { Interface13.Alert("Invalid name."); } return(null); } this.registered_name = t; u = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Assistant", null, InputType.Str | InputType.Null)), 1, 1024); if (!Lang13.Bool(u)) { this.registered_name = ""; return(null); } this.assignment = u; this.update_label(); user.WriteMsg("<span class='notice'>You successfully forge the ID card.</span>"); return(null); } } } base.attack_self((object)(user), (object)(flag), emp); return(null); }
// Function from file: swarmer.dm public override void attack_ghost(Mob user = null) { string be_swarmer = null; Mob_Living_SimpleAnimal_Hostile_Swarmer S = null; be_swarmer = Interface13.Alert("Become a swarmer? (Warning, You can no longer be cloned!)", null, "Yes", "No"); if (be_swarmer == "No") { return; } if (Lang13.Bool(GlobalFuncs.qdeleted(this))) { user.WriteMsg("Swarmer has been occupied by someone else."); return; } S = new Mob_Living_SimpleAnimal_Hostile_Swarmer(GlobalFuncs.get_turf(this.loc)); S.key = user.key; GlobalFuncs.qdel(this); return; }
// Function from file: ladders.dm public dynamic use(dynamic user = null, bool?is_ghost = null) { is_ghost = is_ghost ?? false; if (this.up != null && this.down != null) { switch ((string)(Interface13.Alert("Go up or down the ladder?", "Ladder", "Up", "Down", "Cancel"))) { case "Up": this.go_up(user, is_ghost); break; case "Down": this.go_down(user, is_ghost); break; case "Cancel": return(null); break; } } else if (this.up != null) { this.go_up(user, is_ghost); } else if (this.down != null) { this.go_down(user, is_ghost); } if (!(is_ghost == true)) { this.add_fingerprint(user); } return(null); }
public void suicide( ) { string confirm = null; if (!this.canSuicide()) { return; } confirm = Interface13.Alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No"); if (!this.canSuicide()) { return; } if (confirm == "Yes") { this.suiciding = 1; this.visible_message(new Txt("<span class='danger'>").item(this).str(" begins to fall down. It looks like ").he_she_it_they().str("'s lost the will to live.</span>").ToString(), new Txt("<span class='userdanger'>").item(this).str(" begins to fall down. It looks like ").he_she_it_they().str("'s lost the will to live.</span>").ToString()); this.death(false); } return; }
// Function from file: giant_spider.dm public void humanize_spider(Mob user = null) { string spider_ask = null; if (Lang13.Bool(this.key) || !Lang13.Bool(this.playable_spider)) { return; } spider_ask = Interface13.Alert("Become a spider?", "Are you australian?", "Yes", "No"); if (spider_ask == "No" || !(this != null) || Lang13.Bool(GlobalFuncs.qdeleted(this))) { return; } if (Lang13.Bool(this.key)) { user.WriteMsg("<span class='notice'>Someone else already took this spider.</span>"); return; } this.key = user.key; return; }
// Function from file: raginmages.dm public bool make_more_mages( ) { ByTable candidates = null; dynamic theghost = null; Mob_Dead_Observer G = null; int time_passed = 0; Mob_Dead_Observer G2 = null; dynamic i = null; Mob_Living_Carbon_Human new_character = null; if (this.making_mage) { return(false); } if (this.mages_made >= this.max_mages) { return(false); } this.making_mage = true; this.mages_made++; candidates = new ByTable(); theghost = null; Task13.Schedule(Rand13.Int(this.spawn_delay_min, this.spawn_delay_max), (Task13.Closure)(() => { GlobalFuncs.message_admins("SWF is still pissed, sending another wizard - " + (this.max_mages - this.mages_made) + " left."); foreach (dynamic _a in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Dead_Observer))) { G = _a; if (G.client != null && !(G.client.holder != null) && !(G.client.is_afk() != 0) && G.client.prefs.be_special.Contains("wizard")) { if (!GlobalFuncs.jobban_isbanned(G, "wizard") && !GlobalFuncs.jobban_isbanned(G, "Syndicate")) { if (this.age_check(G.client)) { candidates.Add(G); } } } } if (!(candidates.len != 0)) { GlobalFuncs.message_admins("No applicable ghosts for the next ragin' mage, asking ghosts instead."); time_passed = Game13.time; foreach (dynamic _c in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Dead_Observer))) { G2 = _c; if (!GlobalFuncs.jobban_isbanned(G2, "wizard") && !GlobalFuncs.jobban_isbanned(G2, "Syndicate")) { if (this.age_check(G2.client)) { Task13.Schedule(0, (Task13.Closure)(() => { switch ((string)(Interface13.Alert(G2, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?", "Please answer in 30 seconds!", "Yes", "No"))) { case "Yes": if (Game13.time - time_passed > 300) { return; // Warning: Was a jump out of the closure! } candidates.Add(G2); break; case "No": return; // Warning: Was a jump out of the closure! break; } return; })); } } } Task13.Sleep(300); } if (!(candidates.len != 0)) { GlobalFuncs.message_admins("This is awkward, sleeping until another mage check..."); this.making_mage = false; this.mages_made--; return; } else { GlobalFuncs.shuffle(candidates); foreach (dynamic _d in Lang13.Enumerate(candidates)) { i = _d; if (!Lang13.Bool(i) || !Lang13.Bool(i.client)) { continue; } theghost = i; break; } } if (Lang13.Bool(theghost)) { new_character = this.makeBody(theghost); new_character.mind.make_Wizard(); this.making_mage = false; return; } return; })); return(false); }
// Function from file: special_shadowling_abilities.dm public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null) { thearea = thearea ?? Task13.User; dynamic H = null; string hatch_or_no = null; Obj_Item I = null; Mob_Living M = null; Obj_Machinery_Power_Apc A = null; Mob_Living_SimpleAnimal_AscendantShadowling A2 = null; Obj_Effect_ProcHolder_Spell S = null; H = thearea; if (!this.shadowling_check(H)) { return(false); } hatch_or_no = Interface13.Alert(H, "It is time to ascend. Are you sure about this?", null, "Yes", "No"); switch ((string)(hatch_or_no)) { case "No": H.WriteMsg("<span class='warning'>You decide against ascending for now."); this.charge_counter = this.charge_max; return(false); break; case "Yes": H.notransform = 1; ((Ent_Static)H).visible_message("<span class='warning'>" + H + "'s things suddenly slip off. They gently rise into the air, red light glowing in their eyes.</span>", "<span class='shadowling'>You rise into the air and get ready for your transformation.</span>"); foreach (dynamic _d in Lang13.Enumerate(H, typeof(Obj_Item))) { I = _d; ((Mob)H).unEquip(I); Task13.Sleep(50); ((Ent_Static)H).visible_message("<span class='warning'>" + H + "'s skin begins to crack and harden.</span>", "<span class='shadowling'>Your flesh begins creating a shield around yourself.</span>"); Task13.Sleep(100); ((Ent_Static)H).visible_message("<span class='warning'>The small horns on " + H + "'s head slowly grow and elongate.</span>", "<span class='shadowling'>Your body continues to mutate. Your telepathic abilities grow.</span>"); Task13.Sleep(90); ((Ent_Static)H).visible_message("<span class='warning'>" + H + "'s body begins to violently stretch and contort.</span>", "<span class='shadowling'>You begin to rend apart the final barriers to godhood.</span>"); Task13.Sleep(40); H.WriteMsg("<i><b>Yes!</b></i>"); Task13.Sleep(10); H.WriteMsg("<i><b><span class='big'>YES!!</span></b></i>"); Task13.Sleep(10); H.WriteMsg("<i><b><span class='reallybig'>YE--</span></b></i>"); Task13.Sleep(1); foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(H, 7), typeof(Mob_Living))) { M = _a; M.Weaken(10); M.WriteMsg("<span class='userdanger'>An immense pressure slams you onto the ground!</span>"); } Game13.WriteMsg("<font size=5><span class='shadowling'><b>\"VYSHA NERADA YEKHEZET U'RUU!!\"</font></span>"); Game13.WriteMsg("sound/hallucinations/veryfar_noise.ogg"); foreach (dynamic _b in Lang13.Enumerate(GlobalVars.apcs_list, typeof(Obj_Machinery_Power_Apc))) { A = _b; A.overload_lighting(); } A2 = new Mob_Living_SimpleAnimal_AscendantShadowling(H.loc); foreach (dynamic _c in Lang13.Enumerate(H.mind.spell_list, typeof(Obj_Effect_ProcHolder_Spell))) { S = _c; if (S == this) { continue; } ((Mind)H.mind).remove_spell(S); } H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_Annihilate(null)); H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_Hypnosis(null)); H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Self_ShadowlingPhaseShift(null)); H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_AoeTurf_AscendantStorm(null)); H.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Self_ShadowlingHivemindAscendant(null)); ((Mind)H.mind).transfer_to(A2); A2.name = H.real_name; if (Lang13.Bool(A2.real_name)) { A2.real_name = H.real_name; } H.invisibility = 60; H.loc = A2; Task13.Sleep(50); if (!GlobalVars.ticker.mode.shadowling_ascended) { GlobalVars.SSshuttle.emergency.request(null, 0.3); } GlobalVars.ticker.mode.shadowling_ascended = true; A2.mind.remove_spell(this); GlobalFuncs.qdel(H); } break; } return(false); }
// Function from file: buildmode.dm public bool change_settings(Mob user = null) { dynamic target_path = null; ByTable locked = null; dynamic thetype = null; dynamic gen_paths = null; dynamic type = null; switch ((int)(this.mode)) { case 1: return(true); break; case 2: target_path = Interface13.Input(user, "Enter typepath:", "Typepath", "/obj/structure/closet", null, InputType.Any); this.objholder = Lang13.FindClass(target_path); if (!(this.objholder is Type)) { this.objholder = GlobalFuncs.pick_closest_path(target_path); if (!Lang13.Bool(this.objholder)) { this.objholder = typeof(Obj_Structure_Closet); Interface13.Alert("That path is not allowed."); } } else if (Lang13.Bool(this.objholder.IsSubclassOf(typeof(Mob))) && !GlobalFuncs.check_rights(32, false)) { this.objholder = typeof(Obj_Structure_Closet); } break; case 3: locked = new ByTable(new object [] { "vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine" }); this.varholder = Interface13.Input(user, "Enter variable name:", "Name", "name", null, InputType.Any); if (Lang13.Bool(((dynamic)(locked != null && !GlobalFuncs.check_rights(32, false))).Contains(this.varholder))) { return(true); } thetype = Interface13.Input(user, "Select variable type:", "Type", null, new ByTable(new object [] { "text", "number", "mob-reference", "obj-reference", "turf-reference" }), InputType.Any); if (!Lang13.Bool(thetype)) { return(true); } dynamic _a = thetype; // Was a switch-case, sorry for the mess. if (_a == "text") { this.valueholder = Interface13.Input(user, "Enter variable value:", "Value", "value", null, InputType.Str); } else if (_a == "number") { this.valueholder = Interface13.Input(user, "Enter variable value:", "Value", 123, null, InputType.Num); } else if (_a == "mob-reference") { this.valueholder = Interface13.Input(user, "Enter variable value:", "Value", null, GlobalVars.mob_list, InputType.Mob); } else if (_a == "obj-reference") { this.valueholder = Interface13.Input(user, "Enter variable value:", "Value", null, Game13.contents, InputType.Obj); } else if (_a == "turf-reference") { this.valueholder = Interface13.Input(user, "Enter variable value:", "Value", null, Game13.contents, InputType.Tile); } break; case 5: gen_paths = Lang13.GetTypes(typeof(MapGenerator)) - typeof(MapGenerator); type = Interface13.Input(user, "Select Generator Type", "Type", null, gen_paths, InputType.Null | InputType.Any); if (!Lang13.Bool(type)) { return(false); } this.generator_path = type; this.cornerA = null; this.cornerB = null; break; } return(false); }
// Function from file: mirror.dm public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null) { dynamic H = null; dynamic choice = null; string newname = null; dynamic newrace = null; dynamic racechoice = null; dynamic new_s_tone = null; dynamic new_mutantcolor = null; string temp_hsv = null; string hairchoice = null; dynamic new_hair_color = null; dynamic new_face_color = null; dynamic new_eye_color = null; if (!(a is Mob_Living_Carbon_Human)) { return(null); } H = a; choice = Interface13.Input(a, "Something to change?", "Magical Grooming", null, new ByTable(new object [] { "name", "race", "gender", "hair", "eyes" }), InputType.Null | InputType.Any); dynamic _a = choice; // Was a switch-case, sorry for the mess. if (_a == "name") { newname = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(H, "Who are we again?", "Name change", H.name, null, InputType.Str | InputType.Null)), 1, 26); if (!Lang13.Bool(newname)) { return(null); } H.real_name = newname; H.name = newname; if (Lang13.Bool(H.dna)) { H.dna.real_name = newname; } if (Lang13.Bool(H.mind)) { H.mind.name = newname; } } else if (_a == "race") { newrace = null; racechoice = Interface13.Input(H, "What are we again?", "Race change", null, this.choosable_races, InputType.Null | InputType.Any); newrace = GlobalVars.species_list[racechoice]; if (!Lang13.Bool(newrace)) { return(null); } ((Mob)H).set_species(newrace, false); if (H.dna.species.use_skintones) { new_s_tone = Interface13.Input(a, "Choose your skin tone:", "Race change", null, GlobalVars.skin_tones, InputType.Null | InputType.Any); if (Lang13.Bool(new_s_tone)) { H.skin_tone = new_s_tone; ((Dna)H.dna).update_ui_block(3); } } if (H.dna.species.specflags.Contains(1)) { new_mutantcolor = Interface13.Input(a, "Choose your skin color:", "Race change", null, null, InputType.Null | InputType.Color); if (Lang13.Bool(new_mutantcolor)) { temp_hsv = GlobalFuncs.RGBtoHSV(new_mutantcolor); if (Convert.ToDouble(GlobalFuncs.ReadHSV(temp_hsv)[3]) >= Convert.ToDouble(GlobalFuncs.ReadHSV("#7F7F7F")[3])) { H.dna.features["mcolor"] = GlobalFuncs.sanitize_hexcolor(new_mutantcolor); } else { H.WriteMsg("<span class='notice'>Invalid color. Your color is not bright enough.</span>"); } } } ((Mob_Living_Carbon_Human)H).update_body(); ((Mob)H).update_hair(); ((Mob_Living_Carbon_Human)H).update_mutcolor(); ((Mob_Living_Carbon)H).update_mutations_overlay(); } else if (_a == "gender") { if (!new ByTable(new object [] { "male", "female" }).Contains(H.gender)) { return(null); } if (H.gender == "male") { if (Interface13.Alert(H, "Become a Witch?", "Confirmation", "Yes", "No") == "Yes") { H.gender = "female"; H.WriteMsg("<span class='notice'>Man, you feel like a woman!</span>"); } else { return(null); } } else if (Interface13.Alert(H, "Become a Warlock?", "Confirmation", "Yes", "No") == "Yes") { H.gender = "male"; H.WriteMsg("<span class='notice'>Whoa man, you feel like a man!</span>"); } else { return(null); } ((Dna)H.dna).update_ui_block(5); ((Mob_Living_Carbon_Human)H).update_body(); ((Mob_Living_Carbon)H).update_mutations_overlay(); } else if (_a == "hair") { hairchoice = Interface13.Alert(H, "Hair style or hair color?", "Change Hair", "Style", "Color"); if (hairchoice == "Style") { base.attack_hand((object)(a), b, c); } else { new_hair_color = Interface13.Input(H, "Choose your hair color", "Hair Color", null, null, InputType.Null | InputType.Color); if (Lang13.Bool(new_hair_color)) { H.hair_color = GlobalFuncs.sanitize_hexcolor(new_hair_color); ((Dna)H.dna).update_ui_block(1); } if (H.gender == "male") { new_face_color = Interface13.Input(H, "Choose your facial hair color", "Hair Color", null, null, InputType.Null | InputType.Color); if (Lang13.Bool(new_face_color)) { H.facial_hair_color = GlobalFuncs.sanitize_hexcolor(new_face_color); ((Dna)H.dna).update_ui_block(2); } } ((Mob)H).update_hair(); } } else if (_a == "eyes") { new_eye_color = Interface13.Input(H, "Choose your eye color", "Eye Color", null, null, InputType.Null | InputType.Color); if (Lang13.Bool(new_eye_color)) { H.eye_color = GlobalFuncs.sanitize_hexcolor(new_eye_color); ((Dna)H.dna).update_ui_block(4); ((Mob_Living_Carbon_Human)H).update_body(); } } return(null); }