// Function from file: robot_modules.dm public dynamic get_or_create_estorage(Type storage_type = null) { RobotEnergyStorage S = null; foreach (dynamic _a in Lang13.Enumerate(this.storages, typeof(RobotEnergyStorage))) { S = _a; if (Lang13.Bool(((dynamic)storage_type).IsInstanceOfType(S))) { return(S); } } return(Lang13.Call(storage_type, this)); }
// Function from file: robot_modules.dm public virtual void respawn_consumable(dynamic R = null, double?coeff = null) { coeff = coeff ?? 1; RobotEnergyStorage st = null; Obj_Item I = null; Obj_Item F = null; Obj_Item B = null; foreach (dynamic _a in Lang13.Enumerate(this.storages, typeof(RobotEnergyStorage))) { st = _a; st.energy = Num13.MinInt(st.max_energy, ((int)(st.energy + (coeff ?? 0) * st.recharge_rate))); } foreach (dynamic _b in Lang13.Enumerate(this.get_usable_modules(), typeof(Obj_Item))) { I = _b; if (I is Obj_Item_Device_Assembly_Flash) { F = I; ((dynamic)F).times_used = 0; F.crit_fail = false; F.update_icon(); } if (I is Obj_Item_Weapon_Melee_Baton) { B = I; if (Lang13.Bool(((dynamic)B).bcell)) { ((dynamic)B).bcell.charge = ((dynamic)B).bcell.maxcharge; } } } R.toner = R.tonermax; return; }