|
166 | 166 | A.playsound_local(A, AM.unlock_sound, 50, 0)
|
167 | 167 | else //Adding uses to an existing module
|
168 | 168 | action.uses += initial(action.uses)
|
| 169 | + action.desc = "[initial(action.desc)] It has [action.uses] use\s remaining." |
| 170 | + action.UpdateButtonIcon() |
169 | 171 | temp = "Additional use[action.uses > 1 ? "s" : ""] added to [action.name]!"
|
170 | 172 | processing_time -= AM.cost
|
171 | 173 |
|
|
460 | 462 | desc = "Overheats a machine, causing a small explosion after a short time."
|
461 | 463 | button_icon_state = "overload_machine"
|
462 | 464 | uses = 2
|
| 465 | + auto_use_uses = FALSE |
| 466 | + |
| 467 | +/datum/action/innate/ai/overload_machine/New() |
| 468 | + ..() |
| 469 | + desc = "[desc] It has [uses] use\s remaining." |
| 470 | + button.desc = desc |
463 | 471 |
|
464 | 472 | /datum/action/innate/ai/overload_machine/Activate()
|
465 | 473 | var/select = input("Choose a device to overload", "Overload Machine", null, null) as null|anything in GLOB.machines
|
466 | 474 | if(!select)
|
467 |
| - uses++ |
468 | 475 | return
|
469 | 476 |
|
470 | 477 | var/obj/machinery/M = select
|
471 | 478 | if(istype(M, /obj/machinery))
|
472 | 479 | if(uses > 0)
|
| 480 | + adjust_uses(-1) |
| 481 | + if(src && uses) //Not sure if not having src here would cause a runtime, so it's here to be safe |
| 482 | + desc = "[initial(desc)] It has [uses] use\s remaining." |
| 483 | + UpdateButtonIcon() |
473 | 484 | M.audible_message("<span class='italics'>You hear a loud electrical buzzing sound!</span>")
|
474 | 485 | to_chat(owner, "<span class='warning'>Overloading machine circuitry...</span>")
|
475 | 486 | spawn(50)
|
|
480 | 491 | to_chat(owner, "<span class='notice'>Out of uses.</span>")
|
481 | 492 | else
|
482 | 493 | to_chat(owner, "<span class='notice'>That's not a machine.</span>")
|
483 |
| - uses++ |
484 | 494 | return
|
485 | 495 |
|
486 | 496 | //Override Machine: Allows the AI to override a machine, animating it into an angry, living version of itself.
|
|
497 | 507 | desc = "Animates a targeted machine, causing it to attack anyone nearby."
|
498 | 508 | button_icon_state = "override_machine"
|
499 | 509 | uses = 4
|
| 510 | + auto_use_uses = FALSE |
| 511 | + |
| 512 | +/datum/action/innate/ai/override_machine/New() |
| 513 | + ..() |
| 514 | + desc = "[desc] It has [uses] use\s remaining." |
| 515 | + button.desc = desc |
500 | 516 |
|
501 | 517 | /datum/action/innate/ai/override_machine/Activate()
|
502 | 518 | var/select = input("Choose a device to override", "Override Machine", null, null) as null|anything in GLOB.machines
|
503 | 519 | if(!select)
|
504 |
| - uses++ |
505 | 520 | return
|
506 | 521 |
|
507 | 522 | var/obj/machinery/M = select
|
508 | 523 | if(istype(M, /obj/machinery))
|
509 | 524 | if(!M.can_be_overridden())
|
510 | 525 | to_chat(owner, "Can't override this device.")
|
511 |
| - uses++ |
512 | 526 | return
|
513 | 527 | else if(uses > 0)
|
| 528 | + adjust_uses(-1) |
| 529 | + if(src && uses) //Not sure if not having src here would cause a runtime, so it's here to be safe |
| 530 | + desc = "[initial(desc)] It has [uses] use\s remaining." |
| 531 | + UpdateButtonIcon() |
514 | 532 | M.audible_message("<span class='italics'>You hear a loud electrical buzzing sound!</span>")
|
515 | 533 | to_chat(owner, "<span class='warning'>Reprogramming machine behaviour...</span>")
|
516 | 534 | spawn(50)
|
|
520 | 538 | to_chat(owner, "<span class='notice'>Out of uses.</span>")
|
521 | 539 | else
|
522 | 540 | to_chat(owner, "<span class='notice'>That's not a machine.</span>")
|
523 |
| - uses++ |
524 | 541 | return
|
525 | 542 |
|
526 | 543 | //Robotic Factory: Places a large machine that converts humans that go through it into cyborgs. Unlocking this ability removes shunting.
|
|
608 | 625 |
|
609 | 626 | /datum/action/innate/ai/blackout
|
610 | 627 | name = "Blackout"
|
611 |
| - desc = "Overloads lights across the station." |
| 628 | + desc = "Overloads random lights across the station." |
612 | 629 | button_icon_state = "blackout"
|
613 | 630 | uses = 3
|
| 631 | + auto_use_uses = FALSE |
| 632 | + |
| 633 | +/datum/action/innate/ai/blackout/New() |
| 634 | + ..() |
| 635 | + desc = "[desc] It has [uses] use\s remaining." |
| 636 | + button.desc = desc |
614 | 637 |
|
615 | 638 | /datum/action/innate/ai/blackout/Activate()
|
616 | 639 | for(var/obj/machinery/power/apc/apc in GLOB.apcs)
|
|
620 | 643 | apc.overload++
|
621 | 644 | to_chat(owner, "<span class='notice'>Overcurrent applied to the powernet.</span>")
|
622 | 645 | owner.playsound_local(owner, "sparks", 50, 0)
|
| 646 | + adjust_uses(-1) |
| 647 | + if(src && uses) //Not sure if not having src here would cause a runtime, so it's here to be safe |
| 648 | + desc = "[initial(desc)] It has [uses] use\s remaining." |
| 649 | + UpdateButtonIcon() |
623 | 650 |
|
624 | 651 | //Reactivate Camera Network: Reactivates up to 30 cameras across the station.
|
625 | 652 | /datum/AI_Module/small/reactivate_cameras
|
|
641 | 668 |
|
642 | 669 | /datum/action/innate/ai/reactivate_cameras/New()
|
643 | 670 | ..()
|
644 |
| - desc = "[desc] There are 30 reactivations remaining." |
| 671 | + desc = "[desc] It has [uses] use\s remaining." |
645 | 672 | button.desc = desc
|
646 | 673 |
|
647 | 674 | /datum/action/innate/ai/reactivate_cameras/Activate()
|
|
659 | 686 | owner.playsound_local(owner, 'sound/items/wirecutter.ogg', 50, 0)
|
660 | 687 | adjust_uses(0, TRUE) //Checks the uses remaining
|
661 | 688 | if(src && uses) //Not sure if not having src here would cause a runtime, so it's here to be safe
|
662 |
| - desc = "[initial(desc)] There are [uses] reactivations remaining." |
663 |
| - owner_AI.update_action_buttons() |
| 689 | + desc = "[initial(desc)] It has [uses] use\s remaining." |
| 690 | + UpdateButtonIcon() |
664 | 691 |
|
665 | 692 | //Upgrade Camera Network: EMP-proofs all cameras, in addition to giving them X-ray vision.
|
666 | 693 | /datum/AI_Module/large/upgrade_cameras
|
|
0 commit comments