diff --git a/.gitignore b/.gitignore index aa2528a7fe..f2ce0fe4b8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ *.lk *.backup data/ +cfg/ diff --git a/.travis.yml b/.travis.yml index 9d86d85229..81b8487f48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,4 +19,6 @@ install: script: - shopt -s globstar - (! grep 'step_[xy]' maps/**/*.dmm) + - (! find nano/templates/ -type f -exec md5sum {} + | sort | uniq -D -w 32 | grep nano) + - ( md5sum -c - <<< "0af969f671fba6cf9696c78cd175a14a *baystation12.int") - DreamMaker baystation12.dme diff --git a/baystation12.dme b/baystation12.dme index 56bb547d77..c8ad5bac27 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -33,6 +33,7 @@ #include "code\__HELPERS\type2type.dm" #include "code\__HELPERS\unsorted.dm" #include "code\__HELPERS\vector.dm" +#include "code\_defines\chemical_effects.dm" #include "code\_onclick\adjacent.dm" #include "code\_onclick\ai.dm" #include "code\_onclick\click.dm" @@ -108,7 +109,6 @@ #include "code\controllers\Processes\nanoui.dm" #include "code\controllers\Processes\obj.dm" #include "code\controllers\Processes\pipenet.dm" -#include "code\controllers\Processes\powernet.dm" #include "code\controllers\Processes\Shuttle.dm" #include "code\controllers\Processes\sun.dm" #include "code\controllers\Processes\supply.dm" @@ -517,7 +517,6 @@ #include "code\game\objects\weapons.dm" #include "code\game\objects\effects\aliens.dm" #include "code\game\objects\effects\bump_teleporter.dm" -#include "code\game\objects\effects\chemsmoke.dm" #include "code\game\objects\effects\effect_system.dm" #include "code\game\objects\effects\explosion_particles.dm" #include "code\game\objects\effects\gibs.dm" @@ -530,6 +529,9 @@ #include "code\game\objects\effects\portals.dm" #include "code\game\objects\effects\spiders.dm" #include "code\game\objects\effects\step_triggers.dm" +#include "code\game\objects\effects\chem\chemsmoke.dm" +#include "code\game\objects\effects\chem\foam.dm" +#include "code\game\objects\effects\chem\water.dm" #include "code\game\objects\effects\decals\cleanable.dm" #include "code\game\objects\effects\decals\contraband.dm" #include "code\game\objects\effects\decals\crayon.dm" @@ -554,6 +556,7 @@ #include "code\game\objects\items\crayons.dm" #include "code\game\objects\items\glassjar.dm" #include "code\game\objects\items\latexballoon.dm" +#include "code\game\objects\items\paintkit.dm" #include "code\game\objects\items\shooting_range.dm" #include "code\game\objects\items\toys.dm" #include "code\game\objects\items\trash.dm" @@ -601,9 +604,6 @@ #include "code\game\objects\items\stacks\sheets\glass.dm" #include "code\game\objects\items\stacks\sheets\leather.dm" #include "code\game\objects\items\stacks\sheets\light.dm" -#include "code\game\objects\items\stacks\sheets\mineral.dm" -#include "code\game\objects\items\stacks\sheets\sheet_types.dm" -#include "code\game\objects\items\stacks\sheets\sheets.dm" #include "code\game\objects\items\stacks\tiles\light.dm" #include "code\game\objects\items\stacks\tiles\plasteel.dm" #include "code\game\objects\items\stacks\tiles\tile_types.dm" @@ -621,6 +621,7 @@ #include "code\game\objects\items\weapons\flamethrower.dm" #include "code\game\objects\items\weapons\gift_wrappaper.dm" #include "code\game\objects\items\weapons\handcuffs.dm" +#include "code\game\objects\items\weapons\improvised_components.dm" #include "code\game\objects\items\weapons\kitchen.dm" #include "code\game\objects\items\weapons\manuals.dm" #include "code\game\objects\items\weapons\mop.dm" @@ -631,16 +632,14 @@ #include "code\game\objects\items\weapons\RCD.dm" #include "code\game\objects\items\weapons\RSF.dm" #include "code\game\objects\items\weapons\scrolls.dm" -#include "code\game\objects\items\weapons\shards.dm" #include "code\game\objects\items\weapons\shields.dm" #include "code\game\objects\items\weapons\stunbaton.dm" #include "code\game\objects\items\weapons\surgery_tools.dm" #include "code\game\objects\items\weapons\swords_axes_etc.dm" -#include "code\game\objects\items\weapons\table_rack_parts.dm" #include "code\game\objects\items\weapons\tape.dm" #include "code\game\objects\items\weapons\teleportation.dm" #include "code\game\objects\items\weapons\tools.dm" -#include "code\game\objects\items\weapons\twohanded.dm" +#include "code\game\objects\items\weapons\trays.dm" #include "code\game\objects\items\weapons\weaponry.dm" #include "code\game\objects\items\weapons\weldbackpack.dm" #include "code\game\objects\items\weapons\wires.dm" @@ -678,6 +677,15 @@ #include "code\game\objects\items\weapons\implants\implantfreedom.dm" #include "code\game\objects\items\weapons\implants\implantpad.dm" #include "code\game\objects\items\weapons\implants\implantuplink.dm" +#include "code\game\objects\items\weapons\material\bats.dm" +#include "code\game\objects\items\weapons\material\kitchen.dm" +#include "code\game\objects\items\weapons\material\knives.dm" +#include "code\game\objects\items\weapons\material\material_weapons.dm" +#include "code\game\objects\items\weapons\material\misc.dm" +#include "code\game\objects\items\weapons\material\shards.dm" +#include "code\game\objects\items\weapons\material\swords.dm" +#include "code\game\objects\items\weapons\material\thrown.dm" +#include "code\game\objects\items\weapons\material\twohanded.dm" #include "code\game\objects\items\weapons\melee\energy.dm" #include "code\game\objects\items\weapons\melee\misc.dm" #include "code\game\objects\items\weapons\storage\backpack.dm" @@ -717,7 +725,6 @@ #include "code\game\objects\structures\ladders.dm" #include "code\game\objects\structures\lamarr_cage.dm" #include "code\game\objects\structures\lattice.dm" -#include "code\game\objects\structures\mineral_doors.dm" #include "code\game\objects\structures\mirror.dm" #include "code\game\objects\structures\mop_bucket.dm" #include "code\game\objects\structures\morgue.dm" @@ -725,7 +732,7 @@ #include "code\game\objects\structures\noticeboard.dm" #include "code\game\objects\structures\safe.dm" #include "code\game\objects\structures\signs.dm" -#include "code\game\objects\structures\tables_racks.dm" +#include "code\game\objects\structures\simple_doors.dm" #include "code\game\objects\structures\tank_dispenser.dm" #include "code\game\objects\structures\target_stake.dm" #include "code\game\objects\structures\transit_tubes.dm" @@ -933,13 +940,14 @@ #include "code\modules\clothing\under\syndicate.dm" #include "code\modules\clothing\under\accessories\accessory.dm" #include "code\modules\clothing\under\accessories\armband.dm" +#include "code\modules\clothing\under\accessories\badges.dm" #include "code\modules\clothing\under\accessories\holster.dm" +#include "code\modules\clothing\under\accessories\lockets.dm" #include "code\modules\clothing\under\accessories\storage.dm" #include "code\modules\clothing\under\jobs\civilian.dm" #include "code\modules\clothing\under\jobs\engineering.dm" #include "code\modules\clothing\under\jobs\medsci.dm" #include "code\modules\clothing\under\jobs\security.dm" -#include "code\modules\customitems\item_defines.dm" #include "code\modules\customitems\item_spawning.dm" #include "code\modules\detectivework\evidence.dm" #include "code\modules\detectivework\footprints_and_rag.dm" @@ -1045,6 +1053,9 @@ #include "code\modules\maps\reader.dm" #include "code\modules\maps\swapmaps.dm" #include "code\modules\maps\writer.dm" +#include "code\modules\materials\material_recipes.dm" +#include "code\modules\materials\material_sheets.dm" +#include "code\modules\materials\material_synth.dm" #include "code\modules\materials\materials.dm" #include "code\modules\mining\abandonedcrates.dm" #include "code\modules\mining\alloys.dm" @@ -1063,6 +1074,7 @@ #include "code\modules\mining\satchel_ore_boxdm.dm" #include "code\modules\mining\drilling\drill.dm" #include "code\modules\mining\drilling\scanner.dm" +#include "code\modules\mob\animations.dm" #include "code\modules\mob\death.dm" #include "code\modules\mob\emote.dm" #include "code\modules\mob\hear_say.dm" @@ -1180,6 +1192,7 @@ #include "code\modules\mob\living\carbon\human\MedicalSideEffects.dm" #include "code\modules\mob\living\carbon\human\npcs.dm" #include "code\modules\mob\living\carbon\human\say.dm" +#include "code\modules\mob\living\carbon\human\stripping.dm" #include "code\modules\mob\living\carbon\human\unarmed_attack.dm" #include "code\modules\mob\living\carbon\human\update_icons.dm" #include "code\modules\mob\living\carbon\human\whisper.dm" @@ -1479,7 +1492,6 @@ #include "code\modules\reagents\reagent_containers\glass.dm" #include "code\modules\reagents\reagent_containers\hypospray.dm" #include "code\modules\reagents\reagent_containers\pill.dm" -#include "code\modules\reagents\reagent_containers\robodropper.dm" #include "code\modules\reagents\reagent_containers\spray.dm" #include "code\modules\reagents\reagent_containers\syringes.dm" #include "code\modules\reagents\reagent_containers\food\cans.dm" @@ -1549,8 +1561,6 @@ #include "code\modules\research\xenoarchaeology\finds\finds_misc.dm" #include "code\modules\research\xenoarchaeology\finds\finds_special.dm" #include "code\modules\research\xenoarchaeology\finds\finds_talkingitem.dm" -#include "code\modules\research\xenoarchaeology\genetics\prehistoric_animals.dm" -#include "code\modules\research\xenoarchaeology\genetics\reconstitutor.dm" #include "code\modules\research\xenoarchaeology\machinery\artifact_analyser.dm" #include "code\modules\research\xenoarchaeology\machinery\artifact_harvester.dm" #include "code\modules\research\xenoarchaeology\machinery\artifact_scanner.dm" @@ -1652,6 +1662,12 @@ #include "code\modules\surgery\robolimbs.dm" #include "code\modules\surgery\slimes.dm" #include "code\modules\surgery\surgery.dm" +#include "code\modules\tables\flipping.dm" +#include "code\modules\tables\interactions.dm" +#include "code\modules\tables\presets.dm" +#include "code\modules\tables\rack.dm" +#include "code\modules\tables\tables.dm" +#include "code\modules\tables\update_triggers.dm" #include "code\modules\vehicles\cargo_train.dm" #include "code\modules\vehicles\train.dm" #include "code\modules\vehicles\vehicle.dm" diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index d9cfb93a18..4674d52251 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -61,6 +61,16 @@ use_power = 1 icon_state = "map_vent_in" +/obj/machinery/atmospherics/unary/vent_pump/siphon/on/atmos + use_power = 1 + icon_state = "map_vent_in" + external_pressure_bound = 0 + external_pressure_bound_default = 0 + internal_pressure_bound = 2000 + internal_pressure_bound_default = 2000 + pressure_checks = 2 + pressure_checks_default = 2 + /obj/machinery/atmospherics/unary/vent_pump/New() ..() air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP diff --git a/code/TriDimension/Structures.dm b/code/TriDimension/Structures.dm index 9224facba2..cf216274bb 100644 --- a/code/TriDimension/Structures.dm +++ b/code/TriDimension/Structures.dm @@ -114,7 +114,7 @@ sleep(60) if(!user || !WT || !WT.isOn()) return - var/obj/item/stack/sheet/metal/S = new /obj/item/stack/sheet/metal( src ) + var/obj/item/stack/material/steel/S = new /obj/item/stack/material/steel( src ) S.amount = 2 user << "You remove the ladder and close the hole." qdel(src) diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index ebfd029228..27011dc7b3 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -10,6 +10,8 @@ Attach to transfer valve and open. BOOM. */ +//#define FIREDBG + /turf/var/obj/fire/fire = null //Some legacy definitions so fires can be started. @@ -35,14 +37,13 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) if(air_contents.check_combustability(liquid)) igniting = 1 - create_fire(vsc.fire_firelevel_multiplier) + create_fire(exposed_temperature) return igniting /zone/proc/process_fire() var/datum/gas_mixture/burn_gas = air.remove_ratio(vsc.fire_consuption_rate, fire_tiles.len) var/firelevel = burn_gas.zburn(src, fire_tiles, force_burn = 1, no_check = 1) - //world << "[src]: firelevel [firelevel]" air.merge(burn_gas) @@ -65,6 +66,29 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) if(!fire_tiles.len) air_master.active_fire_zones.Remove(src) +/zone/proc/remove_liquidfuel(var/used_liquid_fuel, var/remove_fire=0) + if(!fuel_objs.len) + return + + //As a simplification, we remove fuel equally from all fuel sources. It might be that some fuel sources have more fuel, + //some have less, but whatever. It will mean that sometimes we will remove a tiny bit less fuel then we intended to. + + var/fuel_to_remove = used_liquid_fuel/(fuel_objs.len*LIQUIDFUEL_AMOUNT_TO_MOL) //convert back to liquid volume units + + for(var/O in fuel_objs) + var/obj/effect/decal/cleanable/liquid_fuel/fuel = O + if(!istype(fuel)) + fuel_objs -= fuel + continue + + fuel.amount -= fuel_to_remove + if(fuel.amount <= 0) + fuel_objs -= fuel + if(remove_fire) + var/turf/T = fuel.loc + if(istype(T) && T.fire) qdel(T.fire) + qdel(fuel) + /turf/proc/create_fire(fl) return 0 @@ -98,7 +122,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) light_color = "#ED9200" layer = TURF_LAYER - var/firelevel = 10000 //Calculated by gas_mixture.calculate_firelevel() + var/firelevel = 1 //Calculated by gas_mixture.calculate_firelevel() /obj/fire/process() . = 1 @@ -122,7 +146,6 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) icon_state = "1" set_light(3, 1) - //im not sure how to implement a version that works for every creature so for now monkeys are firesafe for(var/mob/living/L in loc) L.FireBurn(firelevel, air_contents.temperature, air_contents.return_pressure()) //Burn the mobs! @@ -158,7 +181,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) else enemy_tile.adjacent_fire_act(loc, air_contents, air_contents.temperature, air_contents.volume) - animate(src, color = heat2color(air_contents.temperature), 5) + animate(src, color = fire_color(air_contents.temperature), 5) set_light(l_color = color) /obj/fire/New(newLoc,fl) @@ -166,27 +189,32 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) if(!istype(loc, /turf)) qdel(src) + return set_dir(pick(cardinal)) var/datum/gas_mixture/air_contents = loc.return_air() - color = heat2color(air_contents.temperature) + color = fire_color(air_contents.temperature) set_light(3, 1, color) firelevel = fl air_master.active_hotspots.Add(src) +/obj/fire/proc/fire_color(var/env_temperature) + var/temperature = max(4000*sqrt(firelevel/vsc.fire_firelevel_multiplier), env_temperature) + return heat2color(temperature) /obj/fire/Destroy() - if (istype(loc, /turf/simulated)) - RemoveFire() + RemoveFire() ..() /obj/fire/proc/RemoveFire() - if (istype(loc, /turf)) + var/turf/T = loc + if (istype(T)) set_light(0) - + + T.fire = null loc = null air_master.active_hotspots.Remove(src) @@ -198,6 +226,11 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) //Returns the firelevel /datum/gas_mixture/proc/zburn(zone/zone, force_burn, no_check = 0) + #ifdef FIREDBG + log_debug("***************** FIREDBG *****************") + if(zone) log_debug("Burning [zone.name]!") + #endif + . = 0 if((temperature > PHORON_MINIMUM_BURN_TEMPERATURE || force_burn) && (no_check ||check_recombustability(zone? zone.fuel_objs : null))) var/gas_fuel = 0 //in the case of mixed gas/liquid fires, the gas burns first. @@ -215,9 +248,11 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) total_oxidizers *= group_multiplier //Liquid Fuel + var/fuel_area = 0 if(zone) for(var/obj/effect/decal/cleanable/liquid_fuel/fuel in zone.fuel_objs) liquid_fuel += fuel.amount*LIQUIDFUEL_AMOUNT_TO_MOL + fuel_area++ total_fuel = gas_fuel + liquid_fuel if(total_fuel <= 0.005) @@ -225,9 +260,6 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) //*** Determine how fast the fire burns - //calculate the firelevel. - var/firelevel = calculate_firelevel(zone? zone.fuel_objs : null, total_fuel, total_oxidizers, force = 1) - //get the current thermal energy of the gas mix //this must be taken here to prevent the addition or deletion of energy by a changing heat capacity var/starting_energy = temperature * heat_capacity() @@ -235,61 +267,54 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) //determine how far the reaction can progress var/reaction_limit = min(total_oxidizers*(FIRE_REACTION_FUEL_AMOUNT/FIRE_REACTION_OXIDIZER_AMOUNT), total_fuel) //stoichiometric limit - //determine the actual rate of reaction, as measured by the amount of fuel reacting + //calculate the firelevel. + var/firelevel = calculate_firelevel(total_fuel, total_oxidizers, reaction_limit) + //vapour fuels are extremely volatile! The reaction progress is a percentage of the total fuel (similar to old zburn). - var/gas_reaction_progress = max(0.2*group_multiplier, (firelevel/vsc.fire_firelevel_multiplier)*gas_fuel)*FIRE_GAS_BURNRATE_MULT - //liquid fuels are not as volatile, and the reaction progress depends on the size of the area that is burning (which is sort of accounted for by firelevel). Having more fuel means a longer burn. - var/liquid_reaction_progress = (firelevel/vsc.fire_firelevel_multiplier)*FIRE_LIQUID_BURNRATE_MULT + var/gas_reaction_progress = min(0.2, (firelevel/vsc.fire_firelevel_multiplier))*gas_fuel*FIRE_GAS_BURNRATE_MULT - //world << "liquid_reaction_progress = [liquid_reaction_progress]" - //world << "gas_reaction_progress = [gas_reaction_progress]" + //liquid fuels are not as volatile, and the reaction progress depends on the size of the area that is burning. Limit the burn rate to a certain amount per area. + var/liquid_reaction_progress = ((firelevel/vsc.fire_firelevel_multiplier)*0.2 + 0.05)*fuel_area*FIRE_LIQUID_BURNRATE_MULT var/total_reaction_progress = gas_reaction_progress + liquid_reaction_progress var/used_fuel = min(total_reaction_progress, reaction_limit) var/used_oxidizers = used_fuel*(FIRE_REACTION_OXIDIZER_AMOUNT/FIRE_REACTION_FUEL_AMOUNT) - //world << "used_fuel = [used_fuel]; used_oxidizers = [used_oxidizers]; reaction_limit=[reaction_limit]" + + #ifdef FIREDBG + log_debug("firelevel -> [firelevel] / [vsc.fire_firelevel_multiplier]") + log_debug("liquid_reaction_progress = [liquid_reaction_progress]") + log_debug("gas_reaction_progress = [gas_reaction_progress]") + log_debug("used_fuel = [used_fuel]; used_oxidizers = [used_oxidizers]; reaction_limit=[reaction_limit]") + #endif //if the reaction is progressing too slow then it isn't self-sustaining anymore and burns out - if(zone && zone.fuel_objs.len) - if(used_fuel <= FIRE_LIQUD_MIN_BURNRATE) + if(zone) //be less restrictive with canister and tank reactions + if((!liquid_fuel || used_fuel <= FIRE_LIQUD_MIN_BURNRATE) && (!gas_fuel || used_fuel <= FIRE_GAS_MIN_BURNRATE*group_multiplier)) return 0 - else if(used_fuel <= FIRE_GAS_MIN_BURNRATE*group_multiplier) //purely gas fires have more stringent criteria - return 0 //*** Remove fuel and oxidizer, add carbon dioxide and heat //remove and add gasses as calculated - var/used_gas_fuel = min(used_fuel*(gas_reaction_progress/total_reaction_progress), gas_fuel) //remove in proportion to the relative reaction progress - var/used_liquid_fuel = between(0, used_fuel-used_gas_fuel, liquid_fuel) + var/used_gas_fuel = between(0.25, used_fuel*(gas_reaction_progress/total_reaction_progress), gas_fuel) //remove in proportion to the relative reaction progress + var/used_liquid_fuel = between(0.25, used_fuel-used_gas_fuel, liquid_fuel) //remove_by_flag() and adjust_gas() handle the group_multiplier for us. remove_by_flag(XGM_GAS_OXIDIZER, used_oxidizers) remove_by_flag(XGM_GAS_FUEL, used_gas_fuel) adjust_gas("carbon_dioxide", used_oxidizers) - //As a simplification, we remove fuel equally from all fuel sources. It might be that some fuel sources have more fuel, some have less, but whatever. - if(zone && zone.fuel_objs.len) - var/fuel_to_remove = used_liquid_fuel/(zone.fuel_objs.len*LIQUIDFUEL_AMOUNT_TO_MOL) //convert back to liquid volume units - //world << "used gas fuel = [used_gas_fuel]; used other fuel = [used_fuel-used_gas_fuel]; fuel_to_remove = [fuel_to_remove]" - var/liquidonly = !check_combustability() - for(var/O in zone.fuel_objs) - var/obj/effect/decal/cleanable/liquid_fuel/fuel = O - if(!istype(fuel)) - zone.fuel_objs -= fuel - continue - - fuel.amount -= fuel_to_remove - if(fuel.amount <= 0) - zone.fuel_objs -= fuel - if(liquidonly) - var/turf/T = fuel.loc - if(istype(T) && T.fire) qdel(T.fire) - qdel(fuel) + if(zone) + zone.remove_liquidfuel(used_liquid_fuel, !check_combustability()) //calculate the energy produced by the reaction and then set the new temperature of the mix temperature = (starting_energy + vsc.fire_fuel_energy_release * used_fuel) / heat_capacity() + + #ifdef FIREDBG + log_debug("used_gas_fuel = [used_gas_fuel]; used_liquid_fuel = [used_liquid_fuel]; total = [used_gas_fuel+used_liquid_fuel]") + log_debug("new temperature = [temperature]") + #endif update_values() return firelevel @@ -332,21 +357,28 @@ datum/gas_mixture/proc/check_recombustability(list/fuel_objs) . = 1 break -//Returns a value between 0 and vsc.fire_firelevel_multiplier -/datum/gas_mixture/proc/calculate_firelevel(list/fuel_objs, total_fuel, total_oxidizers, force = 0) +//returns a value between 0 and vsc.fire_firelevel_multiplier +/datum/gas_mixture/proc/calculate_firelevel(total_fuel, total_oxidizers, reaction_limit) //Calculates the firelevel based on one equation instead of having to do this multiple times in different areas. var/firelevel = 0 - if(force || check_recombustability(fuel_objs)) - var/total_combustables = (total_fuel + total_oxidizers) + var/total_combustables = (total_fuel + total_oxidizers) - if(total_combustables > 0) - //slows down the burning when the concentration of the reactants is low - var/dampening_multiplier = total_combustables / total_moles - //calculates how close the mixture of the reactants is to the optimum - var/mix_multiplier = 1 / (1 + (5 * ((total_oxidizers / total_combustables) ** 2))) - //toss everything together - firelevel = vsc.fire_firelevel_multiplier * mix_multiplier * dampening_multiplier + if(total_combustables > 0) + //slows down the burning when the concentration of the reactants is low + var/dampening_multiplier = min(1, reaction_limit / (total_moles/group_multiplier)) + + //calculates how close the mixture of the reactants is to the optimum + //fires burn better when there is more oxidizer -- too much fuel will choke them out a bit, reducing firelevel. + var/mix_multiplier = 1 / (1 + (5 * ((total_fuel / total_combustables) ** 2))) + + #ifdef FIREDBG + ASSERT(dampening_multiplier <= 1) + ASSERT(mix_multiplier <= 1) + #endif + + //toss everything together -- should produce a value between 0 and fire_firelevel_multiplier + firelevel = vsc.fire_firelevel_multiplier * mix_multiplier * dampening_multiplier return max( 0, firelevel) diff --git a/code/_defines/chemical_effects.dm b/code/_defines/chemical_effects.dm new file mode 100644 index 0000000000..6119d80cb5 --- /dev/null +++ b/code/_defines/chemical_effects.dm @@ -0,0 +1,7 @@ +#define CE_STABLE "stable" // Inaprovaline +#define CE_ANTIBIOTIC "antibiotic" // Spaceacilin +#define CE_BLOODRESTORE "bloodrestore" // Iron/nutriment +#define CE_PAINKILLER "painkiller" +#define CE_ALCOHOL "alcohol" // Liver filtering +#define CE_ALCOHOL_TOXIC "alcotoxic" // Liver damage +#define CE_SPEEDBOOST "gofast" // Hyperzine \ No newline at end of file diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 7bb85445d4..0c8685162f 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -20,6 +20,15 @@ /obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters) return +//TODO: refactor mob attack code. +/* +Busy writing something else that I don't want to get mixed up in a general attack code, and I don't want to forget this so leaving a note here. +leave attackby() as handling the general case of "using an item on a mob" +attackby() will decide to call attacked_by() or not. +attacked_by() will be made a living level proc and handle the specific case of "attacking with an item to cause harm" +attacked_by() will then call attack() so that stunbatons and other weapons that have special attack effects can do their thing. +attacked_by() will handle hitting/missing/logging as it does now, and will call attack() to apply the attack effects (damage) instead of the other way around (as it is now). +*/ /obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone) @@ -57,6 +66,7 @@ power *= 2 // TODO: needs to be refactored into a mob/living level attacked_by() proc. ~Z + user.do_attack_animation(M) if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M diff --git a/code/controllers/Processes/machinery.dm b/code/controllers/Processes/machinery.dm index 232ef91973..b84dfaf943 100644 --- a/code/controllers/Processes/machinery.dm +++ b/code/controllers/Processes/machinery.dm @@ -6,18 +6,16 @@ /datum/controller/process/machinery/doWork() internal_sort() - internal_process() + internal_process_machinery() + internal_process_power() + internal_process_power_drain() /datum/controller/process/machinery/proc/internal_sort() if(machinery_sort_required) machinery_sort_required = 0 machines = dd_sortedObjectList(machines) -/datum/controller/process/machinery/proc/internal_process() -//#ifdef PROFILE_MACHINES - //machine_profiling.len = 0 - //#endif - +/datum/controller/process/machinery/proc/internal_process_machinery() for(var/obj/machinery/M in machines) if(M && !M.gcDestroyed) #ifdef PROFILE_MACHINES @@ -43,6 +41,22 @@ scheck() +/datum/controller/process/machinery/proc/internal_process_power() + for(var/datum/powernet/powerNetwork in powernets) + if(istype(powerNetwork) && !powerNetwork.disposed) + powerNetwork.reset() + scheck() + continue + + powernets.Remove(powerNetwork) + +/datum/controller/process/machinery/proc/internal_process_power_drain() + // Currently only used by powersinks. These items get priority processed before machinery + for(var/obj/item/I in processing_power_items) + if(!I.pwr_drain()) // 0 = Process Kill, remove from processing list. + processing_power_items.Remove(I) + scheck() + /datum/controller/process/machinery/getStatName() - return ..()+"([machines.len])" \ No newline at end of file + return ..()+"([machines.len])" diff --git a/code/controllers/Processes/powernet.dm b/code/controllers/Processes/powernet.dm deleted file mode 100644 index 4a85ea4150..0000000000 --- a/code/controllers/Processes/powernet.dm +++ /dev/null @@ -1,20 +0,0 @@ -/datum/controller/process/powernet/setup() - name = "powernet" - schedule_interval = 20 // every 2 seconds - -/datum/controller/process/powernet/doWork() - for(var/datum/powernet/powerNetwork in powernets) - if(istype(powerNetwork) && !powerNetwork.disposed) - powerNetwork.reset() - scheck() - continue - - powernets.Remove(powerNetwork) - - // This is necessary to ensure powersinks are always the first devices that drain power from powernet. - // Otherwise APCs or other stuff go first, resulting in bad things happening. - for(var/obj/item/device/powersink/S in processing_objects) - S.drain() - -/datum/controller/process/powernet/getStatName() - return ..()+"([powernets.len])" diff --git a/code/controllers/Processes/turf.dm b/code/controllers/Processes/turf.dm index c1efac52f9..2ac33f48ba 100644 --- a/code/controllers/Processes/turf.dm +++ b/code/controllers/Processes/turf.dm @@ -1,9 +1,14 @@ -var/global/list/processing_turfs = list() +var/global/list/turf/processing_turfs = list() /datum/controller/process/turf/setup() name = "turf" schedule_interval = 20 // every 2 seconds /datum/controller/process/turf/doWork() - for(var/turf/unsimulated/wall/supermatter/SM in processing_turfs) - SM.process() + for(var/turf/T in processing_turfs) + if(T.process() == PROCESS_KILL) + processing_turfs.Remove(T) + scheck() + +/datum/controller/process/turf/getStatName() + return ..()+"([processing_turfs.len])" diff --git a/code/controllers/communications.dm b/code/controllers/communications.dm index 9e82c55d05..723d2e001a 100644 --- a/code/controllers/communications.dm +++ b/code/controllers/communications.dm @@ -72,7 +72,7 @@ Radio: 1355 - Medical 1357 - Engineering 1359 - Security -1341 - death squad +1341 - deathsquad 1443 - Confession Intercom 1347 - Cargo techs 1349 - Service people diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 171080fb32..98d56d3d23 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -114,6 +114,10 @@ var/list/gamemode_cache = list() var/organ_health_multiplier = 1 var/organ_regeneration_multiplier = 1 + + //Paincrit knocks someone down once they hit 60 shock_stage, so by default make it so that close to 100 additional damage needs to be dealt, + //so that it's similar to HALLOSS. Lowered it a bit since hitting paincrit takes much longer to wear off than a halloss stun. + var/organ_damage_spillover_multiplier = 0.5 var/bones_can_break = 0 var/limbs_can_break = 0 @@ -670,6 +674,8 @@ var/list/gamemode_cache = list() config.organ_health_multiplier = value / 100 if("organ_regeneration_multiplier") config.organ_regeneration_multiplier = value / 100 + if("organ_damage_spillover_multiplier") + config.organ_damage_spillover_multiplier = value / 100 if("bones_can_break") config.bones_can_break = value if("limbs_can_break") diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index d698454cab..0152af8b13 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -39,7 +39,6 @@ datum/controller/game_controller/proc/setup() setup_objects() setupgenetics() - setup_economy() SetupXenoarch() transfer_controller = new diff --git a/code/controllers/voting.dm b/code/controllers/voting.dm index 7db31c6fa6..68bfdab74b 100644 --- a/code/controllers/voting.dm +++ b/code/controllers/voting.dm @@ -257,7 +257,7 @@ datum/controller/vote text += "\n[question]" log_vote(text) - world << "[text]\nType vote to place your votes.\nYou have [config.vote_period/10] seconds to vote." + world << "[text]\nType vote or click here to place your votes.\nYou have [config.vote_period/10] seconds to vote." switch(vote_type) if("crew_transfer") world << sound('sound/ambience/alarm4.ogg', repeat = 0, wait = 0, volume = 50, channel = 3) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 97e1f59582..8bc6cc0580 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -2,10 +2,8 @@ data_core = new /obj/effect/datacore() return 1 -/obj/effect/datacore/proc/manifest(var/nosleep = 0) +/obj/effect/datacore/proc/manifest() spawn() - if(!nosleep) - sleep(40) for(var/mob/living/carbon/human/H in player_list) manifest_inject(H) return diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm index 0f10d8d56f..6098315c11 100644 --- a/code/datums/recipe.dm +++ b/code/datums/recipe.dm @@ -94,7 +94,7 @@ /datum/recipe/proc/make(var/obj/container as obj) var/obj/result_obj = new result(container) for (var/obj/O in (container.contents-result_obj)) - O.reagents.trans_to(result_obj, O.reagents.total_volume) + O.reagents.trans_to_obj(result_obj, O.reagents.total_volume) qdel(O) container.reagents.clear_reagents() return result_obj @@ -109,7 +109,7 @@ if (O.reagents) O.reagents.del_reagent("nutriment") O.reagents.update_total() - O.reagents.trans_to(result_obj, O.reagents.total_volume) + O.reagents.trans_to_obj(result_obj, O.reagents.total_volume) qdel(O) container.reagents.clear_reagents() return result_obj diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index c7495ab749..fa408d1b8f 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -259,7 +259,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee name = "Corgi Crate" contains = list() cost = 50 - containertype = /obj/structure/largecrate/lisa + containertype = /obj/structure/largecrate/animal/corgi containername = "Corgi Crate" group = "Hydroponics" @@ -271,12 +271,12 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /obj/item/weapon/reagent_containers/spray/plantbgone, /obj/item/weapon/reagent_containers/glass/bottle/ammonia, /obj/item/weapon/reagent_containers/glass/bottle/ammonia, - /obj/item/weapon/hatchet, - /obj/item/weapon/minihoe, + /obj/item/weapon/material/hatchet, + /obj/item/weapon/material/minihoe, /obj/item/device/analyzer/plant_analyzer, /obj/item/clothing/gloves/botanic_leather, /obj/item/clothing/suit/apron, - /obj/item/weapon/minihoe, + /obj/item/weapon/material/minihoe, /obj/item/weapon/storage/box/botanydisk ) // Updated with new things cost = 15 @@ -289,7 +289,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/cow name = "Cow crate" cost = 30 - containertype = /obj/structure/largecrate/cow + containertype = /obj/structure/largecrate/animal/cow containername = "Cow crate" access = access_hydroponics group = "Hydroponics" @@ -297,7 +297,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/goat name = "Goat crate" cost = 25 - containertype = /obj/structure/largecrate/goat + containertype = /obj/structure/largecrate/animal/goat containername = "Goat crate" access = access_hydroponics group = "Hydroponics" @@ -305,19 +305,11 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/chicken name = "Chicken crate" cost = 20 - containertype = /obj/structure/largecrate/chick + containertype = /obj/structure/largecrate/animal/chick containername = "Chicken crate" access = access_hydroponics group = "Hydroponics" -/datum/supply_packs/lisa - name = "Corgi crate" - contains = list() - cost = 50 - containertype = /obj/structure/largecrate/lisa - containername = "Corgi crate" - group = "Hydroponics" - /datum/supply_packs/seeds name = "Seeds crate" contains = list(/obj/item/seeds/chiliseed, @@ -345,11 +337,17 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/weedcontrol name = "Weed control crate" - contains = list(/obj/item/weapon/scythe, + contains = list(/obj/item/weapon/material/hatchet, + /obj/item/weapon/material/hatchet, + /obj/item/weapon/reagent_containers/spray/plantbgone, + /obj/item/weapon/reagent_containers/spray/plantbgone, + /obj/item/weapon/reagent_containers/spray/plantbgone, + /obj/item/weapon/reagent_containers/spray/plantbgone, + /obj/item/clothing/mask/gas, /obj/item/clothing/mask/gas, /obj/item/weapon/grenade/chem_grenade/antiweed, /obj/item/weapon/grenade/chem_grenade/antiweed) - cost = 20 + cost = 25 containertype = /obj/structure/closet/crate/secure/hydrosec containername = "Weed control crate" access = access_hydroponics @@ -447,7 +445,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/metal50 name = "50 metal sheets" - contains = list(/obj/item/stack/sheet/metal) + contains = list(/obj/item/stack/material/steel) amount = 50 cost = 10 containertype = /obj/structure/closet/crate @@ -456,7 +454,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/glass50 name = "50 glass sheets" - contains = list(/obj/item/stack/sheet/glass) + contains = list(/obj/item/stack/material/glass) amount = 50 cost = 10 containertype = /obj/structure/closet/crate @@ -465,7 +463,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/wood50 name = "50 wooden planks" - contains = list(/obj/item/stack/sheet/wood) + contains = list(/obj/item/stack/material/wood) amount = 50 cost = 10 containertype = /obj/structure/closet/crate @@ -474,7 +472,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/plastic50 name = "50 plastic sheets" - contains = list(/obj/item/stack/sheet/mineral/plastic) + contains = list(/obj/item/stack/material/plastic) amount = 50 cost = 10 containertype = /obj/structure/closet/crate @@ -1257,7 +1255,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee group = "Hydroponics" /datum/supply_packs/cardboard_sheets - contains = list(/obj/item/stack/sheet/cardboard) + contains = list(/obj/item/stack/material/cardboard) name = "50 cardboard sheets" amount = 50 cost = 10 @@ -1519,7 +1517,32 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /obj/item/weapon/stock_parts/subspace/crystal, /obj/item/weapon/storage/toolbox/electrical) +/datum/supply_packs/randomised/exosuit_mod + num_contained = 1 + contains = list( + /obj/item/device/kit/paint/ripley, + /obj/item/device/kit/paint/ripley/death, + /obj/item/device/kit/paint/ripley/flames_red, + /obj/item/device/kit/paint/ripley/flames_blue + ) + name = "Random APLU modkit" + cost = 200 + containertype = /obj/structure/closet/crate + containername = "heavy crate" + group = "Miscellaneous" +/datum/supply_packs/randomised/exosuit_mod/durand + contains = list( + /obj/item/device/kit/paint/durand, + /obj/item/device/kit/paint/durand/seraph, + /obj/item/device/kit/paint/durand/phazon + ) + name = "Random Durand exosuit modkit" - - +/datum/supply_packs/randomised/exosuit_mod/gygax + contains = list( + /obj/item/device/kit/paint/gygax, + /obj/item/device/kit/paint/gygax/darkgygax, + /obj/item/device/kit/paint/gygax/recitence + ) + name = "Random Gygax exosuit modkit" diff --git a/code/datums/wires/airlock.dm b/code/datums/wires/airlock.dm index 7e8c8779cf..a0f1f9c7f1 100644 --- a/code/datums/wires/airlock.dm +++ b/code/datums/wires/airlock.dm @@ -37,10 +37,11 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048 var/haspower = A.arePowerSystemsOn() //If there's no power, then no lights will be on. . += ..() - . += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]", + . += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]", (A.locked ? "The door bolts have fallen!" : "The door bolts look up."), ((A.lights && haspower) ? "The door bolt lights are on." : "The door bolt lights are off!"), ((haspower) ? "The test light is on." : "The test light is off!"), + ((A.backupPowerCablesCut()) ? "The backup power light is off!" : "The backup power light is on."), ((A.aiControlDisabled==0 && !A.emagged && haspower)? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."), ((A.safe==0 && haspower)? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."), ((A.normalspeed==0 && haspower)? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."), @@ -124,7 +125,7 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048 //Sending a pulse through flashes the red light on the door (if the door has power). if(A.arePowerSystemsOn() && A.density) A.do_animate("deny") - if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2) + if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2) //Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter). A.loseMainPower() if(AIRLOCK_WIRE_DOOR_BOLTS) @@ -135,7 +136,7 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048 else A.unlock() - if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2) + if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2) //two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter). A.loseBackupPower() if(AIRLOCK_WIRE_AI_CONTROL) diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index f94b978537..8932175126 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -278,6 +278,11 @@ var/const/POWER = 8 var/r = rand(1, wires.len) CutWireIndex(r) +/datum/wires/proc/RandomCutAll(var/probability = 10) + for(var/i = 1; i < MAX_FLAG && i < (1 << wire_count); i += i) + if(prob(probability)) + CutWireIndex(i) + /datum/wires/proc/CutAll() for(var/i = 1; i < MAX_FLAG && i < (1 << wire_count); i += i) CutWireIndex(i) diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 99ff26c89a..e230dfa6c9 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -91,7 +91,7 @@ /obj/item/weapon/cane/concealed/New() ..() - var/obj/item/weapon/butterfly/switchblade/temp_blade = new(src) + var/obj/item/weapon/material/butterfly/switchblade/temp_blade = new(src) concealed_blade = temp_blade temp_blade.attack_self() @@ -109,7 +109,7 @@ else ..() -/obj/item/weapon/cane/concealed/attackby(var/obj/item/weapon/butterfly/W, var/mob/user) +/obj/item/weapon/cane/concealed/attackby(var/obj/item/weapon/material/butterfly/W, var/mob/user) if(!src.concealed_blade && istype(W)) user.visible_message("[user] has sheathed \a [W] into \his [src]!", "You sheathe \the [W] into \the [src].") user.drop_from_inventory(W) @@ -175,47 +175,91 @@ origin_tech = "materials=1" var/breakouttime = 300 //Deciseconds = 30s = 0.5 minute -/obj/item/weapon/legcuffs/beartrap +/obj/item/weapon/beartrap name = "bear trap" throw_speed = 2 throw_range = 1 + gender = PLURAL + icon = 'icons/obj/items.dmi' icon_state = "beartrap0" desc = "A trap used to catch bears and other legged creatures." - var/armed = 0 + throwforce = 0 + w_class = 3.0 + origin_tech = "materials=1" + var/deployed = 0 suicide_act(mob/user) - viewers(user) << "\red [user] is putting the [src.name] on \his head! It looks like \he's trying to commit suicide." + viewers(user) << "[user] is putting the [src.name] on \his head! It looks like \he's trying to commit suicide." return (BRUTELOSS) -/obj/item/weapon/legcuffs/beartrap/attack_self(mob/user as mob) +/obj/item/weapon/beartrap/attack_self(mob/user as mob) ..() if(ishuman(user) && !user.stat && !user.restrained()) - armed = !armed - icon_state = "beartrap[armed]" - user << "[src] is now [armed ? "armed" : "disarmed"]" + if(deployed==0) + user.visible_message("[user] is deploying \the [src]", "You are deploying \the [src]!") + if (do_after(user, 60)) + user.visible_message("[user] has deployed \the [src]", "You have deployed \the [src]!") + deployed = 1 + user.drop_from_inventory(src, user.loc) + update_icon() + anchored = 1 -/obj/item/weapon/legcuffs/beartrap/Crossed(AM as mob|obj) - if(armed) +/obj/item/weapon/beartrap/attack_hand(mob/user as mob) + if(ishuman(user) && !user.stat && !user.restrained()) + if(deployed==1) + user.visible_message("[user] is disarming \the [src]", "You are disarming \the [src]!") + if (do_after(user, 60)) + user.visible_message("[user] has disarmed \the [src]", "You have disarmed \the [src]!") + deployed = 0 + anchored = 0 + update_icon() + + if(deployed==0) + ..() + +/obj/item/weapon/beartrap/Crossed(AM as mob|obj) + if(deployed) if(ishuman(AM)) if(isturf(src.loc)) - var/mob/living/carbon/H = AM + var/mob/living/carbon/human/H = AM if(H.m_intent == "run") - armed = 0 - H.legcuffed = src - src.loc = H - H.update_inv_legcuffed() - H << "\red You step on \the [src]!" - feedback_add_details("handcuffs","B") //Yes, I know they're legcuffs. Don't change this, no need for an extra variable. The "B" is used to tell them apart. + deployed = 0 + update_icon() + H << "You step on \the [src]!" for(var/mob/O in viewers(H, null)) if(O == H) continue - O.show_message("\red [H] steps on \the [src].", 1) + O.show_message("[H] steps on \the [src].", 1) + if(H.lying) + var/obj/item/organ/external/affecting = pick(H.organs) + if(affecting.take_damage(30, 0)) + H.UpdateDamageIcon() + affecting.embed(src) + else + var/list/potentialorgans = list() + for(var/organ in list("l_leg", "r_leg", "l_foot", "r_foot")) + var/obj/item/organ/external/R = H.get_organ(organ) + if(R && !(R.status & ORGAN_DESTROYED)) + potentialorgans += R + var/obj/item/organ/external/affecting = pick(potentialorgans) + if(affecting.take_damage(30, 0)) + H.UpdateDamageIcon() + affecting.embed(src) + + if(isanimal(AM) && !istype(AM, /mob/living/simple_animal/parrot) && !istype(AM, /mob/living/simple_animal/construct) && !istype(AM, /mob/living/simple_animal/shade) && !istype(AM, /mob/living/simple_animal/hostile/viscerator)) - armed = 0 + deployed = 0 var/mob/living/simple_animal/SA = AM SA.health -= 20 ..() +/obj/item/weapon/beartrap/update_icon() + ..() + + if(deployed == 0) + icon_state = "beartrap0" + else + icon_state = "beartrap1" /obj/item/weapon/caution diff --git a/code/defines/procs/statistics.dm b/code/defines/procs/statistics.dm index 8a9eb4042d..6025457758 100644 --- a/code/defines/procs/statistics.dm +++ b/code/defines/procs/statistics.dm @@ -1,34 +1,20 @@ -proc/sql_poll_players() +proc/sql_poll_population() if(!sqllogging) return + var/admincount = admins.len var/playercount = 0 for(var/mob/M in player_list) if(M.client) playercount += 1 establish_db_connection() if(!dbcon.IsConnected()) - log_game("SQL ERROR during player polling. Failed to connect.") + log_game("SQL ERROR during population polling. Failed to connect.") else var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss") - var/DBQuery/query = dbcon_old.NewQuery("INSERT INTO population (playercount, time) VALUES ([playercount], '[sqltime]')") + var/DBQuery/query = dbcon_old.NewQuery("INSERT INTO `tgstation`.`population` (`playercount`, `admincount`, `time`) VALUES ([playercount], [admincount], '[sqltime]')") if(!query.Execute()) var/err = query.ErrorMsg() - log_game("SQL ERROR during player polling. Error : \[[err]\]\n") - - -proc/sql_poll_admins() - if(!sqllogging) - return - var/admincount = admins.len - establish_db_connection() - if(!dbcon.IsConnected()) - log_game("SQL ERROR during admin polling. Failed to connect.") - else - var/sqltime = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss") - var/DBQuery/query = dbcon_old.NewQuery("INSERT INTO population (admincount, time) VALUES ([admincount], '[sqltime]')") - if(!query.Execute()) - var/err = query.ErrorMsg() - log_game("SQL ERROR during admin polling. Error : \[[err]\]\n") + log_game("SQL ERROR during population polling. Error : \[[err]\]\n") proc/sql_report_round_start() // TODO @@ -111,10 +97,8 @@ proc/statistic_cycle() if(!sqllogging) return while(1) - sql_poll_players() - sleep(600) - sql_poll_admins() - sleep(6000) // Poll every ten minutes + sql_poll_population() + sleep(6000) //This proc is used for feedback. It is executed at round end. proc/sql_commit_feedback() @@ -157,4 +141,4 @@ proc/sql_commit_feedback() var/DBQuery/query = dbcon.NewQuery("INSERT INTO erro_feedback (id, roundid, time, variable, value) VALUES (null, [newroundid], Now(), '[variable]', '[value]')") if(!query.Execute()) var/err = query.ErrorMsg() - log_game("SQL ERROR during death reporting. Error : \[[err]\]\n") \ No newline at end of file + log_game("SQL ERROR during death reporting. Error : \[[err]\]\n") diff --git a/code/game/antagonist/station/highlander.dm b/code/game/antagonist/station/highlander.dm index 9b82b15852..3ee73f4a95 100644 --- a/code/game/antagonist/station/highlander.dm +++ b/code/game/antagonist/station/highlander.dm @@ -37,7 +37,7 @@ var/datum/antagonist/highlander/highlanders player.equip_to_slot_or_del(new /obj/item/clothing/under/kilt(player), slot_w_uniform) player.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(player), slot_l_ear) player.equip_to_slot_or_del(new /obj/item/clothing/head/beret(player), slot_head) - player.equip_to_slot_or_del(new /obj/item/weapon/claymore(player), slot_l_hand) + player.equip_to_slot_or_del(new /obj/item/weapon/material/sword(player), slot_l_hand) player.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(player), slot_shoes) player.equip_to_slot_or_del(new /obj/item/weapon/pinpointer(get_turf(player)), slot_l_store) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 68e1f34f88..deb4426cf5 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -598,8 +598,7 @@ inject_amount = 0 if (inject_amount > 50) inject_amount = 50 - connected.beaker.reagents.trans_to(connected.occupant, inject_amount) - connected.beaker.reagents.reaction(connected.occupant) + connected.beaker.reagents.trans_to_mob(connected.occupant, inject_amount, CHEM_BLOOD) return 1 // return 1 forces an update to all Nano uis attached to src //////////////////////////////////////////////////////// diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm index b5854ed981..d70c181830 100644 --- a/code/game/gamemodes/cult/cult_structures.dm +++ b/code/game/gamemodes/cult/cult_structures.dm @@ -38,11 +38,12 @@ /obj/structure/cult/pylon/proc/attackpylon(mob/user as mob, var/damage) if(!isbroken) if(prob(1+ damage * 5)) - user << "You hit the pylon, and its crystal breaks apart!" - for(var/mob/M in viewers(src)) - if(M == user) - continue - M.show_message("[user.name] smashed the pylon!", 3, "You hear a tinkle of crystal shards", 2) + user.visible_message( + "[user] smashed the pylon!", + "You hit the pylon, and its crystal breaks apart!", + "You hear a tinkle of crystal shards" + ) + user.do_attack_animation(src) playsound(get_turf(src), 'sound/effects/Glassbr3.ogg', 75, 1) isbroken = 1 density = 0 diff --git a/code/game/gamemodes/cult/cultify/obj.dm b/code/game/gamemodes/cult/cultify/obj.dm index 630877eb11..4306182eaf 100644 --- a/code/game/gamemodes/cult/cultify/obj.dm +++ b/code/game/gamemodes/cult/cultify/obj.dm @@ -14,14 +14,14 @@ new /obj/structure/cult/pylon(loc) ..() -/obj/item/stack/sheet/wood/cultify() +/obj/item/stack/material/wood/cultify() return /obj/item/weapon/book/cultify() new /obj/item/weapon/book/tome(loc) ..() -/obj/item/weapon/claymore/cultify() +/obj/item/weapon/material/sword/cultify() new /obj/item/weapon/melee/cultblade(loc) ..() @@ -32,13 +32,6 @@ /obj/item/weapon/storage/backpack/cultpack/cultify() return -/obj/item/weapon/table_parts/cultify() - new /obj/item/weapon/table_parts/wood(loc) - ..() - -/obj/item/weapon/table_parts/wood/cultify() - return - /obj/machinery/cultify() // We keep the number of cultified machines down by only converting those that are dense // The alternative is to keep a separate file of exceptions. @@ -66,7 +59,7 @@ qdel(src) /obj/machinery/door/airlock/external/cultify() - new /obj/structure/mineral_door/wood(loc) + new /obj/structure/simple_door/wood(loc) ..() /obj/machinery/door/cultify() @@ -121,11 +114,11 @@ /obj/structure/grille/cult/cultify() return -/obj/structure/mineral_door/cultify() - new /obj/structure/mineral_door/wood(loc) +/obj/structure/simple_door/cultify() + new /obj/structure/simple_door/wood(loc) ..() -/obj/structure/mineral_door/wood/cultify() +/obj/structure/simple_door/wood/cultify() return /obj/singularity/cultify() @@ -149,8 +142,12 @@ ..() /obj/structure/table/cultify() - new /obj/structure/table/woodentable(loc) - ..() - -/obj/structure/table/woodentable/cultify() - return + // Make it a wood-reinforced wooden table. + // There are cult materials available, but it'd make the table non-deconstructable with how holotables work. + // Could possibly use a new material var for holographic-ness? + material = name_to_material["wood"] + reinforced = name_to_material["wood"] + update_desc() + update_connections(1) + update_icon() + update_material() diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm index d71ff249d1..dc315ac510 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm @@ -23,7 +23,7 @@ processing_turfs.Remove(src) ..() -/turf/unsimulated/wall/supermatter/proc/process() +/turf/unsimulated/wall/supermatter/process() // Only check infrequently. if(next_check>world.time) return diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 3e039a4c35..861e3e1271 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -110,11 +110,11 @@ var/global/datum/controller/gameticker/ticker else src.mode.announce() + current_state = GAME_STATE_PLAYING create_characters() //Create player characters and transfer them collect_minds() equip_characters() data_core.manifest() - current_state = GAME_STATE_PLAYING callHook("roundstart") @@ -155,7 +155,6 @@ var/global/datum/controller/gameticker/ticker for(var/obj/multiz/ladder/L in world) L.connect() //Lazy hackfix for ladders. TODO: move this to an actual controller. ~ Z if(config.sql_enabled) - spawn(3000) statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE return 1 @@ -292,7 +291,7 @@ var/global/datum/controller/gameticker/ticker if(player.mind.assigned_role != "MODE") job_master.EquipRank(player, player.mind.assigned_role, 0) UpdateFactionList(player) - EquipCustomItems(player) + equip_custom_items(player) if(captainless) for(var/mob/M in player_list) if(!istype(M,/mob/new_player)) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index d13f90d2be..0ad6e7fc5f 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -513,9 +513,9 @@ datum/objective/steal "diamond drill" = /obj/item/weapon/pickaxe/diamonddrill, "bag of holding" = /obj/item/weapon/storage/backpack/holding, "hyper-capacity cell" = /obj/item/weapon/cell/hyper, - "10 diamonds" = /obj/item/stack/sheet/mineral/diamond, - "50 gold bars" = /obj/item/stack/sheet/mineral/gold, - "25 refined uranium bars" = /obj/item/stack/sheet/mineral/uranium, + "10 diamonds" = /obj/item/stack/material/diamond, + "50 gold bars" = /obj/item/stack/material/gold, + "25 refined uranium bars" = /obj/item/stack/material/uranium, ) @@ -830,13 +830,13 @@ datum/objective/heist/salvage for(var/obj/item/O in locate(/area/shuttle/skipjack/station)) - var/obj/item/stack/sheet/S - if(istype(O,/obj/item/stack/sheet)) + var/obj/item/stack/material/S + if(istype(O,/obj/item/stack/material)) if(O.name == target) S = O total_amount += S.get_amount() for(var/obj/I in O.contents) - if(istype(I,/obj/item/stack/sheet)) + if(istype(I,/obj/item/stack/material)) if(I.name == target) S = I total_amount += S.get_amount() @@ -844,9 +844,9 @@ datum/objective/heist/salvage for(var/datum/mind/raider in raiders.current_antagonists) if(raider.current) for(var/obj/item/O in raider.current.get_contents()) - if(istype(O,/obj/item/stack/sheet)) + if(istype(O,/obj/item/stack/material)) if(O.name == target) - var/obj/item/stack/sheet/S = O + var/obj/item/stack/material/S = O total_amount += S.get_amount() if(total_amount >= target_amount) return 1 diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index 2981596645..3c029d5298 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -24,44 +24,6 @@ if (prob(75)) DIFFMUT = rand(0,20) - /* Old, for reference (so I don't accidentally activate something) - N3X - var/list/avnums = new/list() - var/tempnum - - avnums.Add(2) - avnums.Add(12) - avnums.Add(10) - avnums.Add(8) - avnums.Add(4) - avnums.Add(11) - avnums.Add(13) - avnums.Add(6) - - tempnum = pick(avnums) - avnums.Remove(tempnum) - HULKBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - TELEBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - FIREBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - XRAYBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - CLUMSYBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - FAKEBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - DEAFBLOCK = tempnum - tempnum = pick(avnums) - avnums.Remove(tempnum) - BLINDBLOCK = tempnum - */ var/list/numsToAssign=new() for(var/i=1;i