mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
AI Jump Buttons for Snaxi (#25565)
* AI Jump Buttons for Snaxi * Some fixes
This commit is contained in:
@@ -4,15 +4,9 @@
|
||||
adding = list()
|
||||
other = list()
|
||||
|
||||
var/obj/abstract/screen/using
|
||||
adding = map.give_AI_jumps(adding) //gives AI core button, or more based on map
|
||||
|
||||
//AI core
|
||||
using = getFromPool(/obj/abstract/screen)
|
||||
using.name = "AI Core"
|
||||
using.icon = 'icons/mob/screen_ai.dmi'
|
||||
using.icon_state = "ai_core"
|
||||
using.screen_loc = ui_ai_core
|
||||
adding += using
|
||||
var/obj/abstract/screen/using
|
||||
|
||||
//Camera list
|
||||
using = getFromPool(/obj/abstract/screen)
|
||||
|
||||
@@ -142,6 +142,24 @@
|
||||
for(var/datum/camerachunk/c in eyeobj.visibleCameraChunks)
|
||||
c.remove(eyeobj)
|
||||
|
||||
/mob/living/silicon/ai/proc/jump_to_area(var/area/A)
|
||||
if(!A)
|
||||
return
|
||||
if(!eyeobj)
|
||||
eyeobj = new(loc)
|
||||
eyeobj.ai = src
|
||||
eyeobj.name = "[name] (AI Eye)"
|
||||
eyeobj.forceMove(loc)
|
||||
var/list/turfs = list()
|
||||
for(var/turf/T in A)
|
||||
turfs.Add(T)
|
||||
var/turf/T = pick(turfs)
|
||||
if(!T)
|
||||
to_chat(src, "<span class='danger'>Nowhere to jump to!</span>")
|
||||
return
|
||||
cameraFollow = null
|
||||
eyeobj.forceMove(T)
|
||||
|
||||
/mob/living/silicon/ai/verb/toggle_acceleration()
|
||||
set category = "AI Commands"
|
||||
set name = "Toggle Camera Acceleration"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 7.2 KiB |
10
maps/_map.dm
10
maps/_map.dm
@@ -149,6 +149,16 @@ var/global/list/accessable_z_levels = list()
|
||||
//Generated by the map datum on roundstart - and added to during the round
|
||||
//This comment is a memorial to balance bickering from a long-gone TGstation - Errorage and Urist
|
||||
|
||||
/datum/map/proc/give_AI_jumps(var/list/L)
|
||||
var/obj/abstract/screen/using
|
||||
using = getFromPool(/obj/abstract/screen)
|
||||
using.name = "AI Core"
|
||||
using.icon = 'icons/mob/screen_ai.dmi'
|
||||
using.icon_state = "ai_core"
|
||||
using.screen_loc = ui_ai_core
|
||||
L += using
|
||||
return L
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -53,6 +53,57 @@
|
||||
security_shuttle.name = "Northeast Station Shuttle"
|
||||
security_shuttle.req_access = list()
|
||||
|
||||
/obj/abstract/screen/Click(location, control, params)
|
||||
if(!usr)
|
||||
return 1
|
||||
|
||||
switch(name)
|
||||
if("Jump Northwest / View Core")
|
||||
if(isAI(usr))
|
||||
var/mob/living/silicon/ai/AI = usr
|
||||
AI.view_core()
|
||||
if("Jump South")
|
||||
if(isAI(usr))
|
||||
var/mob/living/silicon/ai/AI = usr
|
||||
var/area/A = locate(/area/hallway/secondary/exit)
|
||||
AI.jump_to_area(A)
|
||||
if("Jump Northeast")
|
||||
if(isAI(usr))
|
||||
var/mob/living/silicon/ai/AI = usr
|
||||
var/area/A = locate(/area/wreck/engineering) //This is the area used for Snaxi Northeast Bridge
|
||||
AI.jump_to_area(A)
|
||||
|
||||
#define ui_jump_2 "SOUTH+1:[6*PIXEL_MULTIPLIER],WEST:0"
|
||||
#define ui_jump_3 "SOUTH+1:[6*PIXEL_MULTIPLIER],WEST:[32*PIXEL_MULTIPLIER]"
|
||||
/datum/map/active/give_AI_jumps(var/list/L)
|
||||
//do not call parent, we have our own AI core button
|
||||
var/obj/abstract/screen/using
|
||||
//Jump to Core/Northwest
|
||||
using = getFromPool(/obj/abstract/screen)
|
||||
using.name = "Jump Northwest / View Core"
|
||||
using.icon = 'icons/mob/screen_ai.dmi'
|
||||
using.icon_state = "northwest"
|
||||
using.screen_loc = ui_jump_2
|
||||
L += using
|
||||
|
||||
//Jump to Northeast
|
||||
using = getFromPool(/obj/abstract/screen)
|
||||
using.name = "Jump Northeast"
|
||||
using.icon = 'icons/mob/screen_ai.dmi'
|
||||
using.icon_state = "northeast"
|
||||
using.screen_loc = ui_jump_3
|
||||
L += using
|
||||
|
||||
//Jump to South
|
||||
using = getFromPool(/obj/abstract/screen)
|
||||
using.name = "Jump South"
|
||||
using.icon = 'icons/mob/screen_ai.dmi'
|
||||
using.icon_state = "south"
|
||||
using.screen_loc = ui_ai_core //confusing, but this one is on bottom so it views better
|
||||
L += using
|
||||
|
||||
return L
|
||||
|
||||
// Making nodes every 5*5 tiles in a 100*100 radius
|
||||
// This makes (100*100)/(10*10) = 100 nodes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user