Skip to content

Commit

Permalink
Merge pull request tgstation#6626 from psykzz/patch-1
Browse files Browse the repository at this point in the history
File restructure
  • Loading branch information
tkdrg committed Jan 6, 2015
2 parents d7a4da8 + 15f01d3 commit c551bbf
Showing 1 changed file with 36 additions and 38 deletions.
74 changes: 36 additions & 38 deletions code/_onclick/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,56 +104,28 @@
The following criminally helpful code is just the previous code cleaned up;
I have no idea why it was in atoms.dm instead of respective files.
*/
/atom/proc/AICtrlShiftClick()
return
/* Questions: Instead of an Emag check on every function, can we not add to airlocks onclick if emag return? */

/obj/machinery/door/airlock/AICtrlShiftClick() // Sets/Unsets Emergency Access Override
if(emagged)
return
if(!emergency)
Topic("aiEnable=11", list("aiEnable"="11"), 1) // 1 meaning no window (consistency!)
else
Topic("aiDisable=11", list("aiDisable"="11"), 1)
/* Atom Procs */
/atom/proc/AICtrlClick()
return

/atom/proc/AIShiftClick()
/atom/proc/AIAltClick(var/mob/living/silicon/ai/user)
AltClick(user)
return

/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(emagged)
return
if(density)
Topic("aiEnable=7", list("aiEnable"="7"), 1) // 1 meaning no window (consistency!)
else
Topic("aiDisable=7", list("aiDisable"="7"), 1)
/atom/proc/AIShiftClick()
return


/atom/proc/AICtrlClick()
/atom/proc/AICtrlShiftClick()
return


/* Airlocks */
/obj/machinery/door/airlock/AICtrlClick() // Bolts doors
if(emagged)
return
if(locked)
Topic("aiEnable=4", list("aiEnable"="4"), 1)// 1 meaning no window (consistency!)
else
Topic("aiDisable=4", list("aiDisable"="4"), 1)

/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
toggle_breaker()
add_fingerprint(usr)

/obj/machinery/turretid/AICtrlClick() //turns off/on Turrets
if(can_be_used_by(usr))
toggle_on()
add_fingerprint(usr)


/atom/proc/AIAltClick(var/mob/living/silicon/ai/user)
AltClick(user)
return

/obj/machinery/door/airlock/AIAltClick() // Eletrifies doors.
if(emagged)
return
Expand All @@ -164,15 +136,41 @@
// disable/6 is not in Topic; disable/5 disables both temporary and permenant shock
Topic("aiDisable=5", list("aiDisable"="5"), 1)
return
/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(emagged)
return
if(density)
Topic("aiEnable=7", list("aiEnable"="7"), 1) // 1 meaning no window (consistency!)
else
Topic("aiDisable=7", list("aiDisable"="7"), 1)
return
/obj/machinery/door/airlock/AICtrlShiftClick() // Sets/Unsets Emergency Access Override
if(emagged)
return
if(!emergency)
Topic("aiEnable=11", list("aiEnable"="11"), 1) // 1 meaning no window (consistency!)
else
Topic("aiDisable=11", list("aiDisable"="11"), 1)
return

/* APC */
/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
toggle_breaker()
add_fingerprint(usr)

/* AI Turrets */
/obj/machinery/turretid/AIAltClick() //toggles lethal on turrets
if(can_be_used_by(usr))
toggle_lethal()
add_fingerprint(usr)
/obj/machinery/turretid/AICtrlClick() //turns off/on Turrets
if(can_be_used_by(usr))
toggle_on()
add_fingerprint(usr)

//
// Override TurfAdjacent for AltClicking
//

/mob/living/silicon/ai/TurfAdjacent(var/turf/T)
return (cameranet && cameranet.checkTurfVis(T))
return (cameranet && cameranet.checkTurfVis(T))

0 comments on commit c551bbf

Please sign in to comment.