`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.
For now made all words into one list, instead of separate vars for each.
Brought back awesome Urist runes. Down with crayon doodles!
Need to look into making rune NOT check what rune it is EVERY TIME it is activated... making subclasses or some shit like that.
The more I stare in that code the louder screams in my head, maybe that's intended?
There are many files, folders and chunks of code in areas that make absolutely no sense and thanks to the defines being located mostly in a completely separate file, it can be damn-near impossible to find something. Before moving defines to where the rest of their code is located; I'm going to move some code around into places that actually make sense to begin with. I'll mainly be focusing on the code/game/objects folder.
This commit mainly lays the groundwork for the work I'll be doing by adding in the effects, structures, decals and turfs folders. I'll slowly be moving appropriate files and code into these folders. I may end up moving machinery into 'objects' and mech stuff into its own module folder but I'll ask for some opinions on coderbus before doing that.
I've also gotten rid of the /magic/ folder. I've moved the library stuff into its own folder in modules/library, the cult stuff is now in gamemode/cult with the rest of it and musician.dm is now in objects/structures since the piano is a structure apparently.
I think I've got the hang of how DM and SVN handles folders and files but it's quite possible that something will break simply by svn committing it oddly. Please let me know if that's the case!
Remember to clean compile.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4513 316c924e-a436-60f5-8080-3fe189b3f50e
All credits to the author for this handy little script.
I Committed the modified python script to tool directory. Although it needs to be in the root folder of your repo to work.
To notice the improved compile times, in dreammaker go to Build > Preferences > and untick "automatically set file_dir for subfolders"
If this commit inteferes with any large projects just revert it, do your thing, then rerun the script. Easy-peasy.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4488 316c924e-a436-60f5-8080-3fe189b3f50e
Code-wide changes: /mob -level procs:
equip_if_possible() is now known as equip_to_slot_or_del() to prevent confusion with equip_to_slot_if_possible() and to better describe what it does.
equip_to_slot_if_possible(item, slot, del_on_fail, disable_warning, redraw_mob)
equip_to_appropriate_slot() is now a /mob - level proc.
equip_to_slot() is an unsafe proc, which just handles the final step of actually getting an item onto the mob. It has no checks of whether it can or can't do that. Use equip_to_slot_if_possible() for that purpose.
New /obj/item -level proc:
/obj/item/proc/mob_can_equip(M as mob, slot, disable_warning = 0)
This proc can be used to determine whehter a mob can pick up an item from the item's side.
Carn, I'll need you to review code/modules/mob/living/carbon/human/inventory.dm to ensure that I'm not redrawing the mob too many times.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4423 316c924e-a436-60f5-8080-3fe189b3f50e
-Made a variation of hasvar(), creatively named has_var(), intended for objects versus datums, and the var name is case sensitive
-Clean up mech fabricator code considerably, the terrible switches are all gone, and I was able to make it more robust at the same time. Now, if a junk item is added to the mech fab then it will remove it in 1 of 2 places, either when you call for the queue to be displayed (Will throw it out then rebuild the queue) or when it is processing the queue (Will throw it out then reprocess the building), so now you won't even see the shit that finds its way in there.
-Made the add_part_to_set() useful, now instead of dumping everything in the "Exosuit Equipment" category, it checks if the design's category matches one of the part sets, then adds it to said set if it does (All others get dumped into "Misc"). Right now there isn't much through, mostly just moving MMIs, cells, etc... to the "Misc" set, but this would be easy to use with any other system that handles designs
-Little bit of OCD here, but I noticed that the cells on the map were all 'crap' cells, even though they had 1.5x the charge of a high-capacity cell, so I changed them all to high-capacity cells with the added capacity
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4395 316c924e-a436-60f5-8080-3fe189b3f50e
-Gave brains a proper gib() so they are actually gone
-Added a proc to the 'Secrets' panel, a variation of power the station that instead is MUCH faster and just powers all SMES, turns on output, and sets it to max (helpful for testing and it doesn't leave the server frozen for 60 seconds to process)
-Added maxHealth to mice, killer tomatos, and walking mushrooms (They started with 5 health but could be 'healed' up to 20)
-Made the updatehealth() actually usable outside of humans by making it use maxHealth instead of just '100'
-Fix for shield generator sprites not updating properly, caused by not all generators actually updating on powerloss, and adding an update_icon() where needed
Fixes Issue 751
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4393 316c924e-a436-60f5-8080-3fe189b3f50e
Fixes Issue 229
-Removed the shitty almost-throwing after_attack() for grenades and replaced it with something sane. Now (Like before) when you activate a grenade, it turns throw mode on.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4375 316c924e-a436-60f5-8080-3fe189b3f50e
- Syringe overlay layer is no longer above the blackout screen layer
Fixed issue 704
- Shades (and all simple animals) can no longer pick up paper bins/donut boxes with clickdragging (were there any other objects you could pick up with onmousedrop?)
Fixed issue 737
- Dead/unconscious cultists no longer count towards cultist count on rune use (such as sacrifice, nar-sie, etc)
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4360 316c924e-a436-60f5-8080-3fe189b3f50e
Minds part2 - Carn loses her mind.
The way datum/mind stuff works has been changed a lot. I really can't explain everything. If you have any questions it'd just be easier if you leave a comment or ask me in coderbus.
Generally, minds now represent IC characters rather than following a client around constantly. Minds can change owners, mobs, (names WIP).
Technical babble:
The var/current and var/original variables of the mind datum must always be of type mob/living (or null). Please do not mind.transfer_to(ghost_mob). If you want to ghost somebody use ghostize()! It will do all the technical stuff for you.
mob/dead/observer/var/corpse was removed. mob/dead/observer/var/mind is now used as a reference to the last mind the player had (so respawning code has something to reference), but also because mind.current is a far more useful way of tracking a corpse. If somebody triggers a mind.transfer_to() call on your corpse, your mind will be tranfered to another mob/living or something...that will then be considered your corpse. This could allow for more interesting mind_transfers. For instance, the "raise corpse" rune ghostizes any player in the corpse to be raised and selectes a random dead player to take possesion of their character! The person possesing them will have all of their memories, objectives, etc. The poor guy who was originally the owner cannot re-enter body if there is another player in his body...but if that player is ghosted he can once again return. Exorcisms anybody?
Changes to cloning and hydroponics. I will likely have to rework these later as they're hacky as hell right now.
A lot of stuff is now handled by Login/Logout rather than in hundreds of different places. One such example, mind datums get their variables updated at Login and Logout.
Fixed a few minor bugs. I'll update the issues manually in a bit because I literally cannot think atm.
TL;DR guide:
-If you want to make somebody a ghost use ghostize(). Or you will need to find a doctor to stitch your bits back on. :)
-You don't have to worry about making minds. Simply doing key="carnwennan" or whatever will either: A) make a new mind and initialise it if there isn't one or B) take possession of the mind currently attached to the mob.
-It's safe to transfer a mind even if a key isn't in-body (e.g. they are ghosted/admin-observing etc!) Minds have an active variable which tracks whether they are currently synced with a key. This is to avoid dragging ghosts back into their bodies when say, a wizard mind_transfers them.
-Transferring a mind whilst var/active=1 will cause the following: mob.key = mind.key. So no need to do that separately (in fact you'll lag things if you do, so don't)
-If you do want to initialize a mind manually, say if you don't have a client to login to the mob yet, simply do new_mob.mind_initialize(). Simple! When someody is logged into that mob they will take ownership of the mind and it will sync up.
NOTE: a lot is probably broken since this is a pretty massive change. Please let me know asap (with actual info! Shouting at me, "IT BORKED HALP", doesn't help)
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4342 316c924e-a436-60f5-8080-3fe189b3f50e
This part focuses on:
-structuring the way silicon mobs initialise upon login (there was some hideous copypasta in Login() and New() which used spawn() to change the order of the calls so it was all jumbled up. I think I've got it sorted now.
-Borgs var/real_name was not initialising as "Cyborg". Meaning the name checks were kind of borked.
-Ghosts are now deleted at logout if they no longer have a key. This will stop unneeded ghosts being left lying around. It will not delete ghosts with keys assigned (so people can't respawn or anything). Removed all the del(ghost_ref) stuff I could find. Generally movign the key from a ghost should be the last thing you do as the ghost will be deleted by Logout. However I've put it in a spawn() to hopefully avoid coders accisentally using it in a way which causes runtimes.
-Fixed clone-plants spawning dud potato-people left, right and centre. They'll now dump seeds if it fails for whatever reason.
-Cultist and Rev status are removed at mob/living/silicon/Login() rather than having to be called on a special-case basis everywhere. This may not be necessary when this stuff is finished.
-Removed a bunch of :
-Commented mob/living/Login() with the rest of the antag-indicator code from cloning.dm and hydroponics.dm for any coders whom feel brave/suicidal to fix the related issues
Next on the agenda, replacing mob/var/original_name with datum/mind/var/name to fix the ticker runtimes
Then, fixing mind/proc/transfer_to(mob) once and for all. (There are issues with duplicate minds, role updates, inconsistent initialisation etc etc *yawn*
There's probably a few obscure bugs in there somewhere. Might want to hold off on the updates for a bit. Coderbus will likely spot them all by the end of the week.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4322 316c924e-a436-60f5-8080-3fe189b3f50e
-Resolved Issue 720. Message should now properly tell you who got cult armor
-Resolved Issue 642. Bad indentation caused girders to disappear if you move away while building them.
-Commented out admin messages when monkeys used non-monkey SEs
-Atmos techs given Construction Area access
-Remapped the south end of Med-Sci
--Misc. Research Lab added to science
--Virology moved to be made more isolated
-Updated Changelog
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4312 316c924e-a436-60f5-8080-3fe189b3f50e
-Small change that psuedo-randomizes cult and wizard incantations. For cultists, it's just a [pick("'","`")] in place of a "'" in their incantation, and wizard invocations have a 50% chance to replace the spaces with "`".
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4307 316c924e-a436-60f5-8080-3fe189b3f50e
- Hopefully addressed the concerns about the ultra-darkness. Night vision, mesons, thermals and material scanners now make you see through darkness. (Lighting code does not affect you)
- Ghosts get a "toggle darkness" verb, which changes their see_invisibility. When the toggle is enabled, ghosts cannot see other ghosts. This is due to invisibility.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4235 316c924e-a436-60f5-8080-3fe189b3f50e
Instead of 'x has been attacked with y by z' it now reads 'x has been 'y.attack_verb-ed' with y by z'!
Example:
Monkeyman has been bashed in the head with a riot shield by Nodrak!
or
Monkeyman has been stabbed in the chest with an energy sword by Nodrak!
- Every obj now has a list named "attack_verbs"
- When declaring an object, just use attack_verb = list("verb1", "verb2") and so on to initialize the list for that specific item.
- I've added a bunch of these to a ton of items already, feel free to modify or add more. Just try to stay away from gimmicky verbs (clown stuff being the exception.)
clothing.dm and spawner.dm only had a single definition in each of them, so their definitins have been moved to obj.dm and their original dm files deleted. I'm not sure about spawner but clothing had all of its other definitions removed recently.
radio.dm was a completely blank file, so it was removed.
Changelog updated
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4182 316c924e-a436-60f5-8080-3fe189b3f50e
-Almost every instance of 'for(mob in world)' has been killed. Because GODDAMN was it being run a bunch. Instead, a series of global lists have been made, and they are all handled auto-magically through New()'s, Del()'s, Login()'s, death()'s, etc...
Lists are as follows:
-mob_list : Contains all atom/mobs by ref
-player_list : Like mob_list, but only contains mobs with clients attached
-admin_list : Like player_list, but holds all mobs with clients attached and admin status
-living_mob_list : Contains all mobs that ARE alive, regardless of client status
-dead_mob_list : Contains all mobs that are dead, which comes down to corpses and ghosts
-cable_list : A list containing every obj/structure/cable in existence
Note: There is an object (/obj/item/debuglist) that you can use to check the contents of each of the lists except for cables (Since getting a message saying "a cable," x9001 isn't very helpful)
These lists have been tested as much as I could on my own, and have been mostly implemented. There are still places where they could be used, but for now it's important that the core is working. If this all checks out I would really like to implement it into the MC as well, simply so it doesn't check call Life() on every mob by checking for all the ones in world every damn tick.
Just testing locally I was able to notice improvements with certain aspects, like admin verbs being MUCH more responsive (They checked for every mob in the world every time they were clicked), many sources of needless lag were cut out (Like Adminwho and Who checking every single mob when clicked), and due to the cable_list powernet rebuilding is MUCH more efficient, because instead of checking for every cable in the world every time a powernet was broken (read: A cable was deleted), it runs though the pre-made list, and even with a singulo tearing all the way across the station, the powernet load was VERY small compared to pretty much everything else.
If you want to know how any of this works, check global_lists.dm, there I have it rigorously commented, and it should provide an understanding of what's going on.
Mob related in worlds before this commit: 1262
After: 4
I'm helping
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4179 316c924e-a436-60f5-8080-3fe189b3f50e
- This is a very hackish way to do it.. I don't like it, but it'll work for now. apc's could do with some recoding.
Someone seemed to mix up some indentations in cult rune examines. Fixes Issue 680.
- Cultists examining a rune will be able to read the words.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4167 316c924e-a436-60f5-8080-3fe189b3f50e
-Redid icons to be more optimized at compile by setting icon = 'icons/folder/icon.dmi' instead of just icon = 'icon.dmi', meaning that Dream Maker doesn't have to search through every single file for every single .dmi. This shouldn't lead to any errors because of how I went about it, plus the fact that Dream Maker would have freaked out if I screwed something up. Also moved around 2 icons that weren't sorted well.
r4146 compile time: 1 minute, 40 seconds
r4147 compile time: 45 seconds
[VGTG]
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4147 316c924e-a436-60f5-8080-3fe189b3f50e
-Increased the amount of lights you get from adding glass to the Light Replacer.
-Emagging the light replacer is one way.
-You can add lights to the light replacer to add uses.
-You can unload the trash bag by clicking on it.
-Vodka now heals toxin damage.
-Made light tubes the same price as light bulbs.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4114 316c924e-a436-60f5-8080-3fe189b3f50e
simplified armour rune code a little bit.
Added IP and ID fields to the unban panel. because I told somebody that I'd add it for them aaaages ago but forgot.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4003 316c924e-a436-60f5-8080-3fe189b3f50e