auto_use_power only shows up in the master_controller
following code:
***************
for(var/obj/machinery/machine in machines)
if(machine)
machine.process()
if(machine && machine.use_power)
machine.auto_use_power()
***************
on the second line it checks if machine exists. If it doesn't exit it would go to the next machine.
So it is not null at this point.
then it calls machine.process()...
on the fourth line it cehcks again if the machine exists.
Then it calls machine.auto_use_power()
So at this point the machine has been checked twice for existence.
Now moving into aut_use_power() proc
*********************
/obj/machinery/proc/auto_use_power()
if(!powered(power_channel))
return 0
if(src.use_power == 1)
use_power(idle_power_usage,power_channel)
else if(src.use_power >= 2)
use_power(active_power_usage,power_channel)
return 1
*********************
This calls powered() on the second line.
now stepping into powered() proc
**************************
/obj/machinery/proc/powered(var/chan = EQUIP)
var/area/A = src.loc.loc // make sure it's in an area
if(!A || !isarea(A))
return 0 // if not, then not powered
return A.master.powered(chan) // return power status of the area
**************************
the second line "var/area/A = src.loc.loc" line 26 in power.dm is what caused the problem.
It is asking for the location.
src.loc appears to be null. The reason why this call keeps happening and doesn't stop is because the object itself exists but its location does not.
So my final analysis is that src.loc == null and calling loc on src.loc gives us a runtime error since src.loc.loc == null.loc and null cannot call loc.
runtime error: Cannot read null.loc
proc name: powered (/obj/machinery/proc/powered)
source file: power.dm,26
usr: null
src: Emitter (/obj/machinery/emitter)
call stack:
Emitter (/obj/machinery/emitter): powered(1)
Emitter (/obj/machinery/emitter): auto use power()
/datum/controller/game_control... (/datum/controller/game_controller): process()
/datum/controller/game_control... (/datum/controller/game_controller): process()
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1932 316c924e-a436-60f5-8080-3fe189b3f50e
Admin changes:
Admin attack logs now have a timestamps. Basically, before each log entry there is something that displays [hour:minute:second]. I plan on expanding this functionality to all kinds of logs, as well as creating a global attack log, but this will do for now.
Gloves:
You can still electrify any gloves with a power cell, however you have to use wires on non-insulated (yellow) gloves to create a "ghetto-insulation" system. I might make these gloves' stun effects more watered-down than normal insulated gloves, but that will probably be for later on.
Bugfixes:
Fixed some miscellaneous runtime errors, and more importantly, the shotgun. You can dry-pump it by clicking on it, which will eject any used shots or just make that badass "chuck-chick" sound to let everyone know you mean business. Combat shotguns can now shoot twice without the need to pump.
I also possibly fixed the issue with metroids' AI process locking up. Someone's going to have to PM me on the forums to tell me if this worked or not, because I have not been able to reproduce the bug (although I do know where it's happening in the code).
Chemistry:
Alright, so this is where the meat of this update is. In a previous revision (r1905) I mentioned the addition of a new "color" variable. This variable now has a use. When you use a spray cleaner, or a chem sprayer which now is significantly more powerful, the color combination of all the reagents inside the sprayer will be displayed instead of the plain old blue-white color. This will allow for people to easily distinguish reagents and colors, for instance, if you see some chemist running around spraying orange or purple stuff chances are that's acid he's spraying, so you should probably subdue him!
In addition, you will now be able to see beakers (large ones too) fill up visually. The color of the reagents inside the beaker is overlayed on top of the beaker. The colors may be subject to change to make them brighter or more easily identifiable by "category". Currently, most pharmaceuticals have a light pinkish color. Polytrinic acid has a distinct purple color, etc. However, with due time I can picture chemists mixing other, benign-ish reagents with harmful reagents so passerbys think that a chemist is spraying someone with something harmless, but in reality is spraying them with a bunch of PAcid. There are some consequences, for instance, concentrated acid is more powerful than watered-down acid.
Have fun with that.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1922 316c924e-a436-60f5-8080-3fe189b3f50e
This method takes an input of a powernet and merges it with the powernet that called merge_powernets
This is the first step in my updated cable logic. The code should look cleaner as a result.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1913 316c924e-a436-60f5-8080-3fe189b3f50e
- Solars now bring out a fixed value. 700W each, meaning 60 of them (one array) generates 42000W. Not enough to power the station? That's the point. Although 4 x 42000W = 168000. This might be nerfed soon.
- Sun removed. Seriously, that thing ate up processor time and was completely useless.
- Solar tracker remains on the map but is completely useless. Will remove.
- Also reverted the cable updates from r1729. The code from prior to that revision might be as laggy as it was, but it works properly. After the revision powernets didn't calculate available power properly and did not update properly when new pieces were made (They stopped updating at the first wire piece which ended in a knot (non-smooth cable piece))
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1897 316c924e-a436-60f5-8080-3fe189b3f50e
Guns:
The projectile code has been mostly reworked to provide better support for effects, dynamic damage, etc. This also makes adding new projectiles easier for other coders. This is a pretty big change! If you see any bugs, get on IRC and bug me about it before the change goes live on the server!
Miscellaneous:
I fixed some bugs with Metroids hopefully. Turrets now don't identify people laying down as a threat.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1884 316c924e-a436-60f5-8080-3fe189b3f50e
- added roller bed (for medics). Place human, buckle him to this bed, the bed raises and can be pulled.
- eggs and tomatoes can be smashed of wall, floor [s]or captain's face[/s] not yes.
Code by Balagi, sprites by Farart.
-some fixes for the crew monitoring computer. It can be disassembled now.
-added crew monitoring circuit board. Requires programming 3, biotech 2, magnets 2.
-Mech Bay Power Control Console и Solar Control can be disassembled now.
-added crew Mech Bay Power Control Console circuit. Requirements are programming=2, powerstorage=3.
-Solar Control circuit boardcan be researched. Requirements are programming=2, powerstorage=2.
-R&D Console can be researched and created (requires programming 6). But R&D Console cannot be deconstructed for tech points. That's intended.
Code by Jack Rost.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1880 316c924e-a436-60f5-8080-3fe189b3f50e
Three new weapons added to R&D(the protolathe). The Chem Sprayer, the Shock Gun and the Stun Revolver.
A new costume is added to the theatre, the female clown suit and mask.
Thanks for the weapon sprites goes to Khodoque.
Thanks for the female clown suit sprite goes to Cheridan.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1855 316c924e-a436-60f5-8080-3fe189b3f50e
Fixed some typos.
Categorized some noncategorical verbs.
Badmins and trial admins now can use "select equipment" verb.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1770 316c924e-a436-60f5-8080-3fe189b3f50e
Red jumpsuit and security jumpsuit are separate now. Red jumpsuit does not provide additional protection anymore, security jumpsuit does. The green thunderdome team approves this change.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1733 316c924e-a436-60f5-8080-3fe189b3f50e
Currently removed all instances of makepowernets() and update_network() (Update network just called makepowernets()) from cable.dm.
All actings regarding cables went from 0.5 to <0.08 per call.
-Added a verb in the debug panel called Make Powernets. This calls makepowernets().
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1729 316c924e-a436-60f5-8080-3fe189b3f50e
-Right click commands "Make robot/alien/ai/monkey" moved to "edit player" screen.
-Right click commands "Make traitor/cultist/changeling/etc" moved to "edit mind" screen.
-- note: currently the only way to humanize monkey is to use "edit mind" screen.
-Added right click commands showing "edit player" and "edit memory" screens.
In light of an incoming tournament on ss13.ru I have added "Select equipment" right click command. It allows to instantly dress mob as you wish. Coders, feel free to add more dress packs, like "centcom inspector", "space pirate" and so on.
A strange command "list_occ" now called "List free slots" and shows unoccupied jobs.
Added golden cup, sprite belongs to Farart.
You can now take a power cell from charger even if there is no power.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1724 316c924e-a436-60f5-8080-3fe189b3f50e
- fixed issue 88: monkeys now can play with APC.
- Silicon liveforms cannot use malfhacked APCs if they arent an AT who hacked APC or his slaved borgs.
Fixed issue 121.
Latejoiners got their backpacks back.
Fixed attack log.
Fixed ammo icons not showing in dreammaker map editor.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1720 316c924e-a436-60f5-8080-3fe189b3f50e
Tweaked singularity beacon's layer, so it's even more obvious.
Tweaked singularity beacon's price. For 8, it was literally useless.
I don't know why people complain you can release singulo with it, because the code only affects the singulo's move() proc, changing move_direction from pick(cardinals) to get_dir(src,target). That's literally the only thing it affects, and I don't see how it can release singulo.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1717 316c924e-a436-60f5-8080-3fe189b3f50e
Object spells - fixed two minor bugs. Added the possibility of making a critical failure effect for the spells.
Singularity beacon - added to traitor spawn list. Must be screwdrivered to the floor before you can activate it.
Singularity - optimised the code a bit.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1709 316c924e-a436-60f5-8080-3fe189b3f50e
- after losing and restoring power air alarms had wrong icon.
- same for air vents.
- Latejoiners now get filled DNA entry in medical computer.
- Fixed rare bug with APC.
- Electrocuting while laying wires was made more consistent. Do not forget your gloves.
Borgs now can restock wires, glass and metal in recharging station.
Added logging of bagbombing.
Internal buffer in ChemMaster have volume 100 units.
Metalcrafting window improved.
Added Soviet soda vending machine to the derelict.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1705 316c924e-a436-60f5-8080-3fe189b3f50e
I have done lots of work to make selecting players for special roles be fair.
- New options preferences: "be traitor", "be changeling" and so on for all special roles.
- Now you can have job of AI/cyborg in preferences and do not lower your chances to become wizard/changeling/etc. And vice-versa: you do not have to select AI in your preferences to have non zero chance to play malf.
- Jobban from syndicate bans player from any special role (including malf AI, cult, etc).
- Fixed bug with changeling round not ending sometimes.
- All special roles were tuned to work better as admin-driven event.
-- All adminmade special characters will be listed at the end of round of any type.
-- All adminmade special characters are fully functional with following exceptions:
--- The ending conditions are determined at round start, i.e. you cannot end revolution by killing wizards and malf AIs (however, with nuke you can end anything).
--- The cultists cannot get their special objectives.
--- The malf AI can hack the APCs but without any profit.
--- The syndicate operatives must obtain the nuke/working code from admins.
--- As before, nuclear explosion ends round. Even if nuke was used in wrong place.
- Fixed thingy like "Not enough players for revolution game mode. Restarting world in 5 seconds."
- Changeling wont get objective "absorb X genomes" when there are less that X players in game.
- proc/equip_if_possible now has return value, procs like equip_revolutionary (giving a flash) should be more reliable.
- There are no fake wizards anymore. The research staff have to kill ALL wizards on order to win, even adminspawned ones. ("give spell" verb works as before, not making a spellcaster to actually be wizard).
- The semi-new game mode: traitor+changeling. Just like regular traitor mode plus one changeling. Round ends when the shuttle reaches centcom. Option for config.txt: "PROBABILITY TRAITORCHAN".
- Successful malf AI now have 60 seconds to choose to explode the station or not (some players still have to rejoin game to have their new verbs shown in Malfunction tab).
- Monkeys mode fixed, monkeys wouldn't randomly cure anymore.
For admins:
- New powerful mind editor oriented to mixed rounds.
-- Setting someone as special character (like wizard) does not equip him/her automatically. You have to do it it next step. Note, that in case of wizards and nuke operatives their old dress will be deleted! If you do not want it you shall use "undress" link.
-- Only operatives, head revs and cultists have their objectives set immediately.
-- You can unemad borgs!
-- You cannot unemag borgs because calling mind editor for nonhumans is blocked atm.
-- many other useful features.
-- you can fix burned out flashes from mind editor.
-- first assign the new malf AI/wizard then demalf/dewizard old one or round will immediately end.
- if delete the nuke bomb during its downcounting round will stuck. Using "edit ticker variables" set ticker.mode.explosion_in_progress = 0.
For coders:
- /datum/game_mode/malfunction/AI_Module renamed to /datum/AI_Module. Reason: What. The. Fuck.
Unrelated fixes:
- Blueprints can create areas up to 300 tiles (was 100).
- Cyborgs wont leave backpacks at spawn point anymore.
- Fixed bug in preferences causing preferences files to be huge.
- Diseases can infect again.
- The option "SQL_ENABLED 0" now works in config.txt.
- fixed critical bug on assassinate objective.
Bugs:
- We have a bug with job distribution for people who haven't any available jobs in their preferences. Players tends to group by jobs.
- For example, if we have 3 players they with hight chances will got same jobs. And probability of having one engineer and one medic _exactly_ equals _zero_.
- I am not sure if my changes made that bug worse. Anyway I MUST do this commit. Bug will be fixed eventually. Maybe.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1703 316c924e-a436-60f5-8080-3fe189b3f50e
Profile results (total time)
Proc Name Self CPU Total CPU Real Time Calls
----------------------------------------------------------------------------- --------- --------- --------- ---------
Before Revision
/proc/powernet_nextlink 0.068 14.892 14.895 2936
/proc/powernet_nextlink 0.000 0.005 0.005 2936
Before Revision
/proc/powernet_nextlink 0.077 18.886 18.887 3162
/proc/powernet_nextlink 0.000 0.006 0.006 3162
After Revision
/proc/powernet_nextlink 0.046 15.185 15.186 3022
/proc/powernet_nextlink 0.000 0.005 0.005 3022
This decreases the overhead on larger powernet_nextlink() calls and also decreases the cpu usage for the client by ~30%
For larger powernet_nextlink() calls the cpu usage serverside is decreased by a factor of ~30% also.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1691 316c924e-a436-60f5-8080-3fe189b3f50e
- Gun code condensed to make future modifications easier. Functionality should (mostly) remain the same.
- Taser guns shoot ONE WHOLE SHOT more then they do now. Yippy!
- Energy Crossbow has a slightly higher shot capacity (still automatically recharges).
- Guns that shoot projectiles (such as revolvers) now eject the ammo casings when they fire (this will be adjusted somewhat in phase 2).
- Revolvers can either be loaded one shell at a time or all at once with an ammo box.
- All guns now have a badmin var. Have fun (think shotguns).
- A few admin-only guns have been removed (for now). They'll get re-added in a future update.
- Shotguns no longer need to be pumped before firing (will change back in phase 2).
- All gunshots fired by players are now logged in both the firer's and the target's attack_log. So if someone gets shot and it doesn't show up, it's because a turret or something shot them.
Hopefully I didn't miss anything.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1659 316c924e-a436-60f5-8080-3fe189b3f50e
#Ninja suit now supports pAIs. Further functionality will probably come from their development.
#Ninja suit can now replenish chemicals from beakers. Simply use a beaker on the suit and it will do the rest, if the beaker contains the right combination of chemicals.
#Draining from a wire is now done through clicking instead of a verb. There is no more delay to it.
#Ninja stars cost a bit more energy than before.
#Ninja suit will start initializing automatically (and quickly) when ninja spawned.
#Minor sprite fix for female ninja suit.
#Note: AI-related verbs for the ninja suit will be bugged until BYOND 484 comes out. Not a huge deal but worth noting.
#The has_reagent() proc will now return the reagent being checked for, instead of 1. Will return 0 if reagent is not found (or the amount does not match). Removed a duplicate arithrazine entry.
#AIs should now properly camera_cancel() when carded/physically transfered.
#Fixed a small menu display bug for AI cards. AI cards should now properly auto close their window when appropriate.
#AI holograms should now project above everything.
#Mal AIs can now choose to display an alternative (and awesome) sprite.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1655 316c924e-a436-60f5-8080-3fe189b3f50e
Unsimulated turfs now hide wire nad pipes and such things under them,
- Moved all floors to code/game/turf.dm so they're all in one place (Other than asteroids I guess, those are still in mining.dm)
. Shuttle walls now look at unsimulated floors too when determining the underlay for diagonal wall pieces.
- Some areas around the station that were with air but were intended to be airless are now airless.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1628 316c924e-a436-60f5-8080-3fe189b3f50e
Instead of being a var-edited singularity (which ends up following the normal singularity rules), narsie is now a child object of the singularity, with modified code to prevent it from doing things like changing size or getting exploded by R&D throwing a bluespace backpack into it.
Unless someone beats me to it, I'll probably make it follow cultists/ghosts instead of randomwalking at some point.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1621 316c924e-a436-60f5-8080-3fe189b3f50e
Fixed a small mapping mistake. Also, the locker is still chef-access only. Whoops.
Singularity
Singularities now can "target" something, which makes them aim towards it instead of wandering around.
Added an adminspawnable singularity beacon which automatically targets all singularities on itself.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1612 316c924e-a436-60f5-8080-3fe189b3f50e
#Added a locked list to datacore in order to track character spawn, particularly for respawn_character(). May be useful in the future.
#Added a proc to randomize appearance for any human mob, randomize_appearance_for(mob). It will not take into account gender as you will have to provide it. Names and so on are also randomized but that can be overwritten in the code following.
#Added AI holopads around the station. To use as the AI: click on the pad to center view on it. Click again to activate the hologram. Move it with the directional keys. You can still interact with objects normally. To remove it, either move it too far out or click the pad again. Use robot talk to directly speak through the holopad (and only the holopad, unlike regular robot speak). Could be added on to (like different images for different AIs) but it's basically finished.
#Fixed a bugged message on changeling transformation sting. It will no longer give away your identity.
#Made law datum a silicon define. var/datum/ai_laws/laws.
#A few more ninja adjustments. Added a new view mode for the ninja mask, allowing to see special roles and a few other things.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1608 316c924e-a436-60f5-8080-3fe189b3f50e
Also yes, yes, if you are really bothered by the fact that picking up a green wire piece with a blue coil will result in all of them being blue then that's fine, but I really think it's more than good enough for a game. It will also allow people who want to use a particular color the abbility to get enough wire pieces of it without unneeded problems.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1593 316c924e-a436-60f5-8080-3fe189b3f50e
This should make wiring tight places slightly easier as well as more possibilities for wire art. Enjoy. Can't wait to see your whacky library wire-runes.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1592 316c924e-a436-60f5-8080-3fe189b3f50e
#A few specific religions will now spawn unique books (they all use the Bible sprite). Feel free to expand on this.
#AIs and cyborgs will now get the code phrases if they are a traitor. Rev heads will no-longer get them. Finally, rev heads will properly equip their items if admin-made.
#Added field generator code improvements by Aygar.
#Added a general turf proc to kill mobs/creatures in a tile, kill_creatures(). Might be useful in the future if more creatures are added.
#Added a general teleport proc, get_teleport_loc(). Supports only 4 directions of movement.
#More code improvements to ninjas. Admins will now only spawn player ghosts as ninjas. No more admin ninjas.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1577 316c924e-a436-60f5-8080-3fe189b3f50e
Fixed PDA flashlight.
To clarify, you can still use the PDA when you are stunned/weakened. This was always the case, apparently. You cannot use the PDA when knocked out or dead.
You can now stick an ID card into a PDA without clicking 400 times (click on PDA with card in hand).
Changed how the ninja suit functions in relation to energy. It will now hold a power cell as APCs/Borgs/etc.
Ninjas can now replace their starting power cell (reduced to high capacity/10000) with larger capacities. Drain the cell as normal to do it. On that note, hyper-capacity (30k) cells added to research.
Can now drain energy from a recharger. Much like draining from wire.
Added cooldown to certain ninja abilities. It is a global cooldown; meaning, most abilities will be unusable until it finishes. Usually a second.
Some icon changes for ninjas.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1540 316c924e-a436-60f5-8080-3fe189b3f50e
Reworked energy charging to where it's probably bug free and much easier to edit.
Reworked PDA code so it's much faster and easier to use. Might have some bugs left over.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1532 316c924e-a436-60f5-8080-3fe189b3f50e