// Function from file: requests_console.dm public override bool update_icon(dynamic new_state = null, dynamic new_icon = null, int?new_px = null, int?new_py = null) { if (this.open) { if (!this.hackState) { this.icon_state = "req_comp_open"; } else { this.icon_state = "req_comp_rewired"; } } else if ((this.stat & 2) != 0) { if (this.icon_state != "req_comp_off") { this.icon_state = "req_comp_off"; } } else if (Lang13.Bool(this.emergency) || this.newmessagepriority == 3) { this.icon_state = "req_comp3"; } else if (this.newmessagepriority == 2) { this.icon_state = "req_comp2"; } else if (this.newmessagepriority == 1) { this.icon_state = "req_comp1"; } else { this.icon_state = "req_comp0"; } return(false); }
// Function from file: dominator.dm public override int?process(dynamic seconds = null) { dynamic domloc = null; Gang G = null; base.process((object)(seconds)); if (Lang13.Bool(this.gang) && Lang13.Bool(Lang13.IsNumber(this.gang.dom_timer))) { if (Convert.ToDouble(this.gang.dom_timer) > 0) { GlobalFuncs.playsound(this.loc, "sound/items/timer.ogg", 10, 0); if (!this.warned && Convert.ToDouble(this.gang.dom_timer) < 180) { this.warned = true; domloc = GlobalFuncs.get_area(this.loc); ((Gang)this.gang).message_gangtools("Less than 3 minutes remain in hostile takeover. Defend your dominator at " + domloc.map_name + "!"); foreach (dynamic _a in Lang13.Enumerate(GlobalVars.ticker.mode.gangs, typeof(Gang))) { G = _a; if (G != this.gang) { G.message_gangtools("WARNING: " + this.gang.name + " Gang takeover imminent. Their dominator at " + domloc.map_name + " must be destroyed!", true, true); } } } } else { GlobalVars.SSmachine.processing.Remove(this); } } return(null); }
// Function from file: equipment_locker.dm public override void RefreshParts( ) { dynamic ore_pickup_rate_temp = null; dynamic point_upgrade_temp = null; dynamic sheet_per_ore_temp = null; Obj_Item_Weapon_StockParts_MatterBin B = null; Obj_Item_Weapon_StockParts_Manipulator M = null; Obj_Item_Weapon_StockParts_MicroLaser L = null; ore_pickup_rate_temp = 15; point_upgrade_temp = 1; sheet_per_ore_temp = 1; foreach (dynamic _a in Lang13.Enumerate(this.component_parts, typeof(Obj_Item_Weapon_StockParts_MatterBin))) { B = _a; sheet_per_ore_temp = B.rating; } foreach (dynamic _b in Lang13.Enumerate(this.component_parts, typeof(Obj_Item_Weapon_StockParts_Manipulator))) { M = _b; ore_pickup_rate_temp = M.rating * 15; } foreach (dynamic _c in Lang13.Enumerate(this.component_parts, typeof(Obj_Item_Weapon_StockParts_MicroLaser))) { L = _c; point_upgrade_temp = L.rating; } this.ore_pickup_rate = ore_pickup_rate_temp; this.point_upgrade = point_upgrade_temp; this.sheet_per_ore = sheet_per_ore_temp; return; }
// Function from file: pad.dm public void Send( ) { Mob_Living target = null; if (this.teleport_target == null) { this.teleport_target = GlobalVars.teleportlocs[Rand13.PickFromTable(GlobalVars.teleportlocs)]; } Icon13.Flick("alien-pad", this); foreach (dynamic _a in Lang13.Enumerate(this.loc, typeof(Mob_Living))) { target = _a; this.TeleportToArea(target, this.teleport_target); Task13.Schedule(0, (Task13.Closure)(() => { GlobalFuncs.anim(target.loc, target, "icons/mob/mob.dmi", null, "uncloak", null, target.dir); return; })); } return; }
// Function from file: other_reagents.dm public override double reaction_mob(dynamic M = null, int?method = null, double?reac_volume = null, bool?show_message = null, dynamic touch_protection = null, Mob_Camera_Blob O = null) { method = method ?? GlobalVars.TOUCH; Disease D = null; if (this.data is ByTable && (method == GlobalVars.INGEST || method == GlobalVars.INJECT)) { foreach (dynamic _a in Lang13.Enumerate(M.viruses, typeof(Disease))) { D = _a; if (Lang13.Bool(this.data.Contains(D.GetDiseaseID()))) { D.cure(); } } M.resistances.Or(this.data); } return(0); }
// Function from file: medical_tools.dm public bool get_current_reagents( ) { dynamic output = null; Reagent R = null; foreach (dynamic _a in Lang13.Enumerate(this.reagents.reagent_list, typeof(Reagent))) { R = _a; if (R.volume > 0) { output += new Txt().item(R).str(": ").item(Num13.Round(R.volume, 0.001)).str(" - <a href=\"?src=").Ref(this).str(";purge_reagent=").item(R.id).str("\">Purge Reagent</a><br />").ToString(); } } if (Lang13.Bool(output)) { output += new Txt("Total: ").item(Num13.Round(this.reagents.total_volume ?? 0, 0.001)).str("/").item(this.reagents.maximum_volume).str(" - <a href=\"?src=").Ref(this).str(";purge_all=1\">Purge All</a>").ToString(); } return(Lang13.Bool(output) || Lang13.Bool("None")); }
// Function from file: spacevine.dm public void on_chem_effect(Reagent_Toxin_Plantbgone R = null) { double _override = 0; SpacevineMutation SM = null; _override = 0; foreach (dynamic _a in Lang13.Enumerate(this.mutations, typeof(SpacevineMutation))) { SM = _a; _override += /*[I CANNOT CONVERT SOME RANDOM SHIT TO A DOUBLE: void]*/ 0; } if (!(_override != 0) && R is Reagent_Toxin_Plantbgone) { if (Rand13.PercentChance(50)) { GlobalFuncs.qdel(this); } } return; }
// Function from file: doorcontrol.dm public override bool activate( ) { Obj_Machinery_Flasher M = null; this.cooldown = 1; foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Flasher))) { M = _a; if (M.id == this.id) { Task13.Schedule(0, (Task13.Closure)(() => { M.flash(); return; })); } } Task13.Sleep(50); this.cooldown = 0; return(false); }
// Function from file: chem_master.dm public dynamic isgoodnumber(dynamic num = null) { if (Lang13.Bool(Lang13.IsNumber(num))) { if (Convert.ToDouble(num) > 200) { num = 200; } else if (Convert.ToDouble(num) < 0) { num = 0; } else { num = Num13.Floor(Convert.ToDouble(num)); } return(num); } else { return(0); } }
// Function from file: lighting.dm public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null) { dynamic S = null; base.attackby((object)(A), (object)(user), _params, silent, replace_spent); if (A is Obj_Item_Weapon_ReagentContainers_Syringe) { S = A; user.WriteMsg(new Txt("<span class='notice'>You inject the solution into ").the(this).item().str(".</span>").ToString()); if (Lang13.Bool(((Reagents)S.reagents).has_reagent("plasma", 5))) { this.rigged = true; } ((Reagents)S.reagents).clear_reagents(); } else { base.attackby((object)(A), (object)(user), _params, silent, replace_spent); } return(null); }
// Function from file: medbot.dm public override bool update_icon(dynamic new_state = null, dynamic new_icon = null, int?new_px = null, int?new_py = null) { if (!Lang13.Bool(this.on)) { this.icon_state = "medibot0"; return(false); } if (this.v_mode == 10) { this.icon_state = "medibots" + this.stationary_mode; return(false); } else if (this.stationary_mode) { this.icon_state = "medibot2"; } else { this.icon_state = "medibot1"; } return(false); }
// Function from file: automatic.dm public virtual void burst_select( ) { Mob user = null; user = Task13.User; this.select = !(this.select != 0) ?1:0; if (!(this.select != 0)) { this.burst_size = 1; this.fire_delay = 0; user.WriteMsg("<span class='notice'>You switch to semi-automatic.</span>"); } else { this.burst_size = Lang13.Initial(this, "burst_size"); this.fire_delay = Lang13.Initial(this, "fire_delay"); user.WriteMsg("<span class='notice'>You switch to " + this.burst_size + "-rnd burst.</span>"); } GlobalFuncs.playsound(user, "sound/weapons/empty.ogg", 100, 1); this.update_icon(); return; }
// Function from file: pod.dm public override int?process(dynamic seconds = null) { if (!Lang13.Bool(base.process((object)(seconds)))) { return(null); } if (Lang13.Bool(this.timing)) { if (this.time > 0) { this.time = Num13.Floor(this.time) - 1; } else { this.alarm(); this.time = 0; this.timing = 0; } this.updateDialog(); } return(null); }
// Function from file: processor.dm public virtual void process_food(Ent_Static loc = null, dynamic what = null, Obj_Machinery_Processor processor = null) { int?i = null; if (this.output != null && loc != null && processor != null) { i = null; i = 0; while ((i ?? 0) < Convert.ToDouble(processor.rating_amount)) { Lang13.Call(this.output, loc); i++; } } if (Lang13.Bool(what)) { GlobalFuncs.qdel(what); } return; }
// Function from file: toxin_reagents.dm public override double reaction_mob(dynamic M = null, int?method = null, double?reac_volume = null, bool?show_message = null, dynamic touch_protection = null, Mob_Camera_Blob O = null) { method = method ?? GlobalVars.TOUCH; dynamic C = null; double damage = 0; if (method == GlobalVars.VAPOR) { if (M is Mob_Living_Carbon) { C = M; if (!Lang13.Bool(C.wear_mask)) { damage = Num13.MinInt(((int)(Num13.Round((reac_volume ?? 0) * 0.4, 0.1))), 10); ((Mob_Living)C).adjustToxLoss(damage); } } } return(0); }
// Function from file: holder.dm public dynamic get_master_reagent_name( ) { dynamic name = null; bool max_volume = false; dynamic reagent = null; dynamic R = null; max_volume = false; foreach (dynamic _a in Lang13.Enumerate(this.reagent_list)) { reagent = _a; R = reagent; if (Convert.ToDouble(R.volume) > (max_volume ?1:0)) { max_volume = Lang13.Bool(R.volume); name = R.name; } } return(name); }
// Function from file: equipment_locker.dm public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null) { ByTable mobs = null; if (!Lang13.Bool(user.client)) { return(null); } if (!this.cooldown) { this.cooldown = true; Task13.Schedule(40, (Task13.Closure)(() => { this.cooldown = false; return; })); mobs = new ByTable(); mobs.Or(user); GlobalFuncs.mineral_scan_pulse(mobs, GlobalFuncs.get_turf(user)); } return(null); }
// Function from file: equipment_locker.dm public void CreateResonance(dynamic target = null, dynamic creator = null) { dynamic T = null; T = GlobalFuncs.get_turf(target); if (Lang13.Bool(Lang13.FindIn(typeof(Obj_Effect_Resonance), T))) { return; } if (this.fieldsactive < this.fieldlimit) { GlobalFuncs.playsound(this, "sound/weapons/resonator_fire.ogg", 50, 1); new Obj_Effect_Resonance(T, creator, this.burst_time); this.fieldsactive++; Task13.Schedule(this.burst_time, (Task13.Closure)(() => { this.fieldsactive--; return; })); } return; }
// Function from file: light_floor.dm public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null) { if (Lang13.Bool(base.attackby((object)(A), (object)(user), _params, silent, replace_spent))) { return(null); } if (A is Obj_Item_Weapon_Light_Bulb) { if (this.state != 0 && ((Mob)user).drop_item()) { GlobalFuncs.qdel(A); this.state = 0; this.update_icon(); user.WriteMsg("<span class='notice'>You replace the light bulb.</span>"); } else { user.WriteMsg("<span class='notice'>The lightbulb seems fine, no need to replace it.</span>"); } } return(null); }
// Function from file: revolver.dm public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null) { dynamic num_loaded = null; num_loaded = base.attackby((object)(A), (object)(user), _params, silent, replace_spent); if (Lang13.Bool(num_loaded)) { ((Ent_Static)user).visible_message("" + user + " loads a single bullet into the revolver and spins the chamber.", "<span class='notice'>You load a single bullet into the chamber and spin it.</span>"); } else { ((Ent_Static)user).visible_message("" + user + " spins the chamber of the revolver.", "<span class='notice'>You spin the revolver's chamber.</span>"); } if (this.get_ammo() > 0) { this.Spin(); } this.update_icon(); A.update_icon(); return(null); }
// Function from file: fitness.dm public Obj_Structure_Closet_Lasertag_Red(dynamic loc = null) : base((object)(loc)) { double i = 0; double i2 = 0; // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!; foreach (dynamic _a in Lang13.IterateRange(1, 3)) { i = _a; new Obj_Item_Weapon_Gun_Energy_Laser_Redtag(this); } foreach (dynamic _b in Lang13.IterateRange(1, 3)) { i2 = _b; new Obj_Item_Clothing_Suit_Redtag(this); } new Obj_Item_Clothing_Head_Helmet_Redtaghelm(this); return; }
// Function from file: advance.dm public override dynamic GetDiseaseID( ) { dynamic L = null; Symptom S = null; string result = null; if (!Lang13.Bool(this.id)) { L = new ByTable(); foreach (dynamic _a in Lang13.Enumerate(this.symptoms, typeof(Symptom))) { S = _a; L += S.id; } L = GlobalFuncs.sortList(L); result = GlobalFuncs.jointext(L, ":"); this.id = result; } return(this.id); }
// Function from file: mecha_control_console.dm public dynamic get_mecha_info( ) { Ent_Static M = null; int? cell_charge = null; string answer = null; Ent_Static RM = null; if (!Lang13.Bool(this.in_mecha())) { return(0); } M = this.loc; cell_charge = ((Obj_Mecha)M).get_charge(); answer = "<b>Name:</b> " + M.name + "<br>\n <b>Integrity:</b> "+ ((dynamic)M).health / Lang13.Initial(M, "health") * 100 + "%<br>\n <b>Cell charge:</b> "+ (cell_charge == null ? "Not found" : "" + ((Obj_Item_Weapon_StockParts_Cell)((dynamic)M).cell).percent() + "%") + "<br>\n <b>Airtank:</b> "+ ((dynamic)M).return_pressure() + "kPa<br>\n <b>Pilot:</b> "+ (Lang13.Bool(((dynamic)M).occupant) || Lang13.Bool("None")) + "<br>\n <b>Location:</b> "+ (Lang13.Bool(GlobalFuncs.get_area(M)) || Lang13.Bool("Unknown")) + "<br>\n <b>Active equipment:</b> "+ (Lang13.Bool(((dynamic)M).selected) || Lang13.Bool("None")) + "<br>"; if (M is Obj_Mecha_Working_Ripley) { RM = M; answer += "<b>Used cargo space:</b> " + ((dynamic)RM).cargo.len / Convert.ToDouble(((dynamic)RM).cargo_capacity) * 100 + "%<br>"; } return(answer); }
// Function from file: watertank.dm public void update_filling( ) { Image filling = null; int percent = 0; this.overlays.Cut(); if ( Lang13.Bool( this.reagents.total_volume ) ) { filling = new Image( "icons/obj/reagentfillings.dmi", null, "backpack-10" ); percent = Num13.Floor( ( this.reagents.total_volume ??0) / ( this.volume ??0) * 100 ); dynamic _a = percent; // Was a switch-case, sorry for the mess. if ( 0<=_a&&_a<=15 ) { filling.icon_state = "backpack-10"; } else if ( 16<=_a&&_a<=60 ) { filling.icon_state = "backpack50"; } else if ( 61<=_a&&_a<=Double.PositiveInfinity ) { filling.icon_state = "backpack100"; } filling.color = GlobalFuncs.mix_color_from_reagents( this.reagents.reagent_list ); this.overlays.Add( filling ); } return; }
// Function from file: mushroom.dm public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null) { if (A is Obj_Item_Weapon_ReagentContainers_Food_Snacks_Grown_Mushroom) { if (this.stat == 2 && !this.recovery_cooldown) { this.Recover(); GlobalFuncs.qdel(A); } else { user.WriteMsg("<span class='warning'>" + this + " won't eat it!</span>"); } return(null); } if (Lang13.Bool(A.force)) { this.Bruise(); } base.attackby((object)(A), (object)(user), _params, silent, replace_spent); return(null); }
// Function from file: farm_animals.dm public override bool Life( ) { bool _default = false; _default = base.Life(); if (!_default) { return(_default); } if (!(this.stat != 0) && !Lang13.Bool(this.ckey)) { this.amount_grown += Rand13.Int(1, 2); if (this.amount_grown >= 100) { new Mob_Living_SimpleAnimal_Chicken(this.loc); GlobalFuncs.qdel(this); } } return(_default); }
// Function from file: corpse.dm public override void createCorpse(bool death = false, string ckey = null) { dynamic A = null; AiLaws_Default_Asimov L = null; Obj_Item_Device_Mmi B = null; Mob_Living_Silicon_Ai M = null; A = Lang13.FindIn(typeof(Mob_Living_Silicon_Ai), this.loc); if (Lang13.Bool(A)) { return; } L = new AiLaws_Default_Asimov(); B = new Obj_Item_Device_Mmi(); M = new Mob_Living_Silicon_Ai(this.loc, L, B, true); M.name = this.name; M.real_name = this.name; M.aiPDA.toff = true; M.death(); GlobalFuncs.qdel(this); return; }
// Function from file: energy_ball.dm public void move_the_basket_ball(int move_amount = 0) { int first_move = 0; double i = 0; dynamic move_dir = null; Tile T = null; first_move = this.dir; foreach (dynamic _a in Lang13.IterateRange(0, move_amount)) { i = _a; move_dir = Rand13.PickFromTable(GlobalVars.alldirs + first_move); T = Map13.GetStep(this, Convert.ToInt32(move_dir)); if (this.can_move(T)) { this.loc = T; } } return; }
// Function from file: mulebot.dm public Mob_Living_SimpleAnimal_Bot_Mulebot(dynamic loc = null) : base((object)(loc)) { Job_CargoTech J = null; // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!; this.wires = new Wires_Mulebot(this); J = new Job_CargoTech(); this.access_card.access = J.get_access(); this.prev_access = this.access_card.access; this.cell = new Obj_Item_Weapon_StockParts_Cell(this); this.cell.charge = 2000; this.cell.maxcharge = 2000; Task13.Schedule(10, (Task13.Closure)(() => { GlobalVars.mulebot_count += 1; if (!Lang13.Bool(this.suffix)) { this.set_suffix("#" + GlobalVars.mulebot_count); } return; })); return; }
// Function from file: energy_ball.dm public override dynamic Destroy( ) { dynamic EB = null; dynamic ball = null; dynamic EB2 = null; if (Lang13.Bool(this.orbiting) && this.orbiting is Obj_Singularity_EnergyBall) { EB = this.orbiting; EB.orbiting_balls.Remove(this); this.orbiting = null; } foreach (dynamic _a in Lang13.Enumerate(this.orbiting_balls)) { ball = _a; EB2 = ball; GlobalFuncs.qdel(EB2); } return(base.Destroy()); }