// Function from file: imposter.dm public override bool start( ) { Mind M = null; dynamic W = null; ByTable candidates = null; dynamic C = null; Mob_Living_Carbon_Human I = null; Objective_Protect protect_objective = null; foreach (dynamic _a in Lang13.Enumerate(GlobalVars.ticker.mode.wizards, typeof(Mind))) { M = _a; if (!(M.current is Mob_Living_Carbon_Human)) { continue; } W = M.current; candidates = GlobalFuncs.get_candidates("wizard"); if (!(candidates != null)) { return(false); } C = Rand13.PickFromTable(candidates); GlobalFuncs.PoolOrNew(typeof(Obj_Effect_ParticleEffect_Smoke), W.loc); I = new Mob_Living_Carbon_Human(W.loc); new ByTable().Set(1, I).Set("transfer_SE", 1).Apply(Lang13.BindFunc(W.dna, "transfer_identity")); I.real_name = I.dna.real_name; I.name = I.dna.real_name; I.updateappearance(null, true); I.domutcheck(); if (Lang13.Bool(W.ears)) { I.equip_to_slot_or_del(Lang13.Call(W.ears.type), 8); } if (Lang13.Bool(W.w_uniform)) { I.equip_to_slot_or_del(Lang13.Call(W.w_uniform.type), 14); } if (Lang13.Bool(W.shoes)) { I.equip_to_slot_or_del(Lang13.Call(W.shoes.type), 12); } if (Lang13.Bool(W.wear_suit)) { I.equip_to_slot_or_del(Lang13.Call(W.wear_suit.type), 13); } if (Lang13.Bool(W.head)) { I.equip_to_slot_or_del(Lang13.Call(W.head.type), 11); } if (Lang13.Bool(W.back)) { I.equip_to_slot_or_del(Lang13.Call(W.back.type), 1); } I.key = C.key; I.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_AreaTeleport_Teleport(null)); I.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_TurfTeleport_Blink(null)); I.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_EtherealJaunt(null)); GlobalVars.ticker.mode.apprentices.Add(I.mind); I.mind.special_role = "imposter"; protect_objective = new Objective_Protect(); protect_objective.owner = I.mind; protect_objective.target = W.mind; protect_objective.explanation_text = "Protect " + W.real_name + ", the wizard."; I.mind.objectives.Add(protect_objective); ((GameMode)GlobalVars.ticker.mode).update_wiz_icons_added(I.mind); I.attack_log.Add("[" + GlobalFuncs.time_stamp() + "] <font color='red'>Is an imposter!</font>"); I.WriteMsg("<B>You are an imposter! Trick and confuse the crew to misdirect malice from your handsome original!</B>"); I.WriteMsg(new Sound("sound/effects/magic.ogg")); } return(false); }
// Function from file: antag_spawner.dm public override void spawn_antag(dynamic C = null, dynamic T = null, string type = null) { type = type ?? ""; Mob_Living_Carbon_Human M = null; dynamic wizard_name_first = null; dynamic wizard_name_second = null; string randomname = null; Objective_Protect new_objective = null; string newname = null; GlobalFuncs.PoolOrNew(typeof(Obj_Effect_ParticleEffect_Smoke), T); M = new Mob_Living_Carbon_Human(T); C.prefs.copy_to(M); M.key = C.key; M.WriteMsg("<B>You are the " + Task13.User.real_name + "'s apprentice! You are bound by magic contract to follow their orders and help them in accomplishing their goals."); switch ((string)(type)) { case "destruction": M.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_Projectile_MagicMissile(null)); M.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Dumbfire_Fireball(null)); M.WriteMsg("<B>Your service has not gone unrewarded, however. Studying under " + Task13.User.real_name + ", you have learned powerful, destructive spells. You are able to cast magic missile and fireball."); break; case "bluespace": M.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_AreaTeleport_Teleport(null)); M.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_EtherealJaunt(null)); M.WriteMsg("<B>Your service has not gone unrewarded, however. Studying under " + Task13.User.real_name + ", you have learned reality bending mobility spells. You are able to cast teleport and ethereal jaunt."); break; case "healing": M.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_Charge(null)); M.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_AoeTurf_Conjure_Forcewall(null)); M.equip_to_slot_or_del(new Obj_Item_Weapon_Gun_Magic_Staff_Healing(M), 5); M.WriteMsg("<B>Your service has not gone unrewarded, however. Studying under " + Task13.User.real_name + ", you have learned livesaving survival spells. You are able to cast charge and forcewall."); break; case "robeless": M.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_AoeTurf_Knock(null)); M.mind.AddSpell(new Obj_Effect_ProcHolder_Spell_Targeted_MindTransfer(null)); M.WriteMsg("<B>Your service has not gone unrewarded, however. Studying under " + Task13.User.real_name + ", you have learned stealthy, robeless spells. You are able to cast knock and mindswap."); break; } this.equip_antag(M); wizard_name_first = Rand13.PickFromTable(GlobalVars.wizard_first); wizard_name_second = Rand13.PickFromTable(GlobalVars.wizard_second); randomname = "" + wizard_name_first + " " + wizard_name_second; new_objective = new Objective_Protect(); new_objective.owner = M.mind; new_objective.target = Task13.User.mind; new_objective.explanation_text = "Protect " + Task13.User.real_name + ", the wizard."; M.mind.objectives.Add(new_objective); GlobalVars.ticker.mode.apprentices.Add(M.mind); M.mind.special_role = "apprentice"; ((GameMode)GlobalVars.ticker.mode).update_wiz_icons_added(M.mind); M.WriteMsg(new Sound("sound/effects/magic.ogg")); newname = String13.SubStr(GlobalFuncs.sanitize(Interface13.Input(M, "You are the wizard's apprentice. Would you like to change your name to something else?", "Name change", randomname, null, InputType.Str | InputType.Null)), 1, 26); if (!Lang13.Bool(newname)) { newname = randomname; } M.mind.name = newname; M.real_name = newname; M.name = newname; M.dna.update_dna_identity(); return; }
// 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); }
// Function from file: artefact.dm public void spawn_copy(dynamic C = null, dynamic T = null) { Mob_Living_Carbon_Human M = null; ByTable all_species = null; dynamic speciestype = null; dynamic S = null; Objective_Hijackclone hijack_objective = null; Objective_Protect new_objective = null; M = new Mob_Living_Carbon_Human(T); C.prefs.copy_to(M, false); M.key = C.key; M.mind.name = Task13.User.real_name; M.WriteMsg("<B>You are an alternate version of " + Task13.User.real_name + " from another universe! Help them accomplish their goals at all costs.</B>"); M.real_name = Task13.User.real_name; M.name = Task13.User.real_name; M.faction = new ByTable(new object [] { "" + Task13.User.real_name }); if (Rand13.PercentChance(50)) { all_species = new ByTable(); foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Species)) - typeof(Species))) { speciestype = _a; S = Lang13.Call(speciestype); if (!S.dangerous_existence) { all_species.Add(speciestype); } } M.set_species(Rand13.PickFromTable(all_species), false); } M.update_body(); M.update_hair(); M.update_mutcolor(); M.dna.update_dna_identity(); this.equip_copy(M); if (Lang13.Bool(this.evil)) { hijack_objective = new Objective_Hijackclone(); hijack_objective.owner = M.mind; M.mind.objectives.Add(hijack_objective); hijack_objective.explanation_text = "Ensure only " + Task13.User.real_name + " and their copies are on the shuttle!"; M.WriteMsg("<B>Objective #" + 1 + "</B>: " + hijack_objective.explanation_text); M.mind.special_role = "multiverse traveller"; GlobalFuncs.log_game("" + M.key + " was made a multiverse traveller with the objective to help " + Task13.User.real_name + " hijack."); } else { new_objective = new Objective_Protect(); new_objective.owner = M.mind; new_objective.target = Task13.User.mind; new_objective.explanation_text = "Protect " + Task13.User.real_name + ", your copy, and help them defend the innocent from the mobs of multiverse clones."; M.mind.objectives.Add(new_objective); M.WriteMsg("<B>Objective #" + 1 + "</B>: " + new_objective.explanation_text); M.mind.special_role = "multiverse traveller"; GlobalFuncs.log_game("" + M.key + " was made a multiverse traveller with the objective to help " + Task13.User.real_name + " protect the station."); } return; }