|
1 |
| -#define DEFAULT_DOOMSDAY_TIMER 4500 |
2 |
| - |
3 | 1 | //The malf AI action subtype. All malf actions are subtypes of this.
|
4 | 2 | /datum/action/innate/ai
|
5 | 3 | name = "AI Action"
|
|
108 | 106 | if(istype(A, initial(AM.power_type)))
|
109 | 107 | qdel(A)
|
110 | 108 |
|
111 |
| -/datum/module_picker/proc/use(mob/user) |
112 |
| - var/list/dat = list() |
113 |
| - dat += "<B>Select use of processing time: (currently #[processing_time] left.)</B><BR>" |
114 |
| - dat += "<HR>" |
115 |
| - dat += "<B>Install Module:</B><BR>" |
116 |
| - dat += "<I>The number afterwards is the amount of processing time it consumes.</I><BR>" |
| 109 | +/datum/module_picker/proc/use(user as mob) |
| 110 | + var/dat |
| 111 | + dat += {"<B>Select use of processing time: (currently #[processing_time] left.)</B><BR> |
| 112 | + <HR> |
| 113 | + <B>Install Module:</B><BR> |
| 114 | + <I>The number afterwards is the amount of processing time it consumes.</I><BR>"} |
117 | 115 | for(var/datum/AI_Module/large/module in possible_modules)
|
118 |
| - dat += "<A href='byond://?src=\ref[src];[module.mod_pick_name]=1'>[module.module_name]</A><A href='byond://?src=\ref[src];showdesc=[module.mod_pick_name]'>\[?\]</A> ([module.cost])<BR>" |
| 116 | + dat += "<A href='byond://?src=[UID()];[module.mod_pick_name]=1'>[module.module_name]</A><A href='byond://?src=[UID()];showdesc=[module.mod_pick_name]'>\[?\]</A> ([module.cost])<BR>" |
119 | 117 | for(var/datum/AI_Module/small/module in possible_modules)
|
120 |
| - dat += "<A href='byond://?src=\ref[src];[module.mod_pick_name]=1'>[module.module_name]</A><A href='byond://?src=\ref[src];showdesc=[module.mod_pick_name]'>\[?\]</A> ([module.cost])<BR>" |
| 118 | + dat += "<A href='byond://?src=[UID()];[module.mod_pick_name]=1'>[module.module_name]</A><A href='byond://?src=[UID()];showdesc=[module.mod_pick_name]'>\[?\]</A> ([module.cost])<BR>" |
121 | 119 | dat += "<HR>"
|
122 | 120 | if(temp)
|
123 | 121 | dat += "[temp]"
|
124 |
| - var/datum/browser/popup = new(user, "modpicker", "Malf Module Menu") |
125 |
| - popup.set_content(dat.Join()) |
| 122 | + var/datum/browser/popup = new(user, "modpicker", "Malf Module Menu", 400, 500) |
| 123 | + popup.set_content(dat) |
126 | 124 | popup.open()
|
| 125 | + return |
127 | 126 |
|
128 | 127 | /datum/module_picker/Topic(href, href_list)
|
129 | 128 | ..()
|
|
204 | 203 | one_purchase = TRUE
|
205 | 204 | power_type = /datum/action/innate/ai/nuke_station
|
206 | 205 | unlock_text = "<span class='notice'>You slowly, carefully, establish a connection with the on-station self-destruct. You can now activate it at any time.</span>"
|
| 206 | + unlock_sound = 'sound/items/timer.ogg' |
207 | 207 |
|
208 | 208 | /datum/action/innate/ai/nuke_station
|
209 | 209 | name = "Doomsday Device"
|
|
224 | 224 | set_us_up_the_bomb()
|
225 | 225 |
|
226 | 226 | /datum/action/innate/ai/nuke_station/proc/set_us_up_the_bomb()
|
227 |
| - to_chat(src, "<span class='notice'>Nuclear device armed.</span>") |
| 227 | + to_chat(owner_AI, "<span class='notice'>Nuclear device armed.</span>") |
228 | 228 | event_announcement.Announce("Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.", "Anomaly Alert", new_sound = 'sound/AI/aimalf.ogg')
|
229 | 229 | set_security_level("delta")
|
230 |
| - owner_AI.nuking = 1 |
231 |
| - var/obj/machinery/doomsday_device/DOOM = new /obj/machinery/doomsday_device(src) |
| 230 | + owner_AI.nuking = TRUE |
| 231 | + var/obj/machinery/doomsday_device/DOOM = new /obj/machinery/doomsday_device(owner_AI) |
232 | 232 | owner_AI.doomsday_device = DOOM
|
233 | 233 | owner_AI.doomsday_device.start()
|
234 | 234 | for(var/obj/item/pinpointer/point in GLOB.pinpointer_list)
|
|
337 | 337 | one_purchase = TRUE
|
338 | 338 | power_type = /datum/action/innate/ai/lockdown
|
339 | 339 | unlock_text = "<span class='notice'>You upload a sleeper trojan into the door control systems. You can send a signal to set it off at any time.</span>"
|
340 |
| - unlock_sound = 'sound/machines/boltsdown.ogg' |
341 | 340 |
|
342 | 341 | /datum/action/innate/ai/lockdown
|
343 | 342 | name = "Lockdown"
|
|
368 | 367 | one_purchase = TRUE
|
369 | 368 | power_type = /datum/action/innate/ai/destroy_rcds
|
370 | 369 | unlock_text = "<span class='notice'>After some improvisation, you rig your onboard radio to be able to send a signal to detonate all RCDs.</span>"
|
371 |
| - unlock_sound = 'sound/items/timer.ogg' |
372 | 370 |
|
373 | 371 | /datum/action/innate/ai/destroy_rcds
|
374 | 372 | name = "Destroy RCDs"
|
|
409 | 407 | cost = 25
|
410 | 408 | power_type = /datum/action/innate/ai/break_fire_alarms
|
411 | 409 | unlock_text = "<span class='notice'>You replace the thermal sensing capabilities of all fire alarms with a manual override, allowing you to turn them off at will.</span>"
|
412 |
| - unlock_sound = 'goon/sound/machinery/firealarm.ogg' |
413 | 410 |
|
414 | 411 | /datum/action/innate/ai/break_fire_alarms
|
415 | 412 | name = "Override Thermal Sensors"
|
|
435 | 432 | cost = 50
|
436 | 433 | power_type = /datum/action/innate/ai/break_air_alarms
|
437 | 434 | unlock_text = "<span class='notice'>You remove the safety overrides on all air alarms, but you leave the confirm prompts open. You can hit 'Yes' at any time... you bastard.</span>"
|
438 |
| - unlock_sound = 'sound/effects/space_wind.ogg' |
439 | 435 |
|
440 | 436 | /datum/action/innate/ai/break_air_alarms
|
441 | 437 | name = "Override Air Alarm Safeties"
|
|
459 | 455 | cost = 20
|
460 | 456 | power_type = /datum/action/innate/ai/overload_machine
|
461 | 457 | unlock_text = "<span class='notice'>You enable the ability for the station's APCs to direct intense energy into machinery.</span>"
|
462 |
| - unlock_sound = 'sound/effects/comfyfire.ogg' //definitely not comfy, but it's the closest sound to "roaring fire" we have |
463 | 458 |
|
464 | 459 | /datum/action/innate/ai/overload_machine
|
465 | 460 | name = "Overload Machine"
|
|
468 | 463 | uses = 2
|
469 | 464 |
|
470 | 465 | /datum/action/innate/ai/overload_machine/Activate()
|
471 |
| - var/filtered = list() |
472 |
| - for(var/obj/machinery/MF in GLOB.machines) |
473 |
| - filtered += MF |
474 |
| - |
475 |
| - var/select = input("Choose a device to overload", "Overload Machine", null, null) as null|anything in filtered |
| 466 | + var/select = input("Choose a device to overload", "Overload Machine", null, null) as null|anything in GLOB.machines |
476 | 467 | if(!select)
|
477 |
| - adjust_uses(1) |
| 468 | + uses++ |
478 | 469 | return
|
479 | 470 |
|
480 | 471 | var/obj/machinery/M = select
|
481 | 472 | if(istype(M, /obj/machinery))
|
482 | 473 | if(uses > 0)
|
483 |
| - uses -- |
484 | 474 | M.audible_message("<span class='italics'>You hear a loud electrical buzzing sound!</span>")
|
485 | 475 | to_chat(src, "<span class='warning'>Overloading machine circuitry...</span>")
|
486 | 476 | spawn(50)
|
|
491 | 481 | to_chat(src, "<span class='notice'>Out of uses.</span>")
|
492 | 482 | else
|
493 | 483 | to_chat(src, "<span class='notice'>That's not a machine.</span>")
|
494 |
| - adjust_uses(1) |
| 484 | + uses++ |
495 | 485 | return
|
496 | 486 |
|
497 | 487 | //Override Machine: Allows the AI to override a machine, animating it into an angry, living version of itself.
|
|
501 | 491 | description = "Overrides a machine's programming, causing it to rise up and attack everyone except other machines. Four uses."
|
502 | 492 | cost = 30
|
503 | 493 | power_type = /datum/action/innate/ai/override_machine
|
504 |
| - unlock_text = "<span class='notice'>You procure a virus from the Space Dark Web and distribute it to the station's machines.</span>" |
505 |
| - unlock_sound = 'sound/machines/airlock_alien_prying.ogg' |
| 494 | + unlock_text = "<span class='notice'>You procure a virus from the Space Dark Web and prepare to distribute it to the station's machines.</span>" |
506 | 495 |
|
507 | 496 | /datum/action/innate/ai/override_machine
|
508 | 497 | name = "Override Machine"
|
|
511 | 500 | uses = 4
|
512 | 501 |
|
513 | 502 | /datum/action/innate/ai/override_machine/Activate()
|
514 |
| - var/filtered = list() |
515 |
| - for(var/obj/machinery/MF in GLOB.machines) |
516 |
| - filtered += MF |
517 |
| - |
518 |
| - var/select = input("Choose a device to override", "Override Machine", null, null) as null|anything in filtered |
| 503 | + var/select = input("Choose a device to override", "Override Machine", null, null) as null|anything in GLOB.machines |
519 | 504 | if(!select)
|
520 |
| - adjust_uses(1) |
| 505 | + uses++ |
521 | 506 | return
|
522 | 507 |
|
523 | 508 | var/obj/machinery/M = select
|
524 | 509 | if(istype(M, /obj/machinery))
|
525 | 510 | if(!M.can_be_overridden())
|
526 | 511 | to_chat(src, "Can't override this device.")
|
527 |
| - adjust_uses(1) |
| 512 | + uses++ |
528 | 513 | return
|
529 | 514 | else if(uses > 0)
|
530 |
| - uses -- |
531 | 515 | M.audible_message("<span class='italics'>You hear a loud electrical buzzing sound!</span>")
|
532 | 516 | to_chat(src, "<span class='warning'>Reprogramming machine behaviour...</span>")
|
533 | 517 | spawn(50)
|
|
537 | 521 | to_chat(src, "<span class='notice'>Out of uses.</span>")
|
538 | 522 | else
|
539 | 523 | to_chat(src, "<span class='notice'>That's not a machine.</span>")
|
540 |
| - adjust_uses(1) |
| 524 | + uses++ |
541 | 525 | return
|
542 | 526 |
|
543 | 527 | //Robotic Factory: Places a large machine that converts humans that go through it into cyborgs. Unlocking this ability removes shunting.
|
|
548 | 532 | cost = 100
|
549 | 533 | one_purchase = TRUE
|
550 | 534 | power_type = /datum/action/innate/ai/place_transformer
|
551 |
| - unlock_text = "<span class='notice'>You make contact with Space Amazon and request a robotics factory for delivery.</span>" |
| 535 | + unlock_text = "<span class='notice'>You prepare a robotics factory for deployment.</span>" |
552 | 536 | unlock_sound = 'sound/machines/ping.ogg'
|
553 | 537 |
|
554 | 538 | /datum/action/innate/ai/place_transformer
|
|
622 | 606 | cost = 15
|
623 | 607 | power_type = /datum/action/innate/ai/blackout
|
624 | 608 | unlock_text = "<span class='notice'>You hook into the powernet and route bonus power towards the station's lighting.</span>"
|
625 |
| - unlock_sound = "sparks" |
626 | 609 |
|
627 | 610 | /datum/action/innate/ai/blackout
|
628 | 611 | name = "Blackout"
|
|
648 | 631 | one_purchase = TRUE
|
649 | 632 | power_type = /datum/action/innate/ai/reactivate_cameras
|
650 | 633 | unlock_text = "<span class='notice'>You deploy nanomachines to the cameranet.</span>"
|
651 |
| - unlock_sound = 'sound/items/wirecutter.ogg' |
652 | 634 |
|
653 | 635 | /datum/action/innate/ai/reactivate_cameras
|
654 | 636 | name = "Reactivate Cameras"
|
|
677 | 659 | to_chat(owner, "<span class='notice'>Diagnostic complete! Cameras reactivated: <b>[fixed_cameras]</b>. Reactivations remaining: <b>[uses]</b>.</span>")
|
678 | 660 | owner.playsound_local(owner, 'sound/items/wirecutter.ogg', 50, 0)
|
679 | 661 | adjust_uses(0, TRUE) //Checks the uses remaining
|
680 |
| - if(uses) |
| 662 | + if(src && uses) //Not sure if not having src here would cause a runtime, so it's here to be safe |
681 | 663 | desc = "[initial(desc)] There are [uses] reactivations remaining."
|
| 664 | + owner_AI.update_action_buttons() |
682 | 665 |
|
683 | 666 | //Upgrade Camera Network: EMP-proofs all cameras, in addition to giving them X-ray vision.
|
684 | 667 | /datum/AI_Module/large/upgrade_cameras
|
|
731 | 714 | if(AI.eyeobj)
|
732 | 715 | AI.eyeobj.relay_speech = TRUE
|
733 | 716 |
|
734 |
| -#undef DEFAULT_DOOMSDAY_TIMER |
0 commit comments