Skip to content

Commit

Permalink
Bane AI (tgstation#57771)
Browse files Browse the repository at this point in the history
We take Gotham from the corrupt! The rich! The oppressors of generations who have kept you down with myths of opportunity, and we give it back to you...the people...Gotham is yours. None shall interfere, do as you please!
  • Loading branch information
tralezab authored Mar 25, 2021
1 parent f9c5f10 commit e6be56c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/__DEFINES/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,7 @@
#define COMMAND_FETCH "Fetch"
#define COMMAND_ATTACK "Attack"
#define COMMAND_DIE "Play Dead"

///bane ai
#define BB_BANE_BATMAN "BB_bane_batman"
//yep thats it
9 changes: 9 additions & 0 deletions code/datums/ai/bane/bane_behaviors.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

/datum/ai_behavior/break_spine/bane
target_key = BB_BANE_BATMAN

/datum/ai_behavior/break_spine/bane/finish_action(datum/ai_controller/controller, succeeded)
var/list/bane_quotes = strings("bane.json", "bane")
var/mob/living/bane = controller.pawn
bane.say(pick(bane_quotes))
. = ..()
34 changes: 34 additions & 0 deletions code/datums/ai/bane/bane_controller.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
You yourself fought the decadence of Gotham for years with all your strength, all your resources, all your moral authority.
And the only victory you achieved was a lie. Now you understand Gotham is beyond saving, and must be allowed to die.
*/
/datum/ai_controller/bane
movement_delay = 0.4 SECONDS
blackboard = list(BB_BANE_BATMAN = null)

/datum/ai_controller/bane/TryPossessPawn(atom/new_pawn)
if(!isliving(new_pawn))
return AI_CONTROLLER_INCOMPATIBLE
return ..() //Run parent at end

/datum/ai_controller/bane/able_to_run()
var/mob/living/living_pawn = pawn
if(IS_DEAD_OR_INCAP(living_pawn))
return FALSE
return ..()

/datum/ai_controller/bane/SelectBehaviors(delta_time)
current_behaviors = list()
var/mob/living/batman = blackboard[BB_BANE_BATMAN]
if(!batman)
for(var/mob/living/possibly_the_dark_knight in oview(7, pawn))
if(IS_DEAD_OR_INCAP(possibly_the_dark_knight)) //I HAVE BROKEN THE BAT
continue
blackboard[BB_BANE_BATMAN] = possibly_the_dark_knight
batman = possibly_the_dark_knight
break
if(batman)
current_movement_target = batman
current_behaviors += GET_AI_BEHAVIOR(/datum/ai_behavior/break_spine/bane)


22 changes: 22 additions & 0 deletions strings/bane.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"bane": [
"They expect one of us in the wreckage, brother.",
"The fire rises.",
"Peace has cost you your strength. Victory has defeated you.",
"Do you feel in charge?",
"No one cared who I was ‘til I put on the mask.",
"Time to go mobile.",
"Theatricality and deception are powerful agents to the uninitiated.",
"So you came back to die with your city?",
"We come here not as conquerors but as liberators, to return control of this city to the people.",
"The powerful will be ripped from their decadent nests, and cast out into the cold world that we know and endure.",
"It would be extremely painful.",
"As I terrorize Gotham I will feed its people hope to poison their souls.",
"The Bomb is armed. The bomb is mobile. The identity of the triggerman is a mystery.",
"You think darkness is your ally. But you merely adopted the dark.",
"The shadows betray you, because they belong to me...",
"I will show you where I've made my home while preparing to bring justice.",
"I will break you.",
"Your punishment must be more severe."
]
}
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@
#include "code\datums\ai\_item_behaviors.dm"
#include "code\datums\ai\generic_actions.dm"
#include "code\datums\ai\telegraph_effects.dm"
#include "code\datums\ai\bane\bane_behaviors.dm"
#include "code\datums\ai\bane\bane_controller.dm"
#include "code\datums\ai\dog\dog_behaviors.dm"
#include "code\datums\ai\dog\dog_controller.dm"
#include "code\datums\ai\hauntium\haunted_controller.dm"
Expand Down

0 comments on commit e6be56c

Please sign in to comment.