Commit Graph

25 Commits

Author SHA1 Message Date
StarSmasher
09b92c347f Optimises uniqueList()
Credits go to /TG/, I just figured I'd do what the other codebases do and take it over for us as well.

Changes:

Optimises uniquelist()
also renames it from uniquelist() to uniqueList()
Test 1:

1,000,000 random numbers between 1 and 7 in a list.
Clean out duplicates with current uniquelist(), once:
self: 0.362
Clean out duplicates with my new uniqueList(), once:
self: 0.184

Test 2:

3,000,000 random numbers between 1 and 7 in a list.
Clean out duplicates with current uniquelist(), once:
self: 1.069
Clean out duplicates with my new uniqueList(), once:
self: 0.496
2015-05-10 16:59:32 +02:00
Neerti
326fde4c5f Adds the research module, condensed into one commit so far. 2015-04-04 20:17:59 -04:00
volas
855755f808 sanitize() refactor: first pass (sanitize) 2015-03-22 23:31:19 +03:00
PsiOmega
7f68403ae4 NanoUI - Silicon law manager
NanoUI interface for viewing silicon laws, accessible to both the silicon and admins.
Malf AIs and admins may also add, edit, and remove laws.
2015-03-17 07:22:02 +01:00
PsiOmega
5578afa07c General update.
NanoUI interface sorted.
Accessible by AI, borgs, and through consoles.
Automatic alarm resets in case of lost sources.
2015-02-23 10:32:25 +01:00
Chinsky
3f8462a399 Adds a wardrobe structure to pick your underwear.
Adds ability to wear female underwear as male and vice versa.
Changes 'underwear'/'undershirt' vars to hold iconstate instead of esoteric dances with array indexes.
2015-02-16 11:17:22 +03:00
Zulker Nayeen Nahiyan
0a3f523066 Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
Conflicts:
	code/__HELPERS/maths.dm
	code/__HELPERS/type2type.dm
	code/modules/clothing/head/hardhat.dm
	code/modules/clothing/spacesuits/captain.dm
	code/modules/clothing/spacesuits/miscellaneous.dm
	code/modules/clothing/spacesuits/rig/rig_pieces.dm
	code/modules/clothing/spacesuits/rig/suits/light.dm
	code/modules/clothing/spacesuits/spacesuits.dm
	code/modules/clothing/suits/armor.dm
	code/modules/clothing/suits/utility.dm
	code/modules/events/event_manager.dm
	code/modules/mob/living/living.dm
	code/setup.dm
2015-02-04 04:44:09 +06:00
GinjaNinja32
bc0f5762be Camera sorting improvements 2015-01-28 04:33:31 +00:00
Zulker Nayeen Nahiyan
203a7f1092 Fix compile error, remove Pi etc. from maths.dm and re-add them in setup.dm, fix bittest macros formatting to allow searching
`maths.dm`:
	Removed `var/const`s `E`, `Pi`, `Sqrt2`.

`setup.dm`:
	Re-added `PI` here, and added `Sqrt2`, `E` as macros.
	  The reason for this is that macros have a performance improvement over `var/const`s.

`lists.dm`
	Changed the formatting of the `BITTEST(...)` etc. macros so that they can be found by
	  searching for `#define BITTEST`

`rig.dm`:
	Fixed unknown variable error resulting from the usage if `STOPSPRESSUREDMAGE`
	  which was renamed to `STOPPRESSUREDAMAGE` in one of my earlier commits.

Others:
	Replaced constant variable `Pi` usage, with macro `PI`.
2015-01-10 03:14:48 +06:00
Zulker Nayeen Nahiyan
6e550d7308 Cleanup helper files maths.dm, time.dm, type2type.dm, add macros for bit-manipulation
`maths.dm`:
	Rewrite `Gcd(x)` to remove recursive behaviour.
	Remove `RaiseToPower(x)` and its usage from `event_manager.dm`.
	Rename `Lerp()` to `Interpolate()`.
	Add `Square(x)`, which squares a number.
	Rearrange most of the functions in the file. (trigonometric functions together, etc.)

`type2type.dm`:
	Rewrite `num2hex()` and optimise `hex2num()` for superior clarity and a 100% speed improvement.
	Correct indenting, spaces, make switches more concise.

`time.dm`:
	Remove old, slanderous commented-out function `/proc/time_stamp()`

`lists.dm`:
	Add the macros, `BITTEST(bitfield,index)`, `BITSET(...)`, `BITRESET(...)`
	  and `BITFLIP(...)` for bit-manipulation and use them where 20+ files
	  do it manually, for arguments of reader clarity and standardness.
2015-01-09 21:55:11 +06:00
GinjaNinja32
df29429e0e Add dd_insertObjectList proc, adjust obj/machinery/New to use this proc 2014-10-30 22:59:10 +00:00
GinjaNinja32
0aba56873c Changes dd_sortedObjectList() to use mergesort with cached sort values 2014-10-25 18:22:15 +01:00
PsiOmega
e21da52af9 Atmospherics computer now displays a sorted list of air alarms 2014-08-23 15:23:14 +02:00
GinjaNinja32
42d8344f7d Change crew monitoring computer to use NanoUI 2014-06-02 09:29:34 +01:00
Segrain
54d2a261f3 Helper for cycling through list. 2014-02-03 05:02:18 +03:00
Mloc-Argent
a1f55a50b1 Massive click code rework by SuperSayu, ported from TG.
Full details at https://github.com/tgstation/-tg-station/pull/1206
Fixes #3648

Hopefully done right this time.

Signed-off-by: Mloc-Argent <colmohici@gmail.com>
2013-10-08 20:27:39 +01:00
Cael_Aislinn
5533ef4946 setup digsite creation + propogation on mining asteroid, setup most excavation and tool interaction with mining turfs + digsites, setup tweaked list operation, modified dme
Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
2013-02-08 23:54:45 +10:00
Cael_Aislinn
0efb0311e3 removed misc file, added some extra sprites, added/tweaked list helpers
Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
2013-02-04 23:37:50 +10:00
giacomand@gmail.com
9e8ee77049 -Viruses will now not count towards the chance of infecting someone with virus protection.
-Added some extra virus protection to objects.
-This should all fix randomly being infected while wearing full virus protection gear.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5233 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-30 20:18:29 +00:00
giacomand@gmail.com
9250be52a7 -Got rid of a redundant del() in the PANDEMIC. Fixes Issue 1116.
-Added a new symptom. Voice Change will randomly change the voice of the affected mob. It isn't obtainable by Mutagen and I'll likely put it in the virus crate when I have more dangerous viruses.
-Added two new symptom procs. Start() will be called once and it'll be called when the advance disease processes. Allows you to setup stuff for your symptom. End() will be called before the disease is deleted.
-Diseases that spread by blood won't spread by contact anymore. You will need to directly inject someone to get them to catch the disease.
-Put a limit on shivering and fevers.
-Added a specialvoice variable. You can use SetSpecialVoice() to set a special voice that the player will say instead. To unset it, use UnsetSpecialVoice(). GetSpecialVoice() will return the player's special voice value.
-Added two DEFINEs for the limit which is how much a human can take before taking burn damage from heat or coldness. 
-Some symptom value changes.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5136 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-20 16:39:11 +00:00
giacomand@gmail.com
9894568500 -Cyborg Hypospray will no longer lose it's reagents when switching modes.
-Spaceacillin will now prevent the spread of diseases while it is a mob.
-Moved the "Create A Disease" code into a proc.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5101 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-17 22:28:48 +00:00
giacomand@gmail.com
7955d348d8 Lots of bugs fixed for advance diseases.
Fixed advance diseases using the same reference in mobs.
Fixed advance diseases referencing other advance diseases' symptoms, instead of just copying it.

I tested it more thoroughly this time and I can't find any issues but if you do please add them to the bug tracker and or contact me on #coderbus.

Added a new reaction which will remove symptoms from a disease. Needs blood and synaptizine.
Added a new symptom, shivering will make you cold.

Tweaked and balanced some symptoms.

Removed the "flex" emote that hulks will do randomly.
Reduced the change to speak for hulks and brain damaged mobs. ( 7% -> 3% chance)

Please let me know if anything is out of place or wrong.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5048 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-13 00:28:07 +00:00
johnsonmt88@gmail.com
4746f20f35 A couple of runtime fixes:
Runtime fix for Poly searching for items (runtime error: Cannot read null.w_class)

Runtime fix for safe lock-picking (runtime error: Cannot read null.len)

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5030 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-08 23:25:41 +00:00
giacomand@gmail.com
0162968399 -Lot of runtime fixes for advance diseases.
-Added two new symptoms, fever and itching.
-Changed some stats on existing symptoms.
-Emotes sucks so I used visible_message if there was no preset emote.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5021 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-07 08:21:36 +00:00
elly1989@rocketmail.com
7b720a20b6 >Moved most of the helper procs into code/__HELPERS. If you see ANYTHING generic enough to be a helper proc just throw it in there and help purge the copypasta 5ever
>Replaced dd_text2list, dd_text2listcase, tg_text2listcase and tg_text2list with text2list and text2listEx. text2list will return a list of each and every character in the string if you set separator=""
>added return_file_text(filepath) which returns text from a file after doing some checks: does the file exist? is the file empty? It prints helpful error messages to the world.log if it runs into problems
>Replaced dd_file2list(filepath, seperator) with file2list(filepath, seperator). It just calls text2list(return_file_text(filepath), seperator). rather than copypasta
>Replaced time_stamp() so it's not as retarded
>Lots of the world setup stuff uses file2list now, rather than file2text -> sanity -> text2list
>Added error() warning() testing() procs. These print messages to world.log with a prefix. e.g. ## ERROR: msg.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4948 316c924e-a436-60f5-8080-3fe189b3f50e
2012-10-24 14:39:36 +00:00