Commit Graph

107 Commits

Author SHA1 Message Date
Rob Bailey
12d2e89d50 Cable Layers (#46761)
* Cable Layers

rudimentary function

layer placement

icons

rebase fixes

sprites

refactor

dme fix

dme fix again

potentially functional version

power bridge sprites work correctly

slightly better sprite

examine message + minor organization

* revert runtime changes
2019-10-03 13:25:33 +02:00
spookydonut
82504aee09 Adds linting for power_change() and obj_break() (#46608)
Adds linting for power_change() and obj_break()
2019-09-26 05:09:49 -07:00
spookydonut
8c33746f53 fuck trying to safe cpu cycles i guess 2019-09-16 18:39:45 +08:00
spookydonut
68c8b71ae9 Changes power_change() to respect parent calls for toggling NOPOWER (#46486)
About The Pull Request

Similar to #46485
Now all relevant uses of power_change() call parent, theres a signal sent when a machine changes the NOPOWER flag, all remaining machines that were using power_change() instead of update_icon() have been fixed.
Why It's Good For The Game

code quality, eventually signal stuff. and signal stuff
2019-09-16 17:49:00 +12:00
actioninja
0837f201b3 cleans up propagate code 2019-07-21 18:45:57 -07:00
Rob Bailey
f8ee5be8ee Properly fixes smart cable lag issues and also fixes the awful connection issues. (#44945)
About The Pull Request

I ended up just rewriting propagation logic entirely. This needs a bit of cleanup but this is a really high priority fix.
Actually tested this time. I can confirm for sure this is working in all situations that were previously broken.
Closes #44940
Closes #44936
Closes #44935
Closes #44929
Why It's Good For The Game

I fucked up bad
Changelog

cl
fix: cables now actually function again (I'm so sorry)
/cl
2019-07-03 23:34:13 +12:00
Rob Bailey
a7401c80dd Fix smart cable lag issues (#44899)
Cables are no longer lag generators when being cut.
2019-07-01 13:48:45 -07:00
Rob Bailey
65e9888fa6 [READY] Smart Cables (#44265)
Cables now autoconnect on cardinal directions. All cable placement has been completely stripped out and replaced with simple single cable per tile logic.
Low effort demo: https://www.youtube.com/watch?v=fXp8s6ORWbA
Yes I am aware that cutting it is not dropping wire, that version was bugged.
Cables no longer need a knot specifically placed to link to power objects. The sprite is automatically changed to represent this.
The only exception to this logic is that on smes units, due to the terminal being next to the output, they will not link there.
On a technical powernet side, this is the same as old cables once actually placed. They still use the existing powernet system, just the placement and connection works differently.

Old cables have been turned into "pipe cleaners" for wire art purposes. they work just like the old ones, just missing all the powernet functionality, and also you can put them on top of the floor.
Why It's Good For The Game

How obnoxious cables were to both map and work with in game has been something that has annoyed me for a really long time now.
This is both easier for new players to learn, and easier for experienced players to work with.
Along with making in game much more intuitive and easier, it makes mapping much easier as well. Mad lad wjohn was able to rip out all the mapping conversion in one day because of how much faster it is to work with.

cl actioninja and wjohn
add: Cables have been completely reworked. Simple per tile connection logic, automatically connects to things above it. Think minecraft redstone.
add: Old cables have been kept as pipe cleaner. They are non-functional in terms of power, but otherwise have the same connection logic. Also can go on top of tiles.
remove: mech cable layer has been removed because it was terrible shitcode nobody used
tweak: (sort of balance) cable stack sized has been reduced to 15.
/cl
2019-06-22 10:24:37 +12:00
skoglol
817c9c0ffc Powernets now tracks load added between power ticks. (#40216)
* Powernet non-machine processing changes.

* forgot an =

* Reverts floodlight changes.

* Clamps surplus() to valid values.
2018-09-14 13:05:21 +02:00
skoglol
6c7d97e52f SMES can no longer output to nowhere. (#40106)
* SMES can no longer output to nowhere, removed duplicate proc used in input.

* Forgot an else.

* TRUE and FALSE.

* add_avail() now returns true when appropriate.
2018-09-07 13:02:59 +02:00
Patrick Chieppe
2c8248575a Logging system refactor and improvement (#39521)
* Refactor several log lines to use datum_info_line and atom_loc_line

* Add default return strings from datum_info_line and atom_loc_line

* Add parentheses around atom_loc_line data

* Change more logs to use atom_loc_line

* Add check in atom_loc_line for turfs to avoid calling get_turf on them

* Re-add removed 'at'

* Replace datum_info_line with key_name and atom_loc_line with loc_name

* Refactor logging functions

* Avoid double-logging self-interactions

* Fallback to simple stringification if all else fails in key_name()

* Rewrite muscle spasm logging to use log_message

* Standardize logging of martial arts

* Tweak individual logging panel look

* Fix individual logging panel source

* When I typed || I really meant &&

* Fix Telecomms logging always showing client logs in the panel

* Reverts addition of buggy ownership log to panel

* Remove colon

* Fix missing log_directed_talk tag

* Add warning for missing type in log_direted_talk

* Change warnings to stack_traces

* Add square brackets around fallthrough key_name() case to help parsing

* Allow atom arguments/src in log_*() functions

* Change log_combat call with null argument to log_message

* Change mecha types' log_message() arguments to match atom and mob version

* Add key_name() case for atoms

* Fix resist_grab() unsetting pulledby before log_combat gets a chance to use it

* Fix log_globally logic

* Add logging for hitting objects with items

* Move log_combat() to atoms.dm

* Use utility functions for object stringification in log_combat()

* Use utility functions for object stringification in log_combat()

* Add missing logs for interacting with display cases

* Rewrite log_combat() comment

* Add missing space in log_combat()

* Add logging for hitting grilles barehanded

* Add missing ..()
2018-08-12 21:41:09 +02:00
vuonojenmustaturska
6406896df1 Replaces a bunch of obj vars (and emagged on machinery/items) with obj_flags (#34078)
* It works, but is it worth it?

* bitfield helpers take 1

* Would this work?

* remove dangling debug code

* rebase & fixes

* vv bitfield stuff, reading

* DNM oceans of shitcode DNM

* honk

* honk2

* plonk

* rebase & fix
2018-01-22 20:19:46 +01:00
ShizCalev
8eafaccc88 Cleans up unused code 2017-11-20 00:03:33 -05:00
vuonojenmustaturska
76af1bfe69 Stops manned turrets from firing when the user unbuckles themselves from the turret (#31754)
* The clown is drunk, and the cards of death wait on him

* Update power.dm
2017-10-19 12:41:28 +02:00
KorPhaeron
cc309236d9 ismecha define (#31192) 2017-10-02 02:03:40 -04:00
Jordan Brown
af4d9a85c9 Repaths /obj/item/weapon to /obj/item (#29929) 2017-08-16 10:38:51 -03:00
Jordan Brown
d1ae0a0c95 Adds helpers to avoid << use (#29611) 2017-08-09 00:27:54 -03:00
ShizCalev
45d3d52af7 Made some object lists less terrible to read (#29304)
* spaces

* more spaces

* last ones
2017-07-18 10:44:29 -04:00
Jordan Brown
d135dc2643 Merge pull request #29162 from ChangelingRain/directionliststweak
Renames GLOB.cardinal to GLOB.cardinals to match GLOB.diagonals and GLOB.alldirs
2017-07-10 18:45:52 -04:00
ShizCalev
59ef81245b Changes some 1s and 0s to TRUE and FALSE (#29144) 2017-07-10 10:31:34 -04:00
Joan Lung
ec9439b915 Renames GLOB.cardinal to GLOB.cardinals to match GLOB.diagonals and GLOB.alldirs 2017-07-09 17:24:28 -04:00
oranges
ae3740d84b use_power var now uses a define to reflect it not being a bool
NO_POWER_USE
IDLE_POWER_USE
ACTIVE_POWER_USE

holopads now correctly set use_power and the active_power_usage
2017-06-29 23:50:16 +00:00
Cyberboss
9e1ef0ffe2 Global variable wrappers (#25325)
* Add the system for managed global variables

* Travis ban old globals

* So you CAN inline proccall, that's neat

* Fix that

* master.dm

* Remove the hack procs

* Move InitGlobals to the proper spot

* configuration.dm

* Fix the missing pre-slash

* clockcult.dm

* This is probably for the best

* Doy

* Fix shit

* Rest of the DEFINES tree

* Fix

* Use global. for access

* Update find_references_in_globals

Always hated that proc

Whoever made it must've bee a r e a l idiot...

* __HELPERS tree

* Move global initialization to master.

Fix the declaration

* database.dm

* Dat newline

* I said DECLARATIVE order!

* Here's something you can chew on @Iamgoofball

* game_modes.dm

* Fix this

* genetics.dm

* flavor_misc.dm

* More stuff

* Do it mso's way. Keep the controllers as global

* Make master actually see it

* Fix

* Finish _globalvars/lists

* Finish the rest of the _globalvars tree

* This is weird

* Migrate the controllers

* SLOTH -> GLOB

* Lighting globals

* round_start_time -> ticker

* PAI card list -> pai SS

* record_id_num -> static

* Diseases list -> SSdisease

* More disease globals to the SS

* More disease stuff

* Emote list

* Better and better

* Bluh

* So much stuff

* Ahh

* Wires

* dview

* station_areas

* Teleportlocs

* blood_splatter_icons

* Stuff and such

* More stuff

* RAD IO

* More stuff and such

* Blob shit

* Changeling stuff

* Add "Balance" to changelogs

* Balance for changelog compiler + Auto Tagging

* Update the PR template

* hivemind_bank

* Bip

* sacrificed

* Good shit

* Better define

* More cult shit

* Devil shit

* Gang shit

* > borers

Fix shit

* Rename the define

* Nuke

* Objectives

* Sandbox

* Multiverse sword

* Announce systems

* Stuff and such

* TC con

* Airlock

* doppllllerrrrrr

* holopads

* Shut up byond you inconsistent fuck

* Sneaky fuck

* Burp

* Bip

* Fixnshit

* Port without regard

* askdlfjs;

* asdfjasoidojfi

* Protected globals and more

* SO MANY

* ajsimkvahsaoisd

* akfdsiaopwimfeoiwafaw

* gsdfigjosidjfgiosdg

* AHHHHHHHHHHHHHHHHHHHHHHH!!!!!

* facerolll

* ASDFASDFASDF

* Removes the unused parts of dmm_suite

* WIP

* Fix quote

* asdfjauwfnkjs

* afwlunhskjfda

* asfjlaiwuefhaf

* SO CLOSE

* wwwweeeeeewwwww

* agdgmoewranwg

* HOLY MOTHER OF FUCK AND THATS JUST HALF THE JOB?!?

* Fix syntax errors

* 100 errors

* Another 100

* So many...

* Ugh

* More shit

* kilme

* Stuuuuuufffff

* ajrgmrlshio;djfa;sdkl

* jkbhkhjbmjvjmh

* soi soi soi

* butt

* TODAY WE LEARNED THAT GLOBAL AND STATIC ARE THE EXACT SAME FUCKING THING

* lllllllllllllllllllllllllllllllllllllllllll

* afsdijfiawhnflnjhnwsdfs

* yugykihlugk,kj

* time to go

* STUFFF!!!

* AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!

* ngoaijdjlfkamsdlkf

* Break time

* aufjsdklfalsjfi

* CONTROL KAY AND PRAY

* IT COMPILEELEELELAKLJFKLDAFJLKFDJLADKJHFLJKAJGAHIEJALDFJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

* Goteem

* Fix testing mode

* This does not belong in this PR

* Convert it to a controller

* Eh, fuck this option

* Revert controllerization Ill do it some other time

* Fix

* Working controllerization

* FOR THE LOVE OF CHRIST PROTECT THE LOGS

* Protect admins and deadmins

* Use the inbuilt proc
2017-04-06 23:26:13 -06:00
Cyberboss
b6d5aba7b2 Removes area.master. Moves area/New to Initialize (#24134)
* Removes master areas

* Ports area/New to Initialize
2017-02-18 01:04:47 +13:00
Karl Parakenings
ba671b85a2 added distance check for electrocute mob proc in [power.dm] (#22231)
* added adjacency check for electrocute mob proc

* updated all calls to proc enabling range check
2016-12-18 19:55:34 +13:00
Joan Lung
bdcb16113a Adds a few turf istype helpers (#20754)
* a very calming act
when the world is too much, too fast

* i'm tired
but i have to be efficient, infinite

* lick your lips at the sight of me
a fantasy made reality
2016-10-01 19:25:46 +02:00
Joan Lung
dff4db726a Replaces a bunch of istypes with their proper macros (#20739)
* Replaces a bunch of istypes with their proper macros

* i'm not sure doing a 100+ file changed pr on a whim is something you do when bored
especially if you do it by hand because you never actually learned the regex that would let you automate it

* i'm just... gonna do this, because that check was true a lot and it shouldn't matter
2016-09-30 20:21:08 +02:00
phil235
4efb343d77 * Admins can now bypass the vote creation cooldown.
* Messages in a mob's say_log var are now timestamped and include the coordinates of the mob at the time.
* Fix oil slime extract explosion reaction not being logged.
* Fixes lack of log for reagent explosion.
* Mob's attack_log now show when the mob was electrocuted. Doors get an electrification log when electrified (including via an EMP).
* Fixes gibself admin log showing null instead of the key.
2016-04-29 18:21:53 +02:00
phil235
0caa59b21a First commit of this big PR
These are the files with just tiny tweaks. Mostly modify an object's attackby so it does "return ..()" instead of "..()".
If there are other things in this commit, the PR's description will explain them.
2016-04-24 20:26:24 +02:00
Remie Richards
95d2f9a848 Ports the functionality of the /vg/ holomap to the Station Blueprints, you can now see a layout of cables/pipes/atmos/power machinery as it was at roundstart to assist in repairs 2016-04-08 01:02:41 +01:00
duncathan
b9950c4358 turf/open and turf/closed 2016-03-29 13:38:56 -06:00
duncathan
5bf31463da removes simulated turfs; adds space gas mixture for space 2016-03-10 17:27:01 -06:00
Bjorn Neergaard
29fdf73cc6 tgui power monitor; linegraph component 2016-02-05 17:06:04 -06:00
Bjorn Neergaard
c5e6a922ca Cache canister updates and make huge scrubbers use power; add movable version 2016-02-05 17:06:03 -06:00
Firecage
754491ce4c Changes relatives paths into absolute paths and makes some if()'s better 2016-01-17 01:36:56 +02:00
bear1ake
f697ae90f5 removes a bunch of .0 2015-09-10 20:57:30 +09:00
duncathan
51c09f16bf makes all Destroy()'s return properly 2015-08-31 00:21:01 -06:00
Firecage
4688c2c969 Fixes proc arguments 2015-07-15 23:52:35 +02:00
Remie Richards
d9ec8a1008 area/proc/get_apc() is no longer shit and does not lag (AT ALL) on large areas anymore, the new method stores a list of all APCs in the world, and checks if their area var is equal to the area get_apc() was called on. 2015-06-30 12:20:28 +01:00
MrStonedOne
bd6d51a0b5 Massive MC and subsystem rewrite
MC:
	No longer tracks a subsystem's cpu usage. This was basically worthless and took up space on the stat panel
	Can calculate wait down to a tenth of a decisecond to make it fps/world.ticklag agnostic
	Now allows subsystems to have a dynamic wait, that is based on a ratio of how long that subsystem has been taking to process(cost). (This system allows for upper and lower bounds, and an changeable cost delta for each subsystem)
	MC can now be told to init a zlevel

All Subsystems:
	Stats panel now allows child subsystems to pass it a message to add to its stats entry. All subsystems have been moved over to this system - This should cut down on subsystems having to copy and paste the stats proc in order to add to it
	All subsystems now properlly handle being given a zlevel in their init proc

Subsystem changes:
	Air:
		Added air to the dynamic wait subsystem. upper bound: 50, lower bound: 5, cost delta: 3 times process cost
		Air now fires 4 times faster when it can do so without lagging things up
		Pipenet has been merged into air
		Atmos machinery now processes with process_atmos(), ticked by air, not machinery.
		Hotspots (the fire object) are now object pooled
	Pipenet:
		Deleted, added to air
	Machinery:
		Moved all atmos calcualtions in all objects's process() to process_atmos().
	Lighting:
		Added Lighting to the dynamic wait subsystem. upper bound: 20, lower bound: 5, cost delta: 3 times process cost
	Ticker:
		Fixed ticker not updating the lobby panel when game start delayed
		Fixed the game start timer updating rapidly from queued fires when game start delay is removed
	Garbage/qdel:
		qdel will now limit its process time to 2ds a fire.
		qdel can now be given hints as a return to Destroy() as to what should be done with the object.
		the options are:
			queue: (default) this is the normal behavior.
			letmelive: old default to non-null/zero. does nothing with the object
			iwillgc: functionally the same as above, mainly to let people working with objects know that the object will not be queued for GC checking
			harddel: this will queue the object to be deleted without storing a soft reference, mainly to save locate() processing time.
			harddel_now: this will del() the object. To allow for a clean removal of every del() not in qdel
		All objects have been updated to the new system, harddel and iwillgc was not added to any new objects.
		Fixed some objects not GCing because they didn't properlly clear references in Destory()
		Fixed some objects getting qdel'ed preventing other objects from getting GCed because they did not null their reference to that object.
2015-04-29 02:00:25 -07:00
phil235
e16a817b55 Adjusts electrocution damage from cells and powernets. Less RNG and never goes above 95 to avoid instacrit.
Fixes item attacks targeting a random limb instead of the one selected.
2015-04-26 23:48:20 +02:00
xxalpha
13e291a4e9 Merge remote-tracking branch 'upstream/master' into catwalkmachines
Conflicts:
	code/game/turfs/turf.dm
	code/modules/power/power.dm
2015-03-06 19:19:09 +00:00
xxalpha
15dacd50b1 Replaces cancable var with two new procs.
Clean up.
2015-02-21 20:15:03 +00:00
Remie Richards
5fc7af7fbf attackby() now has an argument containing the parameters of the click that called it. Items placed on tables now center their icon where the user clicked. this is NOT true for racks, since racks look organised in their sprite.
Items reset their pixel_x and pixel_y values on pickup.
2015-02-19 13:02:43 +00:00
xxalpha
ec4bc5665c Allows portable machines to be mounted on any turf that cancable. 2015-02-17 02:27:41 +00:00
carnie
a029a49392 SubSystem rewrite
Misc:

+Fixes unreported issue with initializing lighting on a specific zlevel

+Fixes two similar issues with moveElement and moveRange. Where fromIndex or toIndex could be adjusted incorrectly in certain conditions. Potentially causing bad-sorts, or out of bound errors.

+Rewrites listclearnulls(list/L) to no longer iterate through L.len elements for every null in the list (plus 1). i.e. went from L.len*(number_of_nulls+1) list-element reads (best-case), to L.len list-element reads (worst-case)

+New proc/getElementByVar(list/L, varname, value) which finds the first datum in a list, with a variable named varname, which equals value. You can also feed it atoms instead of lists due to the way the in operator functions.

+Fixes an unreported issue with Yota's list2text rewrite. Under certain conditions, the first element would not be converted into a string. Causing type-mismatch runtimes.

+New global map_ready variable. This is not fully implemented yet, but will be used to avoid duplicate calls to initialize() for map objects.

+All turfs now maintain references to all lights currently illuminating them. This will mean higher memory use unfortunately, due to the huge number of turfs. However, it will speed up updateAffectingLights significantly. I've used list husbandry to reduce baseline memory usage, so it shouldn't be any worse than some past atmos modifications memory-wise.

-Removed 'quadratic lighting', can add this back at some point. Sorry.

+modified the way lum() works slightly, to allow turfs to have overridden delta-lumen. i.e. space cannot be illuminated more than its default ambiance. This allowed removal of some iffy special-snowflake lighting areas implemented by somebody else.

+Lighting images in the dmi can now use arbitrary naming schemes. It is reliant on order now. This allows the dmi to be replaced by simply dropping in a new dmi.

-Removed all subtypes of /area/shuttle. Shuttles now create duplicate 'rooms' of /area/shuttle. (More on this later). This will conflict with most maps. Guide on how to fix to follow.

+All verbs/tools relating to world.tick_lag were refactored to use world.fps. However old config text for setting tick_lag will still work (it converts the value to fps for you)

+MC stats improved using smoothing. They now have their own tab so they dont get in the way when you're playing as an admin.

-removed the push_mob_back stuff due to conflicting changes. Sorry Giacom.

_OK, NOW THE ACTUAL INTERESTING STUFF_

Following systems moved over to subsystem datums:
air_master
garbage_manager
lighting_controller
process_mobs (aka Life())
nanomanager
power
sun
pipenets
AFK kick loops
shuttle_controller (aka emergency shuttle/pods), supply_shuttle and other shuttles
voting
bots
radio
diseases
events
jobs
objects
ticker

Subsystems hooks and variables should be commented fairly in-depth. If anything isn't particularly clear, please make an issue.

Many system-specific global variables have been refactored into

All tickers which previously used world.timeofday now use world.time

some subsystems can iterate before round start. this resolves the issue with votes not working pregame
2014-12-31 13:25:41 +00:00
paprka
3ca6d769a1 adds catwalks 2014-12-26 17:38:55 -08:00
paprka
404da4dbdd code optimizations 2014-12-25 13:28:05 -08:00
Aranclanos
55dd64fdc2 Adds static power value on areas. These variables should replace machines on the process list, that are only there to consume power.
This commit removes lights from the process list, about 500 of them on the current map.
The purpose of this is to reduce lag from the master controller ticker.
2014-08-06 06:57:52 -03:00
Menshin
e65919da42 Removed the now unused directwired variable 2014-07-02 23:58:12 +02:00